logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://hacktivis.me/git/bootstrap-initrd.git
commit: 5b619818dbe1b796b1275d8e04e5d2d5c849dac1
parent 50eb41dd847c73402079e7ad26b31e96b4b79c8a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  3 Jun 2024 08:29:53 +0200

init.sh: Fix TTY handling for containers

Diffstat:

Minit.sh17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/init.sh b/init.sh @@ -192,13 +192,22 @@ build_pigz || die mkdir -p /usr/share/cacert/ || die mv /cacert-*.pem /usr/share/cacert/cert.pem || die +mkdir -p /etc/ssl || die +ln -s /usr/share/cacert/cert.pem /etc/ssl/cert.pem || die -cat /proc/uptime -echo 'Done bootstrapping! Press return to get a TTY' +mkdir -p $HOME +cd -read _ +# No /dev/tty1, no getty (as seen in containers) +if ! test -e /dev/tty1 +then + times + echo 'Done bootstrapping! Dropping into a shell' + exec /bin/sh -l +fi -cd +cat /proc/uptime +echo 'Done bootstrapping! Dropping into a TTY' if ! grep -q console= /proc/cmdline then