From owner-freebsd-pkgbase@freebsd.org Sun Apr 12 00:35:38 2020 Return-Path: Delivered-To: freebsd-pkgbase@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 593A02A857F for ; Sun, 12 Apr 2020 00:35:38 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490CTP3V3Qz4Kwh for ; Sun, 12 Apr 2020 00:35:36 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 03C0ZVCK025046; Sat, 11 Apr 2020 17:35:31 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 03C0ZUTB025045; Sat, 11 Apr 2020 17:35:30 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202004120035.03C0ZUTB025045@gndrsh.dnsmgr.net> Subject: Re: /root on a separate dataset breaks FreeBSD-base installation In-Reply-To: To: Grzegorz Junka Date: Sat, 11 Apr 2020 17:35:30 -0700 (PDT) CC: "Rodney W. Grimes" , Emmanuel Vadot , freebsd-pkgbase@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 490CTP3V3Qz4Kwh X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.09 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.02)[-0.020,0]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.18)[0.175,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.03)[ip: (0.13), ipnet: 69.59.192.0/19(0.06), asn: 13868(0.03), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-pkgbase@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Packaging the FreeBSD base system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 00:35:38 -0000 > On 11/04/2020 17:03, Rodney W. Grimes wrote: > >> On Sat, 11 Apr 2020 09:42:49 -0700 (PDT) > >> "Rodney W. Grimes" wrote: > >> > >>> [ Charset UTF-8 unsupported, converting... ] > >>>> I am following https://wiki.freebsd.org/PkgBase > >>>> > >>>> This: > >>>> > >>>> pkg install -g 'FreeBSD-*' > >>>> > >>>> fails with this: > >>>> > >>>> [2/800] Extracting FreeBSD-runtime-12.1_3:?? 4% > >>>> pkg: Fail to create hardlink: > >>>> /root/.pkgtemp..cshrc.v5sxGCRu3GlP:Cross-device link > >>> ^^^^^^ > >>> > >>> > >>>> [2/800] Extracting FreeBSD-runtime-12.1_3: 100% > >>>> > >>>> /root is in a different ZFS dataset. It works fine if it's not. Why pkg > >>>> is using /root/.pkgtemp instead of /tmp or /var/tmp? It doesn't matter > >>>> from where I run the command, looks like the path is hardcoded. > >>> The failure is caused by the fact that /.cshrc and /root/.cshrc > >>> are hardlinked to each other. A hardlink can not cross a > >>> ZFS dataset or a ufs mount point. > >> Ah right. > >> > >>>> Can I workaround with some option to pkg? > >>> I doubt that. > >> Someone (tm) should add support for this in pkg. > > An option to convert hardlinks to symlinks or duplicate files could be done. > > > > For the person with this problem there are ways to work around it > > by not making /root a seperate dataset, create /toor data set, > > set toor login home to /toor, use that for what ever it is that > > made you feel you needed to have /root as its own data set. > > > Did you mean - set root login home to /toor? Or create a new toor user? Look in your /etc/passwd file, the toor user already exists, its normal use is for /bin/sh login to root, but it can still be used for your issue here. > > I think the same will be with .profile which also looks like it's > hardlinked. Yes, but the pkg system is ONLY going to mess with /root, if you use /toor for your purpose it wont mess with pkg. However, you well have to update things from /root to /toor manually, but that rate of change is very very small. > > Wouldn't pkg already have to handle this for normal port packages > somehow? Or they never create hardlinks? Is it worth raising bug/feature > in bugzilla for pkg? The norm is there are very few cross directory links and this is very rarely an issue unless someone modifies the system in a way outside of the norm. Having /root as a seperate dataset is outside the norm. Note this also places /root outside of the boot environment directory which may bring other issues in the future. Ports should all install stuff inder the /usr/local hierarchy and that is usually self contained, so hard links are not an issue there. Further note, if you have made /usr/local its own dataset your defanitly going to have issues with boot environments if you try to run more than 1 version of FreeBSD as /usr/local is pretty version dependent. /var is a whole nother crap mess with boot environments, pkg and multiple versions cause pkg stores its caches and databases in /var and /var is not part of the BE. > --GrzegorzJ -- Rod Grimes rgrimes@freebsd.org