Skip to content

Commit 12f683d

Browse files
committed
Make KSUN dev branch default + Add Hook override patch
1 parent 46b6b2b commit 12f683d

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

.github/actions/action.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -774,23 +774,11 @@ runs:
774774
cp ../../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./
775775
if [ "${{ inputs.ksu_type }}" = "KSUN" ]; then
776776
patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true
777-
778-
# if ! grep -qF 'static void ksu_install_manager_fd_tw_func(struct callback_head *cb)' ./kernel/setuid_hook.c; then
779-
# sed -i '/static inline bool is_allow_su()/istatic void ksu_install_manager_fd_tw_func(struct callback_head *cb){ ksu_install_fd(); kfree(cb);}' ./kernel/setuid_hook.c
780-
# fi
781-
782-
# if ! grep -qxF 'if (ksu_get_manager_appid() == new_uid % PER_USER_RANGE)' ./kernel/setuid_hook.c; then
783-
# sed -i 's/if (ksu_get_manager_appid() == new_uid % PER_USER_RANGE)/if (ksu_get_manager_uid() == new_uid % PER_USER_RANGE)/' ./kernel/setuid_hook.c
784-
# fi
785-
786-
# if ! grep -qF 'define KERNEL_SU_DOMAIN "su"' ./kernel/selinux/selinux.h; then
787-
# sed -i '/void setup_selinux/i#define KERNEL_SU_DOMAIN "su"\n#define KERNEL_SU_FILE "ksu_file"\n\n#define KERNEL_SU_CONTEXT "u:r:" KERNEL_SU_DOMAIN ":s0"\n#define KSU_FILE_CONTEXT "u:object_r:" KERNEL_SU_FILE ":s0"\n' ./kernel/selinux/selinux.h
788-
# fi
789-
790777
for file in $(find ./kernel -maxdepth 2 -name "*.rej" -exec basename {} .rej \;); do
791778
echo "Patching file: $file with fix_$file.patch"
792779
patch -p1 --forward < "../../../kernel_patches/next/susfs_fix_patches/$susfs_version/fix_$file.patch"
793780
done
781+
patch -p1 --forward < "../../../kernel_patches/next/susfs_fix_patches/$susfs_version/overwrite_hook_mode.patch"
794782
else
795783
patch -p1 --forward < 10_enable_susfs_for_ksu.patch
796784
fi

.github/workflows/build-kernel-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ on:
3333
description: 'Enter KernelSU build json'
3434
required: true
3535
type: string
36-
default: '[{"type":"ksun","hash":"next"}]'
36+
default: '[{"type":"ksun","hash":"dev"}]'
3737
optimize_level:
3838
description: "Compiler optimization level"
3939
required: true
@@ -88,7 +88,7 @@ jobs:
8888
8989
input="${{ github.event.inputs.op_model }}"
9090
ksu_options_raw='${{ github.event.inputs.ksu_options }}'
91-
if ! ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "next" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1); then
91+
if ! ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "dev" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1); then
9292
echo "::error::ksu_options validation failed: $ksu_options_normalized"
9393
exit 1
9494
fi
@@ -180,7 +180,7 @@ jobs:
180180
- name: 📊 Build plan summary
181181
run: |
182182
ksu_options_raw='${{ github.event.inputs.ksu_options }}'
183-
ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "next" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1)
183+
ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "dev" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1)
184184
185185
# export KSU_OPTIONS="$ksu_options_normalized"
186186
@@ -571,7 +571,7 @@ jobs:
571571
done
572572
573573
ksu_options_raw='${{ github.event.inputs.ksu_options }}'
574-
ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "next" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1)
574+
ksu_options_normalized=$(echo "$ksu_options_raw" | jq -c 'map(if .type then .type |= ascii_upcase | if .hash == null then if .type == "KSUN" then .hash = "dev" elif .type == "KSU" then .hash = "main" else .hash end else . end else error("No type found") end)' 2>&1)
575575
576576
ksun_hash=$(echo "$ksu_options_normalized" | jq -r 'map(select(.type == "KSUN")) | first | .hash // empty')
577577
ksu_hash=$(echo "$ksu_options_normalized" | jq -r 'map(select(.type == "KSU")) | first | .hash // empty')

0 commit comments

Comments
 (0)