tools-musl: make the run.sh script work for both amd64 and i686
This commit is contained in:
parent
280393ddc1
commit
b81a0c3498
|
@ -1,4 +1,4 @@
|
|||
CHOST=x86_64-gentoo-linux-musl
|
||||
CHOST=ALTARCH-gentoo-linux-musl
|
||||
CFLAGS="-Os -pipe -fomit-frame-pointer"
|
||||
CXXFLAGS="${CFLAGS}"
|
||||
|
||||
|
|
|
@ -1,24 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
ROOTFS="stage4-amd64-musl-vanilla"
|
||||
MYARCH=${1:-"amd64"}
|
||||
|
||||
if [[ "$MYARCH" != "amd64" && "$MYARCH" != "i686" ]]; then
|
||||
echo "Unsupported arch $MYARCH"
|
||||
exit
|
||||
fi
|
||||
|
||||
[[ "$MYARCH" == "amd64" ]] && ALTARCH="x86_64"
|
||||
[[ "$MYARCH" == "i686" ]] && ALTARCH="i386"
|
||||
|
||||
ROOTFS="stage4-${MYARCH}-musl-vanilla"
|
||||
PWD="$(pwd)"
|
||||
|
||||
prepare_etc () {
|
||||
mkdir -p "${ROOTFS}"/etc
|
||||
cp -a "${PWD}"/portage/ "${ROOTFS}"/etc/
|
||||
|
||||
if [[ "$MYARCH" == "amd64" ]]; then
|
||||
sed -i "s/ALTARCH/${ALTARCH}/" "${ROOTFS}"/etc/make.conf
|
||||
elif [[ "$MYARCH" == "i686" ]]; then
|
||||
sed -i "s/ALTARCH/${MYARCH}/" "${ROOTFS}"/etc/make.conf
|
||||
fi
|
||||
}
|
||||
|
||||
prepare_usr_etc() {
|
||||
mkdir -p "${ROOTFS}"/usr/etc
|
||||
|
||||
cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-x86_64.path
|
||||
cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-${ALTARCH}.path
|
||||
/lib
|
||||
/usr/lib
|
||||
/usr/lib/gcc/x86_64-gentoo-linux-musl/4.7.3
|
||||
/usr/x86_64-gentoo-linux-musl/lib
|
||||
/usr/lib/gcc/${ALTARCH}-gentoo-linux-musl/4.7.3
|
||||
/usr/${ALTARCH}-gentoo-linux-musl/lib
|
||||
EOF
|
||||
|
||||
ln -sf ld-musl-x86_64.path "${ROOTFS}"/usr/etc/ld-musl.path
|
||||
ln -sf ld-musl-${ALTARCH}.path "${ROOTFS}"/usr/etc/ld-musl.path
|
||||
}
|
||||
|
||||
prepare_overlay() {
|
||||
|
@ -39,6 +55,10 @@ setup_configs() {
|
|||
sed -i '/^SYNC/d' "${ROOTFS}"/etc/portage/make.conf
|
||||
sed -i '/^GENTOO_MIRRORS/d' "${ROOTFS}"/etc/portage/make.conf
|
||||
sed -i 's/^MAKEOPTS/#MAKEOPTS/' "${ROOTFS}"/etc/portage/make.conf
|
||||
|
||||
# There are some issue with python3, so let's select python2
|
||||
# which so far is option 1 in elesect python.
|
||||
chroot "${ROOTFS}" eselect python set 1
|
||||
}
|
||||
|
||||
bundle_it() {
|
||||
|
|
Loading…
Reference in a new issue