Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help with booting initramfs for rpi4 Gentoo systemd
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Tue Nov 17, 2020 10:31 pm    Post subject: Need help with booting initramfs for rpi4 Gentoo systemd Reply with quote

I followed these links to build my system to create my own notes:

1) http://syseng.technoplaza.net/files/gentoo-systemd-command-guide_2.txt

2) https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Configuring_systemd_and_Installing_Necessary_Tools

3) https://wiki.gentoo.org/wiki/Systemd

4) https://github.com/mcpcpc/gentoo-arm64-rpi4-install

5) https://wiki.gentoo.org/wiki/Raspberry_Pi4_64_Bit_Install

6) https://wiki.gentoo.org/wiki/Raspberry_Pi/Kernel_Compilation <-- It says that "By default the Raspberry Pi looks for a kernel in /boot/kernel.img"

7) https://wiki.gentoo.org/wiki/User:NeddySeagoon/Pi3#Getting_Started <-- turns out that this is outdated, however, he or she mentions this: "To run 64 bit code we need a 64 bit armv8a kernel" I'll explain this later on...

So, I what I did was grabbed arm64 tar.xz, tar all the files to /mnt/gentoo, ran systemd -bD /mnt/gentoo, chrooted, ran emerge --sync and update, enabled everything needed from the first link, jumped down to link 2 installed all the needed tools, and enabled them, used layman to grab genpi64-0verlay and sakaki-tools, installed the firmware, and ran genkernel --menuconfig --lvm --makeopts=-j4 all followed link 3, 6, and 5 to compile my kernel. I then unmounted everything booted up the system, which gave me this error:
autoboot.txt not found
Partition 0
lba: 2048 oem: 'mkfs.fat' volume: 'NO NAME'
Read config.txt bytes

Note: my config.txt had initramfs and stuff beforehand, and it still gave me the above error. That is not all of the error

I forgot the dtb files, so I booted back linux mate chrooted again, and gathered all the dtb files from link 4, then I started to look into link 7, as linux mate aarch64 has uboot_rpi_4.bin. I opened the config file for linux mate and saw kernel=uboot_rpi_4.bin
So, I looked and looked and looked around and I can't find a way to create uboot_rpi_4.bin for the kernel that I already made. Apparently, by compiling the uboot from the git source: git clone --depth 1 https://github.com/zeldin/u-boot-rpi3.git, it doesn't really go in depth about creating uboot on a different system, only if the user is using gentoo, and it doesn't even show how to make uboot_rpi_4.bin...

This is where I am confused at. What do I need to do for the build I have to work? Do I need uboot to boot my .img? Or it is a complete different error, and I am just overthinking it. Cause I am hoping that I can just type initramfs <the kernel.img> and walla it works.. But that's not the case.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Wed Nov 18, 2020 10:15 am    Post subject: Reply with quote

kucklehead,

Welcome to Gentoo.

The Pi4 does not have any EFI firmware. There is an experimental project to write some but if you want to use it you won't need to ask how.
That's the state of it now.

The SPI firmware (the Pi4 has two different sets of files referred to as firmware) loads the start* and fixup* file as required. bootcode.bin is not used on the Pi4.
Between them those files, which execute on the GPU, set up the Pi, load the kernel, the dtb, (not the initrd) and jump to the kernel start address.
The Pi detection and startup code has sensible defaults for any pi it finds itself on, so it can just work, if you use the default file names.

No EFI, no u-boot is required.

If you don't like the default filenames, set your own in /boot/config.txt. If you list an initrd here it will be loaded too.
Code:
# as we don't use default kernel names, we must set 64 bit mode.
#arm_control=0x200 # is the old way
arm_64bit=1

# Pi 4
device_tree=bcm2711-rpi-4-b.dtb_64

# Pi 4 64 bit
kernel=kernel-5.4.45-v8+


With non default kernel and device tree filenames, that's the minimum config.txt.
As you have an initrd, you need another entry too.
Finding out what that is is left as an exercise for the reader. :)

The dtb for 32 bit and 64 operation are different. You will only get one core if you use the wrong one.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Thu Nov 19, 2020 7:32 am    Post subject: Reply with quote

That actually helped out alot. Thank you.... As for right now, I discarded the kernel that I had before and currently cross compiling rpi-5.10.0-rc4. I tried running genkernel --menuconfig --lvm --makeopts=-j4 --install all as I thought I needed initrd. Because my other installations I would always run into "make error: arch unknown" I'm assuming that's because I'm running this command: " mv bcm2771-rpi-dtb /mint/gentoo/bcm2771-dtb_32. As you said, if you install the wrong arch, you'll get only one core. Yes, I have gentoo installed on a lvm partition, and I don't know if you are suppose to put dolvm inside the cmdline.txt, but I did. My cmdline.txt is:
root=/dev/gentoo/root rootfs=ext4 rootwait dolvm

I honestly don't know if that's going to be a future problem or not, because I'm currently dealing with another problem. Whenever I run genkernel, it says operation not primitted even though I'm root. I was looking into the mount -o remount /dev/sda1 uid=777 some other stuff.
And yeah, I can execute any command just not genkernel of make I think. I'm guessing I don't need the armstub=armstub8-gic.bin?
And, then what's the point of the guide showing you how to "boot" off a initrd? Does it still provide "more options to configure the kernel?"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Thu Nov 19, 2020 10:09 am    Post subject: Reply with quote

kucklehead,

Does genkernel work for a Pi4? How does it know what to build?

You would need to tell it the arm64 bcm2711_defconfig.
I have lvm on my Pi too but not for root. If you want root in lvm, you need an initrd.
I won't encourage you to define the root logical volume on the kernel command line but you can do that if you want.

Does genkernel know about the *dtb file?

Code:
mount -o remount /dev/sda1 uid=777

What is on /dev/sda1 ?
Code:
uid=777
looks wrong.
Possibly you intended to set the file mode?

If /dev/sda1 is /boot, root will have read/write access as its a vfat filesystem.

You will need dolvm on the kernel command line, its an instruction to the inird init script, to start the logical volume manager.

With an initrd you actually have two sequentianl root filesystems.
First the initrd is mounted as root. It does its thing, then your lvm root is mounted as root.
That may be a problem. Which root filesystem does rootwait apply to?
You want it to be the second one, not the initrd. However, its a kernel parameter, so the kernel will swallow it and apply it to the first root filesystem.
Keep that in mind. It may not be needed as LVM has to start before root can appear and if you block device is slow, LVM can't start and rootwait won't fix that.

Genkernel, (which I've never used) has a load of real_* initrd applied options which it parses out of the kernel command line.
That allows it to safely reuse kernel parameter names by prefixing them with real_

To my mind using genkernel for a SBC is the wrong place to start.
The default kernel8.img or your own from the arm64 bcm2711_defconfig does what you want with the exception of the userspace tools to support root inside LVM.
You could use that kernel, as is, no genkernel, and make your own initrd that contains just the userspace things needed to make your real_root show up.
As there are no kernel modules in such initrd, it never needs to change.
The initrd on my main system, brings up raid5, starts LVM, and finds the real root. It was made in April 2009.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 3:50 am    Post subject: Reply with quote

rootwait is I am assuming applied to /dev/gentoo/root. I tried coping the rpi firmware to /mnt/gentoo/boot by following this:
Code:
cp -rv -p ~/Desktop/Gentoopi4/raspberrypi/firmware/boot/* /mnt/gentoo/boot
cp ~/Desktop/Gentoopi4/raspberrypi/linux/arch/arm64/boot/Image /mnt/gentoo/boot/kernel8.img
cd ~/Desktop/Gentoopi4/raspberrypi/linux
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make modules_install INSTALL_MOD_PATH=/mnt/gentoo


***copied the config for the kernel. I tried running genkernel to generate my intiramfs, and it still said even when I am in root:
Code:
cp: failed to preserve ownership for '/boot/vmlinuz-5.10.0-rc4-arm64': Operation not permitted
* ERROR: Failed to copy '/usr/src/linux/arch/arm64/boot/Image' to '/boot/vmlinuz-5.10.0-rc4-arm64'!
* Please consult '/var/log/genkernel.log' for more information and any
* errors that were reported above.

I tried mount -o remount,uid=777 /mnt/gentoo/root
and still nothing worked.

***Yes, I know what you are talking about, cause I stumbled upon that with luck, also some other pretty cool things as well
So, what I did instead was rm -r /boot/*
ran bcm2711_deconfig
Code:
mkdir /boot/overlays
make -j4 zImage modules dtbs
make modules_install dtbs_install

Which had no errors at all.
Code:
cp /usr/src/linux/arch/arm64/boot/Image /boot/kernel8.img


**Which it did install the dtb files that I am not familiar with, however it left an empty dir: /boot/overlays
I don't know if that is useful or not.
I ran
Code:
genkernel --menuconfig --makeopts=-j4 --lvm --install all thinking everything is gonna work out, and guess what?
which popped up "operation not permitted"
Then, I run chown root:root /boot -R and this crap pops up:
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/gpio-key.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/gpio-no-bank0-irq.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/gpio-no-irq.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/gpio-poweroff.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/gpio-shutdown.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hd44780-lcd.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hdmi-backlight-hwhack-gpio.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-amp.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dac.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dacplus.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dacplusadc.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dacplusadcpro.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dacplusdsp.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-dacplushd.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-digi.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hifiberry-digi-pro.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/highperi.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hy28a.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hy28b.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/hy28b-2017.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/i-sabre-q2m.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/i2c-bcm2708.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/i2c-gpio.dtbo': Operation not permitted
chown: changing ownership of '/boot/dtbs/5.10.0-rc4-v8/overlays/i2c-mux.dtbo': Operation not permitted

The list goes on and on.

It is weird because the ownership was root, and it was owned by it. Yes, I have another user on this installation, and yeah, I deleted it, but when I ran ls -l /boot
it popped up 1000 as the owner....


Here's the copy of my genkernel log ---->>> https://pastebin.com/pu2b05jy


I had linux-5.9-arm64 initramfs compiled before this nightmare happened. I uninstalled it because the kernel was crashing; the kernel would just hang. I tried reinstalled it again and ran eselect kernel set 2; cd /usr/src/linux; make arm64-bcm2711_deconfig Error popped up saying no rules for target, compile stopped. And even before that, the firmware files were not there even though I copied them there... The good news is the kernel does find /dev/gentoo/root, but it hangs on something i cant rember. So, I ran
Code:
emerge --deselect sys-kernel/gentoo-sources; emerge --depclean -vp
rm -r the initramfs
"WHILE IN CHROOT" <-- wanted to make this clear that I am still in chroot. And it shouldn't be the source of my problem?
Like I said before, everything else works fine, but running genkernel is becoming the death of me mentally..
[Edit]:
I'm going to deselect genkernel and install dracut. Cause I'm thinking it's something with genkernel.

Code tags added by NeddySeagoon


Last edited by kucklehead on Fri Nov 20, 2020 10:43 am; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 9:46 am    Post subject: Reply with quote

kucklehead,

Never assume.
Quote:
rootwait is I am assuming applied to /dev/gentoo/root

That's unlikely. Its a kernel parameter. The kernel cannot tell that the first root filesystem it mounts is not the real root.

Your kernel build process in the first code block is good.

The arm64 (including the Pi) cannot boot
Code:
/boot/vmlinuz-5.10.0-rc4-arm64
there is no support for booting compressed kernels.
You must use the Image file.

Code:
uid=777
has to be incorrect. Who is the user with UID=777.
I have no such user listed in /etc/passwd.

Code:
cp /usr/src/linux/arch/arm64/boot/Image /boot/kernel8.img
does what it says.
It does nothing for the dtb or dtbo files.
From the top og the kernel tree, the overlays are in arch/arm64/boot/dts/overlays/
and the dtb are in arch/arm64/boot/dts/broadcom/

You only need the *.dtb from arch/arm64/boot/dts/broadcom/ and the *.dto from arch/arm64/boot/dts/overlays/.
The source files will be there too.

Ignore the
Code:
chown: changing ownership of ...
On the Pi, boot is a vfat filesystem. vfat does not support permission at all.
Maybe file a bug against genkernel to not try chown files on a vfat filesystem?
Linux permissions on a vfat filesystem are faked at mount time, so your
Code:
ls -l /boot
shows the faked result.

How about making your initrd by hand instead of depending on the black magic provided by genkernel or dracut?
Then you understand how it work or even more importantly, why it does not, so you can fix it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 10:20 am    Post subject: Reply with quote

Good news finally!
And that uid=777 is suppose to fix the chown owenership, and for my case, it didn't. I don't think it is a usergroup, or anything like that I think. And I am not using mount -o remount, uid=777 /mnt/gentoo/boot This isn't the source per say, but the user does mention 777 https://forums.centos.org/viewtopic.php?t=54978
I got the "initrd" by using dracut which was so much easier than using genkernel. This is the output:
Code:
dracut: Executing: /usr/bin/dracut --lvm --hostonly --kver 5.10.0-rc4-v8
dracut: dracut module 'bootchart' will not be installed, because command '/sbin/bootchartd' could not be found!
dracut: dracut module 'dash' will not be installed, because command '/bin/dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command '/bin/mksh' could not be found!
dracut: dracut module 'modsign' will not be installed, because command 'keyctl' could not be found!
dracut: dracut module 'network-legacy' will not be installed, because command 'dhclient' could not be found!
dracut: dracut module 'btrfs' will not be installed, because command 'btrfs' could not be found!
dracut: 90crypt: Could not find any command of '/lib/systemd/systemd-cryptsetup cryptsetup'!
dracut: dracut module 'dmraid' will not be installed, because command 'dmraid' could not be found!
dracut: dracut module 'dmsquash-live-ntfs' will not be installed, because command 'ntfs-3g' could not be found!
dracut: dracut module 'mdraid' will not be installed, because command 'mdadm' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'stratisd-init' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'mkfs.xfs' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'xfs_admin' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'xfs_growfs' could not be found!
dracut: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsiadm' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsid' could not be found!
dracut: 95nfs: Could not find any command of 'rpcbind portmap'!
dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found!
dracut: dracut module 'masterkey' will not be installed, because command 'keyctl' could not be found!
dracut: dracut module 'dash' will not be installed, because command '/bin/dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command '/bin/mksh' could not be found!
dracut: dracut module 'modsign' will not be installed, because command 'keyctl' could not be found!
dracut: dracut module 'network-legacy' will not be installed, because command 'dhclient' could not be found!
dracut: dracut module 'btrfs' will not be installed, because command 'btrfs' could not be found!
dracut: 90crypt: Could not find any command of '/lib/systemd/systemd-cryptsetup cryptsetup'!
dracut: dracut module 'dmraid' will not be installed, because command 'dmraid' could not be found!
dracut: dracut module 'dmsquash-live-ntfs' will not be installed, because command 'ntfs-3g' could not be found!
dracut: dracut module 'mdraid' will not be installed, because command 'mdadm' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'stratisd-init' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'mkfs.xfs' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'xfs_admin' could not be found!
dracut: dracut module 'stratis' will not be installed, because command 'xfs_growfs' could not be found!
dracut: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsiadm' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsid' could not be found!
dracut: 95nfs: Could not find any command of 'rpcbind portmap'!
dracut: dracut module 'masterkey' will not be installed, because command 'keyctl' could not be found!
dracut: *** Including module: bash ***
dracut: *** Including module: systemd ***
Failed to add dependency on unit, unit systemd-ask-password-plymouth.service does not exist.
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: rngd ***
dracut: *** Including module: i18n ***
dracut: *** Including module: dm ***
dracut: Skipping udev rule: 64-device-mapper.rules
dracut: Skipping udev rule: 56-lvm.rules
dracut: Skipping udev rule: 60-persistent-storage-lvm.rules
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: Skipping udev rule: 70-persistent-net.rules
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies ***
dracut: *** Installing kernel module dependencies done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing AuthenticAMD.bin ***
dracut: *** Store current command line parameters ***
dracut: Stored kernel commandline:
dracut:  rd.lvm.lv=gentoo/root
 rd.lvm.lv=gentoo/swap
dracut:  root=/dev/mapper/gentoo-root rootfstype=ext4 rootflags=rw,relatime
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Creating image file '/boot/initramfs-5.10.0-rc4-v8.img' ***
dracut: *** Creating initramfs image file '/boot/initramfs-5.10.0-rc4-v8.img' done ***


Yes, I thought about making my own initrd and I came up with something called makeinitrmfs. I don't know if gentoo has that package at all, so I went with the "black magic" dracut. It seems really sketchy, but at least it is something.
I also have the dtbo files you mentioned before. I got those by running:

Code:
cd /usr/src/linux
mount /boot
mkdir /boot/overlays
make bcm2711_deconfig
make -j4 Image modules dtbs
make modules_install dtbs_install



They're located in: /boot/dtbs/5.10.0-rc4-v8/overlays/
There's also a file called broadcom located here: /boot/dtbs/5.10.0-rc4/broadcom/
I am slightly confused, the dtb files that you described early on in the config.txt "device-tree=bcm2771_4_b.dtb" <-- That's located in I think you told me in the broadcom dir? I'll double check. It's still odd, as I think that the system thinks I have this kernel: 5.4.0-1022-raspi <-- I'll explain this later on... I also wanted to adress what you said about the kernel command line being altered. I think it has been altered, which I'm thinking even if I were to boot right now, the system would crash. I think that's what you're mentioning as the kernel command line can be altered easy.

Here is what the /boot/dtbs/5.10.0-rc4-v8/overlays:
Code:
act-led.dtbo                            mcp251xfd.dtbo
adafruit18.dtbo                         mcp3008.dtbo
adau1977-adc.dtbo                       mcp3202.dtbo
adau7002-simple.dtbo                    mcp342x.dtbo
ads1015.dtbo                            media-center.dtbo
ads1115.dtbo                            merus-amp.dtbo
ads7846.dtbo                            midi-uart0.dtbo
adv7282m.dtbo                           midi-uart1.dtbo
adv728x-m.dtbo                          miniuart-bt.dtbo
akkordion-iqdacplus.dtbo                mmc.dtbo
allo-boss-dac-pcm512x-audio.dtbo        mpu6050.dtbo
allo-digione.dtbo                       mz61581.dtbo
allo-katana-dac-audio.dtbo              ov5647.dtbo
allo-piano-dac-pcm512x-audio.dtbo       ov7251.dtbo
allo-piano-dac-plus-pcm512x-audio.dtbo  ov9281.dtbo
anyspi.dtbo                             overlay_map.dtb
apds9960.dtbo                           papirus.dtbo
applepi-dac.dtbo                        pca953x.dtbo
at86rf233.dtbo                          pibell.dtbo
audioinjector-addons.dtbo               pifacedigital.dtbo
audioinjector-isolated-soundcard.dtbo   pifi-40.dtbo
audioinjector-ultra.dtbo                piglow.dtbo
audioinjector-wm8731-audio.dtbo         piscreen2r.dtbo
audiosense-pi.dtbo                      piscreen.dtbo
audremap.dtbo                           pisound.dtbo
balena-fin.dtbo                         pitft22.dtbo
cma.dtbo                                pitft28-capacitive.dtbo
dht11.dtbo                              pitft28-resistive.dtbo
dionaudio-loco.dtbo                     pitft35-resistive.dtbo
dionaudio-loco-v2.dtbo                  pps-gpio.dtbo
disable-bt.dtbo                         pwm-2chan.dtbo
disable-wifi.dtbo                       pwm.dtbo
dpi18.dtbo                              pwm-ir-tx.dtbo
dpi24.dtbo                              qca7000.dtbo
draws.dtbo                              rotary-encoder.dtbo
dwc2.dtbo                               rpi-backlight.dtbo
dwc-otg.dtbo                            rpi-cirrus-wm5102.dtbo
edt-ft5406.dtbo                         rpi-dac.dtbo
enc28j60.dtbo                           rpi-display.dtbo
enc28j60-spi2.dtbo                      rpi-ft5406.dtbo
exc3000.dtbo                            rpi-poe.dtbo
fe-pi-audio.dtbo                        rpi-proto.dtbo
fsm-demo.dtbo                           rpi-sense.dtbo
ghost-amp.dtbo                          rpi-tv.dtbo
goodix.dtbo                             rpivid-v4l2.dtbo
googlevoicehat-soundcard.dtbo           rra-digidac1-wm8741-audio.dtbo
gpio-fan.dtbo                           sainsmart18.dtbo
gpio-ir.dtbo                            sc16is750-i2c.dtbo
gpio-ir-tx.dtbo                         sc16is752-i2c.dtbo
gpio-key.dtbo                           sc16is752-spi0.dtbo
gpio-no-bank0-irq.dtbo                  sc16is752-spi1.dtbo
gpio-no-irq.dtbo                        sdhost.dtbo
gpio-poweroff.dtbo                      sdio.dtbo
gpio-shutdown.dtbo                      sh1106-spi.dtbo
hd44780-lcd.dtbo                        smi-dev.dtbo
hdmi-backlight-hwhack-gpio.dtbo         smi.dtbo
hifiberry-amp.dtbo                      smi-nand.dtbo
hifiberry-dac.dtbo                      spi0-1cs.dtbo
hifiberry-dacplusadc.dtbo               spi0-2cs.dtbo
hifiberry-dacplusadcpro.dtbo            spi1-1cs.dtbo
hifiberry-dacplusdsp.dtbo               spi1-2cs.dtbo
hifiberry-dacplus.dtbo                  spi1-3cs.dtbo
hifiberry-dacplushd.dtbo                spi2-1cs.dtbo
hifiberry-digi.dtbo                     spi2-2cs.dtbo
hifiberry-digi-pro.dtbo                 spi2-3cs.dtbo
highperi.dtbo                           spi3-1cs.dtbo
hy28a.dtbo                              spi3-2cs.dtbo
hy28b-2017.dtbo                         spi4-1cs.dtbo
hy28b.dtbo                              spi4-2cs.dtbo
i2c0.dtbo                               spi5-1cs.dtbo
i2c1.dtbo                               spi5-2cs.dtbo
i2c3.dtbo                               spi6-1cs.dtbo
i2c4.dtbo                               spi6-2cs.dtbo
i2c5.dtbo                               spi-gpio35-39.dtbo
i2c6.dtbo                               spi-gpio40-45.dtbo
i2c-bcm2708.dtbo                        spi-rtc.dtbo
i2c-gpio.dtbo                           ssd1306.dtbo
i2c-mux.dtbo                            ssd1306-spi.dtbo
i2c-pwm-pca9685a.dtbo                   ssd1351-spi.dtbo
i2c-rtc.dtbo                            superaudioboard.dtbo
i2c-rtc-gpio.dtbo                       sx150x.dtbo
i2c-sensor.dtbo                         tc358743-audio.dtbo
i2s-gpio28-31.dtbo                      tc358743.dtbo
ilitek251x.dtbo                         tinylcd35.dtbo
imx219.dtbo                             tpm-slb9670.dtbo
imx290.dtbo                             uart0.dtbo
imx477.dtbo                             uart1.dtbo
iqaudio-codec.dtbo                      uart2.dtbo
iqaudio-dac.dtbo                        uart3.dtbo
iqaudio-dacplus.dtbo                    uart4.dtbo
iqaudio-digi-wm8804-audio.dtbo          uart5.dtbo
irs1125.dtbo                            udrc.dtbo
i-sabre-q2m.dtbo                        upstream.dtbo
jedec-spi-nor.dtbo                      upstream-pi4.dtbo
justboom-both.dtbo                      vc4-fkms-v3d.dtbo
justboom-dac.dtbo                       vc4-kms-dsi-7inch.dtbo
justboom-digi.dtbo                      vc4-kms-kippah-7inch.dtbo
ltc294x.dtbo                            vc4-kms-v3d.dtbo
max98357a.dtbo                          vc4-kms-v3d-pi4.dtbo
maxtherm.dtbo                           vga666.dtbo
mbed-dac.dtbo                           w1-gpio.dtbo
mcp23017.dtbo                           w1-gpio-pullup.dtbo
mcp23s17.dtbo                           w5500.dtbo
mcp2515-can1.dtbo
mcp2515-can0.dtbo                    wittypi.dtbo




Here's the files from /boot/dtbs/5.10.0-rc4-v8/broadcom
Code:
bcm2710-rpi-2-b.dtb  bcm2710-rpi-3-b-plus.dtb  bcm2711-rpi-400.dtb  bcm2711-rpi-cm4.dtb       bcm2837-rpi-3-b.dtb       bcm2837-rpi-cm3-io3.dtb
bcm2710-rpi-3-b.dtb  bcm2710-rpi-cm3.dtb       bcm2711-rpi-4-b.dtb  bcm2837-rpi-3-a-plus.dtb  bcm2837-rpi-3-b-plus.dtb
And yeah, you are right. The files are where you said they will be at.  :lol:



So, now I have two issues at hand. One is that when I ran dracut and gotten the initramfs it said AuthenAMD.bin <-- isn't that suppose to be AuthenARM64.bin? It also skipped alot of rules. The other is rng-tools
I ran modprobe bcm2835-rng
which gave me this error:
Code:
modprobe: FATAL: Module bcm2853-rng not found in directory /lib/modules/5.4.0-1022-raspi


Last edited by kucklehead on Fri Nov 20, 2020 10:52 am; edited 4 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 10:44 am    Post subject: Reply with quote

kucklehead,

Quote:
The main problem is all of them has a 777 permission ...

Thats not a UID, its the permissions that are 777 in octal.
Also that problem is related to a 2TB drive, so it won't have a vfat filesystem.

The Pi boot process will not find
Code:
/boot/dtbs/5.10.0-rc4-v8/overlays/

Nor will it find /boot/dtbs/5.10.0-rc4-v8/broadcom

The overlays must be in /boot/overlays.
You may be able to make /boot/dtbs/5.10.0-rc4-v8/broadcom work with a config.txt file entry.
The default is to put the dtb files into /boot.

The initrd file name won't matter, as long as the contents are arm64. Call it kucklehead if you like :)
Code:
dracut: *** Creating initramfs image file '/boot/initramfs-5.10.0-rc4-v8.img' done ***]
is your initrd.
Its full of kernel modules so it will only work with the 5.10.0-rc4-v8 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
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 10:55 am    Post subject: Reply with quote

Okay, I'll move the overlays to the empty dir that was already created; /boot/overlays
And I'll move the broadcom files straight into /boot

The last question will be: Why does the system think I have 5.10.44-raspi?
My kernel crashed again because I am missing the start_cd.elf and the fixup_cd.dat
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 11:29 am    Post subject: Reply with quote

kucklehead,

You need the fixup* and start* files from the raspberry pi fiirmware repo on github.
They run on the GPU before the kernel is loaded.

For the Pi4 you only need the ones with 4 in their names.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 12:02 pm    Post subject: Reply with quote

Yeah, I grabbed and the kernel crashed. As you said before something like this can happen. Basically, the initramfs couldn't find /dev/gentoi/root or /dev/gentoi/swap. It however found /dev/mmcblk0p2. I'm thinking I might have to re-compile the kernel and edit the boot options and set it as root=/dev/mmcblk0p2 instead of /dev/gentoo/root.
Edit: I only grabbed the start_cd.elf and fixup_cd.dat. so maybe if I perhaps grab the rest of the files from github "that has the 4's in them" then maybe it'll boot? What do you think?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 12:35 pm    Post subject: Reply with quote

kucklehead,

The kernel command line goes in /boot/cmdline.txt and it must be a single line.
It should override the in kernel setting.

I have no idea what the intrd init script does.
Its all black magic.
/dev/gentoi/root and /dev/gentoi/swap may well be correct.

root=/dev/mmcblk0p2 is wrong if root is in a logical volume.
The initrd needs to activate LVM, find the root logical volume and mount it.

If you made your own initrd and initrd init script, this would be the time to put comments in the init script so you can see what works and what doesn't.
Did the initrd even get loaded?

Quote:
the kernel crashed
is not a useful error report.
It should have shown a panic message. Quote that panic message verbatim.

Post the /boot/config.txt and /boot/cmdline.txt from 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
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 1:44 pm    Post subject: Reply with quote

Here, I've gotten what you asked for

Here's my cmdline.txt file
Code:
root=/dev/gentoo/root  rootfstype=ext4 rootwait dolvm


Here's my /boot/config.txt file
Code:
# set 64 bit mode
arm_64bit=1
device_tree=bcm2711-rpi-4-b.dtb_64
kernel=kernel-5.10.0-rc4-v8+
initramfs initramfs-5.10.0-rc4-v8+

# have a properly sized image
disable_overscan=1
# for sound over HDMI
hdmi_drive=2

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Enable autoprobing of Bluetooth driver without the need of hciattach/btattach>
dtparam=krnbt=on

# Enable the SPI interface on your RPI
dtparam=spi=on


I looked into https://wiki.gentoo.org/wiki/Dracut and edit the /etc/dracut.conf Mine looks like this:
Code:
# PUT YOUR CONFIG IN separate files
# in /etc/dracut.conf.d named "<name>.conf"
# SEE man dracut.conf(5) for options

# Equivalent to --drivers="module module module"
drivers+="usrmount rootfs-block kernel-modules"

# Bring up <device> in initramfs, <device> should be the device name
add_device+= "/dev/gentoo/root /dev/gentoo/tmp "
# Equivalent to --moddir="lib/modules/fixed
drivers_dir="/lib/modules/5.10.0-rc4-v8"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 3:23 pm    Post subject: Reply with quote

kucklehead,

Does
Code:
initramfs initramfs-5.10.0-rc4-v8+
work without the = between the initramfs keyword and its value?

Do the files
Code:
initramfs-5.10.0-rc4-v8+
kernel-5.10.0-rc4-v8+
exist in your /boot ?

The intrd has a shell. When things go wrong, you usually get dropped the the shell.
Does that happen?

If so, does /dev/gentoo/root exist.
What about /dev/mapper/ and what are the contents of /dev/mapper/ ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 3:41 pm    Post subject: Reply with quote

That has been bugging me for quite sometime. Does /dev/mapper/ only exist if you are installing gentoo from a live boot?
Yes /dev/gentoo/root Does infact as I followed the 1st link to install lvm. kernel=kernel-5.10.0-rc4-v8 does not exist, and I added it because it is shown in your example. And I am following this guide right here: https://wiki.gentoo.org/wiki/Raspberry_Pi/Kernel_Compilation and it doesn't have an equal sign between initramfs initramfs. Everything does exist in my boot
Here's proof:
Code:

ls /boot
bcm2710-rpi-2-b.dtb       fixup4cd.dat
bcm2710-rpi-3-b.dtb       fixup4.dat
bcm2710-rpi-3-b-plus.dtb  fixup4db.dat
bcm2710-rpi-cm3.dtb       fixup_cd.dat
bcm2711-rpi-400.dtb       initramfs-5.10.0-rc4-v8.img
bcm2711-rpi-4-b.dtb_64   
bcm2711-rpi-cm4.dtb        kernel8.img
bcm2837-rpi-3-a-plus.dtb  overlays
bcm2837-rpi-3-b.dtb       start4cd.elf
bcm2837-rpi-3-b-plus.dtb  start4db.elf
bcm2837-rpi-cm3-io3.dtb   start4x.elf
config.txt
cmdline.txt               start_cd.elf


The proof for overlays:
Code:
ls /boot/overlays
act-led.dtbo                            mcp251xfd.dtbo
adafruit18.dtbo                         mcp3008.dtbo
adau1977-adc.dtbo                       mcp3202.dtbo
adau7002-simple.dtbo                    mcp342x.dtbo
ads1015.dtbo                            media-center.dtbo
ads1115.dtbo                            merus-amp.dtbo
ads7846.dtbo                            midi-uart0.dtbo
adv7282m.dtbo                           midi-uart1.dtbo
adv728x-m.dtbo                          miniuart-bt.dtbo
akkordion-iqdacplus.dtbo                mmc.dtbo
allo-boss-dac-pcm512x-audio.dtbo        mpu6050.dtbo
allo-digione.dtbo                       mz61581.dtbo
allo-katana-dac-audio.dtbo              ov5647.dtbo
allo-piano-dac-pcm512x-audio.dtbo       ov7251.dtbo
allo-piano-dac-plus-pcm512x-audio.dtbo  ov9281.dtbo
anyspi.dtbo                             overlay_map.dtb
apds9960.dtbo                           papirus.dtbo
applepi-dac.dtbo                        pca953x.dtbo
at86rf233.dtbo                          pibell.dtbo
audioinjector-addons.dtbo               pifacedigital.dtbo
audioinjector-isolated-soundcard.dtbo   pifi-40.dtbo
audioinjector-ultra.dtbo                piglow.dtbo
audioinjector-wm8731-audio.dtbo         piscreen2r.dtbo
audiosense-pi.dtbo                      piscreen.dtbo
audremap.dtbo                           pisound.dtbo
balena-fin.dtbo                         pitft22.dtbo
cma.dtbo                                pitft28-capacitive.dtbo
dht11.dtbo                              pitft28-resistive.dtbo
dionaudio-loco.dtbo                     pitft35-resistive.dtbo
dionaudio-loco-v2.dtbo                  pps-gpio.dtbo
disable-bt.dtbo                         pwm-2chan.dtbo
disable-wifi.dtbo                       pwm.dtbo
dpi18.dtbo                              pwm-ir-tx.dtbo
dpi24.dtbo                              qca7000.dtbo
draws.dtbo                              rotary-encoder.dtbo
dwc2.dtbo                               rpi-backlight.dtbo
dwc-otg.dtbo                            rpi-cirrus-wm5102.dtbo
edt-ft5406.dtbo                         rpi-dac.dtbo
enc28j60.dtbo                           rpi-display.dtbo
enc28j60-spi2.dtbo                      rpi-ft5406.dtbo
exc3000.dtbo                            rpi-poe.dtbo
fe-pi-audio.dtbo                        rpi-proto.dtbo
fsm-demo.dtbo                           rpi-sense.dtbo
ghost-amp.dtbo                          rpi-tv.dtbo
goodix.dtbo                             rpivid-v4l2.dtbo
googlevoicehat-soundcard.dtbo           rra-digidac1-wm8741-audio.dtbo
gpio-fan.dtbo                           sainsmart18.dtbo
gpio-ir.dtbo                            sc16is750-i2c.dtbo
gpio-ir-tx.dtbo                         sc16is752-i2c.dtbo
gpio-key.dtbo                           sc16is752-spi0.dtbo
gpio-no-bank0-irq.dtbo                  sc16is752-spi1.dtbo
gpio-no-irq.dtbo                        sdhost.dtbo
gpio-poweroff.dtbo                      sdio.dtbo
gpio-shutdown.dtbo                      sh1106-spi.dtbo
hd44780-lcd.dtbo                        smi-dev.dtbo
hdmi-backlight-hwhack-gpio.dtbo         smi.dtbo
hifiberry-amp.dtbo                      smi-nand.dtbo
hifiberry-dac.dtbo                      spi0-1cs.dtbo
hifiberry-dacplusadc.dtbo               spi0-2cs.dtbo
hifiberry-dacplusadcpro.dtbo            spi1-1cs.dtbo
hifiberry-dacplusdsp.dtbo               spi1-2cs.dtbo
hifiberry-dacplus.dtbo                  spi1-3cs.dtbo
hifiberry-dacplushd.dtbo                spi2-1cs.dtbo
hifiberry-digi.dtbo                     spi2-2cs.dtbo
hifiberry-digi-pro.dtbo                 spi2-3cs.dtbo
highperi.dtbo                           spi3-1cs.dtbo
hy28a.dtbo                              spi3-2cs.dtbo
hy28b-2017.dtbo                         spi4-1cs.dtbo
hy28b.dtbo                              spi4-2cs.dtbo
i2c0.dtbo                               spi5-1cs.dtbo
i2c1.dtbo                               spi5-2cs.dtbo
i2c3.dtbo                               spi6-1cs.dtbo
i2c4.dtbo                               spi6-2cs.dtbo
i2c5.dtbo                               spi-gpio35-39.dtbo
i2c6.dtbo                               spi-gpio40-45.dtbo
i2c-bcm2708.dtbo                        spi-rtc.dtbo
i2c-gpio.dtbo                           ssd1306.dtbo
i2c-mux.dtbo                            ssd1306-spi.dtbo
i2c-pwm-pca9685a.dtbo                   ssd1351-spi.dtbo
i2c-rtc.dtbo                            superaudioboard.dtbo
i2c-rtc-gpio.dtbo                       sx150x.dtbo
i2c-sensor.dtbo                         tc358743-audio.dtbo
i2s-gpio28-31.dtbo                      tc358743.dtbo
ilitek251x.dtbo                         tinylcd35.dtbo
imx219.dtbo                             tpm-slb9670.dtbo
imx290.dtbo                             uart0.dtbo
imx477.dtbo                             uart1.dtbo
iqaudio-codec.dtbo                      uart2.dtbo
iqaudio-dac.dtbo                        uart3.dtbo
iqaudio-dacplus.dtbo                    uart4.dtbo
iqaudio-digi-wm8804-audio.dtbo          uart5.dtbo
irs1125.dtbo                            udrc.dtbo
i-sabre-q2m.dtbo                        upstream.dtbo
jedec-spi-nor.dtbo                      upstream-pi4.dtbo
justboom-both.dtbo                      vc4-fkms-v3d.dtbo
justboom-dac.dtbo                       vc4-kms-dsi-7inch.dtbo
justboom-digi.dtbo                      vc4-kms-kippah-7inch.dtbo
ltc294x.dtbo                            vc4-kms-v3d.dtbo
max98357a.dtbo                          vc4-kms-v3d-pi4.dtbo
maxtherm.dtbo                           vga666.dtbo
mbed-dac.dtbo                           w1-gpio.dtbo
mcp23017.dtbo                           w1-gpio-pullup.dtbo
mcp23s17.dtbo                           w5500.dtbo
mcp2515-can1.dtbo
mcp2515-can0.dtbo                       wittypi.dtbo


Also, The system keeps thinking that I have kernel 5.4.0-1022-raspi, which I don't.. Why does it keep thinking that I have it? Can I change it so it recognizes kernel 5.10.0-rc4-v8? Cause I think that's the main issue at hand.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 4:20 pm    Post subject: Reply with quote

kucklehead,

Thin topic on the Pi Forums suggests that
The config.txt syntax is not correct.

Code:
kernel=<kernel_name>
initramfs <initrd_name> followkernel
(with no =) looks promising.

The files listed in config.txt will be used in place of the defaults.
The kernel default is kernel8.img anh that will be the Foundation 5.4.y kernel branch, so it sounds like your kernel is not being used.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Nov 20, 2020 7:14 pm    Post subject: Reply with quote

Then how do I use my kernel? I'm not going to delete as for right now. I'll download, compile, the foundation one, create a new initramfs for it. I was reading the rpi3 64bit and it says that you're suppose to do mv 32bit out of the way. And what I did Is moved the 64bit away. That could be the whole issue. I'm going to reinstall the dtbs for the kernel move the 32 bit out of the way, retype the config.txt and remove the 64 from it. And if that doesn't work like I said before, I'll just install the foundation kernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Fri Nov 20, 2020 7:34 pm    Post subject: Reply with quote

kucklehead,

The only difference between lhe 32 bit and 64 bit dtb relates to the CPU.
It will run with the wrong dtb file, so that's not the problem.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Mon Nov 23, 2020 3:09 am    Post subject: Reply with quote

Kernel=kernel8.img just caused even more of a problem. When I didn't have it, and was booting off of the initramfs made by dracut, it couldn't find /dev/gentoo/root or /dev/gentoo/tmp. I have lvm built into the kernel itself. It seems to me that I should build my own initramfs instead of letting dracut or genkernel do it. Any suggestions? I was looking at busybox to build it. I also was again looking into u-boot, and was looking at the /boot on the ubuntu mate installation. It already as I said before uboot and grub2 on it. I was told there was not a need for grub2
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Mon Nov 23, 2020 10:02 am    Post subject: Reply with quote

kucklehead,

There is no need for u-boot, nor grub but you can use either if you wish.
I make my initrd by hand and its only userspace tools.

Use that link as a guide, it won't work without some changes for you.

You can omit the nod statements if you mount /dev at the start, with /proc and unmount it with /proc at the end of the int script.

I don't think your initrd was ever used as you said that the "kernel crashed".
An initrd normally has a rescue shell that is invoked when a command fails, so the kernel never gets the opportunity to crash once the initrd is mounted as root. LIke
Code:
# not needed on SSD
# /  (root)  I wimped out of root on lvm for this box
/sbin/mdadm --assemble /dev/md126 /dev/sda5 /dev/sdb5 /dev/sdc5 /dev/sdd5 || rescue_shell
# if root won't assemble, we are stuck


Or with a fail message
Code:
# get here with raid sets assembled and logical volumes available
# mounting rootfs on /mnt/root
uuidlabel_root || rescue_shell "Error with uuidlabel_root"

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Wed Nov 25, 2020 9:26 pm    Post subject: Reply with quote

I am using this guide:
https://wiki.gentoo.org/wiki/Early_Userspace_Mounting
And I am going to try combining this guide: https://wiki.gentoo.org/wiki/Old_Fashioned_Gentoo_Install#Making_the_initrd






What else do I need to change, or what can I view that can help me better understand what I need in this file:
Code:
    GNU nano 5.3                                                                             /usr/src/initramfs/initramfs_list                                                                                       
# directory structure
dir /proc   755 0 0
dir /usr        755 0 0
dir /bin        755 0 0
dir /sys        755 0 0
dir /var        755 0 0
dir /lib        755 0 0
dir /sbin   755 0 0
#dir /lib64      755 0 0
#dir /lib32      755 0 0
dir /mnt        755 0 0
dir /mnt/root   755 0 0
dir /etc        755 0 0
dir /root   700 0 0
dir /dev        755 0 0

# busybox
file /bin/busybox /bin/busybox 755 0 0

# libraries required by /sbin/fsck.ext4 and /sbin/fsck
file    /lib64/ld-linux-aarch64.so.1      /lib64/ld-linux-aarch64.so.1                  755 0 0
file    /lib64/libext2fs.so.2     /lib64/libext2fs.so.2                 755 0 0
file    /lib/libcom_err.so.2    /lib/libcom_err.so.2                755 0 0
file    /lib/libpthread.so.0    /lib/libpthread.so.0                755 0 0
file    /lib/libblkid.so.1   /lib/libblkid.so.1                  755 0 0
file    /lib/libmount.so.1   /lib/libmount.so.1                  755 0 0
file    /lib/libuuid.so.1   /lib/libuuid.so.1                   755 0 0
file    /lib/libe2p.so.2        /lib/libe2p.so.2                    755 0 0
file    /lib/libc.so.6          /lib/libc.so.6                      755 0 0
file    /lib/librt.so.1         /lib/librt.so.1                     755 0 0
file    /lib/libdl.so.2         /lib/libdl.so.2                     755 0 0

file    /sbin/fsck              /sbin/fsck                          755 0 0
file    /sbin/fsck.ext4         /sbin/fsck.ext4                     755 0 0

# our init script
file    /init                   /usr/src/initramfs/init             755 0 0
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Wed Nov 25, 2020 9:50 pm    Post subject: Reply with quote

kucklehead,

busybox should be built with the static USE flag.
If not, all the other files that it needs, as determined by
Code:
lddtree /bin/busybox
must be provided.

If you want to use root inside lvm, lvm needs to be included. With USE=static if possible or with all the things it needs if not.

This file is a list of all the pieces that will go into your initrd file. It tells where they can be found on your system and where they will go in the initrd.

Code:
]# our init script
file    /init                   /usr/src/initramfs/init             755 0 0
tells how to use the pieces to start lvm, find and moust root and eventually pass control to the real root filesystem.

There is a trap or two for the unwary.
/lib64/ld-linux-aarch64.so.1 is a symbolic link.
Code:
# ls /lib64/ld-linux-aarch64.so.1 -l
lrwxrwxrwx 1 root root 10 Nov 15 12:41 /lib64/ld-linux-aarch64.so.1 -> ld-2.32.so

You need both in the intrd or /lib64/ld-linux-aarch64.so.1 will point to a missing file.

To use the real /bin/mount, it needs to be included. busybox provides a limited mount command.

There is probably more. You will learn a lot when you debug it. Its not going to work first time for anyone. There is too much to get right.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Wed Nov 25, 2020 11:10 pm    Post subject: Reply with quote

Basically change the ls-arch64 to the file that it is appointing. and that applies with the whole list as it just appointing to a missing files. And the lvm files under the init line you mention, and add /bin/mount, also add all the partitions under that line? And could I pretend to execute the initramfs plus how can I debug it? I was thinking with qemu?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54242
Location: 56N 3W

PostPosted: Wed Nov 25, 2020 11:33 pm    Post subject: Reply with quote

kucklehead,

That depends on the initrd script.

If your kernel has DEVTMPFS, you can mount that on /dev and all the /dev entries you need will appear, created by the kernel.
When you do vgchange -ay in the intrd, /dev entries for your logical volumes will appear too.
If you choose not to use DEVTMPFS, you need to populate /dev for yourself.
Thats why all the /dev entries are in the initrd in https://wiki.gentoo.org/wiki/Old_Fashioned_Gentoo_Install#Making_the_initrd
DEVTMPFS is not used.

You will need mount and lvm in the initrd. fsck is required for error handling when you start after an unclean shutdown.
The initrd shell is provided by busybox.

If you can build the initrd content statically linked, it gets simpler to put together but as long as all the bits for a dynamically linked initrd are included, it works just as well.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Thu Nov 26, 2020 3:45 am    Post subject: Reply with quote

I followed that out line and produced this:

Code:
# directory structure
dir /proc       755 0 0
dir /usr        755 0 0
dir /bin        755 0 0
dir /sys        755 0 0
dir /var        755 0 0
dir /lib        755 0 0
dir /sbin       755 0 0
dir /lib64      755 0 0
#dir /lib32      755 0 0
dir /mnt        755 0 0
dir /mnt/root   755 0 0
dir /etc        755 0 0
dir /root       700 0 0
dir /dev        755 0 0
dir /dev/mapper 755 0 0


# dev/mmcblk and partitions
mknod /dev/mmcblk0        0660 0 0 b 8 0
mknod /dev/mmcblk0p1      0660 0 0 b 8 1
mknod /dev/mmcblk0p2      0660 0 0 b 8 2
#nod /dev/sda4           0660 0 0 b 8 4
#nod /dev/sda5           0660 0 0 b 8 5
#nod /dev/sda6           0660 0 0 b 8 6                                                                             

# dev/sdb and partitions
#nod /dev/sdb            0660 0 0 b 8 16
# ...
# dev/sdc and partitions
#nod /dev/sdc            0660 0 0 b 8 32

# all the lvm nodes I need
mknod /dev/gentoo/root            0660 0 0 b 253 0
mknod /dev/gentoo/swap            0660 0 0 b 253 1
mknod /dev/gentoo/var/log         0660 0 0 b 254 2
mknod /dev/gentoo/tmp

#slink /dev/stderr                       /proc/self/fd/2                 777 0 0
#slink /dev/stdin                        /proc/self/fd/0                 777 0 0
#slink /dev/std/out                      /proc/self/fd/1                 777 0 0


# busybox
file /bin/busybox /bin/busybox 755 0 0

# LVM
file /sbin/lvm.static           /sbin/lvm.static         755 0 0

# libraries required by /sbin/fsck.ext4 and /sbin/fsck
slink   /lib                            /lib64                          777 0 0
file    /lib64/ld-linux-aarch64.so.1  /lib64/ld-linux-aarch64.so.1      755 0 0
file    /lib64/libext2fs.so.2     /lib64/libext2fs.so.2                 755 0 0
file    /lib64/libcom_err.so.2    /lib64/libcom_err.so.2                755 0 0
file    /lib64/libpthread.so.0    /lib64/libpthread.so.0                755 0 0
file    /lib64/libblkid.so.1      /lib64/libblkid.so.1                  755 0 0
file    /lib64/libmount.so.1      /lib64/libmount.so.1                  755 0 0
file    /lib64/libuuid.so.1       /lib64/libuuid.so.1                   755 0 0
file    /lib/libe2p.so.2          /lib64/libe2p.so.2                    755 0 0
file    /lib64/libc.so.6          /lib64/libc.so.6                      755 0 0
file    /lib64/librt.so.1         /lib64/librt.so.1                     755 0 0
file    /lib64/libdl.so.2         /lib64/libdl.so.2                     755 0 0

file    /sbin/fsck              /sbin/fsck                          755 0 0
file    /sbin/fsck.ext4         /sbin/fsck.ext4                     755 0 0

# our init script
file    /init                   /usr/src/initramfs/init             755 0 0




It feels like I am still missing some stuff. Do I need to install the static-udev as well? And you mentioned that DEVMPTFS? i would prefer to make this a simple, and easy initrd build. Do you recommend to have that enabled? I believe I do have it enabled, cause your guide unchecks it. What's more reliable? Having the DEVTMPFS enabled or not? And you also mentioned about the --assemble /devsda5 etc. Is that were I put my lvm logic voulmes at or just the root?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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