Re: Detecting running platform (specifically EFI) during runtime?

2013-01-05 Thread Keshav P R
On Sat, Jan 5, 2013 at 2:58 PM, Andrey Borzenkov arvidj...@gmail.comwrote:

 Is it possible to check at run-time on which platform we are running.
 Specifically, any way to distinguish between EFI and legacy BIOS?

 TIA

 -andrey

 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel


Something like below should work (requires grub 2.00, not 1.99):

[CODE - part of grub.cfg]
if [ ${grub_platform} == efi ]; then
set _GRUB_PLATFORM=UEFI

if [ ${grub_cpu} == x86_64 ]; then
set _UEFI_ARCH=x64
fi

if [ ${grub_cpu} == i386 ]; then
set _UEFI_ARCH=ia32
fi

insmod efi_gop
insmod efi_uga
fi

if [ ${grub_platform} == pc ]; then
set _GRUB_PLATFORM=BIOS

insmod vbe
insmod vga
fi
[/CODE]

Regards.

Keshav
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


patch to fix lua grub-extras for mainline r4109

2012-03-04 Thread Keshav P R
Hi,
Attached patch fixes too few arguments error during compile of
grub_lib.c in lua grub-extras.

Compile error -

/media/Source_Codes/Source_Codes/Boot_Managers/ALL/grub/Source__GIT_BZR/grub__GIT_BZR/grub-core/contrib/lua/grub_lib.c:
In function 'grub_lua_add_menu':
/media/Source_Codes/Source_Codes/Boot_Managers/ALL/grub/Source__GIT_BZR/grub__GIT_BZR/grub-core/contrib/lua/grub_lib.c:469:7:
error: too few arguments to function 'grub_normal_add_menu_entry'
/media/Source_Codes/Source_Codes/Boot_Managers/ALL/grub/Source__GIT_BZR/grub__GIT_BZR/include/grub/normal.h:122:1:
note: declared here
make[3]: *** [contrib/lua/lua_module-grub_lib.o] Error 1

Patch below -

diff --git a/grub_lib.c b/grub_lib.c
index 9014320..055d620 100644
--- a/grub_lib.c
+++ b/grub_lib.c
@@ -466,7 +466,7 @@ grub_lua_add_menu (lua_State *state)
   if (! p)
return push_result (state);

-  grub_normal_add_menu_entry (n, args, NULL, NULL, NULL, NULL, p, 0);
+  grub_normal_add_menu_entry (n, args, NULL, NULL, NULL, NULL, NULL, p, 0);
 }
   else
 {

Please apply it. Thanks in advance.

Regards.

Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V3 1/3] Update the Linux boot protocol

2012-02-26 Thread Keshav P R
Status of this patch in grub2 v2.00 code freeze?

- Keshav

On 09/02/2012, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote:
 Go ahead.
 On 08.02.2012 17:55, Matthew Garrett wrote:
 The Linux boot header includes information on the kernel's desired load
 address and alignment. Add support for that.
 ---
   ChangeLog |6 ++
   include/grub/i386/linux.h |   28 +++-
   2 files changed, 29 insertions(+), 5 deletions(-)

 diff --git a/ChangeLog b/ChangeLog
 index ede7f8e..2bdb3a0 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,3 +1,9 @@
 +2012-02-08  Matthew Garrettm...@redhat.com
 +
 +* include/grub/i386/linux.h (linux_kernel_header): Update to
 +boot protocol 2.10.
 +(linux_kernel_params): Likewise
 +
   2012-02-07  Vladimir Serbinenkophco...@gmail.com

  * grub-core/lib/i386/relocator16.S: Revert moving A20 code into PM
 diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h
 index 6aa2391..8e27b93 100644
 --- a/include/grub/i386/linux.h
 +++ b/include/grub/i386/linux.h
 @@ -86,7 +86,7 @@ enum
   GRUB_VIDEO_LINUX_TYPE_SIMPLE = 0x70/* Linear framebuffer without
 any additional functions.  */
 };

 -/* For the Linux/i386 boot protocol version 2.03.  */
 +/* For the Linux/i386 boot protocol version 2.10.  */
   struct linux_kernel_header
   {
 grub_uint8_t code1[0x0020];
 @@ -131,8 +131,16 @@ struct linux_kernel_header
 grub_uint32_t initrd_addr_max;/* Highest address for initrd */
 grub_uint32_t kernel_alignment;
 grub_uint8_t relocatable;
 -  grub_uint8_t pad[3];
 +  grub_uint8_t min_alignment;
 +  grub_uint8_t pad[2];
 grub_uint32_t cmdline_size;
 +  grub_uint32_t hardware_subarch;
 +  grub_uint64_t hardware_subarch_data;
 +  grub_uint32_t payload_offset;
 +  grub_uint32_t payload_length;
 +  grub_uint64_t setup_data;
 +  grub_uint64_t pref_address;
 +  grub_uint64_t init_size;
   } __attribute__ ((packed));

   /* Boot parameters for Linux based on 2.6.12. This is used by the setup
 @@ -276,10 +284,20 @@ struct linux_kernel_params
 grub_uint32_t ramdisk_size;  /* initrd size */
 grub_uint32_t bootsect_kludge;   /* obsolete */
 grub_uint16_t heap_end_ptr;  /* Free memory after setup end 
 */
 -  grub_uint16_t pad1;   /* Unused */
 +  grub_uint8_t ext_loader_ver;  /* Extended loader version */
 +  grub_uint8_t ext_loader_type; /* Extended loader type */
 grub_uint32_t cmd_line_ptr;  /* Points to the kernel command 
 line */
 -
 -  grub_uint8_t pad2[164];   /* 22c */
 +  grub_uint32_t initrd_addr_max;/* Maximum initrd address */
 +  grub_uint32_t kernel_alignment;   /* Alignment of the kernel */
 +  grub_uint8_t relocatable_kernel;  /* Is the kernel relocatable */
 +  grub_uint8_t pad1[3];
 +  grub_uint32_t cmdline_size;   /* Size of the kernel command 
 line */
 +  grub_uint32_t hardware_subarch;
 +  grub_uint64_t hardware_subarch_data;
 +  grub_uint32_t payload_offset;
 +  grub_uint32_t payload_length;
 +  grub_uint64_t setup_data;
 +  grub_uint8_t pad2[120];   /* 258 */
 struct grub_e820_mmap e820_map[GRUB_E820_MAX_ENTRY]; /* 2d0 */

   } __attribute__ ((packed));


 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub-install revamp

2012-02-26 Thread Keshav P R
Status of mactel bless in grub2 v2.00 code freeze?

- Keshav

On 02/02/2012, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote:
 On 30.01.2012 03:37, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
 Hello, all. It was a Robert's idea of having grub-install to install
 all available (as in: the ones which were make install'ed) ports in a
 single grub-install w/o having to keep and run one grub-install per port.
 I've tried to write such a thing. I have  met some problems in practice:
 - I wanted also to integrate mactelbless in the same time. Unfortunately
 Apple uses the same pointer for both i386 and x86_64 efi. So hfs(+)
 partitions can hold only either 32-bit or 64-bit EFI binary. We could
 use FAT Binary to workaround this but not all macs support this.
 - If one of platform specific installs fail the script doesn't install
 other platforms.
 - When modifying nvram on EFI where to point it to? ESP or HFS? This is
 easy: HFS if it's a mac and ESP otherwise. Or just always ESP.
 - The same problem for ieee1275. While distinguishing between mac and
 non-mac is easy (check vendor string), I don't know how to distinguish
 the ones using PreP partition and the ones using a file on a FAT fs.
 I would appreciate any input both on these specific problems and the
 idea in general. Perhaps it's better to abandon it and have something
 easier like auto-detect firmware and use it as default and specify it
 manually if you need a different install.
 The attached patch is just a small illustration to discuss about. It
 doesn't work
 This has an advantage of making the disk bootable in various ways
 including ability to move it from one computer to another.
 The first problem is the files collision. To resolve this the
 modification will be to load modules from
 $prefix/$cpu-$platform/$modname.mod. Also 2 new script constants will
 be defined:  $cpu and $platform.
 The problem then is that different firmwares require different kind of
 arrangements in order to be bootable.
 i386-pc requires 55AA signature, some code in MBR and embedding zone.
 A dummy msdos active partition is required on some systems.
 *-efi require files on ESP and some nvram entries
 i386-qemu, i386-coreboot, i386-qemu_mips and loongsoon-firmware are
 firmware ports and we don't use grub-install for those but
 grub-mkstandalone.
 i386-multiboot just has to be readable by whatever is a coreboot payload.
 mipsel-loongson has to be on ext2 msdos partition.
 sparc64 requires SUN partition map and the code in sector 1
 Powerpc (Apple) requires a file on HFS and nvram modification
 PowerPC (IBM) uses PreP partition
 ARC uses a special entry in the dvh partition table
 I have no idea what i386-ieee1275 requires but I guess it's a fat
 partition with special file + nvram modification.

 So I propose following strategy: grub-install does the following
 platform-specific installations:
 - if /boot/efi is on fat, copy grub to
 /boot/efi/efi/$boot_id/grub[ia32|x64|ia64].efi (replace $boot_id and
 grub with boot if --removable is specified) and update nvram if no
 --removable is specified and currently running EFI version matches the
 installed one.
 - if /boot/mac is on HFS or HFS+, create there a structure recognized
 by both PPC and Intel macs and update nvram if architecture matches
 - If /boot/ext2 is on ext*, put mipsel-loongson and i386-multiboot there.
 - If /boot/olpc is on fat, install i386-ieee1275 there and update
 nvram if architecture matches.
 - For every argument that is an msdos or gpt disk, install i386-pc
 bootsector.
 - For every argument that is a sun disk, install sun bootsector.
 - For every argument that is a dvh disk, install mips-arc.
 - For every argument that is a prep partition install powerpc-ieee1275

 While the copying to partitions is harmless and updating nvram is done
 only if architecture and platform matches, the disk operations may be
 harmful. While none of the current 4 configuration usually come in
 contradictory combinations, it's possible to purposedly create a disk
 of multiple types and it will confuse this logic. Also if we throw
 e.g. hppa into the mix which requires just a signature on bytes 0-1
 and some info in 0xf4-0xff then we can't know if msdos disk is for
 BIOS or hppa install. So we need a way to specify them more precisely.
 PreP and ARC came in only after 1.99 so we can make them accept only
 the new way whatever it will be. In case of old way we can easily
 distinguish sparc64-ieee1275 and i386-pc with e.g. uname -i. I propose
 either of:
 --device-bios=/dev/xyz --device-sun=/dev/xyz --device-arc=/dev/xyz
 --device-prep=/dev/xyz
 Or: bios:/dev/xyz sun:/dev/xyz arc:/dev/xyz prep:/dev/xyz

 Also it may happen that installation of some port is undesirable. So
 we need options
 --install-only=...
 --exclude=...
 Any further ideas?



 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko



___
Grub-devel mailing list
Grub-devel@gnu.org

Re: [PATCH V3 1/3] Update the Linux boot protocol

2012-02-26 Thread Keshav P R
I am asking about 'this' patch (patch 1/3) alone. Not the other two
ones. And the distro package was never updated, it was just a test
build with a bzr snapshot and these patches, given to users willing to
test the code.

- Keshav

On 27/02/2012, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote:
 On 26.02.2012 22:01, Keshav P R wrote:
 Status of this patch in grub2 v2.00 code freeze?
 I have written what have to be fixed first.
 And one thing: your idea to put into distro a patch which has known
 serious issues that have to be resolved was a very bad one.

 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V3 1/3] Update the Linux boot protocol

2012-02-26 Thread Keshav P R
Coming to the issue of distro package, has the uefi relocator hang
(seen in many asus laptops) been fixed in bzr mainline?

On 27/02/2012, Keshav P R the.ridikulus@gmail.com wrote:
 I am asking about 'this' patch (patch 1/3) alone. Not the other two
 ones. And the distro package was never updated, it was just a test
 build with a bzr snapshot and these patches, given to users willing to
 test the code.

 - Keshav

 On 27/02/2012, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com
 wrote:
 On 26.02.2012 22:01, Keshav P R wrote:
 Status of this patch in grub2 v2.00 code freeze?
 I have written what have to be fixed first.
 And one thing: your idea to put into distro a patch which has known
 serious issues that have to be resolved was a very bad one.

 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel



___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Fix for pkgdatadir grub-mkconfig_lib in all util scripts and grub.d scripts

2012-02-21 Thread Keshav P R
2012/2/21 Grégoire Sutre gregoire.su...@gmail.com:
 On 02/20/2012 06:47 PM, Keshav P R wrote:

 Hi,
     Attached patch fixes runtime error due to sed transform used in
 pkgdatadir


 Maybe we should apply the sed transform to grub-mkconfig_lib's
 installation directory, i.e., install grub-mkconfig_lib alongside
 unicode.pf2 and friends?

That might make it difficult for third party scripts in /etc/grub.d
(like os-prober or memtest) to source grub-mkconfig_lib since they do
not know about the sed transform.


 Grégoire

 # /_grub_/grub_uefi_x86_64/bin/grub_uefi_x86_64-mkstandalone -h
 /_grub_/grub_uefi_x86_64/bin/grub_uefi_x86_64-mkstandalone: line 46:
 /_grub_/grub_uefi_x86_64/share/grub_uefi_x86_64/grub-mkconfig_lib: No
 such file or directory

 File is at /_grub_/grub_uefi_x86_64/share/grub/grub-mkconfig_lib (in my
 case).

 Please apply this. Thanks in advance.

 Regards.

 Keshav



 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel



 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Fix for pkgdatadir grub-mkconfig_lib in all util scripts and grub.d scripts

2012-02-20 Thread Keshav P R
Hi,
Attached patch fixes runtime error due to sed transform used in pkgdatadir

# /_grub_/grub_uefi_x86_64/bin/grub_uefi_x86_64-mkstandalone -h
/_grub_/grub_uefi_x86_64/bin/grub_uefi_x86_64-mkstandalone: line 46:
/_grub_/grub_uefi_x86_64/share/grub_uefi_x86_64/grub-mkconfig_lib: No
such file or directory

File is at /_grub_/grub_uefi_x86_64/share/grub/grub-mkconfig_lib (in my case).

Please apply this. Thanks in advance.

Regards.

Keshav
commit bcd05babf6cbcae654824dfcf0feda2992b02cad
Author: Keshav P R the.ridikulus@gmail.com
Date:   Mon Feb 20 23:11:03 2012 +0530

Use pkgdatadir and no sed transform for all .in util scripts and grub.d scripts

diff --git a/ChangeLog b/ChangeLog
index 20499d7..e50d398 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2012-02-20  Keshav P R  the.ridikulus@gmail.com
+
+	* util/grub-install.in (pkgdatadir): Remove sed transform.
+	* util/grub-kbdcomp.in: Likewise.
+	* util/grub-mkconfig.in: Likewise.
+	* util/grub-mkconfig_lib.in: Likewise.
+	* util/grub-mknetdir.in: Likewise.
+	* util/grub-mkrescue.in: Likewise.
+	* util/grub-mkstandalone.in: Likewise.
+	* util/grub-reboot.in: Likewise.
+	* util/grub-set-default.in: Likewise.
+	* util/grub.d/00_header.in: Add pkgdatadir and source 
+	grub-mkconfig_lib from there.
+	* util/grub.d/10_hurd.in: Likewise.
+	* util/grub.d/10_illumos.in: Likewise.
+	* util/grub.d/10_kfreebsd.in: Likewise.
+	* util/grub.d/10_linux.in: Likewise.
+	* util/grub.d/10_netbsd.in: Likewise.
+	* util/grub.d/10_windows.in: Likewise.
+	* util/grub.d/20_linux_xen.in: Likewise.
+	* util/grub.d/30_os-prober.in: Likewise.
+
 2012-02-19  Samuel Thibault  samuel.thiba...@ens-lyon.org
 
 	* util/grub-mkconfig.in (GRUB_CMDLINE_GNUMACH): Export variable.
diff --git a/util/grub-install.in b/util/grub-install.in
index 747ef17..acce046 100644
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -35,7 +35,7 @@ host_os=@host_os@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 fi
 localedir=@datadir@/locale
 
diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in
index 3938734..87c0100 100644
--- a/util/grub-kbdcomp.in
+++ b/util/grub-kbdcomp.in
@@ -8,7 +8,7 @@ bindir=@bindir@
 datarootdir=@datarootdir@
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 fi
 
 grub_mklayout=${bindir}/`echo grub-mklayout | sed ${transform}`
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 9c40505..dfb9829 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -32,7 +32,7 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 fi
 grub_cfg=
 grub_mkconfig_dir=${sysconfdir}/grub.d
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index a32a2b2..ef0cf6c 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -22,7 +22,7 @@ datarootdir=@datarootdir@
 datadir=@datadir@
 bindir=@bindir@
 sbindir=@sbindir@
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 
 if test x$grub_probe = x; then
   grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in
index eec170a..3726dde 100644
--- a/util/grub-mknetdir.in
+++ b/util/grub-mknetdir.in
@@ -31,7 +31,7 @@ host_os=@host_os@
 pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 fi
 
 self=`basename $0`
diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in
index cd57d41..33c63e1 100644
--- a/util/grub-mkrescue.in
+++ b/util/grub-mkrescue.in
@@ -31,7 +31,7 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed ${transform}`
+pkgdatadir=${datadir}/@PACKAGE_TARNAME@
 fi
 pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 
diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index 2351477..f554fc9 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -32,7 +32,7 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 datadir=@datadir@
 if [ x$pkgdatadir = x ]; then
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed

Request: FS support in search hints

2012-02-14 Thread Keshav P R
Hi,
Is it possible to add support for --hints-fs=ext4 (for example) in
grub-probe hints_string and to the search command in grub2 env. Whi;e
hints speeds up the search for the partition, it does not speed up the
fs related tasks due to some time taken for detecing the filesystem of
the partition. This might speed up the search using FS LABEL and FS
UUID for which grub2 first tries each FS one by one before checking
the UUID/LABEL.

Also in grub-install (and other scripts), for example

${pkgdatadir}/grub-mkconfig_lib =
/usr/share/grub-efi/grub-mkconfig_lib , while the file is at
/usr/share/grub/grub-mkconfig_lib . grub-mkconfig_lib should honour
the program-transform-name option passed to configure. Please fix
this. Thanks in advance.

Regards.

Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Keshav P R
On Mon, Feb 6, 2012 at 22:19, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:10, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:08, Matthew Garrett mj...@srcf.ucam.org wrote:
 On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote:
 loader/i386/pc/plan9_module-plan9.o `test -f 'loader/i386/pc/plan9.c'
 || echo './'`loader/i386/pc/plan9.c
 loader/i386/pc/plan9.c: In function 'grub_cmd_plan9':
 loader/i386/pc/plan9.c:420:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 loader/i386/pc/plan9.c:451:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 make[3]: *** [loader/i386/pc/plan9_module-plan9.o] Error 1


 with all the three V2 patches applied in order (didn't try V1). No
 error in x86_64-efi compile.

 Sigh. Sorry, I missed that the plan9 loader had been added. Just add a 0
 as an additional argument to grub_relocator_alloc_chunk_addr() in
 plan9.c.


 Any other files that require this change?


 After applying the patch, git grep -n
 grub_relocator_alloc_chunk_addr shows, among them the to-be-changed
 files (I think)

 grub-core/loader/i386/coreboot/chainloader.c:71:  err =
 grub_relocator_alloc_chunk_addr (relocator, ch,
 grub-core/loader/i386/pc/chainloader.c:168:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, 0x7C00,
 grub-core/loader/i386/pc/chainloader.c:173:    err =
 grub_relocator_alloc_chunk_addr (rel, ch,
 grub-core/loader/i386/pc/plan9.c:419:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_CONFIG_ADDR,
 grub-core/loader/i386/pc/plan9.c:450:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_TARGET,
 grub-core/loader/i386/pc/pxechainloader.c:133:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, 0x7c00, imagesize);


 --
 Matthew Garrett | mj...@srcf.ucam.org

Patch attached that fixes the remaining files (atleast i386-pc build succeeds)

- Keshav
diff --git a/grub-core/loader/i386/coreboot/chainloader.c b/grub-core/loader/i386/coreboot/chainloader.c
index 3f85aa3..2bf0c6a 100644
--- a/grub-core/loader/i386/coreboot/chainloader.c
+++ b/grub-core/loader/i386/coreboot/chainloader.c
@@ -69,7 +69,7 @@ grub_chain_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr, int *do_load)
 
   *do_load = 1;
   err = grub_relocator_alloc_chunk_addr (relocator, ch,
-	 phdr-p_paddr, phdr-p_memsz);
+	 phdr-p_paddr, phdr-p_memsz, 0);
   if (err)
 return err;
 
diff --git a/grub-core/loader/i386/pc/chainloader.c b/grub-core/loader/i386/pc/chainloader.c
index 30b1e8b..9da0128 100644
--- a/grub-core/loader/i386/pc/chainloader.c
+++ b/grub-core/loader/i386/pc/chainloader.c
@@ -166,13 +166,13 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
 grub_err_t err;
 
 err = grub_relocator_alloc_chunk_addr (rel, ch, 0x7C00,
-	   GRUB_DISK_SECTOR_SIZE);
+	   GRUB_DISK_SECTOR_SIZE, 0);
 if (err)
   goto fail;
 bs = get_virtual_current_address (ch);
 err = grub_relocator_alloc_chunk_addr (rel, ch,
 	   GRUB_MEMORY_MACHINE_PART_TABLE_ADDR,
-	   64);
+	   64, 0);
 if (err)
   goto fail;
 ptable = get_virtual_current_address (ch);
diff --git a/grub-core/loader/i386/pc/plan9.c b/grub-core/loader/i386/pc/plan9.c
index 169f83a..7de8c54 100644
--- a/grub-core/loader/i386/pc/plan9.c
+++ b/grub-core/loader/i386/pc/plan9.c
@@ -417,7 +417,7 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
 grub_relocator_chunk_t ch;
 grub_err_t err;
 err = grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_CONFIG_ADDR,
-	   configsize);
+	   configsize, 0);
 if (err)
   goto fail;
 config = get_virtual_current_address (ch);
@@ -448,7 +448,7 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
 grub_err_t err;
 
 err = grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_TARGET,
-	   memsize);
+	   memsize, 0);
 if (err)
   goto fail;
 mem = get_virtual_current_address (ch);
diff --git a/grub-core/loader/i386/pc/pxechainloader.c b/grub-core/loader/i386/pc/pxechainloader.c
index 30a4c24..e0d8e7c 100644
--- a/grub-core/loader/i386/pc/pxechainloader.c
+++ b/grub-core/loader/i386/pc/pxechainloader.c
@@ -130,7 +130,7 @@ grub_cmd_pxechain (grub_command_t cmd __attribute__ ((unused)),
   imagesize = grub_file_size (file);
   {
 grub_relocator_chunk_t ch;
-err = grub_relocator_alloc_chunk_addr (rel, ch, 0x7c00, imagesize);
+err = grub_relocator_alloc_chunk_addr (rel, ch, 0x7c00, imagesize, 0);
 if (err)
   goto fail;
 image = get_virtual_current_address (ch);
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-08 Thread Keshav P R
On Wed, Feb 8, 2012 at 22:26, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:19, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:10, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:08, Matthew Garrett mj...@srcf.ucam.org wrote:
 On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote:
 loader/i386/pc/plan9_module-plan9.o `test -f 'loader/i386/pc/plan9.c'
 || echo './'`loader/i386/pc/plan9.c
 loader/i386/pc/plan9.c: In function 'grub_cmd_plan9':
 loader/i386/pc/plan9.c:420:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 loader/i386/pc/plan9.c:451:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 make[3]: *** [loader/i386/pc/plan9_module-plan9.o] Error 1


 with all the three V2 patches applied in order (didn't try V1). No
 error in x86_64-efi compile.

 Sigh. Sorry, I missed that the plan9 loader had been added. Just add a 0
 as an additional argument to grub_relocator_alloc_chunk_addr() in
 plan9.c.


 Any other files that require this change?


 After applying the patch, git grep -n
 grub_relocator_alloc_chunk_addr shows, among them the to-be-changed
 files (I think)

 grub-core/loader/i386/coreboot/chainloader.c:71:  err =
 grub_relocator_alloc_chunk_addr (relocator, ch,
 grub-core/loader/i386/pc/chainloader.c:168:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, 0x7C00,
 grub-core/loader/i386/pc/chainloader.c:173:    err =
 grub_relocator_alloc_chunk_addr (rel, ch,
 grub-core/loader/i386/pc/plan9.c:419:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_CONFIG_ADDR,
 grub-core/loader/i386/pc/plan9.c:450:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_TARGET,
 grub-core/loader/i386/pc/pxechainloader.c:133:    err =
 grub_relocator_alloc_chunk_addr (rel, ch, 0x7c00, imagesize);


 --
 Matthew Garrett | mj...@srcf.ucam.org

 Patch attached that fixes the remaining files (atleast i386-pc build succeeds)


Just got the V3 patches in my mailbox with the changes added. Thanks
for the patch.

- Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Some improvements to EFI GOP support

2012-02-08 Thread Keshav P R
On Wed, Feb 8, 2012 at 22:21, Matthew Garrett m...@redhat.com wrote:
 Add support for grabbing the EDID on GOP devices, along with picking the
 better GOP device when we have more than one (Thanks, Apple).


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel

Patch?

- Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-06 Thread Keshav P R
On Mon, Feb 6, 2012 at 21:23, Matthew Garrett m...@redhat.com wrote:
 We should attempt to load the kernel at its preferred address, and if we
 can't do that then we should at lesat align it correctly. When doing so
 we should also make sure to avoid putting the kernel on top of any regions
 being used by the firmware.
 ---

 I managed to screw up the rebase, so this is a fixed version. Also, the code
 now follows the old path if the kernel isn't relocatable - we can't move it,
 so better to try it and just hope that everything works out.

  ChangeLog                     |    8 +
  grub-core/loader/i386/linux.c |   67 ++--
  2 files changed, 65 insertions(+), 10 deletions(-)

 diff --git a/ChangeLog b/ChangeLog
 index 33e5dda..aedf4bc 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,5 +1,13 @@
  2012-02-06  Matthew Garrett  m...@redhat.com

 +       * grub-core/loader/i386/linux.c (allocate_pages): Attempt to obtain
 +       appropriately aligned memory if the desired target is unavailable
 +       (grub_cmd_linux): Update to match newer Linux boot protocols, and
 +       attempt to load the kernel at its preferred address rather than
 +       hardcoding.
 +
 +2012-02-06  Matthew Garrett  m...@redhat.com
 +
        * grub-core/lib/efi/relocator.c (grub_relocator_alloc_chunk_addr):
        Add argument to fail allocation when target address overlaps
        firmware regions. All users updated.
 diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
 index 67a4533..3eb8fa0 100644
 --- a/grub-core/loader/i386/linux.c
 +++ b/grub-core/loader/i386/linux.c
 @@ -183,13 +183,14 @@ free_pages (void)
   grub_relocator_unload (relocator);
   relocator = NULL;
   real_mode_mem = prot_mode_mem = initrd_mem = 0;
 -  real_mode_target = prot_mode_target = initrd_mem_target = 0;
 +  real_mode_target = initrd_mem_target = 0;
  }

  /* Allocate pages for the real mode code and the protected mode code
    for linux as well as a memory map buffer.  */
  static grub_err_t
 -allocate_pages (grub_size_t prot_size)
 +allocate_pages (grub_size_t prot_size, grub_size_t *align,
 +               grub_size_t min_align, int relocatable)
  {
   grub_size_t real_size, mmap_size;
   grub_err_t err;
 @@ -269,18 +270,38 @@ allocate_pages (grub_size_t prot_size)
                                            + efi_mmap_size), 0);
     if (err)
       goto fail;
 +
 +    grub_errno = GRUB_ERR_NONE;
     real_mode_mem = get_virtual_current_address (ch);
   }
   efi_mmap_buf = (grub_uint8_t *) real_mode_mem + real_size + mmap_size;

 -  prot_mode_target = GRUB_LINUX_BZIMAGE_ADDR;
 -
   {
     grub_relocator_chunk_t ch;
     err = grub_relocator_alloc_chunk_addr (relocator, ch,
 -                                          prot_mode_target, prot_size, 0);
 +                                          prot_mode_target, prot_size,
 +                                          relocatable);
 +    if (err)
 +      {
 +       unsigned int i;
 +       for (i = *align; i = min_align; i--)
 +         {
 +           err = grub_relocator_alloc_chunk_align (relocator, ch,
 +                                                   0x100, 0x,
 +                                                   prot_size, 1  i,
 +                                                   
 GRUB_RELOCATOR_PREFERENCE_LOW);
 +           if (!err)
 +             {
 +               *align = i;
 +               prot_mode_target = get_physical_target_address (ch);
 +               break;
 +             }
 +         }
 +      }
 +
     if (err)
       goto fail;
 +
     prot_mode_mem = get_virtual_current_address (ch);
   }

 @@ -631,8 +652,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
 ((unused)),
   struct linux_kernel_header lh;
   struct linux_kernel_params *params;
   grub_uint8_t setup_sects;
 -  grub_size_t real_size, prot_size;
 +  grub_size_t real_size, prot_size, prot_file_size, align = 0, min_align = 0;
   grub_ssize_t len;
 +  int relocatable = 0;
   int i;

   grub_dl_ref (my_mod);
 @@ -705,9 +727,32 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
 ((unused)),
     setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;

   real_size = setup_sects  GRUB_DISK_SECTOR_BITS;
 -  prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;

 -  if (allocate_pages (prot_size))
 +  if (grub_le_to_cpu16 (lh.version) = 0x205)
 +    {
 +      for (align = 0; align  32; align++)
 +       {
 +         if (grub_le_to_cpu32 (lh.kernel_alignment)  (1  align))
 +           break;
 +       }
 +      relocatable = grub_le_to_cpu32 (lh.relocatable);
 +    }
 +
 +  if (grub_le_to_cpu16 (lh.version) = 0x020a)
 +    {
 +      min_align = lh.min_alignment;
 +      prot_size = grub_le_to_cpu32 (lh.init_size);
 +      prot_mode_target = grub_le_to_cpu64 (lh.pref_address);
 +    }
 +  else
 +    {
 +      min_align = 0;
 +      prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
 +      prot_mode_target = 

Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-06 Thread Keshav P R
On Mon, Feb 6, 2012 at 21:58, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 21:23, Matthew Garrett m...@redhat.com wrote:
 We should attempt to load the kernel at its preferred address, and if we
 can't do that then we should at lesat align it correctly. When doing so
 we should also make sure to avoid putting the kernel on top of any regions
 being used by the firmware.
 ---

 I managed to screw up the rebase, so this is a fixed version. Also, the code
 now follows the old path if the kernel isn't relocatable - we can't move it,
 so better to try it and just hope that everything works out.

  ChangeLog                     |    8 +
  grub-core/loader/i386/linux.c |   67 
 ++--
  2 files changed, 65 insertions(+), 10 deletions(-)

 diff --git a/ChangeLog b/ChangeLog
 index 33e5dda..aedf4bc 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,5 +1,13 @@
  2012-02-06  Matthew Garrett  m...@redhat.com

 +       * grub-core/loader/i386/linux.c (allocate_pages): Attempt to obtain
 +       appropriately aligned memory if the desired target is unavailable
 +       (grub_cmd_linux): Update to match newer Linux boot protocols, and
 +       attempt to load the kernel at its preferred address rather than
 +       hardcoding.
 +
 +2012-02-06  Matthew Garrett  m...@redhat.com
 +
        * grub-core/lib/efi/relocator.c (grub_relocator_alloc_chunk_addr):
        Add argument to fail allocation when target address overlaps
        firmware regions. All users updated.
 diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
 index 67a4533..3eb8fa0 100644
 --- a/grub-core/loader/i386/linux.c
 +++ b/grub-core/loader/i386/linux.c
 @@ -183,13 +183,14 @@ free_pages (void)
   grub_relocator_unload (relocator);
   relocator = NULL;
   real_mode_mem = prot_mode_mem = initrd_mem = 0;
 -  real_mode_target = prot_mode_target = initrd_mem_target = 0;
 +  real_mode_target = initrd_mem_target = 0;
  }

  /* Allocate pages for the real mode code and the protected mode code
    for linux as well as a memory map buffer.  */
  static grub_err_t
 -allocate_pages (grub_size_t prot_size)
 +allocate_pages (grub_size_t prot_size, grub_size_t *align,
 +               grub_size_t min_align, int relocatable)
  {
   grub_size_t real_size, mmap_size;
   grub_err_t err;
 @@ -269,18 +270,38 @@ allocate_pages (grub_size_t prot_size)
                                            + efi_mmap_size), 0);
     if (err)
       goto fail;
 +
 +    grub_errno = GRUB_ERR_NONE;
     real_mode_mem = get_virtual_current_address (ch);
   }
   efi_mmap_buf = (grub_uint8_t *) real_mode_mem + real_size + mmap_size;

 -  prot_mode_target = GRUB_LINUX_BZIMAGE_ADDR;
 -
   {
     grub_relocator_chunk_t ch;
     err = grub_relocator_alloc_chunk_addr (relocator, ch,
 -                                          prot_mode_target, prot_size, 0);
 +                                          prot_mode_target, prot_size,
 +                                          relocatable);
 +    if (err)
 +      {
 +       unsigned int i;
 +       for (i = *align; i = min_align; i--)
 +         {
 +           err = grub_relocator_alloc_chunk_align (relocator, ch,
 +                                                   0x100, 0x,
 +                                                   prot_size, 1  i,
 +                                                   
 GRUB_RELOCATOR_PREFERENCE_LOW);
 +           if (!err)
 +             {
 +               *align = i;
 +               prot_mode_target = get_physical_target_address (ch);
 +               break;
 +             }
 +         }
 +      }
 +
     if (err)
       goto fail;
 +
     prot_mode_mem = get_virtual_current_address (ch);
   }

 @@ -631,8 +652,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
 ((unused)),
   struct linux_kernel_header lh;
   struct linux_kernel_params *params;
   grub_uint8_t setup_sects;
 -  grub_size_t real_size, prot_size;
 +  grub_size_t real_size, prot_size, prot_file_size, align = 0, min_align = 
 0;
   grub_ssize_t len;
 +  int relocatable = 0;
   int i;

   grub_dl_ref (my_mod);
 @@ -705,9 +727,32 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
 ((unused)),
     setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;

   real_size = setup_sects  GRUB_DISK_SECTOR_BITS;
 -  prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;

 -  if (allocate_pages (prot_size))
 +  if (grub_le_to_cpu16 (lh.version) = 0x205)
 +    {
 +      for (align = 0; align  32; align++)
 +       {
 +         if (grub_le_to_cpu32 (lh.kernel_alignment)  (1  align))
 +           break;
 +       }
 +      relocatable = grub_le_to_cpu32 (lh.relocatable);
 +    }
 +
 +  if (grub_le_to_cpu16 (lh.version) = 0x020a)
 +    {
 +      min_align = lh.min_alignment;
 +      prot_size = grub_le_to_cpu32 (lh.init_size);
 +      prot_mode_target = grub_le_to_cpu64 (lh.pref_address);
 +    }
 +  else
 +    {
 +      min_align = 0;
 +      prot_size = grub_file_size

Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-06 Thread Keshav P R
On Mon, Feb 6, 2012 at 22:08, Matthew Garrett mj...@srcf.ucam.org wrote:
 On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote:
 loader/i386/pc/plan9_module-plan9.o `test -f 'loader/i386/pc/plan9.c'
 || echo './'`loader/i386/pc/plan9.c
 loader/i386/pc/plan9.c: In function 'grub_cmd_plan9':
 loader/i386/pc/plan9.c:420:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 loader/i386/pc/plan9.c:451:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 make[3]: *** [loader/i386/pc/plan9_module-plan9.o] Error 1


 with all the three V2 patches applied in order (didn't try V1). No
 error in x86_64-efi compile.

 Sigh. Sorry, I missed that the plan9 loader had been added. Just add a 0
 as an additional argument to grub_relocator_alloc_chunk_addr() in
 plan9.c.


Any other files that require this change?

 --
 Matthew Garrett | mj...@srcf.ucam.org

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH V2 3/3] Update Linux loader to follow the kernel's preferences

2012-02-06 Thread Keshav P R
On Mon, Feb 6, 2012 at 22:10, Keshav P R the.ridikulus@gmail.com wrote:
 On Mon, Feb 6, 2012 at 22:08, Matthew Garrett mj...@srcf.ucam.org wrote:
 On Mon, Feb 06, 2012 at 10:00:30PM +0530, Keshav P R wrote:
 loader/i386/pc/plan9_module-plan9.o `test -f 'loader/i386/pc/plan9.c'
 || echo './'`loader/i386/pc/plan9.c
 loader/i386/pc/plan9.c: In function 'grub_cmd_plan9':
 loader/i386/pc/plan9.c:420:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 loader/i386/pc/plan9.c:451:9: error: too few arguments to function
 'grub_relocator_alloc_chunk_addr'
 ../include/grub/relocator.h:34:1: note: declared here
 make[3]: *** [loader/i386/pc/plan9_module-plan9.o] Error 1


 with all the three V2 patches applied in order (didn't try V1). No
 error in x86_64-efi compile.

 Sigh. Sorry, I missed that the plan9 loader had been added. Just add a 0
 as an additional argument to grub_relocator_alloc_chunk_addr() in
 plan9.c.


 Any other files that require this change?


After applying the patch, git grep -n
grub_relocator_alloc_chunk_addr shows, among them the to-be-changed
files (I think)

grub-core/loader/i386/coreboot/chainloader.c:71:  err =
grub_relocator_alloc_chunk_addr (relocator, ch,
grub-core/loader/i386/pc/chainloader.c:168:err =
grub_relocator_alloc_chunk_addr (rel, ch, 0x7C00,
grub-core/loader/i386/pc/chainloader.c:173:err =
grub_relocator_alloc_chunk_addr (rel, ch,
grub-core/loader/i386/pc/plan9.c:419:err =
grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_CONFIG_ADDR,
grub-core/loader/i386/pc/plan9.c:450:err =
grub_relocator_alloc_chunk_addr (rel, ch, GRUB_PLAN9_TARGET,
grub-core/loader/i386/pc/pxechainloader.c:133:err =
grub_relocator_alloc_chunk_addr (rel, ch, 0x7c00, imagesize);


 --
 Matthew Garrett | mj...@srcf.ucam.org

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: not a valid root device error in UEFI chainloader command

2012-01-18 Thread Keshav P R
2012/1/18 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com:
 On 18.01.2012 03:54, Keshav P R wrote:

 Hi,
      I tried to manually chainload UEFI shell from grub2 terminal in
 x86_64 firmware. I get

 insmod part_gpt
 insmod fat
 chainloader (hd0,gpt1)/shellx64.efi

 error: not a valid root device

 Setting root isn't just for convenience inside GRUB, with some loader
 (multiboot, chainloader, bsd) it's actually passed to the payload as its
 root. If you forget to set it, it obviously won't work

 If I use

 set pager=1
 set debug=all
 chainloader (hd0,gpt1)/shellx64.efi

 [long rows of text - but no visible error]

 boot

 [shell launched]

 However a menuentry like

 menuentry UEFI Shell {
        search --fs-uuid --no-floppy --set=root ${_uefi_sys_fs_uuid}
        chainloader (${root})/shellx64.efi
 }

 works. I can reproduce this error everytime I try to manually
 chainload from grub2 terminal, but does not occur even once when
 loaded via menuentry. Thanks in advance.

 Regards.

 Keshav

 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel



 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko


So what you are saying is I have to set the root variable before
calling chainloader?

- Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


not a valid root device error in UEFI chainloader command

2012-01-17 Thread Keshav P R
Hi,
 I tried to manually chainload UEFI shell from grub2 terminal in
x86_64 firmware. I get

 insmod part_gpt
 insmod fat
 chainloader (hd0,gpt1)/shellx64.efi
error: not a valid root device

If I use

 set pager=1
 set debug=all
 chainloader (hd0,gpt1)/shellx64.efi
[long rows of text - but no visible error]
 boot
[shell launched]

However a menuentry like

menuentry UEFI Shell {
search --fs-uuid --no-floppy --set=root ${_uefi_sys_fs_uuid}
chainloader (${root})/shellx64.efi
}

works. I can reproduce this error everytime I try to manually
chainload from grub2 terminal, but does not occur even once when
loaded via menuentry. Thanks in advance.

Regards.

Keshav

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: conf/Makefile.common fails with automake 1.11.2 in autogen.sh step

2011-12-28 Thread Keshav P R
On Wed, Dec 28, 2011 at 02:03, Seth Goldberg seth.goldb...@oracle.comwrote:

 Hi,

  Will this continue to work with older automake as well?

  --S


 Quoting Keshav P R, who wrote the following on Wed, 28 Dec 2011:

  Hi,
   grub2-bzr r3732 fails to compile in Archlinux x86_64 with automake
 1.11.2 due to upstream change
 http://git.savannah.gnu.org/**cgit/automake.git/commit/?h=**maintid=**
 9ca632642b006ac6b0fc4ce0ae5b34**023faa8cbfhttp://git.savannah.gnu.org/cgit/automake.git/commit/?h=maintid=9ca632642b006ac6b0fc4ce0ae5b34023faa8cbf
 .

 Due to this change pkglib_{DATA,SCRIPTS} is invalid. It needs to be
 pkgdata_{DATA_SCRIPTS} due to which grub2 modules are not longer installed
 at /usr/lib/grub but at /usr/share/grub. I added --datadir=/usr/lib and
 --datarootdir=/usr/share to ./configure to workaround this problem, but
 this is a dirty hack.

 Since this seems to be a well discussed change among automake devs, I
 don't
 think they might revert back. Therefore grub2 need to use a valid prerix
 for DATA and SCRIPTS. I have attached the patch I have used (in
 combination
 with --datadir configure option). Please fix this. Thanks in advance.

 Regards.

 Keshav


From what it seems, pkglib_DATA seems to be invalud, for a long time. Only
now (automake 1.11.2) it leads to an error. The actual error is

conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for
`DATA'
conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for
`SCRIPTS'

This error does not occur with automake 1.11.1 . I think pkgdata_DATA will
not create any problem with older automake. The problemn is by uisng this,
the modules and lst files are installed in /usr/share/grub instead of
/usr/lib/grub (unless --datadir=/usr/lib is passed to ./configure). So now
either automake devs should revert back thta commit, or (according to
automake upstream) grub2 should use pkgdatadir instead of pkglibdir for
DATA and SCRIPTS (i.e. modules and lst files).

Regards.

Keshav
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


r3732 compile error with ntldr-img

2011-12-27 Thread Keshav P R
Hi,
 ntldr-img grub-extras does not compile anymore wiht grub2-bzr. It
gives out the error http://pastebin.com/hg1Qwpbq . Please fix this. Thanks
in advance.

Regards.

Keshav
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


conf/Makefile.common fails with automake 1.11.2 in autogen.sh step

2011-12-27 Thread Keshav P R
Hi,
grub2-bzr r3732 fails to compile in Archlinux x86_64 with automake
1.11.2 due to upstream change
http://git.savannah.gnu.org/cgit/automake.git/commit/?h=maintid=9ca632642b006ac6b0fc4ce0ae5b34023faa8cbf.

Due to this change pkglib_{DATA,SCRIPTS} is invalid. It needs to be
pkgdata_{DATA_SCRIPTS} due to which grub2 modules are not longer installed
at /usr/lib/grub but at /usr/share/grub. I added --datadir=/usr/lib and
--datarootdir=/usr/share to ./configure to workaround this problem, but
this is a dirty hack.

Since this seems to be a well discussed change among automake devs, I don't
think they might revert back. Therefore grub2 need to use a valid prerix
for DATA and SCRIPTS. I have attached the patch I have used (in combination
with --datadir configure option). Please fix this. Thanks in advance.

Regards.

Keshav
diff --git a/ChangeLog b/ChangeLog
index 016056a..cf5d822 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-12-24  Keshav P R  the.ridikulus@gmail.com
+
+	Fixes for automake 1.11.2
+
+	* conf/Makefile.common: Change pkglib_SCRIPTS to pkgdata_SCRIPTS.
+	* conf/Makefile.common: Change pkglib_DATA to pkgdata_DATA.
+	* Makefile.am: Likewise.
+	* gentpl.py: Likewise.
+	* util/grub-mkstandalone.in: Likewise.
+	* util/grub-mknetdir.in: Likewise.
+	* util/grub-mkrescue.in: Likewise.
+	* util/grub-mkstandalone.in: Likewise.
+
+
 2011-12-24  Vladimir Serbinenko  phco...@gmail.com
 
 	Integrate hints into autogeneration scripts.
diff --git a/Makefile.am b/Makefile.am
index c5f486e..395b0dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
 # Install config.h into platformdir
 platform_HEADERS = config.h
 
-pkglib_DATA += grub-mkconfig_lib
-pkglib_DATA += update-grub_lib
+pkgdata_DATA += grub-mkconfig_lib
+pkgdata_DATA += update-grub_lib
 
 
 if COND_i386_coreboot
diff --git a/conf/Makefile.common b/conf/Makefile.common
index 751188b..bbd59cc 100644
--- a/conf/Makefile.common
+++ b/conf/Makefile.common
@@ -137,7 +137,7 @@ KERNEL_HEADER_FILES =
 
 man_MANS =
 noinst_DATA =
-pkglib_DATA =
+pkgdata_DATA =
 bin_SCRIPTS =
 sbin_SCRIPTS =
 bin_PROGRAMS =
@@ -147,7 +147,7 @@ check_SCRIPTS =
 grubconf_DATA =
 check_PROGRAMS =
 noinst_SCRIPTS =
-pkglib_SCRIPTS =
+pkgdata_SCRIPTS =
 noinst_PROGRAMS =
 grubconf_SCRIPTS =
 noinst_LIBRARIES =
diff --git a/gentpl.py b/gentpl.py
index 3008b80..a935f4d 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -512,7 +512,7 @@ def script(platform):
 r += [+ ENDIF +]
 
 r += rule([+ name +], platform_sources(platform) +  $(top_builddir)/config.status, 
-$(top_builddir)/config.status --file=-:$ | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g'  $@
+$(top_builddir)/config.status --file=-:$ | sed -e 's,@pkgdata_DATA@,$(pkgdata_DATA),g'  $@
 chmod a+x [+ name +]
 )
 
diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in
index e5a2172..7f6a36d 100644
--- a/util/grub-mknetdir.in
+++ b/util/grub-mknetdir.in
@@ -30,7 +30,7 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 localedir=@datadir@/locale
 datarootdir=@datarootdir@
-pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
+pkgdata_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 
 self=`basename $0`
 
@@ -183,7 +183,7 @@ process_input_dir ()
 cp -f $file $grubdir/
 fi
 done
-for file in ${pkglib_DATA}; do
+for file in ${pkgdata_DATA}; do
 	if test -f ${input_dir}/${file}; then
 cp -f ${input_dir}/${file} $grubdir/
 	fi
diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in
index eff7708..f6b96d4 100644
--- a/util/grub-mkrescue.in
+++ b/util/grub-mkrescue.in
@@ -27,7 +27,7 @@ libdir=@libdir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
-pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
+pkgdata_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 
 self=`basename $0`
 
@@ -163,7 +163,7 @@ process_input_dir ()
 cp -f $file ${iso9660_dir}/boot/grub/${platform}/
 fi
 done
-for file in ${pkglib_DATA}; do
+for file in ${pkgdata_DATA}; do
 	if test -f ${input_dir}/${file}; then
 cp -f ${input_dir}/${file} ${iso9660_dir}/boot/grub/${platform}/
 	fi
diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index b0dbf9b..92b7306 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -27,7 +27,7 @@ libdir=@libdir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
-pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
+pkgdata_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
 
 self=`basename $0`
 
@@ -163,7

Re: grub-mkstandalone fixes

2011-12-18 Thread Keshav P R

  On Sun, Dec 4, 2011 at 15:12, Keshav P R the.ridikulus@gmail.comwrote:

 Hi,
 It seems like grub-mkstandalone was copied directly from
 grub-mkrescue without checking the options. Also there is no way to specify
 a grub.cfg to be copied as (memdisk)/boot/grub/grub.cfg . The attached
 patch fixes all of this. Please apply it.

 Regards.

 Keshav


Updated patch with --config option removed and with a ChangeLog entry (now
contains only trivial/typo fixes) attached.

Regards.

Keshav
diff --git a/ChangeLog b/ChangeLog
index 4aacc74..79efa42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-19  Keshav P R  the.ridikulus@gmail.com
+
+	* util/grub-mkstandalone.in: Fix minor typo errors.
+
 2011-12-16  Vladimir Serbinenko  phco...@gmail.com
 
 	* grub-core/commands/i386/pc/drivemap.c (int13slot): Replace
diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index e140ecc..b0dbf9b 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -31,7 +31,7 @@ pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
 
 self=`basename $0`
 
-source_dirrectory=
+source_directory=
 compression=auto
 format=
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
@@ -86,7 +86,7 @@ do
 	exit 0 ;;
 
 --modules)
-modules=`argument $option $@`; shift ;;
+	modules=`argument $option $@`; shift ;;
 --modules=*)
 	modules=`echo $option | sed 's/--modules=//'` ;;
 
@@ -96,9 +96,9 @@ do
 	output_image=`echo $option | sed 's/--output=//'` ;;
 
 --directory | -d)
-source_directory=`argument $option $@`; shift ;;
+	source_directory=`argument $option $@`; shift ;;
 --directory=*)
-	source_directory=`echo $option | sed 's/--rom-directory=//'` ;;
+	source_directory=`echo $option | sed 's/--directory=//'` ;;
 
 --grub-mkimage)
 	grub_mkimage=`argument $option $@`; shift ;;
@@ -108,12 +108,12 @@ do
 --compression | -C)
 	compression=`argument $option $@`; shift ;;
 --compression=*)
-compression=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	compression=`echo ${option} | sed 's/--compression=//'` ;;
 
 --format | -O)
 	format=`argument $option $@`; shift ;;
 --format=*)
-format=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	format=`echo ${option} | sed 's/--format=//'` ;;
 
 *)
 	source=${source} ${option} $@; break ;;
@@ -162,6 +162,7 @@ for file in ${source_directory}/*.mod ${source_directory}/efiemu32.o ${sour
 cp -f $file ${memdisk_dir}/boot/grub/
 fi
 done
+
 for file in ${pkglib_DATA}; do
 if test -f ${source_directory}/${file}; then
 cp -f ${source_directory}/${file} ${memdisk_dir}/boot/grub/
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub-mkstandalone fixes

2011-12-14 Thread Keshav P R

  On Sun, Dec 4, 2011 at 15:12, Keshav P R the.ridikulus@gmail.comwrote:

 Hi,
 It seems like grub-mkstandalone was copied directly from
 grub-mkrescue without checking the options. Also there is no way to specify
 a grub.cfg to be copied as (memdisk)/boot/grub/grub.cfg . The attached
 patch fixes all of this. Please apply it.

 Regards.

 Keshav


 Patch with --config option removed (now contains only trivial/typo fixes)
 attached.


- Keshav


grub-mkstandalone-trivial-fixes.patch
Description: Binary data
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


grub-mkstandalone fixes

2011-12-04 Thread Keshav P R
Hi,
It seems like grub-mkstandalone was copied directly from grub-mkrescue
without checking the options. Also there is no way to specify a grub.cfg to
be copied as (memdisk)/boot/grub/grub.cfg . The attached patch fixes all of
this. Pleas apply it.

Regards.

Keshav
diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index e140ecc..15af6ad 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -86,7 +86,7 @@ do
 	exit 0 ;;
 
 --modules)
-modules=`argument $option $@`; shift ;;
+	modules=`argument $option $@`; shift ;;
 --modules=*)
 	modules=`echo $option | sed 's/--modules=//'` ;;
 
@@ -95,10 +95,15 @@ do
 --output=*)
 	output_image=`echo $option | sed 's/--output=//'` ;;
 
+-c | --config)
+	config_file=`argument $option $@`; shift ;;
+--config=*)
+	config_file=`echo $option | sed 's/--config=//'` ;;
+
 --directory | -d)
-source_directory=`argument $option $@`; shift ;;
+	source_directory=`argument $option $@`; shift ;;
 --directory=*)
-	source_directory=`echo $option | sed 's/--rom-directory=//'` ;;
+	source_directory=`echo $option | sed 's/--directory=//'` ;;
 
 --grub-mkimage)
 	grub_mkimage=`argument $option $@`; shift ;;
@@ -108,12 +113,12 @@ do
 --compression | -C)
 	compression=`argument $option $@`; shift ;;
 --compression=*)
-compression=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	compression=`echo ${option}/ | sed 's/--compression=//'` ;;
 
 --format | -O)
 	format=`argument $option $@`; shift ;;
 --format=*)
-format=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	format=`echo ${option}/ | sed 's/--format=//'` ;;
 
 *)
 	source=${source} ${option} $@; break ;;
@@ -162,12 +167,17 @@ for file in ${source_directory}/*.mod ${source_directory}/efiemu32.o ${sour
 cp -f $file ${memdisk_dir}/boot/grub/
 fi
 done
+
 for file in ${pkglib_DATA}; do
 if test -f ${source_directory}/${file}; then
 cp -f ${source_directory}/${file} ${memdisk_dir}/boot/grub/
 fi
 done
 
+if test -f ${config_file}; then
+cp -f ${config_file} ${memdisk_dir}/boot/grub/grub.cfg
+fi
+
 mkdir -p ${memdisk_dir}/boot/grub/locale
 for file in ${source_directory}/po/*.mo; do
 if test -f $file; then
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub-mkstandalone fixes

2011-12-04 Thread Keshav P R
On Sun, Dec 4, 2011 at 15:12, Keshav P R the.ridikulus@gmail.comwrote:

 Hi,
 It seems like grub-mkstandalone was copied directly from grub-mkrescue
 without checking the options. Also there is no way to specify a grub.cfg to
 be copied as (memdisk)/boot/grub/grub.cfg . The attached patch fixes all of
 this. Pleas apply it.

 Regards.

 Keshav


Minor fix in previous patch, new file attached.
diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index e140ecc..3a77870 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -31,7 +31,7 @@ pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
 
 self=`basename $0`
 
-source_dirrectory=
+source_directory=
 compression=auto
 format=
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
@@ -51,6 +51,7 @@ Make GRUB rescue image.
   -O, --format=FORMAT generate an image in format
   available formats: %s
   -C, --compression=(xz|none|auto)  choose the compression to use
+  -c, --config=FILE   use specified file as grub.cfg
   --modules=MODULES   pre-load specified modules MODULES
   --grub-mkimage=FILE use FILE as grub-mkimage
 
@@ -86,7 +87,7 @@ do
 	exit 0 ;;
 
 --modules)
-modules=`argument $option $@`; shift ;;
+	modules=`argument $option $@`; shift ;;
 --modules=*)
 	modules=`echo $option | sed 's/--modules=//'` ;;
 
@@ -95,10 +96,15 @@ do
 --output=*)
 	output_image=`echo $option | sed 's/--output=//'` ;;
 
+-c | --config)
+	config_file=`argument $option $@`; shift ;;
+--config=*)
+	config_file=`echo $option | sed 's/--config=//'` ;;
+
 --directory | -d)
-source_directory=`argument $option $@`; shift ;;
+	source_directory=`argument $option $@`; shift ;;
 --directory=*)
-	source_directory=`echo $option | sed 's/--rom-directory=//'` ;;
+	source_directory=`echo $option | sed 's/--directory=//'` ;;
 
 --grub-mkimage)
 	grub_mkimage=`argument $option $@`; shift ;;
@@ -108,12 +114,12 @@ do
 --compression | -C)
 	compression=`argument $option $@`; shift ;;
 --compression=*)
-compression=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	compression=`echo ${option}/ | sed 's/--compression=//'` ;;
 
 --format | -O)
 	format=`argument $option $@`; shift ;;
 --format=*)
-format=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	format=`echo ${option}/ | sed 's/--format=//'` ;;
 
 *)
 	source=${source} ${option} $@; break ;;
@@ -162,12 +168,17 @@ for file in ${source_directory}/*.mod ${source_directory}/efiemu32.o ${sour
 cp -f $file ${memdisk_dir}/boot/grub/
 fi
 done
+
 for file in ${pkglib_DATA}; do
 if test -f ${source_directory}/${file}; then
 cp -f ${source_directory}/${file} ${memdisk_dir}/boot/grub/
 fi
 done
 
+if test -f ${config_file}; then
+cp -f ${config_file} ${memdisk_dir}/boot/grub/grub.cfg
+fi
+
 mkdir -p ${memdisk_dir}/boot/grub/locale
 for file in ${source_directory}/po/*.mo; do
 if test -f $file; then
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub-mkstandalone fixes

2011-12-04 Thread Keshav P R
On Sun, Dec 4, 2011 at 15:17, Keshav P R the.ridikulus@gmail.comwrote:

 On Sun, Dec 4, 2011 at 15:12, Keshav P R the.ridikulus@gmail.comwrote:

 Hi,
 It seems like grub-mkstandalone was copied directly from
 grub-mkrescue without checking the options. Also there is no way to specify
 a grub.cfg to be copied as (memdisk)/boot/grub/grub.cfg . The attached
 patch fixes all of this. Pleas apply it.

 Regards.

 Keshav


 Minor fix in previous patch, new file attached.

diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
index e140ecc..dcb2372 100644
--- a/util/grub-mkstandalone.in
+++ b/util/grub-mkstandalone.in
@@ -31,7 +31,7 @@ pkglib_DATA=moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
 
 self=`basename $0`
 
-source_dirrectory=
+source_directory=
 compression=auto
 format=
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
@@ -51,6 +51,7 @@ Make GRUB rescue image.
   -O, --format=FORMAT generate an image in format
   available formats: %s
   -C, --compression=(xz|none|auto)  choose the compression to use
+  -c, --config=FILE   use specified file as grub.cfg
   --modules=MODULES   pre-load specified modules MODULES
   --grub-mkimage=FILE use FILE as grub-mkimage
 
@@ -86,7 +87,7 @@ do
 	exit 0 ;;
 
 --modules)
-modules=`argument $option $@`; shift ;;
+	modules=`argument $option $@`; shift ;;
 --modules=*)
 	modules=`echo $option | sed 's/--modules=//'` ;;
 
@@ -95,10 +96,15 @@ do
 --output=*)
 	output_image=`echo $option | sed 's/--output=//'` ;;
 
+-c | --config)
+	config_file=`argument $option $@`; shift ;;
+--config=*)
+	config_file=`echo $option | sed 's/--config=//'` ;;
+
 --directory | -d)
-source_directory=`argument $option $@`; shift ;;
+	source_directory=`argument $option $@`; shift ;;
 --directory=*)
-	source_directory=`echo $option | sed 's/--rom-directory=//'` ;;
+	source_directory=`echo $option | sed 's/--directory=//'` ;;
 
 --grub-mkimage)
 	grub_mkimage=`argument $option $@`; shift ;;
@@ -108,12 +114,12 @@ do
 --compression | -C)
 	compression=`argument $option $@`; shift ;;
 --compression=*)
-compression=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	compression=`echo ${option} | sed 's/--compression=//'` ;;
 
 --format | -O)
 	format=`argument $option $@`; shift ;;
 --format=*)
-format=`echo ${option}/ | sed 's/--xorriso=//'` ;;
+	format=`echo ${option} | sed 's/--format=//'` ;;
 
 *)
 	source=${source} ${option} $@; break ;;
@@ -162,12 +168,17 @@ for file in ${source_directory}/*.mod ${source_directory}/efiemu32.o ${sour
 cp -f $file ${memdisk_dir}/boot/grub/
 fi
 done
+
 for file in ${pkglib_DATA}; do
 if test -f ${source_directory}/${file}; then
 cp -f ${source_directory}/${file} ${memdisk_dir}/boot/grub/
 fi
 done
 
+if test -f ${config_file}; then
+cp -f ${config_file} ${memdisk_dir}/boot/grub/grub.cfg
+fi
+
 mkdir -p ${memdisk_dir}/boot/grub/locale
 for file in ${source_directory}/po/*.mo; do
 if test -f $file; then
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH, RFC, RFT] Mactel integration

2011-12-01 Thread Keshav P R
2011/11/29 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com

 On 29.11.2011 08:25, Keshav P R wrote:

 grubx64.efi is installed at /boot/efi/efi/grub2/grubx64.**efi ,  but the
 modules are located at /boot/grub (which is $grubdir aka prefix set in
 grubx64.efi/core.efi). But this again creates confusion for some users who
 have to find out the actual prefix dir in case he/she wants to modify
 grub.cfg and grubenv in that dir. The only way to force grub-install to
 install everything in /boot/efi/efi/grub/ is to us



  The modules and configuration files form platform-independent part as far
 as install is concerned (it's always handles the same way). The grub.efi is
 the EFI specific part which needs to go where EFI expects it. /efi
 directory on ESP as its name implies stores files for EFI, perhaps some
 small config files, it is not to store our bunch of modules. It's ok to use
 ESP to store modules unless they go into /efi directory but it's hard to
 say if such a long list of files will trigger any bugs in firmware
 implementation but in any case platform-independent part shouldn't go into
 firmware-specific directories. We've already had issues with IEEE1275 when
 we did something similar


The problem i have is installing both grub2 i386-pc and x86_64-efi . Both
have /boot/grub as $grubdir . I use /boot/grub for all grub2-bios stuff and
/boot/efi/efi/grub for all grub2-efi-x86_64 related stuff. I have not seen
any issue with having modules in UEFISYS/efi/grub dir itself. AFAIK the
modules are platform dependent since one can't use i386-pc modules in
i386-efi and vice-versa. x86_64-efi is out of question since its a
different arch. I guess for now doing

sed 's|/boot/grub|/boot/efi/efi/grub|g' -i grub-mkconfig

will do, until you implement the platform specific subdir idea you
mentioned. Thanks for clarifying this. For me this is not an issue. But I
also maintain grub2 packages in Archlinux. What should I tell the users
(those who have both grub2-bios and grub2-efi-x86_64), use
/boot/efi/efi/grub for everything or do the sed stuff for
grub-{install,mkconfig}?

sed 's|/boot/grub|/boot/grub-efi|g' -i grub-{install,mkconfig}

TIA.

Regards.

Keshav


 --
 Regards
 Vladimir 'φ-coder/phcoder' Serbinenko


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH, RFC, RFT] Mactel integration

2011-11-28 Thread Keshav P R
On Tue, Nov 29, 2011 at 12:04, Seth Goldberg seth.goldb...@oracle.comwrote:


 On Nov 28, 2011, at 2:23 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:

  On 28.11.2011 14:25, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
  Hello all. Based on the information from
 http://mjg59.dreamwidth.org/7468.html I intend to add support for such
 install. It requires a small HFS+ volume mounted at /boot/mactel. I also
 simplify handling of EFI directories by adding explicit option to specify
 it and removing some compatibility kludges (they don't make anything
 compatible with anything since old behaviour was mostly not to install at
 all) which made the code in question difficult to maintain. Patch attached
 and branch mactel pushed.
  Now attached the right patch.
  I've tested only as far as to see the appropriate directory structure
 in place. Can anybody test it on real mac?
 
 

   The only thing I'd suggest, after some more thought, is to remove
 --efi-directory and just use the install_device (the non-option arg given
 to grub-install) as the EFI directory -- this is also most-consistent with
 the usage a user might expect (IMHO).


The --efi-directory option does same thing as --root-directory option for
specifying mountpoint of UEFISYS partition. At first I thought grub-install
now allows specifying the EXACT directory where all the files aka grub.efi
, *.mod and grub.cfg should exist.

From my understanding of how grub-install works, if I specify

--efi-directory=/boot/efi --bootloader-id=grub2

grubx64.efi is installed at /boot/efi/efi/grub2/grubx64.efi ,  but the
modules are located at /boot/grub (which is $grubdir aka prefix set in
grubx64.efi/core.efi). But this again creates confusion for some users who
have to find out the actual prefix dir in case he/she wants to modify
grub.cfg and grubenv in that dir. The only way to force grub-install to
install everything in /boot/efi/efi/grub/ is to use

--efi-directory=/boot/efi --boot-directory=/boot/efi/efi
--bootloader-id=grub

Even if I use

--efi-directory=/boot/efi --boot-directory=/boot/efi/efi
--bootloader-id=grub2

I get /boot/efi/efi/grub/{core.efi,*.mod} and
/boot/efi/efi/grub2/grubx64.efi . Is there any option to specify to exact
dir (both for grub-install and grub-mkconfig and other related scripts
which use --boot-dir and --root-dir)?

I don't know whether it is okay to compare grub2 with syslinux, but
extlinux provides --install option to specify the directory where ALL
syslinux related files are present, no --root-dir , --boot-dir ,
--bootloader-id confusion. I want all files under one dir
(/boot/efi/efi/grub2, not referencing to /boot/grub or /boot/efi/efi/grub).
Thanks in advance.

Regards.

Keshav
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Add prefix option to grub-mkconfig

2011-11-22 Thread Keshav P R
On Thu, Oct 27, 2011 at 03:53, Seth Goldberg seth.goldb...@oracle.comwrote:


 Quoting Vladimir 'φ-coder/phcoder' Serbinenko, who wrote the following
 on...:

  prefix will be X. Just on runtime it will add platform to it when
 loading modules and .lst (but not locale, themes and grub.cfg)


  Sorry -- prefix is the wrong term.  It is interesting that you're going
 beyond what I thought, though; I thought you were just going to do what
 grub-mkrescue did by creating the platform subdirs and putting grub.cfg in
 there that does platform-specific stuff then sources ../grub.cfg;  I think
 that was a good approach, since you ended up with the generic entries in
 the ../grub.cfg file and platform-specific goodness in the platform dirs.



For now can you please check-in
grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch (file attached). I
can't think of any other way more simple than this. For usage like (as root)

  # GRUB_PREFIX=/boot/efi/efi/grub grub-mkconfig -o
/boot/efi/efi/grub/grub.cfg

This is definitely not the best or the long-term solution but for now this
will suffice (till the actual option to be used is decided). Thanks in
advance.

Regards.

Keshav
commit e744fe45dc0f349156d92b37349619cfbaec8f2f
Author: Keshav P R the.ridikulus@gmail.com
Date:   Tue Nov 22 14:39:54 2011 +0530

grub-mkconfig: Use outside GRUB_PREFIX if defined

diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index e317279..a229811 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -40,7 +40,9 @@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_script_check=${bindir}/`echo grub-script-check | sed ${transform}`
 
-GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed s,//*,/,g`
+if test -z ${GRUB_PREFIX}; then
+GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed s,//*,/,g`
+fi
 
 # Usage: usage
 # Print the usage.
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Add prefix option to grub-mkconfig

2011-10-26 Thread Keshav P R
Hi all,
As discussed in #grub irc, I think going the --boot-directory way as
phcoder suggested will lead to unnecessary complexity. I would prefer
directly mentioning the path to grub_prefix dir, as in case of uefi installs
the prefix dir could be anything (/efi/grub, /efi/grub2, /efi/grub_custom,
/efi/redhat, /efi/ubuntu etc.). Using --boot-directory in such a case also
requires --bootloader-id etc. to be provided.
   Proper GRUB_PREFIX is required for video.lst and locale_dir setting
in grub.cfg. The patch with --prefix option is at
http://pastie.org/2763921. Please give your views.

Regards.

Keshav
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Add prefix option to grub-mkconfig

2011-10-26 Thread Keshav P R
On Thu, Oct 27, 2011 at 02:18, Seth Goldberg seth.goldb...@oracle.comwrote:

 Hi,

  Personally, I'd love to see boot-directory go away also -- I think you
 should be able to specify the exact directory you want without worrying
 about /grub being appended.  Same goes for mkconfig.

  --S


Yes, that would be best and gives direct control to the user. For now
GRUB_PREFIX denotes that final dir (atleast in the scripts).

- Keshav



 Quoting Keshav P R, who wrote the following on Thu, 27 Oct 2011:

  Hi all,
   As discussed in #grub irc, I think going the --boot-directory way as
 phcoder suggested will lead to unnecessary complexity. I would prefer
 directly mentioning the path to grub_prefix dir, as in case of uefi
 installs
 the prefix dir could be anything (/efi/grub, /efi/grub2, /efi/grub_custom,
 /efi/redhat, /efi/ubuntu etc.). Using --boot-directory in such a case also
 requires --bootloader-id etc. to be provided.
  Proper GRUB_PREFIX is required for video.lst and locale_dir setting
 in grub.cfg. The patch with --prefix option is at
 http://pastie.org/2763921. Please give your views.

 Regards.

 Keshav


 __**_
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/**listinfo/grub-develhttps://lists.gnu.org/mailman/listinfo/grub-devel

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel