Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
#
# 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; cat output
- 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/**
3 changes: 3 additions & 0 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion rootfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import argparse
import os
import signal
import sys
import threading

from lib.generator import Generator, stage0_arch_map
Expand Down Expand Up @@ -335,7 +336,7 @@ def bootstrap(args, generator, target, size, cleanup):
'-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__":
Expand Down
2 changes: 1 addition & 1 deletion steps/jump/fiwix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading