Index: stable/10/share/mk/bsd.own.mk =================================================================== --- stable/10/share/mk/bsd.own.mk (revision 289958) +++ stable/10/share/mk/bsd.own.mk (revision 289959) @@ -1,703 +1,702 @@ # $FreeBSD$ # # The include file set common variables for owner, # group, mode, and directories. Defaults are in brackets. # # # +++ variables +++ # # DESTDIR Change the tree where the file gets installed. [not set] # # DISTDIR Change the tree where the file for a distribution # gets installed (see /usr/src/release/Makefile). [not set] # # COMPRESS_CMD Program to compress documents. # Output is to stdout. [gzip -cn] # # COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz] # # BINOWN Binary owner. [root] # # BINGRP Binary group. [wheel] # # BINMODE Binary mode. [555] # # NOBINMODE Mode for non-executable files. [444] # # LIBDIR Base path for libraries. [/usr/lib] # # LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] # # LIBPRIVATEDIR Base path for private libraries. [/usr/lib/private] # # LIBDATADIR Base path for misc. utility data files. [/usr/libdata] # # LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] # # LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint] # # SHLIBDIR Base path for shared libraries. [${LIBDIR}] # # LIBOWN Library owner. [${BINOWN}] # # LIBGRP Library group. [${BINGRP}] # # LIBMODE Library mode. [${NOBINMODE}] # # # DEBUGDIR Base path for standalone debug files. [/usr/lib/debug] # # DEBUGMODE Mode for debug files. [${NOBINMODE}] # # # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/kernel] # # KMODOWN Kernel and KLD owner. [${BINOWN}] # # KMODGRP Kernel and KLD group. [${BINGRP}] # # KMODMODE KLD mode. [${BINMODE}] # # # SHAREDIR Base path for architecture-independent ascii # text files. [/usr/share] # # SHAREOWN ASCII text file owner. [root] # # SHAREGRP ASCII text file group. [wheel] # # SHAREMODE ASCII text file mode. [${NOBINMODE}] # # # CONFDIR Base path for configuration files. [/etc] # # CONFOWN Configuration file owner. [root] # # CONFGRP Configuration file group. [wheel] # # CONFMODE Configuration file mode. [644] # # # DOCDIR Base path for system documentation (e.g. PSD, USD, # handbook, FAQ etc.). [${SHAREDIR}/doc] # # DOCOWN Documentation owner. [${SHAREOWN}] # # DOCGRP Documentation group. [${SHAREGRP}] # # DOCMODE Documentation mode. [${NOBINMODE}] # # # INFODIR Base path for GNU's hypertext system # called Info (see info(1)). [${SHAREDIR}/info] # # INFOOWN Info owner. [${SHAREOWN}] # # INFOGRP Info group. [${SHAREGRP}] # # INFOMODE Info mode. [${NOBINMODE}] # # # MANDIR Base path for manual installation. [${SHAREDIR}/man/man] # # MANOWN Manual owner. [${SHAREOWN}] # # MANGRP Manual group. [${SHAREGRP}] # # MANMODE Manual mode. [${NOBINMODE}] # # # NLSDIR Base path for National Language Support files # installation. [${SHAREDIR}/nls] # # NLSOWN National Language Support files owner. [${SHAREOWN}] # # NLSGRP National Language Support files group. [${SHAREGRP}] # # NLSMODE National Language Support files mode. [${NOBINMODE}] # # INCLUDEDIR Base path for standard C include files [/usr/include] .if !target(____) ____: .if !defined(_WITHOUT_SRCCONF) SRCCONF?= /etc/src.conf .if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" .include "${SRCCONF}" .endif .endif # Binaries BINOWN?= root BINGRP?= wheel BINMODE?= 555 NOBINMODE?= 444 .if defined(MODULES_WITH_WORLD) KMODDIR?= /boot/modules .else KMODDIR?= /boot/kernel .endif KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} KMODMODE?= ${BINMODE} DTBDIR?= /boot/dtb DTBOWN?= root DTBGRP?= wheel DTBMODE?= 444 LIBDIR?= /usr/lib LIBCOMPATDIR?= /usr/lib/compat LIBPRIVATEDIR?= /usr/lib/private LIBDATADIR?= /usr/libdata LIBEXECDIR?= /usr/libexec LINTLIBDIR?= /usr/libdata/lint SHLIBDIR?= ${LIBDIR} LIBOWN?= ${BINOWN} LIBGRP?= ${BINGRP} LIBMODE?= ${NOBINMODE} DEBUGDIR?= /usr/lib/debug DEBUGMODE?= ${NOBINMODE} # Share files SHAREDIR?= /usr/share SHAREOWN?= root SHAREGRP?= wheel SHAREMODE?= ${NOBINMODE} CONFDIR?= /etc CONFOWN?= root CONFGRP?= wheel CONFMODE?= 644 MANDIR?= ${SHAREDIR}/man/man MANOWN?= ${SHAREOWN} MANGRP?= ${SHAREGRP} MANMODE?= ${NOBINMODE} DOCDIR?= ${SHAREDIR}/doc DOCOWN?= ${SHAREOWN} DOCGRP?= ${SHAREGRP} DOCMODE?= ${NOBINMODE} INFODIR?= ${SHAREDIR}/info INFOOWN?= ${SHAREOWN} INFOGRP?= ${SHAREGRP} INFOMODE?= ${NOBINMODE} NLSDIR?= ${SHAREDIR}/nls NLSOWN?= ${SHAREOWN} NLSGRP?= ${SHAREGRP} NLSMODE?= ${NOBINMODE} INCLUDEDIR?= /usr/include # # install(1) parameters. # HRDLINK?= -l h SYMLINK?= -l s INSTALL_LINK?= ${INSTALL} ${HRDLINK} INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} # Common variables .if !defined(DEBUG_FLAGS) STRIP?= -s .endif COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz .if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the # make(1) environment. # These should be tested with `== "no"' or `!= "no"' in makefiles. # The NO_* variables should only be set by makefiles. # # # Supported NO_* options (if defined, MK_* will be forced to "no", # regardless of user's setting). # .for var in \ CTF \ DEBUG_FILES \ INSTALLLIB \ MAN \ PROFILE .if defined(NO_${var}) .if defined(WITH_${var}) .undef WITH_${var} .endif WITHOUT_${var}= .endif .endfor # # Older-style variables that enabled behaviour when set. # .if defined(YES_HESIOD) WITH_HESIOD= .endif __DEFAULT_YES_OPTIONS = \ ACCT \ ACPI \ AMD \ APM \ ARM_EABI \ ASSERT_DEBUG \ AT \ ATM \ AUDIT \ AUTHPF \ AUTOFS \ BHYVE \ BINUTILS \ BLUETOOTH \ BMAKE \ BOOT \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ BSDINSTALL \ BSNMP \ BZIP2 \ CALENDAR \ CAPSICUM \ CCD \ CDDL \ CPP \ CROSS_COMPILER \ CRYPT \ CTM \ CXX \ DICT \ DYNAMICROOT \ ED_CRYPTO \ EE \ EXAMPLES \ FILE \ FINGER \ FLOPPY \ FMTREE \ FORMAT_EXTENSIONS \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ FTP \ GAMES \ GCOV \ GDB \ GNU \ GPIB \ GPIO \ GPL_DTC \ GROFF \ HAST \ HTML \ ICONV \ INET \ INET6 \ INETD \ INFO \ INSTALLLIB \ IPFILTER \ IPFW \ IPX \ ISCSI \ JAIL \ KDUMP \ KERBEROS \ KERNEL_SYMBOLS \ KVM \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ LIB32 \ LIBPTHREAD \ LIBTHR \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ MAIL \ MAILWRAPPER \ MAKE \ MAN \ NCURSESW \ NDIS \ NETCAT \ NETGRAPH \ NIS \ NLS \ NLS_CATALOGS \ NMTREE \ NS_CACHING \ NTP \ OPENSSH \ OPENSSL \ PAM \ PC_SYSINSTALL \ PF \ PKGBOOTSTRAP \ PMC \ PORTSNAP \ PPP \ PROFILE \ QUOTAS \ RADIUS_SUPPORT \ RBOOTD \ RCMDS \ RCS \ RESCUE \ ROUTED \ SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ SOURCELESS \ SOURCELESS_HOST \ SOURCELESS_UCODE \ SSP \ SVNLITE \ SYMVER \ SYSCONS \ - SYSINSTALL \ TALK \ TCSH \ TCP_WRAPPERS \ TELNET \ TEXTPROC \ TFTP \ TIMED \ TOOLCHAIN \ UNBOUND \ USB \ UTMPX \ VT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ HESIOD \ INSTALL_AS_USER \ LLDB \ NAND \ OFED \ OPENSSH_NONE_CIPHER \ PKGTOOLS \ SHARED_TOOLCHAIN \ SVN \ TESTS \ USB_GADGET_EXAMPLES # # Default behaviour of some options depends on the architecture. Unfortunately # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want # to allow defaults for some things like clang and fdt to vary by target # architecture. # .if defined(TARGET_ARCH) __T=${TARGET_ARCH} .else __T=${MACHINE_ARCH} .endif .if defined(TARGET) __TT=${TARGET} .else __TT=${MACHINE} .endif # Clang is only for x86, powerpc and little-endian arm right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL .elif ${__T} == "arm" || ${__T} == "armv6" __DEFAULT_YES_OPTIONS+=CLANG # GCC is unable to build the full clang on arm, disable it by default. __DEFAULT_NO_OPTIONS+=CLANG_FULL .else __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL .endif # Clang the default system compiler only on little-endian arm and x86. .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ ${__T} == "i386" __DEFAULT_YES_OPTIONS+=CLANG_IS_CC # The pc98 bootloader requires gcc to build and so we must leave gcc enabled # for pc98 for now. .if ${__TT} == "pc98" __DEFAULT_NO_OPTIONS+=GNUCXX __DEFAULT_YES_OPTIONS+=GCC .else __DEFAULT_NO_OPTIONS+=GCC GNUCXX .endif .else # If clang is not cc, then build gcc by default __DEFAULT_NO_OPTIONS+=CLANG_IS_CC __DEFAULT_YES_OPTIONS+=GCC # And if g++ is c++, build the rest of the GNU C++ stack .if defined(WITHOUT_CXX) __DEFAULT_NO_OPTIONS+=GNUCXX .else __DEFAULT_YES_OPTIONS+=GNUCXX .endif .endif # FDT is needed only for arm, mips and powerpc .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT .endif # HyperV is only available for x86 and amd64. .if ${__T} == "amd64" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=HYPERV .else __DEFAULT_NO_OPTIONS+=HYPERV .endif .undef __T # # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) .error MK_${var} can't be set by a user. .endif .if defined(WITHOUT_${var}) MK_${var}:= no .else MK_${var}:= yes .endif .endfor .undef __DEFAULT_YES_OPTIONS # # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) .error MK_${var} can't be set by a user. .endif .if defined(WITH_${var}) MK_${var}:= yes .else MK_${var}:= no .endif .endfor .undef __DEFAULT_NO_OPTIONS # # Force some options off if their dependencies are off. # Order is somewhat important. # .if ${MK_LIBPTHREAD} == "no" MK_LIBTHR:= no .endif .if ${MK_LDNS} == "no" MK_LDNS_UTILS:= no MK_UNBOUND:= no .endif .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no .endif .if ${MK_CDDL} == "no" MK_ZFS:= no MK_CTF:= no .endif .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no .endif .if ${MK_CXX} == "no" MK_CLANG:= no MK_GROFF:= no .endif .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no .endif .if ${MK_NETGRAPH} == "no" MK_ATM:= no MK_BLUETOOTH:= no .endif .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no .endif .if ${MK_PF} == "no" MK_AUTHPF:= no .endif .if ${MK_TEXTPROC} == "no" MK_GROFF:= no .endif .if ${MK_TOOLCHAIN} == "no" MK_BINUTILS:= no MK_CLANG:= no MK_GCC:= no MK_GDB:= no .endif .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no .endif .if ${MK_CLANG_IS_CC} == "no" MK_LLDB:= no .endif .if defined(NO_TESTS) # This should be handled above along the handling of all other NO_* options. # However, the above is broken when WITH_*=yes are passed to make(1) as # command line arguments. See PR bin/183762. # # Because the TESTS option is new and it will default to yes, it's likely # that people will pass WITHOUT_TESTS=yes to make(1) directly and get a broken # build. So, just in case, it's better to explicitly handle this case here. # # TODO(jmmv): Either fix make to allow us putting this override where it # belongs above or fix this file to cope with the make bug. MK_TESTS:= no .endif # # Set defaults for the MK_*_SUPPORT variables. # # # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # .for var in \ BZIP2 \ GNU \ INET \ INET6 \ IPX \ KERBEROS \ KVM \ NETGRAPH \ PAM \ WIRELESS .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif .if defined(MK_${var}_SUPPORT) .error MK_${var}_SUPPORT can't be set by a user. .endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else MK_${var}_SUPPORT:= yes .endif .endfor # # MK_* options whose default value depends on another option. # .for vv in \ GSSAPI/KERBEROS \ MAN_UTILS/MAN .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. .endif .if defined(MK_${vv:H}) .error MK_${vv:H} can't be set by a user. .endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) MK_${vv:H}:= no .else MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor # # MK_* options that default to "yes" if the compiler is a C++11 compiler. # .include .for var in \ LIBCPLUSPLUS .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) .error MK_${var} can't be set by a user. .endif .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no .else MK_${var}:= yes .endif .else .if defined(WITH_${var}) MK_${var}:= yes .else MK_${var}:= no .endif .endif .endfor .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else CTFCONVERT_CMD= @: .endif .if ${MK_INSTALL_AS_USER} != "no" _uid!= id -u .if ${_uid} != 0 .if !defined(USER) USER!= id -un .endif _gid!= id -gn .for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE $xOWN= ${USER} $xGRP= ${_gid} .endfor .endif .endif .endif # !_WITHOUT_SRCCONF # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests .endif # !target(____) Index: stable/10/tools/build/options/WITHOUT_SYSINSTALL =================================================================== --- stable/10/tools/build/options/WITHOUT_SYSINSTALL (revision 289958) +++ stable/10/tools/build/options/WITHOUT_SYSINSTALL (nonexistent) @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to not build -.Xr sysinstall 8 -and related programs. Property changes on: stable/10/tools/build/options/WITHOUT_SYSINSTALL ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: stable/10/tools/tools/nanobsd/gateworks/common =================================================================== --- stable/10/tools/tools/nanobsd/gateworks/common (revision 289958) +++ stable/10/tools/tools/nanobsd/gateworks/common (revision 289959) @@ -1,358 +1,357 @@ # $FreeBSD$ NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/${NANO_TOOLS}/gateworks/cfg} test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty NANO_PMAKE="make" # NB: disable -j 3 NANO_ARCH=armeb TARGET_CPUTYPE=xscale; export TARGET_CPUTYPE # XXX NANO_CUSTOMIZE="cust_allow_ssh_root" clean_usr_local() { LOCAL_DIR=${NANO_WORLDDIR}/usr/local pprint 2 "Clean and create world directory (${LOCAL_DIR})" if rm -rf ${LOCAL_DIR}/ > /dev/null 2>&1 ; then true else chflags -R noschg ${LOCAL_DIR}/ rm -rf ${LOCAL_DIR}/ fi for f in bin etc lib libdata libexec sbin share; do mkdir -p ${LOCAL_DIR}/$f done } NANO_CUSTOMIZE="$NANO_CUSTOMIZE clean_usr_local" cust_install_machine_files() { echo "cd ${NANO_TOOLS}/gateworks/Files" cd ${NANO_TOOLS}/gateworks/Files find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} } NANO_CUSTOMIZE="$NANO_CUSTOMIZE cust_install_files cust_install_machine_files" buildenv() { cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ DESTDIR=${NANO_WORLDDIR} make buildenv } net80211_tools() { for f in wlanstats wlanwds wlanwatch; do echo "(cd tools/tools/net80211/$f; make $1)"; done | buildenv } net80211_clean_tools() { net80211_tools "clean" } net80211_build_tools() { net80211_tools "" } net80211_install_tools() { net80211_tools "install" } NANO_CUSTOMIZE="$NANO_CUSTOMIZE net80211_clean_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE net80211_build_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE net80211_install_tools" ath_clean_tools() { echo "cd tools/tools/ath; make clean" | buildenv } ath_build_tools() { echo "cd tools/tools/ath; make" | buildenv } ath_install_tools() { echo "cd tools/tools/ath; make install" | buildenv } NANO_CUSTOMIZE="$NANO_CUSTOMIZE ath_clean_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE ath_build_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE ath_install_tools" npe_clean_tools() { echo "cd tools/tools/npe; make clean" | buildenv } npe_build_tools() { echo "cd tools/tools/npe; make" | buildenv } npe_install_tools() { echo "cd tools/tools/npe; make install" | buildenv } NANO_CUSTOMIZE="$NANO_CUSTOMIZE npe_clean_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE npe_build_tools" NANO_CUSTOMIZE="$NANO_CUSTOMIZE npe_install_tools" NANO_MAKEFS="makefs -B big \ -o bsize=4096,fsize=512,density=8192,optimization=space" export NANO_MAKEFS # NB: leave c++ enabled so devd can be built CONF_BUILD=" WITHOUT_ACCT=true WITHOUT_ACPI=true WITHOUT_APM=true WITHOUT_ATM=true WITHOUT_AUDIT=true WITHOUT_BIND_DNSSEC=true WITHOUT_BIND_ETC=true WITHOUT_BIND_LIBS_LWRES=true WITHOUT_BLUETOOTH=true WITHOUT_BSNMP=true WITHOUT_CALENDAR=true WITHOUT_CDDL=true WITHOUT_CTM=true WITHOUT_DICT=true WITHOUT_EXAMPLES=true WITHOUT_FLOPPY=true WITHOUT_FORTRAN=true WITHOUT_GAMES=true WITHOUT_GCOV=true WITHOUT_GPIB=true WITHOUT_GROFF=true WITHOUT_HTML=true WITHOUT_INET6=true WITHOUT_INFO=true WITHOUT_IPFILTER=true WITHOUT_KERBEROS=true WITHOUT_LOCALES=true WITHOUT_LPR=true WITHOUT_MAN=true WITHOUT_MAIL=true WITHOUT_MAILWRAPPER=true WITHOUT_NETCAT=true WITHOUT_NIS=true WITHOUT_NLS=true WITHOUT_NS_CACHING=true WITHOUT_OBJC=true WITHOUT_PMC=true WITHOUT_PORTSNAP=true WITHOUT_PROFILE=true WITHOUT_QUOTAS=true WITHOUT_RCMDS=true WITHOUT_RCS=true WITHOUT_RESCUE=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SSP=true WITHOUT_SYSCONS=true -WITHOUT_SYSINSTALL=true WITHOUT_TCSH=true WITHOUT_TFTPD=true WITHOUT_ZFS=true " CONF_INSTALL="$CONF_BUILD WITHOUT_TOOLCHAIN=true WITHOUT_INSTALLLIB=true INSTALL_NODEBUG=true " # NB: override to force / on s1 instead of s1a setup_nanobsd_etc() { pprint 2 "configure nanobsd /etc" ( cd ${NANO_WORLDDIR} # create diskless marker file touch etc/diskless # Make root filesystem R/O by default echo "root_rw_mount=NO" >> etc/defaults/rc.conf # save config file for scripts echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf echo "/dev/${NANO_DRIVE}s1 / ufs ro 1 1" > etc/fstab echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab mkdir -p cfg ) } create_arm_diskimage() { pprint 2 "build diskimage" pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.di" ( echo "NANO_MEDIASIZE: $NANO_MEDIASIZE" echo "NANO_IMAGES: $NANO_IMAGES" echo "NANO_SECTS: $NANO_SECTS" echo "NANO_HEADS: $NANO_HEADS" echo "NANO_CODESIZE: $NANO_CODESIZE" echo "NANO_CONFSIZE: $NANO_CONFSIZE" echo "NANO_DATASIZE: $NANO_DATASIZE" echo $NANO_MEDIASIZE $NANO_IMAGES \ $NANO_SECTS $NANO_HEADS \ $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE | awk ' { printf "# %s\n", $0 # size of cylinder in sectors cs = $3 * $4 # number of full cylinders on media cyl = int ($1 / cs) # output fdisk geometry spec, truncate cyls to 1023 if (cyl <= 1023) print "g c" cyl " h" $4 " s" $3 else print "g c" 1023 " h" $4 " s" $3 if ($7 > 0) { # size of data partition in full cylinders dsl = int (($7 + cs - 1) / cs) } else { dsl = 0; } # size of config partition in full cylinders csl = int (($6 + cs - 1) / cs) if ($5 == 0) { # size of image partition(s) in full cylinders isl = int ((cyl - dsl - csl) / $2) } else { isl = int (($5 + cs - 1) / cs) } # First image partition start at second track print "p 1 165 " $3, isl * cs - $3 c = isl * cs; # Second image partition (if any) also starts offset one # track to keep them identical. if ($2 > 1) { print "p 2 165 " $3 + c, isl * cs - $3 c += isl * cs; } # Config partition starts at cylinder boundary. print "p 3 165 " c, csl * cs c += csl * cs # Data partition (if any) starts at cylinder boundary. if ($7 > 0) { print "p 4 165 " c, dsl * cs } else if ($7 < 0 && $1 > c) { print "p 4 165 " c, $1 - c } else if ($1 < c) { print "Disk space overcommitted by", \ c - $1, "sectors" > "/dev/stderr" exit 2 } # Force slice 1 to be marked active. This is necessary # for booting the image from a USB device to work. print "a 1" } ' > ${MAKEOBJDIRPREFIX}/_.fdisk IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} BS=${NANO_SECTS}b if [ "${NANO_MD_BACKING}" = "swap" ] ; then MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` else echo ""; echo "Creating md backing file ${IMG} ..." _c=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` pprint 2 "dd if=/dev/zero of=${IMG} bs=${BS} count=${_c}" dd if=/dev/zero of=${IMG} bs=${BS} count=${_c} pprint 2 "mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} -y ${NANO_HEADS}" MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` fi trap "mdconfig -d -u $MD" 1 2 15 EXIT echo ""; echo "Write partition table ..." FDISK=${MAKEOBJDIRPREFIX}/_.fdisk pprint 2 "fdisk -i -f ${FDISK} ${MD}" fdisk -i -f ${FDISK} ${MD} pprint 2 "fdisk ${MD}" fdisk ${MD} # Create first image IMG1=${NANO_DISKIMGDIR}/_.disk.image1 echo ""; echo "Create first image ${IMG1} ..." SIZE=`awk '/^p 1/ { print $5 "b" }' ${FDISK}` pprint 2 "${NANO_MAKEFS} -s ${SIZE} ${IMG1} ${NANO_WORLDDIR}" ${NANO_MAKEFS} -s ${SIZE} ${IMG1} ${NANO_WORLDDIR} pprint 2 "dd if=${IMG1} of=/dev/${MD}s1 bs=${BS}" dd if=${IMG1} of=/dev/${MD}s1 bs=${BS} if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then IMG2=${NANO_DISKIMGDIR}/_.disk.image2 echo ""; echo "Create second image ${IMG2}..." for f in ${NANO_WORLDDIR}/etc/fstab ${NANO_WORLDDIR}/conf/base/etc/fstab do sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/g" $f done SIZE=`awk '/^p 2/ { print $5 "b" }' ${FDISK}` pprint 2 "${NANO_MAKEFS} -s ${SIZE} ${IMG2} ${NANO_WORLDDIR}" ${NANO_MAKEFS} -s ${SIZE} ${IMG2} ${NANO_WORLDDIR} pprint 2 "dd if=${IMG2} of=/dev/${MD}s2 bs=${BS}" dd if=${IMG2} of=/dev/${MD}s2 bs=${BS} fi # Create Config slice CFG=${NANO_DISKIMGDIR}/_.disk.cfg echo ""; echo "Creating config partition ${CFG}..." SIZE=`awk '/^p 3/ { print $5 "b" }' ${FDISK}` # XXX: fill from where ? pprint 2 "${NANO_MAKEFS} -s ${SIZE} ${CFG} ${NANO_CFGDIR}" ${NANO_MAKEFS} -s ${SIZE} ${CFG} ${NANO_CFGDIR} pprint 2 "dd if=${CFG} of=/dev/${MD}s3 bs=${BS}" dd if=${CFG} of=/dev/${MD}s3 bs=${BS} pprint 2 "rm ${CFG}" rm ${CFG}; CFG= # NB: disable printing below # Create Data slice, if any. if [ $NANO_DATASIZE -gt 0 ] ; then DATA=${NANO_DISKIMGDIR}/_.disk.data echo ""; echo "Creating data partition ${DATA}..." SIZE=`awk '/^p 4/ { print $5 "b" }' ${FDISK}` # XXX: fill from where ? pprint 2 "${NANO_MAKEFS} -s ${SIZE} ${DATA} /var/empty" ${NANO_MAKEFS} -s ${SIZE} ${DATA} /var/empty pprint 2 "dd if=${DATA} of=/dev/${MD}s4 bs=${BS}" dd if=${DATA} of=/dev/${MD}s4 bs=${BS} pprint 2 "rm ${DATA}" rm ${DATA}; DATA= # NB: disable printing below fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then echo "Writing out _.disk.full..." dd if=/dev/${MD} of=${IMG} bs=${BS} fi echo "" echo "Completed images in:" echo "" echo "Full disk: ${IMG}" echo "Primary partition: ${IMG1}" test "${IMG2}" && echo "2ndary partition: ${IMG2}" test "${CFG}" && echo "/cfg partition: ${CFG}" test "${DATA}" && echo "/data partition: ${DATA}" echo "" echo "Use dd if= of=/dev/ bs=${BS} to transfer an" echo "image to bootable media /dev/." ) > ${MAKEOBJDIRPREFIX}/_.di 2>&1 } Index: stable/10 =================================================================== --- stable/10 (revision 289958) +++ stable/10 (revision 289959) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r286822