mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 02:34:30 +00:00
Default to ns mode (not fakeroot) for bin wrappers and add sudoj command
This is related to #292
This commit is contained in:
parent
21b5e3fabb
commit
0e6aa260ad
4 changed files with 24 additions and 6 deletions
19
README.md
19
README.md
|
|
@ -110,25 +110,34 @@ used, see the [Usage](#usage) section below.
|
|||
Run JuNest installed programs directly from host OS
|
||||
---------------------------------------
|
||||
|
||||
Installed programs can be accessible directly from host without
|
||||
entering directly into a JuNest session (no need to call `junest` command).
|
||||
Program installed within JuNest can be accessible directly from host machine
|
||||
without entering directly into a JuNest session
|
||||
(no need to call `junest` command first).
|
||||
For instance, supposing the host OS is an Ubuntu distro you can directly
|
||||
run `pacman` by simply updating the `PATH` variable:
|
||||
|
||||
```sh
|
||||
export PATH="$PATH:~/.junest/usr/bin_wrappers"
|
||||
pacman -S htop
|
||||
sudoj pacman -S htop
|
||||
htop
|
||||
```
|
||||
|
||||
By default the wrappers use `"ns --fakeroot"` but you can change it via `JUNEST_ARGS` environment variable.
|
||||
By default the wrappers use `ns` mode. To use the `ns --fakeroot` you can use the convenient command helper `sudoj`.
|
||||
For more control on backend mode you can use the `JUNEST_ARGS` environment variable.
|
||||
For instance, if you want to run `iftop` with real root privileges:
|
||||
|
||||
```
|
||||
pacman -S iftop
|
||||
sudoj pacman -S iftop
|
||||
sudo JUNEST_ARGS="groot" iftop
|
||||
```
|
||||
|
||||
Bin wrappers can be always recreated (e.g. in case for some reasons they get
|
||||
corrupted) with:
|
||||
|
||||
```
|
||||
junest create-bin-wrappers -f
|
||||
```
|
||||
|
||||
Install packages from AUR
|
||||
-------------------------
|
||||
|
||||
|
|
|
|||
8
bin/sudoj
Executable file
8
bin/sudoj
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# This file is part of JuNest (https://github.com/fsquillace/junest).
|
||||
#
|
||||
|
||||
export PATH="${PATH}:${JUNEST_HOME}/usr/bin_wrappers"
|
||||
|
||||
JUNEST_ARGS="ns --fakeroot" "$@"
|
||||
|
|
@ -24,3 +24,4 @@ sudo -E "$JUNEST_SCRIPT" groot -- "$CHECK_SCRIPT" --run-root-tests --skip-aur-te
|
|||
# Test the wrappers work
|
||||
"$JUNEST_SCRIPT" create-bin-wrappers --force
|
||||
"$JUNEST_HOME"/usr/bin_wrappers/pacman --help
|
||||
"${JUNEST_BASE}/bin/sudoj" pacman -Syu
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function create_wrappers() {
|
|||
cat <<EOF > "${JUNEST_HOME}/usr/bin_wrappers/${file}"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
JUNEST_ARGS=\${JUNEST_ARGS:-ns --fakeroot}
|
||||
JUNEST_ARGS=\${JUNEST_ARGS:-ns}
|
||||
|
||||
eval junest "\${JUNEST_ARGS}" -- ${file} "\$(printf "%q" "\$@")"
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue