LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices

Reply
 
Search this Thread
Old 04-18-2009, 03:59 AM   #1
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
HOWTO: Running slamd64 from an SD card on an Everun Note UMPC


Before I get into the actual content of this post/article, I'd like to point out that this isn't a complete tutorial; I'm hoping by putting this in a regular forum (as opposed to the Tutorial section) others with netbook and UMPC experience can add to it. Hopefully this is too detailed and there are simpler ways to do what I've done.

This article is based on a very specific machine; however, the principles used should apply to almost any SD-bootable machine without an optical drive (with the possible exception of the absurd system Toshiba uses.) There are quite a few tutorials and software systems out there for installing pre-packaged distros onto a flash drive that often work with SD cards. Some of these are limited in that they require a FAT file system and/or an ISO image and a record of changes to the root partition, plus a very limited choice of distributions. For those who want more control over their system, this should be of some help.


Background.
I purchased a Raon Digital Everun Note several weeks ago because I wanted something small, but with some power behind it. Additionally, I wanted to be able to confine the operating system to an SD card, leaving the hard drive for data only. I was unsatisfied with the STFI solutions; therefore, I had to come up with my own. These are the results of my endeavor, although incomplete.

Requirements.
Unfortunately this tutorial isn't M$-friendly, although you might be able to complete it with a rescue disk or a live CD (with some extra effort.) Surprisingly, most of this can be done without the actual machine. If you have a USB DVD drive, you might be able to perform this from the Everun Note itself, however.

Resources:
  • x86_64-compatible machine that can boot a slamd64 install CD/DVD and write to an SD card
  • slamd64 12.2 install CD or DVD
  • Any functioning Linux system with SYSLINUX and EXTLINUX
  • SD card with at least 8GB capacity that can be completely erased (I have a Class 6 card, don't know if it's overkill yet)
Skills/Other:
  • Willingness to do "dirty work" in a real terminal
  • root or sudo access on the working machine (everything below needs to be done as root)
  • Patience and something to occupy yourself with
  • A way to reference these instructions (your x86_64 won't be free; print or use another computer to view)

The Job.

Step 1: Preparing the SD Card.
The first step in this long process is to ready your SD card for booting, etc. In order to do that, you'll need to insert/connect your card, then determine where exactly it is in /dev (I'll refer to the base of the device as <device> for the rest of the tutorial.) If you already know how to do this, identify the root of the device (e.g. /dev/sdb) and continue on. If you have a built-in card reader, you might need to insert the modules mmc_block and sdhci-pci with modprobe. It might take a little bit of work to find out where exactly it is; I'd like to go through all of that, but there are too many possibilities. fdisk -l and tail /var/log/messages can help you determine where it is with a USB card reader. With an internal card reader it will probably be /dev/mmcblk0, otherwise it will probably be /dev/sd[abc]. If for some reason you don't have /dev/mmcblk0 and you have an internal card reader, try the following as root:
Code:
mknod /dev/mmcblk0 b 179 0
blockdev --getsz /dev/mmcblk0
You shouldn't get an error with the second line if your card is connected (ask here or in a separate thread if you have problems.) Once you determine the correct device, continue on.

The most important part of this step is to make sure the card can boot. This is a very simple process when SYSLINUX is installed.
Code:
dd if=/usr/lib/syslinux/mbr.bin of=<device>
cfdisk -z <device>
Once you're in the cfdisk session, do the following:
  • Create a primary partition at the beginning 20-100MB. This will be /boot and will hold the kernel images and initrd. Make it type 82 and bootable.
  • Partition the rest as you see fit. (I only have two partitions: the second one is the root partition. This tutorial assumes your second partition is the root partition.)
Write the partition table and exit. Once you write the table, you should have a separate device for each partition. For example, /dev/sd[abc]1 for a USB reader and /dev/mmcblk0p1 for an internal card reader, etc. Create an ext2 or ext3 file system on the first partition as follows:
Code:
mkfs -t ext3 <device p1>
Create file systems for the rest of your partitions and fsck -f each of them. Lastly, mount the first partition somewhere (e.g. /mnt) and execute the following (note that this is done against the mount point and not the device in /dev):
Code:
extlinux <mount point>
umount <mount point>
You'll need a patched powernow-k8 module for CPU frequency scaling to work; therefore, download the patched module (thanks to marzeal and the hacker who patched it) and save it to your SD card. If that link no longer works, save the attached patch somewhere on your SD card. Unmount all of the partitions on the SD card.

Step 2: Initial Installation.

Once you have your SD card prepared, begin the installation process by booting the slamd64 12.2 installation CD on your x86_64 machine. If this is a different machine than the one used to set up the SD card, you might need to figure out what device your SD card is now. If you're still using an internal card reader, the following additional steps might be required once you get to the command line for the installation CD.
Code:
cd /
mount /dev/hdc /cdrom #mount the installation CD
tar -xvvzf /cdrom/slackware/a/kernel-modules-2.6.27.7-x86_64_slamd64-1.tgz lib #retrieve kernel modules
cd /lib/modules/2.6.27.7/kernel/drivers/mmc
insmod core/mmc_core.ko
insmod card/mmc_block.ko
insmod host/sdhci.ko
insmod host/sdhci-pci.ko
mknod /dev/mmcblk0p1 b 179 1
mknod /dev/mmcblk0p2 b 179 2 #once for each additional partition
This should get you to the point where you can use /dev/mmcblk0p[12]. Proceed once you determine the devices for your partitions and you can see them in /dev.

Unlike with the normal Slackware installation process, you should pre-mount your partitions. If you're using an internal card reader you probably have no choice. Start by mounting your root partition to /mnt. Depending on your file system, you might need to load other modules into the kernel (doubtful.) Next, mkdir /mnt/boot and mount the first partition there. Execute setup once all of your target partitions are mounted.

Select the "TARGET" option to start with and scroll down to "done adding partitions". This is necessary to appease the setup program. Set up your installation as you see fit, but make sure you install the kernel sources and gcc at the very least. Execute the installation and take a nap. This part took about 1:45, which is mostly based on the card and reader.

You can do basic configuration once installation is complete. Here are a few notes and reminders, however:
  • Don't set up the network
  • Don't set the clock if you aren't on the Everun Note
  • Don't set the root password
  • Don't install or run lilo
Once you exit the setup program do not restart the computer! Stay where you are; there's still a lot to do.

If you were able to download the patched powernow-k8 module, copy the .h and .c from the zip file to /mnt/usr/src/linux/arch/x86/kernel/cpu/cpufreq. If you downloaded the patch from this post, copy that patch to /mnt/usr/src/linux.

Step 3: While You're Here.
You need to do several things within your new installation to make sure everything works the first time you start your Everun Note. Perform the following steps in order:
Code:
mount --bind /proc /mnt/proc
chroot /mnt #enter the new installation
pico /etc/fstab
    #add these lines (replace jfs if necessary, leave sda):
    /dev/sda2 /     jfs  defaults 1 1
    /dev/sda1 /boot ext3 defaults 1 2
pico /boot/extlinux.conf
    #add these lines:
    DEFAULT linux
    LABEL linux
    KERNEL vmlinuz
    APPEND ro vga=normal initrd=initrd.gz
cp /boot/config-huge-2.6.27.7 /usr/local/linux/.config
The steps above will make sure the card actually boots the system, although a few things are still required.

If you want to be able to use the ATI graphics driver, you need to rebuild your kernel with PCI-MSI support. If you're using another distro you can grep the default configuration for CONFIG_PCI_MSI=y to save yourself the trouble. slamd64 12.2 doesn't have this by default, however. To set this option, enter /usr/src/linux, make menuconfig and enable "Message Signaled Interrupts (MSI and MSI-X)" in "Bus options (PCI etc.)". You might feel like configuring other things while you're at it. Now's your chance! Don't mess with what you don't understand, however.

If you're using the patch file for the powernow-k8 module, execute the following from /usr/src/linux:
Code:
patch -p0 < powernow-k8-everun.patch.txt
When you're done configuring, execute the commands below. If you have a boot partition of less than 30-40MB, you might want to clear out unwanted kernels before executing this to make room.
Code:
make && make modules && make modules_install && make install
It's very important that you place make install last; it will fail at the very last second because lilo won't work. This is normal; if you get to that point, everything is fine. Let this run and take another nap.

Once the kernel builds and installs, you need to make an initrd. This should be done for the following reasons:
  • If for some reason your root partition won't mount, you have a shell to work with
  • You can build in a delay between kernel load and mounting the root partition; this is necessary because of hardware initialization
Execute the following to give yourself a basic initrd:
Code:
#create a link named /boot/vmlinuz if you didn't rebuild the kernel
mkinitrd -c -k 2.6.27.7 -r /dev/sda2 -w 3 #"-w 3" provides a slight delay
mkinitrd
Now you're ready to exit and clean up:
Code:
exit #exits chroot session
umount /mnt/proc
umount /mnt/boot
#unmount other target partitions except the root
umount /mnt
Remove your SD card and reboot or turn off your machine.

Step 4: Basic Drivers.
You should download a few basic drivers from your working Linux machine and place them on your SD card before using it. I put my drivers in /usr/drivers on the root partition of the SD card, but you might not like that. Just remember where they are. Download the following drivers:
  • At the AMD driver site, find the x86_64 Linux ATI Radeon X1300 driver. Save the installation instructions, also.
  • Download the wireless-card firmware from the Marvell driver site. The "Network Controller" for "Linux 2.6 - Fedora" is what you want. (Thanks again to marzeal.)
Unmount all partitions on your SD card and remove it.

Step 5: Starting Your Everun Note.
Insert your prepared SD card into the card slot and start the Everun Note. Press F2 to enter the BIOS settings and place the boot device starting with "USB HDD:" at the top. You might move the hard drive to the "disabled" list, also. Save and exit, allowing the machine to boot from the SD card. Everything should boot correctly. If not, please post your difficulties here!

The first order of business is setting the time so your timestamps won't be thrown off:
Code:
zic -l <timezone> #see /usr/share/zoneinfo for a list of timezones
date -s "month day, year time"
While you're here, only set up the very basics; you'll want a relatively clean system to create a backup image of a few steps from now.

Install the ATI driver per the instructions. There are a few things you need to execute after you execute the installer; they should work correctly as described in the instructions. The following additional step is required after setup, however:
Code:
ln -s /usr/lib64/dri/fglrx_dri.so /usr/lib64/xorg/modules/dri/
To get the wireless to work, install the firmware as described by marzeal. In case the link no longer works, I quote him/her here:
Quote:
Originally Posted by marzeal
Open the downloaded archive, open and extract the contents of the second level archive:

SD-8686-FEDORA26FC6-SYSKT-GPL-9.70.3.p24-26409.P45.tar

Go to the FwImage directory. Rename helper_sd.bin to sd8686_helper.bin

Now navigate to the FwImage directory in a terminal and enter the following commands:

sudo mv sd* /lib/firmware
If you have the portable battery charger + ethernet port, you don't need a separate driver. You can use the mcs7830 module included with the kernel.

You can control the CPU frequency by loading the powernow-k8 module (only if you patched it as instructed.) You also might want to load the cpufreq_stats module to retreive information. You'll need to download and install cpufrequtils, then use the cpufreq-info and cpufreq-set commands (this can be done later.)

You'll need to make a few changes to your xorg.conf to get everything to work together. Open /etc/X11/xorg.conf with an editor (pico is the simplest) and make the following changes:
  • Search for Section "ServerLayout" and make sure these are the only input devices:
    Code:
        InputDevice    "touchscreen" "CorePointer"
        InputDevice    "Keyboard1" "CoreKeyboard"
        InputDevice    "Mouse1" #"eyeball" mouse
        InputDevice    "Mouse2" #USB mouse
  • Add a section for the touch screen:
    Code:
    Section "InputDevice"
        Identifier "touchscreen"
        Driver "evdev"
        Option "Device" "/dev/input/event3"
        Option "DeviceName" "touchscreen"
        Option "SendCoreEvents" "On"
    EndSection
  • Add a section for a USB mouse:
    Code:
    Section "InputDevice"
        Identifier "Mouse2"
        Driver "mouse"
        Option "Protocol" "auto"
        Option "Device" "/dev/input/mouse3"
        Option "ZAxisMapping" "4 5"
        Option "Button Mapping" "1 2 3 6 7"
        Option "HWheelRelativeAxisButtons" "7 6"
    EndSection
  • Find Identifier "Mouse1" and change the input device from /dev/mouse to /dev/input/mouse1.
Make sure you can startx, then shut your system down.

Step 6: Create an Emergency Backup.
Because you'll have limited boot options, you should make an emergency backup of your SD card with the basic configuration. To do this, start any Linux machine that can read and write the SD card.

Perform the following in order to clean up your system before imaging.
  • Mount all of your SD card partitions R/W
  • Execute the following from the directory where your root partition is mounted. Note that the leading / is left off! Do not put it in there because it might corrupt your working Linux installation. These steps will allow your image to be used by others without security compromises.
    Code:
    rm etc/ssh/ssh_host* #remove ssh keys
    rm root/.bash_history #remove your command history
    rm -r tmp/* #remove temporary files (don't remove the two . directories)
    echo -n > var/log/messages #clean up your logs
    echo -n > var/log/dmesg
    echo -n > var/log/syslog
  • Before you actually create an image of your card, you should reduce the complexity of your free space with the following procedure (inspired by the Eraser program for W$.) Execute the command below where each partition is mounted. Make sure the devices are actually mounted! This might crash your system otherwise! Wait for "DONE" to appear, then move on to the next partition. This command appends zeros to a file until the file system is full, then deletes the file, thereby setting all free space to zero (making it highly compressible.)
    Code:
    { dd if=/dev/zero of=zero; rm zero; echo DONE; } &
  • Unmount all of your partitions. This part is very important! If you don't, your image will always appear to have uncleanly unmounted file systems. Lastly, fsck -f each partition.
Once you've cleaned up your partitions, you can proceed with the backup image. The image should take up less than 1.7GB if you didn't install kdei, even if the card is > 8GB.
Code:
dd if=<device> | md5sum #record a hash if you really feel like it
dd if=<device> | bzip2 > slamd64-12.2-ren-sd.bz2 #bzip2 an image of the card
Both steps will take a while. The imaging alone took about 50 minutes on my Turion X2 machine. Note that this image should only be rewritten to a card of the same size, brand, and type! Otherwise, you might fall short by a block or more, causing your last partition to be corrupted.

Proceed with the rest of your customization and setup once you have the clean image. For example, set the root password, add users, etc. Your machine will regenerate its ssh keys the first time you restart. It's important that they aren't a part of your clean image for security reasons.

I created a second image of my card after I customized my system. Unlike the previous image, however, I piped the output of bzip2 through an encryption program so that my security settings weren't "just out there". The two images together were around 3.1GB, fitting onto a single DVD.

THE END!

Additional Notes.
Here are a few things that need work:
  • Built-in camera. I haven't tried anything with this, but it seems as though Raon uses custom software to drive it. They ship a variant of the machine with Ubuntu; therefore, the only version I know of is in binary form. I haven't actually tried to get the camera to work, though. It could be very simple.
  • Other hardware. Other than audio, I haven't tried to set up any other hardware. Audio sets up easy with alsaconf.

PLEASE POST ANYTHING ADDITIONAL YOU MIGHT HAVE! THANKS.

Kevin P. Barry

____________________
Changes and Additions.

Change 1: I attached a CPU-scaling script I wrote to control the frequency based on whether or not power is connected. Rename the script file by removing the .txt extension, place it in /usr/local/sbin or similar, and make it executable. Within e.g. /etc/rc.d/rc.local, you can start it as a daemon by adding a line like this:
Code:
/usr/local/sbin/cpu-scale.sh auto &
Make sure you use the &, otherwise it will freeze the startup process! This script requires cpufrequtils, powernow-k8, cpufreq_performance, and cpufreq_powersave, and ACPI.
Attached Files
File Type: txt cpu-scale.sh.txt (1.1 KB, 2 views)
File Type: txt powernow-k8-everun.patch.txt (3.9 KB, 4 views)

Last edited by ta0kira; 05-02-2009 at 01:40 AM.
 
Old 04-19-2009, 11:12 AM   #2
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
You might also want to post this at the slamd64 forum:
http://forums.slamd64.com/index.php
 
Old 04-22-2009, 07:41 AM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Good idea. I put it up there yesterday.
Kevin Barry
 
Old 12-24-2009, 03:01 AM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
A few more updates:

I attempted to create an SD card for Slackware 13.0; however, I had no DVD drive on a 64-bit machine. Eventually I just created a bootable SD card for installation using the utility included on the installation DVD and installed on a second SD card from the Everun Note. I found out the hard way that the card rating does matter: a Class 4 card is much slower than a Class 6 card even here. It required an initrd delay of 6 seconds rather than 3, and operations were unbearably slow.

Eventually I gave in and installed on the hard drive. My dream of a machine running from an SD card came to an end. The good news is that Slackware 13.0 requires a lot less setup.

Unfortunately, the proprietary ATI driver won't work for the Everun Note on Slackware 13.0 due to the kernel version. I tried numerous versions of the driver and rebuilt my kernel 4 times (at least) and either the driver was too new to support the card, it was too old for the kernel, or there were insertion errors. The radeon module works (a bit shaky, though) using the configuration the ATI driver would have inserted into xorg.conf (stolen from my Slamd64 installation above.) In case you're interested, replacing everything below the server flags section with this (the vesa stuff is default) worked for me:
Code:
Section "ServerLayout"
        Identifier     "Simple Layout"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
#        Screen          "Screen 1"
        InputDevice    "Keyboard1" "CoreKeyboard"
        InputDevice    "Mouse1"
        InputDevice    "Mouse2"
EndSection

Section "InputDevice"
        Identifier  "Keyboard1"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse1"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mouse1"
EndSection

Section "Monitor"
        Identifier   "My Monitor"
        HorizSync    31.5 - 50.0
        VertRefresh  40.0 - 90.0
EndSection

Section "Monitor"
        Identifier  "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Device"
        Identifier  "VESA Framebuffer"
        Driver      "vesa"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Option      "VideoOverlay" "on"
        Driver      "radeon"
        BusID       "PCI:1:5:0"
EndSection

Section "Screen"
        Identifier "Screen 1"
        Device     "VESA Framebuffer"
        Monitor    "My Monitor"
        DefaultDepth     24
        SubSection "Display"
                Depth     8
                Modes    "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth     16
                Modes    "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth     24
                Modes    "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth     32
                Modes    "1024x768" "800x600" "640x480"
        EndSubSection
EndSection

Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        Monitor    "aticonfig-Monitor[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "InputDevice"
    Identifier "touchscreen"
    Driver "evdev"
    Option "Device" "/dev/input/event3"
    Option "DeviceName" "touchscreen"
    Option "SendCoreEvents" "On"
EndSection

Section "InputDevice"
        Identifier  "Mouse2"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option "Device" "/dev/input/mouse3"
        Option "ZAxisMapping" "4 5"
        Option "Button Mapping" "1 2 3 6 7"
        Option "HWheelRelativeAxisButtons" "7 6"
EndSection
The wireless card worked using the same instructions from above. The powernow-k8 patch from above works (despite an error message from patch); however, the modified module posted doesn't.

Over all, I'm much happier running off the hard drive! I still have my Slamd64 SD card, which saved me about 10 times over the last few days because it allowed me to repair my Slackware 13.0 installation when I screwed up my kernel.
Kevin Barry

Last edited by ta0kira; 12-24-2009 at 01:14 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of instructions on howto install XFCE4.4 on Slamd64 slothpuck Slackware 13 03-29-2009 02:58 AM
Howto: slackware (slamd64) on Mac Pro pooryorick Slackware 1 02-17-2009 03:25 PM
Could I Install A Better Distro on my UMPC? DevilAmada Linux - Software 14 01-18-2009 01:02 AM
howto get compiz-fusion running on debian-etch on intel inbuilt graphics card ? vineet7kumar Linux - Newbie 1 05-03-2008 01:34 PM
driver for internal SD card reader in panasonic "CF-W2 let's note" ? shadowsa Suse/Novell 6 08-28-2005 02:44 AM


All times are GMT -5. The time now is 03:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration