From: <ges...@us...> - 2011-12-27 22:34:30
|
Revision: 6200 http://ipcop.svn.sourceforge.net/ipcop/?rev=6200&view=rev Author: gespinasse Date: 2011-12-27 22:34:24 +0000 (Tue, 27 Dec 2011) Log Message: ----------- As a now faster check_files is run on each build, remove ./make.sh check_files option Use ALL_NODIR as the start list to run check all files md5 Use xargs md5sum as much faster than starting md5sum for each file Run scanelf only once with all features check, we will split interesting informations later with awk Produce with awk and grep -v a log for -not-PIE files -not-NOW files files with RPATH files with executable-stack files installed already stripped Add a check for 'No such file or directory' on configure.log Sort warnings count per package on decreasing order Modified Paths: -------------- ipcop/trunk/doc/make.sh-usage ipcop/trunk/lfs/check_files ipcop/trunk/make.sh Modified: ipcop/trunk/doc/make.sh-usage =================================================================== --- ipcop/trunk/doc/make.sh-usage 2011-12-27 22:13:18 UTC (rev 6199) +++ ipcop/trunk/doc/make.sh-usage 2011-12-27 22:34:24 UTC (rev 6200) @@ -21,7 +21,6 @@ check_versions: Compare the versions of packages used in LFS and IPCop dist : Mainly produce a diff from previous version to track wich files have been updated. Export IPCop sources in a .tgz - check_files : Calculate md5 of include files, check various ELF properties othersrc : Build a .tgz with all source packages necessary to compile toolchain : Create our own toolchain package to speed next rebuild language : Search for all lang entries in source, get translations from Modified: ipcop/trunk/lfs/check_files =================================================================== --- ipcop/trunk/lfs/check_files 2011-12-27 22:13:18 UTC (rev 6199) +++ ipcop/trunk/lfs/check_files 2011-12-27 22:34:24 UTC (rev 6200) @@ -30,16 +30,16 @@ # Definitions ############################################################################### +include Config + PKG_NAME = check_files HOST_ARCH = all THISAPP = $(PKG_NAME) -ALLFILES := ${NAME}-${VERSION}-all-files-list.${MACHINE}.txt +TMPFILE := $(shell mktemp) +LOG_PREFIX:= /usr/src/log_${MACHINE}/$(PKG_NAME) -# where we find ELF exec code to check -EXEC_PATH := /{bin,sbin} /lib/{,iptables,udev} /usr/{bin,lib,libexec,local,sbin} /etc/Conexant - ############################################################################### # Top-level Rules ############################################################################### @@ -58,37 +58,45 @@ # Produce the md5 of installed files install : - echo "Generating md5 for each file include in $(NAME)" >> $(LOGFILE) - -mv -f /usr/src/doc/${ALLFILES}.md5 /usr/src/doc/${ALLFILES}.md5.bak - # remove dev/console (and dev/null) from the list or md5sum hang - # skip directories to avoid error message and don't care of symlink - for myfile in `cat /usr/src/doc/${ALLFILES} | sed 's|^dev.*||'`; do \ - if [ -f /$${myfile} ]; then \ - md5sum /$$myfile >> /usr/src/doc/${ALLFILES}.md5; \ - fi; \ - done + # Adjust the list of files we care + # Remove dev/{,console,null} from the list or md5sum hang + # Use the list with directories removed to avoid md5sum and scanelf related error messages + sed -e '/^dev.*/d' ${ALL_NODIR} >${TMPFILE} - # TEXTEREL - cd / && find ${EXEC_PATH} -type f -exec scanelf -qt {} \; > /usr/src/log_${MACHINE}/$(PKG_NAME)-textrel.log + # Generating md5 for each file include + # Result is not in _NODIR.md5 as tools/comp_md5.pl look in ALLFILES + xargs md5sum < ${TMPFILE} > ${ALLFILES}.md5 + # Checking everything with scanelf only once is faster, but result is not that easy to read + # A bit better with those changes : remove trailing space, split STK/REL/PTL title in 3 columns, replace one or more spaces with 1 tab + scanelf -f ${TMPFILE} -a | sed -e 's| *$$||' -e 's|STK/REL/PTL|STK REL PTL|' -e 's| TYPE|TYPE|' -e 's| \{1,\}|\t|g' > $(LOG_PREFIX)-scanelf.log + + cat $(LOG_PREFIX)-scanelf.log | awk '{ printf "%s\t%s\n", $$1, $$11 }' | grep -v ET_DYN > $(LOG_PREFIX)-not-PIE.log + cat $(LOG_PREFIX)-scanelf.log | awk '{ printf "%s\t%s\n", $$10, $$11 }' | grep -v NOW > $(LOG_PREFIX)-not-NOW.log # RPATH (I consider log good enought to my understanding) - cd / && find ${EXEC_PATH} -type f -exec scanelf -qr {} \; > /usr/src/log_${MACHINE}/$(PKG_NAME)-rpath.log + cat $(LOG_PREFIX)-scanelf.log | awk '{ printf "%s\t%s\n", $$9, $$11 }' | grep -v "\-\t" > $(LOG_PREFIX)-RPATH.log # executable stack http://www.gentoo.org/proj/en/hardened/gnu-stack.xml - cd / && find ${EXEC_PATH} -type f -exec scanelf -qe {} \; > /usr/src/log_${MACHINE}/$(PKG_NAME)-executable-stack.log + # klibc related code is compiled without hardening (to save space) and allow execstack, but that code is not installed, so not checked on ALL_NODIR + cat $(LOG_PREFIX)-scanelf.log | awk '{ printf "%s\t%s\n", $$5, $$11 }' | grep -v 'RW-' > $(LOG_PREFIX)-execstack.log + # check already stripped code (that may drive to lib reduction failure for initramfs with mklibs) + scanelf -k '!.symtab' -f ${TMPFILE} -q -F%F#k > $(LOG_PREFIX)-stripped.log + + # Our modified gcc is made to stop on TEXTEREL, so no need to check that + # TODO - # check not-pie code - # check already stripped code (that drive to lib reduction failure for initramfs with mklibs) # check for old hash (not using our LDFLAG), probably just matter for size if we have both + rm ${TMPFILE} ${ALL_NODIR} + # find warnings and count them, configure emit WARNING, perl Makefile.PL emit Warning - -cd /usr/src/log_${MACHINE} && egrep ': WARNING:|Warning:' 0[1-4]*/* >/usr/src/log_${MACHINE}/$(PKG_NAME)-configure_warnings.log + -cd /usr/src/log_${MACHINE} && egrep ' error:|No such file or|: WARNING:|Warning:' 0[1-4]*/* >/usr/src/log_${MACHINE}/$(PKG_NAME)-configure_warnings.log -cd /usr/src/log_${MACHINE} && grep ': warning:' 0[1-4]*/* >/usr/src/log_${MACHINE}/$(PKG_NAME)-compilation_warnings_all.log -cd /usr/src/log_${MACHINE} && \ for f in $$(ls 0[1-4]*/*); do \ [ -f $$f ] && echo -ne "$$f :\t";grep ': warning:' $$f | wc -l; \ - done >/usr/src/log_${MACHINE}/$(PKG_NAME)-compilation-warnings_per_package_count.log + done | sort -k 3,3nr >/usr/src/log_${MACHINE}/$(PKG_NAME)-compilation-warnings_per_package_count.log # remove lucky 0 warnings from the list -sed -i '/\t0$$/d' /usr/src/log_${MACHINE}/$(PKG_NAME)-compilation-warnings_per_package_count.log Modified: ipcop/trunk/make.sh =================================================================== --- ipcop/trunk/make.sh 2011-12-27 22:13:18 UTC (rev 6199) +++ ipcop/trunk/make.sh 2011-12-27 22:34:24 UTC (rev 6200) @@ -2290,30 +2290,6 @@ echo echo "Verify the release 'marker' in doc/ChangeLog and commit doc/ChangeLog to update SVN" ;; -check_files) - # Check if we have yet build - if [ ! -f ${BASEDIR}/doc/${NAME}-${VERSION}-all-files-list.${MACHINE}.txt ]; then - beautify message FAIL "${NAME}-${VERSION}-all-files-list.${MACHINE}.txt not found, you need to build first" - exit 1 - fi - if [ ! -d ${BASEDIR}/log_${MACHINE}/05_packages ]; then - beautify message FAIL "log_${MACHINE}/05_packages not found, you need to build first" - exit 1 - fi - prepareenv - export PATH=${PATH_CH6} - STAGE_ORDER=05; STAGE=packages # needed for logfile name - chroot_make check_files - if [ -f ${BASEDIR}/doc/${NAME}-${PREVIOUSVERSION}-all-files-list.${MACHINE}.txt.md5 ]; then - echo -ne "Running MD5 compare" - ${BASEDIR}/tools/comp_md5.pl ${BASEDIR} ${VERSION} ${PREVIOUSVERSION} ${MACHINE} ${KVER} ${PERLVER} ${VERSIONSTEP} - beautify message DONE - echo "See ${BASEDIR}/doc/${NAME}-${VERSION}-diff-list.${MACHINE}.txt for result" - else - beautify message INFO "No MD5 all-files-list for ${PREVIOUSVERSION} found, no comparison." - fi - stdumount - ;; check_url) echo "Checking sources files availability on the web" if [ ! -d ${DIR_CHK} ]; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |