[klibc] [PATCH 00/16] External building, update for 2.6.33 and multiple root devices.

Mike Waychison mikew at google.com
Mon Mar 1 23:45:28 PST 2010

The following patchset implements 3 seperate series of changes.

External Building

Patches 1 through 8 enable to use of klibc's build system while leaving the src
tree pristine (and potentially read only).  Specifically:

  - srctree=<Sources for klibc>
  - objtree=<Ouput directory for klibc>
  - KLIBCKERNELSRC=<Kernel sources>
  - KLIBCKERNELOBJ=<Kernel output directory>

As an example, with these patches, one can call 'make' as follows (assuming
/usr/local/src/linux-2.6 are kernel sources and object files and
/usr/local/src/klibc are pristine klibc sources):

$ cd /tmp
$ mkdir klibc-obj
$ cd klibc-obj
$ make KLIBCKERNELSRC=/usr/local/src/linux-2.6/ \
	KLIBCKERNELOBJ=/usr/local/src/linux-2.6/ \
	srctree=/usr/local/src/klibc \
	-f /usr/local/src/klibc/Makefile

Updating headers for 2.6.33

Patches 9 through 14 handle various little breakages that I encountered while
trying to compile klibc using 2.6.33 kernel headers.  Many of these seem to revolve around change in kernel headers for networking, with the biggest change being the use of __KERNEL__ in linux/socket.h.

I'm not sure what the policy is for keeping klibc in sync with kernel headers
as they evolve upstream, but these patches should help anyone interested in
using a newer kernel tree.

Allowing multiple mounts to be specified.

Patch 15 and 16 implement the ability to specify multiple root devices on the
kernel command line.  In our production environment, we are used to specifying
the following non-standard cmdline option: "root=/dev/hda1,/dev/sda1".  We
currently maintain internal patches to support this, but would like to move
this logic down into kinit.

To implement this functionality, we introduce a new internal dev_t called
'Root_MULTI'.  This device type is used to signify that there are multiple root
devices listed.  As for compability with legacy boots using linuxrc in an
initrd, we simply disallow using multiple roots and a linuxrc (it is unclear to
me what the proper behaviour here should be).

Patch Summary (one-liners)

 1: Allow kernel sources to be specified on the command line
 2: Remove redundent include of the klibc .config
 3: Allow override of klibc .config location
 4: Fix srctree references in build.
 5: Specify VPATH
 6: Fix flags to always use relative paths.
 7: Update syscalls.pl commands to use $(srctree)
 8: Update socketcalls.pl commands to use $(srctree)

 9: Fix asm includes for newer kernel sources.
10: Add missing NFS mount RPC call ordinals.
11: packet.h needs a definition for struct iovec
12: netdev.c needs sockios.h
13: Define types and values in sys/socket.h
14: Include sys/socket.h from net/if_arp.h

15: Drop unused argument root_dev to ramdisk_load()
16: Support for multiple devices specified on the root= cmdline.

Mike Waychison

More information about the klibc mailing list