All of lore.kernel.org
 help / color / mirror / Atom feed
* How to test the git clone without "make install" ?
@ 2024-06-14 14:16 Thomas Schmitt via Grub-devel
  2024-06-14 15:17 ` Maximilian Stendler
  2024-06-14 15:22 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Schmitt via Grub-devel @ 2024-06-14 14:16 UTC (permalink / raw)
  To: grub-devel; +Cc: Thomas Schmitt

Hi,

on occasion of
  https://savannah.gnu.org/bugs/index.php?65880
  "heap-buffer-overflow in grub-mkrescue.c"
i try to get grub-mkrescue running from git.

My problem is that grub_util_get_pkglibdir() returns
  /usr/local/lib/grub
and grub_util_get_pkgdatadir() returns
  /usr/local/share/grub
which of course do not come with a Debian installation.
So grub-mkrescue produces only a very small ISO with no boot lures or
boot programs. Quite unrealistic for testing.

I was able to overcome this obstacle by
  ln -s /usr/lib/grub /usr/local/lib/grub
  ln -s /usr/share/grub /usr/local/share/grub
but i understand that now my grub-mkrescue actually copies the ISO content
from the Debian installation and not from the git clone.

The manual
  https://www.gnu.org/software/grub/manual/grub-dev/grub-dev.html
does not give me a clue how i would get the /usr/local/*/grub
directories populated with the files made from the git clone.
I guess "make install" would do it for me, but i fear that this does
too many other things to the GRUB installation of my vanilla Debian.
In general i would prefer to keep the git files away from any system
directory.

So what can i do to make the files built from git available to
./grub-mkrescue built from git, without frankensteining my Debian 12 ?


Have a nice day :)

Thomas


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

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

* Re: How to test the git clone without "make install" ?
  2024-06-14 14:16 How to test the git clone without "make install" ? Thomas Schmitt via Grub-devel
@ 2024-06-14 15:17 ` Maximilian Stendler
  2024-06-14 15:22 ` Vladimir 'phcoder' Serbinenko
  1 sibling, 0 replies; 6+ messages in thread
From: Maximilian Stendler @ 2024-06-14 15:17 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Thomas Schmitt

Hi Thomas,

to keep the host installation clean, I would probably use a container.
So if you are familiar with Podman or Docker, take a look at this:
https://github.com/stendler/grub-fde/blob/main/Containerfile

You could then use a volume mount for any input files from your host and
to retrieve the output files.

Hope this helps in your case, otherwise someone more knowledgeable than
me could chime in. :)

Cheers
Max


On 2024-06-14 16:16, Thomas Schmitt via Grub-devel wrote:
> Hi,
> 
> on occasion of
>   https://savannah.gnu.org/bugs/index.php?65880
>   "heap-buffer-overflow in grub-mkrescue.c"
> i try to get grub-mkrescue running from git.
> 
> My problem is that grub_util_get_pkglibdir() returns
>   /usr/local/lib/grub
> and grub_util_get_pkgdatadir() returns
>   /usr/local/share/grub
> which of course do not come with a Debian installation.
> So grub-mkrescue produces only a very small ISO with no boot lures or
> boot programs. Quite unrealistic for testing.
> 
> I was able to overcome this obstacle by
>   ln -s /usr/lib/grub /usr/local/lib/grub
>   ln -s /usr/share/grub /usr/local/share/grub
> but i understand that now my grub-mkrescue actually copies the ISO content
> from the Debian installation and not from the git clone.
> 
> The manual
>   https://www.gnu.org/software/grub/manual/grub-dev/grub-dev.html
> does not give me a clue how i would get the /usr/local/*/grub
> directories populated with the files made from the git clone.
> I guess "make install" would do it for me, but i fear that this does
> too many other things to the GRUB installation of my vanilla Debian.
> In general i would prefer to keep the git files away from any system
> directory.
> 
> So what can i do to make the files built from git available to
> ./grub-mkrescue built from git, without frankensteining my Debian 12 ?
> 
> 
> Have a nice day :)
> 
> Thomas
> 
> 
> _______________________________________________
> 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

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

* Re: How to test the git clone without "make install" ?
  2024-06-14 14:16 How to test the git clone without "make install" ? Thomas Schmitt via Grub-devel
  2024-06-14 15:17 ` Maximilian Stendler
@ 2024-06-14 15:22 ` Vladimir 'phcoder' Serbinenko
  2024-06-14 17:27   ` [Solved] " Thomas Schmitt via Grub-devel
  1 sibling, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2024-06-14 15:22 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 1713 bytes --]

Set pkgdatadir environment variable

Le ven. 14 juin 2024, 16:17, Thomas Schmitt via Grub-devel <
grub-devel@gnu.org> a écrit :

> Hi,
>
> on occasion of
>   https://savannah.gnu.org/bugs/index.php?65880
>   "heap-buffer-overflow in grub-mkrescue.c"
> i try to get grub-mkrescue running from git.
>
> My problem is that grub_util_get_pkglibdir() returns
>   /usr/local/lib/grub
> and grub_util_get_pkgdatadir() returns
>   /usr/local/share/grub
> which of course do not come with a Debian installation.
> So grub-mkrescue produces only a very small ISO with no boot lures or
> boot programs. Quite unrealistic for testing.
>
> I was able to overcome this obstacle by
>   ln -s /usr/lib/grub /usr/local/lib/grub
>   ln -s /usr/share/grub /usr/local/share/grub
> but i understand that now my grub-mkrescue actually copies the ISO content
> from the Debian installation and not from the git clone.
>
> The manual
>   https://www.gnu.org/software/grub/manual/grub-dev/grub-dev.html
> does not give me a clue how i would get the /usr/local/*/grub
> directories populated with the files made from the git clone.
> I guess "make install" would do it for me, but i fear that this does
> too many other things to the GRUB installation of my vanilla Debian.
> In general i would prefer to keep the git files away from any system
> directory.
>
> So what can i do to make the files built from git available to
> ./grub-mkrescue built from git, without frankensteining my Debian 12 ?
>
>
> Have a nice day :)
>
> Thomas
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #1.2: Type: text/html, Size: 2552 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

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

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

* [Solved] Re: How to test the git clone without "make install" ?
  2024-06-14 15:22 ` Vladimir 'phcoder' Serbinenko
@ 2024-06-14 17:27   ` Thomas Schmitt via Grub-devel
  2024-06-14 17:29     ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Schmitt via Grub-devel @ 2024-06-14 17:27 UTC (permalink / raw)
  To: grub-devel; +Cc: Thomas Schmitt

Hi,

Maximilian Stendler wrote:
> to keep the host installation clean, I would probably use a container.

Yes, a virtual machine came to my mind. Easy to clone and to dispose.
But there must be some better way to test a utility built from git
independenly of systemwide directories.


Vladimir 'phcoder' Serbinenko wrote:
> Set pkgdatadir environment variable

Ahum ...
  rm /usr/local/share/grub
  pkgdatadir=. ./grub-mkrescue -o /dvdbuffer/test.iso
yields indeed an ISO with EFI boot equipment.

But what to do about /usr/local/lib/grub ?
I found option -d meanwhile. After some forth and back i came to


  pkgdatadir=. ./grub-mkrescue -o /dvdbuffer/test.iso -d ./grub-core


which to my surprise creates an ISO with boot equipment for legacy BIOS:

  $ xorriso -indev /dvdbuffer/test.iso -report_el_torito plain -report_system_area plain
  ...
  El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
  El Torito boot img :   1  BIOS  y   none  0x0000  0x00      4        1397
  El Torito img path :   1  /boot/grub/i386-pc/eltorito.img
  El Torito img opts :   1  boot-info-table grub2-boot-info
  ...
  System area summary: MBR protective-msdos-label grub2-mbr cyl-align-off
  ...
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x80  0xcd            1        13783

While i used the Debian system directories it was EFI:

  El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
  El Torito boot img :   1  UEFI  y   none  0x0000  0x00   5760          52
  El Torito img path :   1  /efi.img
  ...
  System area summary: MBR protective-msdos-label cyl-align-off GPT APM
  ...
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x00  0xee            1        18015
  ... and a GPT and an Apple Partition Map for HFS+ ...


So i will start a new thread with the question:
  How do i convince the git clone to produce programs and ISO for 64 bit
  EFI.


Have a nice day :)

Thomas


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

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

* Re: [Solved] Re: How to test the git clone without "make install" ?
  2024-06-14 17:27   ` [Solved] " Thomas Schmitt via Grub-devel
@ 2024-06-14 17:29     ` Vladimir 'phcoder' Serbinenko
  2024-06-14 18:12       ` Thomas Schmitt via Grub-devel
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2024-06-14 17:29 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 2497 bytes --]

Le ven. 14 juin 2024, 19:27, Thomas Schmitt via Grub-devel <
grub-devel@gnu.org> a écrit :

> Hi,
>
> Maximilian Stendler wrote:
> > to keep the host installation clean, I would probably use a container.
>
> Yes, a virtual machine came to my mind. Easy to clone and to dispose.
> But there must be some better way to test a utility built from git
> independenly of systemwide directories.
>
>
> Vladimir 'phcoder' Serbinenko wrote:
> > Set pkgdatadir environment variable
>
> Ahum ...
>   rm /usr/local/share/grub
>   pkgdatadir=. ./grub-mkrescue -o /dvdbuffer/test.iso
> yields indeed an ISO with EFI boot equipment.
>
> But what to do about /usr/local/lib/grub ?
> I found option -d meanwhile. After some forth and back i came to
>
>
>   pkgdatadir=. ./grub-mkrescue -o /dvdbuffer/test.iso -d ./grub-core
>
>
> which to my surprise creates an ISO with boot equipment for legacy BIOS:
>
>   $ xorriso -indev /dvdbuffer/test.iso -report_el_torito plain
> -report_system_area plain
>   ...
>   El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
>   El Torito boot img :   1  BIOS  y   none  0x0000  0x00      4        1397
>   El Torito img path :   1  /boot/grub/i386-pc/eltorito.img
>   El Torito img opts :   1  boot-info-table grub2-boot-info
>   ...
>   System area summary: MBR protective-msdos-label grub2-mbr cyl-align-off
>   ...
>   MBR partition table:   N Status  Type        Start       Blocks
>   MBR partition      :   1   0x80  0xcd            1        13783
>
> While i used the Debian system directories it was EFI:
>
>   El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
>   El Torito boot img :   1  UEFI  y   none  0x0000  0x00   5760          52
>   El Torito img path :   1  /efi.img
>   ...
>   System area summary: MBR protective-msdos-label cyl-align-off GPT APM
>   ...
>   MBR partition table:   N Status  Type        Start       Blocks
>   MBR partition      :   1   0x00  0xee            1        18015
>   ... and a GPT and an Apple Partition Map for HFS+ ...
>
>
> So i will start a new thread with the question:
>   How do i convince the git clone to produce programs and ISO for 64 bit
>   EFI.
>

./configure --with-platform=efi --target=x86_64

>
>
>
> Have a nice day :)
>
> Thomas
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #1.2: Type: text/html, Size: 3475 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

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

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

* [Solved] Re: How to test the git clone without "make install" ?
  2024-06-14 17:29     ` Vladimir 'phcoder' Serbinenko
@ 2024-06-14 18:12       ` Thomas Schmitt via Grub-devel
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Schmitt via Grub-devel @ 2024-06-14 18:12 UTC (permalink / raw)
  To: grub-devel; +Cc: Thomas Schmitt

Hi,

i wrote:
> > So i will start a new thread with the question:
> > How do i convince the git clone to produce programs and ISO for 64 bit
> > EFI.

Vladimir 'phcoder' Serbinenko wrote:
> ./configure --with-platform=efi --target=x86_64

Fast and concise as ever. :))
Thanks, Vladimir.


It works if i do beforehand
  make clean

Without "make clean" i get from the subsequent "make":

  symlist.h:30:10: fatal error: ../include/grub/machine/pxe.h: No such file or directory
     30 | #include <../include/grub/machine/pxe.h>

Trying to revoke the change by
  ./configure && make
yields:

  symlist.c: In function ‘grub_register_exported_symbols’:
  symlist.c:66:31: error: ‘grub_acpi_find_fadt’ undeclared (first use in this function)
     66 |       {"grub_acpi_find_fadt", grub_acpi_find_fadt, 1},

-----------------------------------------------------------------------

Well, now that i know the magic words, i find them in the manual under
"8 Porting".
Possibly it would be worthwhile to put some of this into a new chapter
  "1.1 Building from the git clone"
together with a warning about re-configuring without clean-making.


Have a nice day :)

Thomas


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

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

end of thread, other threads:[~2024-06-14 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-14 14:16 How to test the git clone without "make install" ? Thomas Schmitt via Grub-devel
2024-06-14 15:17 ` Maximilian Stendler
2024-06-14 15:22 ` Vladimir 'phcoder' Serbinenko
2024-06-14 17:27   ` [Solved] " Thomas Schmitt via Grub-devel
2024-06-14 17:29     ` Vladimir 'phcoder' Serbinenko
2024-06-14 18:12       ` Thomas Schmitt via Grub-devel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.