[evoke] r1229 committed - * Finally fix the library resolver....

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 27, 2009, 11:28:22 AM8/27/09
to evoke-...@googlegroups.com
Revision: 1229
Author: heliocentric
Date: Thu Aug 27 08:27:43 2009
Log: * Finally fix the library resolver.

* Use a more solid init_path logic, so kernel only will work for
kernels 'above' ours, eg, we can build just an 8.0 kernel with
COMPAT_FREEBSD7 option, and not put it's userland into the root filesystem.

http://code.google.com/p/evoke/source/detail?r=1229

Modified:
/trunk/builder/dynamic.sh

=======================================
--- /trunk/builder/dynamic.sh Mon Aug 24 07:17:57 2009
+++ /trunk/builder/dynamic.sh Thu Aug 27 08:27:43 2009
@@ -34,13 +34,30 @@

# Copy kernel config to the source.
cp ${BUILDDIR}/targets/FreeBSD/${RELEASE}/${TARGET}/kernconf
${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
+

# Patch in the binary path into the kernel directly, so that loader.conf
doesn't need to.
-if [ "${TARGET_ARCH}" = "amd64" ] ; then
- echo "options
INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/system/FreeBSD-${RELEASE}/i386/bin/nexusd:/system/FreeBSD-${RELEASE}/i386/bin/init:/sbin/init:/stand/sysinstall"
>> ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
-else
- echo "options
INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/sbin/init:/stand/sysinstall" >>
${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
-fi
+
+VERSIONLIST="$(echo "${TARGETLIST}" | cut -d -f : 4 | sort -r | uniq)"
+INIT_PATH="${N_BIN}/nexusd:${N_BIN}/init:/system/FreeBSD-${RELEASE}/i386/bin/nexusd:/system/FreeBSD-${RELEASE}/i386/bin/init"
+
+for version in ${VERSIONLIST}
+do
+ if [ "${version}" -lt "${RELEASE}" ] ; then
+ if [ "${TARGET_ARCH}" = "amd64" ] ; then
+ INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/amd64/bin/nexusd
+ INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/amd64/bin/init
+ INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/i386/bin/nexusd
+ INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/i386/bin/init
+ else
+
INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/${TARGET_ARCH}/bin/nexusd
+
INIT_PATH=${INIT_PATH}:/system/FreeBSD-${version}/${TARGET_ARCH}/bin/init
+ fi
+ fi
+done
+
+echo "options INIT_PATH=${INIT_PATH}:/sbin/init:/stand/sysinstall" >>
${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
+
if [ "${ABI}" = "7" ] ; then
svn co --force http://svn.freebsd.org/base/head/sys/contrib/dev/ath
${WORKDIR}/usr/src/sys/contrib/dev/ath
fi
@@ -167,9 +184,11 @@
resolve_libs() {
for file in "$@"
do
- cd ${DESTDIR}/mnt/lib
echo "${file}" >&2
- TYPE="$(OPTIONS="quiet" filetype ${file})"
+ TYPE="$(OPTIONS="quiet" filetype ${RESOLVE_BINDIR}/${file})"
+ if [ "${TYPE}" = "" ] ; then
+ TYPE="$(OPTIONS="quiet" filetype ${RESOLVE_LIBDIR}/${file})"
+ fi
case "${TYPE}" in
application/x-executable)
DEPENDENCIES=$(${CROSSTOOLSPATH}/readelf -d
${DESTDIR}/mnt/bin/${file} | grep '(NEEDED)' | cut -d [ -f 2 | cut -d ] -f
1)
@@ -187,7 +206,8 @@

}

-
+ RESOLVE_BINDIR="${DESTDIR}/mnt/bin"
+ RESOLVE_LIBDIR="${DESTDIR}/mnt/lib"
echo "Executing resolve_libs" >&2
cd ${DESTDIR}/mnt/bin/
BASELIBS=$(resolve_libs ${PROGS})

Reply all
Reply to author
Forward
0 new messages