SCIENTIFIC-LINUX-DEVEL Archives

February 2008

SCIENTIFIC-LINUX-DEVEL@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Urs Beyerle <[log in to unmask]>
Reply To:
Urs Beyerle <[log in to unmask]>
Date:
Tue, 5 Feb 2008 20:24:32 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (67 lines)
[...]
>>>
>>>
>>>  I'm a little bit puzzled why a hostname doesn't work, by the time the
>>>  mount is attempted the dhcp client has already obtained a list of
>>>  nameservers and seems to have filled in resolv.conf.  Maybe the initrd
>>>  environment just hasn't got support for DNS lookups.  I'll look more
>>>  closely this afternoon but just thought I'd ask first...
>>
>> In the initrd environment I use busybox to mount nfs.
>>
>>>  livecd-2.7.4/linux-live.sl/initrd/static-binaries/busybox
>> BusyBox v1.7.1 (2007-09-21 01:50:40 CEST) multi-call binary
>>
>> Some dhcp features are build in, but it seems that
>>
>> mount -t nfs -o nolock,ro,rsize=8192,wsize=8192,hard,intr $NFSROOT $DIR
>>
>> is not taking into account /etc/resolv.conf or it is not able to do a 
>> DNS lookup. I haven't looked closer into the busybox source code so 
>> far...
>
> Fair enough.  If I have any time I might try to work it out, I just 
> thought I'd ask first.
>
> Is there a simple way to add stuff into the initrd (or run an initrd 
> like thing on a normal box) for debugging?
>

debugging:
Just give in addition the boot/kernel parameter "debug" when booting the 
LiveCD, for example "linux debug". If debug is set, the initrc script 
(called linuxrc) is executed stepwise and you have the possibility to 
debug the initrd environment inside a simple shell (it's an ash shell). 
It's not very comfortable to work with this shell (for example no 
auto-completion - I should fix this...) and you have only the build-in 
busybox commands available.

linux-live.sl/initrd/static-binaries/busybox
BusyBox v1.7.1 (2007-09-21 01:50:40 CEST) multi-call binary
...
...
Currently defined functions:
        [, [[, ash, awk, basename, cat, chmod, chown, chroot,
        clear, cp, cut, dd, df, dirname, du, echo, egrep, eject,
        expr, false, fdisk, fgrep, find, free, grep, gunzip, halt,
        hdparm, head, hostname, ifconfig, ifdown, ifup, insmod,
        kill, killall, last, ln, logger, losetup, ls, lsmod, md5sum,
        mkdir, mkfifo, mknod, mkswap, mktemp, modprobe, more,
        mount, mv, pivot_root, poweroff, ps, pwd, readlink, realpath,
        reboot, rm, rmdir, rmmod, route, sed, sh, sleep, sort,
        swapoff, swapon, sync, tail, tar, tee, test, touch, tr,
        true, udhcpc, umount, uname, uniq, vi, wc, which, xargs,
        zcat


add stuff into the initrd:
Yes, you can change the initrd if you build your own LiveCD.
Mainly have a look at livecd-2.7.4/linux-live.sl/initrd/linuxrc and 
livecd-2.7.4/linux-live.sl/initrd/liblinuxlive inside the livecd build 
scripts. Here "all the magic" is done.
And have a look at livecd-2.7.4/linux-live.sl/initrd/initrd_create, for 
example if you would like to add more kernel modules to the initrd. The 
script initrd_create creates the initrd.

    Urs

ATOM RSS1 RSS2