Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705092 - genkernel-4: force mount /boot
Summary: genkernel-4: force mount /boot
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-10 08:11 UTC by Alexandr Tiurin
Modified: 2020-01-10 18:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Tiurin 2020-01-10 08:11:50 UTC
I running genkernel  in chroot binhost environment. In chroot not need mount /boot.

# genkernel --no-mountboot  all

* Gentoo Linux Genkernel; Version 4.0.1
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --no-mountboot all

* Working with Linux kernel 4.19.86-gentoo for x86_64
* Using kernel config file '/usr/share/genkernel/arch/x86_64/generated-config' ...
* 
* Note: The version above is subject to change (depends on config and status of kernel sources).
* ERROR: Boot partition is not mounted on '/boot' and I am not allowed to mount due to set --no-mountboot option!
* Please consult '/var/log/genkernel.log' for more information and any
* errors that were reported above.


Reproducible: Always
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-10 12:43:57 UTC
...but you still told genkernel to *install* things which means genkernel should install something into /boot by default.

How should we do that when /boot isn't mounted and you told genkernel to mount it? 

If you run without /boot for some reason *on* purpose, you will also have to set --no-install.

If you think I missed your point please write in detail what you are doing and what do you expect. Closing as INVALID for now.
Comment 2 Alexandr Tiurin 2020-01-10 14:38:07 UTC
Why genkernel trying mount boot partition if no-mountboot option is present? The boot directory is present
# file /boot
/boot: directory
thus It's enough for install vmlinuz (etc) to /boot.

With genkernel 3 there was no such behavior. Olny "WARNING: No mounted /boot partition detected!" was present.

 # genkernel --no-mountboot  all
* Gentoo Linux Genkernel; Version 3.5.3.3
* Running with options: --no-mountboot all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
* Linux Kernel 4.19.86-gentoo for x86_64...
* .. with config file /etc/kernels/kernel-config-x86_64-4.19.86-gentoo
* WARNING: No mounted /boot partition detected!
*          Run mount /boot to mount it!

* kernel: Using config from /usr/src/linux/.config
* kernel: --mrproper is disabled; not running 'make mrproper'.
*         >> Running oldconfig...
* kernel: --clean is disabled; not running 'make clean'.
*         >> Compiling 4.19.86-gentoo bzImage...
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-10 18:16:10 UTC
You are commanding genkernel to compile kernel and install created kernel image  into bootdir.

Genkernel will detect that set bootdir (/boot by default) is a mountpoint (check /etc/fstab!).

Because you also told genkernel that genkernel should *not* try to mount boot, genkernel now knows that you are going to shoot yourself into the foot:

For example, if you really assume that kernel was installed to bootdir when genkernel ended with return code 0, you ended up with kernel in mount_dir_ but not in mount_point_.

To make this more obvious:

It's recommended to protect a mountdir with something like

umount /boot
chmod 400 /boot
chattr +i /boot

This way you will prevent that anything will write to that location when nothing is mounted (so you don't lose data and nothing will get overshadowed).

When using genkernel-3, you would fail at this stage because cp would fail (https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_funcs.sh?h=v3.5.3.3#n386).

In genkernel-4 we just prevent that failure *earlier* (e.g. we try to error out as soon as possible).


tl;dr
--no-mountboot usually implies --no-install or you should really know what you are doing.

If you want to lie to genkernel make sure that there is no /boot in /etc/fstab.