Bug 10500 - Can't build kernel as non-root
Summary: Can't build kernel as non-root
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-04-01 01:01 UTC by kenneth_porter
Modified: 2007-04-18 16:26 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2002-12-16 03:05:25 UTC


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

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.


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