picobsd (78494) | picobsd (78541) |
---|---|
1#!/bin/sh - 2# | 1#!/bin/sh - 2# |
3# $FreeBSD: head/release/picobsd/build/picobsd 78494 2001-06-20 14:16:48Z luigi $ | 3# $FreeBSD: head/release/picobsd/build/picobsd 78541 2001-06-21 08:49:46Z luigi $ |
4# 5# The new PicoBSD build script. Invoked as 6# 7# picobsd [options] floppy_type site_name 8# 9# Where floppy_type is a directory where the picobsd config info 10# is held, and ${floppy_type}/floppy.tree.${site_name} contains 11# optional site-specific configuration. --- 328 unchanged lines hidden (view full) --- 340 341 # read config variables from a global and then a type-specific file 342 # 343 . ${PICO_TREE}/build/config 344 if [ -f ${MY_TREE}/config ]; then 345 . ${MY_TREE}/config 346 fi 347 | 4# 5# The new PicoBSD build script. Invoked as 6# 7# picobsd [options] floppy_type site_name 8# 9# Where floppy_type is a directory where the picobsd config info 10# is held, and ${floppy_type}/floppy.tree.${site_name} contains 11# optional site-specific configuration. --- 328 unchanged lines hidden (view full) --- 340 341 # read config variables from a global and then a type-specific file 342 # 343 . ${PICO_TREE}/build/config 344 if [ -f ${MY_TREE}/config ]; then 345 . ${MY_TREE}/config 346 fi 347 |
348 export MFS_MOUNTPOINT # used in the makefiles. 349 export PICO_OBJ # used in the makefiles 350 export SRC # used in the makefiles. 351 | |
352 PICO_OBJ=${OBJ}/picobsd/${TYPE} 353 354 if [ ! -d ${BUILDDIR} ]; then 355 log "Creating builddir" 356 mkdir $BUILDDIR 357 if [ ! -d ${BUILDDIR}/crunch ]; then 358 log "creating crunch dir" 359 mkdir ${BUILDDIR}/crunch 360 fi 361 else 362 rm -f ${BUILDDIR}/kernel.gz ${BUILDDIR}/${MFS_NAME} # cleanup... 363 fi 364} 365 366# invoke the makefile to compile the kernel. 367# Then copy it here and strip as much as possible. 368do_kernel() { # OK 369 log "---> Preparing kernel \"$name\" in $MY_TREE" | 348 PICO_OBJ=${OBJ}/picobsd/${TYPE} 349 350 if [ ! -d ${BUILDDIR} ]; then 351 log "Creating builddir" 352 mkdir $BUILDDIR 353 if [ ! -d ${BUILDDIR}/crunch ]; then 354 log "creating crunch dir" 355 mkdir ${BUILDDIR}/crunch 356 fi 357 else 358 rm -f ${BUILDDIR}/kernel.gz ${BUILDDIR}/${MFS_NAME} # cleanup... 359 fi 360} 361 362# invoke the makefile to compile the kernel. 363# Then copy it here and strip as much as possible. 364do_kernel() { # OK 365 log "---> Preparing kernel \"$name\" in $MY_TREE" |
370 export name SRC # used in this makefile 371 (cd $MY_TREE; make -v -f ${PICO_TREE}/build/Makefile.conf ) | 366 (cd $MY_TREE; export name SRC CONFIG # used in this makefile ; 367 make -v -f ${PICO_TREE}/build/Makefile.conf ) |
372 cp -p ${SRC}/sys/compile/PICOBSD-${name}/kernel ${BUILDDIR}/kernel || \ 373 fail $? missing_kernel 374 (cd ${BUILDDIR}; 375 strip kernel 376 strip --remove-section=.note --remove-section=.comment kernel 377 ) 378} 379 --- 108 unchanged lines hidden (view full) --- 488 (cd ${MFS_MOUNTPOINT}/dev ; ln -s /dev/MAKEDEV ; 489 ./MAKEDEV ${MY_DEVS}; rm MAKEDEV) 490 fi 491 492 ( 493 cd ${BUILDDIR}/crunch 494 log "---> Making and installing crunch1 from `pwd`..." 495 a=${BUILDDIR}/crunch1.conf | 368 cp -p ${SRC}/sys/compile/PICOBSD-${name}/kernel ${BUILDDIR}/kernel || \ 369 fail $? missing_kernel 370 (cd ${BUILDDIR}; 371 strip kernel 372 strip --remove-section=.note --remove-section=.comment kernel 373 ) 374} 375 --- 108 unchanged lines hidden (view full) --- 484 (cd ${MFS_MOUNTPOINT}/dev ; ln -s /dev/MAKEDEV ; 485 ./MAKEDEV ${MY_DEVS}; rm MAKEDEV) 486 fi 487 488 ( 489 cd ${BUILDDIR}/crunch 490 log "---> Making and installing crunch1 from `pwd`..." 491 a=${BUILDDIR}/crunch1.conf |
496 cat ${MY_TREE}/crunch.conf|sed -e "s@/usr/src@${SRC}@" | \ 497 sed -e "s@CWD@${MY_TREE}@" > $a 498 arg="" 499 if [ -f ${MY_TREE}/crunch.inc ] ; then 500 h="-h ${MY_TREE}/crunch.inc" | 492 ( export BUILDDIR SRC MY_TREE PICO_OBJ ; 493 make -v -f ${PICO_TREE}/build/Makefile.conf ${BUILDDIR}/crunch.mk ) 494 # update crunch.mk for new libs 495 if [ "${LIBS}" != "" ] ; then 496 sed -e "s@^LIBS=@ LIBS= ${LIBS}@" ${BUILDDIR}/crunch.mk > ${BUILDDIR}/crunch1.mk 497 mv ${BUILDDIR}/crunch1.mk ${BUILDDIR}/crunch.mk |
501 fi | 498 fi |
502 crunchgen -p ${PICO_OBJ} -o $arg -m ${BUILDDIR}/crunch.mk $a || true 503 # failure is not critical here | |
504 log "Now make -f crunch.mk" 505 make ${makeopts} -f ${BUILDDIR}/crunch.mk 506 strip --remove-section=.note --remove-section=.comment crunch1 507 mv crunch1 ${MFS_MOUNTPOINT}/stand/crunch 508 chmod 555 ${MFS_MOUNTPOINT}/stand/crunch 509 log "---> Making links for binaries..." 510 for i in `crunchgen -l $a` ; do 511 ln ${MFS_MOUNTPOINT}/stand/crunch ${MFS_MOUNTPOINT}/stand/${i}; 512 done | 499 log "Now make -f crunch.mk" 500 make ${makeopts} -f ${BUILDDIR}/crunch.mk 501 strip --remove-section=.note --remove-section=.comment crunch1 502 mv crunch1 ${MFS_MOUNTPOINT}/stand/crunch 503 chmod 555 ${MFS_MOUNTPOINT}/stand/crunch 504 log "---> Making links for binaries..." 505 for i in `crunchgen -l $a` ; do 506 ln ${MFS_MOUNTPOINT}/stand/crunch ${MFS_MOUNTPOINT}/stand/${i}; 507 done |
513 rm $a | 508 # rm $a # do not remove! |
514 ) || fail $? crunch 515 516 if [ -f ${MFS_MOUNTPOINT}/stand/sshd ] ; then 517 log "creating host key for sshd" 518 ssh-keygen -f ${MFS_MOUNTPOINT}/etc/ssh_host_key -N "" -C "root@picobsd" 519 fi 520 521 if [ -d ${MY_TREE}/mfs_tree ]; then --- 141 unchanged lines hidden (view full) --- 663while [ true ]; do 664 case $1 in 665 --src) # set the source path instead of /usr/src 666 SRC=$2 667 # Optionally creates include directory, and set cflags 668 # accordingly. Note that you will still need the right 669 # libraries... 670 | 509 ) || fail $? crunch 510 511 if [ -f ${MFS_MOUNTPOINT}/stand/sshd ] ; then 512 log "creating host key for sshd" 513 ssh-keygen -f ${MFS_MOUNTPOINT}/etc/ssh_host_key -N "" -C "root@picobsd" 514 fi 515 516 if [ -d ${MY_TREE}/mfs_tree ]; then --- 141 unchanged lines hidden (view full) --- 658while [ true ]; do 659 case $1 in 660 --src) # set the source path instead of /usr/src 661 SRC=$2 662 # Optionally creates include directory, and set cflags 663 # accordingly. Note that you will still need the right 664 # libraries... 665 |
671 #i=${SRC}/usr/include # the include directory... 672 #if [ \! -d $i ] ; then 673 # echo "Create \"$i\" as include directory" 674 # mkdir -p $i 675 # (cd ${SRC}; DESTDIR=${SRC} make includes ) 676 #fi 677 #CFLAGS="-nostdinc -I$i" ; export CFLAGS | 666 i=${SRC}/usr/include # the include directory... 667 if [ \! -d $i ] ; then 668 echo "Create \"$i\" as include directory" 669 mkdir -p $i 670 (cd ${SRC}; 671 INCOWN=`id -un` DESTDIR=${SRC} make includes 672 ) 673 fi 674 CFLAGS="-nostdinc -I$i" ; export CFLAGS 675 i=${SRC}/usr/lib 676 if [ \! -d $i ]; then 677 echo "Create libraries (this takes long...)" 678 mkdir -p $i 679 (cd ${SRC}; 680 BINOWN=`id -un` DESTDIR=${SRC} \ 681 make -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries 682 ) 683 fi 684 LIBS=" -L$i" 685 (cd ${SRC}/usr.sbin/config ; 686 make 687 ) 688 CONFIG=${SRC}/usr.sbin/config/config 689 |
678 shift 679 ;; 680 --floppy_size) 681 FLOPPY_SIZE=$2 682 shift 683 ;; 684 -n) 685 interactive="NO" --- 39 unchanged lines hidden --- | 690 shift 691 ;; 692 --floppy_size) 693 FLOPPY_SIZE=$2 694 shift 695 ;; 696 -n) 697 interactive="NO" --- 39 unchanged lines hidden --- |