Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HowTo] gentoo linux on a compact flash card (chroot-build!)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
preacher
n00b
n00b


Joined: 09 Jan 2004
Posts: 55
Location: Göteborg, Sweden

PostPosted: Thu Feb 15, 2007 8:24 am    Post subject: Reply with quote

Ok, I managed to get grub working (see my earlier post). The problem was in the bios, once I disabled the SATA-controller it worked like a charm. I will try some different SATA-settings to see if I can't get it to work with both IDE and SATA, but that's a later problem.

My problem right now is that I feel that the boot is too slow! What takes a lot of time (over one minute) is deploying boot.tgz to the CF-card.
Compressed, my image is 97mb which I feel is pretty good since it houses a mythtv-install complete with some emulators and other stuff.

What, if anything, can I do to decrease this bootup-time? I think I got my system pretty trimmed down to size already.

My CF-card is TwinMOS Compact Flash Card 512MB, 140X, Type I, Ultra-X, 16.2/21MB Write/read
Back to top
View user's profile Send private message
mrdevis
n00b
n00b


Joined: 02 Dec 2006
Posts: 8

PostPosted: Wed Mar 14, 2007 8:48 pm    Post subject: cf card boots, but no alsa Reply with quote

Hi, while I got the card booting fine with this method, I ran into a problem with alsa sound.
As alsaconf detects the built in card allright (I think: it detects an via82xx, where the nano-itx board documentation
says it has put a VIA VT1617A 6 channel AC'97 on it) it gives an

*updating modules.dep ...
FATAL: Could not open '/System.map': No such file or directory

but loads the driver afterwards without a problem..

If I want to open alsamixer I get a:
"ALSA lib control.c:910:(snd_ctl_open_failed for default: No such file or directory)"

I'd be very happy with some help,

Thanks, Jeroen
Back to top
View user's profile Send private message
awhisp
n00b
n00b


Joined: 26 Mar 2007
Posts: 1

PostPosted: Mon Mar 26, 2007 8:18 pm    Post subject: Reply with quote

Hello.

When I tried this, I got to the part where you make 'build' and 'geninc'. When I attempted to issue build, I get this error:

linuxlaptop base # ./build
[ >> ] generating include-list...
[ >> ] building root.tgz...
./build: line 26: 28691 Segmentation fault tar czpf ../target/root.tgz -T $INCLUDES
[ >> ] building exportable tarballs...
tar: root.tgz: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
[ ok ] /etc built!


Any clue as to what I may have done wrong to cause this? I tried going back through the steps and still had no clue.
Back to top
View user's profile Send private message
mrdevis
n00b
n00b


Joined: 02 Dec 2006
Posts: 8

PostPosted: Mon Mar 26, 2007 11:31 pm    Post subject: Reply with quote

Ok, found the trouble, apparently alsa needs /usr/share/alsa with a couple files in them (alsa.conf etc). With these included in the image, I can easily start alsamixer etc. A very low level sound is leaving the sound card though. There seems to be some coherence with some soft like orpheus playing, (there is a difference between it playing and not playing on headphones), but I didn-t manage to get some meaningful sound out of the onboard soundchip.
Luckily I had a M-Audio USB Quattro lying around, and was able to get sound out of that! A sound producing mobo without moving parts. I like it!!

Anybody any experience with sound chips (via82xx) on a Nano Itx board??

Cheers, Jeroen
Back to top
View user's profile Send private message
denudar
n00b
n00b


Joined: 30 Aug 2007
Posts: 12

PostPosted: Thu Aug 30, 2007 8:51 pm    Post subject: hello there Reply with quote

I've read this thread with much interest because it seems to be the best solution for me.
I will try to do what is says.. I need a minimal linux system capable of running a python app, made with pygame.
I tried using puppy linux, a very strange distro but with some great ideas on compacting things up, it didn't work for me, it seems that pup is allergic to snakes :D.
So now i have to build a custom/uClib gentoo with X, python, and pygame... (+psycho?) and a little room for my app. (not much).. and it needs to be done fast, really fast.
The SBC guest for this os is an ARBOR EmCORE n-511. with about 160 RAM and a 128MB CF.
Is this possible?
Could somebody give me a little help on this matter or an estimation of the final size with the things I mentioned before installed?

I thank you nice people in anticipation :)
_________________
:D didn't think of something.. yet..
Back to top
View user's profile Send private message
hoyanf
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2005
Posts: 80
Location: Malaysia

PostPosted: Sat Sep 01, 2007 1:57 am    Post subject: Reply with quote

I was wondering why cant we just emerge baselayout and busybox to it ??

Can we do this :-

USE="-* make-symlinks" \
FEATURES="nodoc noinfo noman" \
CFLAGS="-Os -march=i586 -fomit-frame-pointer -pipe" \
CXXFLAGS="-Os -march=i586 -fomit-frame-pointer -pipe" \
ROOT="/mnt/initrd" \
emerge baselayout busybox --nodeps

rm -fr var/lib/portage var/cache/edb /var/db/pkg

Using only mere 1.6M

Can it be used ??


Thanks
_________________
WorkPC -> Xeon x3440 | Gigabyte P55-UD6 | 16GB DDR3 | HDD1 - 600GB | HDD2 - 500 GB | HDD3 - 1TB
HomePC -> Xeon x3320 | Gigabyte GA-EP45-UD3P | 8GB DDR2 | HDD1 - 500GB | HDD2 - 1TB
Back to top
View user's profile Send private message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Tue Jan 08, 2008 6:03 pm    Post subject: Reply with quote

Hi! I just found this today, and I'm trying to do something similar. In my case, my kernel won't find my CF card until the root FS is mounted... but the root FS is on my CF card. I can get an operable system by network booting (and then I can see my CF card), but I can't go straight from the kernel to the root. A bit of this is covered in this other thread.

In my case, I have a 20 MB IDE flash module on /dev/hda1 (for booting purposes), and my CF card's root partition is on /dev/hde3. I have /dev/hde1 set up as a 1G swap partition for hibernation purposes (not to be used as standard swap), and a 512M swap partition for similar on my video card (though I'm not sure that video hibernation is supportable). The kernel loads fine, and I have an initrd that begins working... but /dev/hde doesn't exist. If I network boot with a different root partition (same kernel), /dev/hde exists again. Not sure what the issue here is... :(

Also, have you considered doing a unionfs rather than moving a whole image to tmpfs? You can keep /etc writable, then union mount the rest on tmpfs. That way, all reads will be from flash rather than RAM, and writes will go to RAM (and can be read back). Doesn't use up all your RAM either. I'm looking at a similar setup for my system.
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
korvend
n00b
n00b


Joined: 06 Mar 2008
Posts: 1

PostPosted: Thu Mar 06, 2008 6:19 pm    Post subject: Reply with quote

I'm also very interested in this subject. I have a low power 45W Sempron EE 1100 with two 500 Gb HD and a CF reader with the corresponding CF card (Sandisk with 22 m/s speed :lol: ) and I'm trying to use it in this manner, a little striped - only binary - gentoo squashfs root on the CF with the corresponding extlinux or syslinux to boot. The system will boot from the CF to a ramdisk and then use the hard disks as a storage medium, like a NAS with RAID. I'm trying a scratch build now, but I've read about GNAP and catalyst too.(In fact I have a liveCF-stage1.spec and liveCF-stage2.spec file that generate a liveCF-amd64.iso), but I want to learn how-to do it on my way. :wink:

I'm not very sure about how-to set boot parameters to the kernel I've compiled, has anyone tried something similar? or booting from a usb pendrive? I say this because I'm missing something. If the root fs is on the USB or CF, how does the kernel mount it?... I'm thinking of some rootdelay=20... but I'm not sure... ¿any suggestion? tonight I'm going to try the rootdelay stuff...

Sorry my poor english from Barcelona
Back to top
View user's profile Send private message
Ulrar
n00b
n00b


Joined: 25 May 2006
Posts: 74

PostPosted: Fri Jun 27, 2008 9:14 am    Post subject: Reply with quote

Hi !

I'm very interesting by this !
Oh, sorry for my English, I'm French ^^ .

I have a via EPIA pico ITX motherboard, and a CF -> IDE adapter.

I followed this tutorial and all steps are OK.
But now, i put my CF on adapter, booting ...
"NO SYSTEM DISK FOUND. INSERT A SYSTEM DISK AND PRESS ENTER".
Grub install problem ?

I just replace hdc by sdb in scripts, and the cart have all install on.

Don't understand where is the problem :-( .

Anyone can help me ?


PS : three weeks ago, i've tried to install, on an other CF a gentoo with the graphic installer on the livecd.
It work but grub was veryyyyyyy slowwwwwwwww.
After this, i try with a CF hight speed, but livecd don't detect it.
But the BIOS detect a SONY CF with no problem.


Thanks for possible helper !


EDIT :
i think is a grub install problem, so, i tried :
grub-install --root-directory=/mnt/base/boot /dev/sdb

and it say :

/sbin/grub-install: line 355: 2289 Floating point exception$grub_shell --batch $no_floppy --device-map=$device_map > $log_file <<EOF
quit
EOF

sed: can't read /mnt/base/boot/boot/grub/device.map: No such file or directory
grep: /mnt/base/boot/boot/grub/device.map: No such file or directory
/dev/sdb does not have any corresponding BIOS drive.
Back to top
View user's profile Send private message
thegid
n00b
n00b


Joined: 02 Jul 2008
Posts: 3

PostPosted: Wed Jul 02, 2008 2:10 am    Post subject: Reply with quote

Hi

Hope some folks are still active on this thread.

This guide has been very helpful to me. I'm a newbie on setting up embedded linux systems, and its gotten me far....but not quite all the way.

I'm having problems with /sbin/init.

I've got a gentoo 2007.0 distribution, installed OK on the intel MB, running out of sata harddrive. I have a 64MB flash basically booting (split as two 32MB partitions. The kernel comes up, and hands off to the /linuxrc script OK.

In the linuxrc script I've modified it a bit, so I can check the environment before it crashes.

I've modified it so that after the cd /new, I just drop to the /bin/sh, so I can ls, cd etc.
....
# pivot root and start real init
cd /new
pivot_root . oldroot
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
umount /oldroot/cf
umount /oldroot
exec /sbin/init ${CMDLINE}
EOF
.....


after I checked to make sure bin & sbin & etc looks fine, I did the rest of the commands manually.

At first I got a bunch of "agetty" issues (respawing too fast). I went ahead and modified the /etc/iniitab to comment out the tty1...tty6 configurations. This helped, and now I get further.

The init script gives me the following message:

INIT: version 2.86 booting
INIT: cannot execute "/sbin/rc"
INIT: cannot execute "/sbin/rc"
INIT: Entering runlevel: 3
INIT: cannot execute "/sbin/rc"
INIT: no more processes left at this runlevel

then the system just sits there.

I did a bunch of searching on the Internet, but couldnt find any reference that seems relevant. Hopefull one you you all has faced this during your trials and tribulations.

PLEASE HELP...I'm at my wits end.

Thanks in advance....

TheGid








I've followed the guide to the point
Back to top
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Sat Aug 02, 2008 11:07 am    Post subject: Reply with quote

Quote:
EDIT :
i think is a grub install problem, so, i tried :
grub-install --root-directory=/mnt/base/boot /dev/sdb

and it say :

/sbin/grub-install: line 355: 2289 Floating point exception$grub_shell --batch $no_floppy --device-map=$device_map > $log_file <<EOF
quit
EOF


I guess grub is miscompiled or not adapted to the CPU. The grub ebuild doesn't use CFLAGS, and some VIA CPUs aren't completely i686 and need -march=c3 or something like that. You can try the USE flag "custom-cflags".

You can also try to reinstall with CHOST="i386-pc-linux-gnu".

Please be aware that my diagnosis may be wrong, and the solutions may not work and be a waste of time.
Back to top
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Sat Aug 02, 2008 11:10 am    Post subject: Reply with quote

thegid wrote:

INIT: version 2.86 booting
INIT: cannot execute "/sbin/rc"
INIT: cannot execute "/sbin/rc"
INIT: Entering runlevel: 3
INIT: cannot execute "/sbin/rc"
INIT: no more processes left at this runlevel


the next step is to find out what's wrong with /sbin/rc, is it missing, not executable, what does it do?
Code:
ls -l /sbin/rc
Back to top
View user's profile Send private message
thegid
n00b
n00b


Joined: 02 Jul 2008
Posts: 3

PostPosted: Mon Sep 15, 2008 1:41 am    Post subject: Reply with quote

Thanks jamapii for your response.

I've gotten a lot further now....As I recall the previous issue was related to a /lib file. I can't quite recall what it was at this time. Anyhow I've got the flash booting now and logging in.

The new problem I have is with getting network services up. Basically once the flash give the login prompt, and I type in the user & password, everything looks fine, except that net.eth0 hasn't run.

If I manually type in "/etc/runlevels/boot/net.eth0 start" it brings up eth0 and assigns it the right static ip address and everything.

If I add the above line to the bashrc file at /etc/bash/bashrc, it brings up the ethernet interface when I log in.

What I need is that even if I haven't logged in at the embedded box, the network is up so I can do a remote login from the network to work with the equipment.

I also need various processes starting up so the equipment can continue operation even though I haven't logged in.

Hope someone can shed some light.

Thanks.... theGid
Back to top
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Tue Sep 16, 2008 9:29 pm    Post subject: Reply with quote

thegid wrote:
...
I also need various processes starting up so the equipment can continue operation even though I haven't logged in.


It looks like the boot runlevel is not coming up correctly, the default runlevel not at all I guess. I didn't read about the details of how to eliminate CF card writes, maybe it's a side effect.

I think /etc/inittab should point a way into the boot scripts, then you can find a place for the commands to run your services.

I'm just setting up a CF card based box with a standard gentoo, no special tweaks, no swap, tmpfs where possible, see also from my /etc/conf.d/rc
Code:
svcmount="yes"
svcfstype="tmpfs"


rsyslog logs to another box, but I don't try to eliminate writes completely.
Back to top
View user's profile Send private message
MageSlayer
Apprentice
Apprentice


Joined: 26 Jul 2007
Posts: 252
Location: Ukraine

PostPosted: Wed Sep 17, 2008 8:42 am    Post subject: Reply with quote

Quite interesting HOWTO.

But I have a question - what if I want to "build" flash system, using (copying) my current system files and not building (using gcc and others) anything?

AFAIK, emerge and paludis know very well where the emerged/built files are, so why rebuilding? Just make a list of packages needed and query your package manager to give you the list files. I think plain bash script will be doing well.

Am I right? Are there any difficulties with this approach? Can "host machine" use-flags be a stopping issue?

Do we have any profiles to building on gentoo?
make.conf is global, so I'd like to have to "local" build profiles.

P.S. You see I'm not trying to get the least size possible, but to be enable to build customized live-cd as quickly as possible.

Thanks.
Back to top
View user's profile Send private message
thegid
n00b
n00b


Joined: 02 Jul 2008
Posts: 3

PostPosted: Fri Sep 19, 2008 1:40 am    Post subject: Reply with quote

jamapii et. al.

I was able to get the eth0 initializing up by modifying the /etc/bash/bashrc file and adding the "/etc/runlevels/default/net.eth0 start" command in the script.

Now it gets ethernet up and running ok, but unfortunately only once I log in.

I'd like to use it for remote work, and simply just turn on the machine and then log in from another machine remotely. So unfortunateily I need the box to comeup by default as soon as you power it up (ie boot level). I've got the net.eth0 file in the /etc/runlevels/boot directory (softlink), but it doesn't start it up during a bootup.

When I go to check my runlevel it comes back with "unknown". If I type in "telinit 3" it seems to take it and doesn't give me a message, but the runlevel still remains at "unknown". If I type in "telinit 5" it comes back with "INIT: Switching to Runlevel: 5". If I type in runlevel, it still gives me "unknown".

For some reason is looks like it doesn't run the scripts in the /etc/runlevels/boot or .../default directories.

Everything else seems to be working fine. Anybody have any ideas on how I can chase this ?

Thanks for your time and help.....

...TheGid
Back to top
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Sat Oct 04, 2008 11:57 am    Post subject: Reply with quote

Looks weird, your default runlevel doesn't seem to come up.

What's in your /etc/inittab?

As a workaround, if all else fails, you can put all the services you need in the boot runlevel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum