View previous topic :: View next topic |
Author |
Message |
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Wed Mar 01, 2006 11:50 pm Post subject: Getting My Slug Working Under Gentoo |
|
|
For the past couple of hours I have been trying to get my linksys nslu2 'slug' working under gentoo. I have been following the wiki, but it is at best vague. Here is what I am stuck on:
1) What do I do about dhcpcd and ssh -- do I need to emerge them and add them to my default run-level or is openslug kind enough to do it for me before it loads gentoo, and for that matter how does it know to load up Gentoo?
2) fstab, what do I need to put here, can someone who has got it working on a slug post their fstab as I have no idea what devices are on there (RAM, real roots etc) and would like some help with it. My only drive is /dev/sda1 (reiserfs).
3) When it says copy across the kernel modules, does it really mean do:
Code: |
cp -R /lib/modules/2.6.12.2 /mnt/gentoo/lib/modules
|
Or do I need to do something else with it for it to work?
Thanks for all of your help. |
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Thu Mar 02, 2006 12:10 am Post subject: |
|
|
already read this one here? (german) embedded-gentoo auf einer Linksys NSLU2
translated into english (well sort of ) embedded gentoo on a Linksys NSLU2 _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Thu Mar 02, 2006 6:08 pm Post subject: |
|
|
I have got to the point where it starts going on about some cross-compilation junk, which google for some reason does not bother to translate. I have no idea why cross compiling is needed, or what I need to actually do. |
|
Back to top |
|
|
+O! n00b
Joined: 20 Jun 2004 Posts: 40 Location: Belgium
|
Posted: Fri Mar 03, 2006 12:24 am Post subject: |
|
|
You don't really need cross-compilation. You can compile everything nativly on the slug. Just takes longer. MUCH longer ...
I found 3 ways of putting gentoo on my slugs (none worked until now ) :
1: The german instructions : I tried these because they also explained how to set up a cross-compilation environment. This is rather complicated, and I screwed up, the slug didn't seem to boot. I didn't feel like doing the whole thing all over again, so I tried the wiki method.
2: The wiki method : Much easier and it leaves your openslug on the slug which is really handy if you screwed up you're gentoo install : The slug either automatically reboots to openslug or you disconnect the hard disk before you boot and reconnect after openslug has booted. Chroot to the gentoo install and repair whatever need repairing ...
Disadvantage of this method : you depend on the openslug kernel, no sources provided to recompile your own.
3: Download the tarball from squaker (http://www.daniel.jp/slug/armeb-softfloat-linux-gnu-stage3.tar.bz2), mount /dev/sda1 /mnt/gentoo, untar the tarball in /mnt/gentoo, folow the instruction in the wiki on how to make the LEDs work, flash the slug with the kernel image in the /boot dir. Reboot and everything should work. This last options has the advantage of using glibc => lots of packages need this. Disadvantages : root has to be on /dev/sda1, unfortunatly this is not possible for me so I did not test this one. This method also leaves you without the openslug fall-back of the second method.
You seem to have abandoned the wiki method, but should you come back to it here are some answers to your questions :
1) dhcpcd : you need to emerge this and add it to your default run level
ssh : rc-update add dropbear default (dropbear is the ssh server)
how does the openslug now that it should load gentoo : ssh into openslug and excute this command :
Code: | turnup disk /dev/sda1 |
2) my fstab :
Code: | # /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# See the manpage fstab(5) for more information.
#
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#/dev/BOOT /boot ext2 noauto,noatime 1 2
/dev/sda2 / ext2 defaults 1 1
/dev/sda3 none swap sw 0 0
/dev/sda1 /mnt/Data vfat noauto,noatime 1 2
#/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# NOTE: The next line is critical for boot!
proc /proc proc defaults 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
|
3) looks ok.
This is what I tried until now :
I first went for the German instructions, but couldn't ssh into my slug afterwards and it didn't seem to boot through to the hard disk. I have no serial port on my slug (yet) so I have absolutly no idea where it went wrong. I didn't feel like starting all over so I abandoned this method and followed the wiki.
This worked fine as long as I stayed in the chrooted environment. After I rebooting into gentoo I can use the slug for a couple of minutes and then it hangs. No reaction on pings, ssh doesn't work anymore, no reaction if you push the power button ... No idea why. There are no indications in the log files (and if there were any fsck probably erased them anyway) ... Anybody any idea how to tacle this ???
After that I had a look at the tarball from squaker and I realized that this would not work for me unless I recompile the kernel : there's an "root=/dev/sda1" option in his kernel config. But then I would need the exact same sources with the same patches.
So back to method 2 : If you work chrooted (booted to openslug) you work with the dropbear from openslug, when booted to gentoo you use the dropbear from gentoo. So I decided to try if I have the same problem with openssh. It's nativly compiling now, so I gues that by tomorrow mornig I should be able to give it a try. I'll let you know if it works.
Hope this helps some ...
Grtz, Positivo _________________ Nature doesn't need to be improved,
it need's respect ... |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sat Mar 04, 2006 12:12 am Post subject: |
|
|
I have followed the wiki method, which when combined with the opendebianslug install guide works quite well. It boots, but the problem is that I can not ssh into it. I added dropbear to my default run-level, however it does not seem to do anything. I am quite sure that it boots off of my hard disk (I hear the noise) and it does get an IP. Just SSH that is causing me problems. I will try out open-ssh to see if it makes a difference. |
|
Back to top |
|
|
+O! n00b
Joined: 20 Jun 2004 Posts: 40 Location: Belgium
|
Posted: Sat Mar 04, 2006 3:24 pm Post subject: |
|
|
I have a working set up now (with dropbear).
Apparently dhcpd was causing my slug to hang after a couple of minutes. No idea why ... But I replaced with it with udhcp and now it's working like a charm.
I wish I could tar it up and share it. That way you could give it a try and perhaps compare with your own install. But I have only 50 Megs of webspace ...
Grtz, +O! _________________ Nature doesn't need to be improved,
it need's respect ...
Last edited by +O! on Sat Mar 04, 2006 6:37 pm; edited 1 time in total |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sat Mar 04, 2006 3:42 pm Post subject: |
|
|
I have got my one working! Turns out that it was the pre-up script in /etc/conf.d/net which I added to keep my mac address fixed. I am currently compiling a load of stuff, and while it is not all that stable (suddenly will stop responding for some reason).
Taring it up is the best thing that I have read all day. With a small shell-script it would be possible to ask a few questions about hostnames etc (the normal stuff) and then give them a working install. All that they would need to do would be to edit a couple of files and reboot.
Currently I am looking into getting distcc to work (I have never used it before), pity that the install guide does not have a section on it, as most people are not able to wait for their slug to compile everything. |
|
Back to top |
|
|
squawker n00b
Joined: 16 Mar 2004 Posts: 43 Location: Lommedalen, Norway
|
Posted: Sat Mar 04, 2006 5:22 pm Post subject: |
|
|
+O! wrote: |
After that I had a look at the tarball from squaker and I realized that this would not work for me unless I recompile the kernel : there's an "root=/dev/sda1" option in his kernel config. But then I would need the exact same sources with the same patches.
|
Hi there,
I started with vanilla 2.6.14.3.
Then I added the same patches as Chilla, minus the anonymizer patch which I couldn't see a reason for.
Then I made a diff between vanilla 2.6.14.3 and vanilla 2.6.14.7 (made by unpacking both and the running diff -Nur on the two trees) and added that to my patched slug sources.
I guess I can tarball that if you like.
Personally I'm not going to build a kernel image to boot off /dev/mtdblockX because I don't see the point in it. It takes less than 5 minute to flash the OpenSlug kernel+rootfs if I ever want to go back to that. And any Gentoo Slug I'm ever gonna boot is gonna have its root fs on /dev/sda1.
In general I'm VERY happy with these little mini-servers of mine - only disappointment is that apache2+mod_php is a too heavy for them. 32MB is just way too little memory for that kind of shenanigans. So I guess I'll have to put the RoundCube and Joomla stuff on a more traditional server - no real surprises there |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sat Mar 04, 2006 5:30 pm Post subject: |
|
|
Anyone here overclocked their slug yet? I am so tempted to go and do so, an extra 133Mhz seems well wroth it to me, which will hopefully allow it to be used as a server. |
|
Back to top |
|
|
squawker n00b
Joined: 16 Mar 2004 Posts: 43 Location: Lommedalen, Norway
|
Posted: Sat Mar 04, 2006 5:39 pm Post subject: |
|
|
Evilguru wrote: | Anyone here overclocked their slug yet? I am so tempted to go and do so, an extra 133Mhz seems well wroth it to me, which will hopefully allow it to be used as a server. |
Just do it! I did both of mine, even before switching them on for the first time. The first one I did with a scalpel, the second one with a fine tipped soldering iron.
I also added serial port headers to them and ran cables out through new holes in the case-backplane. These connect to Nokia DLR3P cables that plug into serial ports on a handy PC. Invaluable for testing new kernels without flashing, and for getting RedBoot into upgrade mode without arp magic. |
|
Back to top |
|
|
+O! n00b
Joined: 20 Jun 2004 Posts: 40 Location: Belgium
|
Posted: Sat Mar 04, 2006 6:47 pm Post subject: |
|
|
squawker wrote: |
In general I'm VERY happy with these little mini-servers of mine - only disappointment is that apache2+mod_php is a too heavy for them. 32MB is just way too little memory for that kind of shenanigans. So I guess I'll have to put the RoundCube and Joomla stuff on a more traditional server - no real surprises there |
Did you have a look at this http://www.nslu2-linux.org/wiki/HowTo/FattenYourSlug ?
Although I have my doubts about the piggy backed solution. The battery holder is in the way and there are a lot of pins to solder together, but then again some people *did* do it ...
Evilguru, don't be afraid to overclock the slug. In fact it's not even overclocking, the processor is designed to run at 266MHz. My two slugs or @ 266MHz, I have absolutly no problems with them. I used one of them with the original firmware @ 266 just to make sure.
BTW are you running dhcpcd ? Maybe you have the same problem as I had ? My slug would also hang every now and again => emerge -C dhcpcd && emerge udhcp. I had both on my system for a while, then you can specify which one to use in /etc/conf.d/net by adding this line : modules_eth0=("udhcpc").
Having a serial port to attach a terminal would have been great to debug this. Assuming that the problem is only in the ethenet controller and the whole slug isn't hanging. One of these days I will have to add the headers.
Grtz, +O! _________________ Nature doesn't need to be improved,
it need's respect ... |
|
Back to top |
|
|
squawker n00b
Joined: 16 Mar 2004 Posts: 43 Location: Lommedalen, Norway
|
Posted: Sat Mar 04, 2006 7:32 pm Post subject: |
|
|
+O! wrote: |
Did you have a look at this http://www.nslu2-linux.org/wiki/HowTo/FattenYourSlug ?
Although I have my doubts about the piggy backed solution. The battery holder is in the way and there are a lot of pins to solder together, but then again some people *did* do it ...
|
I've looked at it. I've dug through my pile of PC133 SDRAM modules. But I've never, ever soldered an SMD device like those memory chips and I'm not sure I dare to try. I thought the piggy back solution looked good, until i realised how tiny those legs actually are. Most of my soldering work is point to point wiring of valve based amplifier circuits in the 400-500VDC range - SMD is a far cry from that!
Maybe I should break up one of those SIMMs and do some practice soldering. Apparently the technique is to just blob all the legs then pull the excess off with a solder sucker. Sounds scary!
cheers,
-Andy |
|
Back to top |
|
|
+O! n00b
Joined: 20 Jun 2004 Posts: 40 Location: Belgium
|
Posted: Sat Mar 04, 2006 9:29 pm Post subject: |
|
|
(It's bit hard to explain in English but I'll try.)
Actually, you want to draw the blob from one end to the other. If you do it right all the pins that the blob passed over will be soldered. Then you take some solder wick and remove the excess solder from the last pins with it. I woudn't try it with one of those pump like devices ! You'd risk bending the pins and then soldering becomes a lot harder.
But soldering is the easy part, desoldering is much harder. At work I have access to professional (de)soldering stations, before we had those I used to cut al te pins with a very small cutting plyer, being *very* carefull not damage the circuits. You could do that for the memory chips on the slug but obviosly not for the ones on the SIMMs.
The best advice I can give you : Don't loose your patience when doing this !
Grtz, +O! _________________ Nature doesn't need to be improved,
it need's respect ... |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sat Mar 04, 2006 10:33 pm Post subject: |
|
|
Well I have overclocked my slug and love the result! Doing an emerge -u world now as we speak.
Now, does anyone know of a light-weight version of portage? |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sun Mar 05, 2006 10:45 am Post subject: |
|
|
Whoever suggested to use udhcpc is a genius! My slug is now a lot more stable than it was with dhcpcd! Anyone feel like adding a note about it on the wiki, as two people have had trouble with dhcpcd and have fixed them by using the uchcpc module.
Thanks guys. |
|
Back to top |
|
|
opm8 n00b
Joined: 10 Sep 2003 Posts: 56
|
Posted: Wed Mar 08, 2006 3:50 am Post subject: |
|
|
Evilguru wrote: | Well I have overclocked my slug and love the result! Doing an emerge -u world now as we speak.
Now, does anyone know of a light-weight version of portage? |
Evilguru,
If you want to limit the huge number of packages in portage, do this:
1. add this to your /etc/make.conf:
Code: | RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes |
2. create yourself an /etc/portage/rsync_excludes file that looks like this:
Code: | games-*/
metadata/cache/games-*/
gnome-*/
metadata/cache/gnome-*/
kde-*/
metadata/cache/kde-*/ |
This prevents all games, gnome, and kde packages from sync'ing, saving you tons of time.
--opm8 |
|
Back to top |
|
|
Evilguru Guru
Joined: 16 Aug 2005 Posts: 390 Location: England
|
Posted: Sun Mar 19, 2006 9:35 am Post subject: |
|
|
I am now trying to have my / partition on a NFS share (like is possible with OpenDebianSlug) however for some reason my slug seems to crash at boot. I have tried installing it on the NFS share itself and copying over a fully working Gentoo-Slug install to it but get the same results every time.
It seems to boot fine, with the swap (/dev/sda2, local disk) being brought up and the LED changing from flashing amber to staying amber, at which point it just stalls there. Here are my config files:
fstab:
Code: |
192.168.0.5:/slug / nfs nolock,noatime,hard,intr,rsize=1024,wsize=1024 0 0
/dev/sda2 swap swap defaults 0 0
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs defaults 0 0
|
And on the server my /etc/exports:
Code: |
/slug 192.168.0.4(async,no_subtree_check,rw,no_root_squash)
/slug 192.168.0.6(async,no_subtree_check,rw,no_root_squash)
|
It is there twice because when I have had Gentoo on there before it has switched IP's from 192.168.0.4 in OpenSlug and then 192.168.0.6 in Gentoo (probably because I use DHCP and it is connecting and then disconnecting before it is able to re-allocate 192.168.0.4).
Can anyone help me get root working as an NFS share?
Thanks for all of your help. |
|
Back to top |
|
|
|