Open mudler opened 3 years ago
This issue seems related to three distinct issues:
[x] mocaccino-dracut script issue: We need to drop or integrate the old logic that it uses the kernel initrd to identify what initrd to generate
[x] kernel packages: we need to create the bzimage , initrd links used by Mocaccino Micro through kernel-switcher
. So, the creation of bzimage, initrd on kernel packages must be removed
[x] kernel-switcher: to integrate the management of bzimage, initrd links
Old images should be removed also.
Implemented experimental feature:
mos kernel geninitrd
that will replace kernel-upgrade and mocaccino-dracut to support multiple kernels setup, links and grub config generation.
https://github.com/mocaccinoOS/mos-cli/commit/17e3553c7ee07d7696e6f36ac2fdb64d2dd67e38
# mos kernel geninitrd --help
Rebuild Dracut initrd images or for Mocaccino Micro fix links.
$ # Generate all initrd images of the kernels available on boot dir.
$ mos kernel geninitrd --all
$ # Generate all initrd images of the kernels available on boot dir
$ # and set the bzImage, Initrd links to one of the kernel available
$ # if not present or to the next release of the same kernel after the
$ # upgrade.
$ mos kernel geninitrd --all --set-links
$ # Just show what dracut commands will be executed for every initrd images.
$ mos kernel geninitrd --all --dry-run
$ # Generate the initrd image for the kernel 5.10.42
$ mos kernel geninitrd --version 5.10.42
$ # Generate the initrd image for the kernel 5.10.42 and kernel type vanilla.
$ mos kernel geninitrd --version 5.10.42 --ktype vanilla
$ # Generate the initrd image for the kernel 5.10.42 and kernel type vanilla
$ # and set the links bzImage, Initrd to the selected kernel/initrd.
$ mos kernel geninitrd --version 5.10.42 --ktype vanilla
Usage:
mos kernel geninitrd [flags]
Aliases:
geninitrd, gi
Flags:
--all Rebuild all images with kernel.
--bootdir string Directory where analyze kernel files. (default "/boot")
--dracut-opts string Override the default dracut options used on the initrd image generation.
Set the MOS_DRACUT_ARGS env in alternative.
--dry-run Dry run commands.
--grub Update grub.cfg.
-h, --help help for geninitrd
--ktype string Specify the kernel type of the initrd image to build.
--purge Clean orphan initrd images without kernel.
--set-links Set bzImage and Initrd links for the selected kernel or update links of the upgraded kernel.
--version string Specify the kernel version of the initrd image to build.
Global Flags:
--config string config file (default is $HOME/.mos.yaml)
Fail to upgrade or switch kernel in MOS Desktop, before, but at least verified from 18 April 2021 builds.
Luet version: Not relevant, a packaging issue
CPU architecture, OS, and Version: MOS Desktop
Describe the bug Upgrading kernels or switching fails. I've tried to uninstall the standard kernel and install the lts, and it fails as grub doesn't have either an Initrd entry, and dracut seems to complain during the process
To Reproduce
Same thing probably happens during upgrades
Expected behavior System booting
Logs Installing two kernels at the same time instead fails for unproper symlink handling:
This is by doing uninstall and install:
Additional context