You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
1.5 KiB

  1. #!/bin/csh
  2. setenv TARGET amd64
  3. setenv MAKEOBJDIRPREFIX /tmp/${TARGET}-objdir
  4. setenv DESTDIR /tmp/${TARGET}-kernel
  5. setenv __MAKE_CONF /dev/null
  6. @ __freebsd_mk_jobs = `sysctl -n kern.smp.cpus` + 1
  7. set current_dir = `pwd`
  8. set _current_dir = `echo ${current_dir} | sed -e 's|\(.*/\)\(.*\.git\)\(/.*\)*|\2|g'`
  9. set _current_realdir = `echo ${current_dir} | sed -e 's|\(.*/\)\(.*\.git\)\(/.*\)*|\1/\2|g'`
  10. set _check_toolchain = "${MAKEOBJDIRPREFIX}/___kernel-toolchain_DONE"
  11. set _date=`date "+%Y%m%d%H%M%S"`
  12. set _log="/tmp/${TARGET}-cc-log-${_current_dir}-${_date}"
  13. if ( "`sysctl -n security.bsd.hardlink_check_uid`" == "1" ) then
  14. echo "build will fail, due to hard security checks"
  15. echo "sysctl security.bsd.hardlink_check_uid=0"
  16. exit
  17. endif
  18. if ( "`sysctl -n security.bsd.hardlink_check_gid`" == "1" ) then
  19. echo "build will fail, due to hard security checks"
  20. echo "sysctl security.bsd.hardlink_check_gid=0"
  21. exit
  22. endif
  23. if ( (${_current_dir} != "hardenedBSD.git")) then
  24. if ((${_current_dir} != "opBSD.git")) then
  25. set _current_dir = "hardenedBSD.git"
  26. endif
  27. endif
  28. echo "build source dir: ${_current_dir}"
  29. sleep 1
  30. if ( ! -d $MAKEOBJDIRPREFIX ) then
  31. mkdir $MAKEOBJDIRPREFIX
  32. endif
  33. if ( ! -f ${_check_toolchain} ) then
  34. (cd /usr/data/source/git/opBSD/${_current_dir}; make -j$__freebsd_mk_jobs -DNO_ROOT KERNCONF=GENERIC kernel-toolchain) |& tee ${_log} || exit
  35. touch ${_check_toolchain}
  36. else
  37. echo "skip make kernel-toolchain"
  38. sleep 1
  39. endif
  40. (cd /usr/data/source/git/opBSD/${_current_dir}; make -j$__freebsd_mk_jobs -DNO_ROOT -DNO_CLEAN KERNCONF=GENERIC kernel) |& tee -a ${_log}