linux_introduction/assets/nspawn/full_bridged.yaml

95 lines
2.5 KiB
YAML
Raw Permalink Normal View History

2022-07-01 11:26:22 +02:00
{{- $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
2022-07-04 10:08:47 +02:00
- grub-efi
- initramfs-tools
- linux-image-amd64
2022-07-01 11:26:22 +02:00
- 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
2022-07-04 10:08:47 +02:00
- 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