You are not logged in.

#1 2022-12-09 05:38:02

diyfan
Member
Registered: 2022-04-05
Posts: 10

I managed to boot my arch linux system with chroot in initramfs

I managed to boot my arch linux system's initramfs with chroot rather that switch_root. systemd-udevd loads up fine and I managed to login to my desktop environent. To accomplish that I ran

 [rootfs]# exec chroot /new_root /usr/lib/systemd/systemd 

in the mkinitcpio initramfs emergency shell.

and it was successful. Are there any drawbacks switching the root like that over:

 [rootfs]# exec switch_root /new_root /usr/lib/systemd/systemd 

Last edited by diyfan (2022-12-09 05:39:29)

Offline

#2 2022-12-09 11:00:55

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,638

Re: I managed to boot my arch linux system with chroot in initramfs

Looking at the man pages of both commands switch_root starts systemd as init  , while chroot executes it as a command .

combining that with https://wiki.archlinux.org/title/Arch_boot_process indicates switch_root executes at final stage of early userspace .
chroot appears to be executed after the boot process has finished .

To me this suggests switch_root and chroot are so different they also have very different usecases .

What is your usecase ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB