manager/userspace: added 32bit (armv7a) support

This commit is contained in:
Rifat Azad
2025-05-18 03:19:50 +06:00
parent 0e8286e195
commit a081fc87c9
13 changed files with 103 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -14,10 +14,16 @@ pub const BOOTCTL_PATH: &str = concatcp!(BINARY_DIR, "bootctl");
#[allow(dead_code)]
pub const SUSFSD_PATH: &str = concatcp!(BINARY_DIR, "susfsd");
#[cfg(all(target_arch = "aarch64", target_os = "android"))]
#[derive(RustEmbed)]
#[folder = "bin/aarch64"]
struct Asset;
#[cfg(all(target_arch = "arm", target_os = "android"))]
#[derive(RustEmbed)]
#[folder = "bin/arm"]
struct Asset;
pub fn ensure_binaries(ignore_if_exist: bool) -> Result<()> {
for file in Asset::iter() {
if file == "ksuinit" || file.ends_with(".ko") {

View File

@@ -202,11 +202,7 @@ pub fn root_shell() -> Result<()> {
if free_idx < matches.free.len() {
let name = &matches.free[free_idx];
uid = unsafe {
#[cfg(target_arch = "aarch64")]
let pw = libc::getpwnam(name.as_ptr()).as_ref();
#[cfg(target_arch = "x86_64")]
let pw = libc::getpwnam(name.as_ptr() as *const i8).as_ref();
match pw {
Some(pw) => pw.pw_uid,
None => name.parse::<u32>().unwrap_or(0),