Hi Adrian,
On 1/6/19 21:43, Frank Scheiner wrote:
On 1/6/19 21:40, John Paul Adrian Glaubitz wrote:
On 1/6/19 9:35 PM, Frank Scheiner wrote:
If an ELF
version of GRUB can be provided by someone, I have a lot of sparc64
gear to test on - though not as many as OpenBSD supports ;-).
I do actually. I have built a version of GRUB for sparc64 with the COFF
linker options stripped off. Feel free to try the packages from [1].
If we actually don't ned COFF even on older SPARC boxes, that would be
great.
I tried to test these packages, but the created core.img (for netboot
though) is still a COFF binary IIUIC:
```
root@e250-5:~# grub-mknetdir -v
[...]
grub-mknetdir: info: copying `/usr/share/grub/unicode.pf2' ->
`/srv/tftp/boot/grub/fonts/unicode.pf2'.
grub-mknetdir: info: grub-mkimage --directory
'/usr/lib/grub/sparc64-ieee1275' --prefix '/boot/grub' --output
'/srv/tftp/boot/grub/sparc64-ieee1275/core.img' --format
'sparc64-ieee1275-aout' --compression 'auto' 'tftp' 'ofnet'
.
grub-mknetdir: info: the total module size is 0x2ba48.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/kernel.img.
grub-mknetdir: info: locating the section .text at 0x0.
grub-mknetdir: info: locating the section .rodata at 0x106b0.
grub-mknetdir: info: locating the section .data at 0x13618.
grub-mknetdir: info: locating the section .module_license at 0x14bb8.
grub-mknetdir: info: locating the section .bss at 0x14bd8.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/bufio.mod.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/datetime.mod.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/boot.mod.
grub-mknetdir: info: reading
/usr/lib/grub/sparc64-ieee1275/priority_queue.mod.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/net.mod.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/tftp.mod.
grub-mknetdir: info: reading /usr/lib/grub/sparc64-ieee1275/ofnet.mod.
grub-mknetdir: info: kernel_img=0xfffff8010005c010, kernel_size=0x14bd8.
grub-mknetdir: info: the core size is 0x40620.
grub-mknetdir: info: writing 0x40640 bytes.
Netboot directory for sparc64-ieee1275 created. Configure your DHCP
server to point to /srv/tftp/boot/grub/sparc64-ieee1275/core.img
```
Checking the man page of `grub-mkimage` the available formats for
sparc64 are (1) "sparc64-ieee1275-raw", (2) "sparc64-ieee1275-cdcore"
and (3) "sparc64-ieee1275-aout". Using format 1 and 2 creates a file
that is identified by `file` as "data". The one from the `mknetdir` run
above is of type "SPARC executable". The "underlying" binary is ELF though:
```
root@e250-5:~# file /usr/lib/grub/sparc64-ieee1275/kernel.img
/usr/lib/grub/sparc64-ieee1275/kernel.img: ELF 64-bit MSB executable,
SPARC V9, relaxed memory ordering, version 1 (SYSV), statically linked,
stripped
```
I can of course create an on-disk installation and try to use this image
instead as "core.img", but I think this is not enough and needs at least
the module to access the bootstrap partition added in some way.
I assume we need to create a new format named "sparc64-ieee1275-elf" in
e.g. `grub-mkimage` ([1]) and possibly other places, though I don't know
what configuration is needed for formats in the struct "image_targets".
The above three formats only differ in the used "id", hence I think the
actual format is defined somewhere else.
[1]: https://salsa.debian.org/grub-team/grub/blob/master/util/mkimage.c
What do you think?
Cheers,
Frank