silence regulatory errors

This commit is contained in:
Tobias Powalowski 2023-11-09 10:59:16 +01:00
parent 3ff8fa4bf0
commit 60187bdc83
2 changed files with 12 additions and 12 deletions

View file

@ -2,9 +2,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
LANG=C
_R_KVER="$(uname -r)"
_R_ARCH="$(uname -m)"
_TITLE="Archboot ${_R_ARCH} | ${_R_KVER} | Basic Setup | Early Userspace"
_KVER="$(uname -r)"
_ARCH="$(uname -m)"
_TITLE="Archboot ${_ARCH} | ${_KVER} | Basic Setup | Early Userspace"
_KEEP="Please keep the boot medium inserted."
_dialog() {
dialog --backtitle "${_TITLE}" "$@"
@ -35,7 +35,7 @@ _progress_wait() {
}
_task() {
if [[ "${1}" == kernel ]]; then
bsdcpio -u -i "*/lib/modules/" "*/lib/firmware/" <"/mnt/efi/boot/initrd-${_R_ARCH}.img" &>/dev/null
bsdcpio -u -i "*/lib/modules/" "*/lib/firmware/" <"/mnt/efi/boot/initrd-${_ARCH}.img" &>/dev/null
# wait 1 second until proceeding with module loading, needed at least for kms activation
sleep 1
fi
@ -58,7 +58,7 @@ ti-connectivity,tehuti,wfx,yam,yamaha}
mv /lib/modules /sysroot/usr/lib
mv /lib/firmware /sysroot/usr/lib
cd /sysroot
bsdcpio -u -f "*/lib/modules/" -f "*/lib/firmware/" -i<"/mnt/efi/boot/initrd-${_R_ARCH}.img" &>/dev/null
bsdcpio -u -f "*/lib/modules/" -f "*/lib/firmware/" -i<"/mnt/efi/boot/initrd-${_ARCH}.img" &>/dev/null
fi
if [[ "${1}" == unmount ]]; then
if mountpoint /mnt/ventoy &>/dev/null; then
@ -110,16 +110,16 @@ printf "\ec"
# it needs one echo before, in order to reset the consolefont!
setfont ter-v16n -C /dev/console
loadkeys us
echo "Searching 10 seconds for Archboot ${_R_ARCH} rootfs..."
echo "Searching 10 seconds for Archboot ${_ARCH} rootfs..."
_COUNT=0
while ! [[ "${_COUNT}" == 10 ]]; do
# dd / rufus
mount UUID=1234-ABCD /mnt/efi &>/dev/null && break
# ventoy
if mount LABEL=Ventoy /mnt/ventoy &>/dev/null; then
mount /mnt/ventoy/archboot-*-*-"${_R_KVER}"-"${_R_ARCH}".iso /mnt/cdrom &>/dev/null && break
mount /mnt/ventoy/archboot-*-*-"${_R_KVER}"-latest-"${_R_ARCH}".iso /mnt/cdrom &>/dev/null && break
mount /mnt/ventoy/archboot-*-*-"${_R_KVER}"-local-"${_R_ARCH}".iso /mnt/cdrom &>/dev/null && break
mount /mnt/ventoy/archboot-*-*-"${_KVER}"-"${_ARCH}".iso /mnt/cdrom &>/dev/null && break
mount /mnt/ventoy/archboot-*-*-"${_KVER}"-latest-"${_ARCH}".iso /mnt/cdrom &>/dev/null && break
mount /mnt/ventoy/archboot-*-*-"${_KVER}"-local-"${_ARCH}".iso /mnt/cdrom &>/dev/null && break
fi
if [[ -b /dev/sr0 ]]; then
mount /dev/sr0 /mnt/cdrom &>/dev/null && break
@ -127,7 +127,7 @@ while ! [[ "${_COUNT}" == 10 ]]; do
sleep 1
_COUNT=$((_COUNT+1))
done
if ! [[ -f "/mnt/efi/boot/initrd-${_R_ARCH}.img" ]] ; then
if ! [[ -f "/mnt/efi/boot/initrd-${_ARCH}.img" ]] ; then
if ! mount /mnt/cdrom/efi.img /mnt/efi &>/dev/null; then
echo -e "\e[1;91mArchboot Emergeny Shell:\e[m"
echo -e "\e[1;91mError: Didn't find a device with archboot rootfs! \e[m"

View file

@ -37,9 +37,9 @@ if [[ "${TTY}" = "tty1" ]]; then
mount -o discard /dev/zram0 /sysroot &>"${_NO_LOG}"
_progress "3" "Removing firmware and modules..."
# cleanup firmware and modules
mv /lib/firmware/regulatory* /tmp/
mv /lib/firmware/regulatory* /tmp/ &>"${_NO_LOG}"
rm -rf /lib/firmware/*
mv /tmp/regulatory* /lib/firmware/
mv /tmp/regulatory* /lib/firmware/ &>"${_NO_LOG}"
rm -rf /lib/modules/*/kernel/drivers/{acpi,ata,gpu,bcma,block,bluetooth,hid,input,platform,net,scsi,soc,spi,usb,video}
rm -rf /lib/modules/*/extramodules
: > /.archboot