View | Details | Raw Unified | Return to bug 269884 | Differences between
and this patch

Collapse All | Expand All

(-)b/tools/tools/nanobsd/defaults.sh (-18 / +7 lines)
Lines 277-292 tgt_dir2symlink ( ) ( Link Here
277
	fi
277
	fi
278
)
278
)
279
279
280
# run in the world chroot, errors fatal
281
CR ( ) {
282
	chroot "${NANO_WORLDDIR}" /bin/sh -exc "$*"
283
}
284
285
# run in the world chroot, errors not fatal
286
CR0 ( ) {
287
	chroot "${NANO_WORLDDIR}" /bin/sh -c "$*" || true
288
}
289
290
clean_build ( ) (
280
clean_build ( ) (
291
	pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})"
281
	pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})"
292
282
Lines 499-505 run_late_customize ( ) ( Link Here
499
# a user's cfg file would override this.
489
# a user's cfg file would override this.
500
#
490
#
501
fixup_before_diskimage ( ) (
491
fixup_before_diskimage ( ) (
502
	# Run the deduplication script that takes the matalog journal and
492
	# Run the deduplication script that takes the metalog journal and
503
	# combines multiple entries for the same file (see source for
493
	# combines multiple entries for the same file (see source for
504
	# details). We take the extra step of removing the size keywords. This
494
	# details). We take the extra step of removing the size keywords. This
505
	# script, and many of the user scripts, copies, appeneds and otherwise
495
	# script, and many of the user scripts, copies, appeneds and otherwise
Lines 740-746 cust_install_files ( ) ( Link Here
740
	find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio ${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR}
730
	find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio ${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR}
741
731
742
	if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then
732
	if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then
743
		CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
733
		chroot "${NANO_WORLDDIR}" /bin/sh -exc "mtree -eiU -p / <${NANO_CUST_FILES_MTREE}"
744
	fi
734
	fi
745
)
735
)
746
736
Lines 750-756 cust_install_files ( ) ( Link Here
750
cust_pkgng ( ) (
740
cust_pkgng ( ) (
751
	mkdir -p ${NANO_WORLDDIR}/usr/local/etc
741
	mkdir -p ${NANO_WORLDDIR}/usr/local/etc
752
	local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf"
742
	local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf"
753
	local PKGCMD="env BATCH=YES ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg"
743
	local PKGCMD="env BATCH=YES ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none pkg -c ${NANO_WORLDDIR}"
754
744
755
	# Ensure pkg.conf points pkg to where the package meta data lives.
745
	# Ensure pkg.conf points pkg to where the package meta data lives.
756
	touch ${PKG_CONF}
746
	touch ${PKG_CONF}
Lines 767-773 cust_pkgng ( ) ( Link Here
767
	fi
757
	fi
768
758
769
	# Find a pkg-* package
759
	# Find a pkg-* package
770
	for x in `find -s ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do
760
	for x in `find -Ls ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do
771
		_NANO_PKG_PACKAGE=`basename "$x"`
761
		_NANO_PKG_PACKAGE=`basename "$x"`
772
	done
762
	done
773
	if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then
763
	if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then
Lines 783-789 cust_pkgng ( ) ( Link Here
783
	trap "umount ${NANO_WORLDDIR}/dev; umount ${NANO_WORLDDIR}/_.p ; rm -xrf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT
773
	trap "umount ${NANO_WORLDDIR}/dev; umount ${NANO_WORLDDIR}/_.p ; rm -xrf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT
784
774
785
	# Install pkg-* package
775
	# Install pkg-* package
786
	CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}"
776
	${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}
787
777
788
	(
778
	(
789
		# Expand any glob characters in pacakge list
779
		# Expand any glob characters in pacakge list
Lines 798-808 cust_pkgng ( ) ( Link Here
798
788
799
		# Install packages
789
		# Install packages
800
		for _PKG in $_PKGS; do
790
		for _PKG in $_PKGS; do
801
			CR "${PKGCMD} add /_.p/${_PKG}"
791
			${PKGCMD} add /_.p/${_PKG}
802
		done
792
		done
803
	)
793
	)
804
794
805
	CR0 "${PKGCMD} info"
795
	${PKGCMD} info || true
806
796
807
	trap - 1 2 15 EXIT
797
	trap - 1 2 15 EXIT
808
	umount ${NANO_WORLDDIR}/dev
798
	umount ${NANO_WORLDDIR}/dev
809
- 

Return to bug 269884