From 4d6711e92f23e67baa2b7b90bc47627ffdd3159a Mon Sep 17 00:00:00 2001 From: Scott Alfter Date: Fri, 5 Nov 2021 21:12:47 -0700 Subject: [PATCH] initial commit --- .gitignore | 1 + README.md | 11 +++++++++++ flash-fix.patch | 10 ++++++++++ userdata.yml | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 flash-fix.patch create mode 100644 userdata.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..06af0c3 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +Initlal Provisioning +-------------------- + +- ```git clone https://github.com/hypriot/flash``` +- make flash executable and patch it with flash-fix.patch +- download latest Hypriot release from https://github.com/hypriot/image-builder-rpi +- write to SD card: ```sudo ./flash -d /dev/sda -u userdata.yml --hostname k8s00 hypriotos-rpi-v1.12.3.img``` +- install SD card in a Raspberry Pi 4 +- wait maybe 10 minutes after boot for it to configure and update + +documentation for userdata.yml: https://blog.hypriot.com/post/cloud-init-cloud-on-hypriot-x64/ diff --git a/flash-fix.patch b/flash-fix.patch new file mode 100644 index 0000000..999c5bb --- /dev/null +++ b/flash-fix.patch @@ -0,0 +1,10 @@ +--- /tmp/flash/flash~ 2021-11-05 20:16:44.000000000 -0700 ++++ /tmp/flash/flash 2021-11-05 20:32:51.866897708 -0700 +@@ -418,6 +418,7 @@ + wait_for_disk() { + echo "Waiting for device $1" + udevadm settle ++ sleep 3 + sudo hdparm -z "$1" + } + diff --git a/userdata.yml b/userdata.yml new file mode 100644 index 0000000..c684ee6 --- /dev/null +++ b/userdata.yml @@ -0,0 +1,34 @@ +#cloud-config + +hostname: k8s01 +manage_etc_hosts: true +apt_preserve_sources_list: true + +users: + - name: salfter # use any user name you like + primary-group: users + shell: /bin/bash + sudo: ALL=(ALL) NOPASSWD:ALL + groups: users,docker,adm,dialout,audio,plugdev,netdev,video + ssh-import-id: None + lock_passwd: true + ssh-authorized-keys: + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJQgbySEtaT8SqZ37tT7S4Z/gZeGH+V5vGZ9i9ELpmU salfter@janeway + +package_update: true +package_upgrade: true +package_reboot_if_required: true +packages: + - ntp + +locale: "en_US.UTF-8" +timezone: "US/Pacific" + +write_files: + - path: "/etc/docker/daemon.json" + owner: "root:root" + content: | + { + "labels": [ "os=linux", "arch=arm64" ], + "experimental": true + }