From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R2eeu-00018h-54 for garchives@archives.gentoo.org; Sun, 11 Sep 2011 07:40:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 109AE21C05B; Sun, 11 Sep 2011 07:40:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8757621C05B for ; Sun, 11 Sep 2011 07:40:47 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F20951B400C for ; Sun, 11 Sep 2011 07:40:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0F14880042 for ; Sun, 11 Sep 2011 07:40:46 +0000 (UTC) From: "Fabio Erculiani" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabio Erculiani" Message-ID: Subject: [gentoo-commits] proj/genkernel:master commit in: /, defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: ChangeLog defaults/initrd.scripts defaults/linuxrc X-VCS-Directories: / defaults/ X-VCS-Committer: lxnay X-VCS-Committer-Name: Fabio Erculiani X-VCS-Revision: d6696d0df6e1b31bf169fc34e2a9b0579f2af72d Date: Sun, 11 Sep 2011 07:40:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 39b6b5f69fb0062398827dd03f0322d7 commit: d6696d0df6e1b31bf169fc34e2a9b0579f2af72d Author: Fabio Erculiani sabayon org> AuthorDate: Sun Sep 11 07:42:30 2011 +0000 Commit: Fabio Erculiani gentoo org> CommitDate: Sun Sep 11 07:44:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3Dd6696d0d syntax: drop parse_opt usage and crufty, deprecated subshelling through `= ` These changes have been ported from official Gentoo LiveDVD --- ChangeLog | 4 + defaults/initrd.scripts | 8 -- defaults/linuxrc | 200 +++++++++++++++++++++++------------------= ----- 3 files changed, 104 insertions(+), 108 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd11f8e..fbc1418 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ =20 + 11 Sep 2011; Fabio Erculiani defaults/initrd.script= s, + defaults/linuxrc: + drop parse_opt usage and crufty, deprecated subshelling through=20 + 30 Aug 2011; Sebastian Pipping defaults/initrd.scri= pts: Fix quoting issue (bug #380729). =20 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index bf31042..da8cb01 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -6,14 +6,6 @@ backup() { echo -ne "\033[0G\033[0K" } =20 -parse_opt() { - case "$1" in - *\=3D*) - echo "$1" | cut -d=3D -f2- - ;; - esac -} - modules_load() { for module in $* do diff --git a/defaults/linuxrc b/defaults/linuxrc index 7aa11e3..ee74d76 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -33,7 +33,7 @@ fi =20 quiet_kmsg =20 -CMDLINE=3D`cat /proc/cmdline` +CMDLINE=3D$(cat /proc/cmdline) # Scan CMDLINE for any specified real_root=3D or cdroot arguments FAKE_ROOT=3D'' REAL_ROOTFLAGS=3D'' @@ -42,41 +42,41 @@ CRYPT_SILENT=3D0 for x in ${CMDLINE} do case "${x}" in - real_root\=3D*) - REAL_ROOT=3D`parse_opt "${x}"` + real_root=3D*) + REAL_ROOT=3D${x#*=3D} ;; - root\=3D*) - FAKE_ROOT=3D`parse_opt "${x}"` + root=3D*) + FAKE_ROOT=3D${x#*=3D} ;; - subdir\=3D*) - SUBDIR=3D`parse_opt "${x}"` + subdir=3D*) + SUBDIR=3D${x#*=3D} ;; - real_init\=3D*) - REAL_INIT=3D`parse_opt "${x}"` + real_init=3D*) + REAL_INIT=3D${x#*=3D} ;; - init_opts\=3D*) - INIT_OPTS=3D`parse_opt "${x}"` + init_opts=3D*) + INIT_OPTS=3D${x#*=3D} ;; # Livecd options cdroot) CDROOT=3D1 ;; - cdroot\=3D*) + cdroot=3D*) CDROOT=3D1 - CDROOT_DEV=3D`parse_opt "${x}"` + CDROOT_DEV=3D${x#*=3D} ;; - cdroot_type\=3D*) - CDROOT_TYPE=3D`parse_opt "${x}"` + cdroot_type=3D*) + CDROOT_TYPE=3D${x#*=3D} ;; # Start livecd loop, looptype options - loop\=3D*) - LOOP=3D`parse_opt "${x}"` + loop=3D*) + LOOP=3D${x#*=3D} ;; - looptype\=3D*) - LOOPTYPE=3D`parse_opt "${x}"` + looptype=3D*) + LOOPTYPE=3D${x#*=3D} ;; - isoboot\=3D*) - ISOBOOT=3D`parse_opt "${x}"` + isoboot=3D*) + ISOBOOT=3D${x#*=3D} ;; # Start Volume manager options=20 dolvm) @@ -92,8 +92,8 @@ do dodmraid) USE_DMRAID_NORMAL=3D1 ;; - dodmraid\=3D*) - DMRAID_OPTS=3D`parse_opt "${x}"` + dodmraid=3D*) + DMRAID_OPTS=3D${x#*=3D} USE_DMRAID_NORMAL=3D1 ;; # Debug Options @@ -101,102 +101,102 @@ do DEBUG=3D'yes' ;; # Scan delay options=20 - scandelay\=3D*) - SDELAY=3D`parse_opt "${x}"` + scandelay=3D*) + SDELAY=3D${x#*=3D} ;; scandelay) SDELAY=3D3 ;; # Module no-loads - doload\=3D*) - MDOLIST=3D`parse_opt "${x}"` - MDOLIST=3D"`echo ${MDOLIST} | sed -e 's/,/ /g'`" + doload=3D*) + MDOLIST=3D${x#*=3D} + MDOLIST=3D$(echo ${MDOLIST} | sed -e 's/,/ /g'`) ;; nodetect) NODETECT=3D1 ;; - noload\=3D*) - MLIST=3D`parse_opt "${x}"` - MLIST=3D"`echo ${MLIST} | sed -e 's/,/ /g'`" + noload=3D*) + MLIST=3D${x#*=3D} + MLIST=3D"$(echo ${MLIST} | sed -e 's/,/ /g')" export MLIST ;; # Redirect output to a specific tty - CONSOLE\=3D*|console\=3D*) - CONSOLE=3D`parse_opt "${x}"` - CONSOLE=3D`basename ${CONSOLE}` + CONSOLE=3D*|console=3D*) + CONSOLE=3D${x#*=3D} + CONSOLE=3D$(basename ${CONSOLE}) # exec >${CONSOLE} <${CONSOLE} 2>&1 ;; # /dev/md - lvmraid\=3D*) - RAID_DEVICES=3D"`parse_opt ${x}`" - RAID_DEVICES=3D"`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`" + lvmraid=3D*) + RAID_DEVICES=3D"${x#*=3D}" + RAID_DEVICES=3D"$(echo ${RAID_DEVICES} | sed -e 's/,/ /g')" USE_LVM_NORMAL=3D1 ;; - part\=3D*) - MDPART=3D`parse_opt "${x}"` + part=3D*) + MDPART=3D${x#*=3D} ;; # NFS - ip\=3D*) - IP=3D`parse_opt "${x}"` + ip=3D*) + IP=3D${x#*=3D} ;; - nfsroot\=3D*) - NFSROOT=3D`parse_opt "${x}"` + nfsroot=3D*) + NFSROOT=3D${x#*=3D} ;; # iSCSI - iscsi_initiatorname\=3D*) - ISCSI_INITIATORNAME=3D`parse_opt "${x}"` + iscsi_initiatorname=3D*) + ISCSI_INITIATORNAME=3D${x#*=3D} ;; - iscsi_target\=3D*) - ISCSI_TARGET=3D`parse_opt "${x}"` + iscsi_target=3D*) + ISCSI_TARGET=3D${x#*=3D} ;; - iscsi_tgpt\=3D*) - ISCSI_TGPT=3D`parse_opt "${x}"` + iscsi_tgpt=3D*) + ISCSI_TGPT=3D${x#*=3D} ;; - iscsi_address\=3D*) - ISCSI_ADDRESS=3D`parse_opt "${x}"` + iscsi_address=3D*) + ISCSI_ADDRESS=3D${x#*=3D} ;; - iscsi_port\=3D*) - ISCSI_PORT=3D`parse_opt "${x}"` + iscsi_port=3D*) + ISCSI_PORT=3D${x#*=3D} ;; - iscsi_username\=3D*) - ISCSI_USERNAME=3D`parse_opt "${x}"` + iscsi_username=3D*) + ISCSI_USERNAME=3D${x#*=3D} ;; - iscsi_password\=3D*) - ISCSI_PASSWORD=3D`parse_opt "${x}"` + iscsi_password=3D*) + ISCSI_PASSWORD=3D${x#*=3D} ;; - iscsi_username_in\=3D*) - ISCSI_USERNAME_IN=3D`parse_opt "${x}"` + iscsi_username_in=3D*) + ISCSI_USERNAME_IN=3D${x#*=3D} ;; - iscsi_password_in\=3D*) - ISCSI_PASSWORD_IN=3D`parse_opt "${x}"` + iscsi_password_in=3D*) + ISCSI_PASSWORD_IN=3D${x#*=3D} ;; - iscsi_debug\=3D*) - ISCSI_DEBUG=3D`parse_opt "${x}"` + iscsi_debug=3D*) + ISCSI_DEBUG=3D${x#*=3D} ;; iscsi_noibft) ISCSI_NOIBFT=3D1 ;; # Crypto - crypt_root\=3D*) - CRYPT_ROOT=3D`parse_opt "${x}"` + crypt_root=3D*) + CRYPT_ROOT=3D${x#*=3D} ;; - crypt_swap\=3D*) - CRYPT_SWAP=3D`parse_opt "${x}"` + crypt_swap=3D*) + CRYPT_SWAP=3D${x#*=3D} ;; - root_key\=3D*) - CRYPT_ROOT_KEY=3D`parse_opt "${x}"` + root_key=3D*) + CRYPT_ROOT_KEY=3D${x#*=3D} ;; - root_keydev\=3D*) - CRYPT_ROOT_KEYDEV=3D`parse_opt "${x}"` + root_keydev=3D*) + CRYPT_ROOT_KEYDEV=3D${x#*=3D} ;; - swap_key\=3D*) - CRYPT_SWAP_KEY=3D`parse_opt "${x}"` + swap_key=3D*) + CRYPT_SWAP_KEY=3D${x#*=3D} ;; - swap_keydev\=3D*) - CRYPT_SWAP_KEYDEV=3D`parse_opt "${x}"` + swap_keydev=3D*) + CRYPT_SWAP_KEYDEV=3D${x#*=3D} ;; - real_resume\=3D*|resume\=3D*) - REAL_RESUME=3D`parse_opt "${x}"` + real_resume=3D*|resume=3D*) + REAL_RESUME=3D${x#*=3D} ;; noresume) NORESUME=3D1 @@ -204,14 +204,14 @@ do crypt_silent) CRYPT_SILENT=3D1 ;; - real_rootflags\=3D*) - REAL_ROOTFLAGS=3D`parse_opt "${x}"` + real_rootflags=3D*) + REAL_ROOTFLAGS=3D${x#*=3D} ;; - rootfstype\=3D*) - ROOTFSTYPE=3D`parse_opt "${x}"` + rootfstype=3D*) + ROOTFSTYPE=3D${x#*=3D} ;; - keymap\=3D*) - keymap=3D`parse_opt "${x}"` + keymap=3D*) + keymap=3D${x#*=3D} ;; aufs) USE_AUFS_NORMAL=3D1 @@ -228,19 +228,19 @@ do nounionfs) USE_UNIONFS_NORMAL=3D0 ;; -# unionfs\=3D*) =20 +# unionfs=3D*) =20 # if [ ! -x /sbin/unionfs ] =20 # then =20 # USE_UNIONFS_NORMAL=3D0 =20 # bad_msg 'unionfs binary not found: abo= rting use of unionfs!' # else =20 # USE_UNIONFS_NORMAL=3D1 =20 -# CMD_UNIONFS=3D`parse_opt "${x}"` =20 +# CMD_UNIONFS=3D${x#*=3D} =20 # echo ${CMD_UNIONFS}|grep , >/dev/null = 2>&1 =20 # if [ $? -eq 0 ] # then =20 -# UID=3D`echo ${CMD_UNIONFS#*,}`= =20 -# UNIONFS=3D`echo ${CMD_UNIONFS%= ,*}` =20 +# UID=3D$(echo ${CMD_UNIONFS#*,}= ) =20 +# UNIONFS=3D$(echo ${CMD_UNIONFS= %,*})=20 # else =20 # UNIONFS=3D${CMD_UNIONFS} =20 # fi =20 @@ -321,23 +321,23 @@ then if [ "${NORESUME}" !=3D '1' ] && [ -n "${REAL_RESUME}" ] then case "${REAL_RESUME}" in - LABEL\=3D*|UUID\=3D*) + LABEL=3D*|UUID=3D*) =20 RESUME_DEV=3D"" retval=3D1 =09 if [ ${retval} -ne 0 ]; then - RESUME_DEV=3D`findfs "${REAL_RESUME}" 2>/dev/null` + RESUME_DEV=3D$(findfs "${REAL_RESUME}" 2>/dev/null) retval=3D$? fi =09 if [ ${retval} -ne 0 ]; then - RESUME_DEV=3D`busybox findfs "${REAL_RESUME}" 2>/dev/null` + RESUME_DEV=3D$(busybox findfs "${REAL_RESUME}" 2>/dev/null) retval=3D$? fi =09 if [ ${retval} -ne 0 ]; then - RESUME_DEV=3D`blkid -l -t "${REAL_RESUME}" | cut -d ":" -f 1 2>/dev= /null` + RESUME_DEV=3D$(blkid -l -t "${REAL_RESUME}" | cut -d ":" -f 1 2>/de= v/null) retval=3D$? fi =09 @@ -434,17 +434,17 @@ do retval=3D1 =09 if [ ${retval} -ne 0 ]; then - ROOT_DEV=3D`findfs "${REAL_ROOT}" 2>/dev/null` + ROOT_DEV=3D$(findfs "${REAL_ROOT}" 2>/dev/null) retval=3D$? fi =09 if [ ${retval} -ne 0 ]; then - ROOT_DEV=3D`busybox findfs "${REAL_ROOT}" 2>/dev/null` + ROOT_DEV=3D$(busybox findfs "${REAL_ROOT}" 2>/dev/null) retval=3D$? fi =09 if [ ${retval} -ne 0 ]; then - ROOT_DEV=3D`blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/nul= l` + ROOT_DEV=3D$(blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/nu= ll) retval=3D$? fi =09 @@ -630,9 +630,9 @@ then then if [ -e "${NEW_ROOT}/mnt/cdrom/add" ] then - for targz in `ls ${NEW_ROOT}/mnt/cdrom/add/*.tar.gz` + for targz in $(ls ${NEW_ROOT}/mnt/cdrom/add/*.tar.gz) do=09 - tarname=3D`basename ${targz}` + tarname=3D$(basename ${targz}) good_msg "Adding additional package ${tarname}" (cd ${NEW_ROOT} ; /bin/tar -xzf ${targz}) done @@ -655,7 +655,7 @@ then do if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ] then - ln -s "`readlink ${NEW_ROOT}/${FS_LOCATION}/${x}`" "${x}" 2>/dev/null + ln -s "$(readlink ${NEW_ROOT}/${FS_LOCATION}/${x})" "${x}" 2>/dev/nul= l else # List all subdirectories of x find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null | while re= ad directory @@ -665,7 +665,7 @@ then =20 # Skip this directory if we already linked a parent directory if [ "${current_parent}" !=3D '' ]; then - var=3D`echo "${directory}" | grep "^${current_parent}"` + var=3D$(echo "${directory}" | grep "^${current_parent}") if [ "${var}" !=3D '' ]; then continue fi @@ -674,7 +674,7 @@ then if [ -e "/${NEW_ROOT}/${directory}" ] then # It does exist, link all the individual files - for file in `ls /${NEW_ROOT}/${FS_LOCATION}/${directory}` + for file in $(ls /${NEW_ROOT}/${FS_LOCATION}/${directory}) do if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ] && [= ! -e "${NEW_ROOT}/${directory}/${file}" ]; then ln -s "/${FS_LOCATION}/${directory}/${file}" "${directory}/${file= }" 2> /dev/null @@ -694,7 +694,7 @@ then =20 fi =20 - #UML=3D`cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||'` + #UML=3D$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||') #if [ "${UML}" =3D 'UML' ] #then # # UML Fixes