Last active
February 10, 2018 16:14
-
-
Save sxing/300b8a58c9f438fcc581 to your computer and use it in GitHub Desktop.
Raw commands for copying an Ubilinux image to an SD card.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# connect an SD card and mount it. Assuming Arduino expansion board. Also, mount the / partition into the rootcopy folder. | |
mkdir /home/sdcard | |
mkdir /home/rootcopy | |
mkdir /home/sdcard/image | |
mount /dev/mmcblk0p8 /home/rootcopy | |
mount /dev/mmcblk1p1 /home/sdcard | |
# copy the operating system to an empty ext4 image | |
dd if=/dev/zero of=/home/sdcard/edison-image-edison.ext4 count=1500 bs=1M iflag=fullblock | |
mkfs.ext4 /home/sdcard/edison-image-edison.ext4 | |
mount /home/sdcard/edison-image-edison.ext4 /home/sdcard/image | |
cp -r /home/rootcopy/* /home/sdcard/image/ | |
#unmount and cleanup | |
umount /home/sdcard/image | |
rm -r /home/sdcard/image | |
umount /home/sdcard | |
umount /home/rootcopy | |
rm -r /home/sdcard | |
rm -r /home/rootcopy | |
# thanks to Nick Chase for an updated dd command and checking through everything. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment