summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbalocca <rbalocca@vyatta.com>2008-09-26 16:19:36 -0700
committerrbalocca <rbalocca@vyatta.com>2008-09-26 16:19:36 -0700
commit737562c6ab9d800f880f0e7a9be43ac9508e1af8 (patch)
tree10ab3e6ae841ce264a8eeb520067d6db7e07d8b5
parentadb56a3213db91c65d261e1c1165634da15975a8 (diff)
downloadvyatta-cfg-737562c6ab9d800f880f0e7a9be43ac9508e1af8.tar.gz
vyatta-cfg-737562c6ab9d800f880f0e7a9be43ac9508e1af8.zip
Fix for http://bugzilla.vyatta.com/show_bug.cgi?id=3680 (floppy config not loaded)
-rwxr-xr-xetc/init.d/vyatta-ofr20
1 files changed, 18 insertions, 2 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr
index 8ff02ab..87e961f 100755
--- a/etc/init.d/vyatta-ofr
+++ b/etc/init.d/vyatta-ofr
@@ -12,7 +12,7 @@
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
-#
+#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -66,6 +66,22 @@ have_rl_system () {
# if necessary, provide initial config
init_bootfile () {
+ # try floppy
+ # if we do not discover an fd device, try loading the floppy module
+ grep -q fd /proc/devices || modprobe -q floppy 2>/dev/null
+ grep -q ext2 /proc/filesystems || modprobe -q ext2 2>/dev/null
+ grep -q vfat /proc/filesystems || modprobe -q vfat 2>/dev/null
+ if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices
+ then
+ mkdir -p /media/floppy 2>/dev/null
+ mount /dev/fd0 /media/floppy -o sync 2>/dev/null ||
+ mount -t ext2 /dev/fd0 /media/floppy -o sync 2>/dev/null ||
+ mount -t vfat /dev/fd0 /media/floppy 2>/dev/null
+ fi
+
+ [ -d /media/floppy/config ] &&
+ mount -o bind /media/floppy/config /opt/vyatta/etc/config
+
if [ -f $BOOTFILE ] && grep -q '/\*XORP Configuration File, v1.0\*/' \
$BOOTFILE >&/dev/null; then
CURTIME=$(date +%F-%H%M%S)
@@ -78,7 +94,7 @@ init_bootfile () {
$vyatta_sbindir/vyatta_current_conf_ver.pl > $BOOTFILE
fi
fi
- chgrp ${GROUP} $BOOTFILE
+ chgrp ${GROUP} $BOOTFILE
chmod 660 $BOOTFILE
## remove the unnecessary and potentially conflicting
## config-directory statement (i.e. /mnt/floppy vs. /media/floppy