site  contact  subhomenews

Multiarch sub-directories

January 19, 2014 — BarryK
Some of the big distros have gone over to "multi-architecture sub-directories". For example, Debian and Ubuntu now have a directory /usr/lib/i386-linux-gnu, that contains library files, that would previously been in /usr/lib.

This creates numerous problems for Puppy, and I avoided it by having circular symlinks, for example /usr/lib/i386-linux-gnu is a symlink to /usr/lib. This works, with some caveats. It is the technique that has been used in all pups up until now.

I did once attempt to support the proper multiarch sub-directories, however, it became too complicated. A few days ago, 01micko asked if I had given it any further thought, and I replied no.

However, it set me thinking. I am now building Quirky from Ubuntu Trusty Tahr .deb packages -- yes, that was the hint yesterday -- Quirky Tahr!
With Quirky, I really do want the proper multiarch sub-directories, so I took a fresh look at it...

The main stumbling block was the package templates in Woof, they are all based on a directory layout without the multarch subdirs. So, I applied some lateral thinking, and the end result is right now I am running Quirky Tahr off a USB stick, with the proper multiarch subdirs. Posting from it right now.

I have modified only two scripts in Woof, 2createpackages and 3builddistro, and modified most of the FIXUPHACK scripts in the package templates. No other changes are required to the templates, and they should work for both situations, with or without multiarch subdirs.

There is one bug in 3builddistro, that I had to fix in Quirky Tahr after the first bootup, so I will fix the script tonight.
Then I will make up a tarball, for the woof-CE guys to consider for inclusion.

Quirky build system
I built Quirky 6.x in Woof, then post-processed it to add all the quirky features, however, I realised that I really need to start hacking into Woof itself. So, I have forked Woof, renamed it as the "Quirky build system", and have partly merged the quirky features into it.

The Quirky build system will continue to evolve as a narrow-focus build for Quirky, that is, a full-installation mode only.

I don't intend to put it onto a online Fossil or Git repository, instead, when I think it has matured enough, I plan to upload a tarball.

Fossil notice
Note that I plan to remove my online Fossil Woof repository soon, at:
http://bkhome.org/fossil/woof2.cgi/home

It has been forked by the woof-CE guys, but if anyone else wants to grab it, please do it soon. I will probably take it down within a week.

Comments

Here is a Forum post with tarball for consideration to be included in woof-CE:

http://murga-linux.com/puppy/viewtopic.php?p=752097#752097

echo "Copying woof-code/*..."

getARCHDIR="`grep '^DISTRO_ARCHDIR' ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS`" #140119
cp -a -f --remove-destination woof-code/* ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/
echo "$getARCHDIR" >> ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS #140119


...except, for woof-CE it would be "puppy-out_".

It is necessary to preserve the DISTRO_ARCHDIR* variables in file DISTRO_SPECS, that are created by 2createpackages script.
It is possible that, after running merge2out, the user then runs 3builddistro without rerunning 2createpackages, so those variables need to be preserved.

mkdir -p ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}

getARCHDIR=""
[ -f ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS ] && getARCHDIR="`grep '^DISTRO_ARCHDIR' ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS`" #140119 140121
echo "Copying woof-code/*..."
cp -a -f --remove-destination woof-code/* ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/

...

#record target architecture in DISTRO_SPECS (will end up in /etc/ in Puppy build)...
if [ -f ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS ];then
if [ "`grep '^DISTRO_TARGETARCH' ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS`" = "" ];then
echo "DISTRO_TARGETARCH='${TARGETARCH}'" >> ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS
fi
fi
[ "$getARCHDIR" ] && echo "$getARCHDIR" >> ../builds/quirky-out_${HOSTARCH}_${TARGETARCH}_${COMPATDISTRO}_${COMPATVERSION}/DISTRO_SPECS #140121


I fixed it.

I also modified /etc/rc.d/rc.shutdown, 'date' now reports date in a format understood by busybox date applet.

I attempted, and failed, to compile SeaMonkey in Quirky Tahr. It seems to be confused by the multiarch subdirs. I made some changes in '3builddistro', to building of 'devx', hopefully will ease that confusion.

Tags: linux