summaryrefslogtreecommitdiff
path: root/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst
blob: 8511227f112223ab0c0478ab69da833c0034aebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

source /opt/vyatta/sbin/install-functions

NEWVER=`mount | grep /mnt/inst_root`
NEWVER=${NEWVER#*upperdir=/live/image/boot/}
NEWVER=${NEWVER%/live-rw*}

# For upgrading from 1.1.8 and older:
# Set the correct disk label and create persistence configs
# Live CD persistence settings have changed in Debian Jessie
# and the system will not find its persistence dir otherwise
DISK_LABEL=`mount | grep /live/image | awk '{print $1}' | grep dev`

if [ -d "/live/image" ]; then
	e2label "${DISK_LABEL}" persistence
	if [ ! -f /live/image/persistence.conf ]; then
		echo "/ union" > /live/image/persistence.conf
	fi
	rm -f /live/image/boot/"${NEWVER}"/live-rw/etc/fstab
	mv /live/image/boot/"${NEWVER}"/live-rw /live/image/boot/"${NEWVER}"/rw

        touch /live/image/boot/"${NEWVER}"/rw/config/.upgraded
fi