-
Notifications
You must be signed in to change notification settings - Fork 1
/
ti-old-omap-card-part.sh
executable file
·45 lines (34 loc) · 1.48 KB
/
ti-old-omap-card-part.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/bash
# ti-old-omap-card-part.sh
# (c) Copyright 2018 Andreas Müller <[email protected]>
# Licensed under terms of GPLv2
#
# This script prepares partitions on SDCards. It wraps
# http://omappedia.org/wiki/Minimal-FS_SD_Configuration by dialog based GUI.
# includes
. `dirname $0`/include/common-helpers.inc
. `dirname $0`/include/card-helpers.inc
# overrride default SelectInOut - we have nothing to deploy here
SelectInOut() {
# DevicePath for target card
SelectCardDevice
}
# implement here - not im machine-ti-old-omap.inc
RootCardWriteCallback() {
# evt. write partition table
CheckPartitionTable "$DevicePath"
# kill u-boot environment
EvalExAuto "dd if=/dev/zero of=$DevicePath bs=1024 count=1024" "\nKill u-boot environment..."
# Create the FAT partition of 64MB and make it bootable
EvalExAuto "parted -s $DevicePath mklabel msdos && parted -s $DevicePath mkpart primary fat32 63s 64MB && parted -s $DevicePath toggle 1 boot" "\nCreate boot partition..."
# Create the rootfs partition until end of device
EvalExAuto "parted -s $DevicePath -- mkpart primary ext4 64MB -0" "\nCreate rootfs partition..."
# create filesystems
EvalExAuto "mkfs.vfat -F 32 -n "boot" -I ${DevicePath}1" "\nCreate boot filesystem..."
EvalExAuto "mke2fs -F -j -t ext4 -L "rootfs" ${DevicePath}2" "\nCreate rootfs filesystem..."
}
CheckPrerequisite "parted"
CheckPrerequisite "dd"
CheckPrerequisite "mkfs.vfat"
CheckPrerequisite "mke2fs"
StartCardWrite