Skip to content

Instantly share code, notes, and snippets.

@clojens
Created March 14, 2015 19:01
Show Gist options
  • Save clojens/bad82b0b11ecac3ddc46 to your computer and use it in GitHub Desktop.
Save clojens/bad82b0b11ecac3ddc46 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
#
# Install script for ArchLinux on Transip VPS Blade XX
#
# For Capital Locations Application (CLApp) Booking
# made by Solobit
#
: ${(AA)=diskcfg::=
1 +2M:BIOS:EF02:X
2 +6G:SWAP:8200:X
3 +500M:BOOT:8300:EXT4
4 +8G:ROOT:8300:EXT4
5 +35G:USER:8300:EXT4
6 +25G:MORE:8300:EXT4
7 +15G:OPTS:8300:EXT4
8 +15G:SERV:8300:EXT4
9 +25G:LOGS:8300:REISERFS
10 0:HOME:8300
}
#sgdisk -og ${target:-/dev/vda}
function sg()
{
print sgdisk -og ${target:=${1:-/dev/vda}}
for k in ${(@nok)diskcfg[@]}
do
local size disk label
parts=(${${(@ws.:.)diskcfg[$k]}[@]})
size=${parts[1]}
label=${parts[2]}
disk=${parts[3]}
print sgdisk $k -n $k:0:$size -c $k:$label -t $k:$disk $target
unset size disk label
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment