grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix grub-install from build directory
@ 2013-09-22 16:22 Andrey Borzenkov
  2013-09-22 16:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Borzenkov @ 2013-09-22 16:22 UTC (permalink / raw)
  To: grub-devel

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 <arvidjaar@gmail.com>

---
 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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix grub-install from build directory
  2013-09-22 16:22 [PATCH] fix grub-install from build directory Andrey Borzenkov
@ 2013-09-22 16:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-22 16:56 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2876 bytes --]

Go ahead
On 22.09.2013 18:22, Andrey Borzenkov wrote:
> 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 <arvidjaar@gmail.com>
> 
> ---
>  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
>  }
>  
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-22 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22 16:22 [PATCH] fix grub-install from build directory Andrey Borzenkov
2013-09-22 16:56 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).