X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Finitscripts%2Finit.d%2Fpartresize;h=d4e4db268528ffa99b4ba4fef542df9c67592a70;hb=0037264780e516ef1cd85c1a73b178097b3201d6;hp=9c9a60998d4636bb17541fe2bf00f85b528a4184;hpb=a6d0d790ebe2c72aa85b83961ab1915fec14ab20;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/src/initscripts/init.d/partresize b/src/initscripts/init.d/partresize index 9c9a60998..d4e4db268 100644 --- a/src/initscripts/init.d/partresize +++ b/src/initscripts/init.d/partresize @@ -2,11 +2,11 @@ ######################################################################## # Begin $rc_base/init.d/partresize # -# Description : Resize the /var partition to the drivesize +# Description : Resize the root partition to the drivesize # # Authors : Arne Fitzenreiter - arne_f@ipfire.org # -# Version : 1.00 +# Version : 1.02 # # Notes : # @@ -18,20 +18,33 @@ 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 + + boot_mesg "Create /etc/mtab..." + > /etc/mtab + mount -f / || failed=1 + (exit ${failed}) + evaluate_retval # Detect device ROOT=`mount | grep -m1 " / " | cut -d" " -f1`; - DRV=${ROOT::`expr length $ROOT`-1} + if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then + DRV=${ROOT::`expr length $ROOT`-2} + else + DRV=${ROOT::`expr length $ROOT`-1} + fi - boot_mesg "Change Partition 4 to all free space ..." - echo -e 'd\n4\nn\np\n4\n\n\nw\nq\n' | fdisk ${DRV} + boot_mesg "Change Partition ${DRV}3 to all free space ..." + echo -e 'd\n3\nn\np\n3\n\n\nw\nq\n' | fdisk ${DRV} # Erase symlink, it should run only once rm -f /etc/rc.d/rcsysinit.d/S25partresize boot_mesg "Rebooting ..." + sync + mount -o remount,ro / > /dev/null reboot -f ;; @@ -42,4 +55,3 @@ case "${1}" in esac # End $rc_base/init.d/partresize -