Mail archive
alpine-devel

Re: [alpine-devel] mkinitfs initramfs-init questions

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Tue, 26 Feb 2013 21:45:49 +0100

On Tue, 26 Feb 2013 12:51:29 +0400
Евгений 'Rush' Непомнящий <rush.zlo_at_gmail.com> wrote:

> 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?

git blame pointed me to this commit:
http://git.alpinelinux.org/cgit/mkinitfs/commit/?id=bcc5a38b9849411a880d8b65771b30042aa7ce62

I had an issue with parsning acpi_osi="!Windows 2006". While there I
probably added the sed 's: :_:g' out of paranoia, in case kernel or
anything would have a param with spaces.

  somenewopt:"arg with space"

I doubt there are anything current that actually needs it. It was more
for future, unexpected things.

> 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?

Bug/regression due to new syslinux behaviour. I have similar issue on
my computer too. Just not had time to actually fix it.

> 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
> bug?

Yeah. this sounds like bug.

> 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
> future)

Agree. We should only fish out the options we actually use and don't
bother about the rest. I have one more example where current code will
break things:

  cirrus.modeset=0

>
> 8<------------------------------------------------------------------------------------------->8
> # 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
> s|single|1)
> SINGLEMODE=yes ;;
> 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" ;; esac
> shift
> done
> 8<------------------------------------------------------------------------------------------->8
>
> / # 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


Thanks for your feedback, and sorry for the breakages due to syslinux-5.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Tue Feb 26 2013 - 21:45:49 UTC