Provide a new picobsd option, "--modules", to also build modules

(modload and friends are sufficiently small to consider their inclusion
in PicoBSD images).
This commit is contained in:
Luigi Rizzo 2001-11-01 16:17:37 +00:00
parent 0c5d0f0eff
commit 3c560efb1a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85833
2 changed files with 19 additions and 2 deletions

View File

@ -11,6 +11,10 @@
SRC?=/usr/src SRC?=/usr/src
CONFIG?=config 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. # These 3 variables determine where the kernel is built.
# If config were smart enough, we could place the config # 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 ${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways
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} ${COMPILE}: ${CONF}/${CONFFILE}
(cd ${CONF}; ${CONFIG} -d ${COMPILE} ${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 ${CONF}/${CONFFILE}: PICOBSD
# -mkdir -p ${CONF} # XXX not needed yet. # -mkdir -p ${CONF} # XXX not needed yet.

View File

@ -100,6 +100,7 @@ set_defaults() {
o_init_src="" # non "" if we need to init libs and includes. o_init_src="" # non "" if we need to init libs and includes.
o_makeopts=${MAKEOPTS:--s} # make options, be silent by default o_makeopts=${MAKEOPTS:--s} # make options, be silent by default
o_no_devfs=yes # we do not want devfs o_no_devfs=yes # we do not want devfs
o_do_modules="" # do not build modules
SRC="/usr/src" # default location for sources SRC="/usr/src" # default location for sources
c_startdir=`pwd` # directory where we start c_startdir=`pwd` # directory where we start
@ -397,6 +398,11 @@ this as small as possible. " 10 70 2> ${c_reply} \
do_install() { do_install() {
log "do_install()" log "do_install()"
if [ "${o_interactive}" = "NO" ] ; then
echo "+++ Build completed +++"
cat .build.reply
return
fi
dialog --title "Build ${THETYPE} completed" --inputbox \ dialog --title "Build ${THETYPE} completed" --inputbox \
"\nThe build process was completed successfuly.\n\ "\nThe build process was completed successfuly.\n\
`cat .build.reply` \n\n\ `cat .build.reply` \n\n\
@ -424,6 +430,10 @@ Your options:\n\
do_kernel() { # OK do_kernel() { # OK
log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" log "do_kernel() Preparing kernel \"$name\" in $MY_TREE"
(cd $MY_TREE; export name SRC CONFIG BUILDDIR # used in this makefile ; (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 ) || \ make -v -f ${PICO_TREE}/build/Makefile.conf ) || \
fail $? missing_kernel fail $? missing_kernel
} }
@ -830,6 +840,9 @@ while [ true ]; do
o_all_in_mfs="" o_all_in_mfs=""
;; ;;
--modules) # also build kernel modules
o_do_modules="yes"
;;
-n) -n)
o_interactive="NO" o_interactive="NO"
;; ;;