mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
reset percentages
This commit is contained in:
parent
6f526ef85d
commit
aaa075ccea
2 changed files with 13 additions and 12 deletions
|
@ -40,6 +40,7 @@ echo -e "\e[1mInformation:\e[m Logging is done on \e[1m/dev/tty7\e[m..."
|
|||
# Generate new environment and launch it with kexec
|
||||
if [[ -n "${_L_COMPLETE}" || -n "${_L_INSTALL_COMPLETE}" ]]; then
|
||||
_TITLE="Archboot $(uname -m) | Basic Setup | Generating New Environment"
|
||||
_KEEP="Logging is done on /dev/tty7."
|
||||
_new_environment | _dialog --title "Running..." --gauge "Waiting for gpg pacman keyring import to finish..." 6 75 0
|
||||
fi
|
||||
# Generate new images
|
||||
|
|
|
@ -296,7 +296,7 @@ _prepare_graphic() {
|
|||
[[ ! -e "/.full_system" ]] && _cleanup_install
|
||||
# check for qxl module
|
||||
grep -q qxl /proc/modules && grep -q xorg "${_GRAPHIC}" && _GRAPHIC="${_GRAPHIC} xf86-video-qxl"
|
||||
echo "Running pacman to install packages: ${_GRAPHIC}..."
|
||||
echo "Initializing pacman to install packages: ${_GRAPHIC}..."
|
||||
for i in ${_GRAPHIC}; do
|
||||
#shellcheck disable=SC2086
|
||||
pacman -S ${i} --noconfirm &>"${_NO_LOG}" || exit 1
|
||||
|
@ -370,9 +370,9 @@ _new_environment() {
|
|||
mkdir ${_RAM}
|
||||
mount -t ramfs none ${_RAM}
|
||||
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
|
||||
_progress "20" "Skipping copying of kernel ${_VMLINUZ} to ${_RAM}/${_VMLINUZ}..."
|
||||
_progress "50" "Skipping copying of kernel ${_VMLINUZ} to ${_RAM}/${_VMLINUZ}..."
|
||||
else
|
||||
_progress "20" "Copying kernel ${_VMLINUZ} to ${_RAM}/${_VMLINUZ}..."
|
||||
_progress "50" "Copying kernel ${_VMLINUZ} to ${_RAM}/${_VMLINUZ}..."
|
||||
# use ramfs to get immediate free space on file deletion
|
||||
mv "${_W_DIR}/boot/${_VMLINUZ}" ${_RAM}/ || exit 1
|
||||
fi
|
||||
|
@ -380,19 +380,19 @@ _new_environment() {
|
|||
[[ ${_RUNNING_ARCH} == "aarch64" || ${_RUNNING_ARCH} == "riscv64" ]] && _kver_generic
|
||||
# fallback if no detectable kernel is installed
|
||||
[[ -z "${_HWKVER}" ]] && _HWKVER="$(uname -r)"
|
||||
_progress "30" "Collecting rootfs files in ${_W_DIR}..."
|
||||
_progress "55" "Collecting rootfs files in ${_W_DIR}..."
|
||||
# write initramfs to "${_W_DIR}"/tmp
|
||||
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount tmp;archboot-cpio.sh -k ${_HWKVER} -c ${_CONFIG} -d /tmp" >"${_LOG}" 2>&1 || exit 1
|
||||
_progress "50" "Cleanup ${_W_DIR}..."
|
||||
_progress "70" "Cleanup ${_W_DIR}..."
|
||||
find "${_W_DIR}"/. -mindepth 1 -maxdepth 1 ! -name 'tmp' -exec rm -rf {} \;
|
||||
_clean_kernel_cache
|
||||
_ram_check
|
||||
# local switch, don't kexec on local image
|
||||
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
|
||||
_progress "60" "Move rootfs to ${_RAM}..."
|
||||
_progress "75" "Move rootfs to ${_RAM}..."
|
||||
mv ${_W_DIR}/tmp/* /${_RAM}/
|
||||
# cleanup mkinitcpio directories and files
|
||||
_progress "70" "Cleanup ${_RAM}..."
|
||||
_progress "95" "Cleanup ${_RAM}..."
|
||||
rm -rf /sysroot/{hooks,install,kernel,new_root,sysroot,mkinitcpio.*} &>"${_NO_LOG}"
|
||||
rm -f /sysroot/{VERSION,config,buildconfig,init} &>"${_NO_LOG}"
|
||||
_progress "100" "Switching to rootfs ${_RAM}..."
|
||||
|
@ -409,7 +409,7 @@ _new_environment() {
|
|||
systemctl start initrd-switch-root.target
|
||||
fi
|
||||
_C_DIR="${_W_DIR}/tmp"
|
||||
_progress "60" "Preserving Basic Setup values..."
|
||||
_progress "75" "Preserving Basic Setup values..."
|
||||
if [[ -e '/.localize' ]]; then
|
||||
cp /etc/{locale.gen,locale.conf} "${_C_DIR}"/etc
|
||||
cp /.localize "${_C_DIR}"/
|
||||
|
@ -439,13 +439,13 @@ _new_environment() {
|
|||
cp -ar /etc/pacman.d/gnupg "${_C_DIR}"/etc/pacman.d
|
||||
cp /.pacsetup "${_C_DIR}"/
|
||||
fi
|
||||
_progress "70" "Creating initramfs ${_RAM}/${_INITRD}..."
|
||||
_progress "80" "Creating initramfs ${_RAM}/${_INITRD}..."
|
||||
_create_initramfs
|
||||
_progress "80" "Cleanup ${_W_DIR}..."
|
||||
_progress "95" "Cleanup ${_W_DIR}..."
|
||||
cd /
|
||||
_kill_w_dir
|
||||
_clean_kernel_cache
|
||||
_progress "90" "Waiting for kernel to free RAM..."
|
||||
_progress "97" "Waiting for kernel to free RAM..."
|
||||
# wait until enough memory is available!
|
||||
while true; do
|
||||
[[ "$(($(stat -c %s ${_RAM}/${_INITRD})*200/100000))" -lt "$(grep -w MemAvailable /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" ]] && break
|
||||
|
@ -456,7 +456,7 @@ _new_environment() {
|
|||
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
|
||||
_MEM_MIN="--mem-min=0xA0000000"
|
||||
fi
|
||||
_progress "100" "kexec\e[m with \e[1mKEXEC_LOAD\e[m..."
|
||||
_progress "100" "Restarting with KEXEC_LOAD..."
|
||||
kexec -c -f ${_MEM_MIN} ${_RAM}/"${_VMLINUZ}" --initrd="${_RAM}/${_INITRD}" --reuse-cmdline &
|
||||
sleep 0.1
|
||||
_clean_kernel_cache
|
||||
|
|
Loading…
Reference in a new issue