Package Details: ksud 3.2.4-2

Git Clone URL: https://aur.archlinux.org/ksud.git (read-only, click to copy)
Package Base: ksud
Description: KernelSU userspace cli
Upstream URL: https://kernelsu.org/
Keywords: kernelsu
Licenses: GPL-3.0-or-later
Submitter: chise0713
Maintainer: chise0713
Last Packager: chise0713
Votes: 1
Popularity: 0.010547
First Submitted: 2024-05-19 10:45 (UTC)
Last Updated: 2026-04-23 12:54 (UTC)

Latest Comments

chise0713 commented on 2026-04-22 12:27 (UTC) (edited on 2026-04-23 12:55 (UTC) by chise0713)

@vitaliikuzhdin I can not reproduce the build error, was it fixed itself at a newer version? Could you try rebuild it again and send the build logs to comments?


edit: I reproduced the error, and pushed a fix commit to it just now

vitaliikuzhdin commented on 2026-03-29 15:01 (UTC) (edited on 2026-03-29 15:01 (UTC) by vitaliikuzhdin)

   Compiling ksud v0.1.0 ([...]/ksud/src/KernelSU-3.2.2/userspace/ksud)
warning: variable does not need to be mutable
   --> userspace/ksud/src/boot_patch.rs:414:9
    |
414 |     let mut bootdevice = None;
    |         ----^^^^^^^^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `kmi`
   --> userspace/ksud/src/boot_patch.rs:407:5
    |
407 |     kmi: &str,
    |     ^^^ help: if this is intentional, prefix it with an underscore: `_kmi`
    |
    = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `ota`
   --> userspace/ksud/src/boot_patch.rs:408:5
    |
408 |     ota: bool,
    |     ^^^ help: if this is intentional, prefix it with an underscore: `_ota`

warning: unused variable: `is_replace_kernel`
   --> userspace/ksud/src/boot_patch.rs:409:5
    |
409 |     is_replace_kernel: bool,
    |     ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_is_replace_kernel`

warning: unused variable: `workdir`
   --> userspace/ksud/src/boot_patch.rs:410:5
    |
410 |     workdir: &Path,
    |     ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_workdir`

warning: unused variable: `partition`
   --> userspace/ksud/src/boot_patch.rs:411:5
    |
411 |     partition: &Option<String>,
    |     ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_partition`

warning: constant `VERSION_CODE` is never used
  --> userspace/ksud/src/defs.rs:45:11
   |
45 | pub const VERSION_CODE: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_CODE"));
   |           ^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

error: linking with `x86_64-linux-gnu-gcc` failed: exit status: 1
  |
  = note:  "x86_64-linux-gnu-gcc" "-m64" "<1 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "[...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/rustcEjM0Td/libzstd_sys-739880e1d4d9ae94.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-*.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "[...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/rustcEjM0Td/raw-dylibs" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "[...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/build/zstd-sys-d3837eb268aab51d/out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "[...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld.lld: error: undefined symbol: ZSTD_freeDCtx
          >>> referenced by ksud.42f5f6958b13265d-cgu.0
          >>>               [...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725.ksud.42f5f6958b13265d-cgu.0.rcgu.o:(core::ptr::drop_in_place$LT$include_flate_compress..FlateDecoder$LT$$RF$mut$u20$std..io..cursor..Cursor$LT$$RF$$u5b$u8$u5d$$GT$$GT$$GT$::h2de85f0108b62ccb)

          ld.lld: error: undefined symbol: ZSTD_DCtx_reset
          >>> referenced by ksud.42f5f6958b13265d-cgu.0
          >>>               [...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725.ksud.42f5f6958b13265d-cgu.0.rcgu.o:(include_flate::decode::h4374d0d98b3488fd)

          ld.lld: error: undefined symbol: ZSTD_decompressStream
          >>> referenced by ksud.42f5f6958b13265d-cgu.0
          >>>               [...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725.ksud.42f5f6958b13265d-cgu.0.rcgu.o:(include_flate::decode::h4374d0d98b3488fd)

          ld.lld: error: undefined symbol: ZSTD_getErrorName
          >>> referenced by ksud.42f5f6958b13265d-cgu.0
          >>>               [...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725.ksud.42f5f6958b13265d-cgu.0.rcgu.o:(zstd::map_error_code::h134ea6f540463899)

          ld.lld: error: undefined symbol: ZSTD_isError
          >>> referenced by ksud.42f5f6958b13265d-cgu.0
          >>>               [...]/ksud/src/KernelSU-3.2.2/userspace/ksud/target/release/deps/ksud-696f0f86fc490725.ksud.42f5f6958b13265d-cgu.0.rcgu.o:(zstd_safe::parse_code::h346b9025bfa51206)
          collect2: error: ld returned 1 exit status


warning: `ksud` (bin "ksud") generated 7 warnings
error: could not compile `ksud` (bin "ksud") due to 1 previous error; 7 warnings emitted
==> ERROR: A failure occurred in build().

$ pacman -Q rust 
rust 1:1.94.1-1
$ pacman -Q zstd 
zstd 1.5.7-3

vitaliikuzhdin commented on 2026-01-29 09:09 (UTC)

"android16-6.12_kernelsu_$pkgvar.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android16-6.12_kernelsu.ko"

Please fix the typo in pkgver.

axuanran commented on 2025-07-21 16:11 (UTC) (edited on 2025-08-11 02:50 (UTC) by axuanran)

Hello! I get this, I try to use rustup and set rustup default nightly , but this is of no use ``==> Extracting sources... -> Extracting KernelSU-1.0.5.tar.gz with bsdtar ==> Starting prepare()... error: failed to parse manifest at/home/xuanran/.cache/paru/clone/ksud/src/KernelSU-1.0.5/userspace/ksud/Cargo.toml`

Caused by: feature edition2024 is required

The package requires the Cargo feature called edition2024, but that feature is not stabilized in this version of Cargo (1.83.0 (5ffbef321 2024-10-29)). Consider trying a newer version of Cargo (this may require the nightly release). See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2024 for more information about the status of this feature. ==> ERROR: A failure occurred in prepare(). Aborting... error: failed to build 'ksud-1.0.5-1': error: packages failed to build: ksud-1.0.5-1```


Right, I changed all of export RUSTUP_TOOLCHAIN= to nightly solve it

sorry, just update toolchain will solve it

chise0713 commented on 2024-08-26 03:35 (UTC)

@nyaruta Thank you for your feedback and suggestions!

I've discovered that the error with LTO occurs only when the build.rs linking functionality is not used. Please try the following patch:

diff --git a/userspace/ksud/build.rs b/userspace/ksud/build.rs
index 021418ac..8a16bff8 100644
--- a/userspace/ksud/build.rs
+++ b/userspace/ksud/build.rs
@@ -34,6 +34,7 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
 }

 fn main() {
+    println!("cargo:rustc-link-lib=zstd"); 
     let (code, name) = match get_git_version() {
         Ok((code, name)) => (code, name),
         Err(_) => {

This patch should resolve the LTO linking issue. If it works, I will update the PKGBUILD accordingly. Additionally, if we are not fetching our own magiskboot, we can remove the unzip makedepends.

<deleted-account> commented on 2024-08-14 05:52 (UTC)

Here is my PKGBUILD

# Maintainer: chise0713 <chise0713 at protonmail dot com>

pkgname=ksud
pkgver=1.0.1
pkgrel=1
pkgdesc='KernelSU userspace cli'
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url='https://kernelsu.org/'
license=('GPL-3.0-or-later')
depends=('magiskboot-bin')
makedepends=('cargo' 'unzip')
_srcname='KernelSU'
source=("$_srcname-$pkgver.tar.gz::https://github.com/tiann/$_srcname/archive/v$pkgver.tar.gz"
        "android12-5.10_kernelsu_$pkgver.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android12-5.10_kernelsu.ko"
        "android13-5.10_kernelsu_$pkgver.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android13-5.10_kernelsu.ko"
        "android13-5.15_kernelsu_$pkgver.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android13-5.15_kernelsu.ko"
        "android14-5.15_kernelsu_$pkgver.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android14-5.15_kernelsu.ko"
        "android14-6.1_kernelsu_$pkgver.ko::https://github.com/tiann/$_srcname/releases/download/v$pkgver/android14-6.1_kernelsu.ko"
)
sha512sums=('a327bd8b6c5abce0da971153759785753470041df285f4a8e9b09049d539c7b4b28cc2adfdceb27edb65a96053cfa9e9e0c43f06f129bca0f9f1f0ca8cd06586'
            'dd971c4fa3f1d1003b34e7746117e09beb14db2efbc690bd2dab10b91604dd1c730e5a56cbfeb25d3783851fe48b4b2bd4610bc9f5e4e4e45296ad64c122aef0'
            'a461d9d07531c662861b020d4251d197320c4bdd8f7e532c8e5221c364b815b9be345d18902d818ca528d12ae875a2144aff478ba3a34f2a61cc2bb68908a0b1'
            '58437823be316e9e558dc32c2baa3e59f852e9ffe1459f55177dbad8656b54b98eaef5afe30025cbbc2569156cb6a6e042ae44ed12c1a1bd3db9e25e36a3e63a'
            '05fc22d63a6fec6820bb7bc27b9ff236b4df94d47f9a9a861aedc1e65f656f79805cbdf65bb6e6d6bb344bcbda7121f88bf22b5ad4aca2354209029682a3f7ec'
            'db0ee7f47a300c9f9b0e5bd1da0c10550705bb277457e71f0c0dc78f81823e267f6055aa136ed5d0631411bc144abaef11c32d44d64fcbaf7a2ff39d190b07ee'
)

options=(!lto)

prepare() {
    cd "$_srcname-$pkgver/userspace/ksud/"

    export RUSTUP_TOOLCHAIN=stable

    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"

    for ko in $srcdir/*.ko; do
        _ko=${ko##*/}
        _ko=${_ko%_$pkgver.ko}
        install -v -Dm644 "$ko" "bin/aarch64/$_ko.ko"
        unset _ko
    done
}

build() {
    cd "$_srcname-$pkgver/userspace/ksud/"

    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target

    cargo build --frozen --release --all-features
}

package() {
    cd "$_srcname-$pkgver"

    install -Dm755 "userspace/ksud/target/release/$pkgname"     -t "$pkgdir/usr/bin/"
    install -Dm644 "LICENSE"                                    -t "$pkgdir/usr/share/licenses/$pkgname/"
}

<deleted-account> commented on 2024-08-14 05:50 (UTC)

Cannot build
Output:

= note: /usr/bin/ld: /build/ksud/src/KernelSU-1.0.1/userspace/ksud/target/release/deps/ksud-bedf0849440e9464.ksud.8fb589a703c351ac-cgu.12.rcgu.o: in function `<zip::read::ZipFile as core::ops::drop::Drop>::drop':
          ksud.8fb589a703c351ac-cgu.12:(.text._ZN60_$LT$zip..read..ZipFile$u20$as$u20$core..ops..drop..Drop$GT$4drop17h4aea84ebc1daec75E+0x23b): undefined reference to `ZSTD_freeDCtx'
...
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

Solved by adding options=(!lto)

chise0713 commented on 2024-05-19 13:00 (UTC) (edited on 2024-05-22 19:24 (UTC) by chise0713)

Usage example:

#!/bin/bash

# Get a boot image
curl -L https://github.com/tiann/KernelSU/releases/download/v0.9.4/android12-5.10.205_2024-03-boot-lz4.img.gz |\
        zcat > android12-5.10.205_2024-03-boot-lz4.img

# Patch kernel image
ksud boot-patch -b android12-5.10.205_2024-03-boot-lz4.img