[Bug]: AIK prevents boot.img generation (cpio: Cannot mknod: Operation not permitted)
xabolcs opened this issue · 17 comments
CheckBox
- I have searched the issue list and found no similar issues.
- I use the official action instead of someone else's
- I have read the FAQ section in README.md
Configuration
uses: dabao1955/kernel_build_action@main
with:
anykernel3: false
bootimg-url: https://sourceforge.net/projects/crdroid/files/Spacewar/10.x/recovery/boot-20240209.img/download
Describe the bug
shubhamvis98's AIK-magisk
unnecessary unpacks the ramdisk in the last step of unpackimg
:
cd $RPWD/ramdisk
cpio -i < $RPWD/split/ramdisk.cpio
Breaking the build:
Error: Process completed with exit code 2.
Screenshots
No response
How to reproduce
Try unpack the linked boot.img
.
Expected behavior
No response
Error Logs
2024-03-15 22:40:35 (5.08 MB/s) - ‘boot.img’ saved [100663296/100663296]
_ _____ _ _
/_\ \_ \/\ /\ _ __ ___ __ _ __ _(_)___| | __
//_\\ / /\/ //_/____| '_ ` _ \ / _` |/ _` | / __| |/ /
/ _ \/\/ /_/ __ \_____| | | | | | (_| | (_| | \__ \ <
\_/ \_/\____/\/ \/ |_| |_| |_|\__,_|\__, |_|___/_|\_\
|___/ by fossfrog
twitter/git: shubhamvis98
[!]Nothing to clean
Parsing boot image: [/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/boot.img]
HEADER_VER [3]
KERNEL_SZ [56400384]
RAMDISK_SZ [1664276]
OS_VERSION [14.0.0]
OS_PATCH_LEVEL [2024-02]
PAGESIZE [4096]
CMDLINE []
KERNEL_FMT [raw]
RAMDISK_FMT [lz4_legacy]
VBMETA
cpio: dev/null: Cannot mknod: Operation not permitted
cpio: dev/console: Cannot mknod: Operation not permitted
6333 blocks
Error: Process completed with exit code 2.
Additional context
No need to use AIK-magisk
's unpackimg
at all!
It's more than enough to use it's bin/magiskboot_x86
directly.
Or use an alternative:
Do you accept pull requests?
maybe fixed on 81e100d
Almost!
The architecture check is failing:
/home/runner/work/_temp/9b629a8a-74c6-4644-a07c-407176433b67.sh: line 273: Unknow cpu architecture for this device !: command not found
Failing code:
export HOST_ARCH=$(dpkg --print-architecture)
case ${HOST_ARCH} in
armv7* | armv8l | arm64 | armhf | arm) aria2c https://github.com/Shubhamvis98/AIK/raw/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_arm -O magiskboot && chmod 755 magiskboot ;;
i*86 | x86 | amd64) aria2c https://github.com/Shubhamvis98/AIK/raw/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86 -O magiskboot && chmod 755 magiskboot ;;
*) echo -e "\033[31m$(${GETTEXT} "Unknow cpu architecture for this device !")\033[0m"&&exit 1 ;;
esac
Testing locally it finds amd64
but on GH worker it went to the "unkown cpu". 🤷
And fails on that ${GETTEXT}
call. Is ${GETTEXT}
needed or it just a copy-paste leftover?
maybe fixed on 81e100d
Almost! The architecture check is failing:
/home/runner/work/_temp/9b629a8a-74c6-4644-a07c-407176433b67.sh: line 273: Unknow cpu architecture for this device !: command not foundFailing code:
export HOST_ARCH=$(dpkg --print-architecture) case ${HOST_ARCH} in armv7* | armv8l | arm64 | armhf | arm) aria2c https://github.com/Shubhamvis98/AIK/raw/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_arm -O magiskboot && chmod 755 magiskboot ;; i*86 | x86 | amd64) aria2c https://github.com/Shubhamvis98/AIK/raw/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86 -O magiskboot && chmod 755 magiskboot ;; *) echo -e "\033[31m$(${GETTEXT} "Unknow cpu architecture for this device !")\033[0m"&&exit 1 ;; esacTesting locally it finds
amd64
but on GH worker it went to the "unkown cpu". 🤷 And fails on that${GETTEXT}
call. Is${GETTEXT}
needed or it just a copy-paste leftover?
try 4b67877
try 4b67877
🙏
One step forward!
Sorry for not noticing at first, but aria2c
needs -o
instead -O
:
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--index-out'.
-> [util.cc:2051] errorCode=1 Bad path index
Usage:
-O, --index-out=INDEX=PATH Set file path for file with index=INDEX. You can
find the file index using the --show-files option.
PATH is a relative path to the path specified in
--dir option. You can use this option multiple
times.
Possible Values: INDEX=PATH
Tags: #bittorrent
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--index-out'.
-> [util.cc:2051] errorCode=1 Bad path index
Usage:
-O, --index-out=INDEX=PATH Set file path for file with index=INDEX. You can
find the file index using the --show-files option.
PATH is a relative path to the path specified in
--dir option. You can use this option multiple
times.
Possible Values: INDEX=PATH
Tags: #bittorrent
Error: Process completed with exit code 28.
try 4b67877
🙏
One step forward!
Sorry for not noticing at first, but needs instead :
aria2c``-o``-O
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--index-out'. -> [util.cc:2051] errorCode=1 Bad path index Usage: -O, --index-out=INDEX=PATH Set file path for file with index=INDEX. You can find the file index using the --show-files option. PATH is a relative path to the path specified in --dir option. You can use this option multiple times. Possible Values: INDEX=PATH Tags: #bittorrent Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--index-out'. -> [util.cc:2051] errorCode=1 Bad path index Usage: -O, --index-out=INDEX=PATH Set file path for file with index=INDEX. You can find the file index using the --show-files option. PATH is a relative path to the path specified in --dir option. You can use this option multiple times. Possible Values: INDEX=PATH Tags: #bittorrent Error: Process completed with exit code 28.
Maybe I confused the wget command with the aria2 command. Commit 2b31759 has fixed this issue.
Sorry for unable to test this locally, we got one step forward:
- it downloads the correct
magiskboot
(tokernel/kernel/magiskboot
) - it downloads the
boot.img
(tokernel/kernel/split/boot.img
) - it misses
./magiskboot
(because$PWD
iskernel/kernel/split
)
Preparing to Upload boot.img
03/17 12:37:55 [NOTICE] Downloading 1 item(s)
03/17 12:37:55 [NOTICE] CUID#7 - Redirecting to https://raw.githubusercontent.com/Shubhamvis98/AIK/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86
03/17 12:37:56 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/magiskboot
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
98dfee|OK | 24MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/magiskboot
Status Legend:
(OK):download completed.
03/17 12:37:56 [NOTICE] Downloading 1 item(s)
03/17 12:37:56 [NOTICE] CUID#7 - Redirecting to https://downloads.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img?ts=gAAAAABl9uQk2Yx9a5hVU-apFa2E_jFLEIzq7wJ7nhEmpfarU0beF0cQaTqizd5-r0wi6yRAvIiEw0jYlgEY9udeUL1kKjSotw%3D%3D&use_mirror=phoenixnap&r=
03/17 12:37:56 [NOTICE] CUID#7 - Redirecting to https://phoenixnap.dl.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img
[#56683e 208KiB/96MiB(0%) CN:1 DL:1.0MiB ETA:1m27s]
[#56683e 37MiB/96MiB(38%) CN:1 DL:30MiB ETA:1s]
[#56683e 82MiB/96MiB(85%) CN:1 DL:37MiB]
03/17 12:37:59 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
56683e|OK | 38MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img
Status Legend:
(OK):download completed.
nohup: failed to run command './magiskboot': No such file or directory
Error: Process completed with exit code 127.
Thank you all the help!
Sorry for unable to test this locally, we got one step forward:
- it downloads the correct
magiskboot
(tokernel/kernel/magiskboot
)- it downloads the
boot.img
(tokernel/kernel/split/boot.img
)- it misses
./magiskboot
(because$PWD
iskernel/kernel/split
)Preparing to Upload boot.img 03/17 12:37:55 [NOTICE] Downloading 1 item(s) 03/17 12:37:55 [NOTICE] CUID#7 - Redirecting to https://raw.githubusercontent.com/Shubhamvis98/AIK/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86 03/17 12:37:56 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/magiskboot Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 98dfee|OK | 24MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/magiskboot Status Legend: (OK):download completed. 03/17 12:37:56 [NOTICE] Downloading 1 item(s) 03/17 12:37:56 [NOTICE] CUID#7 - Redirecting to https://downloads.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img?ts=gAAAAABl9uQk2Yx9a5hVU-apFa2E_jFLEIzq7wJ7nhEmpfarU0beF0cQaTqizd5-r0wi6yRAvIiEw0jYlgEY9udeUL1kKjSotw%3D%3D&use_mirror=phoenixnap&r= 03/17 12:37:56 [NOTICE] CUID#7 - Redirecting to https://phoenixnap.dl.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img [#56683e 208KiB/96MiB(0%) CN:1 DL:1.0MiB ETA:1m27s] [#56683e 37MiB/96MiB(38%) CN:1 DL:30MiB ETA:1s] [#56683e 82MiB/96MiB(85%) CN:1 DL:37MiB] 03/17 12:37:59 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 56683e|OK | 38MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img Status Legend: (OK):download completed. nohup: failed to run command './magiskboot': No such file or directory Error: Process completed with exit code 127.Thank you all the help!
well, it's my mistake :(
One more step forward! Thank you!
- as the
cd split
is now earlier than theboot.img
download ... - the
aria2c
still downloads it tosplit/boot.img
- which is now
kernel/kernel/split/split/boot.img
- therefore
magiskboot
doesn't find it in directorykernel/kernel/split/
Preparing to Upload boot.img
03/17 14:14:26 [NOTICE] Downloading 1 item(s)
03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://raw.githubusercontent.com/Shubhamvis98/AIK/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86
03/17 14:14:27 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/magiskboot
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
bee218|OK | 80MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/magiskboot
Status Legend:
(OK):download completed.
03/17 14:14:27 [NOTICE] Downloading 1 item(s)
03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://downloads.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img?ts=gAAAAABl9vrDNiKmJ3G6jcAn4XLtmIb2syNirP5Y_8PK0mD_N5KqkkgiIwN5L9A2TwQ9WTTnNNWaavYClNxrl6MZ2xgmf8RBzA%3D%3D&use_mirror=cytranet&r=
03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://cytranet.dl.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img
[#5340e0 53MiB/96MiB(55%) CN:1 DL:77MiB]
03/17 14:14:28 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/split/boot.img
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
5340e0|OK | 84MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/split/boot.img
Status Legend:
(OK):download completed.
open: boot.img failed with 2: No such file or directory
Error: Process completed with exit code 1.
One more step forward! Thank you!
- as the
cd split
is now earlier than theboot.img
download ...- the
aria2c
still downloads it tosplit/boot.img
- which is now
kernel/kernel/split/split/boot.img
- therefore
magiskboot
doesn't find it in directorykernel/kernel/split/
Preparing to Upload boot.img 03/17 14:14:26 [NOTICE] Downloading 1 item(s) 03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://raw.githubusercontent.com/Shubhamvis98/AIK/4ac321dfd48e16344e6146c505708aa720ff0bb3/bin/magiskboot_x86 03/17 14:14:27 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/magiskboot Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= bee218|OK | 80MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/magiskboot Status Legend: (OK):download completed. 03/17 14:14:27 [NOTICE] Downloading 1 item(s) 03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://downloads.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img?ts=gAAAAABl9vrDNiKmJ3G6jcAn4XLtmIb2syNirP5Y_8PK0mD_N5KqkkgiIwN5L9A2TwQ9WTTnNNWaavYClNxrl6MZ2xgmf8RBzA%3D%3D&use_mirror=cytranet&r= 03/17 14:14:27 [NOTICE] CUID#7 - Redirecting to https://cytranet.dl.sourceforge.net/project/crdroid/Spacewar/10.x/recovery/boot-20240209.img [#5340e0 53MiB/96MiB(55%) CN:1 DL:77MiB] 03/17 14:14:28 [NOTICE] Download complete: /home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/split/boot.img Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 5340e0|OK | 84MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/split/boot.img Status Legend: (OK):download completed. open: boot.img failed with 2: No such file or directory Error: Process completed with exit code 1.
86b659e
Well, I forgot about that...
🙏
Much better now!
I would like to build KernelSU as loadable kernel module and my config is:
ksu: true
ksu-lkm: true
And it misses out/drivers/kernelsu/kernelsu.ko
:
543243|OK | 43MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img
Status Legend:
(OK):download completed.
Parsing boot image: [boot.img]
HEADER_VER [3]
KERNEL_SZ [56400384]
RAMDISK_SZ [1664276]
OS_VERSION [14.0.0]
OS_PATCH_LEVEL [2024-02]
PAGESIZE [4096]
CMDLINE []
KERNEL_FMT [raw]
RAMDISK_FMT [lz4_legacy]
VBMETA
cat: nohup.out: No such file or directory
Parsing boot image: [boot.img]
HEADER_VER [3]
KERNEL_SZ [56400384]
RAMDISK_SZ [1664276]
OS_VERSION [14.0.0]
OS_PATCH_LEVEL [2024-02]
PAGESIZE [4096]
CMDLINE []
KERNEL_FMT [raw]
RAMDISK_FMT [lz4_legacy]
VBMETA
Repack to boot image: [new-boot.img]
HEADER_VER [3]
KERNEL_SZ [56400384]
RAMDISK_SZ [1664276]
OS_VERSION [14.0.0]
OS_PATCH_LEVEL [2024-02]
PAGESIZE [4096]
CMDLINE []
mkdir: created directory '../../../build'
renamed 'new-boot.img' -> '../../../build/boot.img'
mv: cannot stat 'out/drivers/kernelsu/kernelsu.ko': No such file or directory
Error: Process completed with exit code 1.
Maybe a cd ..
as the last step in the if [ ${{ inputs.anykernel3 }} = false ]; then ...
block is missing.
Thank you for being so patient and helpful!
🙏
Much better now!
I would like to build KernelSU as loadable kernel module and my config is:
ksu: true ksu-lkm: trueAnd it misses :
out/drivers/kernelsu/kernelsu.ko
543243|OK | 43MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img Status Legend: (OK):download completed. Parsing boot image: [boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] KERNEL_FMT [raw] RAMDISK_FMT [lz4_legacy] VBMETA cat: nohup.out: No such file or directory Parsing boot image: [boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] KERNEL_FMT [raw] RAMDISK_FMT [lz4_legacy] VBMETA Repack to boot image: [new-boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] mkdir: created directory '../../../build' renamed 'new-boot.img' -> '../../../build/boot.img' mv: cannot stat 'out/drivers/kernelsu/kernelsu.ko': No such file or directory Error: Process completed with exit code 1.Maybe a as the last step in the block is missing.
cd ..``if [ ${{ inputs.anykernel3 }} = false ]; then ...
Thank you for being so patient and helpful!
Is the kernel version ≥5.10?
Is the kernel version ≥5.10?
It is 5.4.
Is the kernel version ≥5.10?
It is 5.4.
from https://github.com/tiann/KernelSU/releases/tag/v0.9.0 :
"LKM does not support non-GKI kernels, and will not support them in the future;"
Ohh, thanks!
Trying again with ksu-lkm: false
.
Thank you very much for the fix and the notice about ksu-lkm
!
It worked! 🙏
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 8388608
Uploaded bytes 16777216
Uploaded bytes 25165824
Uploaded bytes 26108569
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 122736858f233045fb7f6a39b8c6bb68e3393e1af2e80c6c5bac5a841d7890ba
Finalizing artifact upload
🙏
Much better now!
I would like to build KernelSU as loadable kernel module and my config is:
ksu: true ksu-lkm: trueAnd it misses
out/drivers/kernelsu/kernelsu.ko
:543243|OK | 43MiB/s|/home/runner/work/android_kernel_builds/android_kernel_builds/kernel/kernel/split/boot.img Status Legend: (OK):download completed. Parsing boot image: [boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] KERNEL_FMT [raw] RAMDISK_FMT [lz4_legacy] VBMETA cat: nohup.out: No such file or directory Parsing boot image: [boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] KERNEL_FMT [raw] RAMDISK_FMT [lz4_legacy] VBMETA Repack to boot image: [new-boot.img] HEADER_VER [3] KERNEL_SZ [56400384] RAMDISK_SZ [1664276] OS_VERSION [14.0.0] OS_PATCH_LEVEL [2024-02] PAGESIZE [4096] CMDLINE [] mkdir: created directory '../../../build' renamed 'new-boot.img' -> '../../../build/boot.img' mv: cannot stat 'out/drivers/kernelsu/kernelsu.ko': No such file or directory Error: Process completed with exit code 1.Maybe a
cd ..
as the last step in theif [ ${{ inputs.anykernel3 }} = false ]; then ...
block is missing.Thank you for being so patient and helpful!
I tried on msm-4.19,it has some problem:
MODPOST 3 modules
ERROR: "selinux_status_update_policyload" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "selnl_notify_policyload" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "avc_ss_reset" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "avtab_insert_nonunique" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "avtab_search_node_next" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "avtab_search_node" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "ebitmap_get_bit" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "ebitmap_set_bit" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "hashtab_insert" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "hashtab_search" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "selinux_state" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "security_hook_heads" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "security_add_hooks" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "init_nsproxy" [drivers/kernelsu/kernelsu.ko] undefined!
ERROR: "kallsyms_lookup_name" [drivers/kernelsu/kernelsu.ko] undefined!
make[2]: *** [../scripts/Makefile.modpost:108: __modpost] Error 1