diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-12-31 17:21:42 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-01-01 22:01:31 +0200 |
commit | 8b796467fcef03133c40f88ac331b1a0d06033a8 (patch) | |
tree | 3d11453f15824ea71abda70f4b3e3150b712ab9a /x220.sh | |
parent | 9ace8e9b7d0a15cf6aeeedada8bb7646acc8e6b0 (diff) | |
download | v-i-8b796467fcef03133c40f88ac331b1a0d06033a8.tar.gz |
feat: make X220 install work with cryptsetup and everything
Sponsored-by: author
Diffstat (limited to 'x220.sh')
-rwxr-xr-x | x220.sh | 42 |
1 files changed, 33 insertions, 9 deletions
@@ -5,17 +5,41 @@ set -eux vi="$1" vmdb2="$2" -git clone -b "$vi" git://git.liw.fi/v-i -git clone -b "$vmdb2" git://git.liw.fi/vmdb2 -git clone git://git.liw.fi/ansibleness -git clone git://git.liw.fi/debian-ansible +gitget() { + local url="$1" + local branch="$2" + local dir="$3" + if [ ! -e "$dir" ]; then + git clone -b "$branch" "$url" + else + (cd "$dir" && git checkout "$branch" && git pull) + fi +} + +git config --global pull.ff only +gitget git://git.liw.fi/v-i "$vi" v-i +gitget git://git.liw.fi/vmdb2 "$vmdb2" vmdb2 +gitget git://git.liw.fi/ansibleness main ansibleness +gitget git://git.liw.fi/debian-ansible main debian-ansible cd v-i export ANSIBLE_LOG=/root/ansible.log export ANSIBLE_ROLES_PATH=/root/debian-ansible/roles:/root/ansibleness/ansible/roles + +if vgdisplay | grep "VG Name" || [ -e /dev/mapper/pv0 ]; then + vgremove --force vg0 || true + ! [ -e /dev/vg0 ] + + pvremove /dev/mapper/pv0 || true + cryptsetup close pv0 + + dd if=/dev/zero of=/dev/sda bs=1M count=20000 oflag=direct status=progress +fi + +rm -f /root/x220.log /root/vmdb2/vmdb2 \ - --verbose \ - --rootfs-tarball /root/rootfs.tar.gz \ - --log /root/x220.log \ - --image /dev/sda \ - x220.vmdb + --verbose \ + --rootfs-tarball /root/rootfs.tar.gz \ + --log /root/x220.log \ + --image /dev/sda \ + x220.vmdb |