termux-packages/packages/debootstrap/debootstrap.patch

53 lines
1.6 KiB
Diff
Raw Normal View History

diff -u -r ../debootstrap-1.0.97/debootstrap ./debootstrap
--- ../debootstrap-1.0.97/debootstrap 2018-04-17 04:06:32.000000000 +0200
+++ ./debootstrap 2018-04-30 03:14:32.764728670 +0200
@@ -14,7 +14,7 @@
2017-06-06 08:20:41 +00:00
if [ -x /debootstrap/debootstrap ]; then
DEBOOTSTRAP_DIR=/debootstrap
else
- DEBOOTSTRAP_DIR=/usr/share/debootstrap
+ DEBOOTSTRAP_DIR=$PREFIX/share/debootstrap
fi
fi
@@ -468,10 +468,10 @@
2017-06-06 08:20:41 +00:00
if in_path dpkg && \
dpkg --print-architecture >/dev/null 2>&1; then
- HOST_ARCH=$(/usr/bin/dpkg --print-architecture)
+ HOST_ARCH=$($PREFIX/bin/dpkg --print-architecture)
2017-06-06 08:20:41 +00:00
elif in_path udpkg && \
udpkg --print-architecture >/dev/null 2>&1; then
- HOST_ARCH=$(/usr/bin/udpkg --print-architecture)
+ HOST_ARCH=$($PREFIX/bin/udpkg --print-architecture)
elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then
HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch")
2017-06-06 08:20:41 +00:00
fi
@@ -512,7 +512,8 @@
2017-06-06 08:20:41 +00:00
if [ "$TARGET" = "/" ]; then
CHROOT_CMD=""
else
- CHROOT_CMD="chroot \"$TARGET\""
2017-06-06 08:20:41 +00:00
+ PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin
+ CHROOT_CMD="proot -w /home -b /dev -b /proc --link2symlink -0 -r $TARGET"
fi
# fakeroot cannot check /proc/1/environ
@@ -532,16 +533,6 @@
2017-06-06 08:20:41 +00:00
export ARCH SUITE TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD
2017-06-06 08:20:41 +00:00
-if am_doing_phase first_stage second_stage; then
- if in_path id && [ "$(id -u)" -ne 0 ]; then
2017-06-06 08:20:41 +00:00
- error 1 NEEDROOT "debootstrap can only run as root"
- fi
- # Ensure that we can create working devices and executables on the target.
- if ! check_sane_mount "$TARGET"; then
- error 1 NOEXEC "Cannot install into target '$TARGET' mounted with noexec or nodev"
- fi
-fi
-
if [ ! -e "$SCRIPT" ]; then
error 1 NOSCRIPT "No such script: %s" "$SCRIPT"
fi