Use forced fsck in mountroot.sh only if it is supported (Closes: #686895)
Dmitry Bogatov
5 years ago
5 | 5 |
* Update path to `nologin' file in `bootmisc.sh' script (Closes: #743743)
|
6 | 6 |
* Fix mounting of /proc on Hurd (Closes: #814735)
|
7 | 7 |
* Fix /sbin/poweroff alternative on Hurd (Closes: #825975)
|
|
8 |
* Use forced fsck in mountroot.sh only if it is supported (Closes: #686895)
|
8 | 9 |
|
9 | 10 |
-- Dmitry Bogatov <KAction@debian.org> Thu, 27 Dec 2018 10:06:16 +0000
|
10 | 11 |
|
20 | 20 |
|
21 | 21 |
. /lib/lsb/init-functions
|
22 | 22 |
. /lib/init/mount-functions.sh
|
|
23 |
|
|
24 |
_want_force_fsck () {
|
|
25 |
case "$(findmnt -n -o FSTYPE /)" in
|
|
26 |
# Only ext* file systems support `-f' option to fsck. See #686895
|
|
27 |
(ext*)
|
|
28 |
[ -f /forcefsck ] || grep -q -s -w -i "forcefsck" /proc/cmdline
|
|
29 |
;;
|
|
30 |
(*)
|
|
31 |
return 1
|
|
32 |
;;
|
|
33 |
esac
|
|
34 |
}
|
23 | 35 |
|
24 | 36 |
do_start () {
|
25 | 37 |
# Trap SIGINT so that we can handle user interrupt of fsck.
|
|
202 | 214 |
#
|
203 | 215 |
if [ "$rootcheck" = yes ]
|
204 | 216 |
then
|
205 | |
if [ -f /forcefsck ] || grep -q -s -w -i "forcefsck" /proc/cmdline
|
206 | |
then
|
207 | |
force="-f"
|
208 | |
else
|
209 | |
force=""
|
210 | |
fi
|
|
217 |
force=""
|
|
218 |
_want_force_fsck && force="-f"
|
211 | 219 |
|
212 | 220 |
if [ "$FSCKFIX" = yes ]
|
213 | 221 |
then
|