From owner-freebsd-stable@FreeBSD.ORG Fri Jan 6 15:14:44 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65B2416A41F for ; Fri, 6 Jan 2006 15:14:44 +0000 (GMT) (envelope-from ceri@submonkey.net) Received: from shrike.submonkey.net (cpc2-cdif2-3-1-cust208.cdif.cable.ntl.com [82.31.78.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CB3D43D46 for ; Fri, 6 Jan 2006 15:14:43 +0000 (GMT) (envelope-from ceri@submonkey.net) Received: from ceri by shrike.submonkey.net with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1EutIf-0007F7-Ad; Fri, 06 Jan 2006 15:14:41 +0000 Date: Fri, 6 Jan 2006 15:14:41 +0000 From: Ceri Davies To: Marius Nuennerich Message-ID: <20060106151441.GE86645@submonkey.net> Mail-Followup-To: Ceri Davies , Marius Nuennerich , freebsd-stable@freebsd.org References: <20060105134133.61aef78f@sol> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FLPM4o+7JoHGki3m" Content-Disposition: inline In-Reply-To: <20060105134133.61aef78f@sol> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.11 Sender: Ceri Davies Cc: freebsd-stable@freebsd.org Subject: Re: /boot/nextboot.conf not deactivated after one boot X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 15:14:44 -0000 --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--