Partition layout for snappy?

how to create partition table on emmc for snappy boot?

Regards…

that totally depends on your hardware and how it boots :slight_smile: can you be a little bit more specific ?

in general, you would create the image properly partitioned in advance like done for the SD card images and then simply dd/flash it to the MMC device.

Hi ogra,
I have used dd command to copy ubuntu core image to emmc then i observed below logs
[0] welcome to lk
[10] platform_init()
[10] target_init()
[20] initialising mmc_slot =2
[20] Error: Command timeout error
[20] Failure getting OCR response from MMC Card
[30] MMC card failed to respond, try for SD card
[30] Error: Command timeout error
[30] The response for CMD8 does not match the supplied value
[40] Failed to initialize SD card
[40] Failed detecting MMC/SDC @ slot2
[50] Error: Command timeout error
[50] Failure getting OCR response from MMC Card
[50] MMC card failed to respond, try for SD card
[60] Error: Command timeout error
[60] The response for CMD8 does not match the supplied value
[70] Failed to initialize SD card
[70] Failed detecting MMC/SDC @ slot2
[70] mmc init failed![70] panic (caller 0x8f600efc): ASSERT FAILED at (target/msm8916/init.c:131): 0
[80] SCM call: 0x2000110 failed with :ffffffff
[80] HALT: reboot into dload mode…
[80] SCM call: 0x82000901 failed with :ffffffff

so clearly from logs we can observe that mmc initialisation is getting failed.
Is this problem related to mmc_slot? do we need to change the mmc slot somewhere?

Regards,.

no, you need to patch the little-kernel and create your own gadget, the gadget in the ubuntu image has a little-kernel that initializes the SD card, not the MMC …

see http://bazaar.launchpad.net/~ogra/+junk/dragonboard/view/head:/README#L67 how the little-kernel in use was built.

ok…thanks for the info…

Hi again,
I changed the lk, now im able to get pass beyond bootloader stage,but then kernel is not booting up…

u-boot is not able to read kernel,dtb and initrd image…

below are the logs
U-Boot 2016.01-rc1 (Dec 08 2015 - 11:39:05 +0000)
Qualcomm-DragonBoard 410C

DRAM: 986 MiB
MMC: msm_sdhci: 0, msm_sdhci: 1
Card did not respond to voltage select!
** Bad device mmc 1 **
Using default environment

In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
starting USB…
USB0: USB EHCI 1.00
scanning bus 0 for devices… 3 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found
scanning usb for ethernet devices… 0 Ethernet Device(s) found

can u suggest me what to do further.

the uboot.patch that is mentioned in the README points to SD card too, this will need changing …

i.e.:

#define FAT_ENV_DEVICE_AND_PART "1:8"
might need changing to:
#define FAT_ENV_DEVICE_AND_PART "0:8"

Hi ogra,
I made the above changes ,still facing the same issue…

U-Boot 2016.01-rc1 (Dec 08 2015 - 11:39:05 +0000)
Qualcomm-DragonBoard 410C

DRAM: 986 MiB
MMC: msm_sdhci: 0, msm_sdhci: 1
Card did not respond to voltage select!
** Bad device mmc 1 **
Using default environment

In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
starting USB…
USB0: USB EHCI 1.00
scanning bus 0 for devices… 3 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found
scanning usb for ethernet devices… 0 Ethernet Device(s) found
No ethernet found

well, that still looks for the SD … can you actually see the MMC content later when you are at the uboot prompt ? (do you see partitions, partition content for the system-boot partition when you try via uboot commands)

yeah, im able to see partitions
Partition GUID
1 0x00000800 0x00000fff “sbl1”
attrs: 0x0000000000000000
type: dea0ba2c-cbdd-4805-b4f9-f428251c3e98
guid: f5a87e0b-bc6a-4c32-b326-984b881cb260
2 0x00001000 0x000017ff “rpm”
attrs: 0x0000000000000000
type: 098df793-d712-413d-9d4e-89d711772228
guid: a1d354d2-1ede-4532-8d65-320a408e0b57
3 0x00001800 0x00001fff “tz”
attrs: 0x0000000000000000
type: a053aa7f-40b8-4b1c-ba08-2f68ac71a4f4
guid: ddea39e9-04cd-443a-b4ff-6e7c5a2a9472
4 0x00002000 0x000027ff “hyp”
attrs: 0x0000000000000000
type: e1a6a689-0c8d-4cc6-b4e8-55a4320fbd8a
guid: 0f68d9d2-3473-48b0-b99b-91d195837ec9
5 0x00002800 0x00002fff “sec”
attrs: 0x0000000000000000
type: 303e6ac3-af15-4c54-9e9b-d9a8fbecf401
guid: da945630-a4b4-41af-aba0-1b30a0cc9723
6 0x00003000 0x00003fff “aboot”
attrs: 0x0000000000000000
type: 400ffdcd-22e0-47e7-9a23-f16ed9382388
guid: 3900ab6b-e2f8-45e3-9aec-bf40d96a9983
7 0x00004000 0x000047ff “boot”
attrs: 0x0000000000000000
type: 20117f86-e985-4357-b9ee-374bc1d8487d
guid: 50aa5022-6467-4985-a3b7-4d3b6ae9e087
8 0x00004800 0x000447ff “system-boot”
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 98048af6-1ccb-4a99-9434-d7bb4508b04a
9 0x00044800 0x000d2567 “writable”
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
guid: 54860902-c3ae-4578-b922-7d2566256bc8
=>

if you are still interested in emmc boot, feel free to use this gadget snap:
https://github.com/kubiko/dragonboard-gadget/tree/emmc-boot

urgh, why did yo make it a fastboot multipartition multi img build instead of a properly buildable and dd-able multipartition single img as we discusse before :confused:

Hi ogra/ondra,
when i try to build ubuntu core image with above mentioned gadget(kubiko’s dragonboard-gadget) im getting this strange error
error: cannot find boot config in “/tmp/tmpyoo1qd2k/unpack/gadget”

what might be missing there?

Regards
Laxman

Hi,
softlink to uboot.env is missing,so got that error.

Yup Thanks its booting from emmc…Thanks for your support guys

Regards

Hi ogra/ondra,
i used dd command to flash ubuntu core image to emmc .

Now i wanted to flash through fastboot so need to generate system-boot.img and writable.img.
But those are the part of kernel snap.so how to segregate system-boot.img and writable.img from kernel snap so that i can flash them by fastboot commands.

Regards,
Laxman

You can use the -w option to ubuntu-image:

ogra@anubis:~/testbuild$ ubuntu-image -w . dragonboard-model.assertion 
Fetching core
Fetching dragonboard-kernel
Fetching dragonboard
ogra@anubis:~/testbuild$ ls volumes/dragonboard/*.img
volumes/dragonboard/part0.img
volumes/dragonboard/part1.img
volumes/dragonboard/part2.img
volumes/dragonboard/part3.img
volumes/dragonboard/part4.img
volumes/dragonboard/part5.img
volumes/dragonboard/part6.img
volumes/dragonboard/part7.img
volumes/dragonboard/part8.img

Usually the last partition is always “writable” in the current Ubuntu Core images and when looking at the gadget.yaml file in ./ you will find that system-boot is part7.img

Thanks ogra, i verified with it and now board is booting with fastboot.Thanks a lot.

Regards
Laxman

Hi ogra,
i need your help.
I just added some more files to firmware so that the size of writable image increased from 183M to 191M. now if i try to flash writable image im getting below error
Invalid sparse file format at header magi
fastboot: …/libsparse/sparse.c:144: write_all_blocks: Assertion `pad >= 0’ failed.
Aborted (core dumped)
if i revert the changes in firmware then im not getting any error.
so is this related to size of writable partition?
How can i change the size of it and i observed only 236M is total size of writable.

Regards,
Laxman

writable is generated based on the contents of the partition at build time of the image … how exactly did you add the additional firmware ? it should be added to the kernel snap, then you should use ubuntu-image and then re-flash the whole image from scratch since you need the generated GPT with proper numbers …

An alternative is to define an image size in the ubuntu-image call that is big enough to fit extra stuff in when you do the initial build of the image.

I.e. make your image be 1G big, that will add extra space to writable in the partition table and allow you to flash bigger content.