kth5 / archpower

Unofficial Archlinux port to powerpc64le, powerpc64, powerpc and riscv64
https://archlinuxpower.org
82 stars 5 forks source link

Kernel Panic on G5 with ppc64 kernel #37

Closed benthetechguy closed 11 months ago

benthetechguy commented 2 years ago

I'm helping someone install Arch POWER on their G5. Everything went relatively smoothly until their first boot, when the kernel panicked.

Here's an image of the panic: panic

It looks like it's failed to open the initial console for some reason, and the init quits. If this is in fact an issue with the linux-ppc64 kernel, it has to be in the latest version, because the iso booted fine, and it uses the previous version of the kernel. I attempted to reproduce this in QEMU, but I couldn't even get the iso to boot on ppc64 (neither hard drive nor CD show up in /dev, even after running udevadm trigger).

benthetechguy commented 2 years ago

Update: Was able to get QEMU install working using a different -M value for the initial installation, and was able to reproduce the kernel panic with the same error.

kth5 commented 2 years ago

The way I start the ISO in qemu is working:

qemu-system-ppc64 -m 2048 -smp 2 -cdrom archpower-current-powerpc.iso -boot d

The default amount of RAM in Qemu may not be enough. On PPC64 you need at least 384MB of RAM, but I guess your G5 has that much?

What particular model of a G5 is it? It does sound like it can't find the root filesystem indicated by it failing to switch_root. I reckon you already tried to boot with the fallback initramfs?

kth5 commented 2 years ago

I just uploaded linux-ppc64-5.17.5.arch1-2 straight to base. Apparently I missed re-enabling some SATA drivers when refactoring the .config. My apologies, I don't have a G5 around but do use this Kernel in KVM for buildbots.

benthetechguy commented 2 years ago

Thank you. I will have him test this new kernel later today.

benthetechguy commented 2 years ago

Sorry for the delay, he was busy. The new kernel didn't fix the issue, it still panics in the same way.

kth5 commented 2 years ago

That sucks, and yeah... I don't have a G5 to fully test this. Since the kernel on the ISO works, I reposted it here:

https://archlinuxpower.org/share/issues/35/

Until the issue is fixed this should be one that's working unless there's yet another issue.

benthetechguy commented 2 years ago

Thanks, will try this.

benthetechguy commented 2 years ago

Well, still panics but with a different message. The same kernel that's on the iso doesn't work on the installed system. To confirm the issue wasn't Arch, I had him try Debian, which worked flawlessly. He don't want to try Arch anymore, so I won't be able to test any further (except through QEMU).

Here's something to note: After the initial installation, GRUB would not show up in the alt (option) menu. Without alt, the system would boot to a question mark disk screen for a couple seconds then boot to OS X. He could still boot to GRUB from Open Firmware and it worked fine until the kernel panicked. I tried to get it to show up with the hattrib commands from the wiki, but it would say "No such file or directory." I made sure it was copied exactly as written. Neither the Arch nor Debian ISOs showed up in the alt menu, but both of them were able to be booted from Open Firmware. However, unlike Arch, after installing Debian, GRUB showed up in the alt menu.

kth5 commented 2 years ago

That is unfortunate, I'm not really sure what exactly went wrong here since I can't test on actual hardware. Qemu does not emulate a G5 and it's OpenFirmware implementation differs quite drastically.

For instance, you'd use a PReP partition on a MSDOS partition table instead of the Apple_Bootstap equivalent with an Apple partitiontable and HFS.

At the end of the day, I wouldn't say Arch POWER is supporting G5 systems it's just halfway there for someone to hack it and contribute patches. For regular use without having to dig in a bit, other distros may be better suited at least for the moment.

benthetechguy commented 2 years ago

For instance, you'd use a PReP partition on a MSDOS partition table instead of the Apple_Bootstap equivalent with an Apple partitiontable and HFS

That could very well be the issue. We created an Apple partition table with Apple_Bootstrap. I don't get why that would make GRUB still boot fine but Linux panic, but it's a solid clue. Unfortunately, we may never know, since the user is content with Debian now and I don't have experience with or ownership of a G5.

Serentty commented 2 years ago

Unfortunately, we may never know, since the user is content with Debian now and I don't have experience with or ownership of a G5.

I have a G5 and would be willing to keep testing this. Right now I am running Gentoo and am getting a bit fed up with the compile times, and Void Linux PPC is going little endian-only soon, so this would be a great next distro for me if this can get fixed.

Serentty commented 2 years ago

Oh, I just realized that the 64-bit userland is all little endian, right? I would have to run a 32-bit userspace on the G5? Hm... this would definitely be my preferred distribution option if I could run a 64-bit userspace on it, but if you’re not building those packages it might not be worth it.

benthetechguy commented 2 years ago

Debian has a 64 bit big endian user land available, but it's an unofficial port just like 32 bit is. It's still very good, though. It would be great if you could help us test this.

Serentty commented 2 years ago

I am thinking that I might install Debian or Adélie for now (any recommendation which one I should pick?) and then help test this on another partition. I’m not sure if you have any plans to ever enable big endian builds for userspace, but if you do, I would be pretty hyped to help making sure everything works. I’ll try to get around to testing this kernel either way though.

benthetechguy commented 2 years ago

I am thinking that I might install Debian or Adélie for now (any recommendation which one I should pick?)

I've never heard of Adélie, but it seems like a smaller project than Debian. For an already niche platform, it's generally a better idea to go for distribution that more people are supporting. On top of that, if you run into trouble, I'm much more familiar with Debian and will be able to help you easier.

Serentty commented 2 years ago

I have Debian all set up on the G5 now and it is working quite well. I would be interested in trying this now. Since I have Debian installed on my SSD, maybe it would make sense to install Arch on the mechanical hard drive, which I was going to format with BTRFS anyway. If the kernel does not boot, then I can always test and and fix things using chroot from Debian.

kth5 commented 2 years ago

I'll incorporate a Grub.cfg into the next iso removing the forced console cmdline for hvc0. Cheers for finding this.

benthetechguy commented 2 years ago

Strange, the original message from @nitrogen388 seems to be gone.

qyot27 commented 2 years ago

That is unfortunate, I'm not really sure what exactly went wrong here since I can't test on actual hardware. Qemu does not emulate a G5 and it's OpenFirmware implementation differs quite drastically.

For instance, you'd use a PReP partition on a MSDOS partition table instead of the Apple_Bootstap equivalent with an Apple partitiontable and HFS.

At the end of the day, I wouldn't say Arch POWER is supporting G5 systems it's just halfway there for someone to hack it and contribute patches. For regular use without having to dig in a bit, other distros may be better suited at least for the moment.

QEMU actually can emulate a G5...sort of:

#!/bin/bash -x
qemu-system-ppc64 -L pc-bios -M mac99,via=pmu -cpu 970 -m 2G -net nic,model=sungem -net user -hda debian_ppc64_g5.qcow2 $1 $2 $3 $4

($1-4 provided for convenience, so that -cdrom and -boot can just be passed to the script with their parameters)

Technically, the above is an impossible combination in reality: it claims to be a Power Mac 3,1 with an IBM 970 (the G5) in it instead, and run under the ppc64 environment so that it can run actual ppc64 binaries. That Debian ppc64 install is valid enough that it can then be flashed to a USB drive with qemu-dd and booted directly on a G5 (although wifi and graphics drivers will likely need to be installed beyond what qemu allows running with).

kth5 commented 2 years ago

I have a G5 incoming tomorrow and will finally be able to iron out any kinks there still may be. Stay tuned.

kth5 commented 1 year ago

I was able to install on a PowerMac G5 Dual Core 2.0Ghz (late-2005) with Nvidia Geforce 6600 LE. I had to do some quirks though to make the display work properly since nvidiafb and nouveau are fighting for dominance.

nouveau.modeset=0

makes it use offb until issue can be addressed in a better fashion.

kth5 commented 1 year ago

linux-ppc64-6.0.11.arch1-2 will have CONFIG_FB_NVIDIA disabled. Need to verify this once home tonight.

Hugobros3 commented 1 year ago

the 6.0.12 kernel in the ISO works fine for me when disabling nouveau modesetting, but 6.3 from the repos hangs with or without it :(

kth5 commented 11 months ago

There's been a new ISO with 6.6.4 and various other fixes. Please have a go again if you like and if it still fails feel free to re-open this issue.