Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jul 2023 20:24:14 +0200
From:      Stefan Hegnauer <stefan.hegnauer@gmx.ch>
To:        freebsd-stable@freebsd.org
Subject:   Nanobsd and packages
Message-ID:  <d032cb73-5ce0-76b7-48e5-45393a601a22@gmx.ch>

next in thread | raw e-mail | index | archive | help
Up to stable/13 of about March this year - and for the last two decades
or so - using packages in nanobsd(8) was pretty straight forward: you
needed a directory with packages to install using the included
'cust_pkgng' helper function, and one of the packages had to be the
'pkg-x.y.z' package to bootstrap the package system during the nanobsd
creation stage.

Not anymore with stable/13.2 of about July 24 or later. I did not try to
bisect to find out when and what changed. This is rather outside of my
comfort zone so there may be a better way / better explanation, but
these are my findings so far:
- to bootstrap pkg(8) without resorting to the internet (which fails for
me in=C2=A0 a chroot environment) the associated package *must* be named
'pkg.txz'. Nothing else will do.
- there cannot be a path in front of the package name, i.e.
'/_.p/pkg.txz' as used by nanobsd(8) does not work anymore.
- alas, nanobsd(8) cannot install packages in the old way as the
bootstrapping fails.

To get around this the following patch seems to work for me:

    diff --git a/tools/tools/nanobsd/defaults.sh
    b/tools/tools/nanobsd/defaults.sh
    index 45d9fe44c650..9a654e6d9d5b 100755
    --- a/tools/tools/nanobsd/defaults.sh
    +++ b/tools/tools/nanobsd/defaults.sh
    @@ -774,6 +774,7 @@ cust_pkgng ( ) (
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 echo "FAILED: need a pkg/ package for bootstrapping"
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 exit 2
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi
    +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mv ${NANO_PACKAGE_DIR}/${_=
NANO_PKG_PACKAGE}
    ${NANO_PACKAGE_DIR}/pkg.txz

     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # Mount packages into chro=
ot
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mkdir -p ${NANO_WORLDDIR}/=
_.p
    @@ -783,7 +784,7 @@ cust_pkgng ( ) (
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 trap "umount ${NANO_WORLDD=
IR}/dev; umount
    ${NANO_WORLDDIR}/_.p ; rm -xrf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT

     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # Install pkg-* package
    -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CR "${PKGCMD} add /_.p/${_NANO_P=
KG_PACKAGE}"
    +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CR "cd /_.p ; ${PKGCMD} add pkg.=
txz"

     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (
     =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 # Expand any glob characters in pacakge list

=2D- stefan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d032cb73-5ce0-76b7-48e5-45393a601a22>