From 9cd1c2f0b577836043b25dfab4d27f03cf587b83 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 1 Feb 2016 11:56:44 -0500 Subject: Rename "live-rw" to only "rw". --- scripts/install/install-image-existing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/install/install-image-existing') diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 7d58cd96..454ae749 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -155,7 +155,7 @@ echo "Installing \"$NEWNAME\" image." # create the new release directories REL_ROOT=$BOOT_DIR/$NEWNAME -RW_DIR="$REL_ROOT/live-rw" +RW_DIR="$REL_ROOT/rw" if ! mkdir -p "$RW_DIR"; then failure_exit 'Cannot create directory for new release.' fi -- cgit v1.2.3 From ac29f8f49a1ee620d07c3c6bdaec97afaeb1ad27 Mon Sep 17 00:00:00 2001 From: Thomas Jepp Date: Wed, 3 Feb 2016 16:49:35 +0000 Subject: Make add system image install the image to the right place. --- scripts/install/install-functions | 2 +- scripts/install/install-image-existing | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts/install/install-image-existing') 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.' -- cgit v1.2.3 From f54bad96cef6ed52547151bc3a7ef64377f16c3e Mon Sep 17 00:00:00 2001 From: Thomas Jepp Date: Wed, 3 Feb 2016 20:08:16 +0000 Subject: Add vyos-persistpath and update install-image-existing and vyatta-update-grub.pl to use it. --- Makefile.am | 1 + scripts/install/install-image-existing | 6 ++---- scripts/vyatta-update-grub.pl | 2 +- scripts/vyos-persistpath | 19 +++++++++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 scripts/vyos-persistpath (limited to 'scripts/install/install-image-existing') diff --git a/Makefile.am b/Makefile.am index 5445f9cd..169df296 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,7 @@ sbin_SCRIPTS += scripts/vyatta-update-grub.pl sbin_SCRIPTS += scripts/vyos-intfwatchd sbin_SCRIPTS += scripts/ec2-check.pl sbin_SCRIPTS += scripts/is_port_available.pl +sbin_SCRIPTS += scripts/vyos-persistpath sbin_PROGRAMS = src/valid_address sbin_PROGRAMS += src/local_ip diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 1c90df83..4c6b601b 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -110,13 +110,11 @@ fi echo "OK. This image will be named: $NEWNAME" # this is the default if current install is union -BOOT_DIR=/live/image/boot + if [ "$CUR_INSTALL" == 'old' ]; then BOOT_DIR=/boot 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" + BOOT_DIR=`/opt/vyatta/sbin/vyos-persistpath`/boot else echo 'Invalid current install type. Exiting...' exit 1 diff --git a/scripts/vyatta-update-grub.pl b/scripts/vyatta-update-grub.pl index a9e646ed..e4110ee0 100755 --- a/scripts/vyatta-update-grub.pl +++ b/scripts/vyatta-update-grub.pl @@ -25,7 +25,7 @@ use warnings; use Getopt::Long; use File::Temp qw/ :mktemp /; -my $UNION_BOOT_DIR = '/live/image/boot'; +my $UNION_BOOT_DIR = `/opt/vyatta/sbin/vyos-persistpath` . '/boot'; my $UNION_GRUB_CFG_DIR = "$UNION_BOOT_DIR/grub"; my $DISK_BOOT_DIR = '/boot'; my $DISK_GRUB_CFG_DIR= '/boot/grub'; diff --git a/scripts/vyos-persistpath b/scripts/vyos-persistpath new file mode 100755 index 00000000..d7199b09 --- /dev/null +++ b/scripts/vyos-persistpath @@ -0,0 +1,19 @@ +#!/bin/bash + +if grep -q -e '^overlay.*/filesystem.squashfs' /proc/mounts; then + # Live CD boot + exit 2 + +elif grep -q 'upperdir=/live/persistence/' /proc/mounts && egrep -q 'overlay / overlay ' /proc/mounts; then + # union boot + + boot_device=`grep -o 'upperdir=/live/persistence/[^/]*/boot' /proc/mounts | cut -d / -f 4` + persist_path="/lib/live/mount/persistence/$boot_device" + + echo $persist_path + exit 0 +else + # old style boot + + exit 1 +fi \ No newline at end of file -- cgit v1.2.3 From 184ca4e9e11023f5c99fa8bb6b6063ce29f9fea3 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Feb 2016 12:19:18 -0500 Subject: Do not create persistent fstab, this will interfere with systemd. --- scripts/install/install-image-existing | 8 -------- 1 file changed, 8 deletions(-) (limited to 'scripts/install/install-image-existing') diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 4c6b601b..62e73882 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -191,14 +191,6 @@ if ! try_mount "$margs"; then failure_exit 'Failed to set up root directory for postinst.' fi -# set up /var/run fstab entry -PI_FSTAB=$INST_ROOT/etc/fstab -if ! grep -q 'tmpfs /var/run ' $PI_FSTAB >&/dev/null; then - # replace the fstab. the default one has header that will cause - # it to be wiped out on live boot. - echo 'tmpfs /var/run tmpfs nosuid,nodev 0 0' >$PI_FSTAB -fi - # # Check to make sure we have enough space to copy the config and data dirs... # -- cgit v1.2.3 From d133ba0fcdda4bb1c4a7653e2b275a2a3ec4434b Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 5 Jun 2017 01:20:50 +0200 Subject: remove trailing space from version (if there is any) --- scripts/install/install-image-existing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/install/install-image-existing') diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 62e73882..f38e3701 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -77,7 +77,7 @@ if [ -z "$CURVER" ]; then fi # get new version string. this is from the squashfs image. -NEWVER=`cat ${CD_SQUASH_ROOT}/opt/vyatta/etc/version | grep "Version:" | awk '{print $2,$3}' | sed 's/ /-/g'` +NEWVER=`cat ${CD_SQUASH_ROOT}/opt/vyatta/etc/version | grep "Version:" | awk '{print $2,$3}' | sed 's/[[:space:]]*$//' | sed 's/ /-/g'` NEWNAME=$NEWVER echo -n "What would you like to name this image? [$NEWNAME]: " -- cgit v1.2.3