From a6cc72bf6d2c27c8f10546085ed6a6a295b248cc Mon Sep 17 00:00:00 2001
From: jnqnfe <jnqnfe@gmail.com>
Date: Sun, 18 Jan 2015 20:39:36 +0000
Subject: strip useless multi-arch separate directory stuff

(part of never completed side-by-side multi archi support)

Several scripts make a call to a function called Check_multiarchitectures,
the purpose of which is to adjust the target directory that certain 'live'
and 'install' files are located in. The idea is that a script sets up
'DESTDIR', 'DESTDIR_LIVE' and 'DESTDIR_INSTALL' as appropriate and then
the script appends a suitable arch dependant postfix to the directory
name, depending upon the arch currently being targetted. This would allow
the script to be run multiple times, each for a different architecture.

This is a part of an implementation of allowing multiple architectures to
sit side by side within the same live image, selectable from the
bootloader menus. (As opposed to multiple architectures mixed within the
same userland).

This is evidently the case both from the fact that:
  1) The arch specific postfix chosen in that function depends on a var
     called LB_CURRENT_ARCHITECTURE, which is never set. In fact going
     back through the git history to the introduction of the function in
     0d5ff4ca7596790f853cf637e0fe225cad810a76, the var (even considering
     var name changes) has never been set by anything. So effectively the
     call to the function has been entirely redundant all this time.
  2) The major build stages do not perform multiple executions of substages
     per arch. Thus from this perspective it seems that the support was
     never fully implemented.
  3) If any doubt remained, there is an old branch called 'tmp-multiarch'
     which has a couple of commits making progress with completing support,
     such as implementing the above missing pieces.

The above mentioned branch is 10 years old and can be considered abandoned.

It is not clear whether the original author ever intended to complete and
merge this; nor is it at all clear at what stage of completion it was at.

At any rate, imo it is not at all particularly useful to have extra code
and complexity in order to be able to cram multiple environments side by
side in one image, not when CDs/DVDs and even to some extent USB pen drives
are so cheap. And who really needs more than one environment so
desperately on just one such medium.

If this was not enough to justify removal, then there is also the fact that
the support that was implemented has become completely broken over the
years with scripts diverging in terms of the variable names the function
modifies such that they are incompatible with it.

A quick assessment of the state of this latter aspect:

  good:
   - grub-legacy uses the correct var names so is fine
   - memtest similarly good
   - installer_debian-installer looks okay

  questionable:
   - binary_linux-image uses the correct vars but might not select the
     right kernel and initrd files to copy (seems to copy all)

  bad:
   - grub-pc is making a redundant call, after functionality was moved
     to the loopback script
   - loopback is using the wrong vars (INITFS instead of DESTDIR +
     DESTDIR_INSTALL + DESTDIR_LIVE), plus is doing its own amd64+i686
     thing anyway, so the function call would achieve nothing anyway.
   - syslinux is also using the wrong var names so would not work with
     it and is not even making the necessary function call. Also the
     install paths are fixed in the hard coded cfg files anyway so this
     would need addressing with placeholders and sed replacement, but
     then it is not entirely clear how things should work with respect
     to install entries and multi-arch anyway, are we having multiple
     copies of the installer, one for each target arch and then multiple
     copies of the install menus, perhaps under different submenus?

So, this removes the artefacts of this never completed feature.

Gbp-Dch: Short
---
 scripts/build/binary_grub-legacy         | 2 --
 scripts/build/binary_grub-pc             | 2 --
 scripts/build/binary_linux-image         | 2 --
 scripts/build/binary_loopback_cfg        | 2 --
 scripts/build/binary_memtest             | 2 --
 scripts/build/installer_debian-installer | 2 --
 6 files changed, 12 deletions(-)

(limited to 'scripts')

diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy
index bcd78b0e9..264b647b4 100755
--- a/scripts/build/binary_grub-legacy
+++ b/scripts/build/binary_grub-legacy
@@ -155,8 +155,6 @@ case "${LIVE_IMAGE_TYPE}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 # Creating directory
 mkdir -p "${DESTDIR_LIVE}"
 
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index b251fb64f..c2ad7d7af 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -59,8 +59,6 @@ case "${LIVE_IMAGE_TYPE}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 # Copying templates
 mkdir -p binary/boot/grub/i386-pc
 
diff --git a/scripts/build/binary_linux-image b/scripts/build/binary_linux-image
index ae8ef45f6..49e04c756 100755
--- a/scripts/build/binary_linux-image
+++ b/scripts/build/binary_linux-image
@@ -60,8 +60,6 @@ case "${LB_ARCHITECTURES}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 # Creating directory
 mkdir -p "${DESTDIR}"
 
diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg
index 13e6d1ba9..63a9363a5 100755
--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_loopback_cfg
@@ -151,8 +151,6 @@ case "${LB_INITRAMFS}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 # Setting boot parameters
 if [ "${LB_UNION_FILESYSTEM}" != "overlay" ]
 then
diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest
index 0c4a3f00e..221f77265 100755
--- a/scripts/build/binary_memtest
+++ b/scripts/build/binary_memtest
@@ -86,8 +86,6 @@ case "${LB_INITRAMFS}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 # Creating directory
 mkdir -p "${DESTDIR}"
 
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index a06808282..f4fb4e70e 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -153,8 +153,6 @@ case "${LB_ARCHITECTURES}" in
 		;;
 esac
 
-Check_multiarchitectures
-
 Install_file() {
 	local FILE
 	FILE="${1}"
-- 
cgit v1.2.3