Mail archive

[alpine-devel] mkinitfs initramfs-init questions

From: Евгений 'Rush' Непомнящий <>
Date: Tue, 26 Feb 2013 12:51:29 +0400

There are some magic when parsing kernel command line (at the end of message):

1. Which reason for doing sed 's: :_:g' ? What command line will be
affected this for example?
2. Syslinux (5.x) pass kernel path as the first arg (twice in my
case). This code run with errors "/init: eval: line 1:
KOPT_/boot/datacom=yes: not found". This a bug or feature?
3. I've passed console=tty0 console=ttyS1,115200 for my Ubuntu kernels
on Dell servers with IPMI SOL to see kernel output both on IP KVM and
IPMI SOL (because not everywhere I have both). I think tty0 must not
be placed in inittab, because it is "current console". Seems like a
4. Code looks overcomplicated because there are
  a) not many options to be parsed by initramfs-init
  b) not all kernel options must be parsed by initramfs-init, unknown
options must be skipped (and errors as in #2 will not be raised in the

# read the kernel options. We use eval set so we can handle things like
# acpi_osi="!Windows 2006"
eval set -- `cat /proc/cmdline`

while [ $# -gt 0 ]; do
        case "$1" in
                        SINGLEMODE=yes ;;
                        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" ;;

/ # cat /proc/cmdline
/boot/datacom /boot/datacom initrd=/boot/datacom.gz
alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage
nomodeset console=tty0 console=ttyS1,115200

Cogito ergo sum
Received on Tue Feb 26 2013 - 12:51:29 UTC