-
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 Forwarded: #20 Signed-off-by: Philippe Coval <[email protected]>
- Loading branch information
Showing
1 changed file
with
74 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,74 @@ | ||
{{- $architecture := or .architecture "amd64" -}} | ||
{{- $image := or .image "debian-generic.img" -}} | ||
{{- $kernel := or .kernel "linux-image-generic" -}} | ||
{{- $suite := or .suite "buster" -}} | ||
|
||
{{if eq $suite "buster" "stable"}} | ||
{{if eq $architecture "i386"}} | ||
{{ $kernel = or .kernel "linux-image-686"}} | ||
{{else}} | ||
{{$kernel = or .kernel (printf "linux-image-%s" $architecture)}} | ||
{{end}} | ||
{{end}} | ||
|
||
|
||
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 "debian" > /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}} | ||
$kernel | ||
] | ||
|
||
- 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}} |