summaryrefslogtreecommitdiff
path: root/overlay/etc/rc.d/archiso
diff options
context:
space:
mode:
Diffstat (limited to 'overlay/etc/rc.d/archiso')
-rwxr-xr-xoverlay/etc/rc.d/archiso81
1 files changed, 21 insertions, 60 deletions
diff --git a/overlay/etc/rc.d/archiso b/overlay/etc/rc.d/archiso
index 3355737..1d4443c 100755
--- a/overlay/etc/rc.d/archiso
+++ b/overlay/etc/rc.d/archiso
@@ -1,66 +1,6 @@
# vim: set ft=sh:
. /etc/rc.conf
. /etc/rc.d/functions
-. /etc/archiso/functions
-
-
-scan_network ()
-{
- netparam () { echo ${2} | sed "s|.*${1}\([^ ]*\).*|\1|gi"; }
- #
- netdevs=$(cat /proc/net/dev | grep ':' | cut -d':' -f1)
- for net in ${netdev}; do
- stats=$(ifconfig ${net} | tr -s "\n" " ")
- done
-}
-
-scan_mount_pts ()
-{
- #iterate over all block devices
- stat_busy "Scanning local block devices"
- for dev in $(echo /sys/block/*/dev /sys/block/*/*/dev); do
-
- devname="/dev/$(echo ${dev} | cut -d'/' -f3,4 | cut -d'/' -f1)"
- mountpt="/mnt/$(basename '${devname}')"
- mkdir -p "${mountpt}" 2>/dev/null
- mount ${options} "${devname}" "${mountpt}" >/dev/null 2>&1
-
- fstype=$(awk '{ if ($1=="${devname}") { print $3" "$4;q }}' /proc/mounts)
- fstype="${fstype%%,*}"
- case "${fstype%% *}" in
- *fat*|ntfs|*dos) options="user,exec,uid=0,gid=100,umask=00070" ;;
- *) options="users,defaults,exec" ;;
- #TODO handle 'sync' on usb devices...
- esac
-
- echo "${devname} ${mountpt} ${fstype} ${options} 0 0 #configured by archiso" >>/etc/fstab
- done
- stat_done
-}
-
-scan_swap ()
-{
- #Archie finds a pagefile.sys for windows/dos machines... may add later
- stat_busy "Finding existing swap partitions"
- swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
- if [ -e "${swapdev}" ]; then
- swapon ${swapdev}
- echo "${swapdev} swap swap defaults 0 0 #configured by archiso" >>/etc/fstab
- fi
- stat_done
-}
-
-do_homedir ()
-{
- stat_busy "Scanning for existing HOME directory"
- user="$(cmdline_param homeuser)"
- for hdir in $(find /mnt -name "home/${user}" 2>/dev/null); do
- mkdir -p "/home/libre/"
- # break after the first success...
- mount --bind "${hdir}" "/home/libre/" && break
- done
- stat_done
-}
do_makeuser ()
{
@@ -86,11 +26,32 @@ do_fix_perms ()
stat_done
}
+# If an alternate console was specified on the kernel command line,
+# start agetty on it too.
+do_special_console()
+{
+ cmdline_console="$(kernel_cmdline console)"
+ [ $? -ne 0 ] && return
+
+ dev="${cmdline_console%%,*}"
+ args="${cmdline_console##*,}"
+ baud="${args%%[neo]*}" && baud="${baud:-"9600"}"
+ [ "x${args}" != "x${args%%r}" ] && rts="-h"
+
+
+ stat_busy "Starting agetty on console: ${cmdline_console}"
+ echo "${dev}" >> /etc/securetty
+ echo "z0:2345:respawn:/sbin/agetty ${rts} ${baud} ${dev} linux" >> /etc/inittab
+ /sbin/telinit q
+ stat_done
+}
+
case "$1" in
start)
do_locale_gen
do_makeuser
do_fix_perms
+ do_special_console
;;
esac
exit 0