From f86c6fb9fa49229fbddbdbcf6aaf750ee3173c8a Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sat, 9 Nov 2024 17:04:42 +0200 Subject: [PATCH] add readme on how to create OS template --- README.md | 17 +++++++++++++++++ creator_functions.sh | 1 + init_functions.sh | 1 - 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce4cdd3 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +You will need a working OS template to work with this project. + +Easy solution create an OS template: +- mount the archlinux installation .iso in a VM +- run `pacstrap /mnt base linux openssh` +- run `ln -s /usr/lib/systemd/system/sshd.service /mnt/etc/systemd/system/multi-user.target.wants/sshd.service` +- run `fsarchiver savedir /tmp/os_template.fsa /mnt` +- download `/tmp/os_template.fsa` +- upload the `os_template.fsa` anywhere so that it can be downloaded with wget + +Some notes on the above: +- base and linux are the only packages to run a VM +- you will need sshd to operate the VM, so create the symlink to make it start with the OS +- fsarchiver is very good at preserving OS data +- the initrd will dump that template to the encrypted disk +- the same procedure can be used with any distribution, but we didn't test that yet + diff --git a/creator_functions.sh b/creator_functions.sh index aba1235..ba17969 100644 --- a/creator_functions.sh +++ b/creator_functions.sh @@ -23,6 +23,7 @@ create_dirs() { mkdir -p "${ROOT}/usr/lib" mkdir -p "${ROOT}/dev" mkdir -p "${ROOT}/etc" + mkdir -p "${ROOT}/mnt" mkdir -p "${ROOT}/proc" mkdir -p "${ROOT}/run" mkdir -p "${ROOT}/sys" diff --git a/init_functions.sh b/init_functions.sh index 96d20bd..b16b5ea 100644 --- a/init_functions.sh +++ b/init_functions.sh @@ -106,6 +106,5 @@ github_ssh_key() { } mount_root() { - mkdir /mnt mount /dev/vda1 /mnt }