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

Bug#361150: Kernel install process contains a time window that can lead to an unusable system



Package: linux-2.6
Severity: normal

This is about the kernel image installation process (all linux-image-*)

There is a critical time window during install that occurs if

- multiple packages are being installed at once (for exemple during "apt-get upgrade")
- *AND* the same kernel is being updated

during which time, an interruption of the installation process can lead to a non-bootable system (non coherent kernel/modules combination, invalid kernel map for bootloader, etc..)

The installation procedure first unpacks and replaces the actual running kernel.

If anything happens during that time several bad things can happen :
- The initrd image (if needed) is not built
- The bootloader is not updated to reflect the disk location map of the new kernel (lilo ?)

Unfortunatelly, this can happen very easily if one of the package that is loaded during an 'apt-get upgrade' happens to fail to install (recent exemple : manpages-dev and modutils conflict over a single file). However, this can also occur for other various reasons (power
outtage, CTRL-C, etc..)

The, hmmm.. solution (?) - would be to actually *install* the new kernel ONLY when all steps have been taken to ensure that the system is ready (or about ready) to boot that kernel
(read : initrd is ready)..

There is probably also a problem with /lib/modules.. I believe the solution here is to unload the /lib/modules somewhere else, chroot to create the initrd, and mv the right /lib/modules/XXX just before finishing linux-image package installation setup.

It is possible the previously mentioned solutions are not applicable to the way dpkg/apt work. But I am not familiar enough with the debian install procedures to tell whether this
is the case or not.

It may also be impossible to completelly remove any critical time window (eg: lilo update needs everything to be in place first) - but at least it could be reduced to encompass only a single installation step.

If it is believed this report belongs to another place (apt, dpkg, etc..) please
don't hesitate to say so - I'll report wherever it is necessary.

Finally - the workaround is usually to boot from a rescue medium (or another kernel if feasable) and restart the installation process - until the kernel is 'setup' properly.

-- System Information:
Debian Release: testing/unstable
 APT prefers unstable
 APT policy: (500, 'unstable')
Architecture: powerpc (ppc64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-vserver-powerpc64




Reply to: