Bug 10500

Summary: Can't build kernel as non-root
Product: [Retired] Red Hat Linux Reporter: kenneth_porter
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-16 03:05:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Adds -f to cp invocations to allow build phase by non-root
none
Patch to kernel spec to install cp patch and fix errant touch command. none

Description kenneth_porter 2000-04-01 01:01:08 UTC
Found a couple of problems in the RH6.1 kernel SRPM that prevent it from
being built by a non-root user, one of which seems unresolvable.

First is that the pcmcia component is built multiple times, once for SMP
and once for UP. Read-only files are installed with cp and the second
attempt fails. This is fixed by adding -f to the cp invocation in the
Makefiles.

The show-stopper is the mknod invocations, which are privileged. I think
this can only be resolved either by an enhancement to RPM or installation
of the special files using a %post script.

While attempting to build as non-root, I found a bug in the spec file: An
attempt to touch /boot/kernel.h instead of %{buildroot}/boot/kernel.h. This
is one advantage of building as non-root: It catches attempts to write to
the final install tree instead of the buildroot tree.

Comment 1 kenneth_porter 2000-04-01 01:04:59 UTC
Created attachment 182 [details]
Adds -f to cp invocations to allow build phase by non-root

Comment 2 kenneth_porter 2000-04-01 01:07:59 UTC
Created attachment 183 [details]
Patch to kernel spec to install cp patch and fix errant touch command.

Comment 3 kenneth_porter 2000-04-01 06:24:59 UTC
The Makefile for ksymoops for both RH6.1 and RH6.2 attempts to install with "-o
root -g root". This needs to be patched out for non-root builds. The ownership
is correctly set in the RPM spec file.

BTW, my current objective is to comment out the mknod's and run the packaging to
the install step, then manually install the resulting kernel and modules
directory alongside my working kernel. (My principal objective is to create a
kernel that's "just like Red Hat's" only with minor site tweaks.)

Comment 4 Doug Ledford 2000-04-22 17:20:59 UTC
Our current kernel RPM spec file already had the kernel.h part fixed.  I've
added the pcmcia-cs patch (after fixing the patch to work with out later
pcmcia-cs 3.1 version in the current kernel RPM).  The mknod item is beyond the
scope of the kernel RPM itself and would need to be added to the functionality
of RPM itself.  Doing it in the %post would not be good because then the rpm
database on the machine would not know about the device files.

I'm closing this bug out.  Please reopen a new bug with the RPM feature you
requested.

Comment 5 kenneth_porter 2001-08-15 02:31:37 UTC
Problem with pcmcia-cs Makefiles and cp command has reappeared in kernel-2.2.19-
6.2.7.src.rpm (in 6.2 updates). The -f has been lost from the cp command so re-
installing into RPM_BUILD_ROOT fails on successive subsystem builds. Looks like 
the patch got lost between 2.2.14 and 2.2.19.

BTW, (FYI for lurkers) a package called fakeroot may be usable for executing 
mknod as non-root.