postmarketos-initramfs: debug-shell: buffyboard (MR 5048)

Drop the console-shell hook in favour of stuffing buffyboard into the
initramfs. This makes it possible to get a debug shell directly on the
device without needing to use a computer.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
[ci:skip-build]: already built successfully in CI
This commit is contained in:
Caleb Connolly 2024-04-19 14:29:48 +01:00 committed by Clayton Craft
parent abca4acbe0
commit 1b19bd7367
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
7 changed files with 19 additions and 37 deletions

View file

@ -16,6 +16,7 @@ nls_ascii
nls_cp437 nls_cp437
nls_iso8859_1 nls_iso8859_1
nls_utf8 nls_utf8
uinput
usb_f_rndis usb_f_rndis
usb_f_ncm usb_f_ncm
usb-storage usb-storage

View file

@ -12,6 +12,8 @@
/usr/share/initramfs/init.sh:/init /usr/share/initramfs/init.sh:/init
/usr/share/initramfs/init_functions.sh:/init_functions.sh /usr/share/initramfs/init_functions.sh:/init_functions.sh
/usr/share/misc/source_deviceinfo /usr/share/misc/source_deviceinfo
/usr/bin/buffyboard
/usr/share/consolefonts/ter-128n.psf.gz
/usr/share/libinput/*.quirks /usr/share/libinput/*.quirks
/bin/udevadm /bin/udevadm
/sbin/udevd /sbin/udevd

View file

@ -1,8 +1,8 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org> # Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net> # Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-initramfs pkgname=postmarketos-initramfs
pkgver=3.1.0 pkgver=3.2.0
pkgrel=2 pkgrel=0
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
url="https://postmarketos.org" url="https://postmarketos.org"
options="!check" # no tests options="!check" # no tests
@ -11,6 +11,7 @@ provider_priority=10
depends=" depends="
blkid blkid
btrfs-progs btrfs-progs
buffyboard
busybox-extras busybox-extras
bzip2 bzip2
cryptsetup cryptsetup
@ -19,6 +20,7 @@ depends="
e2fsprogs e2fsprogs
e2fsprogs-extra e2fsprogs-extra
f2fs-tools f2fs-tools
font-terminus
iskey iskey
kmod kmod
libinput-libs libinput-libs
@ -85,11 +87,11 @@ package() {
} }
sha512sums=" sha512sums="
59be0649ed87a72d93624bd8a2e3f8c99a0f32f7b7a26f99436de782beba55671472c269eeee86440efc87e0d7148a0bb335fa537791092e73878ca21330544a 00-default.modules 20bc7a21f4f59548b8179c5cb1fc2b3db64eb355988bce992db3bc4075d65b4135ff9dd7d754215d0402978811494449cce476a26cda6bb2f0f8b53ae8e36bd7 00-default.modules
9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs 9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs
1c64d2da2013213467dfaa40e984e3a7c7e8a885d3327fe164f1e1c091eb9c9f2dfadcc7e1e1ef8a0e7fa36513b2216b4bde97d58c2528a637821a31800ccd34 00-initramfs-base.files 929a8e6cca6b2b4ac6af89fc3912e80315f51c9bf6e9479124ccb7ebe9e99c6c1cafb98d3aa01b0a76a2f6e0071ba3eb86c7a2169a15c2e1788d69458bea3471 00-initramfs-base.files
8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files 8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files
749865c52a229569c0cd346dd97fe10d49361124eba95bd0dbb25d0737d1efc139c8e2e31f4b7654747ffecfa77403886f1e1fe7d548d47aee03ced43d8ef2eb init.sh e85386077d590cd0db0745e8b58f3323a408cb6a94bca0e4395c43e4db18b0beef29324ed2bfeab6511d0e3b297c067e5a37f420a6877d9c28c285f2416ca420 init.sh
1d3337ace7611853579945dc6563556ced66f386a7f906835425bac9e45c7734682b85b381656dfd5d3b0a727a39e5718e77f0d19af42562c199df25ea9fda59 init_functions.sh 262136623ea82d8b60432481128a2b786144ef7eae0b3759229e1a0001b5c2a16e615f3410658bfb1d87df035e204658b81d10c0a207a0de7dd84ae9e1f29e77 init_functions.sh
ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf
" "

View file

@ -947,6 +947,13 @@ debug_shell() {
# Getty on the display # Getty on the display
hide_splash hide_splash
# Spawn buffyboard if the device might not have a physical keyboard
if echo "handset tablet convertible" | grep "${deviceinfo_chassis:-handset}" >/dev/null; then
modprobe uinput
# Set a large font for the framebuffer
setfont "/usr/share/consolefonts/ter-128n.psf.gz" -C "/dev/$active_console"
buffyboard &
fi
run_getty "$active_console" run_getty "$active_console"
# And on the usb acm port (if it exists) # And on the usb acm port (if it exists)
@ -980,7 +987,7 @@ debug_shell() {
show_splash "Loading..." show_splash "Loading..."
pkill -f fbkeyboard || true pkill -f buffyboard || true
} }
# Check if the user is pressing a key and either drop to a shell or halt boot as applicable # Check if the user is pressing a key and either drop to a shell or halt boot as applicable

View file

@ -1,23 +0,0 @@
# Maintainer: Ferenc Bakonyi <bakonyi.ferenc@gmail.com>
pkgname=postmarketos-mkinitfs-hook-console-shell
pkgver=0.4.0
pkgrel=0
pkgdesc="Root console shell in the initramfs (security hole, for debugging only)"
url="https://postmarketos.org"
depends="postmarketos-mkinitfs devicepkg-utils fbdebug evtest linuxconsoletools reboot-mode fbkeyboard font-dejavu"
source="console-shell.files console-shell.modules"
arch="noarch"
license="GPL-2.0-or-later"
options="!check" # No tests
package() {
install -Dm644 "$srcdir"/console-shell.files \
"$pkgdir"/usr/share/mkinitfs/files/30-console-shell.files
install -Dm644 "$srcdir"/console-shell.modules \
"$pkgdir"/usr/share/mkinitfs/modules/30-console-shell.modules
}
sha512sums="
17b65cb24103e4c1459ae72bc036c1f06cdfcccf480389ecf6a28253d104b9b06d394cf53314a1ef4ace4ffc88b6b1384ef4894b7270d6b2cfdfc83592e12b2c console-shell.files
a9b069ed121ffeee887e0583d8cb46035ecf1fa90a26a4ecb3aa11ff03178b2b08621f6676db6b2350f290694c04aabcf36f2ce3e0813a76dde9a33555edb112 console-shell.modules
"

View file

@ -1,6 +0,0 @@
/usr/bin/evtest
/usr/bin/fbkeyboard
/usr/bin/fftest
/usr/sbin/fbdebug
/usr/sbin/reboot-mode
/usr/share/fonts/dejavu/DejaVuSans.ttf