From 3c560efb1a384cf515adb2f07d93b8e05797e6e9 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 1 Nov 2001 16:17:37 +0000 Subject: [PATCH] Provide a new picobsd option, "--modules", to also build modules (modload and friends are sufficiently small to consider their inclusion in PicoBSD images). --- release/picobsd/build/Makefile.conf | 8 ++++++-- release/picobsd/build/picobsd | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/release/picobsd/build/Makefile.conf b/release/picobsd/build/Makefile.conf index 936f06217bc1..c4f048b735d5 100644 --- a/release/picobsd/build/Makefile.conf +++ b/release/picobsd/build/Makefile.conf @@ -11,6 +11,10 @@ SRC?=/usr/src CONFIG?=config +MODULES?=-DNO_MODULES # do not build them as a default + +# caller will set MODULES to empty if modules are needed. +# Indeed, it can be used to specify other Makefile options as well. # These 3 variables determine where the kernel is built. # If config were smart enough, we could place the config @@ -34,11 +38,11 @@ ${BUILDDIR}/kernel: ${KERNFILE} ${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways do_a_make_in_the_kernel_directory_anyways: - (cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES) + (cd ${COMPILE}; make KERNEL=kernel ${MODULES} ) ${COMPILE}: ${CONF}/${CONFFILE} (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \ - cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES depend ) + cd ${COMPILE}; make KERNEL=kernel ${MODULES} depend ) ${CONF}/${CONFFILE}: PICOBSD # -mkdir -p ${CONF} # XXX not needed yet. diff --git a/release/picobsd/build/picobsd b/release/picobsd/build/picobsd index be83b5c38ed5..d6726363b84f 100755 --- a/release/picobsd/build/picobsd +++ b/release/picobsd/build/picobsd @@ -100,6 +100,7 @@ set_defaults() { o_init_src="" # non "" if we need to init libs and includes. o_makeopts=${MAKEOPTS:--s} # make options, be silent by default o_no_devfs=yes # we do not want devfs + o_do_modules="" # do not build modules SRC="/usr/src" # default location for sources c_startdir=`pwd` # directory where we start @@ -397,6 +398,11 @@ this as small as possible. " 10 70 2> ${c_reply} \ do_install() { log "do_install()" + if [ "${o_interactive}" = "NO" ] ; then + echo "+++ Build completed +++" + cat .build.reply + return + fi dialog --title "Build ${THETYPE} completed" --inputbox \ "\nThe build process was completed successfuly.\n\ `cat .build.reply` \n\n\ @@ -424,6 +430,10 @@ Your options:\n\ do_kernel() { # OK log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" (cd $MY_TREE; export name SRC CONFIG BUILDDIR # used in this makefile ; + if [ "${o_do_modules}" = "yes" ] ; then + MODULES="" + export MODULES + fi make -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel } @@ -830,6 +840,9 @@ while [ true ]; do o_all_in_mfs="" ;; + --modules) # also build kernel modules + o_do_modules="yes" + ;; -n) o_interactive="NO" ;;