Page 1 sur 1

[kernel] Kernel unifié

Publié : mar. 05 août 2025, 13:17
par albireo
Bonjour, j'essaie dans un VM arch d'installer le kernel unifié pour ne pas mourir idiot.

au lancement j'ai le splash screen ArchLinux puis ce message:
:: running early hook [udev]
Starting systemd-udevd version 257.7-2-arch
:: running hook [udev]
:: Triggering uevents...
:: running hook [keymap]
:: Loading keymap...done.
:: running hook [consolefont]
:: Loading console font...done.
:: performing fsck on 'UUID=a5228adb-5874-4272-a7d5-c682be48a758 '
:: mounting 'UUID=a5228adb-5874-4272-a7d5-c682be48a758' on real root
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on Your own. Good luck.
sh: can't access tty; job control turned aff
[rootfs ^1#
le problème vient de /sbin/init qui n'existe pas

Voilà la configuration de la VM
lsblk
vda 254:0 0 30G 0 disk
├─vda1 254:1 0 1G 0 part /efi
└─vda2 254:2 0 29G 0 part /var/cache
/var/log
/home
/
ls -l /dev/disk/by-uuid
lrwxrwxrwx 1 root root 10 5 août 14:38 a5220adb-5874-4272-a7d5-c602be48a758 -> ../../vda2
lrwxrwxrwx 1 root root 10 5 août 14:38 D170-DDB2 -> ../../vda1

[bruno@archbtrfs grub.d]$ sudo btrfs subvolume list /
ID 256 gen 299 top level 5 path @
ID 257 gen 301 top level 5 path @home
ID 258 gen 11 top level 5 path @var
j'ai procédé comme suit pour le kernel:
pacman -S systemd-ukify

nano /etc/cmdline.d/root.conf
root=UUID=a5220adb-5874-4272-a7d5-c602be48a758 rw

nano /etc/cmdline.d/security.conf
lsm=landlock,lockdown,yama,integrity,apparmor,bpf audit=1 audit_backlog_limit=256

modification de
/etc/mkinitcpio.d/linux.preset

# mkinitcpio preset file for the 'linux' package

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
#default_image="/boot/initramfs-linux.img"
default_uki="/efi/EFI/Linux/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
#fallback_image="/boot/initramfs-linux-fallback.img"
fallback_uki="/efi/EFI/Linux/arch-linux-fallback.efi"
fallback_options="-S autodetect"

mkdir /efi/EFI/Linux
mkinitcpio -p

cd /etc/grub.d
nano 40_custom
menuentry "Arch_unified" {
insmod fat
insmod chain
search --no-floppy --set=root --fs-uuid D170-DDB2
chainloader /EFI/Linux/arch-linux.efi
}

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

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 13:55
par benjarobin
Sauf erreur de ma part, mais a5220adb-5874-4272-a7d5-c602be48a758 n'est pas ta partition racine, mais ton volume BTRFS (après je ne maîtrise pas bien ce système de fichier).
Voir https://wiki.archlinux.org/title/Btrfs# ... me_as_root

Depuis le shell, quelle est la sortie de : ls /

Note: Si tu utilises un kernel unifié, autant utiliser systemd-boot qui est quand même bien plus simple. La seule limitation c'est que tu ne peux pas démarrer un OS qui est sur un autre disque que la partition ESP où est installé / démarré systemd-boot. Aussi la gestion du secure boot y est encore plus simple.

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 14:34
par albireo
Je ne suis pas un specialiste non plus et ta remarque me semble plus que pertinante. bref voilà le resultat demandé
[root@archbtrfs ~]# ls -l /
total 24
lrwxrwxrwx 1 root root 7 3 mai 21:26 bin -> usr/bin
drwxr-xr-x 1 root root 174 5 aoGt ©8:86 boot
druxr-xr-x 20 root root 3828 5 ao0t 16:25 dev
druxr-xr-x 3 root root 4896 1 janv. 1978 efi
drwxr-xr-x 1 root root 2652 5 ao0t 16:25 etc
drwxr-xr-x 1 root root 18 3 ao0t 12:58 home
Irwxrwxrwx 1 root root 7 3 mai 21:26 1lib -> usr/lib
lrwxrwxrwx 1 root root 7 3 mai 21:26 1ib64 -> usr/lib
druxr-xr-x 1 root root 8 3 mai 21:26 mnt
drwxr-xr-x 1 root root 8 3 mai 21:26 opt
dr-xr-xr-x 204 root root @ 5 ao0t 16:25 proc
drwxr-x--- 1 root root 232 5 aodt 12:51 root
druxr-xr-x 21 root root 568 5 ao0t 16:25 run
lruxruxrux 1 root root 7 3 mai 21:26 sbin -> usr/bin
drwxr-xr-x 1 root root 14 3 ao0t 18:39 srv
dr-xr-xr-x 13 root root @ 5 ao0t 16:25 suys
druxrwxrwt 9 root root 188 5 aodt 16:25 tmp
drwxr-xr-x 1 root root 80 5 aott 14:40@ usr
drwxr-xr-x 1 root root 116 5 ao0t 16:25 var
[root@archbtrfs ~]#
je vais essayer de chercher mais c'est pas urgent de toute façon

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 17:01
par benjarobin
Hum, je voulais dire : ls -l depuis le shell

Code : Tout sélectionner

Bailing out, you are on Your own. Good luck.
sh: can't access tty; job control turned aff
[rootfs ^1#
Mais sinon voir https://wiki.archlinux.org/title/Btrfs# ... me_as_root

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 18:00
par albireo
Ok je n'avais pas compris.
Je te donnes le résultat à partir d'une copie d'ecran passée par gimagereader pour l'avoir en texte. l'essentiel y est :D
[rootfs ~]# ls -l
-ru-r--r-- 10 4] 4 Jan 1 1970 VERSION
leuxruxrux 10 4] 7 Jan 1 1978 bin -> usr/bin
—ru-r--r-- 10 4] 3298 Jan 1 1970 buildconfig
—rw-r--r-- 18 4] 181 Jan 1 1978 config
—ru-r--r-- 10 4] 15183 Jan 1 1970 consolefont.psf
druxr-xr-x 12 8 a 3008 Aug 5 17:51 dev
-ru-r--r-- 10 4] 2 Jan 1 1978 early_cpio
druxr-xr-x 30 4] @ Jan 1 1978 etc
druxr—-xr-x 20 4] @ Jan 1 1978 hooks
—rWXr—Xr-x 10 4] 3325 Jan 1 1978 init
—ru-r--r-— 10 4] 15577 Jan 1 1978 init_functions
drwxr—-xr-x 30 4] 8 Jan 1 1978 kernel
—ru-r--r-— 10 4] 2855 Jan 1 1978 keymap.bin
—rw-r--r--— 18 4] 8 Jan 1 1978 keymap.utf8
Irwxrwxrwx 10 4] 7 Jan 1 1978 lib -> usr/lib
lrwxrwxrwx 10 4] 7 Jan 1 1978 1ib64 -> usr/lib
drwxr-xr-x 18 4] 76 Aug 5 B5:42 neuw_root
dr-xr-xr-x 179 0 4] @ Aug 5 17:51 proc
drwx————-- 20 4] 8 Aug 2 B1:28 root
drwxr—xr-x 60 4] 1286 Aug 5 17:51 run
Irwxrwxrwx 10 4] 7 Jan 1 1978 sbin -> usr/bin
dr—xr—-xr-x 13 0 4] @ Aug 5 17:51 sus
drwxr—-xr-x 20 4] 8 Aug 5 17:51 tmp
druxr-xr-x 58 %) @ Jan 1 1978 usr
drwxr—-xr-x 20 4] @ Jan 1 1978 var
[rootfs “1#
en fait /sbin/init existe et pointe vers busybox

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 18:22
par albireo
Je viens de regarder le script archinstall et il ne propose pas de kernel unifié avec grub, seulement avec system-boot !
Peut-être qu'il y a quelques problèmes pour passer les paramètres ?

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 19:46
par albireo
j'ai trouvé une solution qui fonctionne :
nano /etc/cmdline.d/root.conf
root=UUID=a5220adb-5874-4272-a7d5-c602be48a758 rootflags=subvol=@ rootfstype=btrfs rw quiet splash
par contre mkinitcpio ne fonctionne plus si les fichiers (initramfs-linux.img vmlinuz-linux) ne sont pas présent.
bon à creuser plus tard avec system-boot que je ne connais pas

Re: [kernel] Kernel unifié

Publié : mar. 05 août 2025, 21:17
par benjarobin
albireo a écrit : mar. 05 août 2025, 19:46par contre mkinitcpio ne fonctionne plus si les fichiers (initramfs-linux.img vmlinuz-linux) ne sont pas présent.
C'est à dire, ce n'est pas clair... mkinitcpio génère l'initramfs, donc aucun souci pour que ce fichier soit absent.

Et pour vmlinuz-linux ce fichier est copié lors de l'installation/mise à jour du kernel à l'emplacement indiqué par la variable ALL_kver qui est par défaut /boot/vmlinuz-linux. Si tu supprimes /boot/vmlinuz-linux et ensuite tente de lancer mkinitcpio, en effet cela ne va pas bien se passer.

Personnellement, j'ai changé la valeur de ALL_kver afin de copier le kernel ici /usr/lib/modules/vmlinuz-linux. Ce qui fait que je n'ai plus de fichier vmlinuz-linux dans /boot. J'ai dans /boot plus que le fichier UKI (fichier .efi)

Sinon aucun lien avec systemd-boot

Re: [kernel] Kernel unifié

Publié : mer. 06 août 2025, 07:18
par albireo
Ok, j'ai compris je n'ai plus dans /boot que boot et intel-ucode.
le kernel unifié se trouve dans /efi/EFI/Linux
c'est exactement ce que je voulais faire.

Oui pour systemd-boot que je ne connais pas, je vais essayer de le configurer mais c'est vrai qu'il n'y a aucun rapport c'est juste en remplacement de grub.
Depuis le temps que je suis sous Arch je n'ai jamais eu de gros problèmes donc en conséquence de quoi quand tout roule tout seul on oublie facilement la technique, et à mon age (70) il est important de faire travailler le cerveau :mrgreen: et faire de temps en temps une install nouvelle et relire les wikis.
Merci pour tes élcairages :D

Re: [kernel] Kernel unifié

Publié : mer. 06 août 2025, 10:32
par benjarobin
Personnellement, je suis passé à systemd-boot avec UKI car c'est la méthode la plus simple et la plus propre de mon point de vue afin de faire du secure boot.