cleanup / before switching

This commit is contained in:
Tobias Powalowski 2022-06-02 18:21:21 +02:00
parent bae03ce7f1
commit 3d17b20ea1

View file

@ -141,15 +141,17 @@ fi
EOF
# motd not needed anymore
rm /etc/motd
echo -e "\033[1mStep 5/7:\033[0m Copying initramfs to /new_root ..."
echo -e "\033[1mStep 5/8:\033[0m Removing not necessary files from / ..."
_clean_archboot
echo -e "\033[1mStep 6/8:\033[0m Copying initramfs to /new_root ..."
echo -e " This takes some time ..."
tar -C / --exclude="./dev/*" --exclude="./proc/*" --exclude="./sys/*" --exclude="./tmp/*" --exclude="./run/*"\
--exclude="./mnt/*" --exclude="./media/*" --exclude="./lost+found" --exclude="./new_root/*" \
--exclude="./etc/pacman.d/S.*" -clpf - . | tar -C /new_root -xlspf -
# stop dbus to avoid 90 seconds hanging
echo -e "\033[1mStep 6/7:\033[0m Stopping dbus ..."
echo -e "\033[1mStep 7/8:\033[0m Stopping dbus ..."
systemctl stop dbus
echo -e "\033[1mStep 7/7:\033[0m Switching root to /new_root ..."
echo -e "\033[1mStep 8/8:\033[0m Switching root to /new_root ..."
echo "/dev/zram0 / btrfs defaults,discard,noatime,compress=zstd 0 0" >>/etc/fstab
systemctl switch-root /new_root
fi