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

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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 @@
> =20
>  HOME=3D/; export HOME
>  PATH=3D/bin; export PATH
> -dev=3D`sysctl -n machdep.guessed_bootdev`
> +dev=3D`mount | grep 'on / ' | awk '{ print $1 }'`
>  [ -c "${dev}" ] || dev=3D"/dev/fd0"
> =20
>  trap "echo 'Reboot interrupted'; exit 1" 3
> Index: src/release/picobsd/mfs_tree/stand/update
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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=3D$*
>  [ -z "$thefiles" ] && \
>      thefiles=3D"/etc/rc.conf /etc/rc.firewall /etc/master.passwd"
> -dev=3D`sysctl -n machdep.guessed_bootdev`
> +dev=3D`mount | grep 'on / ' | awk '{ print $1 }'`
>  [ -c "${dev}" ] || dev=3D"/dev/fd0"
>  mount ${dev} /mnt
>  if [ "$?" !=3D "0" ] ; then
[CUT]

--=20
Simon L. Nielsen

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

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

--qDbXVdCdHGoSgWSk--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




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