summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-05-03 16:20:56 +0000
committerLars Wirzenius <liw@liw.fi>2023-05-03 16:20:56 +0000
commitad845a7d26bd43f2b0bff9cb9113c486fd4a19c7 (patch)
treef2c126a8de7854beef97feea59d2c84658fb08ac
parentef638ccdc71a2adac74785a14773320003373c73 (diff)
parent9e799148046c6fe205bef081738595d1fdae9613 (diff)
downloadv-i-ad845a7d26bd43f2b0bff9cb9113c486fd4a19c7.tar.gz
Merge branch 'x' into 'main'
fixes See merge request larswirzenius/v-i!46
-rw-r--r--installer-ansible.yml9
-rw-r--r--installer.vmdb1
-rwxr-xr-xv-i19
-rwxr-xr-xwrite-and-config.sh1
4 files changed, 19 insertions, 11 deletions
diff --git a/installer-ansible.yml b/installer-ansible.yml
index 56cee7a..4227437 100644
--- a/installer-ansible.yml
+++ b/installer-ansible.yml
@@ -88,11 +88,20 @@
FONTSIZE="8x16"
VIDEOMODE=
dest: /etc/default/console-setup
+ mode: 0644
- name: "set default LC_TYPE for all users"
shell:
echo export LC_CTYPE=fi_FI.UTF8 >> /etc/profile.d/finnish.sh
+ - name: "silence kernel messages to console"
+ copy:
+ content:
+ kernel.printk = 3 4 1 3
+ dest:
+ /etc/sysctl.d/kernel.conf
+ mode: 0644
+
# SSH configuration.
- name: "restrict root logins over ssh to require a key"
diff --git a/installer.vmdb b/installer.vmdb
index 61469ad..deb3151 100644
--- a/installer.vmdb
+++ b/installer.vmdb
@@ -57,6 +57,7 @@ steps:
- cryptsetup-initramfs
- dosfstools
- rsync
+ - btrfs-progs
tag: root
- ansible: root
diff --git a/v-i b/v-i
index 0b25fec..18141ff 100755
--- a/v-i
+++ b/v-i
@@ -208,9 +208,9 @@ def cache_rootfs(tag):
}
-def debootstrap(tag):
+def debootstrap(debian_release, tag):
return {
- "debootstrap": "bullseye",
+ "debootstrap": debian_release,
"mirror": "http://deb.debian.org/debian",
"target": tag,
"unless": "rootfs_unpacked",
@@ -301,10 +301,8 @@ def vmdb_spec(system, ansible_vars):
# Create a 20 gigabyte LV for the root file system. That's big
# enough for a desktop system.
lvcreate("vg0", "root", "20G"),
- # format the root file system. This gets a fair bit of use, so
- # ext4 seems like a safe choice. If you wanted another file
- # system, sorry.
- mkfs("root", "ext4"),
+ # format the root file system.
+ mkfs("root", system.root_fstype),
# Mount the root file system.
mount("root"),
# Mount /boot on top of the root file system.
@@ -319,7 +317,7 @@ def vmdb_spec(system, ansible_vars):
steps.extend(
[
lvcreate("vg0", lv["name"], lv["size"]),
- mkfs(lv["name"], "ext4"),
+ mkfs(lv["name"], lv.get("fstype", "ext4")),
mount(lv["name"], dirname=lv["mounted"], mount_on="root"),
]
)
@@ -332,7 +330,7 @@ def vmdb_spec(system, ansible_vars):
# have to remember to manually remove the cache file. v-i or
# vmdb2 won't do that automatically for you.
unpack_rootfs("root"),
- debootstrap("root"),
+ debootstrap(system.debian_release, "root"),
apt(
"root",
[
@@ -393,6 +391,8 @@ class SystemSpec:
"ansible_vars": {},
"ansible_vars_files": [],
"luks": "",
+ "debian_release": "bullseye",
+ "root_fstype": "ext4",
}
with open(filename) as f:
obj = yaml.safe_load(f)
@@ -463,9 +463,6 @@ def main():
system = SystemSpec(args.spec)
log(f"spec: {system!r}")
- print("OK")
- return
-
ansible_vars = dict(system.ansible_vars)
ansible_vars["hostname"] = system.hostname
for filename in system.ansible_vars_files:
diff --git a/write-and-config.sh b/write-and-config.sh
index ce21afe..308065e 100755
--- a/write-and-config.sh
+++ b/write-and-config.sh
@@ -14,6 +14,7 @@ echo "Unmounting everything in $dev"
umount -fv "$dev"* || true
echo "Write installer.img to $dev"
dd if=installer.img bs=1M oflag=direct status=progress of="$dev"
+sync
for fs in "$dev"?; do
echo