10.0 BETA3 - nanobsd.sh does not use pkg
Patrick M. Hausen
hausen at punkt.de
Wed Nov 20 13:53:10 UTC 2013
Hi, all,
Am 20.11.2013 um 09:09 schrieb Zenny <garbytrash at gmail.com>:
> +1 I had the same experience.
>
> On 11/20/13, Patrick M. Hausen <hausen at 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 …
OK, here’s a quick hack to just make it work somehow. I have to build an image at
the moment ;-)
Any takers for tidying up? I’m using the „-c“ option and pkg from the 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
———————————————
root at 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=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
echo "=== TODO: $todo"
ls ${NANO_WORLDDIR}/Pkg
echo "==="
while true
do
# Record how many we have now
have=`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=`pkg -c ${NANO_WORLDDIR} info | wc -l`
echo "=== NOW $now"
pkg -c ${NANO_WORLDDIR} info
echo "==="
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
)
———————————————
--
punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe
Tel. 0721 9109 0 * Fax 0721 9109 100
info at punkt.de http://www.punkt.de
Gf: Jürgen Egeling AG Mannheim 108285
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20131120/7d1a669a/attachment.sig>
More information about the freebsd-stable
mailing list