Revision: 6846 http://ipcop.svn.sourceforge.net/ipcop/?rev=6846&view=rev Author: gespinasse Date: 2012-11-16 07:54:27 +0000 (Fri, 16 Nov 2012) Log Message: ----------- Copy some running kernel modules to be able to run more tests in util-linux, parted, mdadm Not very clean code but that seen to work
Run check_running_test before prepareenv, so the unlikely case where the exact same $(uname -r) inside and outside the chroot could be identified. In that case, the modules will not be copied to avoid some conflict (both modules in depmod...), so those supplemental tests will not be able to run. -Cette ligne, et les suivantes ci-dessous, seront ignor?\195?\169es-- M make.sh Modified Paths: -------------- ipcop/trunk/make.sh Modified: ipcop/trunk/make.sh =================================================================== --- ipcop/trunk/make.sh 2012-11-10 20:57:23 UTC (rev 6845) +++ ipcop/trunk/make.sh 2012-11-16 07:54:27 UTC (rev 6846) @@ -109,6 +109,9 @@ # Set up INSTALLER_DIR INSTALLER_DIR=installer +# Not running tests suite after each package compilation by default +RUNNING_TEST='no' + # To compile a package more than once in the same stage # and send PASS value to both the log file and lfs makefile # Has to be reset after usage or next log will have a wrong name @@ -1083,6 +1086,30 @@ # Remove pre-install list of installed files in case user erase some files before to build again ${SUDO} ${RM} ${LFS}/usr/src/lsalr 2>/dev/null + + # Copy host kernel modules required to run some tests in util-linux, mdadm, parted + # Less tests could run if running kernel is the same as compiled kernel version + # do not bet on compatibility between different kernel config + [ ${KVER} == $(uname -r) ] && [ "${RUNNING_TEST}" == 'yes' ] \ + && beautify message INFO "Skip copying running modules for testing, to avoid conflict with compiled kernel (same version)" \ + && return 0 + for flavor in lib/modules/$(uname -r) lib64/modules/$(uname -r); do + [ -d /${flavor} ] || continue + M_LIST=$(find /${flavor} \( -name 'scsi_debug.ko*' -o -name 'crc?t10dif.ko*' -o -name 'scsi_mod.ko*' -o -name 'md-mod.ko*' \) ) + ${SUDO} ${MKDIR} ${LFS}/${flavor} + ${SUDO} ${CHMOD} 0777 ${LFS}/${flavor} + cp ${M_LIST} ${LFS}/${flavor} + # Uncompress modules if needed, names are hardcoded in .dep because that easier + find ${LFS}/${flavor} -name '*.ko.gz' -exec gzip -fd {} \; + # Warn if not every needed module has been found + M_FOUND=$(ls -1 ${LFS}/${flavor}/*.ko | wc -l) + [ ${M_FOUND} -eq 4 ] || \ + beautify message WARN "Found only ${M_FOUND}/4 modules from running kernel to run the tests in util-linux, mdadm, parted" + echo -e 'alias block-major-9-* md_mod\nalias md md_mod' >${LFS}/${flavor}/modules.alias + echo -e 'crc-t10dif.ko:\nscsi_mod.ko:\nmd-mod.ko:\nscsi_debug.ko: scsi_mod.ko crc-t10dif.ko' >${LFS}/${flavor}/modules.dep + ${SUDO} ${CHMOD} 0666 ${LFS}/${flavor} + done + } # End of prepareenv() @@ -1092,8 +1119,6 @@ ######################################################################################################### check_running_test() { - # not running building tests by default - RUNNING_TEST='no' if [ "${1}" -a x"${1}" == x"test" ]; then RUNNING_TEST='yes' ${MKDIR} ${BASEDIR}/test_${MACHINE}/${BUILDDATE} @@ -2185,9 +2210,9 @@ echo -ne "Building ${BOLD}${NAME}-${VERSION}${NORMAL} for ${BOLD}${MACHINE} on ${MACHINE_REAL}${NORMAL}\n" if [ -f ${BASEDIR}/files_${MACHINE}/01_toolchain/strip ]; then - prepareenv beautify message DONE "Stage toolchain already built (found files_${MACHINE}/01_toolchain/strip)" check_running_test ${2} + prepareenv elif [ -f ${BASEDIR}/cache/${TOOLCHAINNAME} -a -f ${BASEDIR}/cache/${TOOLCHAINNAME}.md5 ]; then echo -ne "${BOLD}*** Restore from ${TOOLCHAINNAME}${NORMAL}\n" echo -ne "Checking md5sum" @@ -2210,12 +2235,12 @@ beautify message DONE # Now prepare the environment + check_running_test ${2} prepareenv - check_running_test ${2} else echo -ne "${BOLD}*** Full toolchain compilation${NORMAL}\n" + check_running_test ${2} prepareenv - check_running_test ${2} # Check if host can build the toolchain toolchain_check_prerequisites @@ -2487,8 +2512,8 @@ ;; toolchain) # Prepare the environment + check_running_test ${2} prepareenv - check_running_test ${2} # Check if host can build the toolchain toolchain_check_prerequisites This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn