Skip to content
Merged
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
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ jobs:
name: artifact-${{ matrix.target }}
path: output/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: artifact-disk-image-${{ matrix.target }}
path: output/images/*.qcow2

release:
name: Release Infix ${{ github.ref_name }}
needs: build
Expand Down Expand Up @@ -141,6 +146,11 @@ jobs:
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
if ls *.qcow2 &>/dev/null; then
for file in *.qcow2; do
sha256sum "$file" > "$file.sha256"
done
fi

- name: Extract ChangeLog entry ...
run: |
Expand All @@ -155,7 +165,7 @@ jobs:
makeLatest: ${{ steps.rel.outputs.latest }}
discussionCategory: ${{ steps.rel.outputs.cat }}
bodyFile: release.md
artifacts: "*.tar.gz*"
artifacts: "*.tar.gz*,*.qcow2*"

- name: Summary
run: |
Expand Down
8 changes: 5 additions & 3 deletions board/common/mkdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bootdata=
diskimg=disk.img
bootimg=
bootpart=

tmpimage=$(mktemp)
while getopts "a:b:B:n:s:" opt; do
case ${opt} in
a)
Expand Down Expand Up @@ -166,7 +166,7 @@ awk \
-vimgsize=$imgsize \
-vcfgsize=$cfgsize \
-vvarsize=$varsize \
-vdiskimg=$diskimg \
-vdiskimg=$tmpimage \
-vbootimg="$bootimg" -vbootpart="$bootpart" \
'{
sub(/@TOTALSIZE@/, total);
Expand Down Expand Up @@ -211,5 +211,7 @@ genimage \
--rootpath "$root" \
--tmppath "$tmp" \
--inputpath "$BINARIES_DIR" \
--outputpath "$BINARIES_DIR" \
--config "$root/genimage.cfg"

qemu-img convert -c -O qcow2 "$tmpimage" "$BINARIES_DIR/$diskimg"
rm "$tmpimage"
6 changes: 3 additions & 3 deletions board/common/post-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -n "$IMAGE_ID" ]; then
else
NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/')
fi
diskimg=disk.img
diskimg=disk.qcow2

ver()
{
Expand All @@ -48,7 +48,7 @@ fi
load_cfg DISK_IMAGE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
diskimg="${NAME}-disk$(ver).img"
diskimg="${NAME}-disk$(ver).qcow2"
bootcfg=
if [ "$DISK_IMAGE_BOOT_DATA" ]; then
bootcfg="-b $DISK_IMAGE_BOOT_DATA -B $DISK_IMAGE_BOOT_OFFSET"
Expand Down Expand Up @@ -90,7 +90,7 @@ if [ "$BR2_TARGET_ROOTFS_SQUASHFS" = "y" ]; then
rel=$(ver)
ln -sf rootfs.squashfs "$BINARIES_DIR/${NAME}${rel}.img"
if [ -n "$rel" ]; then
ln -sf "$BINARIES_DIR/${NAME}${rel}.img" "$BINARIES_DIR/${NAME}.img"
ln -sf "${NAME}${rel}.img" "$BINARIES_DIR/${NAME}.img"
fi
fi

Expand Down
10 changes: 5 additions & 5 deletions board/common/qemu/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ rootfs_args()
echo -n "-device sd-card,drive=mmc "
echo -n "-drive id=mmc,file=$CONFIG_QEMU_ROOTFS,if=none,format=raw "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "-drive file=$CONFIG_QEMU_ROOTFS.qcow2,if=virtio,format=qcow2,bus=0,unit=0 "
echo -n "-drive file=qemu.qcow2,if=virtio,format=qcow2,bus=0,unit=0 "
fi
}

Expand Down Expand Up @@ -316,13 +316,13 @@ gdb_args()
run_qemu()
{
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
if ! qemu-img check "${CONFIG_QEMU_ROOTFS}.qcow2"; then
rm -f "${CONFIG_QEMU_ROOTFS}.qcow2"
if ! qemu-img check "qemu.qcow2"; then
rm -f "qemu.qcow2"
fi
if [ ! -f "${CONFIG_QEMU_ROOTFS}.qcow2" ]; then
if [ ! -f "qemu.qcow2" ]; then
echo "Creating qcow2 disk image for Qemu ..."
qemu-img create -f qcow2 -o backing_file="$CONFIG_QEMU_ROOTFS" \
-F raw "${CONFIG_QEMU_ROOTFS}.qcow2" > /dev/null
-F qcow2 "qemu.qcow2" > /dev/null
fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ chown root:wheel "$BACKUP_DIR"
chmod 0770 "$BACKUP_DIR"

if [ ! -f "$CONFIG_FILE" ]; then
note "No $(basename "$CONFIG_FILE" .cfg) yet, likely factory reset."
logger -I $$ -k -p user.notice -t $(basename "$0") "No $(basename "$CONFIG_FILE" .cfg) yet, likely factory reset."
exit 0
elif migrate -cq "$CONFIG_FILE"; then
exit 0
Expand Down
4 changes: 2 additions & 2 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ All notable changes to the project are documented in this file.
-------------------------

### Changes
- N/A
- Format for disk image (for QEMU) has changed to `qcow2`

### Fixes
- Fix #1002: Broken symlink in release package
- Fix #1006: NanoPi R2S corrupt startup, regression in Infix v25.02.0
- Bump R2S kernel, now same as tier one boards
- Fix group owner and permissions of `/cfg/backup` directory
- Fix extraction of old version for `/cfg/backup/` files


[v25.03.0][] - 2025-03-31
-------------------------

Expand Down
19 changes: 12 additions & 7 deletions test/env
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ get_base_img()
{
local files="$1"
local base_img_file
base_img_file=$(echo "$files" | tr ' ' '\n' | grep -- '-disk.img$')
base_img_file=$(echo "$files" | tr ' ' '\n' | grep -- '-disk.qcow2$')
echo "$envdir/qeneth/$(basename "$base_img_file")"
}

Expand All @@ -96,16 +96,20 @@ start_topology()
done

base_img=$(get_base_img "$files")
test_img="${base_img%-disk.img}-disk-test.img"

$testdir/inject-test-mode -b "$base_img" -o "$test_img"

img_name=$(basename "$test_img")
test_img_name="${base_img%-disk.qcow2}-disk-test"
base_img_name="${base_img%-disk.qcow2}-disk"
test_img_raw="${test_img_name}.img"
base_img_raw="${base_img_name}.img"
test_img_qcow2="${test_img_name}.qcow2"

qemu-img convert -f qcow2 -O raw "$base_img" "$base_img_raw"
$testdir/inject-test-mode -b "$base_img_raw" -o "$test_img_raw"
qemu-img convert -f raw -O qcow2 "$test_img_raw" "$test_img_qcow2"
img_name=$(basename $test_img_qcow2)
sed -i "s/qn_image=\".*\"/qn_image=\"$img_name\"/" "$envdir/qeneth/topology.dot.in"

(cd "$envdir/qeneth/" && $qeneth generate && $qeneth start)
INFAMY_ARGS="$INFAMY_ARGS $envdir/qeneth/topology.dot"

cat <<EOF >"$envdir/bin/qeneth"
#!/bin/sh
cd $envdir/qeneth && exec $testdir/qeneth/qeneth "\$@"
Expand Down Expand Up @@ -228,6 +232,7 @@ if [ "$containerize" ]; then
--env INFAMY_EXTRA_ARGS="$INFAMY_EXTRA_ARGS" \
--env PROMPT_DIRTRIM="$ixdir" \
--env NINEPM_PROJ_CONFIG="$NINEPM_PROJ_CONFIG" \
--env QENETH_PATH="$testdir/templates:$testdir" \
--env PS1="$(build_ps1)" \
$extra_env \
--expose 9001-9010 --publish-all \
Expand Down
4 changes: 4 additions & 0 deletions test/templates/inc/infix-disk.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if [ ! -e {{name}}.disk ]; then
qemu-img create -f raw {{name}}.disk 16M >/dev/null
mkfs.ext4 -q -L cfg {{name}}.disk
fi
9 changes: 9 additions & 0 deletions test/templates/inc/infix-usb.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
usb_cmd=""

if [ -n "{{qn_usb}}" ]; then
if ! [ -f {{qn_usb}} ]; then
dd if=/dev/zero of={{qn_usb}} bs=8M count=1 >/dev/null 2>&1
mkfs.vfat {{qn_usb}} >/dev/null 2>&1
fi
usb_cmd=" -drive if=none,id=usbstick,format=raw,file={{qn_usb}} -usb -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=usbstick "
fi
26 changes: 26 additions & 0 deletions test/templates/infix-bios-x86_64.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

con=hvc0
tty -s && con=hvc2

img={{#qn_image}}{{qn_image}}{{/qn_image}}{{^qn_image}}infix-x86_64-disk.img{{/qn_image}}
bios={{#qn_bios}}{{qn_bios}}{{/qn_bios}}{{^qn_bios}}OVMF.fd{{/qn_bios}}
{{> inc/infix-usb}}

origimg=$(realpath $img)
qemu-img create -f qcow2 -o backing_file=$origimg -F qcow2 {{name}}.qcow2

truncate -s 0 $imgdir/{{name}}.mactab
{{#links}}
echo "{{qn_name}} {{qn_mac}}" >>$imgdir/{{name}}.mactab
{{/links}}

exec qemu-system-x86_64 -M pc,accel=kvm:tcg -cpu max \
-m {{#qn_mem}}{{qn_mem}}{{/qn_mem}}{{^qn_mem}}256M{{/qn_mem}} \
{{> ../qeneth/templates/inc/qemu-links}}
-fw_cfg name=opt/mactab,file=$imgdir/{{name}}.mactab \
-bios $bios \
-drive file={{name}}.qcow2,if=virtio,format=qcow2,bus=0,unit=1 \
$usb_cmd \
{{> ../qeneth/templates/inc/infix-common}}
{{> ../qeneth/templates/inc/qemu-console}}
30 changes: 30 additions & 0 deletions test/templates/infix-kernel-x86_64.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

con=hvc0
tty -s && con=hvc2

img={{#qn_image}}{{qn_image}}{{/qn_image}}{{^qn_image}}infix-x86_64.img{{/qn_image}}
imgsz=$((($(stat -Lc %s $img) + 1023) >> 10))
imgdir=./.$(realpath $img | sed -e s:/:-:g)

unsquashfs -n -f -d $imgdir $img boot/bzImage >/dev/null


{{> inc/infix-disk}}
{{> inc/infix-usb}}

truncate -s 0 $imgdir/{{name}}.mactab
{{#links}}
echo "{{qn_name}} {{qn_mac}}" >>$imgdir/{{name}}.mactab
{{/links}}

exec qemu-system-x86_64 -M pc,accel=kvm:tcg -cpu max \
-m {{#qn_mem}}{{qn_mem}}{{/qn_mem}}{{^qn_mem}}384M{{/qn_mem}} \
-kernel "bzImage" -initrd $img \
-append "root=/dev/ram0 ramdisk_size=$imgsz console=$con,115200 $append {{qn_append}}" \
-drive file={{name}}.disk,if=virtio,format=raw,bus=0,unit=1 \
{{> ../qeneth/templates/inc/qemu-links}}
-fw_cfg name=opt/mactab,file=$imgdir/{{name}}.mactab \
$usb_cmd \
{{> ../qeneth/templates/inc/infix-common}}
{{> ../qeneth/templates/inc/qemu-console}}
29 changes: 29 additions & 0 deletions test/templates/infix-x86_64.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

con=hvc0
tty -s && con=hvc2

img={{#qn_image}}{{qn_image}}{{/qn_image}}{{^qn_image}}infix-x86_64.img{{/qn_image}}
imgsz=$((($(stat -Lc %s $img) + 1023) >> 10))
imgdir=./.$(realpath $img | sed -e s:/:-:g)

unsquashfs -n -f -d $imgdir $img boot/bzImage >/dev/null


{{> inc/infix-disk}}
{{> inc/infix-usb}}

truncate -s 0 $imgdir/{{name}}.mactab
{{#links}}
echo "{{qn_name}} {{qn_mac}}" >>$imgdir/{{name}}.mactab
{{/links}}

exec qemu-system-x86_64 -M pc,accel=kvm:tcg -cpu max \
-m {{#qn_mem}}{{qn_mem}}{{/qn_mem}}{{^qn_mem}}384M{{/qn_mem}} \
-kernel $imgdir/boot/bzImage -initrd $img \
-append "root=/dev/ram0 ramdisk_size=$imgsz console=$con,115200 $append {{qn_append}}" \
-drive file={{name}}.disk,if=virtio,format=raw,bus=0,unit=1 \
{{> inc/qemu-links}}
-fw_cfg name=opt/mactab,file=$imgdir/{{name}}.mactab \
$usb_cmd \
{{> inc/infix-common}}
2 changes: 1 addition & 1 deletion test/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mode-run := -t $(BINARIES_DIR)/qemu.dot
mode := $(mode-$(TEST_MODE))

INFIX_IMAGE_ID := $(call qstrip,$(INFIX_IMAGE_ID))
binaries-$(ARCH) := $(addprefix $(INFIX_IMAGE_ID),.img -disk.img)
binaries-$(ARCH) := $(addprefix $(INFIX_IMAGE_ID),.img -disk.qcow2)
pkg-$(ARCH) := -p $(O)/images/$(addprefix $(INFIX_IMAGE_ID),.pkg)
binaries-x86_64 += OVMF.fd
binaries := $(foreach bin,$(binaries-$(ARCH)),-f $(BINARIES_DIR)/$(bin))
Expand Down
2 changes: 1 addition & 1 deletion test/virt/quad/topology.dot.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ graph "quad" {
edge [color="cornflowerblue", penwidth="2"];

qn_template="infix-bios-x86_64";
qn_image="infix-x86_64-disk-test.img"
qn_image="infix-x86_64-disk-test.qcow2"
qn_oui="00:a0:85";
qn_append="quiet";

Expand Down