From fbb2ebd68446a51c4d6d543210a1f53b7fcd73dc Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Fri, 20 Jan 2012 21:06:45 +0100 Subject: [PATCH] flash-image: improve mount/dismount at partition resize. fix missing parameters at mount. remount / ro before reboot to leave a clean rootfs. --- src/initscripts/init.d/fsresize | 9 +++++---- src/initscripts/init.d/partresize | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/initscripts/init.d/fsresize b/src/initscripts/init.d/fsresize index b1af720b58..0afe77900c 100644 --- a/src/initscripts/init.d/fsresize +++ b/src/initscripts/init.d/fsresize @@ -17,11 +17,11 @@ case "${1}" in start) - boot_mesg "Autoresize /var partition to use the whole drive ..." - - # Ensure that / is writeable - mount + boot_mesg "Mounting root file system in read/write mode ..." + mount -o remount,rw / > /dev/null + evaluate_retval + boot_mesg "Autoresize /var partition to use the whole drive ..." # Detect device ROOT=`mount | grep -m1 " / " | cut -d" " -f1`; DRV=${ROOT::`expr length $ROOT`-1} @@ -34,6 +34,7 @@ case "${1}" in # Erase symlink, it should run only once rm -f /etc/rc.d/rcsysinit.d/S26fsresize + sync exit 0; ;; diff --git a/src/initscripts/init.d/partresize b/src/initscripts/init.d/partresize index 9c9a60998d..8eddc46c37 100644 --- a/src/initscripts/init.d/partresize +++ b/src/initscripts/init.d/partresize @@ -18,8 +18,9 @@ case "${1}" in start) - # Ensure that / is writeable - mount -o remount,rw / + boot_mesg "Mounting root file system in read/write mode ..." + mount -o remount,rw / > /dev/null + evaluate_retval # Detect device ROOT=`mount | grep -m1 " / " | cut -d" " -f1`; @@ -32,6 +33,8 @@ case "${1}" in rm -f /etc/rc.d/rcsysinit.d/S25partresize boot_mesg "Rebooting ..." + sync + mount -o remount,ro / > /dev/null reboot -f ;; -- 2.39.5