summaryrefslogtreecommitdiff
path: root/scripts
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
parentf6c4763b4e6a4314c6d6d06c5f3721ad2ab4af2b (diff)
downloadvyatta-cfg-system-8270392c9b5801e8ec9f54fb07cb9a282add390d.tar.gz
vyatta-cfg-system-8270392c9b5801e8ec9f54fb07cb9a282add390d.zip
add read-write union install mechanism
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-system22
-rwxr-xr-xscripts/vyatta-grub-setup2
2 files changed, 22 insertions, 2 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
diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup
index 4ac8cd92..c7bfbcd0 100755
--- a/scripts/vyatta-grub-setup
+++ b/scripts/vyatta-grub-setup
@@ -88,7 +88,7 @@ else
fi
if eval "$UNION"; then
- GRUB_OPTIONS="boot=live live-media-path=/boot/$livedir module=$livedir quiet persistent noautologin nonetworking nouser hostname=vyatta"
+ GRUB_OPTIONS="boot=live live-media-path=/boot/$livedir persistent-path=/boot/$livedir quiet persistent noautologin nonetworking nouser hostname=vyatta"
union_xen_kernel_version=$(ls $ROOTFSDIR/boot/$livedir/vmlinuz*-xen* \
2>/dev/null \
| awk -F/ '{ print $6 }' \