X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from ncopa-laptop.res.nor.wtbts.net (3.203.202.84.customer.cdi.no [84.202.203.3]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nc@alpinelinux.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id 00B54DC011F; Tue, 26 Feb 2013 21:20:56 +0000 (UTC) Date: Tue, 26 Feb 2013 22:20:40 +0100 From: Natanael Copa To: =?UTF-8?Q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= 'Rush' =?UTF-8?Q?=D0=9D=D0=B5=D0=BF=D0=BE=D0=BC=D0=BD=D1=8F=D1=89=D0=B8=D0=B9?= Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] mkinitfs initramfs-init questions Message-ID: <20130226222040.16f2a4a4@ncopa-laptop.res.nor.wtbts.net> In-Reply-To: <20130226214549.3e82b644@ncopa-laptop.res.nor.wtbts.net> References: <20130226214549.3e82b644@ncopa-laptop.res.nor.wtbts.net> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.15; i686-pc-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 26 Feb 2013 21:45:49 +0100 Natanael Copa wrote: > > 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. How about this: diff --git a/initramfs-init.in b/initramfs-init.in index 6e1ebc1..60a0255 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -283,22 +283,23 @@ echo "Alpine Init $VERSION" # 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" ;; +for opt in "$@"; do + case "$opt" in + s|single|1) + SINGLEMODE=yes ;; + console=*) + CONSOLE="$CONSOLE ${opt#console=}";; + debug_init) + set -x;; + alpine_dev|autodetect|autoraid|chart|cryptroot|debug_init|dma|init_args|keep_apk_new|modules|ovl_dev|pkgs|quiet|root_size|root|usbdelay) + case "$opt" in + *=*) eval "KOPT_${opt%%=*}='${opt#*=}'";; + no*) eval "KOPT_${opt#no}=no";; + *) eval "KOPT_$opt=yes";; + esac esac - shift done -# enable debugging if requested -[ -n "$KOPT_debug_init" ] && set -x - # pick first keymap if found for map in /etc/keymap/*; do if [ -f "$map" ]; then -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---