hooks/setup00-merged-usr.sh: use /usr/share/debootstrap/functions if available and account for different architectures
This commit is contained in:
parent
465c056434
commit
0920f72996
1 changed files with 34 additions and 5 deletions
|
@ -2,9 +2,38 @@
|
|||
|
||||
set -exu
|
||||
|
||||
rootdir="$1"
|
||||
TARGET="$1"
|
||||
|
||||
for d in bin sbin lib; do
|
||||
ln -s usr/$d "$rootdir/$d"
|
||||
mkdir -p "$rootdir/usr/$d"
|
||||
done
|
||||
if [ -e "$TARGET/var/lib/dpkg/arch" ]; then
|
||||
ARCH=$(head -1 "$TARGET/var/lib/dpkg/arch")
|
||||
else
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
fi
|
||||
|
||||
if [ -e /usr/share/debootstrap/functions ]; then
|
||||
. /usr/share/debootstrap/functions
|
||||
doing_variant () { [ $1 != "buildd" ]; }
|
||||
MERGED_USR="yes"
|
||||
setup_merged_usr
|
||||
else
|
||||
case $ARCH in
|
||||
hurd-*) exit 0;;
|
||||
amd64) link_dir="lib32 lib64 libx32" ;;
|
||||
i386) link_dir="lib64 libx32" ;;
|
||||
mips|mipsel) link_dir="lib32 lib64" ;;
|
||||
mips64*|mipsn32*) link_dir="lib32 lib64 libo32" ;;
|
||||
powerpc) link_dir="lib64" ;;
|
||||
ppc64) link_dir="lib32 lib64" ;;
|
||||
ppc64el) link_dir="lib64" ;;
|
||||
s390x) link_dir="lib32" ;;
|
||||
sparc) link_dir="lib64" ;;
|
||||
sparc64) link_dir="lib32 lib64" ;;
|
||||
x32) link_dir="lib32 lib64 libx32" ;;
|
||||
esac
|
||||
link_dir="bin sbin lib $link_dir"
|
||||
|
||||
for dir in $link_dir; do
|
||||
ln -s usr/"$dir" "$TARGET/$dir"
|
||||
mkdir -p "$TARGET/usr/$dir"
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue