This commit is contained in:
Samuel Tyler 2026-02-14 22:25:28 +01:00 committed by GitHub
commit 5ce922aa3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 69 additions and 2 deletions

63
.github/workflows/qemu.yml vendored Normal file
View file

@ -0,0 +1,63 @@
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Run under QEMU
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
build:
name: Run under bubblewrap
runs-on: ubuntu-22.04
steps:
- name: Install qemu
run: sudo apt-get install qemu-system-x86
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
# There is a strange bug(?) in nongnu, when you clone a git repository
# against a commit != HEAD with depth=1, it errors out.
fetch-depth: 0
- name: Query cache for sources
id: cache
uses: actions/cache/restore@v4
with:
path: |
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
restore-keys: |
cache-
- name: Get sources
if: steps.cache.outputs.cache-hit != 'true'
run: mkdir -p mirror mirror-state && ./mirror.sh mirror mirror-state
- name: Cache sources
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
mirror
mirror-state
key: cache-${{ hashFiles('steps/*/sources') }}
- name: Run bootstrap
run: sudo ./rootfs.py --qemu --update-checksums --external-sources --cores 2 --mirror file://${PWD}/mirror
- name: Remount package disk
if: always()
run: >
DEV=$(sudo losetup -f --show target/external.img) &&
sudo partprobe ${DEV} &&
mkdir -p mnt &&
sudo mount ${DEV}p1 mnt
- name: Archive created packages
if: always() # archive both failed and successful builds
uses: actions/upload-artifact@v4
with:
name: packages
path: mnt/repo/**

View file

@ -19,6 +19,9 @@ def run(*args, cleanup=None, **kwargs):
if kwargs.pop('verbose', False):
print(arguments)
sys.stdout.flush()
sys.stderr.flush()
try:
return subprocess.run(arguments, check=True, **kwargs)
except subprocess.CalledProcessError:

View file

@ -17,6 +17,7 @@ you can run bootstap inside chroot.
import argparse
import os
import signal
import sys
import threading
from lib.generator import Generator, stage0_arch_map
@ -335,7 +336,7 @@ print(shutil.which('chroot'))
'-nic', 'user,ipv6=off,model=e1000'
]
if not args.interactive:
arg_list += ['-no-reboot', '-nographic']
arg_list += ['-no-reboot', '-nographic', '-serial', 'file:output']
run(args.qemu_cmd, *arg_list, cleanup=cleanup)
if __name__ == "__main__":

View file

@ -16,5 +16,5 @@ make_fiwix_initrd -s 1381376 /boot/fiwix.ext2
if match x${BARE_METAL} xTrue; then
kexec-fiwix /boot/fiwix -i /boot/fiwix.ext2 -m /e820 -c "fiwix console=/dev/tty1 root=/dev/ram0 initrd=fiwix.ext2 kexec_proto=linux kexec_size=199680 kexec_cmdline=\"init=/init consoleblank=0\""
else
kexec-fiwix /boot/fiwix -i /boot/fiwix.ext2 -m /e820 -c "fiwix console=/dev/ttyS0 root=/dev/ram0 initrd=fiwix.ext2 kexec_proto=linux kexec_size=199680 kexec_cmdline=\"init=/init console=ttyS0\""
kexec-fiwix /boot/fiwix -i /boot/fiwix.ext2 -m /e820 -c "fiwix console=/dev/ttyS0 root=/dev/ram0 initrd=fiwix.ext2 kexec_proto=linux kexec_size=199680 kexec_cmdline=\"init=/init console=ttyS0,115200\""
fi