mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Add root entry in /etc/passwd
This commit is contained in:
parent
8c78ef4333
commit
4b90f3fcf2
1 changed files with 5 additions and 3 deletions
8
script
8
script
|
|
@ -85,8 +85,9 @@ mkdir -p bootstrap/etc/nix
|
||||||
echo "sandbox = false " > bootstrap/etc/nix/nix.conf
|
echo "sandbox = false " > bootstrap/etc/nix/nix.conf
|
||||||
|
|
||||||
echo "composing login scripts..."
|
echo "composing login scripts..."
|
||||||
mkdir -p bootstrap/tmp
|
|
||||||
mkdir -p bootstrap/bin
|
mkdir -p bootstrap/bin
|
||||||
|
mkdir -p bootstrap/root
|
||||||
|
mkdir -p bootstrap/tmp
|
||||||
cat > bootstrap/bin/login <<EOF
|
cat > bootstrap/bin/login <<EOF
|
||||||
#!/system/bin/sh
|
#!/system/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -94,8 +95,9 @@ export USER=\$(/system/bin/whoami)
|
||||||
export PROOT_TMP_DIR=$INST/tmp
|
export PROOT_TMP_DIR=$INST/tmp
|
||||||
|
|
||||||
if [ ! -e $INST/etc/passwd ]; then
|
if [ ! -e $INST/etc/passwd ]; then
|
||||||
echo "Creating an entry in /etc/passwd..."
|
echo "Creating /etc/passwd..."
|
||||||
echo "nix-on-droid:x:\$(/system/bin/stat -c '%u:%g' $INST):nix-on-droid:/bin/sh" > $INST/etc/passwd
|
echo "root:x:0:0:System administrator:$INST/root:/bin/sh" > $INST/etc/passwd
|
||||||
|
echo "nix-on-droid:x:\$(/system/bin/stat -c '%u:%g' $INST):nix-on-droid:/bin/sh" >> $INST/etc/passwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec $INST/bin/proot \
|
exec $INST/bin/proot \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue