# SliTaz package receipt. PACKAGE="custom-console" VERSION="2.0" CATEGORY="meta" GROUP="system" SHORT_DESC="Configure the consoles" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" WEB_SITE="http://tiny.slitaz.org/" DEPENDS="base-tiny" SUGGESTED="module-usbserial module-serial" CONFIG_FILES="/etc/init.d/tty.sh" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/etc/init.d } post_install() { respawn=respawn [ "$ASKFIRST" ] && respawn=askfirst [ "$KERNEL_TTY" = "none" ] || echo -n " console=tty0 console=$KERNEL_TTY,${SPEED_KERNEL_TTY}n8" \ >> $1/boot/cmdline TTY_LIST="" for i in $(seq 1 63); do eval n=\$TTY$i [ -n "$n" ] || continue TTY_LIST="$TTY_LIST tty$i:38400" done for i in $(seq 0 3 | sed 's/^/TTYS/' ; seq 0 3 | sed 's/^/TTYUSB/'); do eval n=\$$i [ -n "$n" ] || continue eval s=\$SPEED_$i TTY_LIST="$TTY_LIST ${i/TTY/tty}:$s" done [ -s $1/etc/init.d/tty.sh ] || cat > $1/etc/init.d/tty.sh <> $1/etc/init.d/tty.sh <> $1/etc/init.d/tty.sh [ -n "$TTY_LIST" ] && cat >> $1/etc/init.d/tty.sh < /dev/null 2>&1 || continue echo -n "\$dev " echo "\$dev::$respawn:getty \${i#*:} /dev/\$dev" >> /etc/inittab done kill -1 1 status EOT grep tty.sh $1/etc/rcS.conf || sed -i 's/^RUN_SCRIPTS="/&tty.sh /' $1/etc/rcS.conf } config_form() { cat < Virtual consoles EOT for i in $(seq 1 63); do [ $(($i & 7)) -eq 1 ] && echo "" eval checked="\$TTY$i" cat < tty$i EOT [ $(($i & 7)) -eq 0 ] && echo "" done cat <

Confirm console launch (spare some memory)


Serial consoles EOT for i in $(seq 0 3 | sed 's/^/TTYS/' ; seq 0 3 | sed 's/^/TTYUSB/'); do eval checked="\$$i" cat < ${i/TTY/tty} " [ "$i" = "TTYS3" ] && echo "" done cat <

Kernel serial console EOT for i in 115200 57600 38400 19200 9600 4800 2400 1200 600 300; do echo -n "$i" done echo -e "\n

" } config_note() { cat < function update_form() { for (var i = 0; i < document.forms.length; i++) { for (var j = 0; j < document.forms[i].elements.length; j++) { var obj = document.forms[i].elements[j] if (obj.name.startsWith("TTYS") || obj.name.startsWith("TTYUSB")) { var speed = document.getElementsByName("SPEED_"+obj.name)[0] speed.disabled = !obj.checked } if (obj.name == "KERNEL_TTY") { var speed = document.getElementsByName("SPEED_"+obj.name)[0] speed.disabled = (obj.value == "none") } } } } update_form() window.onchange = update_form //--> EOT }