Home > Alix, Gentoo > Installing Gentoo on ALIX.3D3

Installing Gentoo on ALIX.3D3

When I ordered the ALIX.3D3 board I thought installing Gentoo on this should be a piece of cake, but finally there were some stumbling blocks and that’s why I want to summarize how I got gentoo running.

First of all, I recommend installing Gentoo on a normal desktop to get to know the installing process, which is a bit different from graphical installers of mainstream distros. The Gentoo Handbook is a great documentation how this done.

To install gentoo, you have to boot a minimal or “rescue” linux usually from cd/dvd. I tried to convice the bios to boot from a usb cd-rom drive, but I hadn’t any success.

So I had to prepare a USB stick to boot from. There’s a nice tool UNetbootin which automatically copies ISO images to a usbstick and makes it bootable. I tried a lot with the Linux version of it but didn’t had any success regardless of which ISO image or USB stick I took. So I booted windows and tried it with this version. I had success on the first attempt, using the install-x86-minimal.iso from Gentoo and a 3 EUR SD-card Reader with a 4 GB SDHC card in it, formatted as FAT32 as the only partition (not in superfloppy mode).

If you’ve got a booting usb stick, insert it into a USB plug of the board, attach a USB keyboard and a monitor to the VGA port. Power on and press escape to select the boot menu. There should be an option for the usb stick if everything went fine.

Now the gentoo minimal system should boot and you can proceed with the usual installing (look into Gentoo Handbook for details). The AMD Geode LX800 cpu is a i586 cpu, so you have to install a i386, i486 oder i586 stage (i686 or amd64 won’t work!). I installed a i486 stage 3 and updated later to i586.

Partitioning should follow your preferences but don’t a forget a swap partition. 256 MB of RAM is not that much and gcc will not compile without!

I took

CFLAGS="-O2 -march=i486 -pipe"

for installation as the gcc version on the stage3 archive don’t support the geode march.

The rest of the installation is business as usual. I installed gentoo-sources for a optimized kernel and took this configuration here: ALIX.3D3 kernel-2.6.29-r2 config

After finishing installation and booting with the new kernel, it’s time to update the systems to i586. For this, at first update all packages to actual version, especially gcc to version 4.3. Afterwards it’s save to change

CFLAGS="-march=geode -Os -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer"

and proceed with changing of the CHOST variable. There’s a nice tutorial here: Changing CHOST.

Now you should have a nice and optimized gentoo on your ALIX.3D3

Categories: Alix, Gentoo Tags: , ,
  1. odin
    May 9th, 2009 at 21:24 | #1

    hi dude, im in a problem with an alix 3d3 and gentoo, i have the same problems, usb-cd doesn’t work, i try unetbootin at linux, and doesn’t work, i try with unetbooting with windows and it doesn’t work neither, booting jump to a iMedia linux at mu cf card. i use a transcend cf 2Gb for unetbooting, with a transcend usb adapter, the bios order boot is removable, cdrom, hard disk.

    i read this howto with no succed, could you give me a clue about this??
    thankyou a lot

  2. May 9th, 2009 at 21:38 | #2

    First of all, BIOS boot order is not that important. Press ESC while powering up and there should appear a boot menu. If your device doesn’t show up there, it won’t boot. I tested 3 different usb sticks and only one of them worked.

    If none of yours will work, you can try it a different way. Insert the CF card on your desktop into a usb cardreader or into a IDE-CF adapter. Boot from the install-x86-minimal CD (remember to download a i386,i486 or i586 version. i686 won’t work). Then install Gentoo normally on the CF and don’t forget to setup grub. grub-install scripts doesn’t worked for me (Maybe –recheck helps on your system). I had to setup manually. It’s described in the Gentoo handbook, Chapter 10.

    I installed Gentoo on a 2 GB CF at the first time. It’s possible but maybe you get problems when you have a lots of files from portage and kernel sources. You can solve this by either setting a high enough inode count when formatting the root partition (mkfs.ext3 -N number-of-inodes /dev/sdXX). I recommend 250000 inodes or more. Another solutions is to compress portage. There’s a nice article on Gentoo Wiki Archive.

  3. odin
    May 9th, 2009 at 21:56 | #3

    thank you i will try installing first into a CF

  4. May 10th, 2009 at 16:06 | #4

    You’re welcome. If your CF is a least 2048901120 Bytes large, you can try my Gentoo 2GB image. You can download it -link removed-.

    After downloading and bunzipping just copy it to your CF with dd:

    dd if=alix-2gb.img of=/dev/sdX

    where sdX is your Compact Flash device (not the partition on it!). Plug it in and boot. Root password should be alix.

  5. odin
    May 11th, 2009 at 21:42 | #5

    i install a gentoo into a usb, but you was right, no all usb works, its hard to find one, but well a kingston DT Mini works, and also i will try your image, im downloading it, i hope to finish today, really, thank you for your help

  6. odin
    May 12th, 2009 at 00:39 | #6

    hi, i download you image and then i use dd to pass it to a CF but when i mount it, fdisk -l said that has a invalid partition table. im trying to copy with cp -dpR una cf with a partition table, may be its works.

  7. May 12th, 2009 at 10:24 | #7

    You’re righy. I accidently only made an image of the partition, not the whole disk. I updated the image linked above.

  8. odin
    May 12th, 2009 at 21:26 | #8

    hi twam, finaly my alix 3d3 is running, so i have a one last question, i use debian, so emerge is a new tool for me, so, i cannot emerge anything, also if i do a make menuconfig, i get a errors, so i need update something, thankyou a lot

  9. May 13th, 2009 at 09:53 | #9

    Congratulations! Which way did you succeed?

    There’s a nice introdution to portage in the Gentoo Handbook as well. If emerge is complaining about no make.profile or something like that, theres a problem with the squashfs image of portage I mentioned in Comment #2.

    make menuconfig? You mean compiling a new kernel? I should work like

    cd /usr/src/linux
    make menuconfig
    make; make install; make modules_install
  10. odin
    May 13th, 2009 at 18:35 | #10

    well, i think with both, finally i get a usb-boot and install it, so it just custom gentoo, and also your image work too. so i have 2 details with C preprocessor sanity check when i use emerge, and eth0 is a unknwon interface i hace to use eth1, but im on the run, so, i have to read more about gentoo also

    :)

  11. May 13th, 2009 at 19:11 | #11

    If eth0 is unknown (on my image), this because udev wants to keep the device name for each MAC address. Just delete the line with eth0 and eth1 in /etc/udev/rules.d/70-persistent-net.rules and reboot.

  12. odin
    May 13th, 2009 at 20:37 | #12

    ok, i got it, it was a CF geometri error, i install it in a transcend 2 Gb CF, so y change it into a pcengines CF, and the geometri was causing a ext3 error corrupt, so it was the problem, so, until now i don’t get it clearly why.

    so this is a resume

    *usb-live was a kingston data travell
    *i install it by unetbootin on debian lenny
    *alix bios take it without problem
    *i install gentoo into a CF transcend 2gb 133x and don’t work
    *i use you image into a CF transcend 2 gb 133x and work with errors
    *i install gentoo into a CF buy it at pcengines (without brand) and works,
    *also your image works pretty nice

    so check your cf compatibility

    thank you a lot :)

  13. May 22nd, 2009 at 19:44 | #13

    I would heavily discourage converting a Geode to i586 CHOST.
    While the Geode LX does have all documented i586 and i686 instructions (I believe some undocumented i686 instructions get used by gcc/glibc on i686 CHOST, hence i686 is not for geode), its CPU is more like a i486 as far as instruction scheduling and times go. While -march=geode will mitigate most of that, as the implied -mtune=geode will let gcc know exact instruction costs based on gcc/config/i386/geode.md in gcc sources, glibc will still be using optimized routines for i586 (from sysdeps/i386/i586 in glibc sources), which are much slower on a Geode than the i486 versions. At least i586 being worse than i486 for some reasons is what the consensus is amongst the technical experts of the GeodeLX CPU (including now disbanded AMD Geode technical team, iirc), the details are what I have figured are probably the reasons.
    Note that for glibc there’s actually code in http://dev.laptop.org/git/geode-perf/ that implements geode specific optimized routines for even more gains, but the work on those seems to have ceased before they got implemented to upstream glibc. I’ve been meaning to test those, but haven’t gotten that far yet. In there are also highly technical explanations and documentation of the work and testing that had been done. Too bad they didn’t get them to glibc proper.

    As for anecdotal proof of why Gentoo is better on a GeodeLX, once I was implementing some simple thing based on GGI on top of lxfb framebuffer that simply showed a few numbers across the whole resolution that had to be updated every second and with debians glibc (I believe that was i386, but maybe i586, whatever Lenny had) caused the updating to blink unbearably, the memcpy or something was just too slow I figured in the end. As soon as I replaced libc.so.6 with one from a Gentoo -march=geode rootfs, it stopped being a problem at all :) I did not take the find out if it was glibc optimized memcpy routines differences or simply the -march or CHOST difference in that specific case though

    Maybe we should have a chat about Gentoo and linux on Geode on IRC or something, my nickname is “leio” in FreeNode.

  14. May 22nd, 2009 at 19:48 | #14

    Oh and as a disclaimer or something, using the correct -march or CHOST or optimized Geode glibc routines doesn’t mean it will be much more snappy than with some other choices, it just means that in some (not so often) cases where the bottleneck is something that would benefit from better instruction scheduling and so on it gets noticeably better. In the real world with your average application often it doesn’t make all that much of a difference, but who cares, we have Gentoo, we have the possibility to add that extra 1-3% oomph when the real gain is the controllability of USE flags :)

  15. May 22nd, 2009 at 20:52 | #15

    Thanks a lot for those very clarifying explanations. Changing to i586 CHOST was a spontaneous idea, because I just thought that i586 would be more adequate for the Geode LX CPU. Do you know any benchmarks who could measure the difference to i486 seriously?

  16. June 4th, 2009 at 11:52 | #16

    Hello and thank you for this wonderful blog of yours. I’ve bought an ALIX 3D3 a few days ago and installed Debian Lenny (i386-i486) on Apacer 4GB flash stick. There seems to be some sort of bug in the bootloader on in the kernel – it refuses to boot without a monitor attached to the VGA port. It just freezes on “Detecting EDD” or something like that, just after “Starting up…”. After I reattach the monitor it hangs like that for about 3-4 minutes and resumes normal boot, without a monitor it doesn’t boot at all. Currently I’m building the newest kernel (2.6.29.4) from kernel.org with some customisations on the config to see if it’ll work. Is this a correct approach or should I patch the bios with the beta version from the pc-engines page (and there are alix0.bin and alix2.bin – which one?)
    Best Regards, Dimitar.

  17. June 4th, 2009 at 12:17 | #17

    I installed the BETA bios (alix2.bin) from the PC Engines webpage, but I don’t think this is the cause of the problem.

    Trying a new kernel is the first I would have done. You can use my .config I linked in the article. This should boot fine.

  18. June 4th, 2009 at 15:23 | #18

    Hello again. I’ve compiled a 2.6.29.4 kernel with some modifications to the .config and it works like a charm now. Thank you very much, as the info on your blog was very helpful.

  19. June 13th, 2009 at 06:44 | #19

    What modifications to the config do you need to make when compiling a kernel? I have tried every distro, and Gentoo and DSL are the only two i’ve found that don’t have a 30minute or so hang during boot. Gentoo, I’ve found, is too slow for this CPU since you have to compile everything from source. Any other distros that are known to work?

  20. June 13th, 2009 at 12:11 | #20

    I haven’t tried any other distro than Gentoo, but actually every one should work. If you have problems with kernel you can upgrade it on any distro. Download the sources from kernel.org and compile it by yourself. A suitable config for the ALIX.3D3 can be found here. Copy it to /usr/src/linux/.config (if you extracted your kernel to /usr/src/linux) and run

    make; make install; make modules_install

    Maybe you have to adjust your boot manager afterwards.

  21. tymm
    July 10th, 2009 at 21:12 | #21

    Hello.
    My Alix3d3 just arrived and I tried to boot minimal gentoo from a shcd card.
    The shcd card was detected successfully and I could see the grub menu, but when I try to boot gentoo it stops doing anything after loading /gentoo.efimg.mountpoint/gentoo and /gentoo.efimg.mountpoint/gentoo.igz.
    I tried it also with grml, but same result.
    Are there any boot options I have to use?

  22. July 10th, 2009 at 21:16 | #22

    I didn’t have to set any boot options. EFI sounds a little strange to me, as this board has no EFI firmware. Maybe you picked a wrong image. Also I had problems when using the Linux version of Unetbootin, maybe you should try the Windows version (if you used Unetbootin to put the image on SDHC).

  23. podlus
    July 13th, 2009 at 17:03 | #23

    twam :
    If eth0 is unknown (on my image), this because udev wants to keep the device name for each MAC address. Just delete the line with eth0 and eth1 in /etc/udev/rules.d/70-persistent-net.rules and reboot.

    Unfortunately it’s still doesn’t work for me.
    I erased two lines in 70-persistent-net.rules , I even removed this file, still during booting I get dhclient error:

    /var/log/everything/current
    Jun 30 17:22:22 [kernel] [ 10.633258] eth0: link up, 100Mbps, full-duplex, lpa 0×45E1
    Jun 30 17:22:23 [dhclient] DHCPREQUEST on eth0 to 255.255.255.255 port 67
    Jun 30 17:22:27 [dhclient] DHCPREQUEST on eth0 to 255.255.255.255 port 67
    – Last output repeated twice -
    Jun 30 17:22:37 [dhclient] DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
    Jun 30 17:22:45 [dhclient] DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
    – Last output repeated twice -
    Jun 30 17:23:13 [dhclient] DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19
    Jun 30 17:23:32 [dhclient] DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
    Jun 30 17:23:38 [dhclient] No DHCPOFFERS received.
    Jun 30 17:23:38 [dhclient] Trying recorded lease 192.168.23.88
    Jun 30 17:23:41 [/etc/init.d/net.eth0] start-stop-daemon: failed to start `/sbin/dhclient’
    Jun 30 17:23:41 [/etc/init.d/net.eth0] ERROR: net.eth0 failed to start
    Jun 30 17:23:41 [/etc/init.d/ntp-client] ERROR: cannot start ntp-client as net.eth0 would not start

  24. tymm
    July 14th, 2009 at 17:28 | #24

    @twam
    It worked for me with slax 6.1.1 on an usb stick.

  25. podlus
    July 14th, 2009 at 23:40 | #25

    No worries guys, I’ll try to install it by myself, I need to find a time for it. Complaining it’s just my second nature ;-) Anyway, thanks for .config & everything :)

  26. fdnull
    August 10th, 2009 at 13:58 | #26

    Hi,

    Booting an alix3d3 from usb cdrom is simple, just press the pause key right after powerup and wait a minute (or two), until the cdrom has successfully detected a cd. After that, press ESC, until the boot-menu is shown. Select the cdrom there.

    The bios is a bit impatient on usb cdroms, so you have to increase the wait-time by using pause.

    Cheers

  27. locus
    September 7th, 2009 at 23:46 | #27

    @tymm

    i had the same errors with the Unetbootin running under Linux.. when i tried with puppylinux it worked. the sources for gentoo were the ones listed as: 2008-live

    twam, you did you removed your image? is there a chance to have it back? As this blog entry suggets, its all about gentoo on the alix3d3, i dont want to have something else!

    :)

    thanks!

  28. September 8th, 2009 at 04:23 | #28

    @locus
    Yes, I removed the image as it took too much space on my small webserver. :( I can make you and upload you a 4 GB version as soon as I have access to my board (2 weeks ETA) if you like

  29. locus
    October 16th, 2009 at 14:24 | #29

    yes, i will be very grateful if you can share it again, Im running a debootsraped debian in my alix and will like to compare with gentoo and hopefully migrate it following your advices here in this post.

  30. locus
    October 17th, 2009 at 21:36 | #30

    twan, hi again, nevermind, i had some spare time and went through the whole process.. right now im choosing a wm. I will try to upload the base image on my site so other can get the gentoo taste on the alix board with a simple dd clone command.

  31. October 19th, 2009 at 14:59 | #31

    Nice! You can post your link here if you like, so other people will benefit from it.

  32. lucas
    October 20th, 2009 at 00:27 | #32

    Hi lads,

    have a quick question about Alix3d3 performance with DivX files. I tried to run some videos using Mplayer on TinyCoreLinux and that was not too excitement, pretty slow, even when I played a little with settings. Is Gentoo doin any better? Did anyone tried?

    Cheers :-)
    Lucas

  33. lucas
    October 20th, 2009 at 01:11 | #33

    My fault guys, it works perfect. Sorry to bother you ;)

  34. marxin
    November 13th, 2009 at 18:46 | #34

    Hello, you articles connecte with gentoo on Alix PC are really perfect (LEDs & CPU Temp sensor are best). Please could you help me with my problem, I have Alix PC 3d2 which is different from your version in not having board clock. So after reboot time is 1970-01-01 and my problem is to force running ntp-client before checkfs/checkroot which fails because my partition has been mounted in a future ! I tried to specify that ntp-client will start in boot runlevel and before checkfs, but everytime checkfs is the first in boot section ?

    Thank you for your ideas ;) marxin

  35. November 13th, 2009 at 18:57 | #35

    I’m sorry that haven’t got a solution right off the top of my head. If you were able to put ntp-client in front of this would need a running network, and the running network would need net.eth0 which depends on udev. Udev needs write support on the device for creating its permanent rules… (No guarantee on that dependecies)

    Maybe the easiest solution would to disable the filesystems checks at all and do them by hand.

  1. May 25th, 2009 at 20:27 | #1