On 2003.02.24 01:35:02 -0500, Hiten Pandya wrote:

> Okay. I have attached a patch which will nuke the sysctl, and replace
> it's use in picobsd's mfs_tree rc scripts with something better, but
> which still needs review.  I have not tested the patch, but this patch
> should not fail, hopefully.
PicoBSD does not necessarily have awk (actually most likely doesn't
since awk is 'big'). cut could be used instead since it much smaller :

mount | grep 'on / ' | cut -f 1 -d ' '

Perhaps somebody has a better way?

I have cc'ed -small, since somebody there might have good idea.

> Index: src/release/picobsd/mfs_tree/etc/rc
> ===================================================================
> RCS file: /home/ncvs/src/release/picobsd/mfs_tree/etc/rc,v
> retrieving revision 1.9
> diff -u -r1.9 rc
> --- src/release/picobsd/mfs_tree/etc/rc       17 Nov 2002 20:19:34 -0000      1.9
> +++ src/release/picobsd/mfs_tree/etc/rc       24 Feb 2003 06:21:31 -0000
> @@ -7,7 +7,7 @@
>  
>  HOME=/; export HOME
>  PATH=/bin; export PATH
> -dev=`sysctl -n machdep.guessed_bootdev`
> +dev=`mount | grep 'on / ' | awk '{ print $1 }'`
>  [ -c "${dev}" ] || dev="/dev/fd0"
>  
>  trap "echo 'Reboot interrupted'; exit 1" 3
> Index: src/release/picobsd/mfs_tree/stand/update
> ===================================================================
> RCS file: /home/ncvs/src/release/picobsd/mfs_tree/stand/update,v
> retrieving revision 1.5
> diff -u -r1.5 update
> --- src/release/picobsd/mfs_tree/stand/update 11 Mar 2002 05:15:44 -0000      1.5
> +++ src/release/picobsd/mfs_tree/stand/update 24 Feb 2003 06:20:08 -0000
> @@ -5,7 +5,7 @@
>  thefiles=$*
>  [ -z "$thefiles" ] && \
>      thefiles="/etc/rc.conf /etc/rc.firewall /etc/master.passwd"
> -dev=`sysctl -n machdep.guessed_bootdev`
> +dev=`mount | grep 'on / ' | awk '{ print $1 }'`
>  [ -c "${dev}" ] || dev="/dev/fd0"
>  mount ${dev} /mnt
>  if [ "$?" != "0" ] ; then
[CUT]

-- 
Simon L. Nielsen

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to