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

Bug#794403: flash-kernel: command "update-initramfs -uk <kver>" result in boot images in false version



Dear Ian,

Thanks for your detailed comments!

> I think your patch will break things by automatically installing (via
> the initramfs hook in the kernel postinst) whatever kernel was most
> recently installed/upgraded, instead of the latest kernel by version.
> We do not want this: consider people who still have stable+testing in
> their sources.list and the stable+testing kernel's both installed, they
> are expecting to use the testing kernel and do not want to get a
> surprise stable kernel installed whenever a DSA is issued against the
> Linux package in stable.

I understand your concern.
Yes, the patch will change the behavior as the case you mentioned.
However I feel it's still strange by current mechanism, using your
case as example, the "testing" kernel images will get rebuilt when DSA
(to "stable") is issued.
In this case I think only stuff related to stable kernel can be
modified, and all testing kernel stuff should be left untouched.

So I consider there's a "bug" here need to be fixed.

> An acceptable alternative to your patch might be to add support for a
> new option in /etc/default/flash-kernel e.g. LINUX_KERNEL_VERSION which
> names an explicit version which is the one which should should always
> be installed in flash (unless overridden on the command line). Care
> would need to be taken that the kernel exists and to do the right thing
> if it is is removed.

I like the idea to introduce an option for kernel version, but I also
feel terrible considering that option need to be updated manually when
kernel ABI gets changed.
I see there're a few scripts under /etc/kernel/postinst.d/ which seems
to monitor the kernel ABI changing. (also noticed the existence of
flash-kernel script there...)

I'm not familiar with that part, so need some time to go over.

> I think a suitable algorithm for determining the version would be to
> consider in order:
>
>      1. The version on the command line, if any. If one is given but
>         doesn't exist then error out.
>      2. The version from /etc/default/flash
>         -kernel:$LINUX_KERNEL_VERSION, if it doesn't exist then fall
>         through to next option(*) with a big fat warning printed.
>      3. The currently installed version with the greatest version
>         number.

I feel comfortable with this order.
And I think there need to be added another rule: only if the kernel
version (deciding from the order list) matches the <kver> from
update-initramfs command, the flash-kernel should not update boot
images otherwise.

> The fall through from option 2 to option 3 is important, otherwise a
> kernel removal/upgrade/install (which invokes flash-kernel) may find
> itself unable to complete if the desired kernel is missing and abort
> the whole operation, which will be potentially tricky to recover from
> since it will block further apt/dpkg operations until it is sorted out.
> Installing the latest kernel if the preferred option is not available
> seems better than failing in this case.
> People who then want to boot an older kernel could set
> LINUX_KERNEL_VERSION and call flash-kernel to make it take effect.

I totally agree.
Thanks for your consideration in overall!
I'll think your points over again, and try to work out a solution.

Cheers,
Roger


Reply to: