From nobody Wed Apr 12 18:36:13 2023 X-Original-To: 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 4PxWd02Dzwz44WMG for ; Wed, 12 Apr 2023 18:36:20 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PxWcz4bVjz4JYS for ; Wed, 12 Apr 2023 18:36:19 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id CE5693C0199; Wed, 12 Apr 2023 18:36:13 +0000 (UTC) Date: Wed, 12 Apr 2023 18:36:13 +0000 From: Brooks Davis To: Christopher Bowman Cc: hackers@freebsd.org Subject: Re: make installworld -DNO_ROOT Message-ID: References: <3E739B8C-9416-43B4-B8C7-6671FF5C028C@chrisbowman.com> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <3E739B8C-9416-43B4-B8C7-6671FF5C028C@chrisbowman.com> X-Rspamd-Queue-Id: 4PxWcz4bVjz4JYS X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Apr 11, 2023 at 08:51:53PM -0700, Christopher Bowman wrote: >=20 > > On Apr 11, 2023, at 7:10 AM, Brooks Davis wrote: > >=20 > > These warnings are annoying, but mostly harmless. A stalled > > and seemingly not quite right review to address the issue is at > > https://reviews.freebsd.org/D30990 > >=20 > > -- Brooks > >=20 > > On Mon, Apr 10, 2023 at 12:00:45AM -0700, Christopher Bowman wrote: > >> Id like to build some images and I???d like do that as an ordinary use= r NOT as root > >>=20 > >> I???m experimenting with ???make installworld -DNO_ROOT TARGET_ARCH=3D= armv7??? > >>=20 > >> When I do that or ???make distribution -DNO_ROOT TARGET_ARCH=3Darmv7?= ?? > >>=20 > >> I get the following error messages during the make run: > >>=20 > >> make[4] warning: /etc: Permission denied. > >> make[4] warning: /lib: Permission denied. > >> make[5] warning: /lib/geom: Permission denied. > >> make[4] warning: /libexec: Permission denied. > >> make[4] warning: /bin: Permission denied. > >> make[4] warning: /rescue: Permission denied. > >> make[4] warning: /sbin: Permission denied. > >> make[4] warning: /etc: Permission denied. > >> make[2] warning: /etc: Permission denied. > >> make[3] warning: /etc/gss: Permission denied. > >> make[3] warning: /etc/mtree: Permission denied. > >> make[3] warning: /lib: Permission denied. > >> make[4] warning: /lib/geom: Permission denied. > >> make[3] warning: /libexec: Permission denied. > >> make[3] warning: /bin: Permission denied. > >> make[3] warning: /rescue: Permission denied. > >> make[3] warning: /sbin: Permission denied. > >> make[3] warning: /etc: Permission denied. > >>=20 > >> I think as a results either the recursive makes are failing or not doi= ng all they are supposed to. > >>=20 > >> It???s possible I???m using -DNO_ROOT wrong but if anyone has some sug= gestions about what???s happening that would be very helpful. > >>=20 > >> In the alternative I???m open to suggestions as to how to debug the hu= gs set of make invocations. I find reading and debug make files hard enoug= h but on huge treee like this with all the invocations and arguments I???m = kind lost as to even which command within the make files are causing this. > >>=20 > >> Thanks > >> Christopher >=20 > It???s possible but I???m not so sure. > I???m trying to build images and I???m using -DNO_ROOT to create a file s= ystem image without root privileges. Then later I use makefs to build the = filesystems images passing the METALOG file from the installworld/installke= rnel/distribution so that the files get the correct permission in the built= filesystem. > My METLOG file doesn???t have an entry for /etc/fstab so even though I ha= d build such a file and place it in my image, it doesn???t get copied into = my filesystem by makefs because there is no METLOG entry. So I???m of two = minds. On the one hand, this is probably ok for /boot/loader.conf which I = add to my image, after all it???s not strictly necessary that /boot/loader.= conf exist in all systems, but I???m not getting an /etc/fstab even though = I hand create the proper fstab because I have no METALOG entry for it, and = this is absolutely an essential file. What I???m not sure of is how this i= s supposed to work and I???d appreciate anyones feedback. >=20 > 1. I suppose it???s possible that fstab indeed isn???t created by make di= stribution and so I should hand create a METALOG entry for it, but this lea= ves me wondering what other files are important but also don???t get copied= because they don???t have a METALOG entry. Perhaps there is a switch to m= akefs that would warn me of files in the image without METALOG entries? /etc/fstab is normally created by the installer. If you want to add one you need to add a METALOG entry (METALOG use is all or nothing). Note that you can choose to store it outside DESTDIR and use contents=3D keyword to specify an absolute path to it if you prefer. I'm not sure if there's an easy way to check for stray files in DESTDIR, probably mtree can do it. -- Brooks >=20 > 2. The /etc/fstab should have a METALOG entry and I???m doing something w= rong, perhaps I???m missing a switch or options somewhere. >=20 > In any even I welcome any feedback and thank you for the response you???v= e already sent. > Regards, > Christopher=09 >=20