From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VNmQi-0005bB-Ai for mharc-grub-devel@gnu.org; Sun, 22 Sep 2013 12:22:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNmQa-0005Sf-IS for grub-devel@gnu.org; Sun, 22 Sep 2013 12:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNmQT-0004ss-W0 for grub-devel@gnu.org; Sun, 22 Sep 2013 12:22:32 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:49422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNmQT-0004sj-Ce for grub-devel@gnu.org; Sun, 22 Sep 2013 12:22:25 -0400 Received: by mail-lb0-f178.google.com with SMTP id z5so2062794lbh.9 for ; Sun, 22 Sep 2013 09:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=92X5cVHYAMYC3QiPA1FUXT3uXgmnAH5aj1p1AhFlZvs=; b=xzTWSzZ5YL3Em4JyhdBwo499Dc1Ef/x57WyJ8jTQ3IoGfOX28wOfizzaPDjhjx7GbU s55j6EHjTgJKuOu1PfrEYkEYXatNt4Y5ZE7NvvRjnLs9DE2xZh02ZSLpUBJx5GYFhscK a9hy17bdvPdRcn2RrWmZoBUOlu/YSxTu+pgxoxuk1aifcrl1d91ziggJVj6wft9aYQbh Qj5+f72r20xWfRkPPoxhf+K1qHZXujObv+osKMPYUxKKQKf4GEUKjdia+48Rpuos5PtQ //JSWz46Cg8i6tAUFlvENStPjS4NuN41IfwxR4z6CJ12ZH+95SG8io4gidPWJzxa3RP/ vAOA== X-Received: by 10.152.116.7 with SMTP id js7mr16069372lab.11.1379866944306; Sun, 22 Sep 2013 09:22:24 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-150-246.pppoe.mtu-net.ru. [91.76.150.246]) by mx.google.com with ESMTPSA id ap7sm10606463lac.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Sep 2013 09:22:23 -0700 (PDT) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH] fix grub-install from build directory Date: Sun, 22 Sep 2013 20:22:20 +0400 Message-Id: <1379866940-16014-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 16:22:39 -0000 1. grub-install exits early due to cp error bor@opensuse:~/build/grub> LC_ALL=C sudo pkgdatadir=$PWD ./grub-install --grub-mkimage=./grub-mkimage --grub-setup=./grub-bios-setup --grub-probe=./grub-probe --grub-mkrelpath=./grub-mkrelpath --boot-directory=/boot/upstream -d $PWD/grub-core /dev/sda1 cp: omitting directory '/home/bor/build/grub/themes/starfield/src' bor@opensuse:~/build/grub> echo $? 1 Explicitly skip non-plain files but emit a warning. 2. grub-install requires grub-editenv when installing in clean directory. Add --grub-editenv option to grub-install to specify its location. Signed-off-by: Andrey Borzenkov --- util/grub-install.in | 6 ++++++ util/grub-install_header | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/util/grub-install.in b/util/grub-install.in index 1816bb1..acd516f 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -75,6 +75,7 @@ usage () { print_option_help "--grub-setup=$(gettext "FILE")" "$(gettext "use FILE as grub-setup")" print_option_help "--grub-mkrelpath=$(gettext "FILE")" "$(gettext "use FILE as grub-mkrelpath")" print_option_help "--grub-probe=$(gettext "FILE")" "$(gettext "use FILE as grub-probe")" + print_option_help "--grub-editenv=$(gettext "FILE")" "$(gettext "use FILE as grub-editenv")" # TRANSLATORS: "may break" doesn't just mean that option wouldn't have any # effect but that it will make the resulting install unbootable from HDD. print_option_help "--allow-floppy" "$(gettext "make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes.")" @@ -173,6 +174,11 @@ do --grub-probe=*) grub_probe="`echo "$option" | sed 's/--grub-probe=//'`" ;; + --grub-editenv) + grub_editenv="`argument "$option" "$@"`"; shift;; + --grub-editenv=*) + grub_editenv="`echo "$option" | sed 's/--grub-editenv=//'`" ;; + --no-floppy) ;; --recheck) diff --git a/util/grub-install_header b/util/grub-install_header index cf7fa9d..26013fe 100644 --- a/util/grub-install_header +++ b/util/grub-install_header @@ -45,10 +45,14 @@ handler.lst video.lst crypto.lst terminal.lst" grub_mkimage="${bindir}/@grub_mkimage@" grub_compress_file () { - if [ "$compressor" != "" ] ; then - "$compressor" $compressor_opts "$1" > "$2" + if [ -f "$1" ] ; then + if [ "$compressor" != "" ] ; then + "$compressor" $compressor_opts "$1" > "$2" + else + cp -f "$1" "$2" + fi else - cp -f "$1" "$2" + gettext_printf "Skipping file \`%s': not a plain file\n" "$1" 1>&2 fi } -- tg: (37966d5..) u/grub-install-non-plain-files (depends on: master)