diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2009-04-14 16:25:19 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2009-04-14 16:25:19 -0700 |
commit | 873ed2407885f70adbdebbce171e4fd4d8060ae4 (patch) | |
tree | fa78464090ce9a8e0b0ea04bd54a60991e823fcd /scripts | |
parent | 363165003112d3a0b222ec4a89d6951a4d41708b (diff) | |
download | vyatta-cfg-system-873ed2407885f70adbdebbce171e4fd4d8060ae4.tar.gz vyatta-cfg-system-873ed2407885f70adbdebbce171e4fd4d8060ae4.zip |
post-install changes
* set up start-up config and /var/run.
* pass writable root to postinst hook for union-specific tasks.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/install-system | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/install-system b/scripts/install-system index 7675ec38..558a5427 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -1370,9 +1370,11 @@ if [ -e $MDADM_CONFIG_FILE ]; then fi postinst_root=$rootfsdir +writable_root='' if [ -n "$UNION" ]; then # set up root for postinst postinst_root=/mnt/postinst_root + writable_root=$rootfsdir version=$(egrep -i version /opt/vyatta/etc/version | awk '{ print $3 }') rw_dir=$rootfsdir/boot/$version/live-rw @@ -1381,12 +1383,27 @@ if [ -n "$UNION" ]; then $rootfsdir/boot/$version/$version.squashfs /mnt/squashfs mount -t unionfs -o noatime,dirs=$rw_dir=rw:/mnt/squashfs=ro unionfs \ $postinst_root + + # handle start-up config file + mkdir -p $postinst_root/$ofrconfdir + if [ -f $rootfsdir/$ofrconfdir/config.boot ]; then + cp -p $rootfsdir/$ofrconfdir/* $postinst_root/$ofrconfdir/ + fi + + # set up /var/run + pi_fstab=$postinst_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 fi # postinst hook if [ -e /opt/vyatta/etc/install-system/postinst ]; then echo "running post-install script" - /opt/vyatta/etc/install-system/postinst $postinst_root >>$INSTALL_LOG + /opt/vyatta/etc/install-system/postinst $postinst_root $writable_root \ + >>$INSTALL_LOG fi if [ -n "$UNION" ]; then |