/bin/mkdir /sysroot
/bin/mkdir /opt
-#Find devices
ROOTFS=`/sbin/blkid -L rootfs`
if [ x$ROOTFS = "x" ]
then
DATAFS=`/sbin/blkid -t PARTLABEL=system-data -o device`
fi
-#Check and mount devices
-FIRSTBOOT=1
+NEED_RESIZEFS=1
if [ x"$DATAFS" != "x" ]
then
/sbin/fsck -y $DATAFS
/bin/mount $DATAFS /opt
- if [ -e /opt/var/.fsck_done ]
+ if [ -e /opt/var/.resizefs_done ]
then
- FIRSTBOOT=0
+ NEED_RESIZEFS=0
else
- echo " " > /opt/var/.fsck_done
+ echo " " > /opt/var/.resizefs_done
/bin/umount /opt
fi
fi
if [ x$ROOTFS != "x" ]
then
- if [ "$FIRSTBOOT" = "1" ]
+ if [ "$NEED_RESIZEFS" = "1" ]
then
/sbin/resize2fs -f $ROOTFS
fi
if [ x"$DATAFS" != "x" ]
then
- if [ "$FIRSTBOOT" = "1" ]
+ if [ "$NEED_RESIZEFS" = "1" ]
then
/sbin/resize2fs -f $DATAFS
+ /sbin/fsck -y $DATAFS
/bin/mount $DATAFS /sysroot/opt
else
/bin/mount -M /opt /sysroot/opt
if [ x$MODULES != "x" ]
then
- if [ "$FIRSTBOOT" = "1" ]
+ if [ "$NEED_RESIZEFS" = "1" ]
then
/sbin/resize2fs -f $MODULES
fi