95 lines
2.5 KiB
YAML
95 lines
2.5 KiB
YAML
{{- $architecture := or .architecture "amd64" -}}
|
|
{{- $suite := or .suite "bullseye" -}}
|
|
{{ $image := or .image (printf "debian_full_network-%s-%s.tgz" $suite $architecture) }}
|
|
|
|
architecture: {{ $architecture }}
|
|
|
|
actions:
|
|
- action: debootstrap
|
|
suite: {{ $suite }}
|
|
components:
|
|
- main
|
|
mirror: http://deb.debian.org/debian
|
|
# variant: minbase
|
|
|
|
- action: apt
|
|
recommends: false
|
|
packages:
|
|
- systemd-container
|
|
- adduser
|
|
- sudo
|
|
- htop
|
|
- vim-nox
|
|
- tmux
|
|
- grub-efi
|
|
- initramfs-tools
|
|
- linux-image-amd64
|
|
|
|
- action: run
|
|
description: enable essential systemd services
|
|
chroot: true
|
|
command: systemctl enable systemd-networkd systemd-resolved
|
|
|
|
- action: run
|
|
description: symlink resolv.conf
|
|
chroot: true
|
|
command: touch /etc/resolv.conf && rm /etc/resolv.conf && ln -s /var/run/systemd/resolve/resolv.conf /etc/resolv.conf
|
|
|
|
- action: run
|
|
description: Set hostname
|
|
chroot: true
|
|
command: echo debian-{{ $suite }}-{{ $architecture }} > /etc/hostname
|
|
|
|
- action: pack
|
|
file: {{ $image }}
|
|
compression: gz
|
|
|
|
- action: image-partition
|
|
imagename: {{ $image }}.img
|
|
imagesize: 2GB
|
|
partitiontype: gpt
|
|
mountpoints:
|
|
- mountpoint: /
|
|
partition: root
|
|
- mountpoint: /boot/efi
|
|
partition: efi
|
|
flags: [ boot ]
|
|
partitions:
|
|
- name: efi
|
|
fs: vfat
|
|
start: 1MiB
|
|
end: 513MiB
|
|
options: [ x-systemd.automount ]
|
|
parttype: C12A7328-F81F-11D2-BA4B-00A0C93EC93B # ESP guid
|
|
- name: root
|
|
# parttype: 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 # linux root x86_64
|
|
parttype: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 # linux partition
|
|
fs: ext4
|
|
start: 513MiB
|
|
end: 1999MB
|
|
|
|
- action: filesystem-deploy
|
|
description: Deploying filesystem onto image
|
|
setup-kernel-cmdline: true
|
|
setup-fstab: true
|
|
|
|
# - action: run
|
|
# chroot: true
|
|
# command: grub-install --target=x86_64-efi --no-nvram /dev/vda
|
|
#
|
|
# - action: run
|
|
# chroot: true
|
|
# command: update-grub
|
|
#
|
|
# - action: run
|
|
# chroot: true
|
|
# command: mkdir -p /boot/efi/EFI/BOOT && cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
|
|
#
|
|
# - action: run
|
|
# chroot: true
|
|
# command: update-initramfs -u
|
|
#
|
|
# - action: run
|
|
# chroot: true
|
|
# command: sed -i 's/vda/sda/g' /boot/grub/grub.cfg
|