diff options
author | sam <sam@FreeBSD.org> | 2006-03-08 18:02:32 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-03-08 18:02:32 +0000 |
commit | fa1fbfedc2f06342ca8bbae5b057d8bd2c14cc59 (patch) | |
tree | 87198eeaccc5a4734146e5e9aa6881c4854232fe /release | |
parent | b19c8d2fcc1540312b520fc757d445026667a6ac (diff) | |
download | FreeBSD-src-fa1fbfedc2f06342ca8bbae5b057d8bd2c14cc59.zip FreeBSD-src-fa1fbfedc2f06342ca8bbae5b057d8bd2c14cc59.tar.gz |
Revamp base system packaging of kernels to enable up/smp selection
at runtime and to support distributing additional kernels:
o remove kernel from the base tarball
o add new kernel tarballs
o build + package both SMP and GENERIC kernels when an <arch>/conf/SMP
config file is present
o add sysinstall support for multiple kernels
o update sysinstall to probe for the number of cpus on a system
and auto-select smp/up kernel accordingly
o add a post-kernels install hook to fixup /boot/kernel
o add -ldevinfo to boot crunch for sysinstall's cpu probing logic
Notes:
1. On HEAD this code is not currently used because GENERIC kernels
include SMP. This work is mainly intended for RELENG_6 where the
GENERIC kernel is UP. If HEAD changes to match then just enable
WITH_SMP in sysinstall/Makefile.
2. The cpu probing support is done with acpi and MPTable; this means
some systems will require work for auto-detection to work.
3. The handling of /boot/kernel may need to be revisited; for now
we rename one kernel at the last moment (SMP if installed, otherwise
GENERIC). There are other, possibly better, approaches.
Lots of help from ru, emaste, scottl, and jhb.
Diffstat (limited to 'release')
-rw-r--r-- | release/Makefile | 39 | ||||
-rw-r--r-- | release/amd64/boot_crunch.conf | 2 | ||||
-rw-r--r-- | release/i386/boot_crunch.conf | 2 | ||||
-rw-r--r-- | release/ia64/boot_crunch.conf | 2 | ||||
-rw-r--r-- | release/pc98/boot_crunch.conf | 2 |
5 files changed, 33 insertions, 14 deletions
diff --git a/release/Makefile b/release/Makefile index 1b9b506..56de4fe 100644 --- a/release/Makefile +++ b/release/Makefile @@ -173,6 +173,16 @@ ARCH_DISTS?= lib32 .endif DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS} +# +# Build and package both GENERIC and SMP kernels if the target +# has both configuration files. Otherwise only GENERIC is done. +# +.if !exists(${.CURDIR}/../sys/${TARGET}/conf/SMP) +KERNELS?= GENERIC +.else +KERNELS?= GENERIC SMP +.endif + # mountpoint for filesystems. MNT= /mnt @@ -567,7 +577,6 @@ release.1: mkdir ${RD}/floppies .endif mkdir ${RD}/trees - mkdir ${RD}/kernels for i in ${DISTRIBUTIONS}; do \ mkdir ${RD}/trees/$$i && \ mtree -deU -f ${MTREEFILES}/BSD.root.dist \ @@ -579,6 +588,10 @@ release.1: mtree -deU -f ${MTREEFILES}/BSD.var.dist \ -p ${RD}/trees/$$i/var > /dev/null ; \ done + mkdir ${RD}/kernels + for i in ${KERNELS}; do \ + mkdir ${RD}/kernels/$${i}; \ + done touch ${.TARGET} # Install the system into the various distributions. @@ -592,15 +605,10 @@ release.2: release.3: .for kernel in ${KERNELS} cd ${.CURDIR}/..; \ - ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \ - KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \ - DESTDIR=${RD}/trees/base -.endfor - # Install a standard boot kernel+modules. - cd ${.CURDIR}/..; \ ${CROSSMAKE} ${KERNEL_FLAGS} \ - kernel \ - DESTDIR=${RD}/trees/base + KERNCONF=${kernel} kernel \ + DESTDIR=${RD}/kernels KODIR=/${kernel} +.endfor touch ${.TARGET} # Make and install the three crunched binaries which live on the floppies. @@ -658,6 +666,15 @@ release.6: echo "$${i} distribution is finished."; \ fi ; \ done + @for i in ${KERNELS} ; \ + do \ + if [ -d ${RD}/kernels/$${i} ] ; then \ + cd ${.CURDIR} && $(MAKE) doTARBALL \ + SD=${RD}/kernels \ + TN=$$i TD=kernels ARG="$$i" && \ + echo "$${i} distribution is finished."; \ + fi ; \ + done .if !defined(NOPORTS) # XXX: Inline stripped version of doTARBALL @rm -rf ${RD}/dists/ports/ports* @@ -789,7 +806,7 @@ SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz # Build boot and install floppies. floppies.1: - @gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz + @gzip -9nc ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz @echo "Making the kernel boot floppies..." @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \ FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz @@ -919,6 +936,8 @@ cdrom.1: find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \ fi \ done + @echo "Copy GENERIC kernel to boot area" + @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel @rm -f ${CD_LIVEFS}/.profile @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile @ln -sf /rescue ${CD_LIVEFS}/stand diff --git a/release/amd64/boot_crunch.conf b/release/amd64/boot_crunch.conf index ce31af3..e478b25 100644 --- a/release/amd64/boot_crunch.conf +++ b/release/amd64/boot_crunch.conf @@ -41,4 +41,4 @@ progs sysinstall progs usbdevs libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo diff --git a/release/i386/boot_crunch.conf b/release/i386/boot_crunch.conf index ce31af3..e478b25 100644 --- a/release/i386/boot_crunch.conf +++ b/release/i386/boot_crunch.conf @@ -41,4 +41,4 @@ progs sysinstall progs usbdevs libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo diff --git a/release/ia64/boot_crunch.conf b/release/ia64/boot_crunch.conf index a052ab9..b6b52aa 100644 --- a/release/ia64/boot_crunch.conf +++ b/release/ia64/boot_crunch.conf @@ -43,4 +43,4 @@ progs sysinstall progs usbdevs libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs +libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -ldevinfo diff --git a/release/pc98/boot_crunch.conf b/release/pc98/boot_crunch.conf index b630c88..78061dd 100644 --- a/release/pc98/boot_crunch.conf +++ b/release/pc98/boot_crunch.conf @@ -40,4 +40,4 @@ progs ppp progs sysinstall libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo |