]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/initscripts/init.d/partresize
Merge branch 'iptables-upnpfw' into core67-merge
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / partresize
CommitLineData
a6d0d790
AF
1#!/bin/sh
2########################################################################
3# Begin $rc_base/init.d/partresize
4#
3e011c27 5# Description : Resize the root partition to the drivesize
a6d0d790
AF
6#
7# Authors : Arne Fitzenreiter - arne_f@ipfire.org
8#
3e011c27 9# Version : 1.01
a6d0d790
AF
10#
11# Notes :
12#
13########################################################################
14
15. /etc/sysconfig/rc
16. ${rc_functions}
17
18case "${1}" in
19 start)
20
fbb2ebd6
AF
21 boot_mesg "Mounting root file system in read/write mode ..."
22 mount -o remount,rw / > /dev/null
23 evaluate_retval
a6d0d790
AF
24
25 # Detect device
26 ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
ac6945db
AF
27 if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then
28 DRV=${ROOT::`expr length $ROOT`-2}
29 else
30 DRV=${ROOT::`expr length $ROOT`-1}
31 fi
a6d0d790 32
da23c4be 33 boot_mesg "Change Partition ${DRV}3 to all free space ..."
3e011c27 34 echo -e 'd\n3\nn\np\n3\n\n\nw\nq\n' | fdisk ${DRV}
a6d0d790
AF
35
36 # Erase symlink, it should run only once
37 rm -f /etc/rc.d/rcsysinit.d/S25partresize
38
39 boot_mesg "Rebooting ..."
fbb2ebd6
AF
40 sync
41 mount -o remount,ro / > /dev/null
a6d0d790
AF
42 reboot -f
43
44 ;;
45 *)
46 echo "Usage: ${0} {start}"
47 exit 1
48 ;;
49esac
50
51# End $rc_base/init.d/partresize
52