-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This image can be used as reference "generic" image for any architectures supported by debian. Boot on PC (x86 or x86_64) is supported thanks to grub, extra tweaking might be needed to boot other architectures on virtual machines. For the record, this is inspired from recipes I wrote for emilia pinball. Change-Id: I709a456f196df337c3f368f03416defe6aadcb0b Signed-off-by: Philippe Coval <[email protected]>
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{{- $architecture := or .architecture "amd64" -}} | ||
{{- $image := or .image "debian-generic.img" -}} | ||
{{- $suite := or .suite "buster" -}} | ||
|
||
architecture: {{$architecture}} | ||
|
||
actions: | ||
|
||
- action: debootstrap | ||
suite: "{{$suite}}" | ||
components: | ||
- main | ||
mirror: https://deb.debian.org/debian | ||
variant: minbase | ||
|
||
- action: apt | ||
packages: [adduser, sudo, systemd-sysv] | ||
|
||
- action: run | ||
chroot: true | ||
description: Set hostname | ||
command: echo "{{$architecture}}" > /etc/hostname | ||
|
||
- action: run | ||
description: Set up user | ||
chroot: true | ||
command: > | ||
/sbin/adduser --gecos user --disabled-password --shell /bin/bash user | ||
&& /sbin/adduser user sudo | ||
&& sh -c "echo 'user:user' | chpasswd" | ||
- action: apt | ||
packages: [ | ||
{{if eq $architecture "i386" "amd64"}} | ||
grub-pc, | ||
{{end}} | ||
{{if eq $suite "buster" "stable"}} | ||
{{if eq $architecture "i386"}} | ||
linux-image-686 | ||
{{else}} | ||
linux-image-{{$architecture}} | ||
{{end}} | ||
{{else}} | ||
linux-image-generic | ||
{{end}} | ||
] | ||
|
||
- action: image-partition | ||
imagename: {{ $image }} | ||
imagesize: 1GB | ||
partitiontype: msdos | ||
mountpoints: | ||
- mountpoint: / | ||
partition: root | ||
partitions: | ||
- name: root | ||
fs: ext4 | ||
start: 1MiB | ||
end: 100% | ||
flags: [ boot ] | ||
|
||
- action: filesystem-deploy | ||
description: Deploying filesystem onto image | ||
|
||
- action: run | ||
description: Install bootloader | ||
chroot: true | ||
command: > | ||
{{if eq $architecture "i386" "amd64"}} | ||
update-grub | ||
&& grub-install /dev/disk/by-id/virtio-fakedisk-0 | ||
{{end}} |