nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.29k stars 72 forks source link

Issues on OnePlus 6t #7

Open offlinehacker opened 5 years ago

offlinehacker commented 5 years ago

This is the error i get on oneplus 6t

Creating /etc/passwd...
sh: xmalloc: shell.c:1709: cannot allocate 43 bytes (0 bytes allocated)

[Process completed (code 2) - press Enter]

It's running Android 9 with oxygen 9.0.11

t184256 commented 5 years ago

Wow, I would never suspect such trivial code to fail.

The code in question is just

echo "root:x:0:0:System administrator:/data/data/com.termux.nix/files/usr/root:/bin/sh" > /data/data/com.termux.nix/files/usr/etc/passwd
echo "nix-on-droid:x:$(/system/bin/stat -c '%u:%g' /data/data/com.termux.nix/files/usr):nix-on-droid:/bin/sh" >> /data/data/com.termux.nix/files/usr/etc/passwd

Could you please run /system/bin/stat -c '%u:%g' /data/data/com.termux.nix/files/usr and these two commands in a failsafe shell and post the results?

gallexme commented 5 years ago

Same issue on HUAWEI Mate 20 Pro Android 9 Emui 9.0.0.198

gallexme commented 5 years ago

Don't know what u mean with failsafe shell, but I've tried with termux https://puu.sh/D0tAA/45c6764db1.jpg

t184256 commented 5 years ago

When the app was installed, it should've created not one, but two entries in your app drawer. 'Nix' for launching a shell inside the Nix environment, and 'Nix (failsafe shell)' for a vanilla Android environment from the user that owns the Nix environment files. You need to close all the sessions, invoke the latter. and run the commands there.

Running these command in Termux won't cut it because it doesn't have sufficient permissions.