Bug 30420

Summary: "make install" for stallion tries to write to /usr/src
Product: Base System Reporter: david
Component: binAssignee: Murray Stokely <murray>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description david 2001-09-07 19:40:01 UTC
Using the above machine as source./NFS server, a colleague was doing an
NFS-based install.  During the "make installworld" phase, he started
getting "permission denied" messages for installing into /usr/libdata/stallion.

Examination shows that usr.sbin/stallion/bootcode/Makefile is apparently
trying to do uudecode and gzip operations in place.  Since /usr/src is
exported read-only, that poses a challenge or two.  :-}

Fix: 

As a circumvention, it can (in some cases) suffice to mount /usr/src read-write.  Alternatively, copy /usr/src from the server to the client.

I suspect that the Makefile(s?) will need to be made a bit cleverer,
probably involving another level of indirection.
How-To-Repeat: On a machine with recent sources, do the usual source upgrade (per
UPDATING) -- "make buildworld", "make buildkernel", "make installkernel", "make installworld", "mergemaster" (with a re-boot to
single-user mode after the installkernel if necessary or (otherwise) desired).  Verify that the resulting system  boots & runs.

NFS-export /usr/src and /usr/obj (read-only).

On a suitable victi^Wclient machine, mount the server's /usr/src and
/usr/obj appropriately, ensure that /etc/make.conf is compatible with
the one on the server, then "make installkernel" and "make installworld".

That last step should fail, whining about "permission denied" errors in usr.sbin/stallion/bootcode.
Comment 1 david 2001-09-08 04:37:52 UTC
Further analysis (catalyzed by others' reports of failures at the same
place) shows that my earlier assertions about trying to write to
/usr/src are likely wildly inaccurate.

Rather, the problem seem to be the mode of the created files:

dhcp-140[1] cd /usr/src/usr.sbin/stallion
dhcp-140[2] ls -la {,/usr/obj/`pwd`/}bootcode
/usr/obj//usr/src/usr.sbin/stallion/bootcode:
total 79
drwxrwxr-x  2 root  wheel    512 Sep  7 06:57 .
drwxrwxr-x  6 root  wheel    512 Sep  7 05:50 ..
-r--r-----  1 root  wheel  31056 Sep  7 06:57 2681.sys
-r--r-----  1 root  wheel  41760 Sep  7 06:57 cdk.sys
-rw-rw-r--  1 root  wheel   4233 Sep  7 06:57 stl.4.gz

bootcode:
total 116
drwxrwxr-x  3 david  wheel    512 Sep  7 10:57 .
drwxrwxr-x  7 david  wheel    512 Aug 31 05:26 ..
-rw-rw-r--  1 david  wheel  42912 Aug 31 05:26 2681.sys.uu
drwxrwxr-x  2 david  wheel    512 Aug 31 05:26 CVS
-rw-rw-r--  1 david  wheel    401 Sep  7 10:57 Makefile
-rw-rw-r--  1 david  wheel  57657 Aug 31 05:26 cdk.sys.uu
-rw-rw-r--  1 david  wheel  12475 Aug 31 05:26 stl.4
dhcp-140[3] 


Since "root" on the client machine is treated as neither the root
user nor a member of the wheel group (by default), the attempt
to read the generated files fails, thus causing the install to fail.

Sorry for the confusion; it still seems that there's a problem, though.
Perhaps the "make buildworld" step could cause the generated files to
have a less-restrictive mode...?

david
-- 
David H. Wolfskill				david@catwhisker.org
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2001-09-08 09:25:58 UTC
Responsible Changed
From-To: freebsd-bugs->murray

This problem was apparently introduced by murray's recent import into RELENG_4
Comment 3 david 2001-09-08 15:10:26 UTC
I think this shows what needs to be fixed:

dhcp-140[1] cd /usr/src/usr.sbin/stallion/bootcode/
dhcp-140[2] grep '^begin' *.uu
2681.sys.uu:begin 440 2681.sys
cdk.sys.uu:begin 440 cdk.sys
dhcp-140[3] 


I rather suspect that changing those "440"s to "444"s would adress the
issue nicely.

Cheers,
david
-- 
David H. Wolfskill				david@catwhisker.org
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.
Comment 4 Murray Stokely freebsd_committer freebsd_triage 2001-09-09 02:42:06 UTC
State Changed
From-To: open->closed

The file mode has been changed, thanks!