Bug 10500 - Can't build kernel as non-root
Can't build kernel as non-root
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-31 20:01 EST by kenneth_porter
Modified: 2007-04-18 12:26 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 22:05:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Adds -f to cp invocations to allow build phase by non-root (4.98 KB, patch)
2000-03-31 20:04 EST, kenneth_porter
no flags Details | Diff
Patch to kernel spec to install cp patch and fix errant touch command. (1.01 KB, patch)
2000-03-31 20:07 EST, kenneth_porter
no flags Details | Diff

  None (edit)
Description kenneth_porter 2000-03-31 20:01:08 EST
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-03-31 20:04:59 EST
Created attachment 182 [details]
Adds -f to cp invocations to allow build phase by non-root
Comment 2 kenneth_porter 2000-03-31 20:07:59 EST
Created attachment 183 [details]
Patch to kernel spec to install cp patch and fix errant touch command.
Comment 3 kenneth_porter 2000-04-01 01:24:59 EST
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 13:20:59 EDT
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-14 22:31:37 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.