View | Details | Raw Unified | Return to bug 187838
Collapse All | Expand All

(-)tools/tools/nanobsd/nanobsd.sh (-14 / +34 lines)
Lines 45-54 Link Here
45
# Where nanobsd additional files live under the source tree
45
# Where nanobsd additional files live under the source tree
46
NANO_TOOLS=tools/tools/nanobsd
46
NANO_TOOLS=tools/tools/nanobsd
47
47
48
# Where cust_pkg() finds packages to install
49
NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
50
NANO_PACKAGE_LIST="*"
51
52
# Object tree directory
48
# Object tree directory
53
# default is subdir of /usr/obj
49
# default is subdir of /usr/obj
54
#NANO_OBJ=""
50
#NANO_OBJ=""
Lines 157-162 Link Here
157
153
158
NANO_ARCH=`uname -p`
154
NANO_ARCH=`uname -p`
159
155
156
# Where cust_install_files finds files to install
157
NANO_FILESDIR=${NANO_TOOLS}/Files
158
159
# Where cust_pkg() finds packages to install
160
NANO_PACKAGEDIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
161
NANO_PACKAGE_LIST="*"
162
160
# Directory to populate /cfg from
163
# Directory to populate /cfg from
161
NANO_CFGDIR=""
164
NANO_CFGDIR=""
162
165
Lines 447-453 Link Here
447
)
450
)
448
451
449
populate_data_slice ( ) (
452
populate_data_slice ( ) (
450
	populate_slice "$1" "$2" "$3" "$4"
453
	local dev dir mnt lbl
454
	dev=$1
455
	dir=$2
456
	mnt=$3
457
	lbl=$4
458
	
459
	populate_slice "$dev" "$dir" "$mnt" "$lbl"
460
	
461
	find ${mnt} -type f -name .mtree -delete
462
	cd ${dir}
463
	find . -type f -name .mtree -print | while read fn ; do
464
		fdir=`dirname ${fn}`
465
		mtree -Ueq -f ${fn} -p ${mnt}/${fdir}
466
	done
451
)
467
)
452
468
453
create_i386_diskimage ( ) (
469
create_i386_diskimage ( ) (
Lines 704-720 Link Here
704
# Install the stuff under ./Files
720
# Install the stuff under ./Files
705
721
706
cust_install_files () (
722
cust_install_files () (
707
	cd ${NANO_TOOLS}/Files
723
	cd ${NANO_FILESDIR}
708
	find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${NANO_WORLDDIR}
724
	find . -print | grep -Ev '/(CVS|\.svn|.mtree)' | cpio -dumpv ${NANO_WORLDDIR}
725
	find . -type f -name .mtree -print | while read fn ; do
726
		dir=`dirname ${fn}`
727
		mtree -Ueq -f ${fn} -p ${NANO_WORLDDIR}/${dir}
728
	done
709
)
729
)
710
730
711
#######################################################################
731
#######################################################################
712
# Install packages from ${NANO_PACKAGE_DIR}
732
# Install packages from ${NANO_PACKAGEDIR}
713
733
714
cust_pkg () (
734
cust_pkg () (
715
735
716
	# If the package directory doesn't exist, we're done.
736
	# If the package directory doesn't exist, we're done.
717
	if [ ! -d ${NANO_PACKAGE_DIR} ]; then
737
	if [ ! -d ${NANO_PACKAGEDIR} ]; then
718
		echo "DONE 0 packages"
738
		echo "DONE 0 packages"
719
		return 0
739
		return 0
720
	fi
740
	fi
Lines 722-728 Link Here
722
	# Copy packages into chroot
742
	# Copy packages into chroot
723
	mkdir -p ${NANO_WORLDDIR}/Pkg
743
	mkdir -p ${NANO_WORLDDIR}/Pkg
724
	(
744
	(
725
		cd ${NANO_PACKAGE_DIR}
745
		cd ${NANO_PACKAGEDIR}
726
		find ${NANO_PACKAGE_LIST} -print |
746
		find ${NANO_PACKAGE_LIST} -print |
727
		    cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
747
		    cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
728
	)
748
	)
Lines 764-779 Link Here
764
cust_pkgng () (
784
cust_pkgng () (
765
785
766
	# If the package directory doesn't exist, we're done.
786
	# If the package directory doesn't exist, we're done.
767
	if [ ! -d ${NANO_PACKAGE_DIR} ]; then
787
	if [ ! -d ${NANO_PACKAGEDIR} ]; then
768
		echo "DONE 0 packages"
788
		echo "DONE 0 packages"
769
		return 0
789
		return 0
770
	fi
790
	fi
771
791
772
	# Find a pkg-* package
792
	# Find a pkg-* package
773
	for x in `find -s ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do
793
	for x in `find -s ${NANO_PACKAGEDIR} -iname 'pkg-*'`; do
774
		_NANO_PKG_PACKAGE=`basename "$x"`
794
		_NANO_PKG_PACKAGE=`basename "$x"`
775
	done
795
	done
776
	if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then
796
	if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGEDIR}/${_NANO_PKG_PACKAGE}" ]; then
777
		echo "FAILED: need a pkg/ package for bootstrapping"
797
		echo "FAILED: need a pkg/ package for bootstrapping"
778
		exit 2
798
		exit 2
779
	fi
799
	fi
Lines 781-787 Link Here
781
	# Copy packages into chroot
801
	# Copy packages into chroot
782
	mkdir -p ${NANO_WORLDDIR}/Pkg
802
	mkdir -p ${NANO_WORLDDIR}/Pkg
783
	(
803
	(
784
		cd ${NANO_PACKAGE_DIR}
804
		cd ${NANO_PACKAGEDIR}
785
		find ${NANO_PACKAGE_LIST} -print |
805
		find ${NANO_PACKAGE_LIST} -print |
786
		cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
806
		cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
787
	)
807
	)

Return to bug 187838