#!/bin/sh # shellcheck disable=SC1091,SC2034 # rc.S: Basic system initialization. # Modification of the file assumed to have been written by Patrick .J. Volkerding found in: # http://ftp.slackware.com/pub/slackware/slackware-15.0/source/installer/sources/initrd/skeleton_initrd.tar.gz # heavily modified by Didier Spaier didieratslintdotfr for the Slint Linux distribution. # Version included in slint64-15.0-3.iso # Any /etc/mtab that exists here is old, so we start with a new one: #/bin/rm -f /etc/mtab /etc/mtab~ /etc/mtab.tmp && /bin/touch /etc/mtab # Add (fake) entry for / to /etc/mtab: #/sbin/mount -f -w /dev/initramfs / -t tmpfs 1> /dev/null if [ ! -e /proc/mounts ]; then /sbin/mount -v proc /proc -t proc 1> /dev/null fi if ! grep -q "^sysfs" /proc/mounts; then /sbin/mount -v sysfs /sys -t sysfs 1> /dev/null fi # Mount the efivars files system if the system booted in EFI mode. This # will allow to include in the GRUB # boot menu a boot entry to go to # the firmware setup menu. [ -d /sys/firmware/efi/efivars ] && mount -t efivarfs none /sys/firmware/efi/efivars if [ -x /sbin/ldconfig ]; then /sbin/ldconfig 1> /dev/null fi # We source /sbin/functions after having mounted /proc and /sys to avoid hamrless erreor messages # But before "export TEXTDOMAIN=rc.S" as the TEXTDOMAIN of /sbin/functions is "auto". . /sbin/functions export TEXTDOMAIN=rc.S . gettext.sh . /sbin/SeTlocales # System logger (mostly to eat annoying messages): /sbin/syslogd 2> /dev/null sleep 1 /sbin/klogd -c 3 1> /dev/null # Try to load the loop module: modprobe loop 1> /dev/null 2> /dev/null # Run udev: /bin/bash /etc/rc.d/rc.udev start unset SYNTH if grep -q speakup.synth /proc/cmdline; then SYNTH=$(sed "s@.*speakup[-_]synth=\([[:alpha:]]\{1,\}\).*@\1@" /proc/cmdline) [ "$SYNTH" ] && [ ! "$SYNTH" = "soft" ] && modprobe speakup_"$SYNTH" && touch /tmp/noespeakup fi sleep 1 # espeakup initialization. This was done in previous versions just before running # /sbin/probe_sound_cards but there is no need to wait. # If a hard synth is set in the command line no need to start espeakup. # This could be done running "rc.espeakup start", but not knowing yet if espeakup will be really used, # instead case occuring espeakup will be started by /sbin/probe_sound_cards. if [ ! -f /tmp/noespeakup ]; then modprobe speakup_soft echo "soft" > /sys/accessibility/speakup/synth sleep 1 echo 1 > /sys/accessibility/speakup/soft/direct fi sleep 1 # brltty is included in the initrd so that it be started by udev when applicable. # Start brltty if it has not yet been started by udev NBPROC="$(ps -C brltty --noheaders|wc -l)" if [ "$NBPROC" = "0" ]; then echo "starting brltty" /bin/brltty sleep 2 fi touch /.today /bin/sh /sbin/fakedate if [ -x /etc/rc.d/rc.inet1 ]; then /bin/sh /etc/rc.d/rc.inet1 fi /bin/sh /etc/rc.d/rc.font # Don't automatically blank the screen, or it will go black during the install # process when stray keystrokes might be dangerous: /bin/setterm -blank 0 TMP=/var/log/setup/tmp if [ ! -d $TMP ]; then mkdir -p $TMP fi TMP=/var/log/setup/tmp kbd_stored="$(cat /tmp/Pkeymap)" kbd=${kbd_stored%.*} #SavedLANG=$LANG #LANG=en_US.utf8 ll_TT=${LANG%.*} SeTFonts PutFonts set_voice () { locale="$1" rawlocale=${locale%.utf8} lang=$(echo "$rawlocale" |cut -d_ -f1) country=$(echo "$rawlocale" |cut -d_ -f2|tr "[:upper:]" "[:lower:]") if [ "$lang" = gl ]; then # Not supported by espeak yet, but pt should be fine enough, better # than English anyway # Comment above from Debian. We don't propose gv in Slint yet, but # maybe later ? lang=pt fi if grep -qr "^language $lang-$country$" /usr/share/espeak-ng-data/lang; then VOICE="$lang-$country" elif grep -qr "^language $lang$" /usr/share/espeak-ng-data/lang; then VOICE="$lang" else VOICE=en fi echo $VOICE > /tmp/speech } sh /etc/rc.d/rc.alsa 2>/tmp/error.alsa 1>out.alsa set_voice "$LANG" # Probe the sound cards as in Debian # We will do it, regardless or espeakup could be used or not # TODO: internationalize and localize the messages from /sbin/probe_sound_cards sh /sbin/probe_sound_cards sleep 2 # If a working sound card has been found, its id has been written in # /tmp/alsacard, else /tmp/noespeakup has been written sleep 2 clear if [ ! -f /tmp/noespeakup ]; then gettext "This installer has speech and Braille device support in order to be accessible to visually impaired users. To have speech turned on during installation type S, then press [Enter]. Else, just press Enter. " clear_stdin read -r sound if [ ! "$sound" = "s" ] && [ ! "$sound" = "S" ]; then PID=$(ps -C espeakup --noheaders -o pid) kill -s 9 "$PID" sleep 1 touch /tmp/noespeakup else # I assume that people owning a hard synthesizer already know the speakup keybord shosrtcuts. clear gettext "To display keyboard shortcuts for reviewing the screen with speech press R, then press [Enter], Else, just press [Enter]: " clear_stdin read -r ANSWER if [ "$ANSWER" = "R" ] || [ "$ANSWER" = "r" ]; then clear w3m -o confirm_qq=false /Speakup fi fi fi INITLANG=$LANG TITLE=$(gettext "LANGUAGE TO USE DURING INSTALLATION") dialog --visit-items --no-tags --no-cancel --nook --title "$TITLE" --default-item "$INITLANG" --menu \ "$(eval_gettext "Please select the language to use for installation.")" 0 0 0 \ en_US.utf8 "$(gettext "English (USA)")" \ nl_NL.utf8 "$(gettext "Dutch")" \ fr_FR.utf8 "$(gettext "French")" \ el_GR.utf8 "$(gettext "Greek")" \ it_IT.utf8 "$(gettext "Italian")" \ pt_PT.utf8 "$(gettext "Portuguese (Portugal)")" \ ru_RU.utf8 "$(gettext "Russian")" \ sv_SE.utf8 "$(gettext "Swedish")" \ 2> /tmp/.SlintInstallationLANG mycmd="$?" if [ "$mycmd" -ne 0 ]; then echo "$INITLANG" > /tmp/.SlintInstallationLANG fi LANG=$(cat /tmp/.SlintInstallationLANG) ll_TT=${LANG%.*} SeTlocales SeTKeymap SeTFonts PutFonts if [ ! -f /tmp/noespeakup ] && [ ! "$INITLANG" = "$LANG" ]; then PID=$(ps -C espeakup --noheaders -o pid) kill -s 9 "$PID" sleep 1 set_voice "$LANG" ALSA_CARD=$(cat /tmp/alsacard) ALSA_CARD=$ALSA_CARD /usr/bin/espeakup -V "$(cat /tmp/speech)" >> /tmp/espeakup.log 2>&1 echo "ALSA_CARD=$ALSA_CARD /usr/bin/espeakup -V $(cat /tmp/speech)" >> /tmp/report fi clear eval_gettext "