[meta-xilinx] Using wic to generate sd-image and writing it correctly

Jean-Francois Dagenais jeff.dagenais at gmail.com
Tue Feb 20 13:46:17 PST 2018



> On Feb 20, 2018, at 16:29, Giordon Stark <kratsg at gmail.com> wrote:
> 
> 
> The script looks formatted weird in my email, but how is this script run or where? Is it part of bitbake, or separately? Do you use the wic output file, etc...?
> 
> 

Sorry about that, that'll teach me to think I can get away with a quick answer from an iPhone.

Here again:

if $IS_SD_CARD; then
    printWarning "adjusting sdcard's partitions"
    set +e
    command="sudo partprobe /dev/$DEVICE"
    echo "$command"; $command
    sudo udevadm settle
    command="sudo e2fsck -f /dev/${DEVICE}2"
    echo "$command"; $command
    command="sudo parted /dev/${DEVICE} resizepart 2 '100%'"
    echo "$command"; $command
    sudo udevadm settle
    command="sudo resize2fs /dev/${DEVICE}2"
    echo "$command"; $command
    set -e

    sync
fi



Sow we use a wrapper script called "writewic /path/to/tmp/image/deploy/myimage.wic /dev/sdX". It is invoked completely outside bitbake, post image build.

It will raw write (using dd or the like) to the device, then run the bit I pasted above.

I think this should/could be part of the poky/scripts directory as it is generic code which anybody could use. (I didn't check if someone already did something like this in there or in poky-contrib)

Cheers!


More information about the meta-xilinx mailing list