mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Provide fake /proc/stat if it's not readable
to make unpatched htop work
This commit is contained in:
parent
98eca42af0
commit
f88b0825c5
1 changed files with 11 additions and 1 deletions
|
|
@ -1,9 +1,12 @@
|
||||||
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
|
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
{ config, writeScript }:
|
{ config, writeScript, writeText }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (config.build) installationDir extraProotOptions;
|
inherit (config.build) installationDir extraProotOptions;
|
||||||
|
fakeProcStat = writeText "fakeProcStat" ''
|
||||||
|
btime 0
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
writeScript "login" ''
|
writeScript "login" ''
|
||||||
|
|
@ -28,6 +31,12 @@ writeScript "login" ''
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -r /proc/stat ]; then
|
||||||
|
BIND_PROC_STAT=""
|
||||||
|
else
|
||||||
|
BIND_PROC_STAT="-b ${installationDir}${fakeProcStat}:/proc/stat"
|
||||||
|
fi
|
||||||
|
|
||||||
exec ${installationDir}/bin/proot-static \
|
exec ${installationDir}/bin/proot-static \
|
||||||
-b ${installationDir}/nix:/nix \
|
-b ${installationDir}/nix:/nix \
|
||||||
-b ${installationDir}/bin:/bin \
|
-b ${installationDir}/bin:/bin \
|
||||||
|
|
@ -35,6 +44,7 @@ writeScript "login" ''
|
||||||
-b ${installationDir}/tmp:/tmp \
|
-b ${installationDir}/tmp:/tmp \
|
||||||
-b ${installationDir}/usr:/usr \
|
-b ${installationDir}/usr:/usr \
|
||||||
-b ${installationDir}/dev/shm:/dev/shm \
|
-b ${installationDir}/dev/shm:/dev/shm \
|
||||||
|
$BIND_PROC_STAT \
|
||||||
-b /:/android \
|
-b /:/android \
|
||||||
--link2symlink \
|
--link2symlink \
|
||||||
--sysvipc \
|
--sysvipc \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue