diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-29 10:05:42 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-29 10:05:42 -0700 |
commit | b813adec2a11222748b6fd8976ddda9de1e3da5d (patch) | |
tree | d438b1eaa8612c97d1efc725e23094215a1a590b /etc/init.d/vyatta-ofr | |
parent | 8cc248d3d90d606e87adb412049b318dba687487 (diff) | |
download | vyatta-cfg-b813adec2a11222748b6fd8976ddda9de1e3da5d.tar.gz vyatta-cfg-b813adec2a11222748b6fd8976ddda9de1e3da5d.zip |
Change how floppy is mounted
This fixes several problems:
1) Only try mounting once which avoids several I/O errors
2) Mount floppy with safer options for security
3) Use more optimum methods to reduce boot time
This should really be done by better udev support. But the root of the
problem lies in the Debian upstream package maintainer.
He is hostile to later advancements, and still maintains a static
/dev infrastructure as well as devfs compatiablity!
Ubuntu, SUSE, and Redhat have all migrated to creating devices via udev;
this would allow floppy device to only exist if floppy is present.
And then inserting a floppy could cause udev add event to mount
/media/floppy...
Diffstat (limited to 'etc/init.d/vyatta-ofr')
-rwxr-xr-x | etc/init.d/vyatta-ofr | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index a3dbc42..ac8d861 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -66,13 +66,17 @@ have_rl_system () { # if necessary, provide initial config init_bootfile () { - if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices + + if [ ! -d /media/floppy/config -a -b /dev/fd0 ] then - mkdir -p /media/floppy - mount /dev/fd0 /media/floppy -o sync || - mount -t ext2 /dev/fd0 /media/floppy -o sync || - mount -t vfat /dev/fd0 /media/floppy - fi 2>/dev/null + [ -d /media/floppy ] || mkdir -p /media/floppy + + # This mount will try ext2 or fat format + # and it will fail if no floppy present + # Note: no good way to test for floppy present without causing I/O error + mount /dev/fd0 /media/floppy \ + -o sync,noexec,nodev,noatime,nosuid 2>/dev/null + fi [ -d /media/floppy/config ] && mount -o bind /media/floppy/config /opt/vyatta/etc/config |