On 2026/06/11 13:41, Kirill A. Korinsky wrote:
> On Thu, 11 Jun 2026 12:41:48 +0200,
> Stuart Henderson <[email protected]> wrote:
> > 
> > On 2026/06/11 11:47, Kirill A. Korinsky wrote:
> > > ports@,
> > > 
> > > I'd like to add small port which packs pnor.BOOTKERNEL needed to boot
> > > qemu-system-ppc64 with something that can run OpenBSD/powerpc64
> > 
> > I don't really like EXTRACT_ONLY= when the main distfile can be handled
> > by standard infrastructure, so I'd prefer it with the diff below, but
> > won't insist.
> >
> > ok
> > 
> > --- Makefile.orig   Thu Jun 11 11:39:45 2026
> > +++ Makefile        Thu Jun 11 11:24:21 2026
> > @@ -8,7 +8,6 @@ CATEGORIES= sysutils
> >  HOMEPAGE=  https://wiki.raptorcs.com/wiki/Talos_II/Firmware
> >  SITES=             https://wiki.raptorcs.com/w/images/6/61/
> >  EXTRACT_SUFX=      .tar
> > -EXTRACT_ONLY=
> >  
> >  # pnor.BOOTKERNEL: Linux kernel (GPL-2.0) with Buildroot/Skiroot
> >  # initramfs containing GPL/LGPL/BSD/MIT/ISC licensed components.
> > @@ -24,10 +23,9 @@ PNOR_BZ2=        shell_upgrade/talos-ii-v${V}.pnor.bz2
> >  PNOR=              ${WRKSRC}/talos-ii-v${V}.pnor
> >  BOOTKERNEL=        ${WRKSRC}/pnor.BOOTKERNEL
> >  
> > +WRKDIST=   ${WRKDIR}
> > +
> >  post-extract:
> > -   ${INSTALL_DATA_DIR} ${WRKSRC}
> > -   cd ${WRKSRC} && \
> > -       ${TAR} -xf ${FULLDISTDIR}/${DISTNAME}${EXTRACT_SUFX} -- ${PNOR_BZ2}
> >     ${LOCALBASE}/bin/bzip2 -dc ${WRKSRC}/${PNOR_BZ2} > ${PNOR}
> >  
> >  do-build:
> > 
> > 
> 
> This way it won't make clean as:
> 
> ===>  Cleaning for talos-ii-pnor-bootkernel-2.10
> rm: 
> /build/pobj/talos-ii-pnor-bootkernel-2.10/shell_upgrade/talos-ii-v2.10.pnor.bz2:
>  Permission denied
> rm: /build/pobj/talos-ii-pnor-bootkernel-2.10/shell_upgrade: Directory not 
> empty
> rm: 
> /build/pobj/talos-ii-pnor-bootkernel-2.10/web_ipmi_upgrade/talos-ii-v2.01.pnor.squashfs.tar:
>  Permission denied
> rm: /build/pobj/talos-ii-pnor-bootkernel-2.10/web_ipmi_upgrade: Directory not 
> empty
> rm: /build/pobj/talos-ii-pnor-bootkernel-2.10: Directory not empty
> *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:3409 
> '_internal-clean': @if [ -e /build/pobj/talos-ii-pnor-bootkernel-2.10 ]; 
> the...)
> 
> the issue that Talos-ii-pnor-v2.10-bundle.tar contains two folders inside,
> and I haven't found a way to fix make clean without this "manual hack"

hmm, FIX_EXTRACT_PERMISSIONS is meant for this, but it only adds read
bits, and these dirs are not user-writable. with this diff it works...
is there a downside?

anyway, ok to go ahead and commit your version, we can adjust this
later if wanted.

Index: ports/infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
diff -u -p -r1.1651 bsd.port.mk
--- ports/infrastructure/mk/bsd.port.mk 18 May 2026 23:38:23 -0000      1.1651
+++ ports/infrastructure/mk/bsd.port.mk 11 Jun 2026 13:27:18 -0000
@@ -2831,7 +2831,7 @@ _post-extract-finalize:
 .  endif
 .endfor
 .if ${FIX_EXTRACT_PERMISSIONS:L} == "yes"
-       @chmod -R a+rX ${WRKDIR}
+       @chmod -R a+rX,u+rwX ${WRKDIR}
 .endif
 
 # run as _pbuild

Index: src/share/man/man5/bsd.port.mk.5
===================================================================
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
diff -u -p -r1.654 bsd.port.mk.5
--- src/share/man/man5/bsd.port.mk.5    4 Nov 2025 12:52:28 -0000       1.654
+++ src/share/man/man5/bsd.port.mk.5    11 Jun 2026 13:28:41 -0000
@@ -2114,7 +2114,7 @@ If
 .Sq Yes ,
 restore contents of
 .Pa ${WRKDIR}
-to world-readable at the end of
+to world-readable and owner-writable at the end of
 .Cm extract .
 Used for some distfile contents which have paranoid permissions for no reason.
 Defaults to

Reply via email to