Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 2013 15:38:46 +0100
From:      Andreas Nilsson <andrnils@gmail.com>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        Zenny <garbytrash@gmail.com>, "freebsd-stable@freebsd.org List" <freebsd-stable@freebsd.org>
Subject:   Re: 10.0 BETA3 - nanobsd.sh does not use pkg
Message-ID:  <CAPS9%2BSsxti2RpNrug5V%2BBnWwxG968X1=mJDLk0e9FhV91BSEhA@mail.gmail.com>
In-Reply-To: <4D1434BD-F4B2-4572-B3FD-E5030FFB2FB3@punkt.de>
References:  <834900CF-EEF2-4AA7-8BAC-CBAFCE7007E8@punkt.de> <CACuV5sBqToq347N37RXrZx6YA=_VQAipfk-oB9yLPu_a3xft%2Bw@mail.gmail.com> <4D1434BD-F4B2-4572-B3FD-E5030FFB2FB3@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 20, 2013 at 2:53 PM, Patrick M. Hausen <hausen@punkt.de> wrote:

> Hi, all,
>
> Am 20.11.2013 um 09:09 schrieb Zenny <garbytrash@gmail.com>:
> > +1 I had the same experience.
> >
> > On 11/20/13, Patrick M. Hausen <hausen@punkt.de> wrote:
> >> Hi, all,
> >>
> >> I just wanted to report that. I do not yet have a patch to suggest.
> >> nanobsd.sh cust_pkg() still tries to call pkg_add and fails when
> >> adding packages to the NANO_WORLD_DIR. tbz vs. txz =85
>
> OK, here=92s a quick hack to just make it work somehow. I have to build a=
n
> image at
> the moment ;-)
>
> Any takers for tidying up? I=92m using the =84-c=93 option and pkg from t=
he
> buidling system
> instead of chroot into the NANO_WORLD_DIR first. Looks like that might
> simplify
> things even more than I just did.
>
> Kind regards
> Patrick
>
> =97=97=97=97=97=97=97=97=97=97=97=97=97=97=97
> root@freebsd10:/home/nanobsd/build/vagrant # cat pkgng.nano
> cust_pkgng () (
>         # If the package directory doesn't exist, we're done.
>         if [ ! -d ${NANO_PACKAGE_DIR} ]; then
>                 echo "DONE 0 packages"
>                 return 0
>         fi
>
>         # Copy packages into chroot
>         mkdir -p ${NANO_WORLDDIR}/Pkg
>         (
>                 cd ${NANO_PACKAGE_DIR}
>                 find ${NANO_PACKAGE_LIST} -print |
>                     cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
>         )
>
>         # Count & report how many we have to install
>         todo=3D`ls ${NANO_WORLDDIR}/Pkg | wc -l`
>         echo "=3D=3D=3D TODO: $todo"
>         ls ${NANO_WORLDDIR}/Pkg
>         echo "=3D=3D=3D"
>         while true
>         do
>                 # Record how many we have now
>                 have=3D`pkg -c ${NANO_WORLDDIR} info | wc -l`
>
>                 # Attempt to install more packages
>                 # ...but no more than one at a time - experienced sqlite
> errors
>                 (cd ${NANO_WORLDDIR} && ls Pkg/*txz) | xargs -n 1 pkg -c
> ${NANO_WORLDDIR} add || true
>
>                 # See what that got us
>                 now=3D`pkg -c ${NANO_WORLDDIR} info | wc -l`
>                 echo "=3D=3D=3D NOW $now"
>                 pkg -c ${NANO_WORLDDIR} info
>                 echo "=3D=3D=3D"
>
>
>                 if [ $now -eq $todo ] ; then
>                         echo "DONE $now packages"
>                         break
>                 elif [ $now -eq $have ] ; then
>                         echo "FAILED: Nothing happened on this pass"
>                         exit 2
>                 fi
>         done
>         rm -rf ${NANO_WORLDDIR}/Pkg
> )
> =97=97=97=97=97=97=97=97=97=97=97=97=97=97=97
>
> --
> punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe
> Tel. 0721 9109 0 * Fax 0721 9109 100
> info@punkt.de       http://www.punkt.de
> Gf: J=FCrgen Egeling      AG Mannheim 108285
>
>
>
> As I just answered this in another thread: this is what I do:

If you use the official pkgng repo it is almost trivial:

define/override cust_pkg() in your config file, something like

cust_pkg() {
    pkg -c ${NANO_WORLDDIR} install $packages
    pkg -c ${NANO_WORLDDIR} clean
}

You might also have to temporarily place a working resolv.conf in
${NANO_WORLDDIR}/etc

If you have your own repo just add
export PACKAGESITE=3D"proto://path/to/repo"
to the config file as well.

Best regards
Andreas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPS9%2BSsxti2RpNrug5V%2BBnWwxG968X1=mJDLk0e9FhV91BSEhA>