<Forty-Bot>
the if/then is nice if you need multiple commands
<Forty-Bot>
but it's personal preference IMO
WoC has joined #u-boot
mmu_man has quit [Ping timeout: 248 seconds]
mmu_man has joined #u-boot
tsraoien has quit [Quit: WeeChat 3.6]
tsraoien has joined #u-boot
brassado has joined #u-boot
WoC` has joined #u-boot
WoC has quit [Ping timeout: 244 seconds]
<marex>
Forty-Bot: sure
adams[1] has joined #u-boot
<adams[1]>
mkimage -D "-I dts -O dtb -p 1024" -f ${IMGDEPLOYDIR}/boot.its ${IMGDEPLOYDIR}/boot.img ---> Using this I created boot.img and then used "dumpimage -T flat_dt -l boot.img -p 1 -o output" this tool to extract ramdisk but both are not matching.
<adams[1]>
boot.its has kernel + ramdisk + dtb in that order.
<adams[1]>
I was able to match kernel and dtb but ramdisk is not matching and also during kernel boot uboot is not able to load ramdisk but succefully able to load kernel and device tree.
<adams[1]>
any pointers?
<hanetzer>
adams[1]: *any ;) but yeah. the cpio you extract, is it actually a cpio on extraction? eg, can you lsinitrd/cpio -t it, does file extracted.cpio return the correct kind of data?
GuestGuy has joined #u-boot
<adams[1]>
hanetzer: I did binary comparison. Shouldn't it match?
<hanetzer>
padding and such could change md5; also, did you set any compression params in the its?
<adams[1]>
hanetzer: all files are uncompressed.
<marex>
iow share the u-boot.its please , and check fdtdump u-boot.its (that prints the tree bundled into fitImage)
<marex>
you can even dd if=/of= the blob from the ITB , or use fdtget to dump the specific property with the blob if you dont use fitImage with external data, and compare that
<adams[1]>
https://ideone.com/RFFLGj this image works but it is different from my method where I am using boot.img for booting up.
<adams[1]>
in the "working" method, kernel and ramdisk are part of single .its file and also in that method we are flashing directly the fitImage and not creating boot.img.
<marex>
adams[1]: what happens if you plug in ramdisk-1 { ... cpio (without gz) and set compression = gzip } ?
<adams[1]>
marex: let me try
<marex>
adams[1]: I am not entirely sure whether you need to pass in cpio.gz or plain cpio with compression = gzip, try both
<marex>
compression=gzip would instruct u-boot fitImage loader to decompress the payload first
<marex>
adams[1]: also, by any chance, do you have 'initrd_high' set in U-Boot environment ?
naoki has joined #u-boot
<adams[1]>
wondering if you know how the uboot loads the initramfs image as in that .its file we are not passing loading address of initramfs?
<marex>
naoki: FYI, you can do load ... || load ... , or "if load ... else load fi ", the load command sets return value which u-boot shell conditionals can handle just fine
<adams[1]>
https://ideone.com/RFFLGj as I said with this it works but wondering why it doesn't have loading address of initramfs?
<marex>
adams[1]: it just copies the blob to load= address to my knowledge and then passes that address to the kernel
<marex>
adams[1]: u-boot will likely pick a suitable one near the end of RAM (near fdt_high) and relocate RD there
<adams[1]>
aha....
<marex>
have a look at boot/image-fit.c fit_image_load()
<adams[1]>
but shouldn't uboot print a log when it finds initramfs image like it does for kernel and dtb as below:
<adams[1]>
## Loading kernel from FIT Image at 12000000 ...
<adams[1]>
## Flattened Device Tree blob at 70065000
<marex>
that's where the loading should be implemented
<adams[1]>
compression doesn't count right?
<adams[1]>
as first uboot should find the ramdisk image
<marex>
right
<marex>
well, you can load the fitImage into RAM in U-Boot and then run 'iminfo' on it to verify the ramdisk is OK
<adams[1]>
I have googled up and found that whenever ramdisk gets found by uboot there are some logs which I am not getting it.
<adams[1]>
so i suspect the problem is creating the boot.img as when I extracted the ramdisk from it and the one I supplied, it doesn't match.
<adams[1]>
I did binary comparison.
<adams[1]>
mkimage -D "-I dts -O dtb -p 1024" -f ${IMGDEPLOYDIR}/boot.its ${IMGDEPLOYDIR}/boot.img ---> Using this I created boot.img and then used "dumpimage -T flat_dt -l boot.img -p 1 -o output" this tool to extract ramdisk but both are not matching.
<adams[1]>
so either I am using wrong commands to create boot.img or I am extracting wrong.
<marex>
adams[1]: you are doing some signed/encrypted boot though, right ?
<adams[1]>
adams[1]: I am not sure, I can check though.
<adams[1]>
marex: mkimage version 2021.07-g1a6716ec1c
scientes has joined #u-boot
<adams[1]>
zcat initramfs.cpio.gz | cpio -idmv --- using this I am able to see the contents of initramfs and whatever I packed.
<marex>
should be ok
<adams[1]>
well, you can load the fitImage into RAM in U-Boot and then run 'iminfo' on it to verify the ramdisk is OK -- i like this idea, do you have some steps how to load fitImage into RAM? I flashed the boot.img which has the images, after that do I need to go to some offset and load ?
<adams[1]>
marex: or is there any way to create boot.img using mkimage using fitImage of kernel which has both kernel + ramfs ?
alpernebbi has quit [Ping timeout: 244 seconds]
scientes has quit [Ping timeout: 252 seconds]
alpernebbi has joined #u-boot
tsraoien has quit [Ping timeout: 268 seconds]
WoC` has quit [Remote host closed the connection]
WoC` has joined #u-boot
camus has quit [Remote host closed the connection]
camus has joined #u-boot
camus has quit [Remote host closed the connection]
camus has joined #u-boot
camus has quit [Remote host closed the connection]
camus has joined #u-boot
camus has quit [Remote host closed the connection]