From 460c8de69d29cb107b1d98448d401dfecef2f65e Mon Sep 17 00:00:00 2001 From: Ferenc Bakonyi Date: Sat, 11 Jul 2020 13:56:12 +0200 Subject: [PATCH] main/postmarketos-mkinitfs-hook-console-shell: Add support for rotated framebuffers (MR 1422) --- .../postmarketos-mkinitfs-hook-console-shell/APKBUILD | 11 +++++++---- .../console-shell.modules | 1 + .../console-shell.sh | 6 ++---- 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 main/postmarketos-mkinitfs-hook-console-shell/console-shell.modules diff --git a/main/postmarketos-mkinitfs-hook-console-shell/APKBUILD b/main/postmarketos-mkinitfs-hook-console-shell/APKBUILD index 3272a2873..24afaabf0 100644 --- a/main/postmarketos-mkinitfs-hook-console-shell/APKBUILD +++ b/main/postmarketos-mkinitfs-hook-console-shell/APKBUILD @@ -1,11 +1,11 @@ # Maintainer: Ferenc Bakonyi pkgname=postmarketos-mkinitfs-hook-console-shell pkgver=0.1 -pkgrel=0 +pkgrel=1 pkgdesc="Root console shell in the initramfs (security hole, for debugging only)" url="https://postmarketos.org" depends="postmarketos-mkinitfs fbdebug evtest linuxconsoletools reboot-mode fbkeyboard" -source="console-shell.sh console-shell.files" +source="console-shell.sh console-shell.files console-shell.modules" arch="noarch" license="GPL-2.0-or-later" options="!check" # No tests @@ -16,7 +16,10 @@ package() { "$pkgdir"/etc/postmarketos-mkinitfs/hooks/30-console-shell.sh install -Dm644 "$srcdir"/console-shell.files \ "$pkgdir"/etc/postmarketos-mkinitfs/files/30-console-shell.files + install -Dm644 "$srcdir"/console-shell.modules \ + "$pkgdir"/etc/postmarketos-mkinitfs/modules/30-console-shell.modules } -sha512sums="3a991e598c5c5d8f4750346f5edc113238ea3f90f47b22855d94a84aca35993490a4a1a0be3c4558c94a070eb9b5761bfe268dd5a5bcf6617b4da77d274fa771 console-shell.sh -4c64724c1ecadb831d2900cf98b04ca4f7cbae57c1868a82d5c89333a071dbc29527462f5a724afc95c4ddcc9d40e8601476f830632474cb93788d93e2d59896 console-shell.files" +sha512sums="5dec96bc74be95220dc72ad9dfee6e547833feccc23415d4734508601d72b0515d45c911ac2f551df2bc43141052bf260ff4f34f3869c4c0945f3b22af8d7f3c console-shell.sh +4c64724c1ecadb831d2900cf98b04ca4f7cbae57c1868a82d5c89333a071dbc29527462f5a724afc95c4ddcc9d40e8601476f830632474cb93788d93e2d59896 console-shell.files +a9b069ed121ffeee887e0583d8cb46035ecf1fa90a26a4ecb3aa11ff03178b2b08621f6676db6b2350f290694c04aabcf36f2ce3e0813a76dde9a33555edb112 console-shell.modules" diff --git a/main/postmarketos-mkinitfs-hook-console-shell/console-shell.modules b/main/postmarketos-mkinitfs-hook-console-shell/console-shell.modules new file mode 100644 index 000000000..42bc0053c --- /dev/null +++ b/main/postmarketos-mkinitfs-hook-console-shell/console-shell.modules @@ -0,0 +1 @@ +uinput diff --git a/main/postmarketos-mkinitfs-hook-console-shell/console-shell.sh b/main/postmarketos-mkinitfs-hook-console-shell/console-shell.sh index fa8ed74f0..4cd60f126 100644 --- a/main/postmarketos-mkinitfs-hook-console-shell/console-shell.sh +++ b/main/postmarketos-mkinitfs-hook-console-shell/console-shell.sh @@ -10,13 +10,11 @@ fi if tty -s; then tty=/dev/tty0 - rows=$(stty -F $tty size | awk '{print $1}') - stty -F $tty rows $(($rows * 2 / 3)) - fbkeyboard & + modprobe uinput + fbkeyboard -r $(cat /sys/class/graphics/fbcon/rotate) 2>$tty & echo "Exit the shell to continue booting:" > $tty sh +m <$tty >$tty 2>$tty pkill -f fbkeyboard - stty -F $tty rows $rows else echo "No tty attached, exiting." fi