Bug #265

Replace tar extract with dd in mkinstall

Added by Hammel over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:14 Jan 2014
Priority:UrgentDue date:
Assignee:Hammel% Done:


Category:05 - Releases
Target version:0.8.0
Severity:02 - High


mkinstall mounts the rootfs dir and copies to it in an attempt to make the entire 2nd partition available after installation to the SD card. However, this often fails when trying to set the root user on all those files, possibly because the chown is running while data is still being pushed to the SD card.

To get around this I can create the ext3 image for the rootfs in buildroot.mk (the target is already there) and copy it to the pkg directory with buildroot-pkg. Then the mkinstall can be updated to remove the tar extraction line for the rootfs and replace it with these lines (before the partition is mounted):

sudo dd if=rootfs.ext3 of=$ROOTFSDIR bs=16384
sudo e2label $ROOTFSDIR rootfs
sudo e2fsck -f $ROOTFSDIR
sudo resize2fs $ROOTFSDIR

where the rootfs.ext3 filename should be made a variable like $RAMDISK (which currently points to the rootfs.tar file).

This will use dd to write to the disk first, then set the proper label, clean up the filesystem and then resize the filesystem to match the partition size. After that the partition can be mounted the the chown run.

Associated revisions

Revision b5c0a5a0
Added by Hammel over 7 years ago

RM #265: Switch to using rootfs.ext3 and dd to write to SD card during install.

Revision 374505b9
Added by Hammel over 7 years ago

RM #265: Fix make target to generate rootfs.ext3 file instead of ramdisk.ext3 so it matches mkinstall.sh.


#1 Updated by Hammel over 7 years ago

  • % Done changed from 0 to 50

Updates added and pushed upstream. Awaiting a full test with packaging.

#2 Updated by Hammel over 7 years ago

  • Status changed from New to Closed
  • % Done changed from 50 to 100

Tested with packaging. Works much better. I have had no lockups yet using this method, while with tar to the SD card was slower and often locked up requiring a host reboot.

Closing issue.

Also available in: Atom PDF