tllim has quit [Read error: Connection reset by peer]
<fALSO>
bom dia
SopaXorzTaker has joined #linux-sunxi
<SopaXorzTaker>
How do I tell the kernel that my rootfs is in the ramdisk image?
<SopaXorzTaker>
I mean, I used miniroot to create an initramfs image.
<wens>
just have the bootloader load the initramfs image
clonak has quit [Read error: Connection reset by peer]
clonak_ has joined #linux-sunxi
<wens>
if your initramfs doesn't do pivot_root, then it stays on the initramfs :)
<SopaXorzTaker>
No, I mean, my kernel panics due to not finding a rootfs for some reason.
<wens>
then it's not going to the initramfs
<wens>
did you get the bootloader to load the initramfs into memory _and_ pass the memory address to the kernel?
<SopaXorzTaker>
The bootloader loads the initramfs uImage and verifies its checksum successfully, but I don't specify its address in the kernel arguments; should I do that?
<wens>
you have to tell the kernel. how else is it going to know about it?
<wens>
yeah, well pass the address as the second parameter?
<SopaXorzTaker>
That's what I'm doing right now and the kernel doesn't see it.
<wens>
does the bootloader complain about anything?
<KotCzarny>
maybe you are loading ramdisk with some wrapper?
<SopaXorzTaker>
No, it's seemingly fine and verifies the images successfully.
<KotCzarny>
pastebin the dmesg?
<wens>
I suggest just using bootz and get rid of the U-boot legacy image format
<wens>
it is the preferred way
<SopaXorzTaker>
Obtaining a log would be troublesome as I don't have an UART adapter attached (and I really, really should resolve that).
<KotCzarny>
yup, it might print something interesting in between
yann has joined #linux-sunxi
<SopaXorzTaker>
wens, so should I make a kernel zImage now?
<wens>
SopaXorzTaker: what is the format of your initramfs anyway? gzip?
<SopaXorzTaker>
Yes.
<SopaXorzTaker>
I built it using miniroot and then used mkimage against that to get an uInitrd.
<wens>
with or without the U-boot image wrapper?
<wens>
try using the .gz file instead?
<SopaXorzTaker>
Directly?
<wens>
don't know if U-boot supports that, but it's worth a try
<wens>
yeah
<SopaXorzTaker>
bootm verifies the image header, I won't be able to, I think.
<SopaXorzTaker>
>> "For at least the cubieboard with the mainline/devicetree kernel you will also want to set initrd_high before calling bootm, such as"
<SopaXorzTaker>
hmm
Mangy_Dog has joined #linux-sunxi
<SopaXorzTaker>
I shall try that, shall I?
<wens>
yeah, I think that was the other bit
<wens>
because U-boot relocates the initramfs image
<SopaXorzTaker>
And the kernel expects to find it at the original location?
<SopaXorzTaker>
Whoa, it crashed
_0x5eb_ has quit [Ping timeout: 272 seconds]
<wens>
The U-boot README gives a proper explanation. It's a bit long to post here.
<wens>
been a while since I used initramfs
ScrumpyJack has joined #linux-sunxi
<SopaXorzTaker>
> uInitrd must not fall inside the range 0x43000000-0x4FFFFFF due to memory allocation conflicts.
<SopaXorzTaker>
>> write 0x43300000 uInitrd
<SopaXorzTaker>
gotcha
<wens>
if initrd_high isn't set to 0xffffffff, looks like U-boot relocates it, and passed the new address to the kernel
<SopaXorzTaker>
Hmm, still crashing
Gerwin_J has joined #linux-sunxi
<wens>
probably something else.
<wens>
like your images might be overlapping
<wens>
btw, U-boot should provide some default values for kernel_addr_r, ramdisk_addr_r, fdt_addr_r, which you can use
<DuClare>
Ymmv, everything just kinda magically works for me with itbs
<wens>
they should be reasonably kept apart in memory so nothing overlaps, except for the largest of kernels/ramdisks
<wens>
something kernelCI has run into
suprothunderbolt has quit [Ping timeout: 248 seconds]
<MoeIcenowy>
wens: for initramfs it seems to be switch_root
<MoeIcenowy>
not pivot_root
popolon has joined #linux-sunxi
afaerber has joined #linux-sunxi
f0xx has quit [Ping timeout: 246 seconds]
<SopaXorzTaker>
I switched the framebuffer console to use a tiny font
<SopaXorzTaker>
I can see the error now, it's indeed what I suspected.
<wens>
which was?
<SopaXorzTaker>
It can't see any root partition.
<MoeIcenowy>
SopaXorzTaker: what screen are you using?
<MoeIcenowy>
I remember Linux will automatically use tiny font when screen is small
<KotCzarny>
but you need to find out why it doesnt mount ramdisk
<KotCzarny>
MoeIcenowy: default font is 8x16, you can use 8x8
<wens>
SopaXorzTaker: stupid question, do you have initramfs support built in the kernel?
<SopaXorzTaker>
MoeIcenowy, 1024x600, but I intentionally made the font 8x8 so that the error doesn't get scrolled past as I don't use the UART console.
<MoeIcenowy>
KotCzarny: when I'm using 480x272 LCD panel, it's automatically switched to 4x6
<SopaXorzTaker>
wens, hmm, that's not actually such a stupid question
<wens>
IIRC it is _not_ on in sunxi_defconfig
<MoeIcenowy>
SopaXorzTaker: did you pack the initramfs w/ mkimage?
<wens>
MoeIcenowy: he did
<MoeIcenowy>
wens: send a patch for it ;-)
<SopaXorzTaker>
In .config, there's CONFIG_INITRAMFS_SOURCE=""
<SopaXorzTaker>
(kernel)
<wens>
that's not it
<wens>
CONFIG_BLK_DEV_INITRD
<MoeIcenowy>
wens: initrd != initramfs
<SopaXorzTaker>
Oh, right before that, didn't see it.
<MoeIcenowy>
initramfs is a tmpfs, not about block device
<SopaXorzTaker>
Yes, it's set to "y"
<wens>
MoeIcenowy: Initial RAM filesystem and RAM disk (initramfs/initrd) support
<wens>
MoeIcenowy: :)
<SopaXorzTaker>
Okay, turns out I didn't update the script before trying, another attempt...
<wens>
MoeIcenowy: it goes through the same code path I believe, being checking if the bootloader specified an initrd/initramfs
<SopaXorzTaker>
I currently have > panic=30 rootwait fbcon=font:VGA8x8 initrd=0x42a00000 root=/dev/mem0 rw
<SopaXorzTaker>
It halts, as there's no /dev/mem0 (and I don't know if that's what I should be doing, but it doesn't see anything otherwise)
<MoeIcenowy>
SopaXorzTaker: it's not needed to pass initrd= for Linux kernel
<MoeIcenowy>
Linux kernel doesn't recognize it
<SopaXorzTaker>
It's also passed via bootm and the kernel doesn't see it.
<wens>
SopaXorzTaker: just drop both initrd= and root=
<wens>
SopaXorzTaker: you don't need them
<MoeIcenowy>
yes
<SopaXorzTaker>
That's what I was doing initially.
<MoeIcenowy>
root=/dev/mem0 is harmful for initramfs setup
<MoeIcenowy>
because initramfs is not backed by ram block device
<MoeIcenowy>
and root= is not intended for an initramfs
<wens>
SopaXorzTaker: again, you don't need them. with initramfs the kernel allocates a tmpfs mount and unpacks the initramfs stuff into it
<MoeIcenowy>
it's intended for real final /
<SopaXorzTaker>
So, how do I stop my kernel from wanting a rootfs?
<wens>
SopaXorzTaker: and with initramfs, the kernel will ignore root= . It's up to the initramfs tooling to mount and switch to the real root.
<MoeIcenowy>
SopaXorzTaker: build all your needed drivers in
<MoeIcenowy>
and just set root= your reall /
<wens>
SopaXorzTaker: with initramfs, the kernel will just load the initramfs and run init from it, and consider it done
<SopaXorzTaker>
I don't have a real /, only a miniroot initrd
<MoeIcenowy>
SopaXorzTaker: is it an initrd or an initramfs?
<MoeIcenowy>
initrd is a real disk image w/ a fs
<MoeIcenowy>
initramfs is just a cpio archive
<SopaXorzTaker>
It's actually the latter, I have a cpio archive there.
<wens>
SopaXorzTaker: if you don't see "Unpacking initramfs..." you are not getting initramfs for whatever reason
<MoeIcenowy>
SopaXorzTaker: do your initramfs have /init ?
<SopaXorzTaker>
wens, the kernel doesn't see initramfs for some reason, that's the issue.
<wens>
SopaXorzTaker: so did you check your kernel config yet?
<MoeIcenowy>
or /linuxrc
<MoeIcenowy>
(I didn't remember which one is really executed
<wens>
SopaXorzTaker: CONFIG_BLK_DEV_INITRD and CONFIG_RD_*
<MoeIcenowy>
oh it's /init
<MoeIcenowy>
for initramfs
<SopaXorzTaker>
CONFIG_RD_GZIP/BZIP2/whatever is set to y
<SopaXorzTaker>
I do have a /sbin/init in the initramfs
<MoeIcenowy>
it's /init for initramfs
<MoeIcenowy>
not /sbin/init
<SopaXorzTaker>
I don't think that's present, no
<wens>
IIRC /sbin/init works? buildroot images work fine for initramfs
<SopaXorzTaker>
I'll try making a new uImage in the meanwhile
<SopaXorzTaker>
also, somehow a kernel image showed up in the miniroot directory, but I only pointed it to the built kernel modules
fl_0 has quit [Quit: STRG + Q]
<SopaXorzTaker>
Let's try not specifying it at all, I wonder what the kernel will do
<SopaXorzTaker>
Hmm, the VFS error code seems to have changed
<wens>
you really need to get a proper console
<wens>
we basically have no idea what is happening with your system
ceng has quit [Ping timeout: 268 seconds]
<dgp>
and maybe just use buildroot to build a kernel with an initramsfs embedded in it to start with
<SopaXorzTaker>
dgp, that's a good idea.
Hell__ has joined #linux-sunxi
<dgp>
Are you using JTAG + a breakpoint on printk as a console?
<SopaXorzTaker>
with initramfs, the VFS reports error -2, else it's -6, interesting.
<wens>
dgp: he's using an LCD screen
<SopaXorzTaker>
dgp, no, I'm using a framebuffer console.
<dgp>
SopaXorzTaker: ok, just build a kernel with the initramfs included and go from there. Once you get a shell you'll be able to inspect /dev etc and see why it won't work
<SopaXorzTaker>
"just build a kernel with the initramfs included"
<SopaXorzTaker>
How can this be done?
<dgp>
buildroot
megi has joined #linux-sunxi
<wens>
buildroot image has /init, which just execs /sbin/init after setting up the console
<wens>
SopaXorzTaker: so maybe try adding /init to your image if you run out of ideas?
Hellsenberg has quit [Quit: CPU triple-faulted.]
Hellsenberg has joined #linux-sunxi
Hellsenberg has quit [Client Quit]
<wens>
SopaXorzTaker: oh, and increase the loglevel of your console
<wens>
the default loglevel is not enough for debugging issues
<SopaXorzTaker>
I've tried and it's apparently at the maximum verbosity.
<SopaXorzTaker>
If I don't specify an initramfs, it's > VFS: Cannnot open root device (null) or unknown-block(0,0): error -6
<SopaXorzTaker>
If I do specify the address, it becomes > VFS: Cannnot open root device (null) or unknown-block(0,0): error -2
<KotCzarny>
isnt there ramdisk howto on sunxi?
<SopaXorzTaker>
That's what I am following.
<KotCzarny>
basics: there are two types of ramdisk, block one and files one
<KotCzarny>
block one is called initrd, files one is initramfs
<KotCzarny>
the only address you have to specify is in uboot, where you load initrd into ram, then bootm/bootz uses that address
<KotCzarny>
initramfs doesnt use it at all
<KotCzarny>
to use initramfs, in kernel config you specify base dir of files
<KotCzarny>
to use initrd you have to prepare it yourself
<KotCzarny>
initramfs is glued to kernel during build, initrd is separate file
<wens>
you can also prepare initramfs yourself. it's just the difference of cpio vs rom/ram/cramfs
<KotCzarny>
wens, yeah, but lets stick to basic workflow
<wens>
I agree
<wens>
SopaXorzTaker: maybe you could take a literal screenshot (with a camera) and post it somewhere
<KotCzarny>
also, pastebin your .config
<wens>
SopaXorzTaker: that would help people here that are trying to help you have more clues
<wens>
SopaXorzTaker: otherwise we're just working in the dark, and TBH it's very frustrating
<SopaXorzTaker>
My kernel config is sunxi_defconfig, unmodified.
<KotCzarny>
does it enable initrd by default?
<SopaXorzTaker>
Yes.
<SopaXorzTaker>
Hmm, may this be caused by having CONFIG_BLOCK set?