From 13cf05ad949e8e622613b59084a39a776110fa99 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 26 Jan 2016 09:09:06 -0500 Subject: Update 'is_live_cd_boot' and 'is_union_instal' functions to search on 'overlay' instead of 'overlayfs' --- scripts/install/install-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 1551fbb0..8f30f8db 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -274,7 +274,7 @@ is_live_cd_boot () # Poor check, but whatever. The point is that on installed system # the image file normally is named after the current version, # while on livecd it's just "filesystem.squashfs" - if grep -q -e '^overlayfs.*/filesystem.squashfs' /proc/mounts; then + if grep -q -e '^overlay.*/filesystem.squashfs' /proc/mounts; then return 0 else return 1 @@ -287,8 +287,8 @@ is_union_install () if is_live_cd_boot; then return 1 fi - if grep -q ' /live/image [^ ]\+ rw' /proc/mounts \ - && egrep -q '(union|overlay)fs / (union|overlay)fs ' /proc/mounts; then + if grep -q 'upperdir=/live/overlay//rw' /proc/mounts \ + && egrep -q 'overlay / overlay ' /proc/mounts; then return 0 else return 1 -- cgit v1.2.3 From 79bffc87c0b0a4b6b35a190fa64adc34e5ff8005 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 29 Jan 2016 05:56:40 -0500 Subject: Update the way the install scrips get the vyos version. --- scripts/install/install-functions | 4 ++-- scripts/install/install-image | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 8f30f8db..0a1f5d13 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -298,7 +298,7 @@ is_union_install () # outputs the version string of the current running version. get_cur_version () { - ver=`dpkg-query --showformat='${Version}' --show vyatta-version` + ver=`cat /opt/vyatta/etc/version` if [ -z "$ver" ]; then echo "UNKNOWN" else @@ -323,7 +323,7 @@ get_new_version () ver_file=${ver_path} if is_live_cd_boot && [ -f "$ver_file" ]; then # we are installing from a live CD boot - ver=`dpkg-query --showformat='${Version}' --show vyatta-version` + ver=`cat /opt/vyatta/etc/version` echo $ver return fi diff --git a/scripts/install/install-image b/scripts/install/install-image index c7323fbf..d093d80d 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -63,7 +63,7 @@ fetch_iso_by_url () fi # This is for statistics collection - vyos_version=`dpkg-query --showformat='${Version}' --show vyatta-version` + vyos_version=`cat /opt/vyatta/etc/version` filename="${TEMP_DIR}/${NEW_ISO##*/}" curl -L -H "User-Agent: VyOS/$vyos_version" $auth -f -o $filename $NEW_ISO -- cgit v1.2.3 From ecb3ae1ed2a66c0ddc5be25f6cba9fe6c0a0345a Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 29 Jan 2016 07:05:33 -0500 Subject: Refine getting the vyos version. --- scripts/install/install-functions | 4 ++-- scripts/install/install-image | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 0a1f5d13..720ac28a 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -298,7 +298,7 @@ is_union_install () # outputs the version string of the current running version. get_cur_version () { - ver=`cat /opt/vyatta/etc/version` + ver=`cat /opt/vyatta/etc/version | awk '{print $2}'` if [ -z "$ver" ]; then echo "UNKNOWN" else @@ -323,7 +323,7 @@ get_new_version () ver_file=${ver_path} if is_live_cd_boot && [ -f "$ver_file" ]; then # we are installing from a live CD boot - ver=`cat /opt/vyatta/etc/version` + ver=`cat /opt/vyatta/etc/version | awk '{print $2}'` echo $ver return fi diff --git a/scripts/install/install-image b/scripts/install/install-image index d093d80d..fd10d0c3 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -63,7 +63,7 @@ fetch_iso_by_url () fi # This is for statistics collection - vyos_version=`cat /opt/vyatta/etc/version` + vyos_version=`cat /opt/vyatta/etc/version | awk '{print $2}'` filename="${TEMP_DIR}/${NEW_ISO##*/}" curl -L -H "User-Agent: VyOS/$vyos_version" $auth -f -o $filename $NEW_ISO -- cgit v1.2.3 From 47e2c43533abe96eca65f3906528c8654d5839b4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 29 Jan 2016 07:41:43 -0500 Subject: Correct overlay mount function. --- scripts/install/install-functions | 7 ++++--- scripts/install/install-image-new | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 720ac28a..d6e38523 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -337,11 +337,12 @@ gen_mopts () local mnttype=$1 local upper=$2 local lower=$3 - local mntpoint=$4 + local work=$4 + local mntpoint=$5 case "$1" in - overlayfs) - echo "-t $mnttype -o noatime,upperdir=$upper,lowerdir=$lower $mnttype $mntpoint" + overlay) + echo "-t $mnttype -o noatime,upperdir=$upper,lowerdir=$lower,workdir=$work $mnttype $mntpoint" ;; *) echo "-t $mnttype -o noatime,dirs=$upper=rw:$lower=ro $mnttype $mntpoint" diff --git a/scripts/install/install-image-new b/scripts/install/install-image-new index 91cb27fa..81ac45e9 100755 --- a/scripts/install/install-image-new +++ b/scripts/install/install-image-new @@ -64,6 +64,8 @@ mkdir -p $WRITE_ROOT/boot/$image_name # make dir for backing store rw_dir=$WRITE_ROOT/boot/$image_name/live-rw mkdir -p $rw_dir +work_dir=$WRITE_ROOT/boot/$image_name/live-work +mkdir -p $work_dir echo Copying squashfs image... # these are the defaults if installing from a specified ISO image file. @@ -94,7 +96,7 @@ if ! try_mount "-o loop,ro -t squashfs $target_squash $READ_ROOT"; then echo 'Exiting...' exit 1 fi -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 echo 'Exiting...' exit 1 -- 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-functions') 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 b66cc78521db17628efa3dd27766527816c170cc Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Sat, 21 May 2016 11:48:25 -0400 Subject: T69 Remove floppy device settings --- scripts/install-system | 8 -------- scripts/install/install-functions | 3 --- scripts/install/install-postinst-new | 9 --------- 3 files changed, 20 deletions(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install-system b/scripts/install-system index 71fe0de1..108153da 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -46,7 +46,6 @@ MANUF=`/usr/sbin/dmidecode -s system-manufacturer` : ${vyatta_sysconfdir:=${vyatta_prefix}/etc} ofrconfdir=${vyatta_sysconfdir}/config -fdconfdir=/media/floppy/config rootfsdir=/mnt/rootfs # By default this is not a union install @@ -1037,13 +1036,6 @@ copy_config () { if [ -f $ofrconfdir/config.boot ]; then config=$ofrconfdir/config.boot fi - if [ -f $fdconfdir/config.boot ]; then - if [ -z "$config" ]; then - config="$fdconfdir/config.boot" - else - config="$config $fdconfdir/config.boot" - fi - fi if [ -n "$config" ]; then echo "I found the following configuration files" diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 85235f75..d241e040 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -43,9 +43,6 @@ CD_SQUASH_ROOT=/mnt/cdsquash VYATTA_CFG_DIR=${vyatta_sysconfdir}/config VYATTA_NEW_CFG_DIR=/config -# the floppy config dir -FD_CFG_DIR=/media/floppy/config - # PROGRESS_PID can be exported by top-level script progress_indicator () { local spid=$PROGRESS_PID diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index 2a3bcde9..f6c6e956 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -51,15 +51,6 @@ copy_config () { config=${VYATTA_NEW_CFG_DIR}/config.boot fi - # Second candidate: The config file on floppy, if one exists. - if [ -f "${FD_CFG_DIR}/config.boot" ]; then - if [ -z "$config" ]; then - config="${FD_CFG_DIR}/config.boot" - else - config="$config ${FD_CFG_DIR}/config.boot" - fi - fi - # Third candidate: The default config file DEF_CONF=$vyatta_sysconfdir/config.boot.default if [ -f $DEF_CONF ]; then -- cgit v1.2.3