Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2006 15:14:41 +0000
From:      Ceri Davies <ceri@submonkey.net>
To:        Marius Nuennerich <marius.nuennerich@gmx.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: /boot/nextboot.conf not deactivated after one boot
Message-ID:  <20060106151441.GE86645@submonkey.net>
In-Reply-To: <20060105134133.61aef78f@sol>
References:  <20060105134133.61aef78f@sol>

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

--FLPM4o+7JoHGki3m
Content-Type: multipart/mixed; boundary="DNUSDXU7R7AVVM8C"
Content-Disposition: inline


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

On Thu, Jan 05, 2006 at 01:41:33PM +0100, Marius Nuennerich wrote:
> Hi folks,
>=20
> it seems like /boot/nextboot.conf is neither deleted nor
> nextboot_enable set to NO on the first line after a reboot.
> So it isn't a one shot anymore as the manpage claims.
>=20
> System is 6.0-RELEASE.

I think this is down to a typo in /etc/rc.d/root; at least I can't find
any other reference to /boot/nextkernel in src/.  Patch attached
(root.diff).

> It would also be fine imo, if the -k option would be optional and the
> next kernel defaults to "kernel".

I'm not sure if getopts can be persuaded to take an optional argument to
an option.  If not, the attached patch (nextboot.diff) should work for
you.

Ceri
--=20
Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former.			  -- Einstein (attrib.)

--DNUSDXU7R7AVVM8C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="root.diff"
Content-Transfer-Encoding: quoted-printable

Index: etc/rc.d/root
=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/etc/rc.d/root,v
retrieving revision 1.11
diff -u -r1.11 root
--- etc/rc.d/root	2 Dec 2005 21:33:43 -0000	1.11
+++ etc/rc.d/root	6 Jan 2006 14:37:51 -0000
@@ -34,8 +34,8 @@
=20
 	# If we booted a special kernel remove the record
 	# so we will boot the default kernel next time.
-	if [ -e /boot/nextkernel ]; then
-		rm -f /boot/nextkernel
+	if [ -e /boot/nextboot.conf ]; then
+		rm -f /boot/nextboot.conf
 	fi
 }
=20

--DNUSDXU7R7AVVM8C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="nextboot.diff"
Content-Transfer-Encoding: quoted-printable

Index: sbin/reboot/nextboot.8
=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/sbin/reboot/nextboot.8,v
retrieving revision 1.4
diff -u -r1.4 nextboot.8
--- sbin/reboot/nextboot.8	12 Dec 2002 17:25:56 -0000	1.4
+++ sbin/reboot/nextboot.8	6 Jan 2006 15:13:24 -0000
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD: src/sbin/reboot/nextboot.8,v 1.4 2002/12/12 17:25:56 ru Exp $
 .\"
-.Dd November 4, 2002
+.Dd January 6, 2006
 .Dt NEXTBOOT 8
 .Os
 .Sh NAME
@@ -33,8 +33,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f
+.Op Fl k Ar kernel
 .Op Fl o Ar options
-.Fl k Ar kernel
 .Nm
 .Fl D
 .Sh DESCRIPTION
@@ -68,6 +68,8 @@
 This option specifies a kernel directory relative to
 .Pa /boot
 to load the kernel and any modules from.
+If this option is not provided, defaults to
+.Dq Li kernel .
 .It Fl o Ar options
 This option
 allows the passing of kernel flags for the next boot.
@@ -90,7 +92,7 @@
 .Pp
 To enable into single user mode with the normal kernel:
 .Pp
-.Dl "nextboot -o ""-s"" -k kernel"
+.Dl "nextboot -o ""-s"""
 .Pp
 To remove an existing nextboot configuration:
 .Pp
Index: sbin/reboot/nextboot.sh
=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/sbin/reboot/nextboot.sh,v
retrieving revision 1.1
diff -u -r1.1 nextboot.sh
--- sbin/reboot/nextboot.sh	24 May 2002 04:06:03 -0000	1.1
+++ sbin/reboot/nextboot.sh	6 Jan 2006 15:13:24 -0000
@@ -10,10 +10,12 @@
 nextboot_file=3D"/boot/nextboot.conf"
=20
 display_usage() {
-	echo "Usage: nextboot [-f] [-o options] -k kernel"
+	echo "Usage: nextboot [-f] [-k kernel] [-o options]"
 	echo "       nextboot -D"
 }
=20
+kernel=3D"kernel"
+
 while getopts "Dfk:o:" argument ; do
 	case "${argument}" in
 	D)
@@ -40,11 +42,6 @@
 	exit 0
 fi
=20
-if [ "xxx${kernel}" =3D "xxx" ]; then
-	display_usage
-	exit 1
-fi
-
 if [ ${force} =3D "NO" -a ! -d /boot/${kernel} ]; then
 	echo "Error: /boot/${kernel} doesn't exist. Use -f to override."
 	exit 1

--DNUSDXU7R7AVVM8C--

--FLPM4o+7JoHGki3m
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFDvolgocfcwTS3JF8RAhFVAKCN2aly+flyu0EsLVlKjbfJAE9d+gCdGVgb
R0ydiWezxExLQGmhglucSFA=
=T+Rv
-----END PGP SIGNATURE-----

--FLPM4o+7JoHGki3m--



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