From 02cb8c37c5278dc9658f36055e50bdb841dee720 Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Thu, 26 Oct 2023 18:49:47 +0800 Subject: [PATCH] ci: switch to zstd compression --- .github/workflows/ci.yml | 5 ++--- checkra1n/kpf-test/main.c | 7 ++++++- checkra1n/kpf/main.c | 14 +++++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88b6587d..a2fa381c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: dpkg --add-architecture arm64 apt-get update apt-get -y --allow-downgrades dist-upgrade - apt-get install -y build-essential git libc6:arm64 gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross qemu-user qemu-user-binfmt clang lld curl xz-utils + apt-get install -y build-essential git libc6:arm64 gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross qemu-user qemu-user-binfmt clang lld curl zstd - name: Checkout repository uses: actions/checkout@v2 @@ -73,8 +73,7 @@ jobs: - name: Get kernels run: | - curl -LOu ${{ secrets.ACTIONS_RESOURCES_LOGIN }} https://static.palera.in/action-resources/kc.tar.xz - xz -cdT 0 kc.tar.xz | tar -x + curl -Lu ${{ secrets.ACTIONS_RESOURCES_LOGIN }} https://static.palera.in/action-resources/kc.tar.zst | zstd -cdT 0 | tar -x - name: Test KPF run: | diff --git a/checkra1n/kpf-test/main.c b/checkra1n/kpf-test/main.c index b5c2e68d..c31c3592 100644 --- a/checkra1n/kpf-test/main.c +++ b/checkra1n/kpf-test/main.c @@ -565,6 +565,8 @@ static int wait_for_child(child_t *children, size_t *num_bad, child_t **slot) return -1; } +bool test_force_rootful = 0; + int main(int argc, const char **argv) { int aoff = 1; @@ -588,6 +590,9 @@ int main(int argc, const char **argv) case 'v': ++verbose; break; + case 'f': + test_force_rootful = 1; + break; default: fprintf(stderr, "Bad arg: -%c\n", c); return -1; @@ -596,7 +601,7 @@ int main(int argc, const char **argv) } if(argc - aoff != 1) { - fprintf(stderr, "Usage: %s [-nqv] [file | dir]\n", argv[0]); + fprintf(stderr, "Usage: %s [-nqvf] [file | dir]\n", argv[0]); return -1; } int fd = open(argv[aoff], O_RDONLY); diff --git a/checkra1n/kpf/main.c b/checkra1n/kpf/main.c index 6fb88478..1e4542e9 100644 --- a/checkra1n/kpf/main.c +++ b/checkra1n/kpf/main.c @@ -39,6 +39,10 @@ uint32_t offsetof_p_flags; palerain_option_t palera1n_flags; +#if __STDC_HOSTED__ +extern bool test_force_rootful; +#endif + #if 0 // AES, sigh else if((fetch & 0xfffffc00) == 0x510fa000 && (apfs_privcheck[i+1] & 0xfffffc1f) == 0x7100081f && (apfs_privcheck[i+2] & 0xff00001f) == 0x54000003) { @@ -1215,8 +1219,12 @@ void kpf_apfs_patches(xnu_pf_patchset_t* patchset, bool have_union) { xnu_pf_maskmatch(patchset, "apfs_vfsop_mount", remount_matches, remount_masks, sizeof(remount_masks) / sizeof(uint64_t), !have_union -#ifdef DEV_BUILD - && gKernelVersion.darwinMajor <= 22 // this patch is not used on ios 17. +#if DEV_BUILD + && (gKernelVersion.darwinMajor <= 22 +#if __STDC_HOSTED__ + || test_force_rootful +#endif + ) // this patch is not used on ios 17. #else && (palera1n_flags & palerain_option_rootful) != 0 #endif @@ -2005,7 +2013,7 @@ static void kpf_cmd(const char *cmd, char *args) if (!kpf_has_done_mac_mount) panic("Missing patch: mac_mount"); if (!has_found_apfs_vfsop_mount && rootvp_string_match != NULL) { #if __STDC_HOSTED__ - if (gKernelVersion.darwinMajor <= 22) { + if (gKernelVersion.darwinMajor <= 22 || test_force_rootful) { puts("Missing patch: apfs_vfsop_mount"); } else #endif