From 6f5ed66fd94f594bf2fb6a3cce12ef25aef4eca7 Mon Sep 17 00:00:00 2001
From: Luke Shumaker <lukeshu@sbcglobal.net>
Date: Mon, 5 Jan 2015 15:03:35 -0500
Subject: chroot-tools: Drop support for CHROOTARCH

This only existed to work around a compatibility-breaking change in
the Linux kernel.  `uname -m` for MIPS-64 little-endian changed from
"mips64el" to "mips64".  This meant that all existing packages' CARCH
was no longer == `uname -m`, so we had to de-unify the two, as we
couldn't do `setarch $CARCH`.

I'm removing this kludge because:
 - We no longer actively support MIPS.
 - Until two commits ago, it didn't work anyway
 - We should avoid this on new architectures going forward (ARM,
   anyone?)
 - It's gross.
---
 src/chroot-tools/arch-nspawn.patch | 12 ++----------
 src/chroot-tools/librechroot       |  4 +---
 2 files changed, 3 insertions(+), 13 deletions(-)

(limited to 'src')

diff --git a/src/chroot-tools/arch-nspawn.patch b/src/chroot-tools/arch-nspawn.patch
index b3a6973..e387335 100644
--- a/src/chroot-tools/arch-nspawn.patch
+++ b/src/chroot-tools/arch-nspawn.patch
@@ -1,5 +1,5 @@
 --- arch-nspawn.in	2015-01-04 16:32:42.463202960 -0500
-+++ arch-nspawn.ugly	2015-01-05 14:05:01.749597982 -0500
++++ arch-nspawn.ugly	2015-01-05 14:51:34.678625475 -0500
 @@ -1,4 +1,6 @@
  #!/bin/bash
 +# License: GNU GPLv2
@@ -7,7 +7,7 @@
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; version 2 of the License.
-@@ -92,11 +94,14 @@
+@@ -92,6 +94,7 @@
  fi
  
  build_mount_args
@@ -15,11 +15,3 @@
  copy_hostconf
  
  eval $(grep '^CARCH=' "$working_dir/etc/makepkg.conf")
-+CHROOTARCH=$CARCH
-+eval $(grep '^CHROOTARCH=' "$working_dir/etc/libretools.d/chroot.conf")
- 
--exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
-+exec ${CHROOTARCH:+setarch "$CHROOTARCH"} systemd-nspawn -q \
- 	-D "$working_dir" \
- 	--register=no \
- 	"${mount_args[@]}" \
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index 616d868..79f57c9 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -5,7 +5,7 @@ set -euE
 # Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu>
 # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com>
 # Copyright (C) 2012 Michał Masłowski <mtjm@mtjm.eu>
-# Copyright (C) 2012-2014 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright (C) 2012-2015 Luke Shumaker <lukeshu@sbcglobal.net>
 #
 # License: GNU GPLv2+
 #
@@ -338,8 +338,6 @@ main() {
 			printf '%q ' "${CHROOTEXTRAPKG[@]}"
 			printf ')\n'
 		fi
-		# TODO: only set CHROOTARCH if $CARCH != $(uname -m)
-		printf 'CHROOTARCH=%q\n' "$(uname -m)"
 	} > "$copydir"/etc/libretools.d/chroot.conf
 
 	if [[ $mode != delete ]]; then
-- 
cgit v1.2.3-2-g168b