diskimage-builder/diskimage_builder/elements/enable-serial-console/install.d/20-stty
Matthew Thode 97e4627d87
update various gentoo bits
Update an rc-update call to only be made if running openrc instead of
all gentoo profiles (systemd does not have rc-update).

Add python3-pyyaml package mappings.

Update serial console to support multiple arches.

Update open-iscsi and open-isns keywords (looks like upstream merged
some musl fixes).

Update the kernel and initramfs file name globs for the
gentoo-kernel-bin usage.

Change-Id: I259bffed3a3e3f92be2210ead6bdfa383917d457
Signed-off-by: Matthew Thode <mthode@mthode.org>
2020-08-24 10:21:35 -05:00

29 lines
1 KiB
Bash
Executable file

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
SCRIPTDIR=$(dirname $0)
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
install -m 0644 -o root -g root ${SCRIPTDIR}/ttySx.conf /etc/init/ttySx.conf
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
install -D -g root -o root -m 0644 ${SCRIPTDIR}/serial-console-udev.rules /etc/udev/rules.d/99-serial-console.rules
elif [ "$DIB_INIT_SYSTEM" == "openrc" ]; then
sed -r 's/^#(.*ttyS[0,1].*$)/\1/' -i /etc/inittab
echo '# diskimage-builder serial console' >> /etc/inittab
echo -n 's0:12345:respawn:/sbin/agetty -L 115200 ' >> /etc/inittab
if [[ -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" ]]; then
echo -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" >> /etc/inittab
elif [[ "powerpc ppc64 ppc64le" =~ ${ARCH} ]]; then
echo -n "hvc0" >> /etc/inittab
elif [[ "arm64" =~ ${ARCH} ]]; then
echo -n "ttyAMA0" >> /etc/inittab
else
echo -n "ttyS0" >> /etc/inittab
fi
echo ' vt100' >> /etc/inittab
fi