be more acurate on switching root

This commit is contained in:
Tobias Powalowski 2023-06-18 16:46:01 +02:00
parent d10dad76e9
commit 191e54244f
5 changed files with 7 additions and 10 deletions

View file

@ -50,18 +50,17 @@ if [[ "${TTY}" = "tty1" ]]; then
rm -rf /lib/modules/*/extramodules
echo -e "\e[1mStep 4/4:\e[m Copying archboot rootfs to /sysroot..."
tar -C / --exclude="./dev/*" --exclude="./proc/*" --exclude="./sys/*" \
--exclude="./run/*" --exclude="./mnt/*" --exclude="./sysroot/*" \
--exclude="./run/*" --exclude="./mnt/*" --exclude="./tmp/*" --exclude="./sysroot/*" \
-clpf - . | tar -C /sysroot -xlspf - &>/dev/null
# cleanup mkinitcpio directories and files
rm -rf /sysroot/{hooks,install,kernel,new_root,sysroot} &>/dev/null
rm -f /sysroot/{VERSION,config,buildconfig,init} &>/dev/null
# systemd needs this for root_switch
touch /etc/initrd-release
sync
echo -e "\e[1;96mArchboot\e[m \e[1m- Arch Linux Environment finished.\e[m"
echo -e "\e[1mSystemd initrd-switch-root will be launched in a second...\e[m"
read -r -t 3
systemctl start initrd-switch-root
systemctl start initrd-switch-root.target
else
while true; do
read -r -t 1

View file

@ -383,14 +383,12 @@ _new_environment() {
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
echo -e "\e[1mStep ${_STEPS}/${_STEPS}:\e[m Switch root to ${_RAM}..."
mv ${_W_DIR}/tmp/* /${_RAM}/
rm -r /${_RAM}/mkinitcpio.*
# cleanup mkinitcpio directories and files
rm -rf /sysroot/{hooks,install,kernel,new_root,sysroot} &>/dev/null
rm -rf /sysroot/{hooks,install,kernel,new_root,sysroot,mkinitcpio.*} &>/dev/null
rm -f /sysroot/{VERSION,config,buildconfig,init} &>/dev/null
# systemd needs this for root_switch
touch /etc/initrd-release
sync
systemctl start initrd-switch-root
systemctl start initrd-switch-root.target
fi
echo -e "\e[1mStep ${_S_APPEND}7/${_STEPS}:\e[m Creating initramfs ${_RAM}/${_INITRD}..."
echo " This will need some time..."

View file

@ -6,7 +6,7 @@ build ()
{
map add_binary head id cksum tail test uptime w who whoami xargs \
swapon uniq seq fdisk sfdisk cfdisk parted free less \
chgrp chown dialog dmesg egrep fgrep stty hdparm \
chgrp chown dialog dmesg egrep fgrep stty hdparm sync \
dirname chroot expr bzip2 su sdparm tput bsdcpio \
losetup mkfifo mknod readlink lzmadec lzop xz last wall mesg utmpdump \
xzdec switch_root pivot_root chcpu ctrlaltdel gdisk sgdisk cgdisk fixparts findmnt \

View file

@ -6,7 +6,7 @@ build ()
{
apps="head id cksum tail test uptime w who whoami xargs \
swapon uniq seq fdisk sfdisk cfdisk parted free less \
chgrp dialog dmesg egrep fgrep stty hdparm bsdcpio\
chgrp dialog dmesg egrep fgrep stty hdparm sync bsdcpio\
dirname chroot expr bunzip2 bzcat bzip2 su sdparm tput \
losetup mkfifo mknod lzmadec lzop lzma lzcat unlzma unxz xzcat \
lastb last wall mesg utmpdump xzdec switch_root pivot_root chcpu ctrlaltdel \

View file

@ -16,7 +16,7 @@ build ()
mkdir echo false sleep kmod pidof touch chmod find wc uname yes awk halt \
shutdown reboot poweroff insmod modprobe sh dd sort zstd date tee mktemp \
install pgrep mkfs.btrfs rmmod mountpoint gzip ldconfig nscd ln top df cut \
stat tr passwd od tar bsdtar sync
stat tr passwd od tar bsdtar
### add nano
add_binary nano