public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
@ 2005-04-27  2:36 Heath H Holcomb
  2005-04-27  3:08 ` Yuri Vasilevski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heath H Holcomb @ 2005-04-27  2:36 UTC (permalink / raw
  To: gentoo-embedded

I'm trying to document a Gentoo embedded build for a x86 target SBC (single 
board computer, Geode and Via C3).  I'm using a development computer to build 
the actual system, it's an Athlon based Gentoo system.  Once the embedded 
system is built I'll copy the embedded filing system to a harddrive on the 
target SBC.  I'll prepare the partitions on the target harddrive using a 
Gentoo live CD.  Once I've worked out all the bugs, I'll copy the harddrive 
filing system to flash (DiskOnChip or compact flash).

The following are the steps I done so far.  Please add, modify, and remove 
steps to this so I can get it "right" and also for anyone else.  Also all 
comments about the commands to better explain what the command does. I'll 
post the "final" version to my website and the Gentoo Forums.  This document 
is for x86 embedded SBC only (or cross development).  

FYI - I'm not a programmer, I'm a electronics engineering (hardware only very 
lite C and assembly).  

Also what do I do next?  I need X and Blackbox or Windowmaker, how I do that 
and keep the build small?

# Commands to setup a Gentoo ebmedded enviroment
# you must be root
# create the development project directory
mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
# download the latest stage 1 or 2
wget 
http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uclibc-2005.0.tar.bz2
# untar the stage to the project directory
tar -xvjf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/
# mount the new proc filesystem
mount --bind /proc /opt/i586-gentoo-uclibc-linux/proc/
mount --bind /usr/portage /opt/i586-gentoo-uclibc-linux/usr/portage
# copy over DNS information to the chroot embedded build system
cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
# chroot into the embedded build system
chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
# modify make.conf file to your liking
nano -w /etc/make.conf
# work around for bug 90306
mknod -m 0444 /dev/random c 1 8
mknod -m 0444 /dev/urandom c 1 9
# start the bootstrip script
cd /usr/portage/scripts
./bootstrap -p -v
# emerge system
emerge -e system
# fixes for a ebuild bug
emerge python
# continue with the rest of the emerge system
emerge -e system
# modify /etc/make.conf to the target
# this is for my target, Geode x86 processor
CHOST="i586-gentoo-linux-uclibc"
CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
CXXFLAGS="${CFLAGS}"
FEATURES="buildpkg"
# build busybox and uclibc, put into /dev/shm
ROOT=/dev/shm emerge busybox uclibc


** most of this was taken form Ned Ludd e-mails **

-- 
xcable
heath holcomb
heath@bulah.com
-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27  2:36 [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation Heath H Holcomb
@ 2005-04-27  3:08 ` Yuri Vasilevski
  2005-04-27 18:14   ` Christian Heim
  2005-04-27 13:38 ` Heath Holcomb
  2005-04-29 10:21 ` Mike George
  2 siblings, 1 reply; 7+ messages in thread
From: Yuri Vasilevski @ 2005-04-27  3:08 UTC (permalink / raw
  To: gentoo-embedded; +Cc: heath

Hi,

> Also what do I do next?  I need X and Blackbox or Windowmaker, how I do that 
> and keep the build small?
> 
> # Commands to setup a Gentoo ebmedded enviroment
> # you must be root
> # create the development project directory
> mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> # download the latest stage 1 or 2
> wget 
> http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uclibc-2005.0.tar.bz2
> # untar the stage to the project directory
> tar -xvjf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/
> # mount the new proc filesystem
> mount --bind /proc /opt/i586-gentoo-uclibc-linux/proc/
> mount --bind /usr/portage /opt/i586-gentoo-uclibc-linux/usr/portage
> # copy over DNS information to the chroot embedded build system
> cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> # chroot into the embedded build system
> chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login

I always run
env-update ; source /etc/profile
at this point as it is advised to do in Gentoo Handbook

> # modify make.conf file to your liking
> nano -w /etc/make.conf

Why don't you set the final make.conf at this point?
with the CHOST, CFLAGS, etc. for your target.

> # work around for bug 90306
> mknod -m 0444 /dev/random c 1 8
> mknod -m 0444 /dev/urandom c 1 9
> # start the bootstrip script
> cd /usr/portage/scripts
> ./bootstrap -p -v

After preretending (-p) you should actually do the
bootstrapping with:
./bootstrap.sh
(this is in case you start form stage1)

> # emerge system
> emerge -e system

What is the point of ruining emerge with --emptytree (-e)?
I think emerge system should do it fine.

> # fixes for a ebuild bug
> emerge python

This will be emerged as a dependency to portage,
and if there is a bug regarding this (i have not had it
manifested) it should be fixed in the ebuild or in the
bootstrap script.

> # continue with the rest of the emerge system
> emerge -e system

Why compile anything again?

> # modify /etc/make.conf to the target
> # this is for my target, Geode x86 processor
> CHOST="i586-gentoo-linux-uclibc"

You shouldn't change CHOST after getting to stage2.

> CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> CXXFLAGS="${CFLAGS}"
> FEATURES="buildpkg"

As it is for an embedded system add nodoc, noinfo and
noman FEATURES to save space.

> # build busybox and uclibc, put into /dev/shm
> ROOT=/dev/shm emerge busybox uclibc

Best wishes,
Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27  2:36 [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation Heath H Holcomb
  2005-04-27  3:08 ` Yuri Vasilevski
@ 2005-04-27 13:38 ` Heath Holcomb
  2005-04-29 10:21 ` Mike George
  2 siblings, 0 replies; 7+ messages in thread
From: Heath Holcomb @ 2005-04-27 13:38 UTC (permalink / raw
  To: gentoo-embedded

Version 0.01
Added Yuri's comments.  
Please add, delete, modify. Thanks!

#---------------------------------------------------------------------------------------
# Embedded Gentoo How-To for x86
#
# Commands to setup a Gentoo embedded environment, you must be root.
# These commands are to be run on your developement system, 
# any x86 Gentoo Linux computer will do.  The system should be fast,
# to speed developement.
#
# version 0.01
# 2005.27.04
#
# Heath Holcomb (heath at bulah.com)
# Ned Ludd (original commands posted)
# Yuri Vasilevshi (contributor)
#---------------------------------------------------------------------------------------

# create the development project directory
mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage

# download the latest stage 1 tarball
wget \ 
http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uclibc-2005.0.tar.bz2

# untar the stage to the project directory
tar -xvjf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/

# mount the new proc filesystem
# don't understand this someone please add comments
mount --bind /proc /opt/i586-gentoo-uclibc-linux/proc/
mount --bind /usr/portage /opt/i586-gentoo-uclibc-linux/usr/portage

# copy over DNS information to the chroot embedded build system
cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf

# chroot into the embedded build system
chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
env-update
source /etc/profile

# modify make.conf file to your liking
nano -w /etc/make.conf
# this is for my target, Geode x86 processor
CHOST="i586-gentoo-linux-uclibc"
CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
CXXFLAGS="${CFLAGS}"
FEATURES="buildpkg"

# work around for bug 90306
mknod -m 0444 /dev/random c 1 8
mknod -m 0444 /dev/urandom c 1 9

# start the bootstrip script
cd /usr/portage/scripts
./bootstrap.sh -p -v
./bootstrap.sh

# emerge system
emerge -e system
# fixes a emerge ebuild bug, this should go away soon
emerge python
# continue with the rest of the emerge system
emerge -e system

# modify make.conf and set you USE flags for the target embedded build
# these use flags build a smaller system with no documentation, man or info 
pages installed
# the make-symlinks option of for busybox to automatically create the symlinks 
to it
nano -w /etc/make.conf
USE="make-symlinks nodoc noinfo noman"

# build busybox and uclibc, put into /dev/shm
# don't understand exactally how this works, someone please add comments
ROOT=/dev/shm emerge busybox uclibc

# emerge other software you need for you embedded target
ROOT=/dev/shm emerge xxxxxxxxx



-- 
Heath Holcomb
heath@bulah.com
www.bulah.com
-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27  3:08 ` Yuri Vasilevski
@ 2005-04-27 18:14   ` Christian Heim
  2005-04-27 18:27     ` Yuri Vasilevski
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Heim @ 2005-04-27 18:14 UTC (permalink / raw
  To: gentoo-embedded

On Wednesday 27 April 2005 05:08, Yuri Vasilevski ( YV )wrote:
>Hi,
>
>> [ ... ]
>
>After preretending (-p) you should actually do the
>bootstrapping with:
>./bootstrap.sh
>(this is in case you start form stage1)
>
>> # emerge system
>> emerge -e system
>
>What is the point of ruining emerge with --emptytree (-e)?
>I think emerge system should do it fine.

It should be the actual practice after a bootstrap to get all this nasty 
USE="build" out of you packages.

-- 
I've never been drunk, but often I've been overserved.
		-- George Gobel
-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27 18:14   ` Christian Heim
@ 2005-04-27 18:27     ` Yuri Vasilevski
  2005-04-27 20:01       ` Christian Heim
  0 siblings, 1 reply; 7+ messages in thread
From: Yuri Vasilevski @ 2005-04-27 18:27 UTC (permalink / raw
  To: gentoo-embedded; +Cc: christian.th.heim

Hi,

> >> # emerge system
> >> emerge -e system
> >
> >What is the point of ruining emerge with --emptytree (-e)?
> >I think emerge system should do it fine.
> 
> It should be the actual practice after a bootstrap to get all this nasty 
> USE="build" out of you packages.

How about --newuse so you just rebuild about 5 packages
affected by this flag?

And what was the point of doing it 2 times?
(emerge -e system ; emerge python ; emerge -e system)

Yuri.

-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27 18:27     ` Yuri Vasilevski
@ 2005-04-27 20:01       ` Christian Heim
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Heim @ 2005-04-27 20:01 UTC (permalink / raw
  To: gentoo-embedded

On Wednesday 27 April 2005 20:27, Yuri Vasilevski ( YV )wrote:
>Hi,
>
>> [ ... ]
>
>How about --newuse so you just rebuild about 5 packages
>affected by this flag?

Well I don't actually know :) -e world is pointed out at the end of a 
bootstrap.

-------------------------------------------------------------------------------
* "Please note that you should now add the '-e' option for emerge system:"

* "  # emerge -e system"

>
>And what was the point of doing it 2 times?
>(emerge -e system ; emerge python ; emerge -e system)

Well that might be due to the fuzzyness with python (the bug heath mentioned), 
as well as optimizing gcc and friends.

Christian
-- 
"You need tender loving care once a week - so that I can slap you into shape."
- Ellyn Mustard
-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation
  2005-04-27  2:36 [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation Heath H Holcomb
  2005-04-27  3:08 ` Yuri Vasilevski
  2005-04-27 13:38 ` Heath Holcomb
@ 2005-04-29 10:21 ` Mike George
  2 siblings, 0 replies; 7+ messages in thread
From: Mike George @ 2005-04-29 10:21 UTC (permalink / raw
  To: gentoo-embedded

Heath,

 >Heath H Holcomb wrote:
 > I'm trying to document a Gentoo embedded build for a x86 target SBC
 > single board computer, Geode and Via C3).

	I appended a set of instructions I used to get a full-blown version of 
Gentoo working on a Via Epia 5000 SBC.  The instructions walk you 
through bootstrapping Gentoo directly onto the SBC.  Your mileage may 
vary based on your specific configuration but the instructions might help.

	You might also want to take a look at 'Open-Source Robotics and Process 
Control Cookbook' By Lewin Edwards.  Chapter 5 has an excellent 
discussion of embedding Linux into a Geode-based SBC.  Mr. Lewin walks 
you through creating/cross-compiling an entire bootable system on your 
development computer and then loading it into flash on the target system.
	
	The JDOS project at https://jdos.dev.java.net has some good advice on 
working with the Via processors.

Good luck!



# Version 0.1
#
# These are the commands/actions I used to
# install Gentoo on an Epia 5000.  You will
# need to customize the commands to your specific
# situation.
#
# The commands are based on the Gentoo/Linux/x86
# Handbook which can be found at
# http://www.gentoo.org/doc/en/handbook/index.xml
# The handbook has good explanations of what is going
# on with each of the commands listed below.
#
# Some of the Epia-specific stuff is from
# http://www.epiawiki.org   and
# http://epia.kalf.org
#
# My environment consisted of three main elements:
# 1. A desktop PC running Gentoo
# 2. The Epia 5000 in a case with keyboard, mouse, monitor
# and network attached.
# 3. A Linksys router that connected the two computers
# to each other and the Internet.
#
# Most installation and configuration is done from the PC
# using an SSH connection.
#
# If you follow this guide exactly you will end up
# with a complete install starting from
# stage1 using the stage1 tarball from the
# universal CD and downloading the rest of the source code
# from the Internet.
#
# Comments are prefaced with the '#' character.
# Actions are prefaced with the '*' character.
# Commands have no leading character.

* Attach a CDROM drive to the Epia 5000.
* Insert the Universal CD into the drive.
* Reset or turn on the Epia 5000.
* Press <ENTER> to accept the default kernel.

######################################################
#
# These commands are run on the Epia itself.
#
######################################################

# At the prompt, check to see if networking was enabled

ifconfig

# If it wasn't
# Look for the ria-rhine driver

ls /lib/modules/*2.6.5*/kernel/drivers/net

# Load the driver

modprobe via-rhine

# Confirm that your network adapter was found
# If it wasn't, refer to the installation guide for
# more troubleshooting information

ifconfig

# Use dhcp to set up your networking or configure
# the network manually (see the installation guide
# for more information)

dhcpcd eth0

# Change the root password

passwd

# Format the disk.  Refer to the installation
# guide for more information
# I used the following settings
# /dev/hda1 - 50M - ext3 - bootable
# /dev/hda2 - 512M - swap
# /dev/hda3 - The rest of the drive - ext3
#

fdisk hda

# Format the drives.  The options below
# will format them as ext3

mke2fs -j /dev/hda1
mke2js -j /dev/hda3

# Format the swap partition and activate it

mkswap /dev/hda2
swapon /dev/hda2

# Mount the partitions

mount /dev/hda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1 /mnt/gentoo/boot

# Mount the proc system

mkdir /mnt/gentoo/proc
mount -t proc none /mnt/gentoo/proc

# Start the ssh daemon

/etc/init.d/sshd start

######################################################
#
# These commands are run on the PC.
#
######################################################

# Connect to the Epia via ssh

ssh -l root <ip-address>

# Check and set the date if necessary
# Format is MMDDHHmmYYYY

date
date 072500132004

# Check to see what stages are available
# This script uses stage1 in order to make sure that
# everything is compiled of the Epia architecture

ls /mnt/cdrom/stages/

# Change to the installation root directory

cd /mnt/gentoo

# Select the stage1 and untar it

tar -xvjpf /mnt/cdrom/stages/stage1-x86-2004.1.tar.bz2

# Check to see that the portage snapshot exists

ls /mnt/cdrom/snapshots/

# Untar it to the /mnt/gentoo/usr directory

tar -xvjf /mnt/cdrom/snapshots/portage-20040413.tar.bz2 -C /mnt/gentoo/usr

# Copy over the installation distfiles

mkdir /mnt/gentoo/usr/portage/distfiles
cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/

# Edit your configuration files as follows
# See 
http://www.epiawiki.org/wiki/tiki-index.php%3Fpage%3DEpiaInstallingGentoo+&hl=en
# or (Google cache): http://216.239.41.104/search?q=cache:-kzywSw_vqgJ: -->
# --> 
www.epiawiki.org/wiki/tiki-index.php%3Fpage%3DEpiaInstallingGentoo+&hl=en

* Set your CFLAGS and CHOST as follows.
* CFLAGS="-march=c3 -pipe -fomit-frame-pointer"
* CHOST="i586-pc-linux-gnu"

nano -w /mnt/gentoo/etc/make.conf

# Now run mirrorselect to find the fastest sites to download from

mirrorselect -a -s4 -o | grep -ve '^Netselect' >> /mnt/gentoo/etc/make.conf

# Save your DNS server info

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

# Change to the new root

chroot /mnt/gentoo /bin/bash

# Update your environment variables to use the new setting

env-update
source /etc/profile

# disable the use of java during the bootstrapping of gcc

export USE="-java"

# Bootstrap the system
# The use of the -f command will fetch all
# of the files first
#
# ***Note:
# The fetch program will try 3 or more mirrors and then fail.
# If you fail to get some package, go to Google and search
# for it using the package name, i.e. package.name.tar.bz2
# Use wget to get it and then move it into the
# appropriate directory.  You can find the destination
# directory in the download error message
# The wget command is
# wget <website address><path to file><file name>
#
# For example:
# wget gentoo.mirror.at.stealer.net/distfiles/rc-scripts-1.4.8.tar.bz2
# mv rc-scripts-1.4.8.tar.bz2 /mnt/gentoo/usr/portage/distfiles/

cd /usr/portage
scripts/bootstrap.sh -f

# Rerun scripts/bootstrap.sh -f until it completes
# without error

# Now bootstrap the system with the downloaded files
#
# ***Note:
# On my 533 MHz system this took about 8 hours
#

scripts/bootstrap.sh

# Reenable java and update the environment

unset USE
source /etc/profile

# Now prepare to load the system

emerge --pretend system | less

# Download all of the files you need.
# Use wget as mentioned above to retrieve
# anything that you failed on.

emerge -fetchonly system

# Now install the system
# ***Note:
# On my 533 MHz system this took about 3 hours
#

emerge system

# Now get ready to install the kernel

# Set the timezone
# First, see what time zones are available and
# then link the correct timezone to /etc/localtime

ls /usr/share/zoneinfo
ln -sf /usr/share/zoneinfo/EST /etc/localtime

# Get the kernel source code

emerge --fetchonly gentoo-dev-sources

# Now emerge the kernel source code

emerge gentoo-dev-sources

# Confirm that the kernel symlink is pointing to the appropriate place

ls -l /usr/src/linux

# Now configure the kernel manually

###############################################################
#
# Good luck finding some of these options.  Depending on the kernel
# and phase of the moon, some of the options may or
# may not be available.
#
###############################################################

# Accept all of the default settings except for those
# noted below
#
# From the link above, here are the parameters you need:
# For the Epia 5000:
# Code maturity level options				All enabled
# Processor Type and Features	Processor Family	C3-2 for Nehemiah, C3 for 
all others
#				MTRR			Enabled
# General Setup/ACPI		ACPI Suport		Enabled
# 				Button			Builtin
# 				Processor		Builtin
# Device Drivers->Block Device	RAM Disk		Builtin
# 				Initrd Support		Builtin
# ATA/IDE/... Devices		VIA82CXXX chipset spt	Builtin
# Firewire			OHCI and Misc		Modules or Builtin
# Network Device/Ethernet 10/100	VIA Rhine		Builtin
# Character Devices
# I2C Support			I2C Support		Builtin
# 				I2C bit-banging		Builtin
# 				I2C Device		Builtin
# 				I2C /proc		Builtin
# 				Intel/AMD/VIA RNG	Builtin or Module
# 				agpgart	Enabled
# 				CLE266 DirectFB Support	Module
# 				VIA Chipset		Builtin
# 				Enhance Real Time Clock	Builtin or Module
# 				Direct Rendering Mngr	Enabled
# 				Via unichrome video crd	Module or Builtin
# Multimedia Devices		Video For Linux		Builtin
# 				V4L/CLE266		Module or Builtin
# File Systems			Supermount		Builtin (if you want supermount)
# 	Filesystem of root filesystem (ReiserFS or ext3, most often)	Builtin
# 				ISO 9660		Builtin or module (for reading CD-ROMs)
# 				/dev fs	D		isabled
# Console drivers			VGA Text		Enabled
# 				FB/Support for fb dev	Enabled
# 				FB/VESA VGA Support	Enabled or Disabled
# 				FB/CLE266 Support	Builtin or Module
# 				FB/Use splash screen...	Enabled (if you want it)
# Sound				VIA 82Cxxx		Module
# USB				UHCI			Builtin or Module
# 				EHCI			Builtin or Modules (only on USB 2.0 # capable boards)
#
# Go to the source directory and
# configure the kernel using the parameters above.

cd /usr/scr/linux
make menuconfig

# Now compile your kernel.  Note that the command varies
# depending on which kernel you are building.
# ***Note:
# On my 533 MHz system this took about 1.5 hours

# For 2.4 jernels --> make dep && make bzImage modules modules_install
# For 2.6 kernels

make && make modules_install

# Copy the kernel and associated files to the appropriate location

cp arch/i386/boot/bzImage /boot/kernel-2.6.5-gentoo-r1
cp System.map /boot/System.map-2.6.5-gentoo-r1
cp .config /boot/config-2.6.5-gentoo-r1

# Now configure /etc/fstab
# This is what mine looks like:
#
# /dev/hda1               /boot           ext3            noauto,noatime 
          1 2
# /dev/hda3               /               ext3            noatime 
           0 1
# /dev/hda2               none            swap            sw 
           0 0
# /dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,user 
           0 0
# none                    /proc           proc            defaults 
           0 0
# none                    /dev/shm        tmpfs           defaults 
           0 0

nano -w /etc/fstab

# Now name your machine

echo <machinename> > /etc/hostname

# Now name your domain, if necessary

echo <domain-name> > /etc/dnsdomainname

# Now setup networking (again)
# Follow the instructions in the installation guide

nano -w /etc/conf.d/net

# Set up networking to start by default

rc-update add net.eth0 default

# Modify /etc/hosts that you will recognize yourself
# My /etc/hosts file reads:
#
# 127.0.0.1       localhost devbox2
# IPV6 versions of localhost and co
# ::1 ip6-localhost ip6-loopback
# fe00::0 ip6-localnet
# ff00::0 ip6-mcastprefix
# ff02::1 ip6-allnodes
# ff02::2 ip6-allrouters
# ff02::3 ip6-allhosts

nano -w /etc/hosts

# Now edit /etc/rc.conf if necessary
# For my system I made no changes at this point

nano -w /etc/rc.conf

# Now install the bootloader.
# I installed Grub.  See the installation
# guide if you want ot install Lilo or something
# else.

emerge grub

# Run grub.  I use the --no-floppy option
# because I don't have one installed

grub --no-floppy

# At the Grub prompt enter the following lines:

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

# Edit the grub.conf file
# Mine looks like this:
# default 0 

# timeout 30
# splashimage=(hd0,0)/grub/splash.xpm.gz
# title=Gentoo Linux 2.6.5
# root (hd0,0)
# kernel /kernel-2.6.5-gentoo-r1 root=/dev/hda3 vga=788

nano -w /boot/grub/grub.conf

# Now install a logger.
# Strictly speaking this is not necessary but it helps
# when you are having problems

emerge --pretend syslog-ng
emerge syslog-ng
rc-update add syslog-ng default

# Now install a cron daemon
# Not necessary but useful...

emerge --pretend vixie-cron
emerge vixie-cron
rc-update add vixie-cron default

# Now add a regular user.  Make sure to use the wheel group option
# so that the user can su -

useradd mike -m -G users,wheel,audio,tty -s /bin/bash
passwd mike
<password>
<password>

# Finally, make sure that sshd will start automatically

rc-update add sshd default

# Now get ready to reboot

exit
cd /
umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo

# Now reboot and log in as the user you just added
# You may want to hook up a monitor to the Epia to
# make sure that the boot sequence goes ok.

reboot

######################################################
#
# These commands are run on the PC.
#
######################################################

# Connect to the Epia via ssh

ssh -l root <ip-address>

# Now update the system with the latest patches, fixes
# and updates.

# Start by updating portage

emerge portage
env-update
source /etc/profile

# Get the newest emerge data

emerge sync

# Now check to see what needs to be updated on your system

emerge --pretend -uDv world

# Note that the update may include updating your system
# to the newest kernel.  If you don't want this, make sure
# that you exclude the kernel from the things being updated.
# If you do update the kernel, make sure to go up to the
# kernel compilation section above and redo the appropriate
# steps.
# Also make sure that you update the /boot/grub/grub.conf file.
#
# On my computer this took 14 hours.

emerge -uDv world

# Now check for old dependencies that are not valid

emerge -pv depclean

# Remove old dependencies of necessary

emerge -v depclean

# Finally, check for the most current security patches
# Start by installing glsa-check

emerge gentoolkit

# Now run glsa-check

####################################################
#
# glsa-check is a new tool and may have bugs
# read carefully before you blindly accept its
# suggestions.  I almost installed two more
# kernels this way.....
#
####################################################

glsa-check --help
glsa-check --pretend all
glsa-check --test all

# If you are brave, autofix everything (scarrryyyy)

# glsa-check -f all

# You should have an updated, secure build


   I'm using a development computer to build
> the actual system, it's an Athlon based Gentoo system.  Once the embedded 
> system is built I'll copy the embedded filing system to a harddrive on the 
> target SBC.  I'll prepare the partitions on the target harddrive using a 
> Gentoo live CD.  Once I've worked out all the bugs, I'll copy the harddrive 
> filing system to flash (DiskOnChip or compact flash).
> 
> The following are the steps I done so far.  Please add, modify, and remove 
> steps to this so I can get it "right" and also for anyone else.  Also all 
> comments about the commands to better explain what the command does. I'll 
> post the "final" version to my website and the Gentoo Forums.  This document 
> is for x86 embedded SBC only (or cross development).  
> 
> FYI - I'm not a programmer, I'm a electronics engineering (hardware only very 
> lite C and assembly).  
> 
> Also what do I do next?  I need X and Blackbox or Windowmaker, how I do that 
> and keep the build small?
> 
> # Commands to setup a Gentoo ebmedded enviroment
> # you must be root
> # create the development project directory
> mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> # download the latest stage 1 or 2
> wget 
> http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uclibc-2005.0.tar.bz2
> # untar the stage to the project directory
> tar -xvjf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/
> # mount the new proc filesystem
> mount --bind /proc /opt/i586-gentoo-uclibc-linux/proc/
> mount --bind /usr/portage /opt/i586-gentoo-uclibc-linux/usr/portage
> # copy over DNS information to the chroot embedded build system
> cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> # chroot into the embedded build system
> chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
> # modify make.conf file to your liking
> nano -w /etc/make.conf
> # work around for bug 90306
> mknod -m 0444 /dev/random c 1 8
> mknod -m 0444 /dev/urandom c 1 9
> # start the bootstrip script
> cd /usr/portage/scripts
> ./bootstrap -p -v
> # emerge system
> emerge -e system
> # fixes for a ebuild bug
> emerge python
> # continue with the rest of the emerge system
> emerge -e system
> # modify /etc/make.conf to the target
> # this is for my target, Geode x86 processor
> CHOST="i586-gentoo-linux-uclibc"
> CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> CXXFLAGS="${CFLAGS}"
> FEATURES="buildpkg"
> # build busybox and uclibc, put into /dev/shm
> ROOT=/dev/shm emerge busybox uclibc
> 
> 
> ** most of this was taken form Ned Ludd e-mails **
> 
-- 
gentoo-embedded@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-04-29 10:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-27  2:36 [gentoo-embedded] x86 SBC Gentoo Embedded HowTo/Documentation Heath H Holcomb
2005-04-27  3:08 ` Yuri Vasilevski
2005-04-27 18:14   ` Christian Heim
2005-04-27 18:27     ` Yuri Vasilevski
2005-04-27 20:01       ` Christian Heim
2005-04-27 13:38 ` Heath Holcomb
2005-04-29 10:21 ` Mike George

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox