Last active
February 8, 2024 23:19
-
-
Save slowpeek/8dcb1a10846371f820c36b7282897f49 to your computer and use it in GitHub Desktop.
Make dropbear not start with 'nodropbear' or 'dropbear=no' kernel arg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
: <<'README' | |
Make dropbear not start with 'nodropbear' or 'dropbear=no' kernel arg. | |
Put this script under /etc/initramfs-tools/scripts/init-top/ and update | |
initramfs. | |
README | |
PREREQ="" | |
prereqs() { | |
echo "$PREREQ" | |
} | |
case "$1" in | |
prereqs) | |
prereqs | |
exit 0 ;; | |
esac | |
# shellcheck disable=SC2013 | |
for arg in $(cat /proc/cmdline); do | |
case "$arg" in | |
nodropbear|dropbear=no) | |
if [ -e /sbin/dropbear ]; then | |
# There is '[ -x /sbin/dropbear ] || exit 0' early in | |
# /usr/share/initramfs-tools/scripts/init-premount/dropbear | |
chmod -x /sbin/dropbear | |
fi | |
break ;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment