summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-05-31 12:14:53 +0300
committerLars Wirzenius <liw@liw.fi>2019-05-31 12:14:53 +0300
commitc78f6f8babec7a44e68add667ebc6da1657e4aba (patch)
tree3c850a155797287dbcb2ac230d9b6edf71bb5e4e
parent910a094152d2ed0c1279eef490beb55c1edfd1f7 (diff)
downloadbase-image-specs-c78f6f8babec7a44e68add667ebc6da1657e4aba.tar.gz
Change: base image and build script for Debian buster as host
-rw-r--r--base.vmdb65
-rw-r--r--base.yml2
-rwxr-xr-xbuild-all.sh16
3 files changed, 46 insertions, 37 deletions
diff --git a/base.vmdb b/base.vmdb
index f0515ed..e1633b6 100644
--- a/base.vmdb
+++ b/base.vmdb
@@ -3,47 +3,46 @@
# via Ansible.
steps:
-- mkimg: "{{ output }}"
- size: 8G
+ - mkimg: "{{ output }}"
+ size: 8G
-- mklabel: msdos
- device: "{{ output }}"
+ - mklabel: msdos
+ device: "{{ output }}"
-- mkpart: primary
- device: "{{ output }}"
- start: 0%
- end: 100%
- part-tag: root-part
+ - mkpart: primary
+ device: "{{ output }}"
+ start: 0%
+ end: 100%
+ tag: rootfs
-- mkfs: ext4
- partition: root-part
+ - kpartx: "{{ output }}"
-- mount: root-part
- fs-tag: root-fs
+ - mkfs: ext4
+ partition: rootfs
+ label: rootfs
-- unpack-rootfs: root-fs
+ - mount: rootfs
-- debootstrap: stretch
- mirror: http://http.debian.net/debian
- target: root-fs
- unless: rootfs_unpacked
+ - unpack-rootfs: rootfs
-- apt: linux-image-amd64
- fs-tag: root-fs
- unless: rootfs_unpacked
+ - debootstrap: stretch
+ mirror: http://deb.debian.org/debian
+ target: rootfs
+ unless: rootfs_unpacked
-- chroot: root-fs
- shell: |
- apt -y install python
- unless: rootfs_unpacked
+ - apt: install
+ packages:
+ - linux-image-amd64
+ - python
+ tag: rootfs
+ unless: rootfs_unpacked
-- cache-rootfs: root-fs
- unless: rootfs_unpacked
+ - cache-rootfs: rootfs
+ unless: rootfs_unpacked
-- ansible: root-fs
- playbook: base.yml
+ - ansible: rootfs
+ playbook: base.yml
-- grub: bios
- root-fs: root-fs
- root-part: root-part
- device: "{{ output }}"
+ - grub: bios
+ tag: rootfs
+ console: serial
diff --git a/base.yml b/base.yml
index 0a2b83d..bed3790 100644
--- a/base.yml
+++ b/base.yml
@@ -1,6 +1,6 @@
- hosts: image
tasks:
- - name: set /etc/hostname
+ - name: set hostname in /etc/hostname
copy:
content: "{{ hostname }}"
dest: /etc/hostname
diff --git a/build-all.sh b/build-all.sh
index 814b292..fca81a3 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -2,7 +2,17 @@
set -eu
-opts="--verbose"
+image()
+{
+ local img="$1"
+ local tarball="$2"
-vmdb2 base.vmdb $opts --output debian9-amd64.img --rootfs-tarball debian9-amd64.tar.gz
-xz -f --verbose debian9-amd64.img
+ vmdb2 base.vmdb \
+ --output "$img" \
+ --verbose \
+ --log base.log \
+ --rootfs-tarball "$tarball"
+ xz -v1T0 "$img"
+}
+
+image debian9-ick.img "/home/liw/tmp/debian9.tar.gz"