NetBSD Problem Report #51992

From paul@whooppee.com  Wed Feb 22 10:50:36 2017
Return-Path: <paul@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4FD5F7A2A7
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 22 Feb 2017 10:50:36 +0000 (UTC)
Message-Id: <20170222105033.4EEEB16E62@speedy.whooppee.com>
Date: Wed, 22 Feb 2017 18:50:33 +0800 (PHT)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: Enhancement suggestions for pkgtools/mksandbox
X-Send-Pr-Version: 3.95

>Number:         51992
>Category:       pkg
>Synopsis:       Enhancement suggestions for pkgtools/mksandbox
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    agc
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 22 10:55:00 +0000 2017
>Last-Modified:  Tue Dec 05 20:50:01 +0000 2023
>Originator:     Paul Goyette
>Release:        NetBSD 7.99.59
>Organization:
+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+
>Environment:


System: NetBSD speedy.whooppee.com 7.99.59 NetBSD 7.99.59 (SPEEDY 2017-02-15 11:46:59 UTC) #0: Wed Feb 15 12:39:29 UTC 2017 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
The following enhancements to the pkgtools/mksandbox would be useful:

* Check to see if the sandbox is already mounted before mounting it
  again.  (Mounting the sandbox on top of itself is just messy, and
  awkward to unwind!)

* Don't try to unmount the sandbox if it is not already mounted.

* In addition to --rodirs and --rwdirs, provide for --tmpdirs.  This
  would allow, for example, --tmpdirs tmp=tmpfs[:-m1777,-sram%25] to
  mount a tmpfs on /sandbox/tmp with the listed (optional) options.
  This is an alternative to including /tmp in the list of --rwdirs.

>How-To-Repeat:
N/A

>Fix:
N/A


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->agc
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Wed, 22 Feb 2017 11:30:34 +0000
Responsible-Changed-Why:
Over to maintainer


From: Alistair Crooks <agc@pkgsrc.org>
To: tech-pkg <tech-pkg@netbsd.org>, Paul Goyette <paul@whooppee.com>, gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/51992
Date: Fri, 10 Nov 2023 12:41:22 -0800

 --0000000000008d8fd50609d2587e
 Content-Type: text/plain; charset="UTF-8"

 On Fri, 10 Nov 2023 at 12:04, Alistair Crooks <agc@pkgsrc.org> wrote:

 > [This is a PR from Paul about improvements for mksandbox. CC to tech-pkg
 > for comments -- agc]
 >
 > Finally getting around to looking at PR 51992, it includes some excellent
 > suggestions - thanks, Paul!
 >
 > The attached diff should address the first 2 parts of the PR, still
 > working on the third part.
 >
 > Does anyone have any comments on these?
 >
 > Thanks,
 > Al
 >
 > PS. I tried a lot of different ways before landing on this one, which
 > seems to be the
 > cleanest way.
 >

 I should have pasted what the operations look like:

 [2023/11/10 Fri 12:37:35] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [237]
 > mkdir ~/sb6
 [2023/11/10 Fri 12:37:47] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [238]
 > sudo mksandbox ~/sb6
 WARNING: LOCALPATCHES directory does not exist - ignoring
 Copying the kernel
 Checking package hierarchy in /usr/pkg and package database in
 /usr/pkg/pkgdb exist
 Make and populate /home/agc/sb6/dev
 Make and populate /home/agc/sb6/etc
 Make empty dirs upon which to mount the null mounts
 Making /tmp in /home/agc/sb6
 Making /var/games in /home/agc/sb6
 Making /var/run in /home/agc/sb6
 Making /var/log in /home/agc/sb6
 Making /var/spool/lock in /home/agc/sb6
 Making /var/run/utmp in /home/agc/sb6
 Making /var/run/utmpx in /home/agc/sb6
 Making /var/log/wtmp in /home/agc/sb6
 Making /var/log/wtmpx in /home/agc/sb6
 Making /var/log/lastlog in /home/agc/sb6
 Making /var/log/lastlogx in /home/agc/sb6
 Mount /usr/src from /home/agc/sb6
 Mount /usr/pkgsrc from /home/agc/sb6
 Mounting /usr/pkgsrc/packages and /usr/pkgsrc/distfiles from /home/agc/sb6
 Mount /usr/xsrc from /home/agc/sb6
 Sandbox creation is now complete
 [2023/11/10 Fri 12:38:02] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [239]
 > sudo ~/sb6/sandbox mount
 /home/agc/sb6 already mounted
 [2023/11/10 Fri 12:38:22] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [240]
 > sudo ~/sb6/sandbox umount
 [2023/11/10 Fri 12:38:29] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [241]
 > sudo ~/sb6/sandbox umount
 /home/agc/sb6 not mounted
 [2023/11/10 Fri 12:38:32] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [242]
 >

 --0000000000008d8fd50609d2587e
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
 <div dir=3D"ltr" class=3D"gmail_attr">On Fri, 10 Nov 2023 at 12:04, Alistai=
 r Crooks &lt;<a href=3D"mailto:agc@pkgsrc.org">agc@pkgsrc.org</a>&gt; wrote=
 :<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
 8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"lt=
 r">[This is a PR from Paul about improvements for mksandbox. CC to tech-pkg=
  for comments -- agc]<div><br></div><div>Finally getting around to looking =
 at PR 51992, it includes some excellent suggestions - thanks, Paul!<div><br=
 ></div><div>The attached diff should address the first 2 parts of the PR, s=
 till working on the third part.</div><div><br></div><div>Does anyone have a=
 ny comments on these?</div><div><br></div><div>Thanks,</div><div>Al</div><d=
 iv><br></div><div>PS. I tried a lot of different ways before landing on thi=
 s one, which seems to be the</div><div>cleanest way.</div></div></div></blo=
 ckquote><div><br></div><div>I should have pasted=C2=A0what the operations l=
 ook like:</div><div><br></div>[2023/11/10 Fri 12:37:35] agc@netbsd-012 ...p=
 kgsrc/pkgtools/mksandbox [237] &gt; mkdir ~/sb6<br>[2023/11/10 Fri 12:37:47=
 ] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [238] &gt; sudo mksandbox ~/s=
 b6<br>WARNING: LOCALPATCHES directory does not exist - ignoring<br>Copying =
 the kernel<br>Checking package hierarchy in /usr/pkg and package database i=
 n /usr/pkg/pkgdb exist<br>Make and populate /home/agc/sb6/dev<br>Make and p=
 opulate /home/agc/sb6/etc<br>Make empty dirs upon which to mount the null m=
 ounts<br>Making /tmp in /home/agc/sb6<br>Making /var/games in /home/agc/sb6=
 <br>Making /var/run in /home/agc/sb6<br>Making /var/log in /home/agc/sb6<br=
 >Making /var/spool/lock in /home/agc/sb6<br>Making /var/run/utmp in /home/a=
 gc/sb6<br>Making /var/run/utmpx in /home/agc/sb6<br>Making /var/log/wtmp in=
  /home/agc/sb6<br>Making /var/log/wtmpx in /home/agc/sb6<br>Making /var/log=
 /lastlog in /home/agc/sb6<br>Making /var/log/lastlogx in /home/agc/sb6<br>M=
 ount /usr/src from /home/agc/sb6<br>Mount /usr/pkgsrc from /home/agc/sb6<br=
 >Mounting /usr/pkgsrc/packages and /usr/pkgsrc/distfiles from /home/agc/sb6=
 <br>Mount /usr/xsrc from /home/agc/sb6<br>Sandbox creation is now complete<=
 br>[2023/11/10 Fri 12:38:02] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [2=
 39] &gt; sudo ~/sb6/sandbox mount<br>/home/agc/sb6 already mounted<br>[2023=
 /11/10 Fri 12:38:22] agc@netbsd-012 ...pkgsrc/pkgtools/mksandbox [240] &gt;=
  sudo ~/sb6/sandbox umount<br>[2023/11/10 Fri 12:38:29] agc@netbsd-012 ...p=
 kgsrc/pkgtools/mksandbox [241] &gt; sudo ~/sb6/sandbox umount<br>/home/agc/=
 sb6 not mounted<br><div>[2023/11/10 Fri 12:38:32] agc@netbsd-012 ...pkgsrc/=
 pkgtools/mksandbox [242] &gt;=C2=A0</div></div></div>

 --0000000000008d8fd50609d2587e--

From: "Alistair G. Crooks" <agc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51992 CVS commit: pkgsrc/pkgtools/mksandbox
Date: Tue, 5 Dec 2023 20:45:27 +0000

 Module Name:	pkgsrc
 Committed By:	agc
 Date:		Tue Dec  5 20:45:27 UTC 2023

 Modified Files:
 	pkgsrc/pkgtools/mksandbox: Makefile
 	pkgsrc/pkgtools/mksandbox/files: mksandbox

 Log Message:
 pkgtools/mksandbox - update to version 1.11

 + Don't allow mounting of already mounted sandboxes, or unmounting of
 unmounted sandboxes.

 + Also, add an extra "ismounted" case label to be able to tell if a
 sandbox is mounted. A df(1) invocation should continue to work just
 as well :)

 No objections on tech-pkg@

 Addresses the first part of PR pkg/51992 from Paul Goyette


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/pkgtools/mksandbox/Makefile
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/pkgtools/mksandbox/files/mksandbox

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

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.