View previous topic :: View next topic |
Author |
Message |
twork Apprentice
Joined: 28 Jul 2006 Posts: 197
|
Posted: Sat Jan 25, 2025 7:26 pm Post subject: I (still) can't boot |
|
|
Been trying off and on to get my first GentooPI machine running. Couple of months ago, I was getting as far as having the startup Gentoo system running, but I don't have a wire network available for this, so I was needing the network interface to work and couldn't figure that out; so, now, starting over, I'm not even getting that far.
With a fresh image, from:
https://distfiles.gentoo.org/releases/arm64/autobuilds/20250119T234827Z/install-arm64-minimal-20250119T234827Z.iso
...when I write that image to a stick and start the machine, it appears to not register the card at all. I see the net install series, whether I have the card inserted or not.
Maybe relevant, not sure: when I stick that card into my laptop, it doesn't register as mountable there either. fdisk does see it:
Code: | $ fdisk -l /dev/sdb
GPT PMBR size mismatch (1207763 != 121536511) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/sdb: 57.95 GiB, 62226694144 bytes, 121536512 sectors
Disk model: mSD SDDR-189
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 796281E1-6435-4DDA-AF54-D91F969862E9
Device Start End Sectors Size Type
/dev/sdb1 64 299 236 118K Microsoft basic data
/dev/sdb2 300 6059 5760 2.8M EFI System
/dev/sdb3 6060 1207699 1201640 586.7M Microsoft basic data
|
...but, unlike last times, my laptop refuses to mount it.
Code: | $ sudo mount /dev/sdb3 /mnt/gentoo/
mount: /mnt/gentoo: wrong fs type, bad option, bad superblock on /dev/sdb3, missing codepage or helper program, or other error. |
The FS type was Microsoft basic back then, too, right? mount Just Knows, not like in olden days?
My guess is that those "error" messages at the start of fdisk are the sort of thing we'd see when fdisk sees something "foreign", but maybe not?
Has something changed in the layout since the last time I tried? Or, is there a booboo on this build? Or (most likely), what have I started doing wrong that I didn't last time?
Thanks, as always. |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1472 Location: Richmond Hill, Canada
|
Posted: Sat Jan 25, 2025 8:03 pm Post subject: |
|
|
Did you follow Gentoo wiki LiveUSB to write the usb stick? |
|
Back to top |
|
|
twork Apprentice
Joined: 28 Jul 2006 Posts: 197
|
Posted: Sun Jan 26, 2025 3:02 am Post subject: |
|
|
Quote: | Did you follow Gentoo wiki LiveUSB to write the usb stick? |
Nope! Didn't even know that page exists; which makes me wonder why I was able to get as far as I did previously, when the stick would boot with the stock image but just didn't handle WiFi.
Anyhow, now my next dumb question: Back In The Day, fdisk had a command, something like "flag a partition as bootable". I see that command implied on the page you link, note the asterisk:
Code: | [...]
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 250 2008124+ 6 FAT16 |
...but as I'm reading fdisk, I don't find that command in modern versions. What am I overlooking? Is it someplace other than fdisk these days, or am I just overlooking it here?
When I do run fdisk on the image I have, here's what it shows:
Code: |
Command (m for help): p
Disk /dev/sdb: 57.95 GiB, 62226694144 bytes, 121536512 sectors
Disk model: mSD SDDR-189
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 796281E1-6435-4DDA-AF54-D91F969862E9
Device Start End Sectors Size Type
/dev/sdb1 64 299 236 118K Microsoft basic data
/dev/sdb2 300 6059 5760 2.8M EFI System
/dev/sdb3 6060 1207699 1201640 586.7M Microsoft basic data |
So yeah, that implies that I've overlooked the flag. (Why isn't in included in the posted image...?) But I don't find a way to set it.
Clue please. Thanks. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5352 Location: Bavaria
|
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1472 Location: Richmond Hill, Canada
|
Posted: Sun Jan 26, 2025 12:48 pm Post subject: |
|
|
twork wrote: | Quote: | Did you follow Gentoo wiki LiveUSB to write the usb stick? |
Nope! Didn't even know that page exists; which makes me wonder why I was able to get as far as I did previously, when the stick would boot with the stock image but just didn't handle WiFi.
Anyhow, now my next dumb question: Back In The Day, fdisk had a command, something like "flag a partition as bootable". I see that command implied on the page you link, note the asterisk:
Code: | [...]
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 250 2008124+ 6 FAT16 |
...but as I'm reading fdisk, I don't find that command in modern versions. What am I overlooking? Is it someplace other than fdisk these days, or am I just overlooking it here?
When I do run fdisk on the image I have, here's what it shows:
Code: |
Command (m for help): p
Disk /dev/sdb: 57.95 GiB, 62226694144 bytes, 121536512 sectors
Disk model: mSD SDDR-189
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 796281E1-6435-4DDA-AF54-D91F969862E9
Device Start End Sectors Size Type
/dev/sdb1 64 299 236 118K Microsoft basic data
/dev/sdb2 300 6059 5760 2.8M EFI System
/dev/sdb3 6060 1207699 1201640 586.7M Microsoft basic data |
So yeah, that implies that I've overlooked the flag. (Why isn't in included in the posted image...?) But I don't find a way to set it.
Clue please. Thanks. |
If you just want to see the boot flag, you need to enter expert mode ('x'). And you can use 'a' to toggle it on and off. However this only work on DOS partition.
the boot flag concept is very old and I think modern day BIOS does not care for it. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Sun Jan 26, 2025 3:26 pm Post subject: |
|
|
twork,
Quote: | Been trying off and on to get my first GentooPI machine running. |
GentooPI?
Exactly what hardware is that?
Most Pis of whatever fruit, will not boot the arm64.iso image, as it depends on EFI and Single Board Computers don't usually support EFI.
Most SBCs won't run the gentoo-sources kernel either, as they need vendor patch sets. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
twork Apprentice
Joined: 28 Jul 2006 Posts: 197
|
Posted: Sun Jan 26, 2025 4:41 pm Post subject: |
|
|
Sorry, should have been less vague: Raspberry Pi 4, 64 bit. arm64 is the right format, yeah?
If... if most ARM vendors won't run Gentoo, how did I have it running a few weeks ago -- minus the WiFi? Is the WiFi part of the "vendors"?
Do the Linux distros who *can* boot on a Pi have to make some kind of contract, and Gentoo doesn't...?
Of course I overwrote that previous image of the stick, assuming I just wanted a fresh start, so I don't have that state to refer to. I know better... Anyhow I was sure that what I booted on the Pi was a Gentoo image, maybe my memory is just wrong. |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1472 Location: Richmond Hill, Canada
|
Posted: Sun Jan 26, 2025 5:04 pm Post subject: |
|
|
twork wrote: |
Sorry, should have been less vague: Raspberry Pi 4, 64 bit. arm64 is the right format, yeah?
If... if most ARM vendors won't run Gentoo, how did I have it running a few weeks ago -- minus the WiFi? Is the WiFi part of the "vendors"?
Do the Linux distros who *can* boot on a Pi have to make some kind of contract, and Gentoo doesn't...?
Of course I overwrote that previous image of the stick, assuming I just wanted a fresh start, so I don't have that state to refer to. I know better... Anyhow I was sure that what I booted on the Pi was a Gentoo image, maybe my memory is just wrong. |
You misunderstood Neddy said. When you refer "Gentoo" you are refer to the running environment you installed on the stick. Whereas Neddy refer to ARM vendors create their own BSP (Board support package). which usually include Kernel, boot loader and application packages.
your "minus WiFi" is evidence where a general linux kernel (Gentoo's gentoo souce or gentoo dist as example) will likely not work right out of box. because missing necessary hardware driver to support the board.
Now a day, vendor supplied boot loader usually understand most kernel image format so it can load them and jump to entry point to execute. in the old day the kernel image usually have to be in very specific format and load in to specific memory location in order to start the board. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Sun Jan 26, 2025 5:12 pm Post subject: |
|
|
twork,
The Pi4 will run gentoo-sources, Everything it needs has been upstreamed. The Pi5 is work in progress.
Older Pis will never run gentoo-sources as some of the code they need in the kernel cannot be upstreamed.
None of the PIs have EFI so cannot boot the Gentoo arm64 ISO.
Once the install is done, they will all run a Gentoo userland but the kernel can be a problem.
To make life easy, start with Raspberry Pi Install Guide. This puts the Gentoo arm64 starge3 on top of the Pi Foundation kernel and firmware. You need the firmware that runs on the GPU to get started.
Once it works, you can try the gentoo-sources kernel. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Mon Jan 27, 2025 11:53 am Post subject: |
|
|
Quote: | Maybe relevant, not sure: when I stick that card into my laptop, it doesn't register as mountable there either. fdisk does see it: |
FWIW, I have a few Marvell Armada 8040 boards where I can't put their disks into an x86 system and read them... once they've been used on the arm boards, either the partition table is blank, or the partitions show as corrupted (I can't remember which)... but oddly enough, it works just fine the other way around...
I don't think that would apply to an install image though, the last time I provisioned a RPI5 I was able to see the files on the usb stick after using balena etcher... Using dd to write images to a usb stick used to give me so many issues when I wanted to re-use the stick for something else (and the solution was pretty weird too, I had to do something like "rm /dev/sdx" if memory serves correct).
Cheers _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Mon Jan 27, 2025 12:17 pm Post subject: |
|
|
bunder,
Some SBCs write the kernel directly to a partition, no filesystem.
The Raspberry Pis are better behaved than that. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 513 Location: San Diego, California USA
|
Posted: Mon Jan 27, 2025 4:50 pm Post subject: |
|
|
I use the Raspberry PI kernel git repository at https://github.com/raspberrypi/linux.git for my Pi 4 and Pi 5. Use the 'make bcmXXX_defconfig' appropriate for your hardware. You can tweak that config to add more kernel features if you like. That kernel repo stays up-to-date depending on what branch you use. I'm currently at 6.12.8-v8+ and update about every month.
With this kernel and the raspberry Pi firmware package, Wifi works on my boards. |
|
Back to top |
|
|
twork Apprentice
Joined: 28 Jul 2006 Posts: 197
|
Posted: Tue Jan 28, 2025 3:11 am Post subject: |
|
|
OK un-stupid me, again.
At that site, it links to a Downloads site with (among other stuff) a "Minimal Installation CD" image for arm64; I dd that to a stick; that's usually all I need to do to start up my machine, right? What step have I forgotten (this time)?
My stick seems fine. On my Real Machine it reads, it writes...
The filesystem layout I posted is the one I get from there; most recently: Code: | $ fdisk -l /dev/sdb
GPT PMBR size mismatch (1207887 != 121536511) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/sdb: 57.95 GiB, 62226694144 bytes, 121536512 sectors
Disk model: mSD SDDR-189
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 34DD58F1-079D-4382-BF3A-BA1EEBAB860B
Device Start End Sectors Size Type
/dev/sdb1 64 299 236 118K Microsoft basic data
/dev/sdb2 300 6059 5760 2.8M EFI System
/dev/sdb3 6060 1207823 1201764 586.8M Microsoft basic data |
That should Just Boot, right? No?
Is there a step between writing the .iso image on to the stick, and flagging the stick as bootable? If there is, where is that? |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1472 Location: Richmond Hill, Canada
|
Posted: Tue Jan 28, 2025 11:53 am Post subject: |
|
|
twork wrote: |
OK un-stupid me, again.
At that site, it links to a Downloads site with (among other stuff) a "Minimal Installation CD" image for arm64; I dd that to a stick; that's usually all I need to do to start up my machine, right? What step have I forgotten (this time)?
My stick seems fine. On my Real Machine it reads, it writes...
...
Is there a step between writing the .iso image on to the stick, and flagging the stick as bootable? If there is, where is that? |
Raspberry Pi (all model) does not support boot from ISO image.
What the guide suggest is using another machine (your Real Machine for example) download stage3 tarball for arm/arm64) and expand the tarball either to a temporary location on your machine or directly to SD card/USB stick. for the later method you will need to partition your SD card/USB stick in right way for RPI boot loader to work. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Tue Jan 28, 2025 4:47 pm Post subject: |
|
|
twork,
Code: | Disklabel type: gpt
Disk identifier: 34DD58F1-079D-4382-BF3A-BA1EEBAB860B |
On a Pi4 you need a recent SPI firmware to boot from GPT. To update it you need a bootable something with an MSDOS partition table.
The ISO image has all of the PI GPU stuff missing, so it cannot boot there.
Also Pis do not support UEFI.
The only Gentoo code you fetch is the arm64 stage3.
You prepare the bootable media on a random arch system as no arm64 code will be executed until your install media can boot on the Pi.
You get enough to log in at the console as root.
Everything that needs arm64 code executed is left until you are logged into the Pi. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 513 Location: San Diego, California USA
|
Posted: Wed Jan 29, 2025 1:05 am Post subject: |
|
|
Pi 4 and Pi 5 don't boot UEFI. There is no UEFI. The easiest way to see how the Pi boots is to install Raspberry Pi OS on an SDCard and look at the layout. You need MBR partitioned storage with a vfat partition up front that contains the boot files the firmware loads. When I installed Gentoo, I booted off a Raspberry Pi OS SDCard and used a USB adapter to create the Gentoo SDCard. Now I'm using NVME drives on my Pi 5 but the layout is the same.
Code: | Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Sabrent SB-ROCKET-NVMe4-1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4865f06d
Device Boot Start End Sectors Size Id Type
/dev/nvme0n1p1 * 2048 1050623 1048576 512M b W95 FAT32
/dev/nvme0n1p2 1050624 17827839 16777216 8G 82 Linux swap / Solaris
/dev/nvme0n1p3 17827840 1953525167 1935697328 923G 8e Linux LVM
|
I'm using LVM for my storage which requires an initramfs but you don't have to go that route if you don't want to. You may create whatever partitions you want after the first one which is used for boot.
Code: | nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot
├─nvme0n1p2 259:2 0 8G 0 part
│ └─swap-a 254:13 0 8G 0 crypt [SWAP]
└─nvme0n1p3 259:3 0 923G 0 part
├─vg1-root 254:0 0 80G 0 lvm /mnt/root
│ /
├─vg1-opt 254:1 0 10G 0 lvm /opt
├─vg1-log 254:2 0 10G 0 lvm /var/log
├─vg1-tmp 254:3 0 6G 0 lvm /tmp
├─vg1-vtmp 254:4 0 512M 0 lvm /var/tmp
└─vg1-home 254:5 0 150G 0 lvm /home
|
Edited contents of the boot partition (without older kernels):
Code: | bcm2712-rpi-5-b.dtb
bootcode.bin
cmdline.txt
config.txt
fixup4cd.dat
fixup4.dat
fixup4db.dat
fixup4x.dat
fixup_cd.dat
fixup.dat
fixup_db.dat
fixup_x.dat
initramfs-gentoo.img
kernel8.img
overlays
start4cd.elf
start4db.elf
start4.elf
start4x.elf
start_cd.elf
start_db.elf
start.elf
start_x.elf
|
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Wed Jan 29, 2025 6:10 pm Post subject: |
|
|
gentoo_ram,
I do much as you do too.
You can save some space on boot.
bootcode.bin is for Pi3 and below. Pi4 and Pi5 have on SPI EEPROM for that code.
I think fixup4* and start4* are Pi4 only but I've not confirmed that but
dmesg: | [ 0.056037] raspberrypi-firmware soc@107c000000:firmware: Attached to firmware from 2025-01-14T00:16:48, variant start_cd |
I have an initrd that is kernel agnostic. That requires a minor change to the kernel to make worx as DM support is a module by default, that makes it difficult to root in LVM.
The Pi5 can read GPT out of the box. The Pi4 may need an SPI EEPROM update to add the enhancement. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|