From 092011044b9a501a04a50d1488c08ebfeb9faec6 Mon Sep 17 00:00:00 2001
From: Tobias Powalowski
Date: Tue, 14 Feb 2023 20:29:32 +0100
Subject: [PATCH] add big screen detection to init
---
usr/lib/initcpio/install/archboot_init | 5 +++--
usr/share/archboot/base/init | 8 +++++++-
usr/share/archboot/doc/archboot.html | 4 ++--
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/usr/lib/initcpio/install/archboot_init b/usr/lib/initcpio/install/archboot_init
index 50b637b1e..f09c67170 100644
--- a/usr/lib/initcpio/install/archboot_init
+++ b/usr/lib/initcpio/install/archboot_init
@@ -12,8 +12,9 @@ build() {
'/drivers/spi/' 'virtio'
map add_binary bash sh blkid mount switch_root bsdcpio mkfs.btrfs setfont \
/usr/lib/systemd/systemd-udevd udevadm systemd-tmpfiles kmod insmod modprobe \
- gzip uname cat cp dmesg grep ln ls mv rm umount lsblk rmmod
- add_file "/usr/share/kbd/consolefonts/ter-v16n.psf.gz" "/consolefont.psf.gz"
+ gzip uname cat cp dmesg grep ln ls mv rm umount lsblk rmmod cut sed find
+ add_file "/usr/share/kbd/consolefonts/ter-v16n.psf.gz" "/consolefont-16.psf.gz"
+ add_file "/usr/share/kbd/consolefonts/ter-v32n.psf.gz" "/consolefont-32.psf.gz"
map add_udev_rule '50-udev-default.rules' '60-persistent-storage.rules' \
'64-btrfs.rules' '80-drivers.rules'
map add_file '/usr/lib/udev/ata_id' '/usr/lib/udev/scsi_id'
diff --git a/usr/share/archboot/base/init b/usr/share/archboot/base/init
index 3779c6396..4665092e4 100755
--- a/usr/share/archboot/base/init
+++ b/usr/share/archboot/base/init
@@ -31,7 +31,13 @@ udevadm info --cleanup-db
echo 1 > /proc/sys/kernel/sysrq
echo -e "\e[1mInitializing\e[m \e[36mArchboot\e[m \e[1m- Arch Linux Environment:\e[m"
# it needs one echo before, in order to reset the consolefont!
-setfont consolefont.psf.gz -C /dev/console
+FB_SIZE="$(cut -d 'x' -f 1 "$(find /sys -wholename '*fb0/modes')" | sed -e 's#.*:##g')"
+if [[ "${FB_SIZE}" -gt '1900' ]]; then
+ SIZE="32"
+else
+ SIZE="16"
+fi
+setfont consolefont-${SIZE}.psf.gz -C /dev/console
echo -e "\e[1mStep 1/4:\e[m Creating /dev/zram0 with zstd compression..."
modprobe zram &>/dev/null
modprobe zstd &>/dev/null
diff --git a/usr/share/archboot/doc/archboot.html b/usr/share/archboot/doc/archboot.html
index e228008a8..789c987ec 100644
--- a/usr/share/archboot/doc/archboot.html
+++ b/usr/share/archboot/doc/archboot.html
@@ -893,8 +893,8 @@ Some hardware does not like the Any combinations of the following kernel parameters may be useful:
noapic
, nolapic
, acpi=off
, pci=routeirq
, pci=nosmp
or pci=nomsi
-- Is it possible to unplugg the usb/cd medium?
-- Yes you can unplug the used medium, with the first Welcome Archboot - Arch Linux message on systemd startup.
+
- Is it possible to remove the USB/CD medium?
+- Yes you can remove the used medium, with the first Welcome Archboot - Arch Linux message on systemd startup.
- Package XYZ is missing in archboot environment.