main/postmarketos-mkinitfs-hook-debug-shell: Cleanup debug-shell telnet server (MR 5191)
Moved the cleanup code from initramfs
This commit is contained in:
parent
ebd351c346
commit
25ad7892a1
4 changed files with 16 additions and 7 deletions
|
@ -85,10 +85,10 @@ package() {
|
|||
|
||||
sha512sums="
|
||||
59be0649ed87a72d93624bd8a2e3f8c99a0f32f7b7a26f99436de782beba55671472c269eeee86440efc87e0d7148a0bb335fa537791092e73878ca21330544a 00-default.modules
|
||||
5b364300f31c91fd0591eb0715f67cbf5383f45246a5fb9f34b79f7cb2e3b15768b2130e5f32f816cc169950f988c1beabc879ba31645c58ce131a288dbc071d 00-initramfs-base.dirs
|
||||
9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs
|
||||
ab41b45b0613f25a61114ed8c8b92bc53c60838f6e2e0ba18c76e5369b2984e6023a0661887692673aca3f647f268c468a468f6b1ac424cfee609017a89481dd 00-initramfs-base.files
|
||||
8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files
|
||||
5479a8cd695474d59594e09177a63e5f51e44ce96ac7fde7475db5b7516482b5e4f0bcdac64904b476c4350e078c2418efd610c02b294ecf9877c6ce7a9bb2c1 init.sh
|
||||
36cfba159ed5e934dd81117485f68ec260e968def31da0c2acab69cdbea8b40363ed7c5c26679b996efd2368a8981bc0045cd98508d3170e7e43cd34e09de8aa init.sh
|
||||
eec9cd4e9b123270615ba9ff840818ae2f1a0dddbe8cf3ea863b5ee4ba3229628adb804d50ac7105c582073fba8f75141af249ebeb60c369da0052ca0fabda19 init_functions.sh
|
||||
ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf
|
||||
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
|
||||
|
|
|
@ -88,7 +88,7 @@ setup_bootchart2
|
|||
|
||||
# Switch root
|
||||
run_hooks /hooks-cleanup
|
||||
killall telnetd mdev udevd msm-fb-refresher 2>/dev/null
|
||||
killall mdev udevd msm-fb-refresher 2>/dev/null
|
||||
|
||||
# shellcheck disable=SC2093
|
||||
exec switch_root /sysroot "$init"
|
||||
|
|
|
@ -16,7 +16,6 @@ echo "Create 'pmos_continue_boot' script"
|
|||
echo "if [ -d /config/usb_gadget/g1/functions/mass_storage.0 ]; then setup_usb_storage; fi"
|
||||
echo "pkill -9 -f pmos_shell"
|
||||
echo "pkill -f pmos_fail_halt_boot"
|
||||
echo "pkill -f telnetd.*:${TELNET_PORT}"
|
||||
} >/usr/bin/pmos_continue_boot
|
||||
chmod +x /usr/bin/pmos_continue_boot
|
||||
|
||||
|
@ -35,6 +34,14 @@ echo "Create 'pmos_fail_halt_boot' script"
|
|||
} >/usr/bin/pmos_fail_halt_boot
|
||||
chmod +x /usr/bin/pmos_fail_halt_boot
|
||||
|
||||
echo "Create debug-shell cleanup script"
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
# shellcheck disable=SC2016
|
||||
echo 'kill `cat /run/debug-shell-telnet.pid`'
|
||||
} > /hooks-cleanup/debug-shell-cleanup.sh
|
||||
chmod +x /hooks-cleanup/debug-shell-cleanup.sh
|
||||
|
||||
echo "Start the telnet daemon"
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
|
@ -44,7 +51,9 @@ echo "Start the telnet daemon"
|
|||
chmod +x /telnet_connect.sh
|
||||
|
||||
host_ip="${unudhcpd_host_ip:-172.16.42.1}"
|
||||
telnetd -b "${host_ip}:${TELNET_PORT}" -l /telnet_connect.sh
|
||||
# Run telnetd with -F (foreground) instead of as a daemon so we can get it's PID
|
||||
telnetd -F -b "${host_ip}:${TELNET_PORT}" -l /telnet_connect.sh &
|
||||
echo "$!" > /run/debug-shell-telnet.pid
|
||||
|
||||
# mount pstore, if possible
|
||||
if [ -d /sys/fs/pstore ]; then
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
pkgname=postmarketos-mkinitfs-hook-debug-shell
|
||||
pkgver=0.6.0
|
||||
pkgver=0.6.1
|
||||
pkgrel=0
|
||||
pkgdesc="Root shell in the initramfs (security hole, for debugging only)"
|
||||
url="https://postmarketos.org"
|
||||
|
@ -19,7 +19,7 @@ package() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
add95b3fa64b804fd386298406fbc55489e3e122d70f40e45627a450d299e148a346a4a147c2b28e0110ecef14e9e0b62ac75a0bd2d39295c2407ebb5e93708c 20-debug-shell.sh
|
||||
46c7a77cc07e3f2acb733583a2710ea50366308c1018ead3081f910a243381a52eb2e584f7b11eb159b7fb16891b6d9acf2ffe3ace1588fcce9aad617787f675 20-debug-shell.sh
|
||||
a739bc47d905d189edb26d9ebfd062023720fefdaab27207471c16d53a9c12ea8b81092a1047d8f2300e42ba500bdf6c5a3343aca55aab5bf8e84d68eb5680ab 20-debug-shell.files
|
||||
75d485c2e9f352cfd717b7a92753a9dfc4a72526a44bcbb784eacb4ef9011072b3ffa1c42a317c0940598cc076fb6c61676c440e5b188378b19ca08d882c1338 setup_usb_storage.sh
|
||||
"
|
||||
|
|
Loading…
Reference in a new issue