-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathx86_64-uefi-bookworm.yaml
154 lines (132 loc) · 4.07 KB
/
x86_64-uefi-bookworm.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# debos config file supporting generic x86_64 machines with UEFI.
# Customizable variables for disk size and upstream Debian mirror.
# Defaults to 32GB disk and RIT's mirror.
{{- $disksize := or .disksize 32015679488 }}
{{- $mirror := or .mirror "http://mirror.rit.edu/debian/" }}
architecture: amd64
actions:
- action: debootstrap
description: Debootstrap core distro
suite: "bookworm"
components:
- main
- contrib
- non-free
- non-free-firmware
mirror: {{ $mirror }}
- action: run
description: Add security apt repo
chroot: true
command: echo deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware >> /etc/apt/sources.list
- action: run
description: Add updates apt repo
chroot: true
command: echo deb {{ $mirror }} bookworm-updates main contrib non-free non-free-firmware >> /etc/apt/sources.list
- action: run
description: Update packages due to security and updates repo adds
chroot: true
command: apt-get update && apt-get -y dist-upgrade
- action: apt
description: Install expected base packages
packages:
- amd64-microcode
- ca-certificates
- intel-microcode
- linux-image-amd64
- locales
- lsb-release
- openssh-server
- avahi-daemon
- libnss-mdns
- ntp
- netplan.io
- systemd-resolved
- man-db
- action: run
description: Delete any generated SSH server keys
chroot: true
command: rm -vf /etc/ssh/ssh_host*key*
- action: overlay
description: Apply system overlay files
source: overlays/x86_64-uefi-bookworm
- action: run
description: Enable first-boot.service
chroot: true
command: systemctl enable first-boot.service
- action: run
description: Generate en_US.UTF-8 locale
chroot: true
command: locale-gen
- action: run
description: Set the default hostname
chroot: true
command: echo localhost > /etc/hostname
- action: run
description: Set the default root password
chroot: true
command: echo "root:password" | chpasswd
- action: run
description: Create /boot/efi directory
chroot: true
command: mkdir -v /boot/efi
- action: image-partition
description: Create a partitioned disk image
imagename: x86_64-uefi-bookworm.img
imagesize: {{ $disksize }}
partitiontype: gpt
partitions:
- name: esp
parlabel: ESP
flags: [ boot, esp ]
parttype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
fs: vfat
start: 0%
end: 4GB # This is rather large as we'll use systemd-boot
fsck: true
- name: swap
parttype: 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f # GPT swap GUID
fs: none
start: 4GB
end: 8GB
- name: root
parttype: 4f68bce3-e8cd-4db1-96e7-fbcaf984b709
fs: btrfs
start: 8GB
end: 100%
fsck: true
mountpoints:
- mountpoint: /boot/efi/
partition: esp
- mountpoint: /
partition: root
# Disable predictable network naming for systemd/udev on kernel commandline
- action: filesystem-deploy
description: Deploy the created filesystem onto the disk image
setup-fstab: true
setup-kernel-cmdline: true
append-kernel-cmdline: net.ifnames=0
- action: run
description: Enable swap partition
chroot: true
script: scripts/swapon.sh
- action: apt
description: Install non-free firmware
packages:
- firmware-misc-nonfree
- bluez-firmware
- action: apt
description: Install systemd-boot bootloader
packages:
- systemd-boot
- action: run
description: Fixup systemd-boot default timeout
chroot: false
command: sed -i -e "s/#timeout/timeout/g" $ROOTDIR/boot/efi/loader/loader.conf
- action: run
description: Clean up the apt downloaded files
chroot: true
command: apt-get clean
- action: run
description: Create bmaptool map file for the deployed disk image
postprocess: true
command: bmaptool create x86_64-uefi-bookworm.img > x86_64-uefi-bookworm.bmap