dizzy
Group: Members
Posts: 1
Joined: Feb. 2007 |
|
Posted: Feb. 23 2007,19:30 |
|
When mounting the mydsl device for loading drivers and extensions the dsl-config initscript should mount the device read-only since read-write access is not needed in this context. This is particularly important if the mydsl location is on a USB flash disk which has a limited number of possible write operations.
The read-only mount can be done by substituting the 'mount' calls with calls to the following 'mount_ro' function:
mount_ro() { local mpoint="$1" local entry="$(awk "(\$2==\"$mpoint\") {print; exit}" /etc/fstab)" if [ -z "$entry" ]; then echo "mount_ro: can't find $mpoint in /etc/fstab" >&2 return 1 fi local mdev=$(echo "$entry" | awk '{print $1}') local type=$(echo "$entry" | awk '{print $3}') local opts=$(echo "$entry" | awk '{print $4}') mount -t $type -o "$opts,ro" $mdev $mpoint }
|