Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Kernel build, what does "#make install" do?

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

Kernel build, what does "#make install" do?

  • Quote

Post by MickeJ » Mon May 29, 2023 9:24 pm

Hi, i am a newbee and planning a Gentoo install.

When reading the documentation https://wiki.gentoo.org/wiki/Handbook:A ... installing. It says
When the kernel has finished compiling, copy the kernel image to /boot/. This is handled by the make install command: This will copy the kernel image into /boot/ together with the System.map file and the kernel configuration file.
Does it mean just copy bin and artifacts to /boot folder on root? Or does it do more fancy thing like copy to sda1 /boot/EFI/? Does it run efibootmgr? What does it do?
Top
saturnalia0
Apprentice
Apprentice
Posts: 172
Joined: Thu Oct 13, 2016 3:09 am

  • Quote

Post by saturnalia0 » Mon May 29, 2023 9:48 pm

I don't know if Gentoo does anything in particular, but looking at the kernel's Makefile it hints that the install target is handled by /sbin/installkernel:

Code: Select all

# ---------------------------------------------------------------------------
# Install

# Many distributions have the custom install script, /sbin/installkernel.
# If DKMS is installed, 'make install' will eventually recurse back
# to this Makefile to build and install external modules.
# Cancel sub_make_done so that options such as M=, V=, etc. are parsed.

quiet_cmd_install = INSTALL $(INSTALL_PATH)
      cmd_install = unset sub_make_done; $(srctree)/scripts/install.sh
Which, in turn, seems to be borrowed from Debian. Glancing over that file it does not seem to call efibootmgr, but in the absence of a response from someone more knowledgeable take a look at it yourself to figure out what it does or does not do.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Mon May 29, 2023 10:22 pm

MickeJ,

Welcome to Gentoo Forums !

I can confirm that "make install" copies only 3 files to /boot (*): Your kernel, your .config-file and your system.map. With this copy it also adds a version string to them (and do a rename from .config to config; and a rename from bzImage to vmlinuz). AFAIK there is also a hook where you can configure more actions if you want.

Because you asked for efibootmgr ...

I am using UEFI as my bootmanager (no Grub) and I dont need a "make install" anymore; I am just "copying" my kernel to /boot/efi/USEDDIRECTORY/. after building my (new) kernel with (EXAMPLE):

Code: Select all

 /usr/src/linux # sbsign --key /mnt/stick/keys/DB.key --cert /mnt/stick/keys/DB.crt --output /boot/efi/secure/bzImage.efi arch/x86/boot/bzImage
:lol:

(* For this you must have mounted your /boot BEFORE doing the "make install" ... ;-) )
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Mon May 29, 2023 10:46 pm

Thx!

Greate news. Yepp i want the same, just use my hardware bootloader EFI app (Lenovo) and booting "direct" into a UKI kernel. Just manually copy and run efibootmgr.

I wish the "make install" output used "/usr/lib/kernel/version/" instead of "/boot" Makes no sense to use a "/boot" directory when the vmlinuz file is on another block device. Instead put it on /usr or /var.
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Mon May 29, 2023 10:51 pm

And also thx for this example as inspiration :D

/usr/src/linux # sbsign --key /mnt/stick/keys/DB.key --cert /mnt/stick/keys/DB.crt --output /boot/efi/secure/bzImage.efi arch/x86/boot/bzImage
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue May 30, 2023 12:42 am

For many many years, /boot has been traditional because it is a special-purpose filesystem, often kept unmounted, that exists solely to hold the early boot environment (kernel, initramfs, bootloader configuration). Putting it on /usr or /var would be unusable on typical encrypted-disk systems.

You can direct make install about where to write by setting INSTALL_PATH in the Make environment. You could also choose to skip make install entirely and manage copying the files through your own script, since there are few files and their names are predictable.
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2401
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Tue May 30, 2023 8:39 am

The default installkernel will maintain symlinks "vmlinuz", etc and "vmlinuz.old" etc. This gives one advantage of having kernels on a modern filesystem (symlinks) rather than the antique floppy disk stuff used for the EFI partition, and means rather whimsically that you don't need to reconfigure GRUB to a new kernel every time you update it (whatever Ubuntu decides to the contrary), but annoyingly can't handle if you use the EFI stub in an EFI partition.

You can easily rewrite installkernel to rename your current kernel to "vmlinuz.old.efi" and copy your new kernel to "vmlinuz.efi", in which case you need just two fixed efibootmgr entries; the downside is you can't tell what versions the current and old kernels are from outside ("file vmlinuz.efi" works fine once Linux is running), and you have only one level of fallback.

(Me, I prefer to keep vmlinuz.new (just installed, testing), vmlinuz, vmlinuz.old (in case I rename .new as current too soon and then find a bug) and vmlinuz-V.R-1.foo if vmlinuz-V.R.bah is current - since the .foo releases are just fix levels, not different releases. So I have a hairy grub.cfg that can handle all of this without needing to reconfigure on a new release).
Greybeard
Top
MickeJ
n00b
n00b
Posts: 13
Joined: Mon May 29, 2023 7:56 pm

  • Quote

Post by MickeJ » Tue May 30, 2023 1:55 pm

Ok, thx for feedback. I am educating me before installing because i think the install and daily use is sort of same thing in Gentoo. I think Portage makes it very flexible but with also simple when you have settled down and just want a defined world to be your regular daily driver. I just was curious before i spend time.

I put my Intel cpu firmware and I915 into two initrd located in a separate folder from the kernel in /EFI because they very seldom changes. And i reuse those initrds when booting other distros.
This is approx the efibootmgr i am planning to use. Its ok if manually create this, but long term a automated way would be better ofc. I am thinking about editing the cmake kernel make file, but that is a later issue. Agreed on keeping a old kernel to boot after a update.

Code: Select all

efibootmgr --create --disk /dev/sda --part 1 --label "Gentoo 6.3.4" --loader \\EFI\\Gentoo\\vmlinuz-6.3.4 --unicode "root=UUID=00f79e37-5467-4c53-d987-7935269c4383 rootfstype=brtfs rootflags=subvol=root initrd=/EFI/initrd/intel-cpu-ucode.cpio initrd=/EFI/initrd/i915-firmware.cpio init=/usr/bin/systemd
Top
Post Reply

8 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy