On 3/20/07, MickB <[EMAIL PROTECTED]> wrote:
> Hi Dan,
>
> Thanks for your answer, it's helpful :). I'm currently trying this,
> but I encounter a little problem : udev's Makefile usually has a boolean
> 'USE_KLIC' to decide whether we should link against klibc or glibc at
> building time, but it seems this has changed recently... I have
> installed klibc but at compil time it links to glibc, of course :). Do
> you have any idea to force the usage of klibc ?
Yeah, the trick to building against klibc is that you want to use klcc
as the compiler, which is just a wrapper script around gcc to get it
to use klibc instead of glibc. This is how I've been building udev
(drop DESTDIR/$PKG_DEST if you don't want it):
# build useful extras
EXTRAS="extras/ata_id extras/edd_id extras/firmware extras/path_id \
extras/scsi_id extras/usb_id extras/volume_id"
# use klibc, strip, statically link vol_id, don't build syslog code
make EXTRAS="$EXTRAS" VERBOSE="$VERBOSE" \
CC=/usr/bin/klcc LD=/usr/bin/klcc LDFLAGS=-s \
VOLUME_ID_STATIC=true USE_LOG=false
make install-bin install-config \
prefix=/usr/lib/klibc \
DESTDIR=${PKG_DEST} \
EXTRAS="$EXTRAS"
# remove unneeded binaries and libvolume_id
rm -vr ${PKG_DEST}/usr/lib/klibc/{usr,lib/libvolume_id.so*}
# relink scsi_id relative
ln -svf ../lib/udev/scsi_id ${PKG_DEST}/usr/lib/klibc/sbin
The last one is because the scsi_id link in $prefix/sbin is absolute
by default and I think it breaks things when you try to move it
around. I can't quite recall.
Building modprobe takes a couple minor tweaks, too. This is how I've
been building that:
CC=klcc CPPFLAGS=-DCONFIG_NO_BACKWARDS_COMPAT ./configure
make modprobe
# install stripped modprobe
install -v -s -m755 modprobe ${PKG_DEST}/usr/lib/klibc/sbin/modprobe
When I actually create the initramfs, I pretty much just copy
/usr/lib/klibc/* into it. Here's my script:
http://www.linuxfromscratch.org/~dnicholson/downloads/mkinitramfs.sh
I install it into /sbin as mkinitramfs. It will look for two variables
in /etc/sysconfig/boot: INIT_MODULES and INIT_FILES. You can specify
the modules you want and any extra files you want. I think the script
will just copy all the ide, scsi, acpi and fs modules if INIT_MODULES
aren't set. That may not be very robust. For example, I have these
settings on my laptop to get my sata root drive up:
INIT_MODULES="ext3 sg sd_mod ata_piix ahci"
INIT_FILES=
But that just puts the modules and their dependencies in the
initramfs. Udev actually modprobes everything so long as the necessary
rules are there. The specific udev rules files are hardcoded in the
script, but it's been working so far for me. You could add any extra
rules files to INIT_FILES.
--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page