[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chroot setup howto



Yes Max, this is very helpful, thanks.

On Monday 31 January 2005 5:25, Max Hofer wrote:
> a) the cvs didn't work most of the time (cvs login timed out on 4 out of 5 
> tries)

Fortunately CVS worked fine for me.  Hopefully you're using the instructions 
here:
http://www.emdebian.org/docs/cvs.html

 
> b) then the documentations in the cvs tree are so out of date and full of 
> contraditctions (CML2, kbuild, docu described programs which were not in the 
> package etc.) that i lost 2 days trying to run emdebsys 
>
> after 3 desperate days trying to set emdebsys (see my post in the mailing 
list 
> - on which none replied) i found the 1st usefull documentation for newbies 
> (thx a lot Philippe: http://stag.mind.be/stag_betadoc.pdf) on the stag 
> project hompage (at this time i had no clue what the difference between stag 
> and emdebsys was).

I hear ya, soul brother.

 
> there i found also a reference to the irc channel on irc.freenode.org 
> #emdebian. On the channel i met Philippe who basicly told me that emdebsys 
is 
> not finished yet (it toke me 4 days to realize that - and don't tell me now 
> RTFM - i did, but i was not prepared  for pre-pre-pre-alpah stage ;-)

I'd tried IRC, but no one was home.  From what I can tell, Phillipe is the 
only one working on the project.

 
> your host platform intel i686 (?)
> host OS: Debian Sarge (kernel-image-2.6.9-2 with header files)

P3, running stock Debian kernel for 686.  (my compiled kernel fscks up the 
kernel image target device on boot, "(hd3,3)", and segfaults.  Yes, devfs is 
compiled in)


> target platform: Geode (btw it is a i586 not i486)
> target OS? (same kernel? or something else)

Actually my immediate target is the Via Nehemia CPU, but thanks, I'd gotten 
bad info on the Geode.  Here's a note on enabling the hardware watchdog on 
Soekris boards, which may help you if your platform is similar:
http://voipexperts.com/pebble/pebble-wdt.txt

Our target OS is embedded Debian Sarge, although it appears to me that 
EmDebian is actually Potato.  If this is the case, I have wasted my time 
here.  Unfortunately no one on this listserv has been able to confirm the 
version of EmDebian.  Clearly they're either not paying attention to this 
list, or do not understand our questions, except maybe Phillipe.  Devs 
complain when you do not provide enough detail, but ignore it when you do 
because it's 'too long'. (I've gotten "I saw your messages going by...", more 
than once)  Whatever... they're volunteers, and don't have to care whether 
anyone uses the project or not.  So why do they do a project in the first 
place, wasting others' time?


> a) create a tool chain for cross compilation
> b) compiling the kernel/applications for your target system, create a root 
> filesystem, and install all on your target platform

Agree, although I would modify this to be:
a.  Create a tool chain for cross compilation;
b.  Create a chroot environment for target, in nature of end-platform;
c.  Create a root filesystem (Scratchbox does a, b, & c automatically, 
although it's not in the form of an image, and also no one here has used it 
before);
d.  Compile the kernel/applications for your target system (but which core 
apps?  I'm guessing kernel, glibc, glibc-linuxthreads  &  crypt --both in 
glibc source dir--, busybox, ncurses, libnet, & libpcap so far);
e.  Package certain target directories into cram files, and set up to 
automatically uncram into ramdisk on boot (no idea how);
f.  Wrap target filesystem into flash image and make bootable with Grub. (Have 
an idea how);
g.  Test boot in Qemu and/or boot on target platform from MoD flash and debug.
 

> as far as i understood you managed to do setp a) but not b)

I was able to create a cross-compile chroot environment in Scratchbox 
perfectly, but the EmDebian-preferred "Cross-Compile Environment" is too 
busted to build on Sarge, at least for architectures of x86 and PPC.  I 
suspect those using this are either running a very old Debian, or have done 
much modification to make it compile.  I've wasted 4, 12-hour days on this.

 
> in your case (i assume you have an i686 hostplatform and an i586 target 
> platform) you don't have to do step a) (as far as i understand - please 
> correct me if i'm wrong).

But ideally I'd like to set up my system in an environment where I can easily 
compile to several architectures, so am working to have toolchans for all 
foreseeable.  Trying to lay a good foundation.

 
> Philipppe gave me the hint to try out UML (user mode linux). i already 
> played around with UML a few months ago. so here i go:
> 
> a) created image file,, mounted it as loopback, created filesystem, and used 
> debootstrap (the docu for cdebootstrap is too short for a newbie like me, so 
> i had no clue how it works) to create a "mini"-debian distribution (with 
> aprox 170MB)
> b) removed all unused packages (exim4, cron, logrotate, ...)
> c) removed /usr/shar/doc
> d) installed busybox-cvs static
> e) removed packages (and libs) which were replacable by busybox

Nice.  But how did you create the filesystem?  Using the UML instructions?  
Maybe I'll try this.


> for now it is small enough beacause, in the final stage, i want to boot my 
> embedded system over NFS. my board has 128MB RAM, which is enough for the 
> kernel and my applications.

Interesting.  Marc recommends NFS, but my nodes will have to be autonomous, so 
must have all on flash.  Plan to use CRam, for compression.

 
> next steps ( not done so far, help/info appreciated):
> * booting my prototyp from compact flash (over ide)

Since you'd created your filesystem in an image, it would just take installing 
Grub into the bootblock, and burning the image to CF flash with something 
like:
dd if={myimage} of=/dev/hde
Or if an MoD in the second IDE as slave:
dd if={myimage} of=/dev/hdd

Be sure to shut down any emu's and umount it first though.


> * createding/tweaking the kernel for the target platform

I suspicion the CPU datasheet will help with this, but the main setting is 
"Processor type and features"


> * installing this kernel on the root filesystem

Haven't you already done this, to have booted?  It would be mainly creating 
a /usr/src symlink to outside your UML, putting the kernel source there, and 
compiling -inside- your UML.


> Btw my HW board is a Geode SP4GX00 from National Semiconductors with a Geode 
> GX1 processor, BIOS is National's XpressROM which doesn't allow booting from 
> network (NIC is NSC DP83815).

Maybe use bootf? (or bootp, or whatever the kids call it nowadays)

Best,

Carl Cook



Reply to: