From 97fd39feb26451bba8598aa0e6b176eaa2d64deb Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 9 Jan 2021 08:58:34 +1100 Subject: [PATCH] Add cirrus CI --- .cirrus.expect | 8 ++++++++ .cirrus.yml | 38 ++++++++++++++++++++++++++++++++++++++ rootfs.sh | 2 +- sysa/after.kaem.run | 2 ++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 .cirrus.expect create mode 100644 .cirrus.yml diff --git a/.cirrus.expect b/.cirrus.expect new file mode 100755 index 0000000..cc0f1ad --- /dev/null +++ b/.cirrus.expect @@ -0,0 +1,8 @@ +#!/usr/bin/expect + +set timeout -1 + +spawn ./rootfs.sh qemu-system-x86_64 3500M +expect -exact {not syncing: Attempted to kill init} +send -- "\x01" +send -- "x" diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..9858624 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,38 @@ +container: + image: potyarkin/molecule:host-kvm + kvm: true + cpu: 2 + memory: 4G + +lint_task: + install_script: + - apt-get -y update + - apt-get -y dist-upgrade + - apt-get -y install shellcheck + - apt-get -y clean + check_script: + - shellcheck rootfs.sh + +run_task: + # Required background services + dbus_background_script: + - mkdir -p /var/run/dbus + - /usr/bin/dbus-daemon --system --nofork --nopidfile + virtlogd_background_script: + - /usr/sbin/virtlogd + libvirtd_background_script: + - sleep 2 && /usr/sbin/libvirtd + iptables_legacy_script: + - update-alternatives --set iptables /usr/sbin/iptables-legacy + deps_script: + - apt-get -y update + - apt-get -y dist-upgrade + - apt-get -y install sudo git cpio linux-image-4.19.0-13-amd64 expect wget + - apt-get -y clean + submodule_script: + - git submodule update --init --recursive + kernel_script: + - cp /boot/vmlinuz-4.19.0-13-amd64 ./kernel + run_script: + - ./.cirrus.expect | tee -a /tmp/run.log + - grep -q 'Bootstrapping completed.' /tmp/run.log diff --git a/rootfs.sh b/rootfs.sh index ba717d5..04deeb3 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -129,7 +129,7 @@ if [ "${QEMU_CMD}" = 'chroot' ]; then sudo PATH="/after/bin:${PATH}" chroot . /init else ${QEMU_CMD} -enable-kvm \ - -m "${QEMU_RAM:-8G}" \ + -m "${QEMU_RAM}" \ -nographic \ -no-reboot \ -kernel ../../kernel -initrd initramfs.igz -append console=ttyS0 diff --git a/sysa/after.kaem.run b/sysa/after.kaem.run index 79bb508..e0d5f6f 100755 --- a/sysa/after.kaem.run +++ b/sysa/after.kaem.run @@ -129,3 +129,5 @@ pkg="m4-1.4" cd ${pkg} kaem --file ${pkg}.kaem cd .. + +echo "Bootstrapping completed."