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.
Created attachment 182 [details] Adds -f to cp invocations to allow build phase by non-root
Created attachment 183 [details] Patch to kernel spec to install cp patch and fix errant touch command.
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.)
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.
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.