Compare commits

..

20 Commits

Author SHA1 Message Date
elseif
2c77a67e7d modified: .github/workflows/patch_v7.yml 2026-08-29 10:11:57 +08:00
elseif
66667fc2ed modified: .github/workflows/patch_v7.yml 2026-08-29 10:02:36 +08:00
elseif
39ae5ca66d modified: .github/workflows/patch_v7.yml 2026-08-29 09:53:20 +08:00
elseif
486d4afe26 modified: .github/workflows/patch_v7.yml 2026-08-29 09:48:39 +08:00
elseif
f984370098 modified: .github/workflows/patch_v7.yml 2026-08-29 09:47:30 +08:00
elseif
d13e050198 modified: .github/workflows/patch_v7.yml 2026-08-29 09:43:31 +08:00
elseif
daca50dced # modified: .github/workflows/patch_v7.yml 2026-08-29 09:33:33 +08:00
elseif
c126421897 modified: .github/workflows/patch_v7.yml 2026-08-28 21:35:43 +08:00
elseif
2a4ad51ca9 modified: .github/workflows/patch_v7.yml
modified:   busybox/busybox_arm64
	modified:   busybox/busybox_x86
2026-08-28 20:11:46 +08:00
elseif
a988945f52 update keygen 2026-08-26 01:34:39 +08:00
elseif
e94750a0d8 update keygen 2026-08-25 21:21:44 +08:00
elseif
489427c34f use musl-toolchain compile busybox 2026-08-25 19:48:01 +08:00
elseif
f7a2316049 Merge branch 'main' of github.com:elseif/MikroTikPatch 2026-08-25 17:22:51 +08:00
elseif
7410c6dc6b modified: .github/workflows/build_docker.yml
modified:   index.html
2026-08-25 17:22:35 +08:00
elseif
fc1d950da6 Update patch_v7.yml
Signed-off-by: elseif <elseif@live.cn>
2026-08-21 19:00:54 +08:00
elseif
622ba70c2a Update patch_v7.yml
Signed-off-by: elseif <elseif@live.cn>
2026-08-21 17:42:56 +08:00
elseif
4761e53917 Update main.yml
Signed-off-by: elseif <elseif@live.cn>
2026-08-21 17:40:18 +08:00
elseif
74a6a9c8dd modified: .github/workflows/build_docker.yml 2026-08-05 01:39:42 +08:00
elseif
e29a43041c modified: .github/workflows/build_docker.yml 2026-08-05 01:36:43 +08:00
elseif
3dc5e43434 modified: .github/workflows/build_docker.yml 2026-08-05 01:21:20 +08:00
8 changed files with 179 additions and 46 deletions

View File

@@ -7,14 +7,19 @@ on:
required: false
default: ''
type: string
force:
description: "Force rebuild even if version already exists"
required: false
default: false
type: boolean
permissions:
packages: write
jobs:
Prepare:
runs-on: ubuntu-24.04
outputs:
MATRIX: ${{ steps.get_versions.outputs.MATRIX }}
MATRIX: ${{ steps.filter_matrix.outputs.MATRIX }}
steps:
- name: Get versions and generate matrix
id: get_versions
@@ -51,13 +56,53 @@ jobs:
echo "Generated matrix: $MATRIX"
echo "MATRIX=$MATRIX" >> $GITHUB_OUTPUT
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Filter already-published versions from matrix
id: filter_matrix
env:
IMAGE: "ghcr.io/${{ github.repository_owner }}/chr"
FORCE: ${{ github.event.inputs.force == 'true' }}
run: |
MATRIX='${{ steps.get_versions.outputs.MATRIX }}'
if [ "$FORCE" = "true" ]; then
echo "Force mode enabled, skipping version existence check."
FILTERED="$MATRIX"
else
FILTERED='[]'
while read -r row; do
VERSION=$(echo "$row" | jq -r '.version')
CHANNEL=$(echo "$row" | jq -r '.channel')
set +e
docker manifest inspect "${IMAGE}:${VERSION}" >/dev/null 2>&1
RET=$?
set -e
if [ "$RET" -eq 0 ]; then
echo "Skipping already published version: ${VERSION}"
else
FILTERED=$(echo "$FILTERED" | jq -c --arg VERSION "$VERSION" --arg CHANNEL "$CHANNEL" '. + [{"version": $VERSION, "channel": $CHANNEL}]')
fi
done < <(echo "$MATRIX" | jq -c '.[]')
fi
echo "Filtered matrix: $FILTERED"
echo "MATRIX=$FILTERED" >> "$GITHUB_OUTPUT"
Build:
if: needs.Prepare.outputs.MATRIX != '[]'
runs-on: ubuntu-24.04
needs: Prepare
strategy:
max-parallel: 1
matrix:
include: ${{ fromJson(needs.Prepare.outputs.MATRIX) }}
include: ${{ fromJson(needs.Prepare.outputs.MATRIX != '[]' && needs.Prepare.outputs.MATRIX || '[{"version":"__NO_BUILD__","channel":""}]') }}
env:
TZ: 'Asia/Shanghai'
VERSION: ${{ matrix.version }}
@@ -72,6 +117,13 @@ jobs:
echo "Version: ${{ env.VERSION }}"
echo "Channel: ${{ env.CHANNEL }}"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download CHR image
run: |
# x86 架构
@@ -79,6 +131,7 @@ jobs:
wget -nv -O "amd64/chr-$VERSION.img.zip" \
"https://github.com/elseif/MikroTikPatch/releases/download/$VERSION/chr-$VERSION-legacy-bios.img.zip"
unzip "amd64/chr-$VERSION.img.zip" -d "amd64/"
mv "amd64/chr-$VERSION-legacy-bios.img" "amd64/chr.img"
rm "amd64/chr-$VERSION.img.zip"
# arm64 架构
@@ -86,6 +139,7 @@ jobs:
wget -nv -O "arm64/chr-$VERSION-arm64.img.zip" \
"https://github.com/elseif/MikroTikPatch/releases/download/$VERSION-arm64/chr-$VERSION-arm64.img.zip"
unzip "arm64/chr-$VERSION-arm64.img.zip" -d "arm64/"
mv "arm64/chr-$VERSION-arm64.img" "arm64/chr.img"
rm "arm64/chr-$VERSION-arm64.img.zip"
ls -la amd64/ arm64/
@@ -185,13 +239,6 @@ jobs:
ENTRYPOINT ["/start.sh"]
EOF
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4

View File

@@ -35,25 +35,25 @@ jobs:
release: true
secrets: inherit
Patch_Testing_V7:
if: |
(github.event_name == 'schedule') ||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
uses: ./.github/workflows/patch_v7.yml
with:
channel: testing
release: true
secrets: inherit
# Patch_Testing_V7:
# if: |
# (github.event_name == 'schedule') ||
# (github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
# uses: ./.github/workflows/patch_v7.yml
# with:
# channel: testing
# release: true
# secrets: inherit
Patch_Development_V7:
if: |
(github.event_name == 'schedule') ||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
uses: ./.github/workflows/patch_v7.yml
with:
channel: development
release: true
secrets: inherit
# Patch_Development_V7:
# if: |
# (github.event_name == 'schedule') ||
# (github.event_name == 'workflow_dispatch' && (github.event.inputs.version == 'all' || github.event.inputs.version == 'v7'))
# uses: ./.github/workflows/patch_v7.yml
# with:
# channel: development
# release: true
# secrets: inherit
Patch_Stable_V6:
if: |

View File

@@ -10,8 +10,8 @@ on:
options:
- stable
- long-term
- testing
- development
# - testing
# - development
arch:
description: 'Architecture (x86, arm64)'
required: true
@@ -378,6 +378,72 @@ jobs:
if: matrix.arch == 'x86' && steps.cache-refind.outputs.cache-hit != 'true'
run: wget -nv -O $BUILD_DIR/refind-bin-0.14.2.zip https://downloads.sourceforge.net/project/refind/0.14.2/refind-bin-0.14.2.zip
- name: Build alpine livecd
if: matrix.arch == 'x86'
run: |
set -e
ROOTFS_URL="https://dl-cdn.alpinelinux.org/alpine/v3.24/releases/x86_64/alpine-minirootfs-3.24.1-x86_64.tar.gz"
ROOTFS_DIR=$BUILD_DIR/rootfs
mkdir -p $ROOTFS_DIR
curl -# -L "$ROOTFS_URL" | tar -xzC $ROOTFS_DIR
sudo mount -v --bind /dev $ROOTFS_DIR/dev
sudo mount -vt sysfs sysfs $ROOTFS_DIR/sys
sudo mount -vt proc proc $ROOTFS_DIR/proc
echo "nameserver 1.1.1.1" > $ROOTFS_DIR/etc/resolv.conf
cat << EOF | sudo chroot $ROOTFS_DIR /usr/bin/env PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/sh
set -e
apk update
apk upgrade
apk add alpine-base openrc busybox-mdev-openrc dhcpcd curl iputils ca-certificates linux-lts linux-firmware-none
rc-update add devfs sysinit
rc-update add dmesg sysinit
rc-update add mdev sysinit
rc-update add hwdrivers sysinit
rc-update add acpid boot
rc-update add hostname boot
rc-update add hwclock boot
rc-update add modules boot
rc-update add sysctl boot
rc-update add bootmisc boot
rc-update add dhcpcd boot
apk cache clean
EOF
sudo sed -i 's/^features=.*/features="ata base cdrom scsi nvme ext4 usb virtio"/' $ROOTFS_DIR/etc/mkinitfs/mkinitfs.conf
KERNEL_VERSION=$(ls $ROOTFS_DIR/lib/modules | head -1)
sudo chroot $ROOTFS_DIR /usr/bin/env PATH=/usr/bin:/bin:/usr/sbin:/sbin /sbin/mkinitfs -k -t /tmp "$KERNEL_VERSION"
sudo rm -rf $ROOTFS_DIR/lib/modules
sudo mv $ROOTFS_DIR/tmp/lib/modules $ROOTFS_DIR/lib
sudo chroot $ROOTFS_DIR /sbin/depmod -b / "$KERNEL_VERSION"
sudo umount -v $ROOTFS_DIR/dev
sudo umount -v $ROOTFS_DIR/sys
sudo umount -v $ROOTFS_DIR/proc
sed -i 's/^#\(ttyS0.*\)/\1/' $ROOTFS_DIR/etc/inittab
sed -i 's/^root:.*/root:::0:::::/' $ROOTFS_DIR/etc/shadow
echo "" > $ROOTFS_DIR/etc/motd
sudo ln -sf sbin/init $ROOTFS_DIR/init
cp $ROOTFS_DIR/boot/vmlinuz-* $BUILD_DIR/vmlinuz
sudo rm -rf $ROOTFS_DIR/tmp/*
sudo rm -rf $ROOTFS_DIR/boot/*
sudo rm -rf $ROOTFS_DIR/var/cache/*
(cd "$ROOTFS_DIR" && sudo find . -print0 | sudo cpio --owner=root:root --null -H newc -o 2>/dev/null | xz -C crc32 -v9eT0 > $BUILD_DIR/initramfs.xz)
sudo rm -rf $ROOTFS_DIR
size=$(stat -c %s "$BUILD_DIR/vmlinuz")
printf "vmlinuz size : %d bytes (%.1f MB)\n" "$size" "$(echo "scale=1; $size/1024/1024" | bc)"
size=$(stat -c %s "$BUILD_DIR/initramfs.xz")
printf "initramfs size : %d bytes (%.1f MB)\n" "$size" "$(echo "scale=1; $size/1024/1024" | bc)"
- name: Create ISO & INSTALL image files
run: |
set -e
@@ -395,9 +461,8 @@ jobs:
sudo mount -o loop $BUILD_DIR/new_iso/efiboot.img $BUILD_DIR/efiboot
python3 patch.py kernel $BUILD_DIR/efiboot/linux.x86_64 -O $BUILD_DIR/new_iso/isolinux/linux
sudo umount $BUILD_DIR/efiboot
#修改为16M,减小镜像体积
rm -f $BUILD_DIR/new_iso/efiboot.img
truncate --size 16M $BUILD_DIR/new_iso/efiboot.img
truncate --size 64M $BUILD_DIR/new_iso/efiboot.img
mkfs.vfat -n "Boot" $BUILD_DIR/new_iso/efiboot.img
sudo mount -o loop,uid=$(id -u),gid=$(id -g) $BUILD_DIR/new_iso/efiboot.img $BUILD_DIR/efiboot
mkdir -p $BUILD_DIR/efiboot/EFI/BOOT
@@ -412,11 +477,32 @@ jobs:
loader /linux.x86_64
options "load_ramdisk=1 root=/dev/ram0 -install -cdrom debug"
}
menuentry "Alpine Linux LiveCD" {
loader /vmlinuz
initrd /initramfs.xz
options "debug"
}
default_selection /EFI/BOOT/BOOTX64.EFI
EOF
cp -v $BUILD_DIR/new_iso/isolinux/linux $BUILD_DIR/efiboot/linux.x86_64
cp -v $BUILD_DIR/vmlinuz $BUILD_DIR/efiboot/vmlinuz
cp -v $BUILD_DIR/initramfs.xz $BUILD_DIR/efiboot/initramfs.xz
sync
sudo umount $BUILD_DIR/efiboot
tee $BUILD_DIR/new_iso/isolinux/syslinux.cfg > /dev/null << 'EOF'
default system
timeout 50
prompt 1
label system
kernel linux
append load_ramdisk=1 -install -cdrom debug
label alpine
kernel vmlinuz
append initrd=initramfs.xz debug
EOF
cp -v $BUILD_DIR/vmlinuz $BUILD_DIR/new_iso/isolinux/vmlinuz
cp -v $BUILD_DIR/initramfs.xz $BUILD_DIR/new_iso/isolinux/initramfs.xz
xorriso -as mkisofs -o $PUBLISH_DIR/mikrotik-$VERSION$ARCH_EXT.iso \
-V 'MikroTik' \
-publisher "WWW.MIKROTIK.COM" \
@@ -463,9 +549,9 @@ jobs:
EOF
tee $BUILD_DIR/install/syslinux.cfg > /dev/null << 'EOF'
default system
LABEL system
KERNEL linux
APPEND load_ramdisk=1 -install -hdd
label system
kernel linux
append load_ramdisk=1 -install -hdd
EOF
NPK_FILES=($(find $BUILD_DIR/new_iso/*.npk))
for ((i=1; i<=${#NPK_FILES[@]}; i++))
@@ -623,7 +709,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT.img
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -632,7 +718,7 @@ jobs:
printf '\x01' | dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=336 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:EF00 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT.img
@@ -699,7 +785,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.img
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2:0:-4096 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -710,7 +796,7 @@ jobs:
printf '\x80' | sudo dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=446 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2:0:-4096 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT-legacy-bios.img
@@ -782,7 +868,7 @@ jobs:
truncate --size 128M $BUILD_DIR/chr-$VERSION$ARCH_EXT.img
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
--gpttombr=1:2 \
@@ -791,7 +877,7 @@ jobs:
printf '\x01' | dd of=$BUILD_DIR/mbr.bin bs=1 count=1 seek=336 conv=notrunc
sgdisk \
--zap-all \
--set-alignment=8 \
--set-alignment=1 \
--new=1:34:+32M --typecode=1:EF00 --change-name=1:"RouterOS Boot" \
--new=2:0:0 --typecode=2:8300 --change-name=2:"RouterOS" \
$BUILD_DIR/chr-$VERSION$ARCH_EXT.img

Binary file not shown.

Binary file not shown.

View File

@@ -442,9 +442,9 @@
// Fetch latest version numbers from MikroTik servers
const loadingOverlay = document.getElementById("loading");
const [routeros7_stable, routeros7_testing, routeros6_longterm, routeros6_stable] = await Promise.all([
const [routeros7_stable, routeros7_longterm, routeros6_longterm, routeros6_stable] = await Promise.all([
fetch_latest_versions(`https://upgrade.mikrotik.ltd/routeros/NEWESTa7.stable?ts=${Date.now()}`, "7.19.4"),
fetch_latest_versions(`https://upgrade.mikrotik.ltd/routeros/NEWESTa7.testing?ts=${Date.now()}`, "7.20rc1"),
fetch_latest_versions(`https://upgrade.mikrotik.ltd/routeros/NEWESTa7.long-term?ts=${Date.now()}`, "7.20rc1"),
fetch_latest_versions(`https://upgrade.mikrotik.ltd/routeros/NEWEST6.long-term?ts=${Date.now()}`, "6.49.18"),
fetch_latest_versions(`https://upgrade.mikrotik.ltd/routeros/NEWEST6.stable?ts=${Date.now()}`, "6.49.19"),
]);
@@ -456,7 +456,7 @@
const downloads =[
{
title:"RouterOS v7",
versions:[ { title:"Stable", version:routeros7_stable }, { title:"Testing", version:routeros7_testing } ],
versions:[ { title:"Long-Term", version:routeros7_longterm },{ title:"Stable", version:routeros7_stable } ],
groups: [
{ title:"ARM64 / AMPERE", arch:"arm64", downloads:[ { title:"Main package", type:"main" }, { title:"Extra packages", type:"extra" }, { title:"ISO image for AMPERE", type:"iso" } ] },
{ title:"X86", arch:"x86", downloads:[ { title:"Main package", type:"main" }, { title:"Extra packages", type:"extra" }, { title:"CD Image", type:"iso" }, { title:"Install image", type:"install" } ] },
@@ -472,7 +472,7 @@
},
{
title:"Cloud Hosted Router",
versions:[ { title:"Long-Term", version:routeros6_longterm }, { title:"Stable", version:routeros6_stable }, { title:"Stable", version:routeros7_stable }, { title:"Testing", version:routeros7_testing } ],
versions:[ { title:"Long-Term", version:routeros6_longterm }, { title:"Stable", version:routeros6_stable }, { title:"Long-Term", version:routeros7_longterm }, { title:"Stable", version:routeros7_stable } ],
groups:[
{ title:"X86", arch:"x86", downloads:[ { title:"Main package", type:"main" }, { title:"Extra packages", type:"extra" }, { title:"VHDX image", type:"vhdx" }, { title:"VMDK image", type:"vmdk" }, { title:"VDI image", type:"vdi" }, { title:"VirtualPC image", type:"vhd" }, { title:"Raw disk image", type:"img" }, { title:"OVA template", type:"ova" } ] },
{ title:"ARM64 / AMPERE", arch:"arm64", downloads:[ { title:"Main package", type:"main" }, { title:"Extra packages", type:"extra" }, { title:"VHDX image", type:"vhdx" }, { title:"VMDK image", type:"vmdk" }, { title:"VDI image", type:"vdi" }, { title:"VirtualPC image", type:"vhd" }, { title:"Raw disk image", type:"img" } ] }
@@ -709,8 +709,8 @@
// Generate version selection buttons
versionBtnsContainer.innerHTML = `
<button data-version="${routeros7_longterm}" class="px-3 py-1.5 text-sm font-medium rounded-md hover:bg-blue-200 dark:hover:bg-gray-600 transition-all">v7 Long-Term</button>
<button data-version="${routeros7_stable}" class="px-3 py-1.5 text-sm font-medium rounded-md hover:bg-blue-200 dark:hover:bg-gray-600 transition-all">v7 Stable</button>
<button data-version="${routeros7_testing}" class="px-3 py-1.5 text-sm font-medium rounded-md hover:bg-blue-200 dark:hover:bg-gray-600 transition-all">v7 Testing</button>
<button data-version="${routeros6_longterm}" class="px-3 py-1.5 text-sm font-medium rounded-md hover:bg-blue-200 dark:hover:bg-gray-600 transition-all">v6 Long-Term</button>
<button data-version="${routeros6_stable}" class="px-3 py-1.5 text-sm font-medium rounded-md hover:bg-blue-200 dark:hover:bg-gray-600 transition-all">v6 Stable</button>
`;

Binary file not shown.

Binary file not shown.