Changeset 12874 in hybrid for branches/releng-10/nanobsd


Ignore:
Timestamp:
Aug 17, 2014, 11:00:13 PM (10 years ago)
Author:
rick
Message:

Let's start breaking pkg build and installs to play around. Since I kind of have to resort to a different path to avoid the official route of poudriere et al.

Location:
branches/releng-10/nanobsd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-10/nanobsd/cfg/nanobsd.wleiden

    r12873 r12874  
    270270
    271271
    272 # pkgdb should live on persistent storage only
    273 cust_alternate_pkg_db () (
    274         mkdir -p ${NANO_WORLDDIR}/usr/local/var/db/pkg ${NANO_WORLDDIR}/usr/local/tmp
    275         touch ${NANO_WORLDDIR}/usr/local/tmp/.hack-to-avoid-pruning-directory
    276         # sh profile
    277         ( echo 'PKG_DBDIR=/usr/local/var/db/pkg; export PKG_DBDIR'; \
    278         echo 'PKG_TMPDIR=/usr/local/tmp; export PKG_TMPDIR' ) >> ${NANO_WORLDDIR}/etc/profile
    279         # csh profile
    280         ( echo 'setenv PKG_DBDIR /usr/local/var/db/pkg'; \
    281         echo 'setenv PKG_TMPDIR /usr/local/tmp' ) >> ${NANO_WORLDDIR}/etc/csh.cshrc
    282 
    283         rmdir ${NANO_WORLDDIR}/var/db/pkg
    284         ln -s /usr/local/var/db/pkg ${NANO_WORLDDIR}/var/db/pkg
    285 )
    286 
    287272# Make tools available for root by default
    288273cust_root_bin_to_tools() {
     
    293278# to source /etc/profile in chroot to get PKG_* included, for alternate installs
    294279cust_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}
    350282)
    351283
     
    425357# XXX: Determine size before installing all find of additions to see how much
    426358# base we are actually using ## du -h -d 0
    427 customize_cmd cust_alternate_pkg_db
    428359customize_cmd cust_pkg
    429360customize_cmd cust_install_files
  • branches/releng-10/nanobsd/tools/package-build.sh

    r12649 r12874  
    127127  ${MAKE} package-links
    128128  PKGNAME=`${MAKE} extract-message | awk '{print $NF}'`
    129   pkg create $PKGNAME ${NANO_PACKAGE_DIR}/${PKGNAME}.tbz || exit 1
     129  ${MAKE} package-recursive PACKAGES=/root/nanobsd/pkg || exit 1
    130130
    131131  p_info Checking dependencies
Note: See TracChangeset for help on using the changeset viewer.