#411 Update a couple of commands for custom kernel cleanup
Merged a year ago by pboy. Opened 2 years ago by nielsenb.
fedora-docs/ nielsenb/quick-docs build-custom-kernel-cleanupfix  into  main

@@ -330,19 +330,16 @@ 

  

  [source,bash]

  ----

- rm -f /boot/config-2.6.*dave* /boot/initrd-2.6.*dave* /boot/vmlinuz-*dave* /boot/System.map-*dave*

- rm -rf /lib/modules/2.6*dave*

+ rm -f /boot/config-*dave* /boot/initramfs-*dave* /boot/vmlinuz-*dave* /boot/System.map-*dave*

+ rm -rf /lib/modules/*dave*

  ----

  

- Finally, you will need to remove the kernel as an option to your bootloader.

- This will change from architecture to architecture. For x86, (as root), edit

- `/boot/grub2/grub.cfg` or `/boot/efi/EFI/fedora/grub.cfg` if you have EFI enabled

- and delete the four lines relating to your kernel (They should be easy to spot,

- they'll be the ones with your tag). They'll look something like:

+ Finally, you will need to remove the kernel as an option in your bootloader.

+ Assuming your system is running grub2, this can be done by removing the

+ bootloader specification entries and rebuilding the grub config:

  

+ [source,bash]

  ----

- title Fedora Core (2.6.22-rc3-dave)

- root (hd0,0)

- kernel /vmlinuz-2.6.22-rc3-dave ro root=/dev/md0

- initrd /initrd-2.6.22-rc3-dave.img

+ rm -f /boot/loader/entries/*dave*

+ grub2-mkconfig -o /boot/grub2/grub.cfg

  ----

Fedora doesn't seem to use "initrd" anymore, so show removing "initramfs" instead.

Fedora uses the Boot Loader Specification[0] for defining boot entries, the grub config should rarely need to be edited by hand. Show removing the drop in entries made by installing the custom kernel, and rebuilding the grub config.

I also removed the kernel version references as they weren't used consistently, and kernel versions change faster now making it more likely there will be more likely to have "dave" kernels of different versions.

Someone should definitely double check this with a fine tooth comb since it discusses deleting things in /boot.

[0] - https://systemd.io/BOOT_LOADER_SPECIFICATION/

Metadata Update from @mattdm:
- Pull-request tagged with: help wanted, needs committer review

2 years ago

rebased onto 2ec581436194102276fa6e8f0e6c4647f1e9e0d3

2 years ago

Why leave all the manual work now? The simple way would be to call 'kernel-install add' for installation and 'kernel-install remove' for the removal. This will take care of all of the relevant bits, and is exactly what the kernel.spec does for install or removal.

It actually looks as though most of the doc needs to be rewritten. It does not take into account the kernel-ark workflow that Fedora has been using for quite some time now.

Why leave all the manual work now? The simple way would be to call 'kernel-install add' for installation and 'kernel-install remove' for the removal. This will take care of all of the relevant bits, and is exactly what the kernel.spec does for install or removal.

I see where kernel-install is used in the specfile, but I'll be darned if I can figure out how to use it to install a kernel built from git:

$ sudo kernel-install add 5.18.0-rc6-installtest arch/x86_64/boot/bzImage
dracut: Cannot find module directory /lib/modules/5.18.0-rc6-installtest/
dracut: and --no-kernel was not specified

It actually looks as though most of the doc needs to be rewritten. It does not take into account the kernel-ark workflow that Fedora has been using for quite some time now.

The section being edited here is specifically targeted at building from Linus' tree for testing patches. Does the kernel-ark workflow make this easier or more intuitive for a regular user? It feel to me like documenting building and running a kernel directly from Linus' git tree (possibly with patches applied) still has value, but I could be wrong.

I am guessing you skipped the:

sudo make modules_install
sudo make install

bits from above in this document. You still have to do that. kernel-install handles dracut, the boot entries, etc but it does expect the files already exist in /lib/modules

It actually looks as though most of the doc needs to be rewritten. It does not take into account the kernel-ark workflow that Fedora has been using for quite some time now.

The section being edited here is specifically targeted at building from Linus' tree for testing patches. Does the kernel-ark workflow make this easier or more intuitive for a regular user? It feel to me like documenting building and running a kernel directly from Linus' git tree (possibly with patches applied) still has value, but I could be wrong.

Yes in that linus' tree is already in the kernel-ark tree as master, as are the upstream stable trees as linux-5.x.y branches, and there is a separate branch that can be merged onto any kernel git tree that adds the fedora config and build tools, but the comment was not directed at this PR directly. The kernel-install comments were directed at this PR, the other comment was directed at the fact that this document should have never migrated from the wiki to here to begin with.

Yes in that linus' tree is already in the kernel-ark tree as master, as are the upstream stable trees as linux-5.x.y branches, and there is a separate branch that can be merged onto any kernel git tree that adds the fedora config and build tools, but the comment was not directed at this PR directly. The kernel-install comments were directed at this PR, the other comment was directed at the fact that this document should have never migrated from the wiki to here to begin with.

Are you saying there is other documentation that should have been migrated instead, or that the wiki page content should have been updated when it migrated to quick-docs?

At first blush I'm not sure it wouldn't be better if I added a bit of installation guidance to the kernel-ark documentation and then made this whole quick-doc point at the kernel-ark documentation.

Yes in that linus' tree is already in the kernel-ark tree as master, as are the upstream stable trees as linux-5.x.y branches, and there is a separate branch that can be merged onto any kernel git tree that adds the fedora config and build tools, but the comment was not directed at this PR directly. The kernel-install comments were directed at this PR, the other comment was directed at the fact that this document should have never migrated from the wiki to here to begin with.

Are you saying there is other documentation that should have been migrated instead, or that the wiki page content should have been updated when it migrated to quick-docs?

Well, the kernel-ark documentation is slightly more useful though it needs a little bit of work to catch up to the full intent of this doc, but by the time the wiki was migrated to quick docs, this document should not have been included as it is pretty out of date. It points to trees that are not longer updated, etc.

At first blush I'm not sure it wouldn't be better if I added a bit of installation guidance to the kernel-ark documentation and then made this whole quick-doc point at the kernel-ark documentation.

That may be the better path forward.

rebased onto 101096c

2 years ago

@nielsenb Can we chat about how to proceed here?

@pboy I have unfortunately had very little time to commit to Fedora lately, hopefully things should be clearing up soon.

I will say this went pretty far outside my wheelhouse once it changed from "making the documentation in Quick Docs work again" to "learn how to actually use Kernel Ark, update that documentation, then circle back here". I'm still glad to do it, but it won't happen fast. Any guidance given would probably make it happen faster.

@nielsenb many thanks for reply! I'm just (desperately) trying to fix (or organize a fix to) all the longstanding issues and to revive the docs team. At least we have some success with that. The next time you will hopefully contribute, to my best effort, there will be no more such delays and non-observance as occurred in the last 2–3 years.

Regarding this article, unfortunately, the last kernel I build was about a decade ago. So I can't decide, what to do here.

I also contacted @jforbes, but he didn't answer so far.

Another objective of mine is not to waste any effort made by community members. To that extent, at the moment I'm leaning towards running the PR, unless you as the author advise against it or want to update something beforehand. Or if concrete suggestions come from jforbes.

Pull-Request has been merged by pboy

a year ago

Merged the pull request based on the 14 days rule. Attempts to obtain further information (devel mailing list, direct inquiries) were unsuccessful. There is no specific rejection of the proposed changes, but general criticism of the timeliness of the article with regard to current developments.