From 62e87f1d96d8fd3d42b33dc4e818a4b0a3ecbba5 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Fri, 1 May 2015 09:31:48 +0200 Subject: [PATCH] remove unshare chroot style replaces #1421. fixes #1403. --- README.md | 14 -------------- common/chroot-style/unshare.sh | 31 ------------------------------- 2 files changed, 45 deletions(-) delete mode 100755 common/chroot-style/unshare.sh diff --git a/README.md b/README.md index 1ded79d3d52..3d2d0edb2e3 100644 --- a/README.md +++ b/README.md @@ -31,20 +31,6 @@ This utility requires these linux kernel options: This is the default method, and if your system does not support any of the required kernel options it will fail with `EINVAL (Invalid argument)`. -#### unshare(1) - -This utility also requires `user_namespaces(7)` support and these linux kernel options: - -- CONFIG\_NAMESPACES -- CONFIG\_IPC\_NS -- CONFIG\_UTS\_NS -- CONFIG\_USER\_NS - -To enable it: - - $ cd void-packages - $ echo XBPS_CHROOT_CMD=unshare >> etc/conf - #### xbps-uchroot(8) This utility requires these linux kernel options: diff --git a/common/chroot-style/unshare.sh b/common/chroot-style/unshare.sh deleted file mode 100755 index 050e8c69ebd..00000000000 --- a/common/chroot-style/unshare.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# This chroot script uses unshare(1) with user_namespaces(7). -# -readonly MASTERDIR="$1" -readonly DISTDIR="$2" -readonly HOSTDIR="$3" -readonly EXTRA_ARGS="$4" - -if ! command -v unshare >/dev/null 2>&1; then - exit 1 -fi - -if [ -z "$XBPS_IS_UNSHARED" ]; then - XBPS_IS_UNSHARED=1 exec unshare $EXTRA_ARGS -m -U -r -- "$0" "$@" - exit 1 -fi - -shift 4 - -if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then - echo "$0 MASTERDIR/DISTDIR not set" - exit 1 -fi - -for i in /dev /proc /sys; do - mount --rbind "$i" "$MASTERDIR/$i" || exit 1 -done -mount --rbind "$DISTDIR" "$MASTERDIR/void-packages" || exit 1 -mount --rbind "$HOSTDIR" "$MASTERDIR/host" || exit 1 -exec chroot "$MASTERDIR" "$@"