From da23749e625367c1cd6d35b054a0ac55d74d79b7 Mon Sep 17 00:00:00 2001 From: lub Date: Tue, 28 Jan 2020 18:43:37 +0100 Subject: [PATCH] add hardware setup for hetzner ax51 --- hardware/hetzner_ax51-nvme/boot | 1 + hardware/hetzner_ax51-nvme/esp | 1 + hardware/hetzner_ax51-nvme/network.sh | 16 ++++++++++++++++ hardware/hetzner_ax51-nvme/parted.sh | 17 +++++++++++++++++ hardware/hetzner_ax51-nvme/root | 1 + 5 files changed, 36 insertions(+) create mode 120000 hardware/hetzner_ax51-nvme/boot create mode 120000 hardware/hetzner_ax51-nvme/esp create mode 100755 hardware/hetzner_ax51-nvme/network.sh create mode 100755 hardware/hetzner_ax51-nvme/parted.sh create mode 120000 hardware/hetzner_ax51-nvme/root diff --git a/hardware/hetzner_ax51-nvme/boot b/hardware/hetzner_ax51-nvme/boot new file mode 120000 index 0000000..b6413b3 --- /dev/null +++ b/hardware/hetzner_ax51-nvme/boot @@ -0,0 +1 @@ +/dev/nvme2n1p2 \ No newline at end of file diff --git a/hardware/hetzner_ax51-nvme/esp b/hardware/hetzner_ax51-nvme/esp new file mode 120000 index 0000000..3213aa3 --- /dev/null +++ b/hardware/hetzner_ax51-nvme/esp @@ -0,0 +1 @@ +/dev/nvme2n1p3 \ No newline at end of file diff --git a/hardware/hetzner_ax51-nvme/network.sh b/hardware/hetzner_ax51-nvme/network.sh new file mode 100755 index 0000000..71ae36a --- /dev/null +++ b/hardware/hetzner_ax51-nvme/network.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e + +address=$(ip address show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?) .*#$1#') +gateway=$(ip route list dev eth0 default | perl -pe 's#.*via ##') + +# $interface differs from the live system because of different naming schemes +# see https://wiki.debian.org/NetworkInterfaceNames for more details +interface='enp35s0' + + +echo "[Match] +Name=$interface + +[Network] +Address=$address +Gateway=$gateway" > "/etc/systemd/network/${interface}.network" \ No newline at end of file diff --git a/hardware/hetzner_ax51-nvme/parted.sh b/hardware/hetzner_ax51-nvme/parted.sh new file mode 100755 index 0000000..b562cb4 --- /dev/null +++ b/hardware/hetzner_ax51-nvme/parted.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + + +# / 440GB +# /boot 2GB +# /boot/efi 1GB +# free 7GB + +parted /dev/nvme2n1 mklabel gpt +parted /dev/nvme2n1 mkpart primary 1 500GB +parted /dev/nvme2n1 mkpart primary 500GB 505GB +parted /dev/nvme2n1 mkpart primary 505GB 510GB +# set flag for ESP +parted /dev/nvme2n1 set 3 boot on + +sleep 1 \ No newline at end of file diff --git a/hardware/hetzner_ax51-nvme/root b/hardware/hetzner_ax51-nvme/root new file mode 120000 index 0000000..9acc13f --- /dev/null +++ b/hardware/hetzner_ax51-nvme/root @@ -0,0 +1 @@ +/dev/nvme2n1p1 \ No newline at end of file