Author Topic: Linux from an SD card?  (Read 17533 times)

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #15 on: July 23, 2010, 11:54:47 AM »
Yeah, gentoo seemed to have no problems with my computer. Also, apparently the Gparted live CD is also based on debian.

I might try knoppix a bit later today, after my class.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #16 on: July 23, 2010, 05:20:36 PM »
If Gentoo picked everything up without a hitch, it might be best to just bite the bullet and download the LiveDVD.

That said, I know that the driver support in Gparted's LiveCD isn't all that great.  I know it has absolutely zero support for any RAID configuration and its SATA support was surprisingly limited.  I kinda figured that it would have improved in the past, oh, two years, though.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #17 on: July 23, 2010, 05:24:46 PM »
I'm in the middle of (Re-)downloading Knoppix.

The fucking thing downloaded to nearly complete (said 0 seconds left, 689/689mb) and then sat there and never finished. I checked my md5, and it was the same, but when I booted it, it crashed, saying something was broken.

Also, why does it take fucking FOREVER to shut vista down? I don't even have all that many things running.

EDIT: So I'm running knoppix fine right now. Just blasted the 2 partitions that toshiba used to "build" my windows install when I first turned the laptop on. They really weren't useful any more anyway. So I get a linux install, without really having to deal with resizing my main partition. I'm gonna install gentoo from here, since everything works, and I actually have a nice graphical environment :P (Compiz Fusion kicks ass!)

EDIT:
The plot thickens... I apparently can't chroot, because knoppix is x86 and my target environment is amd64 :/
Also, the reason I never tried the live DVD is: I can't burn DVDs, and a DVD is larger than 1 GB. That kinda poses a problem.
« Last Edit: July 24, 2010, 12:34:36 PM by Bobbias »
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #18 on: July 24, 2010, 06:13:26 PM »
Yeah, you can't chroot into a 64-bit environment using a 32-bit kernel with Linux.  Literally, the only platform that I know of that supports that is OS X, and it no doubt took them quite a bit of trickery to pull that off.

Besides, Gentoo is much easier to make heads or tails of if you don't mess with multilib.  Drop x64 and just get x32.

And the reason I suggested the LiveDVD was to put on your USB drive, not to burn...
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #19 on: July 24, 2010, 06:47:58 PM »
The problem being that if the LiveDVD is larger than 1 GB, I couldn't do that anyway.

But yeah, I'm trying to get 64bit gentoo on here because for once in my life I'd like to have a functioning 64bit OS on a computer with a 64bit processor. Every time I've had a computer with a 64bit processor, I've been stuck in a 32bit OS, and it's depressing, knowing that my computer could run better, if I had a 64 bit OS.

Since I couldn't chroot into it from knoppix, I switched back to the minimal gentoo CD, because I'd done what I needed gentoo for anyway (resizing partitions so I could actually get gentoo on the computer).

I'm in the middle of emerge --sync right now.

Why is multilib so bad, anyway?

Also, I can't seem to find a list of USE variables anywhere. The handbook doesn't have a list any more, and it tells me to 
Code: [Select]
less //usr/portage/profiles/use.desc but the file doesn't exist.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #20 on: July 24, 2010, 11:11:15 PM »
The problem is simply that Linux's multilib support isn't nearly as refined as Windows and OS X's system.  As long as your userland is 64-bit you're good as gold, but right when you start mixing the two and having to deal with proprietary, binary plugins and such, things get incredibly annoying.

In my 64-bit Fedora installation, Flash will simply never be stable no matter what I do.  The 64-bit version of 10.0 is unstable and breaks with certain web sides, and the 32-bit version (run with the help of nspluginwrapper) likes to crash the browser from time to time.  The fact that most package managers make it difficult or non-obvious to cross-compile (i.e. use a 32-bit browser in an otherwise 64-bit userland) doesn't help.  I've never had good luck with 64-bit Linux because there's always been the proverbial spanner stuck in the gears at some level.

For managing use flags, I recommend emerging ufed.  Just try to keep your list down as much as possible.  There are a ton of available flags, but many of them only cover specific programs.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #21 on: July 25, 2010, 12:24:40 AM »
Ok, so I've successfully chrooted into the gentoo install, manually configured and built a kernel, created a dualboot with vista and linux, and booted my kernel.

Except that since I didn't just chroot into it like usual, I've got very little functionality in the new kernel. when I ls /dev I get a HUGE list of a million different things that I don't have. And I seem to be missing eth and wlan devices entirely. The hell is going on here?
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Alice

  • B&!!!!1!!11`
  • Hero Member
  • *
  • Posts: 1665
  • the pinnacle of human emotion
    • View Profile
    • DigitalMZX
Re: Linux from an SD card?
« Reply #22 on: July 25, 2010, 12:40:43 AM »
This is how I'm running xubuntu off of my netbook (from an SD card).  I've had no issues with it yet.  I installed it from a disc using an external DVD drive, treating the SD card as if it was a normal hard drive.  It's pretty great, and before I decided to get a new hard drive for storage, it was nice having the netbook be that extra bit lighter.
« Last Edit: July 25, 2010, 12:42:23 AM by Alice »

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #23 on: July 25, 2010, 01:29:39 AM »
Nice. My system seems to not want to boot from an SD card, so I'm actually booting off a USB flash drive at the moment. I'm posting on the gentoo forums asking for help, because my kernel boots, but is basically useless for now. But hey, I managed to figure pretty much all of this out on my own, and I havent blown the computer up yet.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #24 on: July 25, 2010, 02:49:40 AM »
Except that since I didn't just chroot into it like usual, I've got very little functionality in the new kernel. when I ls /dev I get a HUGE list of a million different things that I don't have. And I seem to be missing eth and wlan devices entirely. The hell is going on here?

dev isn't populated by the kernel anymore, it's done by udev, so it's automatically populated based on what you have in your system and how your system is configured.  Most likely, the odd things that you're seeing are things like raw devices and stuff like that.  The only thing that's really important to the user is that the input devices and block devices are showing up properly.  The rest of it is pretty much all internal stuff.

If you're missing eth and wlan devices altogether, you probably don't have the correct Ethernet/wireless drivers enabled in the kernel.  It can be a little confusing, because a single manufacturer can put out a single model that can potentially use multiple chipsets (the Linksys LNE100TX series is a perfect example; it changed chipsets multiple times throughout its life).  As far as wireless support goes, it usually not enough to just select the package.  You have to emerge a proprietary, binary firmware blob for the device before you can make it sing.

If you want to have a functional system ASAP, your best bet would be to get genkernel set up and work on building your own kernel later.  Configuring a kernel can take a few attempts to really get right, so that will at least get your system fully functional so that you can play around with it more later.

Then you can work on becoming as much of a sad bastard as I am (I know my hardware so well that it took me less than 10 minutes to configure my kernel last time...yikes).
« Last Edit: July 25, 2010, 02:52:28 AM by Spectere »
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #25 on: July 25, 2010, 03:00:14 AM »
Haha, wow.

I have no /udev...

but yeah, I know I have an Atheros AR5007EN wireless... You say that I may need some proprietary module, but wouldn't that mean that I would need that even in a minimal LiveCD environment, or in Knoppix? If I could figure out what module the LiveCD environment uses, I could potentially get online. When setting up my kernel, I selected everything that looked remotely relevant to what I needed when it came to networking (wired and wireless).

I have a post on the gentoo forums, but it may take them a while to sort everything out. I might make a genkernel and let you know if it works any better than my custom ones.

Also, could you point me to something that explains how modules work and such? My lack of knowledge on the inner workings of linux is really catching up to me. I can navigate my way around the environment well enough, and I can pick stuff up quick enough, but not knowing how things actually work makes it way more confusing than it should be.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #26 on: July 25, 2010, 03:43:23 PM »
No, the devices aren't populated in /udev, they are populated in /dev by the udev daemon.

The LiveCD provides the proprietary firmware blobs for the various cards.  They aren't provided in a stock Gentoo system for a few reasons.  First of all, the base system is pretty much all FOSS-compliant.  That way you don't get the Richard Stallmans of the world flipping out because the base distribution has non-free components.  They aren't included in the kernel for that reason as well.  Second, the point of Gentoo is to keep a lean and mean system (hence compiling everything with only the options you want), so including the firmware blobs would kind of run against that goal.

Modules are sort of like Windows drivers.  They can be loaded into and (sometimes) unloaded from the kernel at will and can add all sorts of new features to the system, such as additional filesystem support, support for hardware devices, etc.  Most of the drivers in the kernel can be compiled as modules and inserted at startup.  In fact, with the clever use of modules, you can add features to your kernel without rebooting the system (for instance, if you want to add kernel NFS client support, you can compile the NFS components as a module, insert them, and use them right away).

When I build Gentoo on desktop systems, I usually build all of the hardware drivers for removable components (i.e. sound cards, video cards, etc) as modules, that way I can swap out hardware without having to do a complete kernel replacement.  I do the same thing with optional filesystems (note: you can't compile your root filesystem as a module for obvious reasons unless you plan to use an initramfs image).  With laptops, I generally compile all hardware into the kernel to speed up boot times a bit (and, simply, because non-generic laptop hardware -- as in anything but hard drives, CD-ROM drives, etc -- can't be easily changed).

In Gentoo, the /etc/modules.autoload.d/kernel-2.6 file specifies which modules automatically load on boot.  You don't always need to populate this file, since udev does a pretty good job detecting what hardware you have and loading the appropriate modules (for example, after I installed ati-drivers, the kernel module was automatically loaded on boot despite it not being in that file).  I don't think you really have to depend on that file much anymore.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #27 on: July 25, 2010, 03:50:33 PM »
Well, I just built a genkernel. udev still didn't seem to play nice, and update my /dev properly.

I am a bit closer to what I wanted though, since I took the opertunity when I was building the genkernel to emerge wireless-tools.

Are there any other packages like that that are basically essential? The base system seems practically crippled as it stands.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #28 on: July 25, 2010, 04:22:12 PM »
The base system really isn't crippled, it's just the absolute bare minimum.  When I'm building a server I definitely don't need a DHCP client and when I'm running ext4 I don't need the XFS filesystem tools.  Best of all, Gentoo doesn't force you to have a fucking mail daemon on your system like many other distros seem to do.

First of all, I'm going to assume if you followed the guide that you already have everything you need to connect to a wired network (i.e. either a DHCP client or a statically configured interface).

It appears that you're in luck with wireless.  The Atheros 5xxx series has an open-source driver in the kernel.  It seems like Atheros is a bit more cooperative than Intel and company when it comes to Linux drivers.  Just make sure that the ath5k driver is built, build any encryption modules that you'll need (i.e. TKIP, AES, etc), and you should be good to go.  As far as configuring the wireless, wpa_supplicant is my tool of choice.  There is a guide here on Gentoo Wiki, but it's not too great:

http://en.gentoo-wiki.com/wiki/Wireless/Configuration

It gives some decent information, but the samples given are very situational and, IMO, fairly useless.  What's worse is that some of the info that they'll make you believe that you need in your conf.d/net is actually outdated.  I'll summarize what you'll have to do below:

Basically, you'll want to emerge wireless-tools and wpa_supplicant.  Use iwconfig to make sure that the interface is there, then edit /etc/wpa_supplicant/wpa_supplicant.conf.  The following configuration file will automatically connect to your preferred network (assuming it uses WPA encryption) and, if that fails, will connect to any open network:

Code: [Select]
# This is a network block that connects to a specific unsecured access point.
# We give it a higher priority.
network={
ssid="YOUR_ACCESS_POINT_NAME"
key_mgmt=WPA-PSK
psk="your_passphrase"
priority=5
}

# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.
network={
key_mgmt=NONE
priority=-9999999
}

If you use WEP, the following block would apply to your network:

Code: [Select]
network={
ssid="YOUR_ACCESS_POINT_NAME"
key_mgmt=NONE
wep_key0=Hexidecimal WEP key goes here
}

In your /etc/conf.d/net file, add the following line:

Code: [Select]
modules=( "wpa_supplicant" )
This tells the system to run wpa_supplicant when it initializes the network.

Finally, you'll need to add a link to your init.d so that the device can start up.  Go into your /etc/init.d directory and do the following:

Code: [Select]
ln -s net.lo net.DEVICE
Replace DEVICE with whatever iwconfig calls your wireless device (it's usually wlan0, but sometimes that'll change depending on the driver).  Afterwards, bring up the interface with /etc/init.d/net.DEVICE start, cross your fingers, and pull the network cable.  Try to ping something and, if it works, make sure that the system brings up the interface at boot:

Code: [Select]
rc-update add default net.DEVICE
If your wireless is working nicely, you'll want to make sure that the system doesn't drag on startup while it tries to find an address for your wired network card.  You can simply disable the service that tries to start it, but there's a much more elegant method: netplug.

netplug immediately backgrounds net.eth0 so that it doesn't block the boot process unnecessarily.  Additionally, it will also handle calling your DHCP client the moment you plug a cable in and disabling the interface when you unplug it again.  Best of all, it couldn't be any easier to get up and running.  Just emerge netplug and that's it.  The init scripts will automatically pick it up and use it.

After that, your next step will probably be to install X.  Here's the guide on Gentoo.org:

http://www.gentoo.org/doc/en/xorg-config.xml

That gives you a minimal X setup.  After you're done with that, you'll probably want to install drivers for your graphics card:

ATI:http://www.gentoo.org/doc/en/ati-faq.xml
nVIDIA: http://www.gentoo.org/doc/en/nvidia-guide.xml

And finally, you'll want to install a desktop environment:

KDE: http://www.gentoo.org/proj/en/desktop/kde/kde4-guide.xml
Gnome: http://www.gentoo.org/doc/en/gnome-config.xml
Fluxbox: http://www.gentoo.org/doc/en/fluxbox-config.xml
Xfce: http://www.gentoo.org/doc/en/xfce-config.xml
Openbox: http://www.gentoo.org/doc/en/openbox.xml
LXDE: http://www.gentoo.org/doc/en/lxde-howto.xml

KDE and Gnome are the easiest to get up and running, but take the longest (by far) to compile.  Xfce is pretty nice and light-weight.  I haven't used LXDE, but it looks nice and is supposed to be pretty light.  Fluxbox and Openbox are very fast to compile (I'm actually using Fluxbox on my Gentoo system right now as a staging area and as a light-weight X environment for root; I think it took one whole minute to get compiled and installed) but require a lot of digging to get them configured.  Additionally, they're probably the only environments that'll still work on a 486, so they're lightning fast. :)

Most Linux users use either KDE or Gnome.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #29 on: July 25, 2010, 05:17:36 PM »
so I got up to the rc-update line. When I type rc-update add net.wlan0 defauly it complains that net.wlan isn't executable.

in bash, net.lo is green, and net.wlan0 is simply grey. Also, net.eth0 already exists, and I never did anything for that, and it is teal...

Also, I'm using EasyBCD to create my dual boot system. I've got it set up to use BCD to load Vista or Grub2, and I use Grub2 to load gentoo. I'd like to give Grub2 a menu so I don't have to manually type all the junk to boot gentoo, but I can't seem to figure out where it stuck Grub.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x