From owner-freebsd-rc@FreeBSD.ORG Sat Mar 8 00:31:43 2008 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636AC106566B; Sat, 8 Mar 2008 00:31:43 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id E8BB68FC1A; Sat, 8 Mar 2008 00:31:42 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [202.108.54.204]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id D737A28458; Sat, 8 Mar 2008 08:31:41 +0800 (CST) Received: from localhost (tarsier.geekcn.org [202.108.54.204]) by tarsier.geekcn.org (Postfix) with ESMTP id 840B7EB2209; Sat, 8 Mar 2008 08:31:41 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([202.108.54.204]) by localhost (mail.geekcn.org [202.108.54.204]) (amavisd-new, port 10024) with ESMTP id yypYQIN93tFX; Sat, 8 Mar 2008 08:31:36 +0800 (CST) Received: from charlie.delphij.net (71.5.7.139.ptr.us.xo.net [71.5.7.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 77C58EB1CB5; Sat, 8 Mar 2008 08:31:34 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:x-enigmail-version:openpgp:content-type; b=q849YKxfpIPXJsnfbWVYSF528Hq4G9kG5wO0RpGVQ6CW7ilfhqY0ifkFRnNJkSVl0 hMdG61YxbxDdGpnHxr0Ww== Message-ID: <47D1DE64.20405@delphij.net> Date: Fri, 07 Mar 2008 16:31:32 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.12 (X11/20080303) MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org, mtm@FreeBSD.org X-Enigmail-Version: 0.95.6 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------070004040207080402080502" Cc: Subject: [RFC] Split nextboot deletion from /etc/rc.d/root X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2008 00:31:43 -0000 This is a multi-part message in MIME format. --------------070004040207080402080502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Here is a patch that moves the nextboot deletion from /etc/rc.d/root to a new script which would be fired after mountlate. The reason behind this is that /boot is not necessarily part of the /, and doing nextboot -D would give an error if /boot is not mounted (i.e. in a typical setup of ZFS root). Objections? Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! --------------070004040207080402080502 Content-Type: text/plain; name="patch-nextboot-split.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-nextboot-split.diff" Index: Makefile =================================================================== RCS file: /home/ncvs/src/etc/rc.d/Makefile,v retrieving revision 1.89 diff -u -p -r1.89 Makefile --- Makefile 5 Mar 2008 18:32:58 -0000 1.89 +++ Makefile 8 Mar 2008 00:14:00 -0000 @@ -23,7 +23,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ named natd netif netoptions \ - network_ipv6 newsyslog nfsclient nfsd \ + network_ipv6 newsyslog nextboot nfsclient nfsd \ nfsserver nisdomain nsswitch ntpd ntpdate \ othermta \ pf pflog pfsync \ Index: root =================================================================== RCS file: /home/ncvs/src/etc/rc.d/root,v retrieving revision 1.16 diff -u -p -r1.16 root --- root 8 Dec 2007 07:20:22 -0000 1.16 +++ root 8 Mar 2008 00:13:42 -0000 @@ -30,12 +30,6 @@ root_start() esac umount -a >/dev/null 2>&1 - - # If we booted a special kernel remove the record - # so we will boot the default kernel next time. - if [ -x /sbin/nextboot ]; then - /sbin/nextboot -D - fi } load_rc_config $name Index: nextboot =================================================================== RCS file: nextboot diff -N nextboot --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ nextboot 8 Mar 2008 00:14:21 -0000 @@ -0,0 +1,26 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nextboot +# REQUIRE: mountlate +# KEYWORD: nojail + +. /etc/rc.subr + +name="nextboot" +start_cmd="nextboot_start" +stop_cmd=":" + +nextboot_start() +{ + # If we booted a special kernel remove the record + # so we will boot the default kernel next time. + if [ -x /sbin/nextboot ]; then + /sbin/nextboot -D + fi +} + +load_rc_config $name +run_rc_command "$1" --------------070004040207080402080502--