home: hub: mkinitfs

Download patch

ref: 1c8e79aa164ecf6606d918a57d991bb6ae234a5b
parent: a3ad8dee6b8e785a43d703a5a8b46e2e3c7ddad7
parent: fb2bcf06282c9b130b4b7a2c1e35449e55d0c139
author: Natanael Copa <ncopa@alpinelinux.org>
date: Wed Jun 2 01:42:54 CDT 2010

Merge remote branch 'sdrik/to-upstream'

--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -152,19 +152,28 @@
 	done
 }
 
-setup_inittab_serial(){
+setup_inittab_console(){
 	while [ $# -gt 0 ]; do
 		local tty=${1%,*}
 		local speed=${1#*,}
-		if [ "$speed" = "$1" ]; then
-			speed=
-		fi
+		local line=
+		local term=
+		case "$tty" in
+			ttyS*)
+				[ "$speed" = "$1" ] && speed=9600
+				term=vt100
+				line=-L
+				;;
+			*)
+				[ "$speed" = "$1" ] && speed=38400
+				;;
+		esac
 		shift
 
 		# do nothing if inittab already have the tty set up
 		grep -q "^$tty:" $sysroot/etc/inittab && continue
-		echo "# enable login on serial console" >> $sysroot/etc/inittab
-		echo "$tty::respawn:/sbin/getty -L $tty $speed vt100" \
+		echo "# enable login on alternative console" >> $sysroot/etc/inittab
+		echo "$tty::respawn:/sbin/getty $line $speed $tty $term" \
 			>> $sysroot/etc/inittab
 	done
 }
@@ -180,8 +189,8 @@
 	case "$1" in
 		s|single|1)
 			SINGLEMODE=yes ;;
-		console=ttyS*)
-			SERIAL="$SERIAL ${1#console=}";;
+		console=*)
+			CONSOLE="$CONSOLE ${1#console=}";;
 		*=*)    eval "KOPT_${1%%=*}='${1#*=}'" ;;
 		no*)    eval "KOPT_$(echo ${1#no} | sed 's: :_:g')=no" ;;
 		*)      eval "KOPT_$(echo $1 | sed 's: :_:g')=yes" ;;
@@ -206,6 +215,13 @@
 if [ "$ALPINE_DEV_FS" = "$ALPINE_DEV" ]; then
 	unset ALPINE_DEV_FS
 fi
+if [ -n "$KOPT_ovl_dev" ] ; then
+	OVL_DEV=${KOPT_ovl_dev%%:*}
+	OVL_DEV_FS=${KOPT_ovl_dev##*:}
+	if [ "$OVL_DEV_FS" = "$OVL_DEV" ]; then
+		unset OVL_DEV_FS
+	fi
+fi
 
 # look for standard mountpoint locations
 ALPINE_MNT=$(find_mnt /dev/$ALPINE_DEV /etc/fstab)
@@ -299,7 +315,18 @@
 fi
 mount -t tmpfs $root_opts tmpfs $sysroot
 
-find_ovl_dev
+if [ -n "$OVL_DEV" ]; then
+	mkdir -p /media/$OVL_DEV
+	unset mount_opts
+	if [ -n "$OVL_DEV_FS" ]; then
+		mount_opts="-t $OVL_DEV_FS"
+	fi
+	
+	retry_mount $mount_opts /dev/$OVL_DEV /media/$OVL_DEV >/dev/null 2>&1
+	ovl=$(find_ovl /media/$OVL_DEV)
+else
+	find_ovl_dev
+fi
 if ! [ -f "$ovl" ]; then
 	ovl=$(find_ovl $ALPINE_MNT)
 fi
@@ -394,8 +421,8 @@
 fi
 eend $?
 
-# fix inittab if serial console
-setup_inittab_serial $SERIAL
+# fix inittab if alternative console
+setup_inittab_console $CONSOLE
 
 # copy alpine release info
 cp $ALPINE_MNT/.alpine-release $sysroot/