summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas Jepp <tom@incyber.eu>2016-02-03 16:49:35 +0000
committerThomas Jepp <tom@incyber.eu>2016-02-03 16:49:35 +0000
commitac29f8f49a1ee620d07c3c6bdaec97afaeb1ad27 (patch)
tree946404e2c5a5f72ab24ec18a7f492005d140bc27 /scripts
parentfad98c513e39ac4ebf0e08d16e9da9dd06934364 (diff)
downloadvyatta-cfg-system-ac29f8f49a1ee620d07c3c6bdaec97afaeb1ad27.tar.gz
vyatta-cfg-system-ac29f8f49a1ee620d07c3c6bdaec97afaeb1ad27.zip
Make add system image install the image to the right place.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install/install-functions2
-rwxr-xr-xscripts/install/install-image-existing11
2 files changed, 10 insertions, 3 deletions
diff --git a/scripts/install/install-functions b/scripts/install/install-functions
index d6e38523..85235f75 100755
--- a/scripts/install/install-functions
+++ b/scripts/install/install-functions
@@ -287,7 +287,7 @@ is_union_install ()
if is_live_cd_boot; then
return 1
fi
- if grep -q 'upperdir=/live/overlay//rw' /proc/mounts \
+ if grep -q 'upperdir=/live/persistence/' /proc/mounts \
&& egrep -q 'overlay / overlay ' /proc/mounts; then
return 0
else
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index 454ae749..1c90df83 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -113,7 +113,11 @@ echo "OK. This image will be named: $NEWNAME"
BOOT_DIR=/live/image/boot
if [ "$CUR_INSTALL" == 'old' ]; then
BOOT_DIR=/boot
-elif [ "$CUR_INSTALL" != 'union' ]; then
+elif [ "$CUR_INSTALL" == 'union' ]; then
+ # I'm not proud of this...
+ BOOT_DEVICE=`grep -o 'upperdir=/live/persistence/[^/]*/boot' /proc/mounts | cut -d / -f 4`
+ BOOT_DIR="/lib/live/mount/persistence/$BOOT_DEVICE/boot"
+else
echo 'Invalid current install type. Exiting...'
exit 1
fi
@@ -160,6 +164,9 @@ if ! mkdir -p "$RW_DIR"; then
failure_exit 'Cannot create directory for new release.'
fi
+WORK_DIR="$REL_ROOT/work"
+mkdir -p "$WORK_DIR"
+
# copy the squashfs image and boot files
echo "Copying new release files..."
squash_img=${CD_ROOT}/live/filesystem.squashfs
@@ -180,7 +187,7 @@ if ! try_mount "-o loop,ro $target_squash $READ_ROOT"; then
fi
# set up root for postinst
-margs=$(gen_mopts "overlayfs" $RW_DIR $READ_ROOT $INST_ROOT)
+margs=$(gen_mopts "overlay" $RW_DIR $READ_ROOT $WORK_DIR $INST_ROOT)
if ! try_mount "$margs"; then
rm -rf $REL_ROOT
failure_exit 'Failed to set up root directory for postinst.'