parent
b152f093f0
commit
13df092fe6
|
|
@ -96,8 +96,8 @@ jobs:
|
|||
- name: Test qemu_x86_virt + ${{ matrix.suite }} ${{ matrix.arch }}
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
./test/qemu.sh $RUNNER_TEMP/boot-qemu_x86_virt.bin.gz \
|
||||
$RUNNER_TEMP/${{ matrix.os }}-${{ matrix.suite }}-${{ matrix.arch }}-*.bin.gz
|
||||
sudo ./test/qemu.sh $RUNNER_TEMP/boot-qemu_x86_virt.bin.gz \
|
||||
$RUNNER_TEMP/${{ matrix.os }}-${{ matrix.suite }}-${{ matrix.arch }}-*.bin.gz
|
||||
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -181,10 +181,10 @@ ln -sf /run/systemd/resolve/stub-resolv.conf debian/etc/resolv.conf
|
|||
find debian ! -type d -printf "/%P\n" | sort > files.txt
|
||||
|
||||
# Make a ext4 filesystem of this and put it into the image
|
||||
# >>> 3800000000 - (32 * 1024 * 1024)
|
||||
# 3766445568
|
||||
# >>> ((3800000000 - 32 * 1024 * 1024) // (1024 * 1024)) * (1024 * 1024)
|
||||
# 3765436416
|
||||
rm -f ext4.img
|
||||
fallocate -l 3766445568 ext4.img
|
||||
fallocate -l 3765436416 ext4.img
|
||||
mkfs.ext4 -d debian ext4.img
|
||||
pigz ext4.img
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ rm -f "${IMAGE}"
|
|||
fallocate -v -l 3800000000 "${IMAGE}" # 3,800,000,000 bytes
|
||||
|
||||
parted -s "${IMAGE}" mklabel msdos
|
||||
parted -s "${IMAGE}" mkpart primary fat32 -- 4MiB 32MiB # 28 MiB (50,331,648 bytes)
|
||||
parted -s "${IMAGE}" mkpart primary fat32 -- 4MiB 32MiB # 28 MiB (29,360,128 bytes)
|
||||
parted -s "${IMAGE}" mkpart primary ext2 -- 32MiB -1
|
||||
parted -s "${IMAGE}" set 2 boot on
|
||||
|
||||
|
|
|
|||
19
test/qemu.sh
19
test/qemu.sh
|
|
@ -20,12 +20,31 @@ echo "Using password ${SSHPASS}"
|
|||
# Build image
|
||||
zcat "${BOOT}" "${DEBIAN}" > image.bin
|
||||
|
||||
# Check integrity
|
||||
LOOP1=$(losetup -f -P --show image.bin) && {
|
||||
trap 'losetup -d "${LOOP1}"' ERR
|
||||
fsck.vfat -p -f "${LOOP1}p1"
|
||||
fsck.ext4 -p -f "${LOOP1}p2"
|
||||
trap '-' ERR
|
||||
losetup -d "${LOOP1}"
|
||||
}
|
||||
|
||||
# Assume 8GB virtual disk
|
||||
fallocate -l 8GB image.bin
|
||||
|
||||
# Extend second partition
|
||||
parted -s -a opt image.bin "resizepart 2 100%"
|
||||
|
||||
# Check integrity again
|
||||
LOOP2=$(losetup -f -P --show image.bin) && {
|
||||
trap 'losetup -d "${LOOP2}"' ERR
|
||||
fsck.vfat -p -f "${LOOP2}p1"
|
||||
fsck.ext4 -p -f "${LOOP2}p2"
|
||||
resize2fs "${LOOP2}p2"
|
||||
trap '-' ERR
|
||||
losetup -d "${LOOP2}"
|
||||
}
|
||||
|
||||
# Extract U-Boot (u-boot.rom in x86 case)
|
||||
dd if=image.bin of=bios.bin count=2048 skip=16
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue