diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-07-17 17:28:23 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-07-18 20:23:43 +0200 |
commit | 449b3e543c6bbc1e9d539ca2298cc5a191b3233a (patch) | |
tree | 2729436120e89a466f7f797dd8dfa0104c19067a | |
parent | d811d8d0fdf76f73b9c4108094bafcb72becec5d (diff) | |
download | mkinitcpio-449b3e543c6bbc1e9d539ca2298cc5a191b3233a.tar.gz mkinitcpio-449b3e543c6bbc1e9d539ca2298cc5a191b3233a.tar.xz |
init: rely on ConditionPathIsReadWrite for root fsck flag0.15.0
Add an annoying warning in case the root device is fsck'd and about to
be mounted RO.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | init_functions | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/init_functions b/init_functions index f356a14..474d6fa 100644 --- a/init_functions +++ b/init_functions @@ -205,9 +205,8 @@ fsck_root() { fsckret=$? if [ -n "$fsckret" ] && [ "$fsckret" -ne 255 ]; then - if [ "$fsckret" -eq 0 ] || bitfield_has_bit $fsckret 1; then - echo "$fsckret" > /run/initramfs/root-fsck - elif bitfield_has_bit "$fsckret" 4; then + # handle error conditions; do nothing on success. + if bitfield_has_bit "$fsckret" 4; then err "Bailing out. Run 'fsck $root' manually" printf '%s\n' \ "********** FILESYSTEM CHECK FAILED **********" \ @@ -239,6 +238,17 @@ fsck_root() { elif bitfield_has_bit "$fsckret" 128; then err "fatal error invoking fsck" fi + + # ensure that root is going to be mounted rw. Otherwise, systemd + # might fsck the device again. Annoy the user so that they fix this. + if [ "${rwopt:-ro}" != 'rw' ]; then + echo "********************** WARNING **********************" + echo "* *" + echo "* The root device is not configured to be mounted *" + echo "* read-write! It may be fsck'd again later. *" + echo "* *" + echo "*****************************************************" + fi fi } |