Discussion:
grub2 with SPARC support available for testing
John Paul Adrian Glaubitz
2017-01-22 23:40:34 UTC
Permalink
Hi!

I just uploaded grub2_2.02~beta3-3+sparc64 to Debian "unreleased" which
contains an additional set of 15 patches by Eric Snowberg (CC'ed) which
improve SPARC in grub2 and add support for modern SPARC hardware through
the SPARC T7.

According to Eric, grub2 should work on SPARC machines from T1 through
T7, apparently older sun4u machines are not 100% supported but might
work as well. If I remember correctly, he said that adding support for
older sun4u hardware is possible in the future.

In any case, it would be great if this package could be tested by as
many users as possible. Please report your results back to the list,
Eric will be very interested to hear any feedback. The more testing we get,
the more likely we find additional bugs and also can get the patches
hopefully merged upstream.

As the packages were just uploaded to "unreleased", it might take a few
hours until the packages show up in the archive. In any case, make sure
the version number contains the "+sparc64" suffix. To use "unreleased",
you need to have the following line in your /etc/apt/sources.list:

deb http://ftp.ports.debian.org/debian-ports/ unreleased main

Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2017-01-23 10:12:29 UTC
Permalink
Hello!

A quick follow up since several people seem to have not read the
instructions carefully enough.

1) You have to use the version with the "+sparc64" suffix in the
version number available from the "unreleased" repository.

*This* is the correct version:

***@deb4g:~# apt-cache policy grub2
grub2:
Installed: (none)
Candidate: 2.02~beta3-3+sparc64
Version table:
2.02~beta3-3+sparc64 500
500 http://ftp.ports.debian.org/debian-ports unreleased/main sparc64 Packages
***@deb4g:~#

The standard grub2 package from "unstable" does *not* include
Eric's patches.

2) Please send any reports to *this* mailing list. Please do *not*
send me any private mail. These issues are supposed to be discussed
on the list and in public so others can see the discussion as well,
including upstream developers.

Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2017-02-08 13:23:09 UTC
Permalink
Hi!
Post by John Paul Adrian Glaubitz
I just uploaded grub2_2.02~beta3-3+sparc64 to Debian "unreleased" which
contains an additional set of 15 patches by Eric Snowberg (CC'ed) which
improve SPARC in grub2 and add support for modern SPARC hardware through
the SPARC T7.
I uploaded grub2_2.02~beta3-4+sparc64.1 to "unreleased" today which is
based on Eric's latest sparc-next-v2 branch [1]. This new version fixes
the build problems on non-sparc* targets. I'm not sure if it addresses
other issues, but Eric can maybe comment on this.

Thanks,
Adrian
Post by John Paul Adrian Glaubitz
[1] https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Eric Snowberg
2017-02-09 18:44:35 UTC
Permalink
Post by John Paul Adrian Glaubitz
Hi!
Post by John Paul Adrian Glaubitz
I just uploaded grub2_2.02~beta3-3+sparc64 to Debian "unreleased" which
contains an additional set of 15 patches by Eric Snowberg (CC'ed) which
improve SPARC in grub2 and add support for modern SPARC hardware through
the SPARC T7.
I uploaded grub2_2.02~beta3-4+sparc64.1 to "unreleased" today which is
based on Eric's latest sparc-next-v2 branch [1]. This new version fixes
the build problems on non-sparc* targets. I'm not sure if it addresses
other issues, but Eric can maybe comment on this.
I put together a wiki to help document the installation process:

https://github.com/esnowberg/grub2-sparc/wiki
Anatoly Pugachev
2017-02-24 16:49:00 UTC
Permalink
Post by Eric Snowberg
https://github.com/esnowberg/grub2-sparc/wiki
Eric,

I tried this on 2 my testing LDOMs, one with sun disk/partition table,
and another one with gpt disk/partition table.
As well on an older sun4u v215 physical machine (sun disks/partition table).

Can you please suggest how do I install with gpt disk? Details is below.


Ldom with sun disk had no problems with installing by wiki guide, and
booted with grub ok:

# apt search grub2
grub2/unreleased,now 2.02~beta3-5+sparc64 sparc64 [installed]
GRand Unified Bootloader, version 2 (dummy package)


# parted /dev/vdiska p
Model: Unknown (unknown)
Disk /dev/vdiska: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: sun
Disk Flags:

Number Start End Size File system Flags
1 0.00B 296MB 296MB ext3 boot
2 296MB 10.3GB 10.0GB ext4
4 10.3GB 10.7GB 436MB btrfs


# cat /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="ro zswap.enabled=1 noresume"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_LINUX_UUID=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_DISABLE_RECOVERY="true"
GRUB_PRELOAD_MODULES="iso9660"

# mkdir /boot/grub

# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-06476-gbc49a7831b11
Found initrd image: /boot/initrd.img-4.10.0-06476-gbc49a7831b11
Found linux image: /boot/vmlinuz-4.9.0-2-sparc64-smp
Found initrd image: /boot/initrd.img-4.9.0-2-sparc64-smp
done

# grub-install --force --skip-fs-probe /dev/vdiska1
Installing for sparc64-ieee1275 platform.
grub-install: warning: Discarding improperly nested partition
(hostdisk//dev/vdiska,sun1,sun2).
grub-install: warning: Discarding improperly nested partition
(hostdisk//dev/vdiska,sun1,sun4).
grub-install: warning: Attempting to install GRUB to a disk with
multiple partition labels. This is not supported yet..
grub-install: warning: Embedding is not possible. GRUB can only be
installed in this setup by using blocklists. However, blocklists are
UNRELIABLE and their use is discouraged..
Installation finished. No error reported.

# reboot


[3015439.460830] reboot: Restarting system
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.

SPARC T5-2, No Keyboard
Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.38.5, 32.0000 GB memory available, Serial #83494642.
Ethernet address 0:14:4f:fa:6:f2, Host ID: 84fa06f2.



Boot device: vdisk1 File and args:
WARNING: Unsupported bootblk image, can not extract fcode

WARNING: Bootblk fcode extraction failed
GRUB Loading kernel....


GNU GRUB version 2.02~beta3-5+sparc64

+----------------------------------------------------------------------------+
| Debian GNU/Linux |
|*Advanced options for Debian GNU/Linux |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----------------------------------------------------------------------------+

Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line.




Another one I have with gpt disk , I was unable to install grub boot block:

***@deb4g:/# parted /dev/vdiska p
Model: Unknown (unknown)
Disk /dev/vdiska: 161GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 1000MB 999MB ext3 boot, esp
2 1001MB 161GB 160GB ext4 2


***@deb4g:/# grub-install /dev/vdiska
Installing for sparc64-ieee1275 platform.
grub-install: warning: this GPT partition label contains no BIOS Boot
Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible. GRUB can only be
installed in this setup by using blocklists. However, blocklists are
UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

I would not suggest to use --force with gpt disk, since it would
destroy partition table on vdiska (and there would be still silo
bootblock), so i had to recover/restore it with parted.

Thanks.



PS: v215 physical machine test, same setup as described earlier in
this email for sun disks, install grub and reboot:

[255887.048586] reboot: Restarting system

SC Alert: Host System has Reset
Probing system devices
Probing memory
Probing I/O buses
screen not found.
keyboard not found.
Keyboard not present. Using ttya for input and output.
Probing system devices
Probing memory
Probing I/O buses


Sun Fire V215, No Keyboard
Copyright 2007 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.22.33, 4096 MB memory installed, Serial #78421684.
Ethernet address 0:14:4f:ac:9e:b4, Host ID: 84ac9eb4.



Rebooting with command: boot
Boot device: disk0 File and args:
GRUB Loading kernel....
screen not found.


GNU GRUB version 2.02~beta3-5+sparc64

+----------------------------------------------------------------------------+
|*Debian GNU/Linux |
| Advanced options for Debian GNU/Linux |
| Debian GNU/Linux 7 (wheezy) (on /dev/mapper/v215-root) |
| Advanced options for Debian GNU/Linux 7 (wheezy) (on /dev/mapper/v215-root>|
| |
| |
| |
| |
| |
| |
| |
| |
+----------------------------------------------------------------------------+

Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line.

Loading Linux 4.9.0-2-sparc64-smp ...
Loading initial ramdisk ...

[ 0.000000] PROMLIB: Sun IEEE Boot Prom 'OBP 4.22.33 2007/06/18 12:47'
[ 0.000000] PROMLIB: Root node compatible:
[ 0.000000] Linux version 4.9.0-2-sparc64-smp
(debian-***@lists.debian.org) (gcc version 6.3.0 20170205 (Debian
6.3.0-6) ) #1 SMP Debian 4.9.10-1 (2017-02-17)
[ 0.000000] bootconsole [earlyprom0] enabled
[ 0.000000] ARCH: SUN4U

it does work, but there's some noticeable delay in between "screen not
found" message and showing menu entries, so on my first thought I was
thinking when I would be able to connect debian installer cdrom to it
again ...

I believe we could probably just leave older machines with silo
bootloader. But grub does work anyway, i.e. machine loaded kernel and
works.
Anatoly Pugachev
2017-11-08 10:24:18 UTC
Permalink
Post by Eric Snowberg
Post by John Paul Adrian Glaubitz
Post by John Paul Adrian Glaubitz
I just uploaded grub2_2.02~beta3-3+sparc64 to Debian "unreleased" which
contains an additional set of 15 patches by Eric Snowberg (CC'ed) which
improve SPARC in grub2 and add support for modern SPARC hardware through
the SPARC T7.
I uploaded grub2_2.02~beta3-4+sparc64.1 to "unreleased" today which is
based on Eric's latest sparc-next-v2 branch [1]. This new version fixes
the build problems on non-sparc* targets. I'm not sure if it addresses
other issues, but Eric can maybe comment on this.
https://github.com/esnowberg/grub2-sparc/wiki
JFYI

Installed another LDOM yesterday, ports have 2.02-2+sparc64.1 version
of grub2 package. Used it to install grub (still on sun partition
table disk), was unable to boot with error message:

# grub-install --skip-fs-probe --force /dev/vdiska
...
# reboot

{0} ok boot disk
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.

SPARC T5-2, No Keyboard
Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.38.8, 16.0000 GB memory available, Serial #83424764.
Ethernet address 0:14:4f:f9:c:36, Host ID: 84f8f5fc.



Boot device: /virtual-***@100/channel-***@200/***@0 File and args:
WARNING: Unsupported bootblk image, can not extract fcode

WARNING: Bootblk fcode extraction failed
GRUB Loading kernel....

ERROR: Last Trap: Fast Data Access MMU Miss

booted from cdrom into rescue, downloaded old version of grub2 package
from [1] and installed grub with grub-install. After which I was able
to reboot to OS.

1. http://snapshot.debian.org/archive/debian-ports/20170401T004207Z/pool-sparc64/main/g/grub2/
John Paul Adrian Glaubitz
2017-11-08 10:26:14 UTC
Permalink
Post by Anatoly Pugachev
WARNING: Bootblk fcode extraction failed
GRUB Loading kernel....
ERROR: Last Trap: Fast Data Access MMU Miss
Yes, this is a known issue. It's possible I made a mistake when
applying Eric's patches to the grub2 package for sparc64.

We have discussed that on the list, if I remember correctly.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2017-12-07 16:43:01 UTC
Permalink
On 11/08/2017 11:24 AM, Anatoly Pugachev wrote:> ERROR: Last Trap: Fast Data Access MMU Miss
Post by Anatoly Pugachev
booted from cdrom into rescue, downloaded old version of grub2 package
from [1] and installed grub with grub-install. After which I was able
to reboot to OS.
This is fixed by adding "export TARGET_CCASFLAGS := -fno-PIE" to debian/rules.

See also: https://github.com/esnowberg/grub2-sparc/issues/8

Many thanks to James Clarke and his master skills debugging this issue!

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
waz0wski
2017-02-11 15:22:24 UTC
Permalink
I tested grub2_2.02~beta3-4+sparc64.1 via the 2016-05-04 install media on t5220[1] hardware as well as in an ldom[2] and had no issues with the installation or subsequent boot via grub

[1] https://distortion.io/p/19 <https://distortion.io/p/19>
[2] https://distortion.io/p/20 <https://distortion.io/p/20>

Based on the discussion in #sparc about T5240 grub2 memory errors/memory-region issues, let me know if you want me to try an 'invalid' memory config on the T5220, or do any more debugging. I've also got a T5440 which can also be used for debugging various memory configurations if needed -- I just need to find sufficient electricity for it first.
Post by John Paul Adrian Glaubitz
Hi!
Post by John Paul Adrian Glaubitz
I just uploaded grub2_2.02~beta3-3+sparc64 to Debian "unreleased" which
contains an additional set of 15 patches by Eric Snowberg (CC'ed) which
improve SPARC in grub2 and add support for modern SPARC hardware through
the SPARC T7.
I uploaded grub2_2.02~beta3-4+sparc64.1 to "unreleased" today which is
based on Eric's latest sparc-next-v2 branch [1]. This new version fixes
the build problems on non-sparc* targets. I'm not sure if it addresses
other issues, but Eric can maybe comment on this.
Thanks,
Adrian
Post by John Paul Adrian Glaubitz
[1] https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2
--
.''`. John Paul Adrian Glaubitz
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Continue reading on narkive:
Loading...