diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2010-06-26 06:38:43 -0700 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2010-06-26 06:38:43 -0700 |
commit | 1ec849bc5a5f4cbe9d273f647b37a2dbc823ed11 (patch) | |
tree | 61d0351a73418c67df0283c627d9281fd59b4255 | |
parent | 2dbc728a47409cd60541286dbe59e6e94225c066 (diff) | |
download | vyatta-cfg-1ec849bc5a5f4cbe9d273f647b37a2dbc823ed11.tar.gz vyatta-cfg-1ec849bc5a5f4cbe9d273f647b37a2dbc823ed11.zip |
Bugfix 5512: Bind mount /boot and /boot/grub on image-installed systems.
On image-installed systems, the /boot directory comes from the read-write
overlay. Its contents are not used by grub to boot the system. This change
mounts the per-image boot directory onto /boot, and the system-wide
grub directory onto /boot/grub.
-rwxr-xr-x | etc/init.d/vyatta-router | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router index c41c48a..a108cec 100755 --- a/etc/init.d/vyatta-router +++ b/etc/init.d/vyatta-router @@ -153,6 +153,33 @@ load_acpi_cpufreq() fi } +# +# On image booted machines, we need to mount /boot from the image-specific +# boot directory so that kernel package installation will put the +# files in the right place. We also have to mount /boot/grub from the +# system-wide grub directory so that tools that edit the grub.cfg +# file will find it in the expected location. +# +bind_mount_boot() +{ + if [ -e /live/image ]; 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 + fi + fi +} + start () { log_action_begin_msg "Mounting Vyatta Config" @@ -175,6 +202,7 @@ start () load_acpi_cpufreq cleanup_raid + bind_mount_boot chmod g-w,o-w / log_end_msg $? |