summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2009-04-13 19:47:10 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2009-04-13 19:47:10 -0700
commit8270392c9b5801e8ec9f54fb07cb9a282add390d (patch)
treeebef9052f8bf5088518c8684a6ccf20f3adfc3bd /scripts/install-system
parentf6c4763b4e6a4314c6d6d06c5f3721ad2ab4af2b (diff)
downloadvyatta-cfg-system-8270392c9b5801e8ec9f54fb07cb9a282add390d.tar.gz
vyatta-cfg-system-8270392c9b5801e8ec9f54fb07cb9a282add390d.zip
add read-write union install mechanism
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system22
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 2e821397..7675ec38 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -828,7 +828,10 @@ install_root_filesystem () {
progress_indicator stop
echo "OK"
else
+ # UNION install
mkdir -p $rootfsdir/boot/$version
+ ## make dir for backing store
+ mkdir -p $rootfsdir/boot/$version/live-rw
if [ -f /live/image/live/filesystem.squashfs ]; then
echo Copying squashfs image...
cp /live/image/live/filesystem.squashfs $rootfsdir/boot/$version/$version.squashfs
@@ -1366,13 +1369,30 @@ if [ -e $MDADM_CONFIG_FILE ]; then
fi
fi
+postinst_root=$rootfsdir
+if [ -n "$UNION" ]; then
+ # set up root for postinst
+ postinst_root=/mnt/postinst_root
+ version=$(egrep -i version /opt/vyatta/etc/version | awk '{ print $3 }')
+ rw_dir=$rootfsdir/boot/$version/live-rw
+
+ mkdir -p $postinst_root /mnt/squashfs
+ mount -o loop,ro -t squashfs \
+ $rootfsdir/boot/$version/$version.squashfs /mnt/squashfs
+ mount -t unionfs -o noatime,dirs=$rw_dir=rw:/mnt/squashfs=ro unionfs \
+ $postinst_root
+fi
# postinst hook
if [ -e /opt/vyatta/etc/install-system/postinst ]; then
echo "running post-install script"
- /opt/vyatta/etc/install-system/postinst $rootfsdir >>$INSTALL_LOG
+ /opt/vyatta/etc/install-system/postinst $postinst_root >>$INSTALL_LOG
fi
+if [ -n "$UNION" ]; then
+ umount $postinst_root
+ umount /mnt/squashfs
+fi
cp $INSTALL_LOG $rootfsdir/install.log