Last active
August 31, 2015 10:10
-
-
Save DVDPT/910fe1900dd081551ca8 to your computer and use it in GitHub Desktop.
Create SD Card default partitions
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
card = //sd card device /dev/sdb | |
BOOT_PARTITION_START = 0 | |
BOOT_PARTITION_SIZE = 8 //mb | |
ROOTFS_PARTITION_SIZE = 4096 | |
FAT_FILE_SYSTEM = c | |
EXT4_FILE_SYSTEM = 83 | |
// Create partitions | |
sfdisk --force -uM ${card} << EOF | |
${BOOT_PARTITION_START}, ${BOOT_PARTITION_SIZE}, ${FAT_FILE_SYSTEM}, | |
,${ROOTFS_PARTITION_SIZE}, ${EXT4_FILE_SYSTEM} EOF | |
// Format partition to fat | |
mkfs.vfat -n boot ${card}1 | |
// Format partition to ext4 | |
mkfs.ext4 ${card}2 -Lrootfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment