This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62: creating a custom debian image

Part Number: SK-AM62

Hello!

I am trying to create a custom Debian image. I am reusing the kernel, u-boot, spl etc from the existing TI release. This is how I am doing it.

1. create a file that will act as the disk image.

dd if=/dev/zero of=disk3.img bs=1M count=4096 status=progress

2. use fdisk disk3.img and partition the disk with two partition: one, a Fat32 (partition type 0c) and another an ext4 one. Make the dos partition bootable.

3. mount the partition1 (dos) as loopback device. (losetup to find out a free loop device and then do losetup -fP disk3.img and it then shows up as loopXXp1 and loopXXp2

4. Copy the files from the TI Debian release's boot partition into the p1 device above via the mounted directory and a rootfs into p2.

5. sync, unmount and use dd to write into an SD card.

Unfortunately this SD Card does not boot at all. Nothing shows up in the screen on the serial port. I can mount this SD Card on a host computer and the partition and file system is all fine. I can also read the files fine.

I am wondering if I am doing anything wrong.

I also tried the create-sdcard.sh script which required the sdcard to be inserted during the process. That works fine. I can also manually do the above process on the real sdcard device and it works fine. However, if I create an image file and then do it, it doesn't work. I would really like to have an image file on which further work can happen and also that the image can be shared with other team members. Can you suggest any solutions or spot any issues my process above?

Thanks

Ram

  • Since you have a known-good working reference point (the SD card created with create-sdcard.sh) I would suggest you compare the partition sizes/layouts/attributes of that SD card, with the one you created using your loopback approach (and then written to another card using `dd`), looking for and eliminating any differences.

    Also it's always critical to have the correct tiboot3.bin file, as those are different for GP vs. HS-FS devices. So read that file back and do a binary compare between your working and NG SD cards just to make sure.

    Regards, Andreas

  • Thanks Andreas. I did take an md5sum of all the files in my image as well as the ones on the working sdcard and  they matched. All the parameters like sector start address etc seem fine.

    tiboot3.bin has a signature on it (file command on tiboot3.img says "Certificate, version 3"). But I am running it on a GP device. Looks like that is okay as the certificate would be ignored?

    I also checked the minimal platform boot document section 5.1 ("common issues"). I am using the same binaries that sdcard boots with, for the image creation, so that is obviously not an issue.

    I made both the partitions bootable (just in case something weird is expected out of the partitions..). Nope. No luck with that too.

    I eventually created a boot.img out of the first partition of an existing working SDCard and wrote it at the right offset into a disk file and loop mounted it to verify it and once that is written into the sdcard, it boots fine.

    It is very strange. I also looked at the TRM for am62 to see if any specific name/case sensitivity is needed for the bootloaders. But I don't see anything mentioned there. I also looked at silicon errata document to make sure there isn't anything obvious that I am missing. But as they say "select() is not broken". :-) The issue is probably in one of my steps and I haven't found it yet. But I can now move on and create an image for distribution among my other colleagues. So, for now, I am unblocked.

    I have used the same method in the past to create bootable image for other boards like raspberry pi. Internet has a number of such examples as well. So, I am puzzled on why this didn't work.

    best regards

    Ramakrishnan

  • Hi Ramakrishnan,

    Our expert is out of office. Please allow until next week for a response.

    Best Regards,

    Anshu