"make release" draft

This commit is contained in:
2026-03-22 23:47:55 +08:00
parent a9a3af5e99
commit e324969a94
10 changed files with 104 additions and 23 deletions

View File

@@ -16,7 +16,7 @@ chroot "$ROOTFS" /bin/sh -c "ln -s /var/cache/apk /etc/apk/cache"
# chroot "$ROOTFS" /bin/sh -c "apk update"
chroot "$ROOTFS" /bin/sh -c "apk add bash curl"
cp "/install-packages.sh" "$ROOTFS/install-packages.sh"
chroot "$ROOTFS" /bin/bash /install-packages.sh
chroot "$ROOTFS" /bin/bash /install-packages.sh || exit 1
umount "$ROOTFS/var/cache/apk"
umount "$ROOTFS/dev"
@@ -26,4 +26,36 @@ umount "$ROOTFS/run"
rm -r "$ROOTFS/build"
# Begin making full disk image for the device
### Begin making full disk image for the device
echo "=========================== RootFS "$( du -sh "$ROOTFS/" )
IMG=output.img
SIZE=512MB
dd if=/dev/zero of="$IMG" bs=1 count=0 seek=$SIZE
sgdisk -o "$IMG" \
-n 1:2048:+64M -t 1:0700 \
-n 2:0:-1M -t 2:8300
losetup -D
LOOP=$(losetup --find --show -P "$IMG")
/sync-loop.sh "$LOOP"
TMP_LOOP="/tmp$LOOP"
mkfs.vfat "${TMP_LOOP}p1"
mkfs.ext4 "${TMP_LOOP}p2"
mkdir -p /mnt/img-root /mnt/img-boot
mount ${TMP_LOOP}p1 /mnt/img-boot
mount ${TMP_LOOP}p2 /mnt/img-root
cp -a "$ROOTFS"/. /mnt/img-root/
cp /build/board.itb /mnt/img-boot
umount /mnt/img-root
umount /mnt/img-boot
losetup -d "$LOOP"

View File

@@ -18,7 +18,7 @@ fi
echo "--------------"
sed -i "s/default_runtime = \"crun\"/\0\ncgroup_manager = \"cgroupfs\"/g" /etc/crio/crio.conf.d/10-crio.conf
cat /etc/crio/crio.conf.d/10-crio.conf
grep cgroup_manager /etc/crio/crio.conf.d/10-crio.conf || exit 1
mkdir -p /var/run/crio
mkdir -p /var/lib/containers/storage

21
alpine/sync-loop.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
DEVICE="$1"
FAKE_DEV="/tmp/dev"
mkdir -p "$FAKE_DEV"
echo "Refreshing partition table..."
partx -u "$DEVICE" 2>/dev/null || partx -a "$DEVICE"
# Find partitions and their Major:Minor numbers
lsblk -rn -o NAME,MAJ:MIN "$DEVICE" | while read -r NAME MAJMIN; do
# Skip the parent loop0
if [[ "$NAME" == "loop0" ]]; then continue; fi
PART_PATH="$FAKE_DEV/$NAME"
MAJOR=$(echo $MAJMIN | cut -d: -f1)
MINOR=$(echo $MAJMIN | cut -d: -f2)
echo "Creating node: $PART_PATH (b $MAJOR $MINOR)"
mknod "$PART_PATH" b "$MAJOR" "$MINOR"
done