Activity log for bug #1918427

Date Who What changed Old value New value Message
2021-03-10 12:48:21 Date Huang bug added bug
2021-03-10 12:49:12 Date Huang attachment added patch-1 https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5475375/+files/%5BPatch%201%5D0001-curthooks-fix-arm64-will-install-flash-kernel-unexpe%20%281%29.patch
2021-03-10 12:49:37 Date Huang attachment added patch-2 https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5475376/+files/%5BPatch%202%5D0001-curthooks-avoid-that-arm64-uefi-system-install-flash%20%281%29.patch
2021-03-10 12:49:55 Date Huang attachment added patch-3 https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5475377/+files/%5BPatch%203%5D0001-curthooks-always-install-flash-kernel-in-arm-arm64-s%20%281%29.patch
2021-03-10 16:25:48 Ubuntu Foundations Team Bug Bot tags patch
2021-03-10 16:25:57 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Review Team
2021-03-12 12:16:24 Taihsiang Ho bug added subscriber Taihsiang Ho
2021-03-12 18:18:23 dann frazier bug task added cloud-images
2021-03-12 18:18:48 dann frazier bug task added linux (Ubuntu)
2021-03-12 18:30:14 Ubuntu Kernel Bot linux (Ubuntu): status New Incomplete
2021-03-12 18:56:02 dann frazier linux (Ubuntu): status Incomplete In Progress
2021-03-12 18:56:04 dann frazier linux (Ubuntu): assignee dann frazier (dannf)
2021-03-12 19:01:24 dann frazier attachment added curtin_userdata_ubuntu_arm64_generic_focal_somehostname https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1918427/+attachment/5476155/+files/curtin_userdata_ubuntu_arm64_generic_focal_somehostname
2021-03-12 20:26:33 dann frazier cloud-images: status New Incomplete
2021-03-12 20:28:35 dann frazier attachment added log_m400_failed_deploy_focal-ms10-35-mcdivittB0-kernel.txt https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1918427/+attachment/5476159/+files/log_m400_failed_deploy_focal-ms10-35-mcdivittB0-kernel.txt
2021-03-15 23:17:10 dann frazier attachment added curtin.patch https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5476956/+files/curtin.patch
2021-03-15 23:17:28 dann frazier curtin (Ubuntu): status New Confirmed
2021-03-15 23:17:33 dann frazier cloud-images: status Incomplete Confirmed
2021-03-15 23:17:39 dann frazier curtin (Ubuntu): status Confirmed Triaged
2021-03-15 23:17:47 dann frazier curtin (Ubuntu): status Triaged Confirmed
2021-03-16 10:03:49 Date Huang attachment added install_bootloader_in_last_stage https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5477121/+files/0001-curthooks-install-bootloader-after-kernel-is-install.patch
2021-03-17 02:52:50 Date Huang attachment added dpkg-divert.log https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5477384/+files/dpkg-divert.log
2021-03-17 03:25:39 Date Huang attachment added 0001-curthook-disable-arch-sepcific-package-in-disable_up.patch https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5477385/+files/0001-curthook-disable-arch-sepcific-package-in-disable_up.patch
2021-03-17 03:38:47 Date Huang attachment removed 0001-curthook-disable-arch-sepcific-package-in-disable_up.patch https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5477385/+files/0001-curthook-disable-arch-sepcific-package-in-disable_up.patch
2021-03-17 03:39:35 Date Huang attachment added 0001-curthook-disable-arch-sepcific-package-in-disable_up.patch https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1918427/+attachment/5477388/+files/0001-curthook-disable-arch-sepcific-package-in-disable_up.patch
2021-03-31 03:30:31 Launchpad Janitor linux (Ubuntu): status In Progress Fix Released
2021-03-31 03:30:31 Launchpad Janitor cve linked 2020-27170
2021-03-31 03:30:31 Launchpad Janitor cve linked 2020-27171
2021-06-29 17:18:54 dann frazier nominated for series Ubuntu Focal
2021-06-29 17:18:54 dann frazier bug task added linux (Ubuntu Focal)
2021-06-29 17:18:54 dann frazier bug task added curtin (Ubuntu Focal)
2021-06-29 17:18:54 dann frazier nominated for series Ubuntu Hirsute
2021-06-29 17:18:54 dann frazier bug task added linux (Ubuntu Hirsute)
2021-06-29 17:18:54 dann frazier bug task added curtin (Ubuntu Hirsute)
2021-06-29 17:19:04 dann frazier linux (Ubuntu Hirsute): status New Fix Released
2021-06-29 20:33:58 dann frazier description I used APM Mustang which flash-kernel supported in u-boot mode. But I used it with UEFI environment. It will cause fatal error when I used ARM64 ubuntu live server ISO to install system. In code[1], this will not install `flash-kernel` for APM Mustang because of UEFI. So that means code[2] will not disable `flash-kernel` in target system, only disable `update-initramfs`. When curtin execute to `install_kernel` stage, code[3,4] will not install `flash-kernel` either. But in code[5], it will install `linux-generic`. `linux-generic` has a long dependency tree and it will get `flash-kernel` in Recommended field. Apt by default will install Recommended package before kernel is installed.[6] So it will still execute `zz-flash-kernel` and `flash-kernel` when installing kernel. But system didn't create any `initrd.img` ever because curtin disable `update-initramfs` in code[2]. This will cause that `flash-kernel` cannot find `initrd.img.<kvers>` and fail when installing it. This issue didn't effect all ARM64 UEFI platform because `flash-kernel` didn't support them and skip.[7] I'm not sure which is best solution for this. But I think we should apply PR-27 in `flash-kernel`[8] for enhancement and fix curtin process with this patch both. If we only apply PR-27, it should work fine as well because it will be skipped when detecting UEFI and install `flash-kernel` before `disable_update_initranfs` in ARM platform without UEFI.[9] [Patch-1,2,3] might have side effect. Picking one patch for curtin should be enough. But I need your advice for this to determine which one is better for curtin. There are two categories 1. avoid installing flash-kernel if no need, [Patch1,2] 2. always install flash-kernel in arm/arm64 and make sure it be installed before code[2] [Patch3] (I will attach patch in reply.) Thanks a lot Regards, Date [1] https://github.com/canonical/curtin/blob/master/curtin/deps/__init__.py#L57-L58 [2] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L1693-L1699 [3] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L365-L370 [4] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L311-L327 [5] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L372-L374 [6] https://github.com/Debian/apt/blob/master/apt-pkg/init.cc#L132 [7] https://salsa.debian.org/installer-team/flash-kernel/-/blob/master/functions#L787 [8] https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/27 [9] curtin will insert `flash-kernel` into `REQUIRED_EXECUTABLES` when system is arm/arm64 without UEFI. [Impact (linux)] The only package that currently satisfies the bootloader Recommends relationship on ARM systems is flash-kernel. This ignores EFI-based systems, which will instead require GRUB. Our installers know to install GRUB anyway - but flash-kernel also gets installed. Normally flash-kernel realizes it is not needed and just exits - so the impact is limited to wasting space and CPU cycles on each kernel update. However, there can be cases where calling flash-kernel can cause problems. The original report here describes one where flash-kernel thinks it recognizes the system and tries to run anyway, when in fact GRUB is the correct boot loader. [Test Case (linux)] On an arm64 system, confirm that grub-efi-arm64 is an option in the Recommends field: $ apt show linux-image-unsigned-5.4.0-78-generic | grep Recommends WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Recommends: flash-kernel | grub-efi-arm64, initramfs-tools | linux-initramfs-tool [What Could Go Wrong (linux)] First let me describe the mitigations against something going wrong. The proposed patch was already in the hirsute kernel at the time of hirsute GA, so it's had some real world testing, including in our installers. In addition, the patch still leaves flash-kernel as the *default* bootloader Recommends (first in the |'d list) - it only adds grub-efi-arm64 as a secondary option, preventing the installation of flash-kernel if GRUB is already there. So, the only scenario where I can see a problem might be if something depends on flash-kernel getting installed due to a Recommends even though GRUB is already present. = Original Report Follows = I used APM Mustang which flash-kernel supported in u-boot mode. But I used it with UEFI environment. It will cause fatal error when I used ARM64 ubuntu live server ISO to install system. In code[1], this will not install `flash-kernel` for APM Mustang because of UEFI. So that means code[2] will not disable `flash-kernel` in target system, only disable `update-initramfs`. When curtin execute to `install_kernel` stage, code[3,4] will not install `flash-kernel` either. But in code[5], it will install `linux-generic`. `linux-generic` has a long dependency tree and it will get `flash-kernel` in Recommended field. Apt by default will install Recommended package before kernel is installed.[6] So it will still execute `zz-flash-kernel` and `flash-kernel` when installing kernel. But system didn't create any `initrd.img` ever because curtin disable `update-initramfs` in code[2]. This will cause that `flash-kernel` cannot find `initrd.img.<kvers>` and fail when installing it. This issue didn't effect all ARM64 UEFI platform because `flash-kernel` didn't support them and skip.[7] I'm not sure which is best solution for this. But I think we should apply PR-27 in `flash-kernel`[8] for enhancement and fix curtin process with this patch both. If we only apply PR-27, it should work fine as well because it will be skipped when detecting UEFI and install `flash-kernel` before `disable_update_initranfs` in ARM platform without UEFI.[9] [Patch-1,2,3] might have side effect. Picking one patch for curtin should be enough. But I need your advice for this to determine which one is better for curtin. There are two categories 1. avoid installing flash-kernel if no need, [Patch1,2] 2. always install flash-kernel in arm/arm64 and make sure it be installed before code[2] [Patch3] (I will attach patch in reply.) Thanks a lot Regards, Date [1] https://github.com/canonical/curtin/blob/master/curtin/deps/__init__.py#L57-L58 [2] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L1693-L1699 [3] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L365-L370 [4] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L311-L327 [5] https://github.com/canonical/curtin/blob/master/curtin/commands/curthooks.py#L372-L374 [6] https://github.com/Debian/apt/blob/master/apt-pkg/init.cc#L132 [7] https://salsa.debian.org/installer-team/flash-kernel/-/blob/master/functions#L787 [8] https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/27 [9] curtin will insert `flash-kernel` into `REQUIRED_EXECUTABLES` when system is arm/arm64 without UEFI.
2021-06-29 20:34:05 dann frazier linux (Ubuntu Focal): status New In Progress
2021-06-29 20:34:07 dann frazier linux (Ubuntu Focal): assignee dann frazier (dannf)
2021-07-06 07:47:45 Stefan Bader linux (Ubuntu Focal): importance Undecided Medium
2021-07-06 07:47:52 Stefan Bader linux (Ubuntu Hirsute): importance Undecided Medium
2021-07-15 16:41:15 Kleber Sacilotto de Souza linux (Ubuntu Focal): status In Progress Fix Committed
2021-07-21 15:00:26 Ubuntu Kernel Bot tags patch patch verification-needed-focal
2021-08-04 14:34:04 dann frazier tags patch verification-needed-focal patch verification-done-focal
2021-08-12 20:35:44 Launchpad Janitor linux (Ubuntu Focal): status Fix Committed Fix Released
2022-01-26 22:00:27 Brian Murray curtin (Ubuntu Hirsute): status New Won't Fix