Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel upgrade/switch fails, and multiple installed at the same time too #5

Open
mudler opened this issue Apr 18, 2021 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@mudler
Copy link
Contributor

mudler commented Apr 18, 2021

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

luet uninstall -y kernel/mocaccino-full && luet install -y kernel/mocaccino-lts-full

Same thing probably happens during upgrades

Expected behavior
System booting

Logs
Installing two kernels at the same time instead fails for unproper symlink handling:
VirtualBox_desktop_18_04_2021_11_59_59

This is by doing uninstall and install:
VirtualBox_desktop_18_04_2021_12_08_58

Additional context

@mudler mudler added the bug Something isn't working label Apr 18, 2021
@mudler mudler assigned mudler and geaaru and unassigned geaaru and mudler Apr 18, 2021
@geaaru
Copy link
Contributor

geaaru commented Apr 19, 2021

This issue seems related to three distinct issues:

  • 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

  • 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

  • kernel-switcher: to integrate the management of bzimage, initrd links

@msdobrescu
Copy link
Contributor

Old images should be removed also.

@geaaru
Copy link
Contributor

geaaru commented Jun 18, 2021

Implemented experimental feature:
mos kernel geninitrd that will replace kernel-upgrade and mocaccino-dracut to support multiple kernels setup, links and grub config generation.

mocaccinoOS/mos-cli@17e3553

# 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants