From 2b09eabef94328b16267abedd71435270ea3ec07 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 6 May 2013 23:07:35 +0200 Subject: [PATCH 01/12] genkernel: set version to 9999 --- genkernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genkernel b/genkernel index 9cdb92b..fe14d7b 100755 --- a/genkernel +++ b/genkernel @@ -2,7 +2,7 @@ # $Id$ PATH="${PATH}:/sbin:/usr/sbin" -GK_V='3.4.45' +GK_V='9999' # Set the default for TMPDIR. May be modified by genkernel.conf or the # --tempdir command line option. From 8ea38a7db97e9508bf7fdad0d406b73e0ff4f032 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 6 May 2013 23:11:46 +0200 Subject: [PATCH 02/12] modules_load: add MODULES_CRYPT, improve backward compatibility --- arch/x86/modules_load | 6 ++++-- arch/x86_64/modules_load | 6 ++++-- defaults/modules_load | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/modules_load b/arch/x86/modules_load index 12a54a5..c643d2f 100644 --- a/arch/x86/modules_load +++ b/arch/x86/modules_load @@ -29,7 +29,9 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" # Crypto -MODULES_CRYPTO="sha256_generic cbc aes_generic aes_586 aesni-intel xts" +MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x86_64 xts" +# Backward compatibility with previous releases +MODULES_CRYPT="${MODULES_CRYPTO}" # DRM (Plymouth support) -MODULES_PLYMOUTH="radeon nouveau uvesafb" \ No newline at end of file +MODULES_PLYMOUTH="radeon nouveau uvesafb" diff --git a/arch/x86_64/modules_load b/arch/x86_64/modules_load index 883bc2d..e036d07 100644 --- a/arch/x86_64/modules_load +++ b/arch/x86_64/modules_load @@ -28,7 +28,9 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" # Crypto -MODULES_CRYPTO="sha256_generic cbc aes_generic aes-x86_64 aesni-intel xts" +MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x86_64 xts" +# Backward compatibility with previous releases +MODULES_CRYPT="${MODULES_CRYPTO}" # DRM (Plymouth support) -MODULES_PLYMOUTH="radeon nouveau uvesafb" \ No newline at end of file +MODULES_PLYMOUTH="radeon nouveau uvesafb" diff --git a/defaults/modules_load b/defaults/modules_load index cc91ff0..49e68df 100644 --- a/defaults/modules_load +++ b/defaults/modules_load @@ -28,7 +28,9 @@ MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd xhci-hcd u MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" # Crypto -MODULES_CRYPTO="sha256_generic cbc aes_generic xts" +MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x86_64 xts" +# Backward compatibility with previous releases +MODULES_CRYPT="${MODULES_CRYPTO}" # DRM (Plymouth support) -MODULES_PLYMOUTH="radeon nouveau uvesafb" \ No newline at end of file +MODULES_PLYMOUTH="radeon nouveau uvesafb" From 4313f7ba209b7d95ba3de807b1766176e3f1e24f Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 6 May 2013 23:14:05 +0200 Subject: [PATCH 03/12] modules_load: add virtio modules --- arch/x86/modules_load | 3 +++ arch/x86_64/modules_load | 3 +++ defaults/initrd.defaults | 4 ++-- defaults/modules_load | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/x86/modules_load b/arch/x86/modules_load index c643d2f..cb8d0c8 100644 --- a/arch/x86/modules_load +++ b/arch/x86/modules_load @@ -33,5 +33,8 @@ MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x # Backward compatibility with previous releases MODULES_CRYPT="${MODULES_CRYPTO}" +# Virtio support (KVM mainly) +MODULES_VIRTIO="virtio virtio_balloon virtio_console virtio_net virtio_blk virtio_pci virtio_ring" + # DRM (Plymouth support) MODULES_PLYMOUTH="radeon nouveau uvesafb" diff --git a/arch/x86_64/modules_load b/arch/x86_64/modules_load index e036d07..88ef0a7 100644 --- a/arch/x86_64/modules_load +++ b/arch/x86_64/modules_load @@ -32,5 +32,8 @@ MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x # Backward compatibility with previous releases MODULES_CRYPT="${MODULES_CRYPTO}" +# Virtio support (KVM mainly) +MODULES_VIRTIO="virtio virtio_balloon virtio_console virtio_net virtio_blk virtio_pci virtio_ring" + # DRM (Plymouth support) MODULES_PLYMOUTH="radeon nouveau uvesafb" diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index 627f4c4..a91e84b 100755 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -77,5 +77,5 @@ DEFAULT_NFSOPTIONS="ro,nolock,rsize=1024,wsize=1024" # Only sections that are in by default or those that # are not module groups need to be defined here... -HWOPTS='keymap cache modules pata sata scsi usb firewire waitscan lvm dmraid mdadm fs net' -MY_HWOPTS='modules pata sata scsi usb firewire waitscan dmraid mdadm fs net iscsi crypto plymouth' +HWOPTS='keymap cache modules pata sata scsi usb firewire waitscan lvm dmraid mdadm fs net virtio' +MY_HWOPTS='modules pata sata scsi usb firewire waitscan dmraid mdadm fs net iscsi crypto plymouth virtio' diff --git a/defaults/modules_load b/defaults/modules_load index 49e68df..78a2af3 100644 --- a/defaults/modules_load +++ b/defaults/modules_load @@ -32,5 +32,8 @@ MODULES_CRYPTO="sha1_generic sha256_generic sha512_generic cbc aes_generic aes-x # Backward compatibility with previous releases MODULES_CRYPT="${MODULES_CRYPTO}" +# Virtio support (KVM mainly) +MODULES_VIRTIO="virtio virtio_balloon virtio_console virtio_net virtio_blk virtio_pci virtio_ring" + # DRM (Plymouth support) MODULES_PLYMOUTH="radeon nouveau uvesafb" From 04fe3fd1f40e28b71d13f738d787e9380148fb40 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 7 May 2013 10:15:00 +0200 Subject: [PATCH 04/12] software: hardcode busybox version --- defaults/software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/software.sh b/defaults/software.sh index c9faa73..24ee6df 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -9,7 +9,7 @@ # - This file should not override previously defined variables, as their values may # originate from user changes to /etc/genkernel.conf . -BUSYBOX_VER="${BUSYBOX_VER:-VERSION_BUSYBOX}" +BUSYBOX_VER="1.20.2" BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}" BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}" BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}" From a8f8f754cc429b5818eca78804f3bdc65c5f096c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 7 May 2013 10:18:32 +0200 Subject: [PATCH 05/12] Revert "software: hardcode busybox version" This reverts commit 04fe3fd1f40e28b71d13f738d787e9380148fb40. --- defaults/software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/software.sh b/defaults/software.sh index 24ee6df..c9faa73 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -9,7 +9,7 @@ # - This file should not override previously defined variables, as their values may # originate from user changes to /etc/genkernel.conf . -BUSYBOX_VER="1.20.2" +BUSYBOX_VER="${BUSYBOX_VER:-VERSION_BUSYBOX}" BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}" BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}" BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}" From b8aee99d8146f8a468aab1d55fab765655139ed3 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 7 May 2013 10:32:59 +0200 Subject: [PATCH 06/12] rewrite Makefile, use git archive --- .gitignore | 4 +--- Makefile | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 5d43ffd..dafa321 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -/genkernel.8 -/genkernel-*.tar.bz2 -/ChangeLog +/*.tar.* diff --git a/Makefile b/Makefile index 8e31a06..063d7e7 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,13 @@ -PACKAGE_VERSION = `/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"` -distdir = genkernel-$(PACKAGE_VERSION) +VERSION ?= +distdir = genkernel-$(VERSION) # Add off-Git/generated files here that need to be shipped with releases -EXTRA_DIST = genkernel.8 ChangeLog +EXTRA_DIST = genkernel.8 genkernel.8: doc/genkernel.8.txt doc/asciidoc.conf Makefile genkernel - a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(PACKAGE_VERSION)" \ + a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(VERSION)" \ --format=manpage -D . "$<" -ChangeLog: - git log >$@ - clean: rm -f $(EXTRA_DIST) @@ -19,12 +16,9 @@ check-git-repository: git diff --cached --quiet || { echo 'STOP, you have uncommitted changes in the index' ; false ; } dist: check-git-repository $(EXTRA_DIST) - rm -Rf "$(distdir)" "$(distdir)".tar "$(distdir)".tar.bz2 - mkdir "$(distdir)" - git ls-files -z | xargs -0 cp --no-dereference --parents --target-directory="$(distdir)" \ - $(EXTRA_DIST) - tar cf "$(distdir)".tar "$(distdir)" - bzip2 -9v "$(distdir)".tar - rm -Rf "$(distdir)" + test -n "$(VERSION)" || { echo "VERSION not set" >&2; exit 1; } + git archive --prefix=$(distdir)/ --format=tar "v$(VERSION)" > $(distdir).tar + rm -f $(distdir).tar.xz + xz $(distdir).tar .PHONY: clean check-git-repository dist From ccd8a81de677e4aba1b2d817b5634333587b5292 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 7 May 2013 10:42:26 +0200 Subject: [PATCH 07/12] Push the generated tarball to dev.g.o --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 063d7e7..2841fe7 100644 --- a/Makefile +++ b/Makefile @@ -20,5 +20,6 @@ dist: check-git-repository $(EXTRA_DIST) git archive --prefix=$(distdir)/ --format=tar "v$(VERSION)" > $(distdir).tar rm -f $(distdir).tar.xz xz $(distdir).tar + scp $(distdir).tar.xz lxnay@dev.gentoo.org:~/public_html/genkernel-next/ .PHONY: clean check-git-repository dist From e2e6e63e524588738956e6079359b574fe3cd061 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 7 May 2013 10:46:04 +0200 Subject: [PATCH 08/12] Fix distdir name: genkernel-next --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2841fe7..24b6881 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ VERSION ?= -distdir = genkernel-$(VERSION) +distdir = genkernel-next-$(VERSION) # Add off-Git/generated files here that need to be shipped with releases EXTRA_DIST = genkernel.8 From 08e7dbdfe5c4608a0b416209c7d5cb401d032c14 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 11 May 2013 07:10:28 +0200 Subject: [PATCH 09/12] Drop old and no longer working /etc/module_options support --- defaults/linuxrc | 7 ------- gen_initramfs.sh | 37 ------------------------------------- 2 files changed, 44 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index ed40cb3..3f570de 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -253,13 +253,6 @@ do aufs) USE_AUFS_NORMAL=1 ;; - *=*) - case "${x%%=*}" in - *.*) - echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf" - ;; - esac - ;; esac done diff --git a/gen_initramfs.sh b/gen_initramfs.sh index dd0fccb..5337762 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -569,41 +569,6 @@ append_modules() { rm -r "${TEMP}/initramfs-modules-${KV}-temp/" } -append_modprobed() { - local TDIR="${TEMP}/initramfs-modprobe.d-temp" - if [ -d "${TDIR}" ] - then - rm -r "${TDIR}" - fi - - mkdir -p "${TDIR}/etc/module_options/" - - # Load module parameters - for dir in $(find "${MODPROBEDIR}"/*) - do - while read x - do - case "${x}" in - options*) - module_name="$(echo "$x" | cut -d ' ' -f 2)" - [ "${module_name}" != "$(echo)" ] || continue - module_options="$(echo "$x" | cut -d ' ' -f 3-)" - [ "${module_options}" != "$(echo)" ] || continue - echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf" - ;; - esac - done < "${dir}" - done - - cd "${TDIR}" - log_future_cpio_content - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modprobe.d cpio" - - cd "${TEMP}" - rm -rf "${TDIR}" > /dev/null -} - # check for static linked file with objdump is_static() { LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null @@ -749,8 +714,6 @@ create_initramfs() { append_data 'splash' "${SPLASH}" - append_data 'modprobed' - if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ] then append_data 'firmware' From 90da2a1a664465b93ad154de539f0932fb6208b3 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 11 May 2013 07:18:00 +0200 Subject: [PATCH 10/12] Drop backticks from initramfs code --- defaults/initrd.scripts | 40 ++++++++++++++++++++-------------------- defaults/linuxrc | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index fd1e5fd..88f39cc 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -196,14 +196,14 @@ findmediamount() { if [ -b "${x}" ] then skip=0 - bsn=`basename "${x}"` + bsn=$(basename "${x}") # # If disk and it has at least one partition, skip. # We use /sys/block/${bsn}/${bsn}[0-9]* to make sure that we # don't skip device mapper devices. Even the craziest scenario # deserves a fair chance. # - for part in `ls /sys/block/${bsn}/${bsn}*[0-9]* 2>/dev/null` + for part in $(ls /sys/block/${bsn}/${bsn}*[0-9]* 2>/dev/null) do skip=1 break; @@ -282,7 +282,7 @@ bootstrapCD() { bootstrapKey() { # $1 = ROOT/SWAP - local KEYDEVS=`devicelist` + local KEYDEVS=$(devicelist) eval local keyloc='"${CRYPT_'${1}'_KEY}"' findmediamount "key" "${keyloc}" "CRYPT_${1}_KEYDEV" "/mnt/key" ${KEYDEVS} @@ -328,27 +328,27 @@ mount_sysfs() { findnfsmount() { if [ "${IP}" != '' ] || busybox udhcpc -n -T 15 -q then - [ -e /rootpath ] && NFSROOT=`cat /rootpath` + [ -e /rootpath ] && NFSROOT=$(cat /rootpath) if [ "${NFSROOT}" = '' ] then # Obtain NFSIP - OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"` + OPTIONS=$(busybox dmesg | grep rootserver | sed -e "s/,/ /g") for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ] + if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootserver' ] then - NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` + NFSIP=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) fi done # Obtain NFSPATH - OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"` + OPTIONS=$(busybox dmesg | grep rootpath | sed -e "s/,/ /g") for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ] + if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootpath' ] then - NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` + NFSPATH=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) fi done @@ -408,17 +408,17 @@ find_real_device() { local retval=1 if [ "${retval}" -ne 0 ]; then - REAL_DEVICE=`findfs "${DEVICE}" 2>/dev/null` + REAL_DEVICE=$(findfs "${DEVICE}" 2>/dev/null) retval=$? fi if [ "$retval" -ne 0 ]; then - REAL_DEVICE=`busybox findfs "${DEVICE}" 2>/dev/null` + REAL_DEVICE=$(busybox findfs "${DEVICE}" 2>/dev/null) retval=$? fi if [ "${retval}" -ne 0 ]; then - REAL_DEVICE=`blkid -o device -l -t "${DEVICE}"` + REAL_DEVICE=$(blkid -o device -l -t "${DEVICE}") retval=$? fi @@ -645,7 +645,7 @@ prompt_user(){ bad_msg '- type "q" to skip...' echo -n "${2}(${oldvalue}) :: " read ${1} - case `eval echo '$'${1}` in + case $(eval echo '$'${1}) in 'q') eval ${1}'='${oldvalue} warn_msg "Skipping step, this will likely cause a boot failure." @@ -677,7 +677,7 @@ cmdline_hwopts() { MY_HWOPTS="${MY_HWOPTS} $x" elif [ "${y}" = "no${x}" ] then - MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`" + MY_HWOPTS="$(echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -)" fi if [ "$(echo ${y} | cut -b -7)" = "keymap=" ] then @@ -688,7 +688,7 @@ cmdline_hwopts() { # Shouldnt need to sort this as the following loop should figure out the # duplicates and strip them out - #MY_HWOPTS=`echo ${MY_HWOPTS}| sort` + #MY_HWOPTS=$(echo ${MY_HWOPTS}| sort) for x in ${MY_HWOPTS} do @@ -701,7 +701,7 @@ cmdline_hwopts() { fi done TMP_HWOPTS="${TMP_HWOPTS} ${x}" - eval DO_`echo ${x} | sed 's/-//'`=1 + eval DO_$(echo ${x} | sed 's/-//')=1 done MY_HWOPTS=${TMP_HWOPTS} @@ -1005,7 +1005,7 @@ startiscsi() { # $1 - root/swap openLUKS() { # please use 'tr' and this line, or remove it - # eval local TYPE=`uppercase $1` + # eval local TYPE=$(uppercase $1) case $1 in root) @@ -1238,10 +1238,10 @@ setup_md_device() { [ -z "$1" ] && device="${REAL_ROOT}" || device="$1" [ -z "${device}" ] && return # LiveCD - if [ `echo ${device}|sed -e 's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#'` = "/dev/md" ] + if [ $(echo ${device}|sed -e 's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#') = "/dev/md" ] then good_msg 'Detected real_root as a md device. Setting up the device node...' - MD_NUMBER=`echo ${device}|sed -e 's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#'` + MD_NUMBER=$(echo ${device}|sed -e 's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#') if [ ! -e /dev/md${MD_NUMBER} ] then mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 2>&1 diff --git a/defaults/linuxrc b/defaults/linuxrc index 0051faa..82aa77a 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -859,7 +859,7 @@ for fs in $fslist; do dev=$(get_mount_device $fs) [ -z "${dev}" ] && continue # Resolve it like util-linux mount does - [ -L ${dev} ] && dev=`readlink ${dev}` + [ -L ${dev} ] && dev=$(readlink ${dev}) # In this case, it's probably part of the filesystem # and not a mountpoint [ -z "$dev" ] && continue From 06af4162646e8715b38188447f20b727c8425bda Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 11 May 2013 07:24:00 +0200 Subject: [PATCH 11/12] Kill trailing whitespaces!!!!! --- defaults/initrd.scripts | 46 ++++++++++++++++++----------------------- defaults/linuxrc | 10 +++------ gen_configkernel.sh | 14 ++++++------- gen_initramfs.sh | 7 +++---- 4 files changed, 33 insertions(+), 44 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 88f39cc..93a3463 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1,4 +1,4 @@ -#!/bin/ash +#!/bin/sh . /etc/initrd.defaults @@ -169,7 +169,7 @@ findmediamount() { # $2 = recognition file # $3 = variable to have the device path # $4 = actual mount dir path (full path) - # args remaining are possible devices + # args remaining are possible devices local media=$1 recon=$2 vrbl=$3 mntdir=$4 shift 4 @@ -332,16 +332,15 @@ findnfsmount() { if [ "${NFSROOT}" = '' ] then - # Obtain NFSIP + # Obtain NFSIP OPTIONS=$(busybox dmesg | grep rootserver | sed -e "s/,/ /g") for OPTION in $OPTIONS do if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootserver' ] then NFSIP=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) - fi + fi done - # Obtain NFSPATH OPTIONS=$(busybox dmesg | grep rootpath | sed -e "s/,/ /g") for OPTION in $OPTIONS @@ -383,7 +382,7 @@ findnfsmount() { else bad_msg "NFS Mounting failed. Is the path corrent ?" fi - else + else good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} if [ "$?" = '0' ] @@ -433,11 +432,9 @@ find_real_device() { check_loop() { if [ "${LOOP}" = '' -o ! -e "${CDROOT_PATH}/${LOOP}" ] then - bad_msg "Invalid loop location: ${LOOP}" bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...' bad_msg 'kernel command line!' - run_shell fi } @@ -487,7 +484,7 @@ mount_devfs () { test_success() { retcode=$? - # If last command failed send error message and fall back to a shell + # If last command failed send error message and fall back to a shell if [ "$retcode" != '0' ] then error_string=$1 @@ -518,7 +515,7 @@ bad_msg() { splashcmd verbose echo -e "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}" fi -} +} warn_msg() { msg_string=$1 @@ -685,18 +682,17 @@ cmdline_hwopts() { fi done done - + # Shouldnt need to sort this as the following loop should figure out the # duplicates and strip them out #MY_HWOPTS=$(echo ${MY_HWOPTS}| sort) - for x in ${MY_HWOPTS} do FOUND=0 for y in ${TMP_HWOPTS} do if [ "${y}" = "${x}" ] - then + then continue 2 fi done @@ -736,7 +732,7 @@ setup_keymap() { [ -f /lib/keymaps/keymapList ] && chooseKeymap [ "${DEVBIND}" = '1' ] && umount /dev - + if [ -e /etc/sysconfig/keyboard -a "${CDROOT}" = '1' ] then mkdir -p ${NEW_ROOT}/etc/sysconfig/ @@ -827,7 +823,7 @@ startVolumes() { mkdir -p /dev/mapper ln -sf /dev/device-mapper /dev/mapper/control fi - + if [ "${USE_MDADM}" = '1' ] then if [ -e '/sbin/mdadm' ] @@ -838,15 +834,15 @@ startVolumes() { fi fi - if [ "${USE_MULTIPATH_NORMAL}" = '1' ] - then - good_msg "Scanning for multipath devices" + if [ "${USE_MULTIPATH_NORMAL}" = '1' ] + then + good_msg "Scanning for multipath devices" /sbin/multipath -v 0 sleep 2 - good_msg "Activating multipath devices" - /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -v" + good_msg "Activating multipath devices" + /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -v" #for MULTIPATH_VOLUMES in /dev/mapper/*; do kpartx -a $MULTIPATH_VOLUMES; done - fi + fi if [ "${USE_DMRAID_NORMAL}" = '1' ] then @@ -899,7 +895,7 @@ startVolumes() { bad_msg "vgscan or vgchange not found: skipping LVM volume group activation!" fi fi - + if [ "${USE_ZFS}" = '1' ] then if [ -z "${ZFS_POOL}" ] @@ -1058,10 +1054,10 @@ openLUKS() { cryptsetup_options="${cryptsetup_options} --allow-discards" fi - if [ -n "${LUKS_KEY}" ] + if [ -n "${LUKS_KEY}" ] then local REAL_LUKS_KEYDEV="${LUKS_KEYDEV}" - if [ ! -e "${mntkey}${LUKS_KEY}" ] + if [ ! -e "${mntkey}${LUKS_KEY}" ] then REAL_LUKS_KEYDEV=$(find_real_device "${LUKS_KEYDEV}") if [ -b "${REAL_LUKS_KEYDEV}" ] @@ -1155,9 +1151,7 @@ openLUKS() { } startLUKS() { - # if key is set but key device isn't, find it - [ -n "${CRYPT_ROOT_KEY}" ] && [ -z "${CRYPT_ROOT_KEYDEV}" ] \ && sleep 6 && bootstrapKey "ROOT" diff --git a/defaults/linuxrc b/defaults/linuxrc index 82aa77a..0fc60ae 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -532,9 +532,8 @@ do prompt_user "REAL_ROOT" "root block device" continue fi - ROOT_DEV="${REAL_ROOT#*=}" - if [ "${ROOT_DEV}" != 'ZFS' ] + if [ "${ROOT_DEV}" != 'ZFS' ] then if [ "$(zfs get type -o value -H ${ROOT_DEV})" = 'filesystem' ] then @@ -563,10 +562,8 @@ do REAL_ROOT=${i} ROOTFSTYPE=zfs break - fi - - done; - + fi + done else got_good_root=0 fi @@ -577,7 +574,6 @@ do prompt_user "REAL_ROOT" "root block device" got_good_root=0 fi - continue ;; esac diff --git a/gen_configkernel.sh b/gen_configkernel.sh index a69c713..fbfed3e 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -118,12 +118,12 @@ config_kernel() { fi # Multipath - if isTrue ${CMD_MULTIPATH} - then + if isTrue ${CMD_MULTIPATH} + then sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH is.*/CONFIG_DM_MULTIPATH=m/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH_RDAC is.*/CONFIG_DM_MULTIPATH_RDAC=m/g' - fi + fi # Make sure dmraid modules are on if --dmraid if isTrue ${CMD_DMRAID} @@ -147,10 +147,10 @@ config_kernel() { then sed -i ${KERNEL_OUTPUTDIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g' fi - + # VirtIO - if isTrue ${CMD_VIRTIO} - then + if isTrue ${CMD_VIRTIO} + then sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_PARAVIRT_GUEST.*/CONFIG_PARAVIRT_GUEST=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_PCI.*/CONFIG_VIRTIO_PCI=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_BALLOON.*/CONFIG_VIRTIO_BALLOON=y/g' @@ -159,5 +159,5 @@ config_kernel() { sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SCSI_VIRTIO.*/CONFIG_SCSI_VIRTIO=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g' - fi + fi } diff --git a/gen_initramfs.sh b/gen_initramfs.sh index f235dc5..01d19d6 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -14,7 +14,7 @@ CPIO_ARGS="--quiet -o -H newc" # CC0 are compatible with the GNU GPL." # (from https://www.gnu.org/licenses/license-list.html#CC0) # -# Written by: +# Written by: # - Sebastian Pipping (error checking) # - Robin H. Johnson (complete rewrite) # - Richard Yao (original concept) @@ -201,7 +201,7 @@ append_multipath(){ copy_binaries "${TEMP}/initramfs-multipath-temp" \ /bin/mountpoint \ /sbin/{multipath,kpartx,mpath_prio_*,devmap_name,dmsetup} \ - /{lib,lib64}/{udev/scsi_id,multipath/*so} + /{lib,lib64}/{udev/scsi_id,multipath/*so} if [ -x /sbin/multipath ] then @@ -647,7 +647,7 @@ append_modules() { find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ || gen_die "compressing modules cpio" cd "${TEMP}" - rm -r "${TEMP}/initramfs-modules-${KV}-temp/" + rm -r "${TEMP}/initramfs-modules-${KV}-temp/" } # check for static linked file with objdump @@ -903,7 +903,6 @@ create_initramfs() { gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;; lzop) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;; esac - if [ -n "${compression}" ]; then print_info 1 " >> Compressing cpio data (${compress_ext})..." ${compress_cmd} "${CPIO}" || gen_die "Compression (${compress_cmd}) failed" From f8b1ea118698688ddafbeb2cb6c023b68e5c9a47 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 11 May 2013 08:09:00 +0200 Subject: [PATCH 12/12] Add /etc/modprobe.d/blacklist.conf to the initramfs if found --- gen_initramfs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 01d19d6..6d7ec8c 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -563,6 +563,7 @@ append_udev() { " udev_maybe_files=" /lib/udev/rules.d/99-systemd.rules + /etc/modprobe.d/blacklist.conf " is_maybe=0 for f in ${udev_files} -- ${udev_maybe_files}; do