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
     0d5ff4ca75, 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
This commit is contained in:
jnqnfe 2015-01-18 20:39:36 +00:00 committed by Raphaël Hertzog
parent c54cc2c497
commit a6cc72bf6d
7 changed files with 0 additions and 44 deletions

View File

@ -91,35 +91,3 @@ Check_crossarchitectures ()
Check_architectures "${CROSS}"
}
Check_multiarchitectures ()
{
if [ "$(echo ${LB_ARCHITECTURES} | wc -w)" -gt "1" ]
then
# First, only support multiarch on iso
case "${LIVE_IMAGE_TYPE}" in
iso*)
# Assemble multi-arch
case "${LB_CURRENT_ARCHITECTURE}" in
amd64)
DESTDIR="${DESTDIR}.amd"
DESTDIR_LIVE="${DESTDIR_LIVE}.amd"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.amd"
;;
i386)
DESTDIR="${DESTDIR}.386"
DESTDIR_LIVE="${DESTDIR_LIVE}.386"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.386"
;;
powerpc)
DESTDIR="${DESTDIR}.ppc"
DESTDIR_LIVE="${DESTDIR_LIVE}.ppc"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc"
;;
esac
;;
esac
fi
}

View File

@ -155,8 +155,6 @@ case "${LIVE_IMAGE_TYPE}" in
;;
esac
Check_multiarchitectures
# Creating directory
mkdir -p "${DESTDIR_LIVE}"

View File

@ -59,8 +59,6 @@ case "${LIVE_IMAGE_TYPE}" in
;;
esac
Check_multiarchitectures
# Copying templates
mkdir -p binary/boot/grub/i386-pc

View File

@ -60,8 +60,6 @@ case "${LB_ARCHITECTURES}" in
;;
esac
Check_multiarchitectures
# Creating directory
mkdir -p "${DESTDIR}"

View File

@ -151,8 +151,6 @@ case "${LB_INITRAMFS}" in
;;
esac
Check_multiarchitectures
# Setting boot parameters
if [ "${LB_UNION_FILESYSTEM}" != "overlay" ]
then

View File

@ -86,8 +86,6 @@ case "${LB_INITRAMFS}" in
;;
esac
Check_multiarchitectures
# Creating directory
mkdir -p "${DESTDIR}"

View File

@ -153,8 +153,6 @@ case "${LB_ARCHITECTURES}" in
;;
esac
Check_multiarchitectures
Install_file() {
local FILE
FILE="${1}"