Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2023 18:36:13 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Christopher Bowman <crb@chrisbowman.com>
Cc:        hackers@freebsd.org
Subject:   Re: make installworld -DNO_ROOT
Message-ID:  <ZDb6HflQ0fjL8EIy@spindle.one-eyed-alien.net>
In-Reply-To: <3E739B8C-9416-43B4-B8C7-6671FF5C028C@chrisbowman.com>
References:  <ADBDBA5E-4B60-4C35-BD7D-9EDE84592358@chrisbowman.com> <ZDVqQ0FwfWADCsbf@spindle.one-eyed-alien.net> <3E739B8C-9416-43B4-B8C7-6671FF5C028C@chrisbowman.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 11, 2023 at 08:51:53PM -0700, Christopher Bowman wrote:
>=20
> > On Apr 11, 2023, at 7:10 AM, Brooks Davis <brooks@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZDb6HflQ0fjL8EIy>