From adf00e139fa4d487d89b700c4403439313b7900f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 18 Apr 2013 13:03:46 +0200 Subject: dracut-027-36.git20130418 - fix initramfs creation on noexec tmpdir Resolves: rhbz#953426 - more options for lsinitrd - bash completion for lsinitrd - do not output debug information on initramfs creation, if rd.debug is on the kernel command line - drop requirement on 'file', lsinitrd can find the magic on its own --- 0026-Makefile-fixup-tarball-Makefile.patch | 22 ++++ ...witch-to-getopt-and-add-f-and-k-parameter.patch | 140 +++++++++++++++++++++ 0028-lsinitrd-add-bash-completion.patch | 105 ++++++++++++++++ ...sh-completion.sh-file-filename-completion.patch | 35 ++++++ 0030-lsinitrd-drop-use-of-file.patch | 89 +++++++++++++ ...-do-not-output-filename-for-a-single-file.patch | 63 ++++++++++ 0032-.gitignore-ignore-more-files.patch | 21 ++++ ...akefile-remove-dracut-version.sh-on-clean.patch | 21 ++++ ...-lib.sh-do-not-setdebug-if-not-in-initram.patch | 21 ++++ ...all-error-out-if-ldd-reports-no-execution.patch | 30 +++++ dracut.spec | 26 +++- 11 files changed, 569 insertions(+), 4 deletions(-) create mode 100644 0026-Makefile-fixup-tarball-Makefile.patch create mode 100644 0027-lsinitrd-switch-to-getopt-and-add-f-and-k-parameter.patch create mode 100644 0028-lsinitrd-add-bash-completion.patch create mode 100644 0029-dracut-bash-completion.sh-file-filename-completion.patch create mode 100644 0030-lsinitrd-drop-use-of-file.patch create mode 100644 0031-lsinitrd.sh-do-not-output-filename-for-a-single-file.patch create mode 100644 0032-.gitignore-ignore-more-files.patch create mode 100644 0033-Makefile-remove-dracut-version.sh-on-clean.patch create mode 100644 0034-base-dracut-lib.sh-do-not-setdebug-if-not-in-initram.patch create mode 100644 0035-dracut-install-error-out-if-ldd-reports-no-execution.patch diff --git a/0026-Makefile-fixup-tarball-Makefile.patch b/0026-Makefile-fixup-tarball-Makefile.patch new file mode 100644 index 0000000..f4c4a26 --- /dev/null +++ b/0026-Makefile-fixup-tarball-Makefile.patch @@ -0,0 +1,22 @@ +From 26ab7b07a6c7bff7b62a59ab880e735017076141 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 15 Apr 2013 11:53:03 +0200 +Subject: [PATCH] Makefile: fixup tarball Makefile + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 6bda766..d3798c6 100644 +--- a/Makefile ++++ b/Makefile +@@ -158,7 +158,7 @@ dracut-$(VERSION).tar.bz2: doc + git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar + mkdir -p dracut-$(VERSION) + cp $(manpages) dracut.html dracut-$(VERSION) +- sed 's/^RELEASEDVERSION =.*/RELEASEDVERSION = $(VERSION)/' Makefile > dracut-$(VERSION)/Makefile ++ git show $(VERSION):Makefile | sed 's/^RELEASEDVERSION =.*/RELEASEDVERSION = $(VERSION)/' > dracut-$(VERSION)/Makefile + tar --owner=root --group=root -rf dracut-$(VERSION).tar dracut-$(VERSION)/*.[0-9] dracut-$(VERSION)/dracut.html dracut-$(VERSION)/Makefile + rm -fr dracut-$(VERSION).tar.bz2 dracut-$(VERSION) + bzip2 -9 dracut-$(VERSION).tar diff --git a/0027-lsinitrd-switch-to-getopt-and-add-f-and-k-parameter.patch b/0027-lsinitrd-switch-to-getopt-and-add-f-and-k-parameter.patch new file mode 100644 index 0000000..11d58df --- /dev/null +++ b/0027-lsinitrd-switch-to-getopt-and-add-f-and-k-parameter.patch @@ -0,0 +1,140 @@ +From 7d9bb76ac7cf6996318a0cfbc8576d8d307bff3e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 10:44:56 +0200 +Subject: [PATCH] lsinitrd: switch to getopt and add "-f" and "-k" parameter + +--- + lsinitrd.1.asc | 10 +++++++++- + lsinitrd.sh | 61 +++++++++++++++++++++++++++++++++++++++++++--------------- + 2 files changed, 54 insertions(+), 17 deletions(-) + +diff --git a/lsinitrd.1.asc b/lsinitrd.1.asc +index fd98161..4293910 100644 +--- a/lsinitrd.1.asc ++++ b/lsinitrd.1.asc +@@ -10,7 +10,9 @@ lsinitrd - tool to show the contents of an initramfs image + + SYNOPSIS + -------- +-*lsinitrd* ['OPTION...'] [] ++*lsinitrd* ['OPTION...'] [ [ [ [...] ]]] ++ ++*lsinitrd* ['OPTION...'] -k + + DESCRIPTION + ----------- +@@ -26,6 +28,12 @@ OPTIONS + **-s, --size**:: + sort the contents of the initramfs by size. + ++**-f, --file** __:: ++ print the contents of . ++ ++**-k, --kver** __:: ++ inspect the initramfs of . ++ + AVAILABILITY + ------------ + The lsinitrd command is part of the dracut package and is available from +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 1b27393..42e30d9 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -22,29 +22,51 @@ + usage() + { + { +- echo "Usage: ${0##*/} [-s] [ []]" ++ echo "Usage: ${0##*/} [options] [ [ [ [...] ]]]" ++ echo "Usage: ${0##*/} [options] -k " + echo +- echo "-h, --help print a help message and exit." +- echo "-s, --size sort the contents of the initramfs by size." ++ echo "-h, --help print a help message and exit." ++ echo "-s, --size sort the contents of the initramfs by size." ++ echo "-f, --file print the contents of ." ++ echo "-k, --kver inspect the initramfs of ." + echo + } >&2 + } + +-[[ $# -le 2 ]] || { usage ; exit 1 ; } +- + sorted=0 +-while getopts "s" opt; do +- case $opt in +- s) sorted=1;; +- h) usage; exit 0;; +- \?) usage; exit 1;; ++declare -A filenames ++ ++unset POSIXLY_CORRECT ++TEMP=$(getopt \ ++ -o "shf:k:" \ ++ --long kver: \ ++ --long file: \ ++ --long help \ ++ --long size \ ++ -- "$@") ++ ++if (( $? != 0 )); then ++ usage ++ exit 1 ++fi ++ ++eval set -- "$TEMP" ++ ++while (($# > 0)); do ++ case $1 in ++ -k|--kver) KERNEL_VERSION="$2"; shift;; ++ -f|--file) filenames[${2#/}]=1; shift;; ++ -s|--size) sorted=1;; ++ -h|--help) usage; exit 0;; ++ --) shift;break;; ++ *) usage; exit 1;; + esac ++ shift + done +-shift $((OPTIND-1)) + +-KERNEL_VERSION="$(uname -r)" ++[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)" + +-if [[ "$1" ]]; then ++if [[ $1 ]]; then + image="$1" + if ! [[ -f "$image" ]]; then + { +@@ -57,13 +79,20 @@ if [[ "$1" ]]; then + else + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + +- if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then ++ if [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \ ++ && [[ $MACHINE_ID ]] \ ++ && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + else + image="/boot/initramfs-${KERNEL_VERSION}.img" + fi + fi + ++shift ++while (($# > 0)); do ++ filenames[${1#/}]=1; ++ shift ++done + + if ! [[ -f "$image" ]]; then + { +@@ -93,8 +122,8 @@ elif [[ "$FILE_T" =~ :\ data ]]; then + CAT="xzcat $XZ_SINGLE_STREAM" + fi + +-if [[ $# -eq 2 ]]; then +- $CAT $image | cpio --extract --verbose --quiet --to-stdout ${2#/} 2>/dev/null ++if (( ${#filenames[@]} > 0 )); then ++ $CAT $image | cpio --extract --verbose --quiet --to-stdout ${!filenames[@]} 2>/dev/null + exit $? + fi + diff --git a/0028-lsinitrd-add-bash-completion.patch b/0028-lsinitrd-add-bash-completion.patch new file mode 100644 index 0000000..cd2d18b --- /dev/null +++ b/0028-lsinitrd-add-bash-completion.patch @@ -0,0 +1,105 @@ +From 7dbca9be866afd65d7ab5368250429e4291aaf88 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 10:43:39 +0200 +Subject: [PATCH] lsinitrd: add bash completion + +--- + Makefile | 1 + + dracut.spec | 1 + + lsinitrd-bash-completion.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 65 insertions(+) + create mode 100644 lsinitrd-bash-completion.sh + +diff --git a/Makefile b/Makefile +index d3798c6..e0baef2 100644 +--- a/Makefile ++++ b/Makefile +@@ -137,6 +137,7 @@ endif + install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install + mkdir -p $(DESTDIR)${bashcompletiondir} + install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut ++ install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd + + dracut-version.sh: + @echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh +diff --git a/dracut.spec b/dracut.spec +index cb605c6..197e9a0 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -282,6 +282,7 @@ rm -rf $RPM_BUILD_ROOT + # compat symlink + /sbin/dracut + %{_datadir}/bash-completion/completions/dracut ++%{_datadir}/bash-completion/completions/lsinitrd + %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 + %{_bindir}/mkinitrd + %{_bindir}/lsinitrd +diff --git a/lsinitrd-bash-completion.sh b/lsinitrd-bash-completion.sh +new file mode 100644 +index 0000000..78ab165 +--- /dev/null ++++ b/lsinitrd-bash-completion.sh +@@ -0,0 +1,63 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++# ++# Copyright 2013 Red Hat, Inc. All rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++__contains_word () { ++ local word=$1; shift ++ for w in $*; do [[ $w = $word ]] && return 0; done ++ return 1 ++} ++ ++_lsinitrd() { ++ local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} ++ local -A OPTS=( ++ [STANDALONE]='-s --size -h --help' ++ ++ [ARG]='-f --file -k --kver' ++ ) ++ ++ if __contains_word "$prev" ${OPTS[ARG]}; then ++ case $prev in ++ --file|-f) ++ comps=$(compgen -f -- "$cur") ++ compopt -o filenames ++ ;; ++ --kver|-k) ++ comps=$(cd /lib/modules; echo [0-9]*) ++ ;; ++ *) ++ return 0 ++ ;; ++ esac ++ COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) ++ return 0 ++ fi ++ ++ if [[ $cur = -* ]]; then ++ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) ++ return 0 ++ fi ++ ++ comps=$(compgen -f -- "$cur") ++ compopt -o filenames ++ COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) ++ return 0 ++} ++ ++complete -F _lsinitrd lsinitrd diff --git a/0029-dracut-bash-completion.sh-file-filename-completion.patch b/0029-dracut-bash-completion.sh-file-filename-completion.patch new file mode 100644 index 0000000..3219263 --- /dev/null +++ b/0029-dracut-bash-completion.sh-file-filename-completion.patch @@ -0,0 +1,35 @@ +From 46a885bf9f90f7cfacb6977ff602c04efdb75f8e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 11:18:18 +0200 +Subject: [PATCH] dracut-bash-completion.sh: file filename completion + +--- + dracut-bash-completion.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh +index 322e630..ae33b3e 100644 +--- a/dracut-bash-completion.sh ++++ b/dracut-bash-completion.sh +@@ -44,15 +44,19 @@ _dracut() { + + if __contains_word "$prev" ${OPTS[ARG]}; then + case $prev in +- --kmoddir|-k|--fwdir|-c|--conf|--confdir|--tmpdir|--sshkey|--add-fstab|--add-device|-I|--install) ++ --kmoddir|-k|--fwdir|--confdir|--tmpdir) + comps=$(compgen -d -- "$cur") + compopt -o filenames + ;; ++ -c|--conf|--sshkey|--add-fstab|--add-device|-I|--install) ++ comps=$(compgen -f -- "$cur") ++ compopt -o filenames ++ ;; + -a|-m|-o|--add|--modules|--omit) + comps=$(dracut --list-modules 2>/dev/null) + ;; + --kver) +- comps=$(cd /lib/modules; echo *) ++ comps=$(cd /lib/modules; echo [0-9]*) + ;; + *) + return 0 diff --git a/0030-lsinitrd-drop-use-of-file.patch b/0030-lsinitrd-drop-use-of-file.patch new file mode 100644 index 0000000..1deae35 --- /dev/null +++ b/0030-lsinitrd-drop-use-of-file.patch @@ -0,0 +1,89 @@ +From 884e1cda7cf999ef15dd78a54a9ce0bf99afd8de Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 12:44:25 +0200 +Subject: [PATCH] lsinitrd: drop use of "file" + +--- + dracut.spec | 4 +--- + lsinitrd.sh | 38 ++++++++++++++++++++------------------ + 2 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 197e9a0..3d42af2 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -84,11 +84,9 @@ Requires: findutils + Requires: grep + Requires: hardlink + Requires: gzip xz +-Requires: module-init-tools >= 3.7-9 ++Requires: kmod + Requires: sed +-Requires: file + Requires: kpartx +-Requires: kbd kbd-misc + + %if 0%{?fedora} || 0%{?rhel} > 6 + Requires: util-linux >= 2.21 +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 42e30d9..0481975 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -103,37 +103,39 @@ if ! [[ -f "$image" ]]; then + exit 1 + fi + +-CAT=zcat +-FILE_T=$(file --dereference "$image") +- +-if echo "test"|xz|xz -dc --single-stream >/dev/null 2>&1; then +- XZ_SINGLE_STREAM="--single-stream" +-fi +- +-if [[ "$FILE_T" =~ :\ gzip\ compressed\ data ]]; then +- CAT=zcat +-elif [[ "$FILE_T" =~ :\ xz\ compressed\ data ]]; then +- CAT="xzcat $XZ_SINGLE_STREAM" +-elif [[ "$FILE_T" =~ :\ XZ\ compressed\ data ]]; then +- CAT="xzcat $XZ_SINGLE_STREAM" +-elif [[ "$FILE_T" =~ :\ LZMA ]]; then +- CAT="xzcat $XZ_SINGLE_STREAM" +-elif [[ "$FILE_T" =~ :\ data ]]; then +- CAT="xzcat $XZ_SINGLE_STREAM" +-fi ++read -N 6 bin < "$image" ++case $bin in ++ $'\x1f\x8b'*) ++ CAT="zcat";; ++ BZh*) ++ CAT="bzcat";; ++ 070701) ++ CAT="cat";; ++ *) ++ CAT="xzcat"; ++ if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then ++ CAT="xzcat --single-stream" ++ fi ++ ;; ++esac + + if (( ${#filenames[@]} > 0 )); then + $CAT $image | cpio --extract --verbose --quiet --to-stdout ${!filenames[@]} 2>/dev/null + exit $? + fi + ++ret=0 ++ + echo "$image: $(du -h $image | while read a b; do echo $a;done)" + echo "========================================================================" + $CAT "$image" | cpio --extract --verbose --quiet --to-stdout '*lib/dracut/dracut-*' 2>/dev/null ++((ret+=$?)) + echo "========================================================================" + if [ "$sorted" -eq 1 ]; then + $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 + else + $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 + fi ++((ret+=$?)) + echo "========================================================================" ++exit $ret diff --git a/0031-lsinitrd.sh-do-not-output-filename-for-a-single-file.patch b/0031-lsinitrd.sh-do-not-output-filename-for-a-single-file.patch new file mode 100644 index 0000000..c30083b --- /dev/null +++ b/0031-lsinitrd.sh-do-not-output-filename-for-a-single-file.patch @@ -0,0 +1,63 @@ +From 4460416abcb420588d189dd5bac6860c79b67ab5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 13:33:40 +0200 +Subject: [PATCH] lsinitrd.sh: do not output filename for a single file + +--- + lsinitrd.sh | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 0481975..cd58529 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -119,23 +119,34 @@ case $bin in + ;; + esac + +-if (( ${#filenames[@]} > 0 )); then +- $CAT $image | cpio --extract --verbose --quiet --to-stdout ${!filenames[@]} 2>/dev/null +- exit $? +-fi +- + ret=0 + +-echo "$image: $(du -h $image | while read a b; do echo $a;done)" +-echo "========================================================================" +-$CAT "$image" | cpio --extract --verbose --quiet --to-stdout '*lib/dracut/dracut-*' 2>/dev/null +-((ret+=$?)) +-echo "========================================================================" +-if [ "$sorted" -eq 1 ]; then +- $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 ++if (( ${#filenames[@]} > 0 )); then ++ (( ${#filenames[@]} == 1 )) && nofileinfo=1 ++ for f in ${!filenames[@]}; do ++ [[ $nofileinfo ]] || echo "initramfs:/$f" ++ [[ $nofileinfo ]] || echo "========================================================================" ++ $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null ++ ((ret+=$?)) ++ [[ $nofileinfo ]] || echo "========================================================================" ++ [[ $nofileinfo ]] || echo ++ done + else +- $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 ++ echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)" ++ echo "========================================================================" ++ version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout '*lib/dracut/dracut-*' 2>/dev/null) ++ ((ret+=$?)) ++ echo "$version with dracut modules:" ++ $CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'usr/lib/dracut/modules.txt' 2>/dev/null ++ ((ret+=$?)) ++ echo "========================================================================" ++ if [ "$sorted" -eq 1 ]; then ++ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 ++ else ++ $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9 ++ fi ++ ((ret+=$?)) ++ echo "========================================================================" + fi +-((ret+=$?)) +-echo "========================================================================" ++ + exit $ret diff --git a/0032-.gitignore-ignore-more-files.patch b/0032-.gitignore-ignore-more-files.patch new file mode 100644 index 0000000..f6555dd --- /dev/null +++ b/0032-.gitignore-ignore-more-files.patch @@ -0,0 +1,21 @@ +From d0eedc4a5fa0bb23a5cf0aa6cea2f45095c74e1d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 13:38:16 +0200 +Subject: [PATCH] .gitignore: ignore more files + +--- + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/.gitignore b/.gitignore +index bec31ab..25506f1 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -13,3 +13,7 @@ test*.img + /.project + /dracut-version.sh + /install/dracut-install ++/*.rpm ++/*.[0-9] ++/modules.d/98systemd/*.service.8 ++/*.sign diff --git a/0033-Makefile-remove-dracut-version.sh-on-clean.patch b/0033-Makefile-remove-dracut-version.sh-on-clean.patch new file mode 100644 index 0000000..9463ab0 --- /dev/null +++ b/0033-Makefile-remove-dracut-version.sh-on-clean.patch @@ -0,0 +1,21 @@ +From 9268366cad0ab1b6340d50404af56760ebe660aa Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 Apr 2013 13:41:19 +0200 +Subject: [PATCH] Makefile: remove dracut-version.sh on clean + +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index e0baef2..2b130d9 100644 +--- a/Makefile ++++ b/Makefile +@@ -149,6 +149,7 @@ clean: + $(RM) $(manpages:%=%.xml) dracut.xml + $(RM) test-*.img + $(RM) dracut-*.rpm dracut-*.tar.bz2 ++ $(RM) dracut-version.sh + $(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS) + $(RM) $(manpages) dracut.html + $(MAKE) -C test clean diff --git a/0034-base-dracut-lib.sh-do-not-setdebug-if-not-in-initram.patch b/0034-base-dracut-lib.sh-do-not-setdebug-if-not-in-initram.patch new file mode 100644 index 0000000..8d3d3fd --- /dev/null +++ b/0034-base-dracut-lib.sh-do-not-setdebug-if-not-in-initram.patch @@ -0,0 +1,21 @@ +From 2b125c69cc80baae765a868992003ddd349a7ae9 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 18 Apr 2013 12:54:30 +0200 +Subject: [PATCH] base/dracut-lib.sh: do not setdebug, if not in initramfs + +--- + modules.d/99base/dracut-lib.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 9f4b2d2..ae79a82 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -325,6 +325,7 @@ splitsep() { + } + + setdebug() { ++ [ -f /etc/initrd-release ] || return + if [ -z "$RD_DEBUG" ]; then + if [ -e /proc/cmdline ]; then + RD_DEBUG=no diff --git a/0035-dracut-install-error-out-if-ldd-reports-no-execution.patch b/0035-dracut-install-error-out-if-ldd-reports-no-execution.patch new file mode 100644 index 0000000..ade0303 --- /dev/null +++ b/0035-dracut-install-error-out-if-ldd-reports-no-execution.patch @@ -0,0 +1,30 @@ +From b4dc22cab7b8b071c8a150b9c61edaa247bacb6a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 18 Apr 2013 12:54:55 +0200 +Subject: [PATCH] dracut-install: error out, if ldd reports no execution + permission + +This turns off lazy resolving on noexec mounted tmp directories. + +https://bugzilla.redhat.com/show_bug.cgi?id=953426 +--- + install/dracut-install.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 5040dea..2d0412c 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -285,6 +285,12 @@ static int resolve_deps(const char *src) + + log_debug("ldd: '%s'", buf); + ++ if (strstr(buf, "you do not have execution permission")) { ++ log_error(buf); ++ ret+=1; ++ break; ++ } ++ + if (strstr(buf, "not a dynamic executable")) + break; + diff --git a/dracut.spec b/dracut.spec index 5828257..5facf0d 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 027 -Release: 26.git20130415%{?dist} +Release: 36.git20130418%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -54,6 +54,16 @@ Patch22: 0022-Makefile-git2spec.pl-use-git-describe.patch Patch23: 0023-systemd-include-the-systemd-random-seed-load.service.patch Patch24: 0024-url-lib-module-setup.sh-install-ca-bundle.crt-by-lib.patch Patch25: 0025-dmsquash-live-add-support-for-iso-scan-filename-kern.patch +Patch26: 0026-Makefile-fixup-tarball-Makefile.patch +Patch27: 0027-lsinitrd-switch-to-getopt-and-add-f-and-k-parameter.patch +Patch28: 0028-lsinitrd-add-bash-completion.patch +Patch29: 0029-dracut-bash-completion.sh-file-filename-completion.patch +Patch30: 0030-lsinitrd-drop-use-of-file.patch +Patch31: 0031-lsinitrd.sh-do-not-output-filename-for-a-single-file.patch +Patch32: 0032-.gitignore-ignore-more-files.patch +Patch33: 0033-Makefile-remove-dracut-version.sh-on-clean.patch +Patch34: 0034-base-dracut-lib.sh-do-not-setdebug-if-not-in-initram.patch +Patch35: 0035-dracut-install-error-out-if-ldd-reports-no-execution.patch BuildRequires: dash bash git @@ -110,11 +120,9 @@ Requires: findutils Requires: grep Requires: hardlink Requires: gzip xz -Requires: module-init-tools >= 3.7-9 +Requires: kmod Requires: sed -Requires: file Requires: kpartx -Requires: kbd kbd-misc %if 0%{?fedora} || 0%{?rhel} > 6 Requires: util-linux >= 2.21 @@ -308,6 +316,7 @@ rm -rf $RPM_BUILD_ROOT # compat symlink /sbin/dracut %{_datadir}/bash-completion/completions/dracut +%{_datadir}/bash-completion/completions/lsinitrd %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 %{_bindir}/mkinitrd %{_bindir}/lsinitrd @@ -463,6 +472,15 @@ rm -rf $RPM_BUILD_ROOT %{dracutlibdir}/dracut.conf.d/02-norescue.conf %changelog +* Thu Apr 18 2013 Harald Hoyer 027-36.git20130418 +- fix initramfs creation on noexec tmpdir +Resolves: rhbz#953426 +- more options for lsinitrd +- bash completion for lsinitrd +- do not output debug information on initramfs creation, if rd.debug is + on the kernel command line +- drop requirement on 'file', lsinitrd can find the magic on its own + * Mon Apr 15 2013 Harald Hoyer 027-26.git20130415 - do not call plymouth with full path - include systemd-random-seed-load.service -- cgit