From owner-freebsd-current@FreeBSD.ORG Mon Sep 8 17:13:18 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA3253B4 for ; Mon, 8 Sep 2014 17:13:18 +0000 (UTC) Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78B971CC9 for ; Mon, 8 Sep 2014 17:13:18 +0000 (UTC) Received: by mail-qa0-f43.google.com with SMTP id cm18so14526971qab.30 for ; Mon, 08 Sep 2014 10:13:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=hvMWQIVe8XIrt1q9NFWSf/7zkxjs//B9NIJv4iDmEo0=; b=H2ixqiebxwwoAjUwfGfgZ1lClyr4KYgk4DkniiQ+iQQDDlw49HyYE993F+n65tDg1U b7gCmyyB0Tp6cSDmZ/o2RSLA39ExIMV6bFZISQsf14KBJbg5MdUajUZpZJCydp9Ewxj5 ckiL6w9r7T0FyDc/XWfyHePc3TSVuc2bRRbBC/cqC8dWhhWXicRF+SoR+5HqmO9iDbY+ 7FE2TB4KsmFhhwiP1eoCPKjsQZelTRi1H8ntUhXZw5pMS3qnizaQ7906tsgyhm31j8O6 aHnJNQIetRNCZ6wA5MnHWGQ5jx7JgZQCw9rPxncLKKE/Iz2k2hC/rk96tBLLMIU/cZTe R0uQ== X-Gm-Message-State: ALoCoQlseYglRlCr6Sh0Np0j1/g4dQ616h2RMzCgvvhonCJYC/2DSW99PuLK+e7Bh5w2DfoFUdE2 X-Received: by 10.140.46.55 with SMTP id j52mr42060856qga.27.1410196018173; Mon, 08 Sep 2014 10:06:58 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Mon, 8 Sep 2014 10:06:38 -0700 (PDT) X-Originating-IP: [2620:0:1003:1007:a9d1:ae7:a174:f544] In-Reply-To: <20140908154858.GB35236@spindle.one-eyed-alien.net> References: <20140908154858.GB35236@spindle.one-eyed-alien.net> From: Julio Merino Date: Mon, 8 Sep 2014 13:06:38 -0400 X-Google-Sender-Auth: B-yQsKOtFDIrmrwa29N4_FAbpK8 Message-ID: Subject: Re: make -DNO_ROOT to create chroot, problem installing into chroot with pkg To: Brooks Davis Content-Type: text/plain; charset=UTF-8 Cc: Craig Rodrigues , freebsd-current Current , freebsd-pkg@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 17:13:18 -0000 On Mon, Sep 8, 2014 at 11:48 AM, Brooks Davis wrote: > > If you don't mind the ownership being wrong and there being a few extra > +FOO files tar works. It would be great for someone to teach package to > install without root and to update a METALOG file. That's not 100% of > the solution, but it's a solid 80-90% solution. (This is just my completely uninformed opinion as I don't know the internals of pkg.) There are other issues to be addressed. Teaching pkg to install without root means changing pkg to not use chroot: i.e. to make pkg be able to deal with the concept of a "destdir" for package installations. That is probably easy: just prefixing a bunch of destdir to the locations being touched. However, the tricky part here is dealing with any package-specific post-install scripts to ensure they understand destdir, which in turn means that any tools executed by the scripts must also be capable of dealing with a destdir. Also, the scripts (being potentially-untrusted code) cannot be guaranteed to behave correctly on the outside-of-the-chroot system.