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

Re: [RFC] Updating boot loaders in lenny and squeeze



On Fri, 18 Jun 2010 22:55:38 -0400 (EDT), Ben Hutchings wrote:
> 
> Stephen Powell recently reminded the kernel team that LILO is not
> automatically updated on installation of a new kernel version in lenny.
> In fact there is a general problem that there are several different ways
> a boot loader may be updated automatically and currently no guarantee
> that this does happen whenever it should.
> 
> There are two major cases where a boot loader should be updated
> automatically:
> 
> 1. Where the boot loader relies on block lists rather than reading the
> filesystem, these block lists need to be updated whenever a kernel image
> or an initramfs is updated or removed.
> 
> 2. Where the boot loader allows selection between arbitrarily many
> installed versions, the configuration should be updated whenever a
> kernel package is newly installed or removed.
> 
> There are several ways such updates may be triggered:
> 
> A. Packages built with older versions of kernel-package, including the
> official kernel packages in etch, run a platform-specific default boot
> loader if it is installed and if it falls into case 1 above.
> 
> B. The maintainer scripts of kernel packages invoke hook scripts
> installed in appropriate subdirectories under /etc/kernel/.
> 
> C. The maintainer scripts of kernel packages invoke hook commands
> specified in /etc/kernel-img.conf.
> 
> D. "update-initramfs -u" will run certain boot loader update programs if
> installed.
> 
> In lenny, route A was effectively disabled in official kernel packages.
> However, no boot loader uses route B and debian-installer enables route
> C only for GRUB (as far as I know).  Disabling route A in lenny was
> clearly premature and I intend to restore it in a stable update.
> 
> However, given that route B is present in both lenny and squeeze (and
> even in etch, I think) there is no good reason for packages not to rely
> on it now.  (Well, except lack of documentation.)  All boot loader
> packages that fall into case 1 or 2 should be installing hook scripts,
> but currently only extlinux does.

That's a well-organized summary, Ben.
>
> I intend to remove the vestigial code
> for route A, and file bugs on all boot loaders in case 1 or 2 that do
> not use route B.

I believe that bug number 585856 will qualify for this purpose for the
lilo boot loader.  If you decide to extend this maintainer script
"feature" to the s390 platform also (for Squeeze and later releases)
then you should, at the same time, file a bug report against the
s390-tools package, which includes the zipl boot loader, which has the
same basic design as lilo.  (It reads the kernel and the initrd as
a list of blocks, which must be kept in sync with the file system.)

> In case 1, the boot loader should also be called by update-initramfs
> when it is called outside of kernel package installation and removal.
> This is normally covered by route D, but this seems a little fragile.  I
> would prefer to replace this with a hook system (as already exists for
> building the initramfs itself), but I'm not that involved in
> initramfs-tools development.

That does seem like a more general-purpose solution, rather than having
lilo and zipl treated as special cases.  But please keep the appropriate
parties informed of any future design changes to update-initramfs.
I myself have never used yaird, but I assume that to be consistent it
should have a similar hook system.

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


Reply to: