mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 02:34:30 +00:00
Small fixes
This commit is contained in:
parent
de0bec9bc5
commit
632aad46bd
6 changed files with 113 additions and 30 deletions
17
.travis.yml
17
.travis.yml
|
|
@ -10,8 +10,10 @@ before_install:
|
|||
|
||||
install:
|
||||
- PATH=$PWD/bin:$PATH
|
||||
- junest setup
|
||||
- junest -- echo "Installing JuNest (\$(uname -m))"
|
||||
- JUNEST_HOME=~/.junest-arm junest -a arm -- echo "Installing JuNest (\$(uname -m))"
|
||||
- JUNEST_HOME=~/.junest-arm junest setup --arch arm
|
||||
- JUNEST_HOME=~/.junest-arm junest proot --fakeroot -- echo "Installing JuNest (\$(uname -m))"
|
||||
|
||||
script:
|
||||
- bash --version
|
||||
|
|
@ -19,12 +21,11 @@ script:
|
|||
- bash ./tests/unit-tests/unit-tests.sh
|
||||
|
||||
# Multiple tests against different execution modes:
|
||||
# TODO AUR installation check is currently disabled
|
||||
- junest -f -- ${PWD}/lib/checks/check.sh
|
||||
- junest -u -- ${PWD}/lib/checks/check.sh
|
||||
- sudo -E ${PWD}/bin/junest -g -- ${PWD}/lib/checks/check.sh
|
||||
- yes | junest --delete
|
||||
- junest proot --fakeroot -- ${PWD}/lib/checks/check.sh
|
||||
- junest ns -- ${PWD}/lib/checks/check.sh
|
||||
- sudo -E ${PWD}/bin/junest groot -- ${PWD}/lib/checks/check.sh --run-root-tests
|
||||
- yes | junest setup --delete
|
||||
|
||||
# Disable arm because it fails when exiting from check.sh for apparent no reason
|
||||
#- JUNEST_HOME=~/.junest-arm junest -f -- ./lib/checks/check.sh --skip-aur-tests
|
||||
#- yes | JUNEST_HOME=~/.junest-arm junest --delete
|
||||
#- JUNEST_HOME=~/.junest-arm junest proot -f -- ./lib/checks/check.sh --skip-aur-tests
|
||||
#- yes | JUNEST_HOME=~/.junest-arm junest setup --delete
|
||||
|
|
|
|||
39
README.md
39
README.md
|
|
@ -11,7 +11,7 @@ The lightweight Arch Linux based distro that runs upon any Linux distros without
|
|||
|
||||
|Project Status|Donation|Communication|
|
||||
|:------------:|:------:|:-----------:|
|
||||
| [](https://travis-ci.org/fsquillace/junest) [](https://www.openhub.net/p/junest) | [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8LEHQKBCYTACY) [](https://gratipay.com/junest/) | [](https://gitter.im/fsquillace/junest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://webchat.freenode.net/?channels=junest) [](https://groups.google.com/d/forum/junest) [](http://fsquillace.github.io/junest-site/feed.xml) |
|
||||
| [](https://travis-ci.org/fsquillace/junest) [](https://www.openhub.net/p/junest) | [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8LEHQKBCYTACY) | [](https://gitter.im/fsquillace/junest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](http://fsquillace.github.io/junest-site/feed.xml) |
|
||||
|
||||
**Table of Contents**
|
||||
- [Description](#description)
|
||||
|
|
@ -23,7 +23,7 @@ The lightweight Arch Linux based distro that runs upon any Linux distros without
|
|||
- [Troubleshooting](#troubleshooting)
|
||||
- [More documentation](#more-documentation)
|
||||
- [Contributing](#contributing)
|
||||
- [Author](#author)
|
||||
- [Authors](#authors)
|
||||
|
||||
Description
|
||||
===========
|
||||
|
|
@ -106,11 +106,11 @@ visit the [pacman rosetta page](https://wiki.archlinux.org/index.php/Pacman_Rose
|
|||
|
||||
JuNest provides a modified version of `makepkg` in `/opt/makepkg/bin` that
|
||||
allows you to build packages from [AUR](https://aur.archlinux.org/) repository.
|
||||
Remember that in order to build package `base-devel` package group is required
|
||||
Remember that in order to build packages, `base-devel` package group is required
|
||||
first:
|
||||
|
||||
```sh
|
||||
pacman -Sy base-devel
|
||||
pacman -Sy --ignore sudo base-devel
|
||||
```
|
||||
|
||||
Installation
|
||||
|
|
@ -124,8 +124,8 @@ Before installing JuNest be sure that all dependencies are properly installed in
|
|||
- [bash (>=4.0)](https://www.gnu.org/software/bash/)
|
||||
- [GNU coreutils](https://www.gnu.org/software/coreutils/)
|
||||
|
||||
The minimum recommended Linux kernel of the host OS is 2.6.32 on x86 (32-bit
|
||||
and 64 bit) and ARM architectures. It is still possible to run JuNest on lower
|
||||
The minimum recommended Linux kernel of the host OS is 2.6.32 on x86 (64 bit)
|
||||
and ARM architectures. It is still possible to run JuNest on lower
|
||||
2.6.x host OS kernels but errors may appear, and some applications may
|
||||
crash. For further information, read the [Troubleshooting](#troubleshooting)
|
||||
section below.
|
||||
|
|
@ -176,10 +176,8 @@ In order to run JuNest via Linux namespaces:
|
|||
|
||||
PRoot based
|
||||
-----------
|
||||
[Proot](https://wiki.archlinux.org/index.php/Proot) represents the default
|
||||
program used for accessing to the JuNest environments.
|
||||
The main reason to choose Proot as default backend program is because
|
||||
it represents a portable solution that works well in most of GNU/Linux distros available.
|
||||
[Proot](https://wiki.archlinux.org/index.php/Proot) represents a portable
|
||||
solution that works well in most of GNU/Linux distros available.
|
||||
One of the major drawbacks is the fact that Proot is not officially
|
||||
supported anymore, therefore, Proot bugs may no longer be fixed.
|
||||
|
||||
|
|
@ -194,7 +192,7 @@ Chroot based
|
|||
This solution suits only for privileged users. JuNest provides the possibility
|
||||
to run the environment via `chroot` program.
|
||||
In particular, it uses a special program called `GRoot`, an enhanced `chroot`
|
||||
wrapper that allows to bind mount directories specified by the user, such as
|
||||
wrapper, that allows to bind mount directories specified by the user, such as
|
||||
`/proc`, `/sys`, `/dev`, `/tmp` and `$HOME`, before
|
||||
executing any programs inside the JuNest sandbox. In case the mounting will not
|
||||
work, JuNest is even providing the possibility to run the environment directly via
|
||||
|
|
@ -212,8 +210,8 @@ The following table shows the capabilities that each backend program is able to
|
|||
|
||||
| | QEMU | Root privileges required | Manage Official Packages | Manage AUR Packages | Portability | Support | User modes |
|
||||
| --- | ---- | ------------------------ | ------------------------ | ------------------- | ----------- | ------- | ---------- |
|
||||
| **Proot** | YES | NO | YES | YES | YES | Poor | Normal user and `fakeroot` |
|
||||
| **Linux Namespaces** | NO | NO | YES | YES | Poor | YES | `fakeroot` only |
|
||||
| **Proot** | YES | NO | YES | YES | YES | Poor | Normal user and `fakeroot` |
|
||||
| **Chroot** | NO | YES | YES | YES | YES | YES | `root` only |
|
||||
|
||||
Advanced usage
|
||||
|
|
@ -249,12 +247,12 @@ Related wiki page:
|
|||
|
||||
## Run JuNest using a different architecture via QEMU ##
|
||||
The following command will download the ARM JuNest image and will run QEMU in
|
||||
case the host OS runs on either `x86_64` or `x86` architectures:
|
||||
case the host OS runs on `x86_64` architecture:
|
||||
|
||||
```sh
|
||||
$> export JUNEST_HOME=~/.junest-arm
|
||||
$> junest setup -a arm
|
||||
$> junest -- uname -m
|
||||
$> junest proot -- uname -m
|
||||
armv7l
|
||||
```
|
||||
|
||||
|
|
@ -262,7 +260,7 @@ armv7l
|
|||
To bind a host directory to a guest location, you can use proot arguments:
|
||||
|
||||
```sh
|
||||
junest proot `-b` "-b /mnt/mydata:/home/user/mydata"
|
||||
junest proot -b "-b /mnt/mydata:/home/user/mydata"
|
||||
```
|
||||
|
||||
The option `-b` to provide options to the backeng program will work with PRoot, Namespace and GRoot backend programs.
|
||||
|
|
@ -514,13 +512,16 @@ There are additional tutorials in the
|
|||
|
||||
Contributing
|
||||
============
|
||||
You could help improving JuNest in the following ways:
|
||||
Contributions are welcome! You could help improving JuNest in the following ways:
|
||||
|
||||
- [Reporting Bugs](CONTRIBUTING.md#reporting-bugs)
|
||||
- [Suggesting Enhancements](CONTRIBUTING.md#suggesting-enhancements)
|
||||
- [Writing Code](CONTRIBUTING.md#your-first-code-contribution)
|
||||
|
||||
Author
|
||||
======
|
||||
Filippo Squillace <feel.sqoox@gmail.com>
|
||||
Authors
|
||||
=======
|
||||
JuNest was originally created in late 2014 by [Filippo Squillace (feel.sqoox@gmail.com)](https://github.com/fsquillace).
|
||||
|
||||
Here is a list of [**really appreciated contributors**](https://github.com/fsquillace/junest/graphs/contributors)!
|
||||
|
||||
[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/0)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/1)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/2)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/3)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/4)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/5)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/6)[](https://sourcerer.io/fame/fsquillace/fsquillace/junest/links/7)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ source "${JUNEST_BASE}/lib/core/namespace.sh"
|
|||
source "${JUNEST_BASE}/lib/core/proot.sh"
|
||||
|
||||
|
||||
# TODO Add test that checks that no_copy files works
|
||||
|
||||
###################################
|
||||
### General functions ###
|
||||
###################################
|
||||
|
|
@ -34,7 +32,7 @@ usage() {
|
|||
echo -e "-V, --version Show the $NAME version"
|
||||
echo
|
||||
echo -e "Actions and options:"
|
||||
echo -e " s[etup] "
|
||||
echo -e " s[etup] Setup $NAME in ${JUNEST_HOME} either from repo or from file"
|
||||
echo -e " -i, --from-file <image> Setup the $NAME image in ${JUNEST_HOME}"
|
||||
echo -e " -a, --arch <arch> $NAME architecture to download (x86_64, arm)"
|
||||
echo -e " Defaults to the host architecture ($ARCH)"
|
||||
|
|
|
|||
|
|
@ -44,6 +44,20 @@ function test_run_env_as_groot_no_cmd(){
|
|||
assertEquals "chroot_cmd -b $HOME -b /tmp -b /proc -b /sys -b /dev $JUNEST_HOME /bin/sh --login -c /bin/sh --login" "$(cat $STDOUTF)"
|
||||
}
|
||||
|
||||
function test_run_env_as_groot_no_copy(){
|
||||
assertCommandSuccess run_env_as_groot "" "true" pwd
|
||||
assertEquals "chroot_cmd -b $HOME -b /tmp -b /proc -b /sys -b /dev $JUNEST_HOME /bin/sh --login -c pwd" "$(cat $STDOUTF)"
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/host.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/nsswitch.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/resolv.conf ]]
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
function test_run_env_as_groot_nested_env(){
|
||||
JUNEST_ENV=1
|
||||
assertCommandFailOnStatus 106 run_env_as_groot "" "false" ""
|
||||
|
|
@ -65,6 +79,20 @@ function test_run_env_as_chroot_no_cmd(){
|
|||
assertEquals "chroot_cmd $JUNEST_HOME /bin/sh --login -c /bin/sh --login" "$(cat $STDOUTF)"
|
||||
}
|
||||
|
||||
function test_run_env_as_chroot_no_copy(){
|
||||
assertCommandSuccess run_env_as_chroot "" "true" pwd
|
||||
assertEquals "chroot_cmd $JUNEST_HOME /bin/sh --login -c pwd" "$(cat $STDOUTF)"
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/host.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/nsswitch.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/resolv.conf ]]
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
function test_run_env_as_choot_nested_env(){
|
||||
JUNEST_ENV=1
|
||||
assertCommandFailOnStatus 106 run_env_as_chroot "" "false" ""
|
||||
|
|
|
|||
|
|
@ -107,6 +107,32 @@ function test_run_env_with_namespace() {
|
|||
_test_copy_remaining_files
|
||||
}
|
||||
|
||||
function test_run_env_with_namespace_no_copy() {
|
||||
assertCommandSuccess run_env_with_namespace "" "true" ""
|
||||
assertEquals "unshare --mount --user --map-root-user $GROOT --no-umount --recursive -b $HOME -b /tmp -b /proc -b /sys -b /dev $JUNEST_HOME /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/host.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/nsswitch.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/resolv.conf ]]
|
||||
assertEquals 0 $?
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts.equiv ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/netgroup ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/networks ]]
|
||||
assertEquals 0 $?
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/passwd ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/group ]]
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
function test_run_env_with_namespace_with_bindings() {
|
||||
assertCommandSuccess run_env_with_namespace "-b /usr -b /lib:/tmp/lib" "false" ""
|
||||
assertEquals "unshare --mount --user --map-root-user $GROOT --no-umount --recursive -b $HOME -b /tmp -b /proc -b /sys -b /dev -b /usr -b /lib:/tmp/lib $JUNEST_HOME /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
|
|
|||
|
|
@ -62,6 +62,35 @@ function test_run_env_as_user(){
|
|||
_test_copy_remaining_files
|
||||
}
|
||||
|
||||
function test_run_env_as_user_no_copy(){
|
||||
_run_env_with_qemu() {
|
||||
echo $@
|
||||
}
|
||||
assertCommandSuccess run_env_as_user "-k 3.10" "true" "/usr/bin/mkdir" "-v" "/newdir2"
|
||||
assertEquals "-b $HOME -b /tmp -b /proc -b /sys -b /dev -r ${JUNEST_HOME} -k 3.10 /usr/bin/mkdir -v /newdir2" "$(cat $STDOUTF)"
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/host.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/nsswitch.conf ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/resolv.conf ]]
|
||||
assertEquals 0 $?
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts.equiv ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/netgroup ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/networks ]]
|
||||
assertEquals 0 $?
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/passwd ]]
|
||||
assertEquals 0 $?
|
||||
[[ ! -e ${JUNEST_HOME}/etc/group ]]
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
function test_run_env_as_user_nested_env(){
|
||||
JUNEST_ENV=1
|
||||
assertCommandFailOnStatus 106 run_env_as_user "" "false"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue