View previous topic :: View next topic |
Author |
Message |
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Thu Apr 22, 2021 2:48 am Post subject: |
|
|
Yeah, I grabbed it already, and as I said before, it wouldn't boot up; just a rainbow screen. I linked my config file showing what I have configured, I do have lvm support, zswap and other stuff enabled in there. For some reason, I can boot off the bleeding-edge no problem, but I still get this error:
Code: |
cat: can't open '/proc/cmdline' no file or directory
|
I removed the kernel string from the pi4 and still saying that. I got this error when I closed out of it aka exit and got this error:
Code: |
CPU: 0 PID:3 Comm: sh
|
It all leads back to the part where my init is looking for /proc/cmdline which is located in my boot folder
Proof of something is acting weird with the /proc/cmdline:
https://www.linuxquestions.org/questions/linux-kernel-70/kernel-panic-not-syncing-attempted-to-kill-init-pid-1-comm-init-not-tainted-2-a-886991/
And here is my 5.12.y kernel config:
http://dpaste.com/DYJEHAVYF |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2003
|
Posted: Thu Apr 22, 2021 9:18 am Post subject: |
|
|
kucklehead wrote: | I moved all the kernel commands into the cmdline.txt, and tried booting off bleeding-edge kernel, and it shows three raspberries and no output. I installed 5.10.11 and all I get is a black screen...
These are the commands that I tried without no issues and now I am getting issues with them
Code: |
make menuconfig; make -j4 Image modules dtbs; make modules_install dtbs_install; rm -r /boot/overlays/* cp /boot/dtbs/5.12.0-rc8-v8/overlays/* /boot/overlays/; rm -r /boot/dtbs; rm -r /boot/rpi-5.12.0-v8.img; cp /usr/src/linux/arch/arm64/boot/Image /boot/rpi-5.10.11-v8.img
|
... |
I presume you retyped this rather than cut & paste, but there's a typo, unless you really meant to remove all of cp, /boot/dtbs/5.12.0-rc8-v8/overlays/* and /boot/overlays/! _________________ Greybeard |
|
Back to top |
|
|
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Thu Apr 22, 2021 4:15 pm Post subject: |
|
|
Yeah, I have to, in which I reinstall all the modules again after compiling the kernel. Again this is for a pi4 systemd which I should've stated in the title |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21619
|
Posted: Thu Apr 22, 2021 5:02 pm Post subject: |
|
|
kucklehead wrote: | Yeah, I have to, in which I reinstall all the modules again after compiling the kernel. Again this is for a pi4 systemd which I should've stated in the title | You can amend the title by editing the first post in the thread. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Thu Apr 22, 2021 5:32 pm Post subject: |
|
|
kucklehead,
Understand a little of the Pi 4 boot process.
The firmware in the SPI ROM, which you can and should update, starts everything off.
Its executed on the GPU. The ARM CPU is held in reset until everything in in place.
It loads one of the start4*.elf and matching fixup4*.dat files.
The draw the 'rainbow' test screen and read the config.txt to find out what to do.
With that done the files that need to be loaded, like the kernel, initrd, cmdline.txt, *dtb and any *.dtbo are loaded into RAM.
Only now in the ARM CPU released from reset and arm code execution begins.
Now its just the kernel, initrd and the initrd init script. Everything else os on the root filesystem, which the the intird and init script are going to mount.
Nothing else matters. Its all out of reach until root is mounted.
All the kernel drivers required to mount the root filesystem must be configured as <*> since we don't want them in the initrd.
All the userspace tools and supporting libraries need to be in the initrd.
All the commands needed to mount root must be in the init script. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Thu Apr 22, 2021 8:46 pm Post subject: |
|
|
kucklehead,
I've had two goes at this now. First root in LVM without an initrd. That uses dm-init. It failed.
I tried the same thing with an initrd. That failed too but gave me some useful information.
Left to its own devices, my initrd assumes everything is ready when its needed.
For this test, I have root in LVM on SD card. SD cards are slow to become ready.
My initrd init script reads
Code: | ...
# start for real here
/bin/mount -t proc proc /proc
/bin/mount -t sysfs sysfs /sys
/bin/mount -t devtmpfs dev /dev
# After /dev is mounted or the /dev targets will be hidden.
ln -s /proc/self/fd/2 /dev/stderr || rescue_shell "symlink /dev/stderr failed"
ln -s /proc/self/fd/0 /dev/stdin || rescue_shell "symlink /dev/stdin failed"
ln -s /proc/self/fd/1 /dev/stdout || rescue_shell "symlink /dev/stdout failed"
# start the Pi_4 volume group
# This is on the SD card for testing but likely to be moved to USB.
/sbin/vgchange -ay Pi4 || rescue_shell "lvchange Pi_4 failed"
... |
The /sbin/vgchange -ay Pi4 command fails but works from the rescue shell.
I was able to type the /sbin/vgchange -ay Pi4 and the rest of the commands and the Pi booted
What is needed is a check that the PV or VG is available before the vgchange command.
A sleep would work but its suboptimal.
My /boot/cmdline is
Code: | dwc_otg.lpm_enable=0 8250.nr_uarts=1 console=ttyAMA0,115200 console=tty cma=256M@256M root=UUID=ac1556c0-1c8d-4a1a-82f9-cd6cfbad903d rootfstype=ext4 |
I was expecting to need the serial port.
-- edit --
As expected, a sleep before the vgchange works but not all SD cards will want the same delay. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Fri Apr 23, 2021 4:34 am Post subject: |
|
|
What does this do exactly?
Code: |
dwc_otg.lpm_enable=0 8250.nr_uarts=1
|
I've seen it before in that post but didn't really pay attention to it. And I'll look into hardware and make sure everything is configured.
I am assuming that I don't have /proc built into my kernel, I'll recompile it again and make sure I have all the configurations set. compiling the bleeding-edge which enables random stuff that I don't know versus the 5.10.11. I know it is not recommended, but it seems to work for me better than the LTF foundation kernel; I don't know why as I do the exact same thing with my other installation. Basically my openrc. I have this gut feeling if I were to move the break_requested function after the start for real here of my script, it would work. I fixed that one error as the gpu_mem=128 caused it. Or it could be something with the function itself that needs to be altered. That said, if I need to build the /proc into my kernel where would that be exactly? Or better yet I could search for it. Also, does the || mean or? Cause it would make sense if the statement fails it will boot into the shell. Why do you have it set as /bin/dev? Do I have to do the same thing? Was thinking on adding the rescue_shell to my lvm statement, but have been hesitant as I don't see it loading up the lvm anymore. Could it be that I didn't install it from a different overlay? It would make sense if that was the case. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Apr 23, 2021 12:23 pm Post subject: |
|
|
kucklehead,
Code: | dwc_otg.lpm_enable=0 | turns off power management for the USB2 OTG port.
That is is the power connector on the Pi4 but its the only USB on the other models.
sets the kernel to use one UART. The Pi has several.
Bluetooth is normally on the first UART but the blutooth can be disabled so that it can be used for a serial console.
Is this wiki page helpful?
It still needs some fine tuning but it works for me. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Apr 23, 2021 12:27 pm Post subject: |
|
|
kucklehead,
Nothing works without procfs support in the 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 |
|
|
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Wed Apr 28, 2021 4:38 pm Post subject: |
|
|
How would I debug /proc/cmdline no file or directory when I get into my shell? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Wed Apr 28, 2021 7:08 pm Post subject: |
|
|
kucklehead,
It the shell, type
Code: | mount -t procfs proc /proc |
What is the error or is it there now?
With proc not mounted, that may not work at all as stdin, stdout and stderr are missing.
It possibly points to a typo in your initrd. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21619
|
Posted: Wed Apr 28, 2021 7:12 pm Post subject: |
|
|
As best I can tell, /proc/cmdline is not optional. If you do not have it, then /proc is not mounted as a procfs. This could be because you failed to mount procfs, or because procfs cannot be mounted (perhaps because it is absent from the kernel). Ordinarily, I would advise you to check /proc/mounts, but that is also part of procfs, so there is a good chance that will be absent. You could try manually mounting procfs on /proc. If it succeeds, you know the initramfs failed to do that automatically. If it fails, then it is likely because your kernel lacks support for procfs. |
|
Back to top |
|
|
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Sun May 02, 2021 4:02 pm Post subject: |
|
|
Big thanks to you all and bigger thanks to Neddy for being patient. This is my init script right now
http://dpaste.com/FPWWZ53DC
And here is my initramfs
http://dpaste.com/CZ2SAU527
Update:
I am getting this again
Code: |
*** stack smashing detected ***: terminated
Aborted
|
I am thinking it's because the init script is loading fast as this is what it is saying:
Code: |
random: fast init done
|
I did this before as I pulled in the switch_root, halt, poweroff, libraries from the /bin directory, and I am using the 5.12.y kernel. I had really bad luck with 5.10.11.y as I mentioned before I just get a black screen, and I don't understand why? The commands I run work I know this because I built openrc which needs some more tweaking |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sun May 02, 2021 5:48 pm Post subject: |
|
|
kucklehead,
Code: | random: fast init done | is from the kernel. Its an informational message and can be ignored.
I have no idea where Code: | *** stack smashing detected ***: terminated
Aborted | comes from.
Do you have any web space where you can host tarballs of your build?
If not, I can host mine and you can do the compare.
If I give you my /boot, you can put it onto an SD card and watch in fail to do the vgchange.
That will get you into the rescue_shell.
From there, you can do the rest by hand.
After the Code: | exec switch_root ... | there will be no kernel modules to load so there will be lots of error messages but it should fet to the login prompt.
I can provide a tarball of the modules too if you want.
I would like to rule out that its actually working bot the root fliesystem is producing the
Code: | *** stack smashing detected ***: terminated
Aborted | error.
I know my system does not do that. Thoughts ?
-- edit --
Its at http://bloodnoc.org/~roy/knucklehead/ _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
kucklehead Tux's lil' helper
Joined: 13 Oct 2020 Posts: 108
|
Posted: Sun May 02, 2021 8:53 pm Post subject: |
|
|
I will take a look at it and compare my modules with yours, and find out what is really going on |
|
Back to top |
|
|
|