Re: initramfs-tools 0.98
On Tue, Aug 17, 2010 at 07:17:17PM +0100, Adam D. Barratt wrote:
> On Tue, 2010-08-17 at 16:42 +0200, maximilian attems wrote:
> > It contains several worthwile fixes for Squeeze and
> > most importantly full fills the new initramfs policy.
> > please unblock.
>
> A quick question on the diff:
>
> +# Common case: /sbin/init is present
> +if [ ! -x "${rootmnt}/sbin/init" ]; then
> + # ... if it's not available search for valid init
> + if [ -z "${init}" ] ; then
> + for inittest in /sbin/init /etc/init /bin/init /bin/sh; do
> + if validate_init "${inittest}"; then
> + init="$inittest"
> + break
> + fi
> + done
> + fi
> +
> + # No init on rootmount
> + if ! validate_init "${init}" ; then
> + panic "No init found. Try passing init= bootarg."
> + fi
> fi
>
> So far as I can see, if /sbin/init is present and executable, but $init
> is set to something else, then the init which will be executed is not
> checked via validate_init(). If so then should the "no init on
> rootmount" block be moved outside of the if block?
yes this is on purpose, the common case should be a single stat call
and no more overhead.
dracut doesn't "validate" init at all thus it never became an issue
in fedora for dracut that /sbin/init may or not be exec, see commit
e7daaf7fdf80ba63626515ca3e3e3054aaac0417 in initramfs-tools git [1]
repo for the systemd details, which got enhanced later by this fast path.
thanks.
[1] git://git.debian.org/git/kernel/initramfs-tools.git
--
maks
Reply to: