Configure grub for pxe boot and nfs-mounted root

2013-11-24 Thread Beeblebrox
Using grub-trunk. My PXE boot environment is a little different:

* FreeBSD_amd64 jail on /data/amd64, serving dhcp  tftp from jail.
NFS-related (rpcbind, nfsd, mountd) being served from host (trivial
detail). Jail IP is 192.168.2.1
* Once PXE client obtains IP, the tftp-server needs to find Grub's
grub.pxe, which will then bring up the menu defined in grub.cfg
* grub.cfg will have 3 different NFS-exported destinations as boot
choices, which have same IP as jail (nfs:/192.168.2.1:/data/*):
+ /data/amd64 for FreeBSD_amd64
+ /data/i386 for FreeBSD_i386
+ /data/tftp for various *.iso images for booting with loopback

My questions are:
1. I assume that since dhcp and tftp are being served from /data/amd64
jail, I must place the grub folder under that path in order for
tftp-server to find it. I don't see a way where tftp-server would be
able to serve-up the grub menu if it were in say /data/tftp path?
2. Do I need to run the code below, is the syntax correct, or is this
for old version:
grub-mkimage --format=i386-pc-pxe --output=grub.pxe
--prefix='(192.168.2.1)/data/amd64/boot/grub' pxe pxecmd
3. Recall that the grub folder will be residing on /data/amd64 or
/data/tftp. Waht is  the grub.cfg entry for /data/i386? Will this
work?
menuentry FreeBSD_i386 {
 set root='ip=:eth0:dhcp nfsroot=192.168.2.1:/data/i386'
 kfreebsd /boot/loader }

Thank you for any input.

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


Re: Configure grub for pxe boot and nfs-mounted root

2013-11-24 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 24.11.2013 09:14, Beeblebrox wrote:
 d version:
 grub-mkimage --format=i386-pc-pxe --output=grub.pxe
 --prefix='(192.168.2.1)/data/amd64/boot/grub' pxe pxecmd
No, use grub-mknetdir.



signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub2 boot root-on-zfs errors

2013-11-24 Thread Beeblebrox
* Is there a way to compile without docs? This does not work:
./configure --disable-werror --disable-nls --disable-docs

* I disabled the docs section manually in grub/Makefile. gmake
completed but still with warning:
/usr/bin/ld: unrecognised emulation mode: elf_x86_64
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: [efiemu64.o] Error 1 (ignored)
gmake[3]: Leaving directory `/asp/git/grub/grub-core'

* I proceeded with gmake install and previous error now causes a problem:
 /usr/bin/install -c -m 644 all_video.mod gdb.mod testspeed.mod tr.mod
progress.mod gcry_arcfour.mod gcry_blowfish.mod gcry_camellia.mod
gcry_cast5.mod gcry_crc.mod gcry_des.mod gcry_dsa.mod gcry_idea.mod
gcry_md4.mod gcry_md5.mod gcry_rfc2268.mod gcry_rijndael.mod
gcry_rmd160.mod gcry_rsa.mod gcry_seed.mod gcry_serpent.mod
gcry_sha1.mod gcry_sha256.mod gcry_sha512.mod gcry_tiger.mod
gcry_twofish.mod gcry_whirlpool.mod modinfo.sh efiemu32.o ./efiemu64.o
'/usr/local/lib/grub/i386-pc'
install: ./efiemu64.o: No such file or directory
gmake[4]: *** [install-platformDATA] Error 71
gmake[4]: Leaving directory `/asp/git/grub/grub-core'
gmake[3]: *** [install-am] Error 2
gmake[3]: Leaving directory `/asp/git/grub/grub-core'
gmake[2]: *** [install] Error 2

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


PATA module extension for ATA/RAID controller SIL680

2013-11-24 Thread CGC Bungetzianu
The controller SIL680 has the same register layout as other pata 
controllers.
Only the PCI ID of the device is different. With minimal changes it can 
be integrated.


Catalin


33,34d32
 #define GRUB_SIL680_PCIID 0x06801095

356d353
   int sil680 = 0;
369,372d365
   else if( pciid == GRUB_SIL680_PCIID)
 {
   sil680 = 1;
 }
375c368
   if (!cs5536  !sil680  (class  16 != 0x0101))
---
   if (!cs5536  (class  16 != 0x0101))
386,387d378
   else if (sil680)
 compat = 1;

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


Re: grub2 boot root-on-zfs errors

2013-11-24 Thread Andrey Borzenkov
В Sun, 24 Nov 2013 11:14:11 +0200
Beeblebrox zap...@berentweb.com пишет:

 * Is there a way to compile without docs? This does not work:
 ./configure --disable-werror --disable-nls --disable-docs
 
 * I disabled the docs section manually in grub/Makefile. gmake
 completed but still with warning:
 /usr/bin/ld: unrecognised emulation mode: elf_x86_64
 Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
 cc: error: linker command failed with exit code 1 (use -v to see invocation)
 gmake[3]: [efiemu64.o] Error 1 (ignored)
 gmake[3]: Leaving directory `/asp/git/grub/grub-core'
 
 * I proceeded with gmake install and previous error now causes a problem:
  /usr/bin/install -c -m 644 all_video.mod gdb.mod testspeed.mod tr.mod
 progress.mod gcry_arcfour.mod gcry_blowfish.mod gcry_camellia.mod
 gcry_cast5.mod gcry_crc.mod gcry_des.mod gcry_dsa.mod gcry_idea.mod
 gcry_md4.mod gcry_md5.mod gcry_rfc2268.mod gcry_rijndael.mod
 gcry_rmd160.mod gcry_rsa.mod gcry_seed.mod gcry_serpent.mod
 gcry_sha1.mod gcry_sha256.mod gcry_sha512.mod gcry_tiger.mod
 gcry_twofish.mod gcry_whirlpool.mod modinfo.sh efiemu32.o ./efiemu64.o
 '/usr/local/lib/grub/i386-pc'
 install: ./efiemu64.o: No such file or directory

As a workaround build with --disable-efiemu. You probably do not need
it anyway unless booting OS X.

 gmake[4]: *** [install-platformDATA] Error 71
 gmake[4]: Leaving directory `/asp/git/grub/grub-core'
 gmake[3]: *** [install-am] Error 2
 gmake[3]: Leaving directory `/asp/git/grub/grub-core'
 gmake[2]: *** [install] Error 2
 
 ___
 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


[PATCH] Explicitly check for linking format to use for efiemu64 module

2013-11-24 Thread Andrey Borzenkov
Similar to check for target linking format, also check for efiemu64
instead of hardcoding -melf_x86_64. This fixes compilation on *BSD
variants. We cannot easily reuse main target check because platforms
are different (main target is 32 bit and efiemu64 - 64 bit).

This commit adds EFIEMU64_LINK_FORMAT that contains detected
link option and is used in efiemu64.o linking instead of hardcoded
value.

Reported-By: Beeblebrox zap...@berentweb.com
---

Could you test this patch?

 configure.ac  | 29 +++--
 grub-core/Makefile.am |  2 +-
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8619a67..be558de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -654,6 +654,30 @@ if test x$efiemu_excuse = x ; then
  efiemu_excuse=cannot compile with -m64 -mcmodel=large -mno-red-zone 
-nostdlib
   fi
 fi
+if test x$efiemu_excuse = x ; then
+  AC_CACHE_CHECK([for efiemu64 linking format], 
[grub_cv_target_cc_efiemu64_link_format], [
+grub_cv_target_cc_efiemu64_link_format=unknown
+for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd 
-melf_x86_64_haiku -mx86_64pe -arch,x86_64; do
+  CFLAGS=-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone
+  LDFLAGS=-m64 -Wl,$format -nostdlib
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+  asm (.globl start; start:);
+  asm (.globl _start; _start:);
+  asm (.globl __start; __start:);
+  void __main (void);
+  void __main (void) {}
+  ]], [[]])], [flag=1], [flag=0])
+  if test x$flag = x1; then
+grub_cv_target_cc_efiemu64_link_format=$format
+   break;
+  fi
+done])
+  if test x$grub_cv_target_cc_efiemu64_link_format = xunknown; then
+efiemu_excuse=no suitable link format for efiemu64 found
+  else
+EFIEMU64_LINK_FORMAT=-Wl,$grub_cv_target_cc_efiemu64_link_format
+  fi
+fi
 if test x$enable_efiemu = xyes  test x$efiemu_excuse != x ; then
   AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
 fi
@@ -663,11 +687,12 @@ else
 enable_efiemu=no
 fi
 AC_SUBST([enable_efiemu])
+AC_SUBST([EFIEMU64_LINK_FORMAT])
 
 CFLAGS=$TARGET_CFLAGS
 
 if test x$target_cpu = xi386 || test x$target_cpu = xx86_64; then
-  AC_CACHE_CHECK([for linking format], [grub_cv_target_cc_link_format], [
+  AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], 
[
 grub_cv_target_cc_link_format=unknown
 for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd 
-melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -m${target_cpu}pe 
-arch,${target_cpu}; do
   if test x${target_cpu} != xi386  test x$format = x${target_cpu}pe; then
@@ -681,7 +706,7 @@ if test x$target_cpu = xi386 || test x$target_cpu = 
xx86_64; then
   asm (.globl __start; __start:);
   void __main (void);
   void __main (void) {}
-  ]], [[]])], [flag=1], [])
+  ]], [[]])], [flag=1], [flag=0])
   if test x$flag = x1; then
 grub_cv_target_cc_link_format=$format
break;
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index e2da083..e6862b7 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -421,7 +421,7 @@ efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF)
  $(TARGET_OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \
  rm -f $@.bin; \
else \
- $(TARGET_CC) -m64 -Wl,-melf_x86_64 -nostdlib -Wl,-r -o $@ $^ || exit 
1; \
+ $(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -Wl,-r -o $@ $^ 
|| exit 1; \
  if test ! -z $(TARGET_OBJ2ELF); then $(TARGET_OBJ2ELF) $@ || (rm -f 
$@; exit 1); fi; \
fi
 
-- 
1.8.1.4


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


Re: PATA module extension for ATA/RAID controller SIL680

2013-11-24 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 24.11.2013 15:14, CGC Bungetzianu wrote:
 The controller SIL680 has the same register layout as other pata
 controllers.
 Only the PCI ID of the device is different. With minimal changes it can
 be integrated.
 
Can you paste lspci -vvvnnxxx ? Usually using hardcoded adresses for PCI
devices is wrong.
 Catalin
 
 
 33,34d32
  #define GRUB_SIL680_PCIID 0x06801095
 
 356d353
int sil680 = 0;
 369,372d365
else if( pciid == GRUB_SIL680_PCIID)
  {
sil680 = 1;
  }
 375c368
if (!cs5536  !sil680  (class  16 != 0x0101))
 ---
   if (!cs5536  (class  16 != 0x0101))
 386,387d378
else if (sil680)
  compat = 1;
 
 
 
 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 https://lists.gnu.org/mailman/listinfo/grub-devel
 




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Explicitly check for linking format to use for efiemu64 module

2013-11-24 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 24.11.2013 18:21, Andrey Borzenkov wrote:
 +for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd 
 -melf_x86_64_haiku -mx86_64pe -arch,x86_64; do
Remove x86_64pe. We skip it in first check as well since we have no
converter for 64-bit windows binaries and the format is name i386pep,
not x86_64pe
 +  CFLAGS=-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone
 +  LDFLAGS=-m64 -Wl,$format -nostdlib
It should be -nostdlib -static. (see my other thread)



signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Explicitly check for linking format to use for efiemu64 module

2013-11-24 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 24.11.2013 18:21, Andrey Borzenkov wrote:
 Similar to check for target linking format, also check for efiemu64
 instead of hardcoding -melf_x86_64. This fixes compilation on *BSD
 variants. We cannot easily reuse main target check because platforms
 are different (main target is 32 bit and efiemu64 - 64 bit).
 
 This commit adds EFIEMU64_LINK_FORMAT that contains detected
 link option and is used in efiemu64.o linking instead of hardcoded
 value.
 
 Reported-By: Beeblebrox zap...@berentweb.com
 ---
 
 Could you test this patch?
 
  configure.ac  | 29 +++--
  grub-core/Makefile.am |  2 +-
  2 files changed, 28 insertions(+), 3 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index 8619a67..be558de 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -654,6 +654,30 @@ if test x$efiemu_excuse = x ; then
   efiemu_excuse=cannot compile with -m64 -mcmodel=large -mno-red-zone 
 -nostdlib
fi
  fi
 +if test x$efiemu_excuse = x ; then
 +  AC_CACHE_CHECK([for efiemu64 linking format], 
 [grub_cv_target_cc_efiemu64_link_format], [
 +grub_cv_target_cc_efiemu64_link_format=unknown
 +for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd 
 -melf_x86_64_haiku -mx86_64pe -arch,x86_64; do
As in other mail: remove -mx86_64pe
 +  CFLAGS=-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone
 +  LDFLAGS=-m64 -Wl,$format -nostdlib
You need -static as otherwise on Apple systems it will try to pull in
the dynamic linker which we don't want (scratch comment about other
thread, I though of adding -static everywhere but it's no necessarry
after all)
 +  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 +  asm (.globl start; start:);
 +  asm (.globl _start; _start:);
 +  asm (.globl __start; __start:);
 +  void __main (void);
 +  void __main (void) {}
 +  ]], [[]])], [flag=1], [flag=0])
 +  if test x$flag = x1; then
 +grub_cv_target_cc_efiemu64_link_format=$format
 + break;
 +  fi
 +done])
 +  if test x$grub_cv_target_cc_efiemu64_link_format = xunknown; then
 +efiemu_excuse=no suitable link format for efiemu64 found
 +  else
 +EFIEMU64_LINK_FORMAT=-Wl,$grub_cv_target_cc_efiemu64_link_format
 +  fi
 +fi
  if test x$enable_efiemu = xyes  test x$efiemu_excuse != x ; then
AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be 
 compiled])
  fi
 @@ -663,11 +687,12 @@ else
  enable_efiemu=no
  fi
  AC_SUBST([enable_efiemu])
 +AC_SUBST([EFIEMU64_LINK_FORMAT])
  
  CFLAGS=$TARGET_CFLAGS
  
  if test x$target_cpu = xi386 || test x$target_cpu = xx86_64; then
 -  AC_CACHE_CHECK([for linking format], [grub_cv_target_cc_link_format], [
 +  AC_CACHE_CHECK([for target linking format], 
 [grub_cv_target_cc_link_format], [
  grub_cv_target_cc_link_format=unknown
  for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd 
 -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -m${target_cpu}pe 
 -arch,${target_cpu}; do
if test x${target_cpu} != xi386  test x$format = x${target_cpu}pe; 
 then
 @@ -681,7 +706,7 @@ if test x$target_cpu = xi386 || test x$target_cpu = 
 xx86_64; then
asm (.globl __start; __start:);
void __main (void);
void __main (void) {}
 -  ]], [[]])], [flag=1], [])
 +  ]], [[]])], [flag=1], [flag=0])
if test x$flag = x1; then
  grub_cv_target_cc_link_format=$format
   break;
 diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
 index e2da083..e6862b7 100644
 --- a/grub-core/Makefile.am
 +++ b/grub-core/Makefile.am
 @@ -421,7 +421,7 @@ efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF)
 $(TARGET_OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \
 rm -f $@.bin; \
Here the check for apple linker has to be adjusted as
x$(EFIEMU64_LINK_FORMAT) = x-arch,x86_64
   else \
 -   $(TARGET_CC) -m64 -Wl,-melf_x86_64 -nostdlib -Wl,-r -o $@ $^ || exit 
 1; \
 +   $(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -Wl,-r -o $@ $^ 
 || exit 1; \
 if test ! -z $(TARGET_OBJ2ELF); then $(TARGET_OBJ2ELF) $@ || (rm -f 
 $@; exit 1); fi; \
Remove TARGET_OBJ2ELF part as it's for 32-bit and we don't use PE here.
   fi
  
 




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel