2017-10-23 08:15:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Remove old partitions on emmc.
|
|
|
|
dd if=/dev/zero of=/dev/mmcblk1 bs=512 count=1
|
|
|
|
|
|
|
|
# Create new partition table.
|
|
|
|
echo "n
|
|
|
|
p
|
|
|
|
1
|
|
|
|
|
|
|
|
+70M
|
|
|
|
a
|
|
|
|
t
|
|
|
|
c
|
|
|
|
n
|
|
|
|
p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w" | fdisk /dev/mmcblk1
|
|
|
|
|
|
|
|
# Create file systems.
|
|
|
|
mkfs.vfat -F 32 -n "boot" /dev/mmcblk1p1
|
2018-03-14 08:29:18 +00:00
|
|
|
yes | mkfs.ext4 -L "rootfs" /dev/mmcblk1p2
|
2017-10-23 08:15:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Flash boot partition.
|
|
|
|
mount /dev/mmcblk1p1 /media
|
|
|
|
cp MLO /media
|
|
|
|
cp u-boot.img /media
|
2018-03-14 08:29:18 +00:00
|
|
|
cp uExt.txt /media
|
2017-10-23 08:15:38 +00:00
|
|
|
sync
|
|
|
|
umount /dev/mmcblk1p1
|
|
|
|
|
|
|
|
# Flash rootfs partition
|
|
|
|
mount /dev/mmcblk1p2 /media
|
|
|
|
tar -C /media -xf rootfs.tar.bz2
|
|
|
|
sync
|
|
|
|
umount /dev/mmcblk1p2
|
|
|
|
|