about summary refs log tree commit diff stats
path: root/core/scripts/setup-target.sh
blob: e64bfe11e32fa3b2d22e4322151549313cca6673 (plain) (blame)
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
#!/bin/sh

# First we define the function
ConfirmOrExit ()
{
    while true
    do
        echo -n "Please confirm (y or n) :"
        read CONFIRM
        case $CONFIRM in
            y|Y|YES|yes|Yes) break ;;
            n|N|no|NO|No)
                echo "Aborting - you entered $CONFIRM"
                exit
                ;;
            *) echo "Please enter only y or n"
        esac
    done
    echo "You entered $CONFIRM. Continuing ..."
}

DEV=$1

echo "Device: $DEV\n"
ConfirmOrExit

parted --script $DEV \
    mklabel gpt \
    mkpart ESP fat32 1MiB 120MiB \
    mkpart primary ext4 120MiB 376MiB \
    mkpart primary ext4 376MiB 4376MiB \
    mkpart primary ext4 4376MiB 5000MiB \
    set 1 boot on

exit 0;