From 44e0707d428de04919a33f325d4e612335bdb777 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 28 Apr 2021 13:04:48 +0200 Subject: good testing environment --- .../system/getty@tty1.service.d/autologin.conf | 3 +++ airootfs/root/bootstrap | 28 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf create mode 100755 airootfs/root/bootstrap (limited to 'airootfs') diff --git a/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf new file mode 100644 index 0000000..d1d8474 --- /dev/null +++ b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux diff --git a/airootfs/root/bootstrap b/airootfs/root/bootstrap new file mode 100755 index 0000000..456345c --- /dev/null +++ b/airootfs/root/bootstrap @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +if ! timeout 1 curl -Is tombarrett.xyz | grep "200 OK" > /dev/null; then + echo "Please first connect to the internet." + exit +fi + +if ! test -b "$1"; then + echo "Please pass an existing drive as an argument. ie /dev/sda" + exit +fi + +parted -s "$1" mklabel gpt + +if ! test -f "/sys/firmware/efi/efivars"; then + parted "$1" mkpart bios ext4 0% 513MiB + parted "$1" set 1 bios_grub on + parted "$1" mkpart home ext4 513MiB 100% +else + parted "$1" mkpart efi fat32 0% 513MiB + parted "$1" set 1 esp on + parted "$1" mkpart home ext4 513MiB 100% +fi + +mount "$1"2 /mnt + +timedatectl set-ntp true -- cgit v1.2.3