mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
be more acurate on switching root
This commit is contained in:
parent
d10dad76e9
commit
191e54244f
5 changed files with 7 additions and 10 deletions
|
@ -50,18 +50,17 @@ if [[ "${TTY}" = "tty1" ]]; then
|
||||||
rm -rf /lib/modules/*/extramodules
|
rm -rf /lib/modules/*/extramodules
|
||||||
echo -e "\e[1mStep 4/4:\e[m Copying archboot rootfs to /sysroot..."
|
echo -e "\e[1mStep 4/4:\e[m Copying archboot rootfs to /sysroot..."
|
||||||
tar -C / --exclude="./dev/*" --exclude="./proc/*" --exclude="./sys/*" \
|
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
|
-clpf - . | tar -C /sysroot -xlspf - &>/dev/null
|
||||||
# cleanup mkinitcpio directories and files
|
# 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} &>/dev/null
|
||||||
rm -f /sysroot/{VERSION,config,buildconfig,init} &>/dev/null
|
rm -f /sysroot/{VERSION,config,buildconfig,init} &>/dev/null
|
||||||
# systemd needs this for root_switch
|
# systemd needs this for root_switch
|
||||||
touch /etc/initrd-release
|
touch /etc/initrd-release
|
||||||
sync
|
|
||||||
echo -e "\e[1;96mArchboot\e[m \e[1m- Arch Linux Environment finished.\e[m"
|
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"
|
echo -e "\e[1mSystemd initrd-switch-root will be launched in a second...\e[m"
|
||||||
read -r -t 3
|
read -r -t 3
|
||||||
systemctl start initrd-switch-root
|
systemctl start initrd-switch-root.target
|
||||||
else
|
else
|
||||||
while true; do
|
while true; do
|
||||||
read -r -t 1
|
read -r -t 1
|
||||||
|
|
|
@ -383,14 +383,12 @@ _new_environment() {
|
||||||
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
|
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
|
||||||
echo -e "\e[1mStep ${_STEPS}/${_STEPS}:\e[m Switch root to ${_RAM}..."
|
echo -e "\e[1mStep ${_STEPS}/${_STEPS}:\e[m Switch root to ${_RAM}..."
|
||||||
mv ${_W_DIR}/tmp/* /${_RAM}/
|
mv ${_W_DIR}/tmp/* /${_RAM}/
|
||||||
rm -r /${_RAM}/mkinitcpio.*
|
|
||||||
# cleanup mkinitcpio directories and files
|
# 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
|
rm -f /sysroot/{VERSION,config,buildconfig,init} &>/dev/null
|
||||||
# systemd needs this for root_switch
|
# systemd needs this for root_switch
|
||||||
touch /etc/initrd-release
|
touch /etc/initrd-release
|
||||||
sync
|
systemctl start initrd-switch-root.target
|
||||||
systemctl start initrd-switch-root
|
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1mStep ${_S_APPEND}7/${_STEPS}:\e[m Creating initramfs ${_RAM}/${_INITRD}..."
|
echo -e "\e[1mStep ${_S_APPEND}7/${_STEPS}:\e[m Creating initramfs ${_RAM}/${_INITRD}..."
|
||||||
echo " This will need some time..."
|
echo " This will need some time..."
|
||||||
|
|
|
@ -6,7 +6,7 @@ build ()
|
||||||
{
|
{
|
||||||
map add_binary head id cksum tail test uptime w who whoami xargs \
|
map add_binary head id cksum tail test uptime w who whoami xargs \
|
||||||
swapon uniq seq fdisk sfdisk cfdisk parted free less \
|
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 \
|
dirname chroot expr bzip2 su sdparm tput bsdcpio \
|
||||||
losetup mkfifo mknod readlink lzmadec lzop xz last wall mesg utmpdump \
|
losetup mkfifo mknod readlink lzmadec lzop xz last wall mesg utmpdump \
|
||||||
xzdec switch_root pivot_root chcpu ctrlaltdel gdisk sgdisk cgdisk fixparts findmnt \
|
xzdec switch_root pivot_root chcpu ctrlaltdel gdisk sgdisk cgdisk fixparts findmnt \
|
||||||
|
|
|
@ -6,7 +6,7 @@ build ()
|
||||||
{
|
{
|
||||||
apps="head id cksum tail test uptime w who whoami xargs \
|
apps="head id cksum tail test uptime w who whoami xargs \
|
||||||
swapon uniq seq fdisk sfdisk cfdisk parted free less \
|
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 \
|
dirname chroot expr bunzip2 bzcat bzip2 su sdparm tput \
|
||||||
losetup mkfifo mknod lzmadec lzop lzma lzcat unlzma unxz xzcat \
|
losetup mkfifo mknod lzmadec lzop lzma lzcat unlzma unxz xzcat \
|
||||||
lastb last wall mesg utmpdump xzdec switch_root pivot_root chcpu ctrlaltdel \
|
lastb last wall mesg utmpdump xzdec switch_root pivot_root chcpu ctrlaltdel \
|
||||||
|
|
|
@ -16,7 +16,7 @@ build ()
|
||||||
mkdir echo false sleep kmod pidof touch chmod find wc uname yes awk halt \
|
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 \
|
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 \
|
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 nano
|
||||||
add_binary nano
|
add_binary nano
|
||||||
|
|
Loading…
Reference in a new issue