NetBSD Problem Report #57674

From www@netbsd.org  Tue Oct 24 10:03:03 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 042B61A9238
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 24 Oct 2023 10:03:03 +0000 (UTC)
Message-Id: <20231024100301.783681A9239@mollari.NetBSD.org>
Date: Tue, 24 Oct 2023 10:03:01 +0000 (UTC)
From: jdoverdev@proton.me
Reply-To: jdoverdev@proton.me
To: gnats-bugs@NetBSD.org
Subject: Making pkgsrc packages fails within chroot jail on an ext2 partition
X-Send-Pr-Version: www-1.0

>Number:         57674
>Category:       bin
>Synopsis:       Making pkgsrc packages fails within chroot jail on an ext2 partition
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 24 10:05:00 +0000 2023
>Originator:     John Dover
>Release:        10.0_BETA | pkgsrc-current | 2023-10-24
>Organization:
>Environment:
System: NetBSD 10.0_BETA (GENERIC) #0: Sun Oct 8 15:24:41 UTC 2023 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: amd64
Machine: amd64
>Description:
Making pkgsrc packages within a chroot jail fails when done on a mounted ext2 partition.

Making in the same way (following the same commands) on either the main NetBSD partition or a separate mounted ffsv2 partition works as expected.

--

Obvious issues appear during the 'make configure' stage of the pkgtools/cwrappers package (or rather the libnbcompat dependency).

First, a number or errors / unusual output is output almost immediately:

 | ./configure: sh: not found
 | ./configure: sh: not found
 | eval: as_var+=2: not found
 | a
 | /
 | ./configure: /bin/uname: not found
 | ./configure: /bin/arch: not found
 | ./configure: /usr/bin/arch: not found
 | ./configure: /usr/convex/getsysinfo: not found
 | ./configure: /usr/bin/hostinfo: not found
 | ./configure: /bin/machine: not found
 | ./configure: /usr/bin/oslevel: not found
 | ./configure: /bin/universe: not found
 | sparc-sun-sunos4.1.1

Then the operation continues, up to where it would normally create the 'config.status' & 'Makefile' files, at which point it fail (pauses with no further output). Last line displayed is:

 | checking if vsnprintf is standards compliant... yes
>How-To-Repeat:
1) Prepare a ext2 partition (I used gparted from a Linux OS)

2) Install or download mksandbox
 - Install via pkg_add, pkgin, pkgsrc, etc.
 or
 - Download shell script directly like below (only executing script, no make require):
 - $ cd /tmp
 - $ cvs -q -z2 -d anoncvs@anoncvs.netbsd.org:/cvsroot checkout pkgsrc/pkgtools/mksandbox/files/mksandbox

3) Mount ext2 partition in NetBSD, and create jail directory
 - # mkdir /mnt/ext
 - # mount -t ext2fs /dev/dk(*) mnt/ext

4) Execute mksandbox via installed version, or from downloaded file
 - # mksandbox --without-x --without-pkgsrc --without-src --without-xsrc mnt/ext/jail
 or
 - # /tmp/pkgsrc/pkgtools/mksandbox/files/mksandbox --without-x --without-pkgsrc --without-src --without-xsrc mnt/ext/jail

5) Enter created chroot jail
 - # mnt/ext/jail/sandbox

6) From within the chroot jail, download a copy of the pkgsrc tree
 - ## cd /tmp
 - ## ftp https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz
 - ## tar -xzf pkgsrc.tar.gz -C /usr
 or
 - ## cd /usr
 - ## cvs -q -z2 -d anoncvs@anoncvs.netbsd.org:/cvsroot checkout pkgsrc

7) Make a package -> it is the cwrappers (or rather the libnbcompat dependency) configure that fails, so it is easy to just 'make configure' there
 - ## cd /usr/pkgsrc/pkgtools/cwrappers
 - ## make configure
>Fix:
Unsure - my current approach is to build pkgsrc on a ffsv2 partition.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.