summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--molecule/default/Dockerfile.archlinux.j22
-rw-r--r--molecule/default/Dockerfile.raspberrypi.j2 (renamed from molecule/default/Dockerfile.debian.j2)8
-rw-r--r--molecule/default/molecule.yml3
-rw-r--r--molecule/default/prepare.yml2
-rw-r--r--roles/bootstrap/tasks/install-raspberry.yml3
-rw-r--r--roles/bootstrap/tasks/main.yml2
-rw-r--r--roles/bootstrap/vars/debian.yml7
7 files changed, 16 insertions, 11 deletions
diff --git a/molecule/default/Dockerfile.archlinux.j2 b/molecule/default/Dockerfile.archlinux.j2
index 9b2cbd8..177724d 100644
--- a/molecule/default/Dockerfile.archlinux.j2
+++ b/molecule/default/Dockerfile.archlinux.j2
@@ -17,4 +17,4 @@ RUN (cd /lib/systemd/system/sysinit.target.wants/; \
VOLUME ["/sys/fs/cgroup"]
-CMD ["/usr/sbin/init"]
+CMD ["/lib/systemd/systemd"]
diff --git a/molecule/default/Dockerfile.debian.j2 b/molecule/default/Dockerfile.raspberrypi.j2
index c28918e..33475b7 100644
--- a/molecule/default/Dockerfile.debian.j2
+++ b/molecule/default/Dockerfile.raspberrypi.j2
@@ -8,7 +8,7 @@ ENV container docker
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
- systemd systemd-sysv python3 parted dosfstools \
+ systemd python3 parted dosfstools \
&& rm -Rf /var/lib/apt/lists/* \
&& rm -Rf /usr/share/doc \
&& rm -Rf /usr/share/man \
@@ -16,6 +16,12 @@ RUN apt-get update \
RUN rm -f /lib/systemd/system/multi-user.target.wants/getty.target
+# Mimic the Raspberry OS Bookworm default boot (for testing)
+RUN mkdir -p /boot/firmware \
+ && touch /boot/firmware/kernel8.img \
+ && touch /boot/firmware/bootcode.bin \
+ && touch /boot/firmware/start.elf
+
VOLUME ["/sys/fs/cgroup", "/tmp", "/run", "/opt"]
CMD ["/lib/systemd/systemd"]
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index a5b30f5..c9f5f8d 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -10,9 +10,10 @@ platforms:
- name: instance
image: ${MOLECULE_DISTRO:-archlinux}
dockerfile: Dockerfile.${MOLECULE_DISTRO:-archlinux}.j2
+ platform: "${MOLECULE_PLATFORM:-linux/amd64}"
pre_build_image: false
privileged: true
- command: ${MOLECULE_COMMAND:-""}
+ command: "${MOLECULE_COMMAND:-/lib/systemd/systemd}"
tmpfs:
- "/tmp"
- "/run"
diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml
index 885103f..bd37f5f 100644
--- a/molecule/default/prepare.yml
+++ b/molecule/default/prepare.yml
@@ -8,7 +8,7 @@
distro_hostname_mapping:
archlinux: "archlinux.local"
ubuntu: "ubuntu.local"
- debian: "rpi5.local"
+ raspberrypi: "rpi5.local"
- name: "Create virtual disk image"
become: true
diff --git a/roles/bootstrap/tasks/install-raspberry.yml b/roles/bootstrap/tasks/install-raspberry.yml
index f19b104..b287746 100644
--- a/roles/bootstrap/tasks/install-raspberry.yml
+++ b/roles/bootstrap/tasks/install-raspberry.yml
@@ -55,7 +55,7 @@
changed_when: true
with_items:
- "apt-get update"
- - "apt-get install -y {{ bootstrap_distro.packages | join(' ') }}"
+ - "apt-get install -y --no-install-recommends {{ bootstrap_distro.packages | join(' ') }}"
- name: "Copy kernel to boot partition"
# NOTE: Copying {{ mnt_root_path }}/boot/ doesn't work
@@ -82,3 +82,4 @@
args:
executable: "bash"
changed_when: true
+ tags: ["molecule-notest"]
diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml
index 4e86312..f74e743 100644
--- a/roles/bootstrap/tasks/main.yml
+++ b/roles/bootstrap/tasks/main.yml
@@ -18,7 +18,7 @@
- name: "Install raspberry"
ansible.builtin.include_tasks: "install-raspberry.yml"
- when: ansible_distribution == "Debian"
+ when: ansible_distribution == "Debian" and ansible_architecture == "aarch64"
- name: "Ensure ansible dependencies are installed in chroot"
ansible.builtin.command:
diff --git a/roles/bootstrap/vars/debian.yml b/roles/bootstrap/vars/debian.yml
index 25e2764..a305470 100644
--- a/roles/bootstrap/vars/debian.yml
+++ b/roles/bootstrap/vars/debian.yml
@@ -6,12 +6,9 @@ bootstrap_distro:
- "raspberrypi-kernel"
- "raspberrypi-bootloader"
- "firmware-brcm80211"
- - "systemd-sysv"
- - "udev"
- - "kmod"
- "rpi-eeprom"
-bootstrap_opts: "--arch=arm64 --include=systemd,udev"
+bootstrap_opts: "--arch=arm64"
bootstrap_apt_ignored_preferences: ""
@@ -19,8 +16,8 @@ bootstrap_apt_ignored_preferences: ""
bootstrap_apt_sources: |
deb [signed-by=/usr/share/keyrings/raspberrypi.gpg] http://archive.raspberrypi.org/debian {{ bootstrap_distro.name }} main
deb http://deb.debian.org/debian {{ bootstrap_distro.name }} main
-
# yamllint enable rule:line-length
+
# 1 = SD card
# f = Restart (loop back)
# 6 = NVMe SSD