Changeset 12874 in hybrid for branches/releng-10/nanobsd/cfg
- Timestamp:
- Aug 17, 2014, 11:00:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-10/nanobsd/cfg/nanobsd.wleiden
r12873 r12874 270 270 271 271 272 # pkgdb should live on persistent storage only273 cust_alternate_pkg_db () (274 mkdir -p ${NANO_WORLDDIR}/usr/local/var/db/pkg ${NANO_WORLDDIR}/usr/local/tmp275 touch ${NANO_WORLDDIR}/usr/local/tmp/.hack-to-avoid-pruning-directory276 # sh profile277 ( echo 'PKG_DBDIR=/usr/local/var/db/pkg; export PKG_DBDIR'; \278 echo 'PKG_TMPDIR=/usr/local/tmp; export PKG_TMPDIR' ) >> ${NANO_WORLDDIR}/etc/profile279 # csh profile280 ( echo 'setenv PKG_DBDIR /usr/local/var/db/pkg'; \281 echo 'setenv PKG_TMPDIR /usr/local/tmp' ) >> ${NANO_WORLDDIR}/etc/csh.cshrc282 283 rmdir ${NANO_WORLDDIR}/var/db/pkg284 ln -s /usr/local/var/db/pkg ${NANO_WORLDDIR}/var/db/pkg285 )286 287 272 # Make tools available for root by default 288 273 cust_root_bin_to_tools() { … … 293 278 # to source /etc/profile in chroot to get PKG_* included, for alternate installs 294 279 cust_pkg () ( 295 # If the package directory doesn't exist, we're done. 296 if [ ! -d ${NANO_PACKAGE_DIR} ]; then 297 echo "DONE 0 packages" 298 return 0 299 fi 300 301 # Make sure to enable /dev as easy_install requires it for example 302 mount -t devfs devfs ${NANO_WORLDDIR}/dev 303 trap "umount ${NANO_WORLDDIR}/dev" 0 304 trap "exit 1" 1 2 3 15 305 306 # Copy packages into chroot 307 mkdir -p ${NANO_WORLDDIR}/Pkg 308 ( 309 cd ${NANO_PACKAGE_DIR} 310 find ${NANO_PACKAGE_LIST} -print | 311 cpio -Ldumpv ${NANO_WORLDDIR}/Pkg 312 ) 313 314 # Count & report how many we have to install 315 todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l` 316 echo "=== TODO: $todo" 317 ls ${NANO_WORLDDIR}/Pkg 318 echo "===" 319 NANO_PKG_DBDIR=${NANO_WORLDDIR}/`chroot ${NANO_WORLDDIR} sh -c '. /etc/profile; echo ${PKG_DBDIR:-/var/db/pkg}'` 320 while true 321 do 322 # Record how many we have now 323 have=`ls ${NANO_PKG_DBDIR} | wc -l` 324 325 # Attempt to install more packages 326 # ...but no more than 200 at a time due to pkg_add's internal 327 # limitations. 328 chroot ${NANO_WORLDDIR} sh -c \ 329 '. /etc/profile; ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true 330 331 # See what that got us 332 now=`ls ${NANO_PKG_DBDIR} | wc -l` 333 echo "=== NOW $now" 334 ls ${NANO_PKG_DBDIR} 335 echo "===" 336 337 338 if [ $now -eq $todo ] ; then 339 echo "DONE $now packages" 340 break 341 elif [ $now -eq $have ] ; then 342 echo "FAILED: Nothing happened on this pass" 343 exit 2 344 fi 345 done 346 rm -rf ${NANO_WORLDDIR}/Pkg 347 348 # Return normal trap behaviour 349 trap - 1 2 3 15 280 cp /etc/resolv.conf ${NANO_WORLDDIR}/etc 281 env ASSUME_ALWAYS_YES=yes pkg --chroot ${NANO_WORLDDIR} install ${PACKAGE_LIST} 350 282 ) 351 283 … … 425 357 # XXX: Determine size before installing all find of additions to see how much 426 358 # base we are actually using ## du -h -d 0 427 customize_cmd cust_alternate_pkg_db428 359 customize_cmd cust_pkg 429 360 customize_cmd cust_install_files
Note:
See TracChangeset
for help on using the changeset viewer.