From 9a65ac4380b7f9ef9d3e975de95a7ce433fbb183 Mon Sep 17 00:00:00 2001 From: Brad House Date: Tue, 9 Dec 2003 19:17:59 +0000 Subject: [PATCH] add devfsd support git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@13 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_compile.sh | 61 +++++++++++++++++++++++++++++++++++++++++--- gen_determineargs.sh | 2 ++ genkernel.conf | 6 +++++ genkernel.sh | 2 ++ 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index 7ce7a65..744b10b 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -240,8 +240,8 @@ compile_modutils() { local ARGS if [ ! -f "${MODUTILS_BINCACHE}" ] then - [ ! -f "${MODUTILS_SRCTAR}" ] && gen_die "Could not find modutils source tarball: ${MODUTILS_BINCACHE}" - cd ${TEMP} + [ ! -f "${MODUTILS_SRCTAR}" ] && gen_die "Could not find modutils source tarball: ${MODUTILS_SRCTAR}" + cd "${TEMP}" rm -rf "${MODUTILS_DIR}" tar -jxpf "${MODUTILS_SRCTAR}" [ ! -d "${MODUTILS_DIR}" ] && gen_die "Modutils directory ${MODUTILS_DIR} invalid" @@ -287,8 +287,8 @@ compile_module_init_tools() { local ARGS if [ ! -f "${MODULE_INIT_TOOLS_BINCACHE}" ] then - [ ! -f "${MODULE_INIT_TOOLS_SRCTAR}" ] && gen_die "Could not find module-init-tools source tarball: ${MODULE_INIT_TOOLS_BINCACHE}" - cd ${TEMP} + [ ! -f "${MODULE_INIT_TOOLS_SRCTAR}" ] && gen_die "Could not find module-init-tools source tarball: ${MODULE_INIT_TOOLS_SRCTAR}" + cd "${TEMP}" rm -rf "${MODULE_INIT_TOOLS_DIR}" tar -jxpf "${MODULE_INIT_TOOLS_SRCTAR}" [ ! -d "${MODULE_INIT_TOOLS_DIR}" ] && gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} invalid" @@ -329,6 +329,59 @@ compile_module_init_tools() { fi } +compile_devfsd() { + local ARGS + if [ ! -f "${DEVFSD_BINCACHE}" -o ! -f "${DEVFSD_CONF_BINCACHE}" ] + then + [ ! -f "${DEVFSD_SRCTAR}" ] && gen_die "Could not find devfsd source tarball: ${DEVFSD_SRCTAR}" + cd "${TEMP}" + rm -rf "${DEVFSD_DIR}" + tar -jxpf "${DEVFSD_SRCTAR}" + [ ! -d "${DEVFSD_DIR}" ] && gen_die "Devfsd directory ${DEVFSD_DIR} invalid" + cd "${DEVFSD_DIR}" + + if [ "${USE_DIETLIBC}" -eq "1" ] + then + extract_dietlibc_bincache + OLD_CC="${UTILS_CC}" + UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}" + fi + + print_info 1 "devfsd: make all" + + if [ "${USE_DIETLIBC}" -eq "1" ] + then + compile_generic "has_dlopen=0 has_rpcsvc=0" utils + else + compile_generic "LDFLAGS=-static" utils + fi + + if [ "${USE_DIETLIBC}" -eq "1" ] + then + clean_dietlibc_bincache + UTILS_CC="${OLD_CC}" + fi + + print_info 1 "devfsd: copying to bincache" + [ ! -f "${TEMP}/${DEVFSD_DIR}/devfsd" ] && gen_die "devfsd executable does not exist after compilation of devfsd" + strip "${TEMP}/${DEVFSD_DIR}/devfsd" || gen_die "could not strip devfsd" + bzip2 "${TEMP}/${DEVFSD_DIR}/devfsd" || gen_die "compression of devfsd failed" + [ ! -f "${TEMP}/${DEVFSD_DIR}/devfsd.bz2" ] && gen_die "could not find compressed devfsd.bz2 binary" + mv "${TEMP}/${DEVFSD_DIR}/devfsd.bz2" "${DEVFSD_BINCACHE}" || gen_die "could not move compressed binary to bincache" + + [ ! -f "${TEMP}/${DEVFSD_DIR}/devfsd.conf" ] && gen_die "devfsd.conf does not exist after compilation of devfsd" + bzip2 "${TEMP}/${DEVFSD_DIR}/devfsd.conf" || gen_die "compression of devfsd.conf failed" + [ ! -f "${TEMP}/${DEVFSD_DIR}/devfsd.conf.bz2" ] && gen_die "could not find compressed devfsd.conf.bz2 binary" + mv "${TEMP}/${DEVFSD_DIR}/devfsd.conf.bz2" "${DEVFSD_CONF_BINCACHE}" || gen_die "could not move compressed binary to bincache" + + print_info 1 "devfsd: cleaning up" + cd "${TEMP}" + rm -rf "${DEVFSD_DIR}" > /dev/null + else + print_info 1 "devfsd: Found bincache at ${DEVFSD_BINCACHE} and ${DEVFSD_CONF_BINCACHE}" + fi +} + compile_dietlibc() { local BUILD_DIETLIBC local ORIGTEMP diff --git a/gen_determineargs.sh b/gen_determineargs.sh index b89c6c0..42df258 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -65,6 +65,8 @@ determine_real_args() { MODUTILS_BINCACHE=`arch_replace "${MODUTILS_BINCACHE}"` DIETLIBC_BINCACHE=`arch_replace "${DIETLIBC_BINCACHE}"` DIETLIBC_BINCACHE_TEMP=`arch_replace "${DIETLIBC_BINCACHE_TEMP}"` + DEVFSD_BINCACHE=`arch_replace "${DEVFSD_BINCACHE}"` + DEVFSD_CONF_BINCACHE=`arch_replace "${DEVFSD_CONF_BINCACHE}"` if isTrue ${BOOTSPLASH} then BOOTSPLASH=1 diff --git a/genkernel.conf b/genkernel.conf index 5087a0f..9111438 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -78,3 +78,9 @@ DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}" DIETLIBC_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2" DIETLIBC_BINCACHE_TEMP="${GK_SHARE}/pkg/%%ARCH%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%-tempdir" +DEVFSD_VER="1.3.25-dietlibc-kernel25" +DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2" +DEVFSD_DIR="devfsd" +DEVFSD_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2" +DEVFSD_CONF_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2" + diff --git a/genkernel.sh b/genkernel.sh index bde9083..6491f7b 100755 --- a/genkernel.sh +++ b/genkernel.sh @@ -66,6 +66,8 @@ else compile_modutils fi +compile_devfsd + # Create initrd create_initrd