From patchwork Tue Sep 24 17:02:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 2934721 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 11E2E9F288 for ; Tue, 24 Sep 2013 17:03:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C48FE203F4 for ; Tue, 24 Sep 2013 17:03:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13224203EA for ; Tue, 24 Sep 2013 17:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753591Ab3IXRDI (ORCPT ); Tue, 24 Sep 2013 13:03:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60689 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753946Ab3IXRDC (ORCPT ); Tue, 24 Sep 2013 13:03:02 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0E6A8A52D7; Tue, 24 Sep 2013 19:02:58 +0200 (CEST) From: Thomas Renninger To: harald@redhat.com Cc: initramfs@vger.kernel.org, yinghai@kernel.org, hpa@zytor.com, rjw@sisk.pl, linux-acpi@vger.kernel.org, Thomas Renninger Subject: [PATCH 1/3] dracut: Generlize microcode early cpio usage Date: Tue, 24 Sep 2013 19:02:55 +0200 Message-Id: <1380042177-66221-2-git-send-email-trenn@suse.de> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1380042177-66221-1-git-send-email-trenn@suse.de> References: <1380042177-66221-1-git-send-email-trenn@suse.de> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPI early table override also may need to place files into an early cpio. Reflect this in variable and file names. This change is renaming only and does not introduce any real change. Signed-off-by: Thomas Renninger --- dracut.sh | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dracut.sh b/dracut.sh index 196b3ad..0dd1e8b 100755 --- a/dracut.sh +++ b/dracut.sh @@ -696,9 +696,9 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)" } if [[ $early_microcode = yes ]]; then - readonly microcode_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_microcode.XXXXXX)" - [ -d "$microcode_dir" ] || { - printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_microcode.XXXXXX failed." >&2 + readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)" + [ -d "$early_cpio_dir" ] || { + printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2 exit 1 } fi @@ -707,7 +707,7 @@ trap ' ret=$?; [[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$"; [[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; }; - [[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; }; + [[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; }; [[ $_dlogdir ]] && rm -Rf -- "$_dlogdir"; exit $ret; ' EXIT @@ -1301,7 +1301,7 @@ if [[ $early_microcode = yes ]]; then dinfo "*** Generating early-microcode cpio image ***" ucode_dir=(amd-ucode intel-ucode) ucode_dest=(AuthenticAMD.bin GenuineIntel.bin) - _dest_dir="$microcode_dir/d/kernel/x86/microcode" + _dest_dir="$early_cpio_dir/d/kernel/x86/microcode" _dest_idx="0 1" mkdir -p $_dest_dir if [[ $hostonly ]]; then @@ -1321,14 +1321,15 @@ if [[ $early_microcode = yes ]]; then fi done done - (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio) + create_early_cpio="yes" fi rm -f -- "$outfile" dinfo "*** Creating image file ***" -if [[ $early_microcode = yes ]]; then +if [[ $create_early_cpio = yes ]]; then # The microcode blob is _before_ the initramfs blob, not after - mv $microcode_dir/ucode.cpio $outfile.$$ + (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio) + mv $early_cpio_dir/early.cpio $outfile.$$ fi if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \ $compress >> "$outfile.$$"; ); then