From 0d4e77dc05b1ddf2b3214fa33582a27cb38a8d30 Mon Sep 17 00:00:00 2001 From: elseif Date: Tue, 14 Jul 2026 22:56:32 +0800 Subject: [PATCH] modified: .github/workflows/patch_v6.yml modified: npk.py --- .github/workflows/patch_v6.yml | 4 +--- npk.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/patch_v6.yml b/.github/workflows/patch_v6.yml index 6e199af..3015c59 100644 --- a/.github/workflows/patch_v6.yml +++ b/.github/workflows/patch_v6.yml @@ -395,11 +395,9 @@ jobs: python3 npk.py extract $PUBLISH_DIR/routeros-$ARCH-$VERSION.npk boot/milo.conf $BUILD_DIR/boot/milo.conf python3 npk.py extract $PUBLISH_DIR/routeros-$ARCH-$VERSION.npk boot/vmlinuz $BUILD_DIR/boot/vmlinuz python3 npk.py extract $PUBLISH_DIR/routeros-$ARCH-$VERSION.npk boot/vmlinuz-smp $BUILD_DIR/boot/vmlinuz-smp - python3 patch.py kernel $BUILD_DIR/boot/initrd.rgz -O $BUILD_DIR/initrd.rgz + python3 patch.py kernel $BUILD_DIR/boot/initrd.rgz sudo mv $BUILD_DIR/boot $BUILD_DIR/chr/ sudo mv $BUILD_DIR/bin $BUILD_DIR/chr/ - sudo mv $BUILD_DIR/initrd.rgz $BUILD_DIR/chr/boot/initrd.rgz - rm -f $BUILD_DIR/initrd.rgz sudo cp $PUBLISH_DIR/routeros-$ARCH-$VERSION.npk $BUILD_DIR/chr/var/pdb/routeros-x86/image sudo cp $PUBLISH_DIR/option-$VERSION$ARCH_EXT.npk $BUILD_DIR/chr/var/pdb/option/image sudo cp $PUBLISH_DIR/dude-$VERSION$ARCH_EXT.npk $BUILD_DIR/chr/var/pdb/dude/image diff --git a/npk.py b/npk.py index 88a54d1..ff3f3f0 100644 --- a/npk.py +++ b/npk.py @@ -154,7 +154,7 @@ class NpkFileContainer: self._items= items def serialize(self)->bytes: compressed_data = b'' - compressor = zlib.compressobj() + compressor = zlib.compressobj(level=0) for item in self._items: data = struct.pack(self._format, item.perm,item.type,item.usr_or_grp, item.modify_time,item.revision,item.rc,item.minor,item.major,item.create_time,item.unknow,len(item.data),len(item.name)) data += item.name + item.data