From 71b85bc6c3f14bc6a47e295ae9346b05585e8496 Mon Sep 17 00:00:00 2001 From: Thomas Jepp Date: Wed, 3 Feb 2016 20:19:37 +0000 Subject: Actually mount /boot and /boot/grub on Jessie. --- etc/init.d/vyatta-router | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router index 9d11aab..ce7f891 100755 --- a/etc/init.d/vyatta-router +++ b/etc/init.d/vyatta-router @@ -115,24 +115,31 @@ load_bootfile () # system-wide grub directory so that tools that edit the grub.cfg # file will find it in the expected location. # -bind_mount_boot() +bind_mount_boot () { - if [ -e /live/image/boot ]; then - image_name=`cat /proc/cmdline | sed -e s+^.*vyatta-union=/boot/++ | sed -e 's/ .*$//'` - if [ -n "$image_name" ]; then - mount --bind /live/image/boot/$image_name /boot - if [ $? -ne 0 ]; then - echo "Couldn't bind mount /boot" - fi - if [ ! -d /boot/grub ]; then - mkdir /boot/grub - fi - mount --bind /live/image/boot/grub /boot/grub - if [ $? -ne 0 ]; then - echo "Couldn't bind mount /boot/grub" - fi + persist_path=`/opt/vyatta/sbin/vyos-persistpath` + if [ $? == 0 ]; then + if [ -e $persist_path/boot ]; then + image_name=`cat /proc/cmdline | sed -e s+^.*vyatta-union=/boot/++ | sed -e 's/ .*$//'` + + if [ -n "$image_name" ]; then + mount --bind $persist_path/boot/$image_name /boot + + if [ $? -ne 0 ]; then + echo "Couldn't bind mount /boot" + fi + + if [ ! -d /boot/grub ]; then + mkdir /boot/grub + fi + + mount --bind $persist_path/boot/grub /boot/grub + if [ $? -ne 0 ]; then + echo "Couldn't bind mount /boot/grub" + fi + fi + fi fi - fi } # -- cgit v1.2.3