From nobody Mon Feb 27 08:04:34 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PQChd2R1Fz3tnFL for ; Mon, 27 Feb 2023 08:04:49 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PQChc75myz40cS; Mon, 27 Feb 2023 08:04:48 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x131.google.com with SMTP id r27so7342594lfe.10; Mon, 27 Feb 2023 00:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kRZJ3uEcL0akLpD970RzkNxlCRo5iyBTOdk/nnlWSwg=; b=gCf8OPZ7lci/gv0KP1G7P4gJwhifr7OeJ3aHlKuXXtRua6TB9On8ZTcPwOm5AoEWCL b3tPJBcR5+Df+yCtGNTAI+cSQokvK7l+eHZS4ookd4NG3IYjfyXU0XHVhPoDcNSxz4zz 5UhgIwDAhcToVzIUBba4HVNXtsh2yB9oHDHhTnD0uAecfcMw5v0xYdGBukFt2wocZI0r ytCpA78fdQ9B7Cl6qXL6o/p8K82ihajpJFpo1MbnPb+7SY8kePJDCHAjVbkgBkv2tFOs 1uS/wSrw7v3Ej8fWX3AW/8u39pt2jP7j4HF87VEG4EW7l4crqY/d9vN9uj8Hp1AhhupI gXQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kRZJ3uEcL0akLpD970RzkNxlCRo5iyBTOdk/nnlWSwg=; b=oiG7bKRSMXjFcRVhWsKtPUY51MtHgJ4LMHoemM+BrfQp//EvB1qHhSLbHSbZxKOZg1 +tLfcI87HEn1MwL8jsTfm2DY0LVYVL9C1HqULtMJQAjxuPY8xrH51WDvaiA6RXbdfAiH wpRVaQ94G2MXiuD+kYLhW0kfLSX3/EUjGGr3p4qmQjaQJpk5Y2jA6krCptqwLyQz+/B4 gh4vpgW58poG6Hd86XHAytPuchJ33Lf0EYm/hI+RyVBd/XH5if/vUAIeWEVbvn5Vpri9 ULhWBzhd8KCaOVN1aafQ6sirAZMYtRhai3nsGfV6bRP8K1kTF+h10rm35205/aQN7uKo uUuw== X-Gm-Message-State: AO0yUKVEboU58y0KiOh7np8RPf67LTRo0m7SnNwaCOjaT+d0hI90fspc R601WtT2ygXAaAEqmaJbs/2wuvDYI4H6Ifnf5HJFRvjNYQxz0Q== X-Google-Smtp-Source: AK7set8dTqDBR62w4sf9PNr7aLxCnJkXicM84fNVM9zaZgC4Q71fs5fRJPXn3T+ToRKRvcIxSC8LSJuICH13bold/Tk= X-Received: by 2002:ac2:54b0:0:b0:4db:266c:4339 with SMTP id w16-20020ac254b0000000b004db266c4339mr7243781lfk.2.1677485086107; Mon, 27 Feb 2023 00:04:46 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <20230227075803.ugvcrasatmtrycnf@aniel.nours.eu> In-Reply-To: <20230227075803.ugvcrasatmtrycnf@aniel.nours.eu> From: Michael Schuster Date: Mon, 27 Feb 2023 09:04:34 +0100 Message-ID: Subject: Re: pkg(8): difference between "-c /path" and "-r /path" To: Baptiste Daroussin Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PQChc75myz40cS X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Guys, see inline On Mon, Feb 27, 2023 at 8:58=E2=80=AFAM Baptiste Daroussin wrote: > > On Sun, Feb 26, 2023 at 10:07:14AM +0100, Michael Schuster wrote: > > Hi, > > > > This question is (as of yet) more of the "fill in background info" type= : > > From the "pkg(8)" man-page: > > > > -c , --chroot > > pkg will chroot in the environment. > > > > -r , --rootdir > > pkg will install all packages within the specified > directory>. > > > > up to now, I've leaned towards "pkg -c /path " when > > installing/updating a BE mounted at /path, but, given some results in t= he > > past that weren't quite clear to me (yes, that's a bit vague, sorry), I= 've > > been wondering whether "-r /path" would have been better. > > > > I'd appreciate thoughts/advice/comments, TIA > > Michael > > pkg -c will chroot (real chroot as in chroot(2)) into the directory at ea= rly > stage and execute everything from the inside. > > This means that for post install script the kernel of the host needs to b= e able > to run the binary withing the guest (for instance you cannot cross instal= l). > > For the packages themselves it is transparent if that is the case. > > pkg -r, will run everything from the host and with the provided rootdir p= repend > to all path in the packages and database, post install scripts needs to k= now > about PKG_ROOTDIR variable (which is not the case for many of them in the= ports > tree). triggers will be deffered (to be run at next boot). > > pkg -r allows cross installation (preparing an arm64 rootdir on a amd64 h= ost). > > In long term pkg -r is preferred, right now pkg -c is probably most of th= e time > safest. my main use case is keeping the current installation (13 Release for now) up to date and to have a fallback when installing new software; in that case, if I understand your comments correctly so far, either should work equally well. thx Michael > > Best regards, > Bapt --=20 Michael Schuster http://recursiveramblings.wordpress.com/ recursion, n: see 'recursion'