Building with Jail Patches

Jack C jack at crepinc.com
Sun Aug 31 04:12:13 UTC 2008


Greetings all,

I apologize in advance for anything stupid I overlooked; I tried to search
as best I could for answers before wasting your time. I've been trying to
compile resource controls into jails for about the past week. No matter how
hard I try, I always seem to run into some issue. I started by finding Chris
Jones' Summer of Code patches, and attempting them against 6.0 to no avail.
In reading archives of this list, I found the 7.0 memory control patch and
tried that as well. Can anyone point out what I'm doing wrong?

I installed this machine straight from 6.0 ISOs. No cvsup was performed.
---
bsd6laptop# uname -a
FreeBSD bsd6laptop.66fruit.com 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov
3 09:36:13 UTC 2005     root at x64.samsco.home:/usr/obj/usr/src/sys/GENERIC
i386
bsd6laptop# [apply the changes detailed in docs/INSTALL (without error)]
bsd6laptop# make buildworld
[... stuff working fine here ...]
===> usr.bin/elf2aout (all)
cc -O2 -fno-strict-aliasing -pipe  -Wsystem-headers -Wall -Wno-format-y2k -W
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow
-Wcast-align -Wunused-parameter -c /usr/src/usr.bin/elf2aout/elf2aout.c
/usr/src/usr.bin/elf2aout/elf2aout.c: In function `main':
/usr/src/usr.bin/elf2aout/elf2aout.c:69: error: syntax error before
"phentsize"
/usr/src/usr.bin/elf2aout/elf2aout.c:120: error: `machine' undeclared (first
use in this function)
/usr/src/usr.bin/elf2aout/elf2aout.c:120: error: (Each undeclared identifier
is reported only once
/usr/src/usr.bin/elf2aout/elf2aout.c:120: error: for each function it
appears in.)
/usr/src/usr.bin/elf2aout/elf2aout.c:123: error: `phentsize' undeclared
(first use in this function)
/usr/src/usr.bin/elf2aout/elf2aout.c:129: error: `phnum' undeclared (first
use in this function)
*** Error code 1

Stop in /usr/src/usr.bin/elf2aout.
*** Error code 1
[...]
---

Similarly, I installed a 7.0 machine straight from ISO without update. I
succeded to buildworld, buildkernel and installkernel, however in single
user mode when I go to installworld, I am stopped at this:
----
[...]
install-info --quiet --defsection="Programming & development tools."
--defentry="* libcom_err: (com_err).     A Common Error Description Library
for UNIX." com_err.info /usr/share/info/dir
*** Error code 1

Stop in /usr/src/lib/libcom_err/doc
*** Error code 1
[...]
---

On the 7.0 machine, if I cvsup to RELENG_7 or RELENG_7_0 (same issue with
both), the patch does not apply: (I am not amazing at patching it seems...
the only way I could get it to work is to make src.old, and the patches seem
to be applied there.)

---
hydra# uname -a
FreeBSD hydra.66fruit.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24
19:59:52 UTC 2008     root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
i386
hydra# grep RELENG /usr/local/etc/cvsup/src-supfile
*default release=cvs tag=RELENG_7_0
hydra# pwd
/usr
hydra# cp -R src src.old
hydra# patch < /root/jailmem.patch
[... success and such ...]
Hunk #13 succeeded at 482.
Hunk #14 succeeded at 607.
patch: **** malformed patch at line 424: diff -burN
src.old/sys/kern/syscalls.c src.new/sys/kern/syscalls.c
hydra#
---

After cvsuping to the current 7 tree, I try again.

---
hydra# grep RELENG /usr/local/etc/cvsup/src-supfile
*default release=cvs tag=RELENG_7
---cvsuping takes place here without issue---
hydra# patch < /root/jailmem.patch
[... edited for brevity ...]
Patching file src.old/sys/kern/init_sysent.c using Plan A...
Hunk #1 failed at 2.
Hunk #2 succeeded at 510 with fuzz 1 (offset -1 lines).
[...]
patch: **** malformed patch at line 424: diff -burN
src.old/sys/kern/syscalls.c src.new/sys/kern/syscalls.c
---

Could anyone perchance give me a condensed step-by-step as to getting the
right source, patching, and compiling one of the resource patches out there?
Sorry again for the long mail.

Thanks,

-Jack Carrozzo


More information about the freebsd-jail mailing list