mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-19 01:35:24 +01:00
Merge 517409a423 into 984b832224
This commit is contained in:
commit
5ce922aa3e
4 changed files with 69 additions and 2 deletions
63
.github/workflows/qemu.yml
vendored
Normal file
63
.github/workflows/qemu.yml
vendored
Normal 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/**
|
||||||
|
|
@ -19,6 +19,9 @@ def run(*args, cleanup=None, **kwargs):
|
||||||
if kwargs.pop('verbose', False):
|
if kwargs.pop('verbose', False):
|
||||||
print(arguments)
|
print(arguments)
|
||||||
|
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return subprocess.run(arguments, check=True, **kwargs)
|
return subprocess.run(arguments, check=True, **kwargs)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ you can run bootstap inside chroot.
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from lib.generator import Generator, stage0_arch_map
|
from lib.generator import Generator, stage0_arch_map
|
||||||
|
|
@ -335,7 +336,7 @@ print(shutil.which('chroot'))
|
||||||
'-nic', 'user,ipv6=off,model=e1000'
|
'-nic', 'user,ipv6=off,model=e1000'
|
||||||
]
|
]
|
||||||
if not args.interactive:
|
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)
|
run(args.qemu_cmd, *arg_list, cleanup=cleanup)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,5 @@ make_fiwix_initrd -s 1381376 /boot/fiwix.ext2
|
||||||
if match x${BARE_METAL} xTrue; then
|
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\""
|
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
|
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
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue