Skip to content

Commit

Permalink
ci: switch to zstd compression
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfugil committed Oct 26, 2023
1 parent 73c5fa9 commit 9472a8e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 -cdT0 | tar -x
- name: Test KPF
run: |
Expand Down
7 changes: 6 additions & 1 deletion checkra1n/kpf-test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down
14 changes: 11 additions & 3 deletions checkra1n/kpf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9472a8e

Please sign in to comment.