Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 2003 19:18:24 +0100
From:      "Simon L. Nielsen" <simon@nitro.dk>
To:        Hiten Pandya <hiten@unixdaemons.com>
Cc:        current@FreeBSD.ORG, freebsd-small@freebsd.org
Subject:   Re: machdep.guessed_bootdev sysctl on i386
Message-ID:  <20030224181823.GA369@nitro.dk>
In-Reply-To: <20030224063502.GB70498@unixdaemons.com>
References:  <20030224024210.GA50286@unixdaemons.com> <4363.1046067059@critter.freebsd.dk> <20030224063502.GB70498@unixdaemons.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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 #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+WmHv8kocFXgPTRwRAl3mAJ44LdM+hrBMuh7RvPtlybMYp6rJTACcDoIi
RUNt6kP/IFwc7LZX0oCDePM=
=a8DT
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030224181823.GA369>