Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 2016 11:27:29 -0800
From:      Colin Percival <cperciva@freebsd.org>
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:  <56897621.6080505@freebsd.org>
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: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56897621.6080505>