[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [DRAFT] Policy for Linux kernel, initramfs, boot loader update process



On Mon, Jun 28, 2010 at 03:02:35AM +0100, Ben Hutchings wrote:
> 1. Packages for boot loaders that need to be updated whenever the files
> they load are modified (i.e. those that store a block list) must install
> hook scripts in /etc/kernel/postinst.d and /etc/kernel/postrm.d, which
> will be called on installation/upgrade and removal of kernel packages,
> respectively.

It seems to me (particularly from the fact that you upgraded a grub2 bug
report about this to important - GRUB 2 does not store block lists for
kernels) that this is not limited to boot loaders that store block lists
for the files they load: it also affects boot loaders that need to be
updated whenever the *list* of files they load is modified.  Can you
confirm that my understanding is correct?

> 2. Packages for boot loaders that need to be updated whenever the files
> they load are modified must also install hook scripts in
> /etc/mkinitramfs/post-update.d.  Initramfs builders must call these
> scripts using run-parts after they create, update or delete an
> initramfs.  The arguments given to these hook scripts are the kernel ABI
> version and the absolute path to the initramfs image.

Does the same apply here, or not?  This is going to be quite a lot of
calls to update-grub if so, although at least it's quite a bit faster
now than it used to be ...

> 3. Initramfs builders must complete their work before returning from the
> kernel postinst hook script.  [initramfs-tools currently uses a trigger
> to defer this because it can also be invoked twice, but this means it
> also has to know how to update specific boot loaders.]

Is an initramfs guaranteed to be built before any of the boot loader
hooks are executed?  It seems like a waste of time calling boot loader
hooks otherwise.  (This may be implied by your design, but it was a
little bit implicit if so.)

> 4. During a kernel package installation, upgrade or removal, various
> boot loader hooks may be invoked (in this order):
> 
> a. A postinst_hook or postrm_hook command set by the user or the
>    installer in /etc/kernel-img.conf
> b. A hook script in /etc/mkinitramfs/post-update.d
> c. A hook script in /etc/kernel/postinst.d or .../postrm.d
> 
> To avoid unnecessary updates, the hooks invoked at step a and b may
> check whether $DPKG_MAINTSCRIPT_PACKAGE begins with 'linux-image-' and
> do nothing in this case.  [Is this sensible or is it too 'clever'?]

Sensible, I think.  There's no point running update-grub three times.

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: