Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jan 2016 17:00:34 +0000
From:      Colin Percival <cperciva@tarsnap.com>
To:        Warner Losh <imp@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r293115 - head/etc
Message-ID:  <000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@email.amazonses.com>
In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org>
References:  <201601031918.u03JImBs012182@repo.freebsd.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 01/03/16 11:18, Warner Losh wrote:
> Log:
>   Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked
>   up and can cause issues on boot with the prompts.

Huh, I never realized that could be a problem.

>   Fix the read-only
>   root case with horrible kludge of mounting rw removing the files, then
>   mounting ro.

The solution I intended when I introduced this (and used elsewhere) was to
set $firstboot_sentinel in /etc(/defaults)?/rc.conf.  This case is precisely
why it's a shell variable, in fact.

Colin Percival

> Modified: head/etc/rc
> ==============================================================================
> --- head/etc/rc	Sun Jan  3 19:06:17 2016	(r293114)
> +++ head/etc/rc	Sun Jan  3 19:18:48 2016	(r293115)
> @@ -131,11 +131,14 @@ done
>  
>  # Remove the firstboot sentinel, and reboot if it was requested.
>  if [ -e ${firstboot_sentinel} ]; then
> -	rm ${firstboot_sentinel}
> +	[ ${root_rw_mount} = "yes" ] || mount -uw /
> +	/bin/rm ${firstboot_sentinel}
>  	if [ -e ${firstboot_sentinel}-reboot ]; then
> -		rm ${firstboot_sentinel}-reboot
> +		/bin/rm ${firstboot_sentinel}-reboot
> +		[ ${root_rw_mount} = "yes" ] || mount -ur /
>  		kill -INT 1
>  	fi
> +	[ ${root_rw_mount} = "yes" ] || mount -ur /
>  fi
>  
>  echo ''

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000>