I’m facing an issue when trying to write an image on a SD card. The image was generated by the Wic tool :
wic create sdimage-8G.wks -e gnuradio-dev-image -o images/$MACHINE
where gnuradio-dev-image
is the name of the image to use the artifacts from, images/$MACHINE
is the name of the output directory and sdimage-8G.wks
is the kickstart file, here is is :
# short-description: Create SD card image with a boot partition
# long-description: Creates a partitioned SD card image. Boot files
# are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4 --size 5500
This is actually part of the Yocto project. The image seems to be correctly deployed, the BOOT partition (/dev/sda1
) has the kernel/device-tree/bootloader files and the ROOTFS (/dev/sda2
) is good too, unless the ownership problem.
Before dd the image to the SD card, I erased it completely using the Disks app, ejected it, plugged it back and then ran the following command :
sudo dd bs=4M if=my-image.direct of=/dev/sda
Once the work is finished, if I check the owners of the root file system with ls -l
, I can see it’s owned by me (user) and not root.
This leads to a read-only filesystem which in then non bootable...
Does anyone already had the same problem ?
I can't use my dev machine right now so I can't share the exact output of ls -l
but what I can say is that when I change the owner of the whole FS with sudo chown -R root:root *
inside the mounted FS, the card becomes bootable.
dd
is completely irrelevant here, it's just copying the disk image without changing it. Garbage in, garbage out. The problem is during the creation of the disk image. – Gilles 'SO- stop being evil' Jul 25 '18 at 20:39