sysdeploy/drive.inc

26 lines
573 B
Bash

#!/bin/bash
function setup_drive
{
local drive="$1"
parted -s "$drive" -- \
mklabel gpt \
unit MiB \
mkpart '"EFI system partition"' fat32 1 1024 \
set 1 esp on \
mkpart '"root unused"' ext4 1025 2048 \
mkpart '"root unused"' ext4 2049 3072 \
mkpart '"root unused"' ext4 3073 4096 \
mkpart Encrypted ext4 4097 -1
}
function rename_partition
{
local drive="$1"
local partition="$2"
local new_label="$3"
parted -s "$drive" -- name "$partition" '"'"$new_label"'"'
}
# vim: set ft=sh: