This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via a6d0d790ebe2c72aa85b83961ab1915fec14ab20 (commit)
from 6333b4e7257cfeb79a381de1f62bdc9a20070eaf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a6d0d790ebe2c72aa85b83961ab1915fec14ab20
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Fri Jan 20 08:02:31 2012 +0100
flash-image: add automatic resizing /var partition at first boot.
-----------------------------------------------------------------------
Summary of changes:
config/rootfiles/common/armv5tel/initscripts | 2 +
config/rootfiles/common/i586/initscripts | 2 +
lfs/flash-images | 19 ++++++++++-
src/initscripts/init.d/fsresize | 46 ++++++++++++++++++++++++++
src/initscripts/init.d/partresize | 45 +++++++++++++++++++++++++
5 files changed, 113 insertions(+), 1 deletions(-)
create mode 100644 src/initscripts/init.d/fsresize
create mode 100644 src/initscripts/init.d/partresize
Difference in files:
diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts
index 22a7c13..a7f0fed 100644
--- a/config/rootfiles/common/armv5tel/initscripts
+++ b/config/rootfiles/common/armv5tel/initscripts
@@ -93,6 +93,8 @@ etc/rc.d/init.d/networking/red.up/99-pakfire-update
etc/rc.d/init.d/ntp
#etc/rc.d/init.d/nut
#etc/rc.d/init.d/openvmtools
+etc/rc.d/init.d/partresize
+etc/rc.d/init.d/fsresize
#etc/rc.d/init.d/portmap
#etc/rc.d/init.d/postfix
#etc/rc.d/init.d/pound
diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts
index 65fa0cd..91e3308 100644
--- a/config/rootfiles/common/i586/initscripts
+++ b/config/rootfiles/common/i586/initscripts
@@ -94,6 +94,8 @@ etc/rc.d/init.d/networking/red.up/99-pakfire-update
etc/rc.d/init.d/ntp
#etc/rc.d/init.d/nut
#etc/rc.d/init.d/openvmtools
+etc/rc.d/init.d/partresize
+etc/rc.d/init.d/fsresize
#etc/rc.d/init.d/portmap
#etc/rc.d/init.d/postfix
#etc/rc.d/init.d/pound
diff --git a/lfs/flash-images b/lfs/flash-images
index 7888423..0b07704 100644
--- a/lfs/flash-images
+++ b/lfs/flash-images
@@ -111,6 +111,11 @@ ifneq "$(MACHINE_TYPE)" "arm"
sed -i -e "s|ROOT|UUID=$$(blkid -sUUID $(IMGroot) | cut -d'"' -f2)|g" $(MNThdd)/boot/grub/grub.conf
ln -s grub.conf $(MNThdd)/boot/grub/menu.lst
+ # Setup symlink for partresize at first boot...
+ ln -sf ../init.d/partresize $(MNThdd)/etc/rc.d/rcsysinit.d/S25partresize
+ # Setup symlink for fsresize at second boot...
+ ln -sf ../init.d/fsresize $(MNThdd)/etc/rc.d/rcsysinit.d/S26fsresize
+
# Copy grub files manually
cp -f $(MNThdd)/usr/share/grub/i386-pc/* $(MNThdd)/boot/grub/
endif
@@ -123,12 +128,18 @@ endif
umount $(MNThdd)/var
umount $(MNThdd)
- # zerofree the ext3 images to get better compression
+ # zerofree the ext2 images to get better compression
ifneq "$(MACHINE_TYPE)" "arm"
zerofree $(IMGboot)
+ -fsck.ext2 -f -y $(IMGboot)
+ fsck.ext2 -f -y $(IMGboot)
endif
zerofree $(IMGroot)
+ -fsck.ext2 -f -y $(IMGroot)
+ fsck.ext2 -f -y $(IMGroot)
zerofree $(IMGvar)
+ -fsck.ext2 -f -y $(IMGvar)
+ fsck.ext2 -f -y $(IMGvar)
# Cat to an image
cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinst)
@@ -175,9 +186,15 @@ endif
# zerofree the ext3 images to get better compression
ifneq "$(MACHINE_TYPE)" "arm"
zerofree $(IMGboot)
+ -fsck.ext2 -f -y $(IMGboot)
+ fsck.ext2 -f -y $(IMGboot)
endif
zerofree $(IMGroot)
+ -fsck.ext2 -f -y $(IMGroot)
+ fsck.ext2 -f -y $(IMGroot)
zerofree $(IMGvar)
+ -fsck.ext2 -f -y $(IMGvar)
+ fsck.ext2 -f -y $(IMGvar)
# Cat to an image
cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinsts)
diff --git a/src/initscripts/init.d/fsresize b/src/initscripts/init.d/fsresize
new file mode 100644
index 0000000..b1af720
--- /dev/null
+++ b/src/initscripts/init.d/fsresize
@@ -0,0 +1,46 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/fsresize
+#
+# Description : Resize the /var filesystem
+#
+# Authors : Arne Fitzenreiter - arne_f(a)ipfire.org
+#
+# Version : 1.00
+#
+# Notes :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+ start)
+ boot_mesg "Autoresize /var partition to use the whole drive ..."
+
+ # Ensure that / is writeable
+ mount
+
+ # Detect device
+ ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
+ DRV=${ROOT::`expr length $ROOT`-1}
+ boot_mesg " * check filesystem on ${DRV}4 before resize ..."
+ fsck -f ${DRV}4
+
+ boot_mesg " * resize ${DRV}4 ..."
+ resize2fs -p ${DRV}4
+ evaluate_retval
+
+ # Erase symlink, it should run only once
+ rm -f /etc/rc.d/rcsysinit.d/S26fsresize
+
+ exit 0;
+ ;;
+ *)
+ echo "Usage: ${0} {start}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/26fsresize
diff --git a/src/initscripts/init.d/partresize b/src/initscripts/init.d/partresize
new file mode 100644
index 0000000..9c9a609
--- /dev/null
+++ b/src/initscripts/init.d/partresize
@@ -0,0 +1,45 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/partresize
+#
+# Description : Resize the /var partition to the drivesize
+#
+# Authors : Arne Fitzenreiter - arne_f(a)ipfire.org
+#
+# Version : 1.00
+#
+# Notes :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+ start)
+
+ # Ensure that / is writeable
+ mount -o remount,rw /
+
+ # Detect device
+ ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
+ DRV=${ROOT::`expr length $ROOT`-1}
+
+ boot_mesg "Change Partition 4 to all free space ..."
+ echo -e 'd\n4\nn\np\n4\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 ..."
+ reboot -f
+
+ ;;
+ *)
+ echo "Usage: ${0} {start}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/partresize
+
hooks/post-receive
--
IPFire 2.x development tree