build/arm: we overwrote core hooks, more cautious approach

This commit is contained in:
Franco Fichtner 2017-09-03 14:46:46 +02:00
parent c56ebd53c9
commit de69db6994
2 changed files with 27 additions and 10 deletions

View File

@ -68,7 +68,6 @@ mount /dev/${DEV}s2a ${STAGEDIR}/mnt
setup_base ${STAGEDIR}/mnt
setup_kernel ${STAGEDIR}/mnt
# xtools poison the installation, but...
setup_xtools ${STAGEDIR}/mnt
# XXX PHP needs to be defanged temporarily
extract_packages ${STAGEDIR}/mnt
@ -81,9 +80,7 @@ unlock_packages ${STAGEDIR}/mnt
mv ${STAGEDIR}/php ${STAGEDIR}/mnt/usr/local/bin/php
setup_extras ${STAGEDIR} ${SELF}/mnt
setup_entropy ${STAGEDIR}/mnt
# ... rewriting the base will fix that
setup_base ${STAGEDIR}/mnt
setup_kernel ${STAGEDIR}/mnt
setup_xbase ${STAGEDIR}/mnt
cat > ${STAGEDIR}/mnt/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#

View File

@ -355,6 +355,32 @@ setup_copy()
cp -r ${2} ${1}${2}
}
setup_xbase()
{
if [ ${PRODUCT_HOST} = ${PRODUCT_ARCH} ]; then
return
fi
echo ">>> Cleaning up xtools in ${1}"
rm -f ${1}/usr/bin/qemu-*-static ${1}/etc/rc.conf.local
XTOOLS_SET=$(find ${SETSDIR} -name "xtools-*-${PRODUCT_ARCH}.txz")
if [ -z "${XTOOLS_SET}" ]; then
return
fi
XTOOLS=
for XTOOL in $(tar tf ${XTOOLS_SET}); do
if [ -d ${1}/${XTOOL} ]; then
continue
fi
XTOOLS="${XTOOLS} ${XTOOL}"
done
tar -C ${1} -xpf ${SETSDIR}/base-*-${PRODUCT_ARCH}.txz ${XTOOLS}
}
setup_xtools()
{
if [ ${PRODUCT_HOST} = ${PRODUCT_ARCH} ]; then
@ -414,12 +440,6 @@ setup_base()
{
echo ">>> Setting up world in ${1}"
# if we had a base in here before, allow for rewrite
chflags -R noschg ${1}
# manually undo xtools additions
rm -f ${1}/usr/bin/qemu-*-static ${1}/etc/rc.conf.local
tar -C ${1} -xpf ${SETSDIR}/base-*-${PRODUCT_ARCH}.txz
# /home is needed for LiveCD images, and since it