Not clear how to boot from SD

Dear forum

Excuse for my long message…I will concentrate all doubt in last 2 week.

Im using the DB410.

Thanks for your help, expecially mr danielt, I was able after 2 week to build
my Kernel image using mkbooting (Kernel + dt+ initrd), the Linaro 18.1 version.

I also compiled the module.

All this on a ubuntu machine.

What is really not clear is how to insert this in a SD,and boot from it.

My doubt are:

  1. I find a already complete image, as for example the :
    *** dragonboard-410c-sdcard-developer-buster-359.img ***

This is working…I put in SD then system start from SD.

Also when I compiled the kernel I get a Mykern .img . (the kernl +dt+initrd.)

a)What is the difference bettwen this 2 image ? Maybe in the first xxxter-359.img
there is also a file system and some bootloader ?
How they come togheter in one .img file (tools )?

2)Can I use this SD ,read in what partition is the Kernel Image (Kern +dt+ inrtrd) and just
substitute my Mykern .img . (the kernl +dt+initrd.)?
In this way could be very easy

Can you suggest me some “good” image where can i start ?

3)In case i want create a bootable SD (i dont know the correct term), one of your guide
show what use for aboot,and also for boot…But if compilation dont consider the Modules
mkbooting is used before compile module) , where I put the module?

I means…the mkbooting tools create a image from Kernel+ dt+ intdr, but not consider the
module…Who consider them ?

So ,in general, could be nice to have a clear (for me) procedure on how to create a SD
and insert my kernel.

Excuse again for long text

Roberto

-1) Could be possible to use a already “working” SD ,for example with a already compiled image, and

-I create a

Great!

The system is run from a media (either eMMC or SDCARD) containing several partitions.
There are partitions for the bootloaders, the bootimage, rootfs, etc.
You usually flash these partitions one-by-one on eMMC with fastboot.
The SDCARD image contains all these partitions.

boot-image usually contains the kernel, the DTB and initrd.
The rootfs contains the distribution ‘filesystem’ (e.g. debian, yocto…).

When you insert the SDCARD, it’s normally detected as a device (/dev/sdX or /dev/mmcblkX…), if the partition table is correct partitions are also detected as /dev/sdXp0, /dev/sdXp1…

You can directly write to these partitions to change the content. Since they are labeled, they are also exposed in /dev/disk/by-partlabel/.

If you want to replace the SDCARD boot-image by your own, you can then write your boot-image to the /dev/disk/by-partlabel/boot partition (with cat or dd). Then sync and eject your card.

You should then be able to boot from SDCARD with your new kernel (check the Linux date in serial output).

3)In case i want create a bootable SD (i dont know the correct term), one of your guide
show what use for aboot,and also for boot…But if compilation dont consider the Modules
mkbooting is used before compile module) , where I put the module?

Yes If your kernel version is not aligned with the modules, they won’t be load, and ‘lsmod’ will return an empty list.

Modules live in the rootfs, a solution is to mount the partition to your Ubuntu machine and copy the modules to /lib/modules/. Normally rootfs is automatically mounted when you insert the SDCARD since it’s a known ext4 filesystem, if not, you can just execute ‘mount /dev/disk/by-partlabel/rootfs ~/my-rootfs-mount-point’.

From your kernel source you can then execute (with env variable previously set to build kernel):

make modules_install INSTALL_MOD_PATH=~/my-rootfs-mount-point/lib/modules/

This will install the module with correct version and dep files.

Then kernel will be able to load the module.

Thanks very much for your detailed reply

We try this procedure and is working…Thanks

If possible I ask again 2 question :slight_smile:

-seems that in this way could be possibl ealso to change the rootfs . But if we try, we get error, end we must
reflah all SD card…(for now in not important this option…Is just for curiosity)

-After giving a sudo upgrade , I cant see anymore the wify . The update dont give problem…upgrade yes.

Again Thanks for your time
and very specific reply

Rob

Yes, this is a known issue with releases:

1 Like

Thanks very much for your reply…

Roberto