* [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
@ 2005-08-18 0:19 Heath Holcomb
2005-08-18 6:35 ` Pierre Cassimans
2005-09-19 13:53 ` Marius Schäfer
0 siblings, 2 replies; 17+ messages in thread
From: Heath Holcomb @ 2005-08-18 0:19 UTC (permalink / raw
To: 'gentoo-embedded@lists.gentoo.org'
Version 0.08
Please add, delete, modify. Thanks!
Small fixes, but one very important. All work arounds are back.
I've update my website with this version also.
http://www.bulah.com/embeddedgentoo.html
#--------------------------------------------------------------------------------
# Embedded Gentoo How-To for x86
#
# A how-to guide to setup a Gentoo embedded environment, you must be root.
# These commands are to be run on your development system,
# any x86 Gentoo Linux computer will do. The system should be fast,
# to speed development. The target can be any x86 based SBC. I'm
# using a Geode based SBC. Latter I'll use a Via based SBC.
#
# versio 0.08
# 2005.8.13
#
# Heath Holcomb (heath at bulah.com)
# Ned Ludd (original commands posted)
# Lloyd Sargent (contributor)
# Yuri Vasilevski (contributor)
# Mike George (contributor)
# Kammi Cazze (contributor)
# Marius Schaefer (contributor)
#
# Definitions and Terms
# system_rootfs = your regular rootfs, development computer
# development_rootfs = what you use to build the embedded_rootfs
# embedded_rootfs = rootfs you deploy to the target system
# SBC = single board computer (here it's an x86 based)
#
# References
# http://www.gentoo.org/doc/en/handbook/index.xml
# http://www.epiawiki.org
# http://epia.kalf.org
# Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
#
#
# Overview of process (steps)
# 1 - Prepare the development_rootfs from your system_rootfs
# 2 - Build the development_rootfs
# 3 - Build the embedded_rootfs
# 4 - Build and install non-system programs to the embedded_rootfs
# 5 - Build and install a kernel to the embedded_rootfs
# 6 - Deploy embedded_rootfs to target
#
#--------------------------------------------------------------------------------
#----- Step 1 - Prepare the development_rootfs from your system_rootfs -------
# You must be root.
su -
cd /opt
# Create the development_rootfs directory.
# I use i586 because of target is a Geode processor.
mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
# Download the latest stage 1 tarball.
wget \
http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedded/stages/\
stage1-x86-uclibc-2005.0.tar.bz2
# Untar the stage to the development_rootfs.
tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/
# Mount the proc and portage directories to your development_rootfs.
# Makes your system_rootfs's proc and portage directory available from inside
# of your development_rootfs (after chrooting).
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 development_rootfs.
cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
# Chroot into the development_rootfs.
chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
#----- Step 2 - Build the development_rootfs ---------------------------------
# Create new environment and load variables into memory.
env-update
source /etc/profile
# Modify make.conf file to your liking/needs.
nano -w /etc/make.conf
# This is for my target, Geode x86 processor.
/*
USE="bitmap-fonts minimal truetype-fonts mmx"
CHOST="i586-gentoo-linux-uclibc"
CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
CXXFLAGS="${CFLAGS}"
FEATURES="buildpkg"
VIDEO_CARDS="chips"
UCLIBC_CPU="586MMX"
*/
# Set profile to use 2.6 kernel.
# The current stage uses 2.4 by default, and for most cases you are going
# to want a 2.6.x kernel.
cd /etc/
unlink make.profile
ln -s ../usr/portage/profiles/uclibc/x86 make.profile
# Start the bootstrap script.
cd /usr/portage/scripts
./bootstrap.sh -p -v
./bootstrap.sh
# Workaround - bootstraping
# Failure compiling uclibc (gcc-config error: Could not run/locate "gcc")?
# If you get a failure while bootstrap is compileing uclibc here are the steps
# to work around the problem.
gcc-config 1
source /etc/profile
./bootstrap.sh
# Emerge the system ebuild for the development_rootfs.
emerge -e system
# Workaround - emerge system
# During emerge -e system, python-fchksum failes complaing about
# gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
# The following commands work around this problem.
emerge python
emerge -e system
#----- Step 3 - Build the embedded_rootfs ------------------------------------
# Create the embedded_rootfs directory.
mkdir /embedded_rootfs
# Emerge baselayout-lite into embedded_rootfs.
# This gives your system a basic file structure.
# 1.0_pre1 is the only one that is stable, right?
cd /usr/portage/sys-apps/baselayout-lite/
ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
# Workaround - baselayout-lite
# Baselayout-lite is still beta, so a few fixes are needed.
# There needs to be a directory "log" in /var.
# Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
mkdir /embedded_rootfs/var/log
nano -w /embedded_rootfs/etc/inittab
/*
#tty3::respawn:/usr/bin/tail -f /var/log/messages
tty3::respawn:/bin/tail -f /var/log/messages
*/
# Emerge uclibc into the embedded_rootfs.
# Use the -K option because we don't get the extra files created by the
# build/emerge process into our embedded rootfs which needs to be as
# small as possible.
ROOT=/embedded_rootfs emerge -K uclibc
# Emerge busybox into the embedded_rootfs.
# First you must emerge it into your development_rootfs.
# This does not create the symlinks in our development embedded rootfs.
emerge busybox
ROOT=/embedded_rootfs emerge -K busybox
# Create the symlinks for busybox in the embedded_rootfs.
mkdir /embedded_rootfs/proc
mount -o bind /proc/ /embedded_rootfs/proc/
chroot /embedded_rootfs /bin/busybox --install -s
umount /embedded_rootfs/proc
# Set time zone in your embedded_rootfs.
# See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
# For central standard time in the US, use "CST6CDT".
nano -w /embedded_rootfs/etc/TZ
/*
CST6CDT
*/
# Install a boot loader (usually grub or lilo).
# Once you copy/deploy your embedded_rootfs to your target SBC you will
# have to run grub on the command line to write to the master boot record
# (MBR).
# For some reason not all of /boot/grub is copied over to the
# embedded_rootfs, so a extra manual copy step is needed.
# The --nodeps gets rip of the run time need of ncurses.
emerge --nodeps grub
ROOT=/embedded_rootfs emerge -K --nodeps grub
cp -R /boot/grub /embedded_rootfs/boot/
# Modify your boot configure file.
# The example below is for a gurb, for a boot partition on /dev/hda1 and only
# one partition on the target SBC system.
nano -w /embedded_rootfs/boot/grub/grub.conf
/*
default 0
timeout 10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Linux 2.6.x
root (hd0,0)
kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
*/
# Set root password for the embedded_rootfs
chroot /embedded_rootfs
passwd
rm /embedded_rootfs/etc/passwd-
exit
# Modify fstab.
# Below is mine, yours may vary.
nano -w /embedded_rootfs/etc/fstab
/*
/dev/hda1 / reiserfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
none /dev/shm tmpfs defaults 0 0
*/
# Clean up the embedded_rootfs.
# Don't know why these files are there in the first place, so if anyone
# can tell me why.....
rm -R /embedded_rootfs/var/db/pkg/*
rm -R /embedded_rootfs/var/lib/portage/
#---- Step 4 - Build and install non-system programs to the embedded_rootfs --
# Emerge other software you need for you embedded target.
# This is very wildly depending on your needs.
# Also your proprietary application will be done here.
emerge foo*
ROOT=/embedded_rootfs emerge -K foo*
#---- Step 5 - Build and install a kernel to the embedded_rootfs -------------
# Install a kernel into embedded_rootfs.
# First we will emerge it into our development_rootfs, then configure and
# build it.
emerge vanilla-sources
cd /usr/src/
cd linux
make menuconfig
# Configure your kernel for your TARGET SBC here. I HIGHLY suggest you
# configure the kernel to compile everything into the kernel, and nothing
# as a module.
make
ROOT=/embedded_rootfs make modules_install
cp /usr/src/linux/arch/i386/boot/bzImage /embedded_rootfs/boot/vmlinuz-2.6.x
# A few notes on compiling your kernel.
# If deploying to Compact Flash/DiskOnChip/SD use ext2, as the journaling
# filing systems "write" to much for a flash device.
# If deploying to a hard drive use a journaling filing system, such as
# ext3 or reiserfs.
#---- Step 6 - Deploy embedded_rootfs to target ------------------------------
# Prepare a Gentoo (or any Linux distro) system on the target SBC using a
# harddrive. This is known as the target development rootfs.
# We will create a partition (/embedded_rootfs) that will server as our
# "test" partition to deploy our embedded_rootfs that we generate on our
# development_system.
#
# I use the following partitions to speed development (yours may vary):
# /dev/hda1 - /embedded_rootfs - 1 GB
# /dev/hda2 - /boot - 100 MB
# /dev/hda3 - swap - (size varies, 512 MB is a good number)
# /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0 install guide
specs)
#
# Copy over your embedded_rootfs from you development system to your target
# system and the directory /embedded_rootfs. This needs to be done via NFS as
# need to preserve the permissions.
#
#The following commands are done from the
# target development rootfs.
mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
mount -t nfs\
192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
/mnt/nfs_embedded_rootfs
cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
# Modify your target system's gurb.conf (or lilo.conf) for allow you to boot
# to the embedded_rootfs partition.
#
# Reboot, and if all goes well you'll be greeted with a login prompt.
#
# Fin.
--
heath holcomb
liquidcable at bulah.com
www.bulah.com
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 0:19 [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08 Heath Holcomb
@ 2005-08-18 6:35 ` Pierre Cassimans
2005-08-18 7:30 ` Natanael Copa
2005-09-19 13:53 ` Marius Schäfer
1 sibling, 1 reply; 17+ messages in thread
From: Pierre Cassimans @ 2005-08-18 6:35 UTC (permalink / raw
To: gentoo-embedded
>From: Heath Holcomb <liquidcable@bulah.com>
>Reply-To: gentoo-embedded@lists.gentoo.org
>To: "'gentoo-embedded@lists.gentoo.org'" <gentoo-embedded@lists.gentoo.org>
>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
>Date: Wed, 17 Aug 2005 19:19:38 -0500
>
>Version 0.08
>Please add, delete, modify. Thanks!
>
>Small fixes, but one very important. All work arounds are back.
>
>I've update my website with this version also.
>http://www.bulah.com/embeddedgentoo.html
>
>
>
>#--------------------------------------------------------------------------------
># Embedded Gentoo How-To for x86
>#
># A how-to guide to setup a Gentoo embedded environment, you must be root.
># These commands are to be run on your development system,
># any x86 Gentoo Linux computer will do. The system should be fast,
># to speed development. The target can be any x86 based SBC. I'm
># using a Geode based SBC. Latter I'll use a Via based SBC.
>#
># versio 0.08
># 2005.8.13
>#
># Heath Holcomb (heath at bulah.com)
># Ned Ludd (original commands posted)
># Lloyd Sargent (contributor)
># Yuri Vasilevski (contributor)
># Mike George (contributor)
># Kammi Cazze (contributor)
># Marius Schaefer (contributor)
>#
># Definitions and Terms
># system_rootfs = your regular rootfs, development computer
># development_rootfs = what you use to build the embedded_rootfs
># embedded_rootfs = rootfs you deploy to the target system
># SBC = single board computer (here it's an x86 based)
>#
># References
># http://www.gentoo.org/doc/en/handbook/index.xml
># http://www.epiawiki.org
># http://epia.kalf.org
># Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
>#
>#
># Overview of process (steps)
># 1 - Prepare the development_rootfs from your system_rootfs
># 2 - Build the development_rootfs
># 3 - Build the embedded_rootfs
># 4 - Build and install non-system programs to the embedded_rootfs
># 5 - Build and install a kernel to the embedded_rootfs
># 6 - Deploy embedded_rootfs to target
>#
>#--------------------------------------------------------------------------------
>
>#----- Step 1 - Prepare the development_rootfs from your system_rootfs
>-------
>
># You must be root.
>su -
>cd /opt
>
># Create the development_rootfs directory.
># I use i586 because of target is a Geode processor.
>mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
>
># Download the latest stage 1 tarball.
>wget \
>http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedded/stages/\
>stage1-x86-uclibc-2005.0.tar.bz2
>
># Untar the stage to the development_rootfs.
>tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
>/opt/i586-gentoo-uclibc-linux/
>
># Mount the proc and portage directories to your development_rootfs.
># Makes your system_rootfs's proc and portage directory available from
>inside
># of your development_rootfs (after chrooting).
>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 development_rootfs.
>cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
>
># Chroot into the development_rootfs.
>chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
>
>
>#----- Step 2 - Build the development_rootfs
>---------------------------------
>
># Create new environment and load variables into memory.
>env-update
>source /etc/profile
>
># Modify make.conf file to your liking/needs.
>nano -w /etc/make.conf
># This is for my target, Geode x86 processor.
>/*
>USE="bitmap-fonts minimal truetype-fonts mmx"
>CHOST="i586-gentoo-linux-uclibc"
>CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
>CXXFLAGS="${CFLAGS}"
>FEATURES="buildpkg"
>
>VIDEO_CARDS="chips"
>UCLIBC_CPU="586MMX"
>*/
As it is a x86 howto, here are the possible values for UCLIBC_CPU:
386, 486, ELAN, 586, 586MMX, 686, PENTIUMII, PENTIUMIII,PENTIUM4, K6, K7,
CRUSOE, WINCHIPC6, WINCHIP2, CYRIXIII, NEHEMIAH.
For people with VIA boards, take CYRIXIII or NEHEMIAH.
>
># Set profile to use 2.6 kernel.
># The current stage uses 2.4 by default, and for most cases you are going
># to want a 2.6.x kernel.
>cd /etc/
>unlink make.profile
>ln -s ../usr/portage/profiles/uclibc/x86 make.profile
>
># Start the bootstrap script.
>cd /usr/portage/scripts
>./bootstrap.sh -p -v
>./bootstrap.sh
>
># Workaround - bootstraping
># Failure compiling uclibc (gcc-config error: Could not run/locate "gcc")?
># If you get a failure while bootstrap is compileing uclibc here are the
>steps
># to work around the problem.
>gcc-config 1
>source /etc/profile
>./bootstrap.sh
>
># Emerge the system ebuild for the development_rootfs.
>emerge -e system
>
># Workaround - emerge system
># During emerge -e system, python-fchksum failes complaing about
># gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
># The following commands work around this problem.
>emerge python
>emerge -e system
I still had to do
USE="-sandbox" emerge -e system
to work around the bug with groff.
>
>#----- Step 3 - Build the embedded_rootfs
>------------------------------------
>
># Create the embedded_rootfs directory.
>mkdir /embedded_rootfs
>
># Emerge baselayout-lite into embedded_rootfs.
># This gives your system a basic file structure.
># 1.0_pre1 is the only one that is stable, right?
>cd /usr/portage/sys-apps/baselayout-lite/
>ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
>
># Workaround - baselayout-lite
># Baselayout-lite is still beta, so a few fixes are needed.
># There needs to be a directory "log" in /var.
># Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
>mkdir /embedded_rootfs/var/log
>nano -w /embedded_rootfs/etc/inittab
>/*
>#tty3::respawn:/usr/bin/tail -f /var/log/messages
>tty3::respawn:/bin/tail -f /var/log/messages
>*/
>
># Emerge uclibc into the embedded_rootfs.
># Use the -K option because we don't get the extra files created by the
># build/emerge process into our embedded rootfs which needs to be as
># small as possible.
>ROOT=/embedded_rootfs emerge -K uclibc
>
># Emerge busybox into the embedded_rootfs.
># First you must emerge it into your development_rootfs.
># This does not create the symlinks in our development embedded rootfs.
>emerge busybox
>ROOT=/embedded_rootfs emerge -K busybox
Busybox is emerged with emerge -e system. Should we emerge busybox again?
>
># Create the symlinks for busybox in the embedded_rootfs.
>mkdir /embedded_rootfs/proc
>mount -o bind /proc/ /embedded_rootfs/proc/
>chroot /embedded_rootfs /bin/busybox --install -s
>umount /embedded_rootfs/proc
>
># Set time zone in your embedded_rootfs.
># See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
># For central standard time in the US, use "CST6CDT".
>nano -w /embedded_rootfs/etc/TZ
>/*
>CST6CDT
>*/
>
># Install a boot loader (usually grub or lilo).
># Once you copy/deploy your embedded_rootfs to your target SBC you will
># have to run grub on the command line to write to the master boot record
># (MBR).
># For some reason not all of /boot/grub is copied over to the
># embedded_rootfs, so a extra manual copy step is needed.
># The --nodeps gets rip of the run time need of ncurses.
>emerge --nodeps grub
>ROOT=/embedded_rootfs emerge -K --nodeps grub
>cp -R /boot/grub /embedded_rootfs/boot/
>
># Modify your boot configure file.
># The example below is for a gurb, for a boot partition on /dev/hda1 and
>only
># one partition on the target SBC system.
>nano -w /embedded_rootfs/boot/grub/grub.conf
>/*
>default 0
>timeout 10
>splashimage=(hd0,0)/boot/grub/splash.xpm.gz
>
>title=Linux 2.6.x
>root (hd0,0)
>kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
>*/
>
># Set root password for the embedded_rootfs
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
Can you please check this again? See my previous post.
>
># Modify fstab.
># Below is mine, yours may vary.
>nano -w /embedded_rootfs/etc/fstab
>/*
>/dev/hda1 / reiserfs defaults 0 0
>none /proc proc defaults 0 0
>none /sys sysfs defaults 0 0
>none /dev/shm tmpfs defaults 0 0
>*/
>
># Clean up the embedded_rootfs.
># Don't know why these files are there in the first place, so if anyone
># can tell me why.....
>rm -R /embedded_rootfs/var/db/pkg/*
>rm -R /embedded_rootfs/var/lib/portage/
>
>#---- Step 4 - Build and install non-system programs to the embedded_rootfs
>--
>
># Emerge other software you need for you embedded target.
># This is very wildly depending on your needs.
># Also your proprietary application will be done here.
>emerge foo*
>ROOT=/embedded_rootfs emerge -K foo*
>
>
>#---- Step 5 - Build and install a kernel to the embedded_rootfs
>-------------
>
># Install a kernel into embedded_rootfs.
># First we will emerge it into our development_rootfs, then configure and
># build it.
>emerge vanilla-sources
>cd /usr/src/
>cd linux
>make menuconfig
># Configure your kernel for your TARGET SBC here. I HIGHLY suggest you
># configure the kernel to compile everything into the kernel, and nothing
># as a module.
>make
>ROOT=/embedded_rootfs make modules_install
>cp /usr/src/linux/arch/i386/boot/bzImage
>/embedded_rootfs/boot/vmlinuz-2.6.x
>
># A few notes on compiling your kernel.
># If deploying to Compact Flash/DiskOnChip/SD use ext2, as the journaling
># filing systems "write" to much for a flash device.
># If deploying to a hard drive use a journaling filing system, such as
># ext3 or reiserfs.
>
>
>#---- Step 6 - Deploy embedded_rootfs to target
>------------------------------
>
># Prepare a Gentoo (or any Linux distro) system on the target SBC using a
># harddrive. This is known as the target development rootfs.
># We will create a partition (/embedded_rootfs) that will server as our
># "test" partition to deploy our embedded_rootfs that we generate on our
># development_system.
>#
># I use the following partitions to speed development (yours may vary):
># /dev/hda1 - /embedded_rootfs - 1 GB
># /dev/hda2 - /boot - 100 MB
># /dev/hda3 - swap - (size varies, 512 MB is a good number)
># /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0 install guide
>specs)
>#
># Copy over your embedded_rootfs from you development system to your target
># system and the directory /embedded_rootfs. This needs to be done via NFS
>as
># need to preserve the permissions.
>#
>#The following commands are done from the
># target development rootfs.
>mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
>mount -t nfs\
>192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
>/mnt/nfs_embedded_rootfs
>cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
>
>
># Modify your target system's gurb.conf (or lilo.conf) for allow you to
>boot
># to the embedded_rootfs partition.
>#
># Reboot, and if all goes well you'll be greeted with a login prompt.
>#
># Fin.
>
>
>--
>heath holcomb
>liquidcable at bulah.com
>www.bulah.com
>
>--
>gentoo-embedded@gentoo.org mailing list
>
Pierre Cassimans
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
@ 2005-08-18 6:46 Marcel Romijn
2005-08-18 7:02 ` Pierre Cassimans
2005-08-18 15:03 ` Joshua ChaitinPollak
0 siblings, 2 replies; 17+ messages in thread
From: Marcel Romijn @ 2005-08-18 6:46 UTC (permalink / raw
To: gentoo-embedded
> -----Original Message-----
> From: Pierre Cassimans [mailto:kammicazze@hotmail.com]
> Sent: Thursday, 18 August, 2005 8:36
> To: gentoo-embedded@lists.gentoo.org
> Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo
> version 0.08
>
>
>
>
> >From: Heath Holcomb <liquidcable@bulah.com>
> >Reply-To: gentoo-embedded@lists.gentoo.org
> >To: "'gentoo-embedded@lists.gentoo.org'"
> <gentoo-embedded@lists.gentoo.org>
> >Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
> >Date: Wed, 17 Aug 2005 19:19:38 -0500
> >
> >Version 0.08
> >Please add, delete, modify. Thanks!
> >
> >Small fixes, but one very important. All work arounds are back.
> >
> >I've update my website with this version also.
> >http://www.bulah.com/embeddedgentoo.html
> >
> >
> >
> >#------------------------------------------------------------
> --------------------
> ># Embedded Gentoo How-To for x86
> >#
> ># A how-to guide to setup a Gentoo embedded environment, you
> must be root.
> ># These commands are to be run on your development system,
> ># any x86 Gentoo Linux computer will do. The system should be fast,
> ># to speed development. The target can be any x86 based SBC. I'm
> ># using a Geode based SBC. Latter I'll use a Via based SBC.
> >#
> ># versio 0.08
> ># 2005.8.13
> >#
> ># Heath Holcomb (heath at bulah.com)
> ># Ned Ludd (original commands posted)
> ># Lloyd Sargent (contributor)
> ># Yuri Vasilevski (contributor)
> ># Mike George (contributor)
> ># Kammi Cazze (contributor)
> ># Marius Schaefer (contributor)
> >#
> ># Definitions and Terms
> ># system_rootfs = your regular rootfs, development computer
> ># development_rootfs = what you use to build the embedded_rootfs
> ># embedded_rootfs = rootfs you deploy to the target system
> ># SBC = single board computer (here it's an x86 based)
> >#
> ># References
> ># http://www.gentoo.org/doc/en/handbook/index.xml
> ># http://www.epiawiki.org
> ># http://epia.kalf.org
> ># Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
> >#
> >#
> ># Overview of process (steps)
> ># 1 - Prepare the development_rootfs from your system_rootfs
> ># 2 - Build the development_rootfs
> ># 3 - Build the embedded_rootfs
> ># 4 - Build and install non-system programs to the embedded_rootfs
> ># 5 - Build and install a kernel to the embedded_rootfs
> ># 6 - Deploy embedded_rootfs to target
> >#
> >#------------------------------------------------------------
> --------------------
> >
> >#----- Step 1 - Prepare the development_rootfs from your
> system_rootfs
> >-------
> >
> ># You must be root.
> >su -
> >cd /opt
> >
> ># Create the development_rootfs directory.
> ># I use i586 because of target is a Geode processor.
> >mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> >
> ># Download the latest stage 1 tarball.
> >wget \
> >http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedde
> d/stages/\
> >stage1-x86-uclibc-2005.0.tar.bz2
> >
> ># Untar the stage to the development_rootfs.
> >tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
> >/opt/i586-gentoo-uclibc-linux/
> >
> ># Mount the proc and portage directories to your development_rootfs.
> ># Makes your system_rootfs's proc and portage directory
> available from
> >inside
> ># of your development_rootfs (after chrooting).
> >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 development_rootfs.
> >cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> >
> ># Chroot into the development_rootfs.
> >chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
> >
> >
> >#----- Step 2 - Build the development_rootfs
> >---------------------------------
> >
> ># Create new environment and load variables into memory.
> >env-update
> >source /etc/profile
> >
> ># Modify make.conf file to your liking/needs.
> >nano -w /etc/make.conf
> ># This is for my target, Geode x86 processor.
> >/*
> >USE="bitmap-fonts minimal truetype-fonts mmx"
> >CHOST="i586-gentoo-linux-uclibc"
> >CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> >CXXFLAGS="${CFLAGS}"
> >FEATURES="buildpkg"
> >
> >VIDEO_CARDS="chips"
> >UCLIBC_CPU="586MMX"
> >*/
>
> As it is a x86 howto, here are the possible values for UCLIBC_CPU:
>
> 386, 486, ELAN, 586, 586MMX, 686, PENTIUMII,
> PENTIUMIII,PENTIUM4, K6, K7,
> CRUSOE, WINCHIPC6, WINCHIP2, CYRIXIII, NEHEMIAH.
>
> For people with VIA boards, take CYRIXIII or NEHEMIAH.
Is this setting used for both the development and the embedded machine?
I'm developing on a Pentium4, but I'm deploying to a VIA board
(CytrixIII).
>
> >
> ># Set profile to use 2.6 kernel.
> ># The current stage uses 2.4 by default, and for most cases
> you are going
> ># to want a 2.6.x kernel.
> >cd /etc/
> >unlink make.profile
> >ln -s ../usr/portage/profiles/uclibc/x86 make.profile
> >
> ># Start the bootstrap script.
> >cd /usr/portage/scripts
> >./bootstrap.sh -p -v
> >./bootstrap.sh
> >
> ># Workaround - bootstraping
> ># Failure compiling uclibc (gcc-config error: Could not
> run/locate "gcc")?
> ># If you get a failure while bootstrap is compileing uclibc
> here are the
> >steps
> ># to work around the problem.
> >gcc-config 1
> >source /etc/profile
> >./bootstrap.sh
> >
> ># Emerge the system ebuild for the development_rootfs.
> >emerge -e system
> >
> ># Workaround - emerge system
> ># During emerge -e system, python-fchksum failes complaing about
> ># gcc-config error: Could not run/locate
> "i386-gentoo-linux-uclibc-gcc"
> ># The following commands work around this problem.
> >emerge python
> >emerge -e system
>
> I still had to do
>
> USE="-sandbox" emerge -e system
>
> to work around the bug with groff.
>
> >
> >#----- Step 3 - Build the embedded_rootfs
> >------------------------------------
> >
> ># Create the embedded_rootfs directory.
> >mkdir /embedded_rootfs
> >
> ># Emerge baselayout-lite into embedded_rootfs.
> ># This gives your system a basic file structure.
> ># 1.0_pre1 is the only one that is stable, right?
> >cd /usr/portage/sys-apps/baselayout-lite/
> >ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
> >
> ># Workaround - baselayout-lite
> ># Baselayout-lite is still beta, so a few fixes are needed.
> ># There needs to be a directory "log" in /var.
> ># Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
> >mkdir /embedded_rootfs/var/log
> >nano -w /embedded_rootfs/etc/inittab
> >/*
> >#tty3::respawn:/usr/bin/tail -f /var/log/messages
> >tty3::respawn:/bin/tail -f /var/log/messages
> >*/
> >
> ># Emerge uclibc into the embedded_rootfs.
> ># Use the -K option because we don't get the extra files
> created by the
> ># build/emerge process into our embedded rootfs which needs to be as
> ># small as possible.
> >ROOT=/embedded_rootfs emerge -K uclibc
> >
> ># Emerge busybox into the embedded_rootfs.
> ># First you must emerge it into your development_rootfs.
> ># This does not create the symlinks in our development
> embedded rootfs.
> >emerge busybox
> >ROOT=/embedded_rootfs emerge -K busybox
>
> Busybox is emerged with emerge -e system. Should we emerge
> busybox again?
>
> >
> ># Create the symlinks for busybox in the embedded_rootfs.
> >mkdir /embedded_rootfs/proc
> >mount -o bind /proc/ /embedded_rootfs/proc/
> >chroot /embedded_rootfs /bin/busybox --install -s
> >umount /embedded_rootfs/proc
> >
> ># Set time zone in your embedded_rootfs.
> ># See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
> ># For central standard time in the US, use "CST6CDT".
> >nano -w /embedded_rootfs/etc/TZ
> >/*
> >CST6CDT
> >*/
> >
> ># Install a boot loader (usually grub or lilo).
> ># Once you copy/deploy your embedded_rootfs to your target
> SBC you will
> ># have to run grub on the command line to write to the
> master boot record
> ># (MBR).
> ># For some reason not all of /boot/grub is copied over to the
> ># embedded_rootfs, so a extra manual copy step is needed.
> ># The --nodeps gets rip of the run time need of ncurses.
> >emerge --nodeps grub
> >ROOT=/embedded_rootfs emerge -K --nodeps grub
> >cp -R /boot/grub /embedded_rootfs/boot/
> >
> ># Modify your boot configure file.
> ># The example below is for a gurb, for a boot partition on
> /dev/hda1 and
> >only
> ># one partition on the target SBC system.
> >nano -w /embedded_rootfs/boot/grub/grub.conf
> >/*
> >default 0
> >timeout 10
> >splashimage=(hd0,0)/boot/grub/splash.xpm.gz
> >
> >title=Linux 2.6.x
> >root (hd0,0)
> >kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
> >*/
> >
> ># Set root password for the embedded_rootfs
> >chroot /embedded_rootfs
> >passwd
> >rm /embedded_rootfs/etc/passwd-
> >exit
>
> Can you please check this again? See my previous post.
>
> >
> ># Modify fstab.
> ># Below is mine, yours may vary.
> >nano -w /embedded_rootfs/etc/fstab
> >/*
> >/dev/hda1 / reiserfs
> defaults 0 0
> >none /proc proc
> defaults 0 0
> >none /sys sysfs
> defaults 0 0
> >none /dev/shm tmpfs defaults 0 0
> >*/
> >
> ># Clean up the embedded_rootfs.
> ># Don't know why these files are there in the first place,
> so if anyone
> ># can tell me why.....
> >rm -R /embedded_rootfs/var/db/pkg/*
> >rm -R /embedded_rootfs/var/lib/portage/
> >
> >#---- Step 4 - Build and install non-system programs to the
> embedded_rootfs
> >--
> >
> ># Emerge other software you need for you embedded target.
> ># This is very wildly depending on your needs.
> ># Also your proprietary application will be done here.
> >emerge foo*
> >ROOT=/embedded_rootfs emerge -K foo*
> >
> >
> >#---- Step 5 - Build and install a kernel to the embedded_rootfs
> >-------------
> >
> ># Install a kernel into embedded_rootfs.
> ># First we will emerge it into our development_rootfs, then
> configure and
> ># build it.
> >emerge vanilla-sources
> >cd /usr/src/
> >cd linux
> >make menuconfig
> ># Configure your kernel for your TARGET SBC here. I HIGHLY
> suggest you
> ># configure the kernel to compile everything into the
> kernel, and nothing
> ># as a module.
> >make
> >ROOT=/embedded_rootfs make modules_install
> >cp /usr/src/linux/arch/i386/boot/bzImage
> >/embedded_rootfs/boot/vmlinuz-2.6.x
> >
> ># A few notes on compiling your kernel.
> ># If deploying to Compact Flash/DiskOnChip/SD use ext2, as
> the journaling
> ># filing systems "write" to much for a flash device.
> ># If deploying to a hard drive use a journaling filing
> system, such as
> ># ext3 or reiserfs.
> >
> >
> >#---- Step 6 - Deploy embedded_rootfs to target
> >------------------------------
> >
> ># Prepare a Gentoo (or any Linux distro) system on the
> target SBC using a
> ># harddrive. This is known as the target development rootfs.
> ># We will create a partition (/embedded_rootfs) that will
> server as our
> ># "test" partition to deploy our embedded_rootfs that we
> generate on our
> ># development_system.
> >#
> ># I use the following partitions to speed development (yours
> may vary):
> ># /dev/hda1 - /embedded_rootfs - 1 GB
> ># /dev/hda2 - /boot - 100 MB
> ># /dev/hda3 - swap - (size varies, 512 MB is a good number)
> ># /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0
> install guide
> >specs)
> >#
> ># Copy over your embedded_rootfs from you development system
> to your target
> ># system and the directory /embedded_rootfs. This needs to
> be done via NFS
> >as
> ># need to preserve the permissions.
> >#
> >#The following commands are done from the
> ># target development rootfs.
> >mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
> >mount -t nfs\
> >192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
> >/mnt/nfs_embedded_rootfs
> >cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
> >
> >
> ># Modify your target system's gurb.conf (or lilo.conf) for
> allow you to
> >boot
> ># to the embedded_rootfs partition.
> >#
> ># Reboot, and if all goes well you'll be greeted with a login prompt.
> >#
> ># Fin.
> >
> >
> >--
> >heath holcomb
> >liquidcable at bulah.com
> >www.bulah.com
> >
> >--
> >gentoo-embedded@gentoo.org mailing list
> >
>
> Pierre Cassimans
>
>
> --
> gentoo-embedded@gentoo.org mailing list
>
>
>
Marcel Romijn
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 6:46 Marcel Romijn
@ 2005-08-18 7:02 ` Pierre Cassimans
2005-08-18 10:33 ` Marius Schaefer/Camberg/ISBAC
2005-08-18 15:03 ` Joshua ChaitinPollak
1 sibling, 1 reply; 17+ messages in thread
From: Pierre Cassimans @ 2005-08-18 7:02 UTC (permalink / raw
To: gentoo-embedded
>From: "Marcel Romijn" <MRomijn@seagullsoftware.com>
>Reply-To: gentoo-embedded@lists.gentoo.org
>To: <gentoo-embedded@lists.gentoo.org>
>Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
>Date: Thu, 18 Aug 2005 02:46:18 -0400
>
>
>
> > -----Original Message-----
> > From: Pierre Cassimans [mailto:kammicazze@hotmail.com]
> > Sent: Thursday, 18 August, 2005 8:36
> > To: gentoo-embedded@lists.gentoo.org
> > Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo
> > version 0.08
> >
> >
> >
> >
> > >From: Heath Holcomb <liquidcable@bulah.com>
> > >Reply-To: gentoo-embedded@lists.gentoo.org
> > >To: "'gentoo-embedded@lists.gentoo.org'"
> > <gentoo-embedded@lists.gentoo.org>
> > >Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
> > >Date: Wed, 17 Aug 2005 19:19:38 -0500
> > >
> > >Version 0.08
> > >Please add, delete, modify. Thanks!
> > >
> > >Small fixes, but one very important. All work arounds are back.
> > >
> > >I've update my website with this version also.
> > >http://www.bulah.com/embeddedgentoo.html
> > >
> > >
> > >
> > >#------------------------------------------------------------
> > --------------------
> > ># Embedded Gentoo How-To for x86
> > >#
> > ># A how-to guide to setup a Gentoo embedded environment, you
> > must be root.
> > ># These commands are to be run on your development system,
> > ># any x86 Gentoo Linux computer will do. The system should be fast,
> > ># to speed development. The target can be any x86 based SBC. I'm
> > ># using a Geode based SBC. Latter I'll use a Via based SBC.
> > >#
> > ># versio 0.08
> > ># 2005.8.13
> > >#
> > ># Heath Holcomb (heath at bulah.com)
> > ># Ned Ludd (original commands posted)
> > ># Lloyd Sargent (contributor)
> > ># Yuri Vasilevski (contributor)
> > ># Mike George (contributor)
> > ># Kammi Cazze (contributor)
> > ># Marius Schaefer (contributor)
> > >#
> > ># Definitions and Terms
> > ># system_rootfs = your regular rootfs, development computer
> > ># development_rootfs = what you use to build the embedded_rootfs
> > ># embedded_rootfs = rootfs you deploy to the target system
> > ># SBC = single board computer (here it's an x86 based)
> > >#
> > ># References
> > ># http://www.gentoo.org/doc/en/handbook/index.xml
> > ># http://www.epiawiki.org
> > ># http://epia.kalf.org
> > ># Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
> > >#
> > >#
> > ># Overview of process (steps)
> > ># 1 - Prepare the development_rootfs from your system_rootfs
> > ># 2 - Build the development_rootfs
> > ># 3 - Build the embedded_rootfs
> > ># 4 - Build and install non-system programs to the embedded_rootfs
> > ># 5 - Build and install a kernel to the embedded_rootfs
> > ># 6 - Deploy embedded_rootfs to target
> > >#
> > >#------------------------------------------------------------
> > --------------------
> > >
> > >#----- Step 1 - Prepare the development_rootfs from your
> > system_rootfs
> > >-------
> > >
> > ># You must be root.
> > >su -
> > >cd /opt
> > >
> > ># Create the development_rootfs directory.
> > ># I use i586 because of target is a Geode processor.
> > >mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> > >
> > ># Download the latest stage 1 tarball.
> > >wget \
> > >http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedde
> > d/stages/\
> > >stage1-x86-uclibc-2005.0.tar.bz2
> > >
> > ># Untar the stage to the development_rootfs.
> > >tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
> > >/opt/i586-gentoo-uclibc-linux/
> > >
> > ># Mount the proc and portage directories to your development_rootfs.
> > ># Makes your system_rootfs's proc and portage directory
> > available from
> > >inside
> > ># of your development_rootfs (after chrooting).
> > >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 development_rootfs.
> > >cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> > >
> > ># Chroot into the development_rootfs.
> > >chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
> > >
> > >
> > >#----- Step 2 - Build the development_rootfs
> > >---------------------------------
> > >
> > ># Create new environment and load variables into memory.
> > >env-update
> > >source /etc/profile
> > >
> > ># Modify make.conf file to your liking/needs.
> > >nano -w /etc/make.conf
> > ># This is for my target, Geode x86 processor.
> > >/*
> > >USE="bitmap-fonts minimal truetype-fonts mmx"
> > >CHOST="i586-gentoo-linux-uclibc"
> > >CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> > >CXXFLAGS="${CFLAGS}"
> > >FEATURES="buildpkg"
> > >
> > >VIDEO_CARDS="chips"
> > >UCLIBC_CPU="586MMX"
> > >*/
> >
> > As it is a x86 howto, here are the possible values for UCLIBC_CPU:
> >
> > 386, 486, ELAN, 586, 586MMX, 686, PENTIUMII,
> > PENTIUMIII,PENTIUM4, K6, K7,
> > CRUSOE, WINCHIPC6, WINCHIP2, CYRIXIII, NEHEMIAH.
> >
> > For people with VIA boards, take CYRIXIII or NEHEMIAH.
>
>Is this setting used for both the development and the embedded machine?
>
>I'm developing on a Pentium4, but I'm deploying to a VIA board
>(CytrixIII).
>
I guess it will be effective for your develop environment AND embedded
machine.
As first we emerge uclibc with the FEATURES="buildpkg" and the we deploy
those binaries to the embedded_rootfs with ROOT=/embedded_rootfs emerge -K
uclibc
Can someone confirm this?
> >
> > >
> > ># Set profile to use 2.6 kernel.
> > ># The current stage uses 2.4 by default, and for most cases
> > you are going
> > ># to want a 2.6.x kernel.
> > >cd /etc/
> > >unlink make.profile
> > >ln -s ../usr/portage/profiles/uclibc/x86 make.profile
> > >
> > ># Start the bootstrap script.
> > >cd /usr/portage/scripts
> > >./bootstrap.sh -p -v
> > >./bootstrap.sh
> > >
> > ># Workaround - bootstraping
> > ># Failure compiling uclibc (gcc-config error: Could not
> > run/locate "gcc")?
> > ># If you get a failure while bootstrap is compileing uclibc
> > here are the
> > >steps
> > ># to work around the problem.
> > >gcc-config 1
> > >source /etc/profile
> > >./bootstrap.sh
> > >
> > ># Emerge the system ebuild for the development_rootfs.
> > >emerge -e system
> > >
> > ># Workaround - emerge system
> > ># During emerge -e system, python-fchksum failes complaing about
> > ># gcc-config error: Could not run/locate
> > "i386-gentoo-linux-uclibc-gcc"
> > ># The following commands work around this problem.
> > >emerge python
> > >emerge -e system
> >
> > I still had to do
> >
> > USE="-sandbox" emerge -e system
> >
> > to work around the bug with groff.
> >
> > >
> > >#----- Step 3 - Build the embedded_rootfs
> > >------------------------------------
> > >
> > ># Create the embedded_rootfs directory.
> > >mkdir /embedded_rootfs
> > >
> > ># Emerge baselayout-lite into embedded_rootfs.
> > ># This gives your system a basic file structure.
> > ># 1.0_pre1 is the only one that is stable, right?
> > >cd /usr/portage/sys-apps/baselayout-lite/
> > >ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
> > >
> > ># Workaround - baselayout-lite
> > ># Baselayout-lite is still beta, so a few fixes are needed.
> > ># There needs to be a directory "log" in /var.
> > ># Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
> > >mkdir /embedded_rootfs/var/log
> > >nano -w /embedded_rootfs/etc/inittab
> > >/*
> > >#tty3::respawn:/usr/bin/tail -f /var/log/messages
> > >tty3::respawn:/bin/tail -f /var/log/messages
> > >*/
> > >
> > ># Emerge uclibc into the embedded_rootfs.
> > ># Use the -K option because we don't get the extra files
> > created by the
> > ># build/emerge process into our embedded rootfs which needs to be as
> > ># small as possible.
> > >ROOT=/embedded_rootfs emerge -K uclibc
> > >
> > ># Emerge busybox into the embedded_rootfs.
> > ># First you must emerge it into your development_rootfs.
> > ># This does not create the symlinks in our development
> > embedded rootfs.
> > >emerge busybox
> > >ROOT=/embedded_rootfs emerge -K busybox
> >
> > Busybox is emerged with emerge -e system. Should we emerge
> > busybox again?
> >
> > >
> > ># Create the symlinks for busybox in the embedded_rootfs.
> > >mkdir /embedded_rootfs/proc
> > >mount -o bind /proc/ /embedded_rootfs/proc/
> > >chroot /embedded_rootfs /bin/busybox --install -s
> > >umount /embedded_rootfs/proc
> > >
> > ># Set time zone in your embedded_rootfs.
> > ># See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
> > ># For central standard time in the US, use "CST6CDT".
> > >nano -w /embedded_rootfs/etc/TZ
> > >/*
> > >CST6CDT
> > >*/
> > >
> > ># Install a boot loader (usually grub or lilo).
> > ># Once you copy/deploy your embedded_rootfs to your target
> > SBC you will
> > ># have to run grub on the command line to write to the
> > master boot record
> > ># (MBR).
> > ># For some reason not all of /boot/grub is copied over to the
> > ># embedded_rootfs, so a extra manual copy step is needed.
> > ># The --nodeps gets rip of the run time need of ncurses.
> > >emerge --nodeps grub
> > >ROOT=/embedded_rootfs emerge -K --nodeps grub
> > >cp -R /boot/grub /embedded_rootfs/boot/
> > >
> > ># Modify your boot configure file.
> > ># The example below is for a gurb, for a boot partition on
> > /dev/hda1 and
> > >only
> > ># one partition on the target SBC system.
> > >nano -w /embedded_rootfs/boot/grub/grub.conf
> > >/*
> > >default 0
> > >timeout 10
> > >splashimage=(hd0,0)/boot/grub/splash.xpm.gz
> > >
> > >title=Linux 2.6.x
> > >root (hd0,0)
> > >kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
> > >*/
> > >
> > ># Set root password for the embedded_rootfs
> > >chroot /embedded_rootfs
> > >passwd
> > >rm /embedded_rootfs/etc/passwd-
> > >exit
> >
> > Can you please check this again? See my previous post.
> >
> > >
> > ># Modify fstab.
> > ># Below is mine, yours may vary.
> > >nano -w /embedded_rootfs/etc/fstab
> > >/*
> > >/dev/hda1 / reiserfs
> > defaults 0 0
> > >none /proc proc
> > defaults 0 0
> > >none /sys sysfs
> > defaults 0 0
> > >none /dev/shm tmpfs defaults 0 0
> > >*/
> > >
> > ># Clean up the embedded_rootfs.
> > ># Don't know why these files are there in the first place,
> > so if anyone
> > ># can tell me why.....
> > >rm -R /embedded_rootfs/var/db/pkg/*
> > >rm -R /embedded_rootfs/var/lib/portage/
> > >
> > >#---- Step 4 - Build and install non-system programs to the
> > embedded_rootfs
> > >--
> > >
> > ># Emerge other software you need for you embedded target.
> > ># This is very wildly depending on your needs.
> > ># Also your proprietary application will be done here.
> > >emerge foo*
> > >ROOT=/embedded_rootfs emerge -K foo*
> > >
> > >
> > >#---- Step 5 - Build and install a kernel to the embedded_rootfs
> > >-------------
> > >
> > ># Install a kernel into embedded_rootfs.
> > ># First we will emerge it into our development_rootfs, then
> > configure and
> > ># build it.
> > >emerge vanilla-sources
> > >cd /usr/src/
> > >cd linux
> > >make menuconfig
> > ># Configure your kernel for your TARGET SBC here. I HIGHLY
> > suggest you
> > ># configure the kernel to compile everything into the
> > kernel, and nothing
> > ># as a module.
> > >make
> > >ROOT=/embedded_rootfs make modules_install
> > >cp /usr/src/linux/arch/i386/boot/bzImage
> > >/embedded_rootfs/boot/vmlinuz-2.6.x
> > >
> > ># A few notes on compiling your kernel.
> > ># If deploying to Compact Flash/DiskOnChip/SD use ext2, as
> > the journaling
> > ># filing systems "write" to much for a flash device.
> > ># If deploying to a hard drive use a journaling filing
> > system, such as
> > ># ext3 or reiserfs.
> > >
> > >
> > >#---- Step 6 - Deploy embedded_rootfs to target
> > >------------------------------
> > >
> > ># Prepare a Gentoo (or any Linux distro) system on the
> > target SBC using a
> > ># harddrive. This is known as the target development rootfs.
> > ># We will create a partition (/embedded_rootfs) that will
> > server as our
> > ># "test" partition to deploy our embedded_rootfs that we
> > generate on our
> > ># development_system.
> > >#
> > ># I use the following partitions to speed development (yours
> > may vary):
> > ># /dev/hda1 - /embedded_rootfs - 1 GB
> > ># /dev/hda2 - /boot - 100 MB
> > ># /dev/hda3 - swap - (size varies, 512 MB is a good number)
> > ># /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0
> > install guide
> > >specs)
> > >#
> > ># Copy over your embedded_rootfs from you development system
> > to your target
> > ># system and the directory /embedded_rootfs. This needs to
> > be done via NFS
> > >as
> > ># need to preserve the permissions.
> > >#
> > >#The following commands are done from the
> > ># target development rootfs.
> > >mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
> > >mount -t nfs\
> > >192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
> > >/mnt/nfs_embedded_rootfs
> > >cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
> > >
> > >
> > ># Modify your target system's gurb.conf (or lilo.conf) for
> > allow you to
> > >boot
> > ># to the embedded_rootfs partition.
> > >#
> > ># Reboot, and if all goes well you'll be greeted with a login prompt.
> > >#
> > ># Fin.
> > >
> > >
> > >--
> > >heath holcomb
> > >liquidcable at bulah.com
> > >www.bulah.com
> > >
> > >--
> > >gentoo-embedded@gentoo.org mailing list
> > >
> >
> > Pierre Cassimans
> >
> >
> > --
> > gentoo-embedded@gentoo.org mailing list
> >
> >
> >
>
>Marcel Romijn
>
>--
>gentoo-embedded@gentoo.org mailing list
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 6:35 ` Pierre Cassimans
@ 2005-08-18 7:30 ` Natanael Copa
2005-08-18 7:39 ` Pierre Cassimans
0 siblings, 1 reply; 17+ messages in thread
From: Natanael Copa @ 2005-08-18 7:30 UTC (permalink / raw
To: gentoo-embedded
Pierre Cassimans wrote:
>> # Workaround - emerge system
>> # During emerge -e system, python-fchksum failes complaing about
>> # gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
>> # The following commands work around this problem.
>> emerge python
>> emerge -e system
>
>
> I still had to do
>
> USE="-sandbox" emerge -e system
>
> to work around the bug with groff.
Altnerative:
echo "sys-apps/groff -sandbox" > /etc/portage/package.use
emerge -e system
Then will groff be the only package that uses the -sandbox.
--
Natanael Copa
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 7:30 ` Natanael Copa
@ 2005-08-18 7:39 ` Pierre Cassimans
2005-08-18 7:47 ` Natanael Copa
0 siblings, 1 reply; 17+ messages in thread
From: Pierre Cassimans @ 2005-08-18 7:39 UTC (permalink / raw
To: gentoo-embedded
>From: Natanael Copa <mlists@tanael.org>
>Reply-To: gentoo-embedded@lists.gentoo.org
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
>Date: Thu, 18 Aug 2005 09:30:01 +0200
>
>Pierre Cassimans wrote:
>>># Workaround - emerge system
>>># During emerge -e system, python-fchksum failes complaing about
>>># gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
>>># The following commands work around this problem.
>>>emerge python
>>>emerge -e system
>>
>>
>>I still had to do
>>
>>USE="-sandbox" emerge -e system
>>
>>to work around the bug with groff.
>
>Altnerative:
>echo "sys-apps/groff -sandbox" > /etc/portage/package.use
>emerge -e system
>
>Then will groff be the only package that uses the -sandbox.
>
>--
>Natanael Copa
>
>--
>gentoo-embedded@gentoo.org mailing list
>
Is it a hidden use flag? emerge -pv groff doesn't show me the possible
sandbox use flag.
Pierre Cassimans
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 7:39 ` Pierre Cassimans
@ 2005-08-18 7:47 ` Natanael Copa
2005-08-18 7:56 ` Pierre Cassimans
0 siblings, 1 reply; 17+ messages in thread
From: Natanael Copa @ 2005-08-18 7:47 UTC (permalink / raw
To: gentoo-embedded
Pierre Cassimans wrote:
>>> I still had to do
>>>
>>> USE="-sandbox" emerge -e system
>>>
>>> to work around the bug with groff.
>>
>>
>> Altnerative:
>> echo "sys-apps/groff -sandbox" > /etc/portage/package.use
>> emerge -e system
>>
>> Then will groff be the only package that uses the -sandbox.
>
>
> Is it a hidden use flag? emerge -pv groff doesn't show me the possible
> sandbox use flag.
Its a "feature" so it should be:
FEATURES="-sandbox" emerge -e system
But if it works putting it in the use flag...
--
Natanael Copa
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 7:47 ` Natanael Copa
@ 2005-08-18 7:56 ` Pierre Cassimans
2005-08-18 15:06 ` Joshua ChaitinPollak
0 siblings, 1 reply; 17+ messages in thread
From: Pierre Cassimans @ 2005-08-18 7:56 UTC (permalink / raw
To: gentoo-embedded
>From: Natanael Copa <mlists@tanael.org>
>Reply-To: gentoo-embedded@lists.gentoo.org
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
>Date: Thu, 18 Aug 2005 09:47:44 +0200
>
>Pierre Cassimans wrote:
>
>>>>I still had to do
>>>>
>>>>USE="-sandbox" emerge -e system
>>>>
>>>>to work around the bug with groff.
>>>
>>>
>>>Altnerative:
>>>echo "sys-apps/groff -sandbox" > /etc/portage/package.use
>>>emerge -e system
>>>
>>>Then will groff be the only package that uses the -sandbox.
>>
>>
>>Is it a hidden use flag? emerge -pv groff doesn't show me the possible
>>sandbox use flag.
>
>
>Its a "feature" so it should be:
>FEATURES="-sandbox" emerge -e system
>
>But if it works putting it in the use flag...
>
>--
>Natanael Copa
>--
>gentoo-embedded@gentoo.org mailing list
>
That's what's strange about it, if i FEATURES="-sandbox" emerge groff, it
doesn't work, but USE="-sandbox" emerge -e system is works.
Well, we have a workaround that works, so no need to dig in it ;)
Pierre Cassimans
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 7:02 ` Pierre Cassimans
@ 2005-08-18 10:33 ` Marius Schaefer/Camberg/ISBAC
0 siblings, 0 replies; 17+ messages in thread
From: Marius Schaefer/Camberg/ISBAC @ 2005-08-18 10:33 UTC (permalink / raw
To: gentoo-embedded
"Pierre Cassimans" <kammicazze@hotmail.com> wrote on 18.08.2005 09:02:13:
>
>
>
> >From: "Marcel Romijn" <MRomijn@seagullsoftware.com>
> >Reply-To: gentoo-embedded@lists.gentoo.org
> >To: <gentoo-embedded@lists.gentoo.org>
> >Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.08
> >Date: Thu, 18 Aug 2005 02:46:18 -0400
> >
> >
> >
> > > -----Original Message-----
> > > From: Pierre Cassimans [mailto:kammicazze@hotmail.com]
> > > Sent: Thursday, 18 August, 2005 8:36
> > > To: gentoo-embedded@lists.gentoo.org
> > > Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo
> > > version 0.08
> > >
> > >
> > >
> > >
> > > >From: Heath Holcomb <liquidcable@bulah.com>
> > > >Reply-To: gentoo-embedded@lists.gentoo.org
> > > >To: "'gentoo-embedded@lists.gentoo.org'"
> > > <gentoo-embedded@lists.gentoo.org>
> > > >Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.08
> > > >Date: Wed, 17 Aug 2005 19:19:38 -0500
> > > >
> > > >Version 0.08
> > > >Please add, delete, modify. Thanks!
> > > >
> > > >Small fixes, but one very important. All work arounds are back.
> > > >
> > > >I've update my website with this version also.
> > > >http://www.bulah.com/embeddedgentoo.html
> > > >
> > > >
> > > >
> > > >#------------------------------------------------------------
> > > --------------------
> > > ># Embedded Gentoo How-To for x86
> > > >#
> > > ># A how-to guide to setup a Gentoo embedded environment, you
> > > must be root.
> > > ># These commands are to be run on your development system,
> > > ># any x86 Gentoo Linux computer will do. The system should be
fast,
> > > ># to speed development. The target can be any x86 based SBC. I'm
> > > ># using a Geode based SBC. Latter I'll use a Via based SBC.
> > > >#
> > > ># versio 0.08
> > > ># 2005.8.13
> > > >#
> > > ># Heath Holcomb (heath at bulah.com)
> > > ># Ned Ludd (original commands posted)
> > > ># Lloyd Sargent (contributor)
> > > ># Yuri Vasilevski (contributor)
> > > ># Mike George (contributor)
> > > ># Kammi Cazze (contributor)
> > > ># Marius Schaefer (contributor)
> > > >#
> > > ># Definitions and Terms
> > > ># system_rootfs = your regular rootfs, development computer
> > > ># development_rootfs = what you use to build the embedded_rootfs
> > > ># embedded_rootfs = rootfs you deploy to the target system
> > > ># SBC = single board computer (here it's an x86 based)
> > > >#
> > > ># References
> > > ># http://www.gentoo.org/doc/en/handbook/index.xml
> > > ># http://www.epiawiki.org
> > > ># http://epia.kalf.org
> > > ># Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
> > > >#
> > > >#
> > > ># Overview of process (steps)
> > > ># 1 - Prepare the development_rootfs from your system_rootfs
> > > ># 2 - Build the development_rootfs
> > > ># 3 - Build the embedded_rootfs
> > > ># 4 - Build and install non-system programs to the embedded_rootfs
> > > ># 5 - Build and install a kernel to the embedded_rootfs
> > > ># 6 - Deploy embedded_rootfs to target
> > > >#
> > > >#------------------------------------------------------------
> > > --------------------
> > > >
> > > >#----- Step 1 - Prepare the development_rootfs from your
> > > system_rootfs
> > > >-------
> > > >
> > > ># You must be root.
> > > >su -
> > > >cd /opt
> > > >
> > > ># Create the development_rootfs directory.
> > > ># I use i586 because of target is a Geode processor.
> > > >mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> > > >
> > > ># Download the latest stage 1 tarball.
> > > >wget \
> > > >http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedde
> > > d/stages/\
> > > >stage1-x86-uclibc-2005.0.tar.bz2
> > > >
> > > ># Untar the stage to the development_rootfs.
> > > >tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
> > > >/opt/i586-gentoo-uclibc-linux/
> > > >
> > > ># Mount the proc and portage directories to your
development_rootfs.
> > > ># Makes your system_rootfs's proc and portage directory
> > > available from
> > > >inside
> > > ># of your development_rootfs (after chrooting).
> > > >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 development_rootfs.
> > > >cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> > > >
> > > ># Chroot into the development_rootfs.
> > > >chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
> > > >
> > > >
> > > >#----- Step 2 - Build the development_rootfs
> > > >---------------------------------
> > > >
> > > ># Create new environment and load variables into memory.
> > > >env-update
> > > >source /etc/profile
> > > >
> > > ># Modify make.conf file to your liking/needs.
> > > >nano -w /etc/make.conf
> > > ># This is for my target, Geode x86 processor.
> > > >/*
> > > >USE="bitmap-fonts minimal truetype-fonts mmx"
> > > >CHOST="i586-gentoo-linux-uclibc"
> > > >CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> > > >CXXFLAGS="${CFLAGS}"
> > > >FEATURES="buildpkg"
> > > >
> > > >VIDEO_CARDS="chips"
> > > >UCLIBC_CPU="586MMX"
> > > >*/
> > >
> > > As it is a x86 howto, here are the possible values for UCLIBC_CPU:
> > >
> > > 386, 486, ELAN, 586, 586MMX, 686, PENTIUMII,
> > > PENTIUMIII,PENTIUM4, K6, K7,
> > > CRUSOE, WINCHIPC6, WINCHIP2, CYRIXIII, NEHEMIAH.
> > >
> > > For people with VIA boards, take CYRIXIII or NEHEMIAH.
> >
> >Is this setting used for both the development and the embedded machine?
> >
> >I'm developing on a Pentium4, but I'm deploying to a VIA board
> >(CytrixIII).
> >
>
> I guess it will be effective for your develop environment AND embedded
> machine.
>
> As first we emerge uclibc with the FEATURES="buildpkg" and the we deploy
> those binaries to the embedded_rootfs with ROOT=/embedded_rootfs emerge
-K
> uclibc
>
> Can someone confirm this?
As the development machine will be usually more powerfull than the target
machine, I think, it should be set to the target hardware.
For the HowTO IMHO it should be set to something common like 386 or 486 as
default. Something every CPU can handle.
Marius
>
> > >
> > > >
> > > ># Set profile to use 2.6 kernel.
> > > ># The current stage uses 2.4 by default, and for most cases
> > > you are going
> > > ># to want a 2.6.x kernel.
> > > >cd /etc/
> > > >unlink make.profile
> > > >ln -s ../usr/portage/profiles/uclibc/x86 make.profile
> > > >
> > > ># Start the bootstrap script.
> > > >cd /usr/portage/scripts
> > > >./bootstrap.sh -p -v
> > > >./bootstrap.sh
> > > >
> > > ># Workaround - bootstraping
> > > ># Failure compiling uclibc (gcc-config error: Could not
> > > run/locate "gcc")?
> > > ># If you get a failure while bootstrap is compileing uclibc
> > > here are the
> > > >steps
> > > ># to work around the problem.
> > > >gcc-config 1
> > > >source /etc/profile
> > > >./bootstrap.sh
> > > >
> > > ># Emerge the system ebuild for the development_rootfs.
> > > >emerge -e system
> > > >
> > > ># Workaround - emerge system
> > > ># During emerge -e system, python-fchksum failes complaing about
> > > ># gcc-config error: Could not run/locate
> > > "i386-gentoo-linux-uclibc-gcc"
> > > ># The following commands work around this problem.
> > > >emerge python
> > > >emerge -e system
> > >
> > > I still had to do
> > >
> > > USE="-sandbox" emerge -e system
> > >
> > > to work around the bug with groff.
> > >
> > > >
> > > >#----- Step 3 - Build the embedded_rootfs
> > > >------------------------------------
> > > >
> > > ># Create the embedded_rootfs directory.
> > > >mkdir /embedded_rootfs
> > > >
> > > ># Emerge baselayout-lite into embedded_rootfs.
> > > ># This gives your system a basic file structure.
> > > ># 1.0_pre1 is the only one that is stable, right?
> > > >cd /usr/portage/sys-apps/baselayout-lite/
> > > >ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
> > > >
> > > ># Workaround - baselayout-lite
> > > ># Baselayout-lite is still beta, so a few fixes are needed.
> > > ># There needs to be a directory "log" in /var.
> > > ># Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
> > > >mkdir /embedded_rootfs/var/log
> > > >nano -w /embedded_rootfs/etc/inittab
> > > >/*
> > > >#tty3::respawn:/usr/bin/tail -f /var/log/messages
> > > >tty3::respawn:/bin/tail -f /var/log/messages
> > > >*/
> > > >
> > > ># Emerge uclibc into the embedded_rootfs.
> > > ># Use the -K option because we don't get the extra files
> > > created by the
> > > ># build/emerge process into our embedded rootfs which needs to be
as
> > > ># small as possible.
> > > >ROOT=/embedded_rootfs emerge -K uclibc
> > > >
> > > ># Emerge busybox into the embedded_rootfs.
> > > ># First you must emerge it into your development_rootfs.
> > > ># This does not create the symlinks in our development
> > > embedded rootfs.
> > > >emerge busybox
> > > >ROOT=/embedded_rootfs emerge -K busybox
> > >
> > > Busybox is emerged with emerge -e system. Should we emerge
> > > busybox again?
> > >
> > > >
> > > ># Create the symlinks for busybox in the embedded_rootfs.
> > > >mkdir /embedded_rootfs/proc
> > > >mount -o bind /proc/ /embedded_rootfs/proc/
> > > >chroot /embedded_rootfs /bin/busybox --install -s
> > > >umount /embedded_rootfs/proc
> > > >
> > > ># Set time zone in your embedded_rootfs.
> > > ># See http://leaf.sourceforge.net/doc/guide/buci-tz.html for
details.
> > > ># For central standard time in the US, use "CST6CDT".
> > > >nano -w /embedded_rootfs/etc/TZ
> > > >/*
> > > >CST6CDT
> > > >*/
> > > >
> > > ># Install a boot loader (usually grub or lilo).
> > > ># Once you copy/deploy your embedded_rootfs to your target
> > > SBC you will
> > > ># have to run grub on the command line to write to the
> > > master boot record
> > > ># (MBR).
> > > ># For some reason not all of /boot/grub is copied over to the
> > > ># embedded_rootfs, so a extra manual copy step is needed.
> > > ># The --nodeps gets rip of the run time need of ncurses.
> > > >emerge --nodeps grub
> > > >ROOT=/embedded_rootfs emerge -K --nodeps grub
> > > >cp -R /boot/grub /embedded_rootfs/boot/
> > > >
> > > ># Modify your boot configure file.
> > > ># The example below is for a gurb, for a boot partition on
> > > /dev/hda1 and
> > > >only
> > > ># one partition on the target SBC system.
> > > >nano -w /embedded_rootfs/boot/grub/grub.conf
> > > >/*
> > > >default 0
> > > >timeout 10
> > > >splashimage=(hd0,0)/boot/grub/splash.xpm.gz
> > > >
> > > >title=Linux 2.6.x
> > > >root (hd0,0)
> > > >kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
> > > >*/
> > > >
> > > ># Set root password for the embedded_rootfs
> > > >chroot /embedded_rootfs
> > > >passwd
> > > >rm /embedded_rootfs/etc/passwd-
> > > >exit
> > >
> > > Can you please check this again? See my previous post.
> > >
> > > >
> > > ># Modify fstab.
> > > ># Below is mine, yours may vary.
> > > >nano -w /embedded_rootfs/etc/fstab
> > > >/*
> > > >/dev/hda1 / reiserfs
> > > defaults 0 0
> > > >none /proc proc
> > > defaults 0 0
> > > >none /sys sysfs
> > > defaults 0 0
> > > >none /dev/shm tmpfs defaults 0 0
> > > >*/
> > > >
> > > ># Clean up the embedded_rootfs.
> > > ># Don't know why these files are there in the first place,
> > > so if anyone
> > > ># can tell me why.....
> > > >rm -R /embedded_rootfs/var/db/pkg/*
> > > >rm -R /embedded_rootfs/var/lib/portage/
> > > >
> > > >#---- Step 4 - Build and install non-system programs to the
> > > embedded_rootfs
> > > >--
> > > >
> > > ># Emerge other software you need for you embedded target.
> > > ># This is very wildly depending on your needs.
> > > ># Also your proprietary application will be done here.
> > > >emerge foo*
> > > >ROOT=/embedded_rootfs emerge -K foo*
> > > >
> > > >
> > > >#---- Step 5 - Build and install a kernel to the embedded_rootfs
> > > >-------------
> > > >
> > > ># Install a kernel into embedded_rootfs.
> > > ># First we will emerge it into our development_rootfs, then
> > > configure and
> > > ># build it.
> > > >emerge vanilla-sources
> > > >cd /usr/src/
> > > >cd linux
> > > >make menuconfig
> > > ># Configure your kernel for your TARGET SBC here. I HIGHLY
> > > suggest you
> > > ># configure the kernel to compile everything into the
> > > kernel, and nothing
> > > ># as a module.
> > > >make
> > > >ROOT=/embedded_rootfs make modules_install
> > > >cp /usr/src/linux/arch/i386/boot/bzImage
> > > >/embedded_rootfs/boot/vmlinuz-2.6.x
> > > >
> > > ># A few notes on compiling your kernel.
> > > ># If deploying to Compact Flash/DiskOnChip/SD use ext2, as
> > > the journaling
> > > ># filing systems "write" to much for a flash device.
> > > ># If deploying to a hard drive use a journaling filing
> > > system, such as
> > > ># ext3 or reiserfs.
> > > >
> > > >
> > > >#---- Step 6 - Deploy embedded_rootfs to target
> > > >------------------------------
> > > >
> > > ># Prepare a Gentoo (or any Linux distro) system on the
> > > target SBC using a
> > > ># harddrive. This is known as the target development rootfs.
> > > ># We will create a partition (/embedded_rootfs) that will
> > > server as our
> > > ># "test" partition to deploy our embedded_rootfs that we
> > > generate on our
> > > ># development_system.
> > > >#
> > > ># I use the following partitions to speed development (yours
> > > may vary):
> > > ># /dev/hda1 - /embedded_rootfs - 1 GB
> > > ># /dev/hda2 - /boot - 100 MB
> > > ># /dev/hda3 - swap - (size varies, 512 MB is a good number)
> > > ># /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0
> > > install guide
> > > >specs)
> > > >#
> > > ># Copy over your embedded_rootfs from you development system
> > > to your target
> > > ># system and the directory /embedded_rootfs. This needs to
> > > be done via NFS
> > > >as
> > > ># need to preserve the permissions.
> > > >#
> > > >#The following commands are done from the
> > > ># target development rootfs.
> > > >mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
> > > >mount -t nfs\
> > > >192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
> > > >/mnt/nfs_embedded_rootfs
> > > >cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
> > > >
> > > >
> > > ># Modify your target system's gurb.conf (or lilo.conf) for
> > > allow you to
> > > >boot
> > > ># to the embedded_rootfs partition.
> > > >#
> > > ># Reboot, and if all goes well you'll be greeted with a login
prompt.
> > > >#
> > > ># Fin.
> > > >
> > > >
> > > >--
> > > >heath holcomb
> > > >liquidcable at bulah.com
> > > >www.bulah.com
> > > >
> > > >--
> > > >gentoo-embedded@gentoo.org mailing list
> > > >
> > >
> > > Pierre Cassimans
> > >
> > >
> > > --
> > > gentoo-embedded@gentoo.org mailing list
> > >
> > >
> > >
> >
> >Marcel Romijn
> >
> >--
> >gentoo-embedded@gentoo.org mailing list
> >
>
>
> --
> gentoo-embedded@gentoo.org mailing list
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 6:46 Marcel Romijn
2005-08-18 7:02 ` Pierre Cassimans
@ 2005-08-18 15:03 ` Joshua ChaitinPollak
1 sibling, 0 replies; 17+ messages in thread
From: Joshua ChaitinPollak @ 2005-08-18 15:03 UTC (permalink / raw
To: gentoo-embedded
On Aug 18, 2005, at 2:46 AM, Marcel Romijn wrote:
>> As it is a x86 howto, here are the possible values for UCLIBC_CPU:
>>
>> 386, 486, ELAN, 586, 586MMX, 686, PENTIUMII,
>> PENTIUMIII,PENTIUM4, K6, K7,
>> CRUSOE, WINCHIPC6, WINCHIP2, CYRIXIII, NEHEMIAH.
>>
>> For people with VIA boards, take CYRIXIII or NEHEMIAH.
>>
>
> Is this setting used for both the development and the embedded
> machine?
>
> I'm developing on a Pentium4, but I'm deploying to a VIA board
> (CytrixIII).
The idea in this Howto is to use filesystems inside filesystems. What
I mean is this (pardon me if you already know this stuff):
I have a full Gentoo installation with all the optimizations for my
desktop processor installed.
Then, following the Howto, I create on my harddrive a directory called:
/opt/i586-gentoo-uclibc-linux
And inside that you basically install a SECOND gentoo installation,
but this time using uclibc and with optimizations for your target
platform. This is sort of a bridge to the eventual filesystem you'll
install on your embedded device. X, KDE, Gnome, or whatever will
still run on your regular installation, but when you build targets
for the embedded device, you'll change into this new uclib based
filesystem, which is optimized for the embedded environment. Thats
what the chroot command does. I
But this development installation, although optimized for your target
device has too much junk to install onto an embedded device (the
entire portage tree for example), so that is why you created the /
embedded_rootfs directory, and emerge binary packages into that
directory. Emerging just the binaries will ensure you don't get too
much extra garbage in the final filesystem you'll install to your
device.
After following this howto, your computer filestructure will look
like this:
/ <- Your desktop optimized installation. Could be Gentoo, SuSE,
RedHat, or anything else.
| - dev/
| - home/
| - .... (etc)
| - /opt/i586-gentoo-uclibc/ <- 'full' Gentoo installation optimized
for your embedded machine
|
| - embedded_rootfs <-'minimal'
install to put onto the embedded device.
Maybe putting this explanation in the How-to would be useful?
-Josh
--
Joshua ChaitinPollak
Software Engineer
Kiva Systems
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 7:56 ` Pierre Cassimans
@ 2005-08-18 15:06 ` Joshua ChaitinPollak
0 siblings, 0 replies; 17+ messages in thread
From: Joshua ChaitinPollak @ 2005-08-18 15:06 UTC (permalink / raw
To: gentoo-embedded
On Aug 18, 2005, at 3:56 AM, Pierre Cassimans wrote:
>>
>>>>> I still had to do
>>>>>
>>>>> USE="-sandbox" emerge -e system
>>>>>
>>>>> to work around the bug with groff.
I did not do this, but system (seemed to) emerged correctly. I have
no idea why though.
--
Joshua ChaitinPollak
Software Engineer
Kiva Systems
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-08-18 0:19 [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08 Heath Holcomb
2005-08-18 6:35 ` Pierre Cassimans
@ 2005-09-19 13:53 ` Marius Schäfer
2005-09-21 14:48 ` Pierre Cassimans
1 sibling, 1 reply; 17+ messages in thread
From: Marius Schäfer @ 2005-09-19 13:53 UTC (permalink / raw
To: gentoo-embedded; +Cc: Heath Holcomb
Hi,
I just tried out the How-To, some things came to my mind while doing so...
On Thursday 18 August 2005 02:19, Heath Holcomb wrote:
> Version 0.08
> Please add, delete, modify. Thanks!
>
> Small fixes, but one very important. All work arounds are back.
>
> I've update my website with this version also.
> http://www.bulah.com/embeddedgentoo.html
>
>
>
> #--------------------------------------------------------------------------
>------ # Embedded Gentoo How-To for x86
> #
> # A how-to guide to setup a Gentoo embedded environment, you must be root.
> # These commands are to be run on your development system,
> # any x86 Gentoo Linux computer will do. The system should be fast,
> # to speed development. The target can be any x86 based SBC. I'm
> # using a Geode based SBC. Latter I'll use a Via based SBC.
> #
> # versio 0.08
> # 2005.8.13
> #
> # Heath Holcomb (heath at bulah.com)
> # Ned Ludd (original commands posted)
> # Lloyd Sargent (contributor)
> # Yuri Vasilevski (contributor)
> # Mike George (contributor)
> # Kammi Cazze (contributor)
> # Marius Schaefer (contributor)
> #
> # Definitions and Terms
> # system_rootfs = your regular rootfs, development computer
> # development_rootfs = what you use to build the embedded_rootfs
> # embedded_rootfs = rootfs you deploy to the target system
> # SBC = single board computer (here it's an x86 based)
> #
> # References
> # http://www.gentoo.org/doc/en/handbook/index.xml
> # http://www.epiawiki.org
> # http://epia.kalf.org
> # Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
> #
> #
> # Overview of process (steps)
> # 1 - Prepare the development_rootfs from your system_rootfs
> # 2 - Build the development_rootfs
> # 3 - Build the embedded_rootfs
> # 4 - Build and install non-system programs to the embedded_rootfs
> # 5 - Build and install a kernel to the embedded_rootfs
> # 6 - Deploy embedded_rootfs to target
> #
> #--------------------------------------------------------------------------
>------
>
> #----- Step 1 - Prepare the development_rootfs from your system_rootfs
> -------
>
> # You must be root.
> su -
> cd /opt
>
> # Create the development_rootfs directory.
> # I use i586 because of target is a Geode processor.
> mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
>
> # Download the latest stage 1 tarball.
> wget \
> http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedded/stages/\
> stage1-x86-uclibc-2005.0.tar.bz2
>
> # Untar the stage to the development_rootfs.
> tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
> /opt/i586-gentoo-uclibc-linux/
>
> # Mount the proc and portage directories to your development_rootfs.
> # Makes your system_rootfs's proc and portage directory available from
> inside # of your development_rootfs (after chrooting).
> 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 development_rootfs.
> cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
>
> # Chroot into the development_rootfs.
> chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
>
>
> #----- Step 2 - Build the development_rootfs
> ---------------------------------
>
> # Create new environment and load variables into memory.
> env-update
> source /etc/profile
>
> # Modify make.conf file to your liking/needs.
> nano -w /etc/make.conf
> # This is for my target, Geode x86 processor.
> /*
> USE="bitmap-fonts minimal truetype-fonts mmx"
> CHOST="i586-gentoo-linux-uclibc"
> CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> CXXFLAGS="${CFLAGS}"
> FEATURES="buildpkg"
>
> VIDEO_CARDS="chips"
> UCLIBC_CPU="586MMX"
> */
>
> # Set profile to use 2.6 kernel.
> # The current stage uses 2.4 by default, and for most cases you are going
> # to want a 2.6.x kernel.
> cd /etc/
> unlink make.profile
> ln -s ../usr/portage/profiles/uclibc/x86 make.profile
>
> # Start the bootstrap script.
> cd /usr/portage/scripts
> ./bootstrap.sh -p -v
> ./bootstrap.sh
>
> # Workaround - bootstraping
> # Failure compiling uclibc (gcc-config error: Could not run/locate "gcc")?
> # If you get a failure while bootstrap is compileing uclibc here are the
> steps # to work around the problem.
> gcc-config 1
> source /etc/profile
> ./bootstrap.sh
>
> # Emerge the system ebuild for the development_rootfs.
> emerge -e system
>
> # Workaround - emerge system
> # During emerge -e system, python-fchksum failes complaing about
> # gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
> # The following commands work around this problem.
> emerge python
> emerge -e system
I didn't have to do any of these two workarounds.
>
> #----- Step 3 - Build the embedded_rootfs
> ------------------------------------
>
> # Create the embedded_rootfs directory.
> mkdir /embedded_rootfs
>
> # Emerge baselayout-lite into embedded_rootfs.
> # This gives your system a basic file structure.
> # 1.0_pre1 is the only one that is stable, right?
> cd /usr/portage/sys-apps/baselayout-lite/
> ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
>
> # Workaround - baselayout-lite
> # Baselayout-lite is still beta, so a few fixes are needed.
> # There needs to be a directory "log" in /var.
> # Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
> mkdir /embedded_rootfs/var/log
> nano -w /embedded_rootfs/etc/inittab
> /*
> #tty3::respawn:/usr/bin/tail -f /var/log/messages
> tty3::respawn:/bin/tail -f /var/log/messages
> */
>
> # Emerge uclibc into the embedded_rootfs.
> # Use the -K option because we don't get the extra files created by the
> # build/emerge process into our embedded rootfs which needs to be as
> # small as possible.
> ROOT=/embedded_rootfs emerge -K uclibc
>
> # Emerge busybox into the embedded_rootfs.
> # First you must emerge it into your development_rootfs.
> # This does not create the symlinks in our development embedded rootfs.
> emerge busybox
> ROOT=/embedded_rootfs emerge -K busybox
>
> # Create the symlinks for busybox in the embedded_rootfs.
> mkdir /embedded_rootfs/proc
> mount -o bind /proc/ /embedded_rootfs/proc/
> chroot /embedded_rootfs /bin/busybox --install -s
> umount /embedded_rootfs/proc
>
> # Set time zone in your embedded_rootfs.
> # See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
> # For central standard time in the US, use "CST6CDT".
> nano -w /embedded_rootfs/etc/TZ
> /*
> CST6CDT
> */
>
> # Install a boot loader (usually grub or lilo).
> # Once you copy/deploy your embedded_rootfs to your target SBC you will
> # have to run grub on the command line to write to the master boot record
> # (MBR).
> # For some reason not all of /boot/grub is copied over to the
> # embedded_rootfs, so a extra manual copy step is needed.
> # The --nodeps gets rip of the run time need of ncurses.
> emerge --nodeps grub
> ROOT=/embedded_rootfs emerge -K --nodeps grub
> cp -R /boot/grub /embedded_rootfs/boot/
>
> # Modify your boot configure file.
> # The example below is for a gurb, for a boot partition on /dev/hda1 and
> only # one partition on the target SBC system.
> nano -w /embedded_rootfs/boot/grub/grub.conf
> /*
> default 0
> timeout 10
> splashimage=(hd0,0)/boot/grub/splash.xpm.gz
>
> title=Linux 2.6.x
> root (hd0,0)
> kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
> */
>
> # Set root password for the embedded_rootfs
> chroot /embedded_rootfs
This gave me 'cannot run command `/bin/bash': No such file or directory'.
So I had to use 'chroot /embedded_rootfs /bin/sh'.
> passwd
> rm /embedded_rootfs/etc/passwd-
> exit
Correct order should be:
chroot /embedded_rootfs
passwd
exit
rm /embedded_rootfs/etc/passwd-
Or use 'rm /etc/passwd-'.
>
> # Modify fstab.
> # Below is mine, yours may vary.
> nano -w /embedded_rootfs/etc/fstab
> /*
> /dev/hda1 / reiserfs defaults 0 0
> none /proc proc defaults 0 0
> none /sys sysfs defaults 0 0
> none /dev/shm tmpfs defaults 0 0
> */
>
> # Clean up the embedded_rootfs.
> # Don't know why these files are there in the first place, so if anyone
> # can tell me why.....
> rm -R /embedded_rootfs/var/db/pkg/*
> rm -R /embedded_rootfs/var/lib/portage/
>
> #---- Step 4 - Build and install non-system programs to the embedded_rootfs
> --
>
> # Emerge other software you need for you embedded target.
> # This is very wildly depending on your needs.
> # Also your proprietary application will be done here.
> emerge foo*
> ROOT=/embedded_rootfs emerge -K foo*
>
>
> #---- Step 5 - Build and install a kernel to the embedded_rootfs
> -------------
>
> # Install a kernel into embedded_rootfs.
> # First we will emerge it into our development_rootfs, then configure and
> # build it.
> emerge vanilla-sources
> cd /usr/src/
> cd linux
> make menuconfig
Here I got 'scripts/kconfig/lkc.h:11:21: libintl.h: No such file or
directory'. Even after emerging libiconv and gettext it didn' work, any
hints?
An alternative would be compiling the kernel on the host system.
> # Configure your kernel for your TARGET SBC here. I HIGHLY suggest you
> # configure the kernel to compile everything into the kernel, and nothing
> # as a module.
> make
> ROOT=/embedded_rootfs make modules_install
> cp /usr/src/linux/arch/i386/boot/bzImage
> /embedded_rootfs/boot/vmlinuz-2.6.x
>
> # A few notes on compiling your kernel.
> # If deploying to Compact Flash/DiskOnChip/SD use ext2, as the journaling
> # filing systems "write" to much for a flash device.
> # If deploying to a hard drive use a journaling filing system, such as
> # ext3 or reiserfs.
>
>
> #---- Step 6 - Deploy embedded_rootfs to target
> ------------------------------
>
> # Prepare a Gentoo (or any Linux distro) system on the target SBC using a
> # harddrive. This is known as the target development rootfs.
> # We will create a partition (/embedded_rootfs) that will server as our
> # "test" partition to deploy our embedded_rootfs that we generate on our
> # development_system.
> #
> # I use the following partitions to speed development (yours may vary):
> # /dev/hda1 - /embedded_rootfs - 1 GB
> # /dev/hda2 - /boot - 100 MB
> # /dev/hda3 - swap - (size varies, 512 MB is a good number)
> # /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0 install guide
> specs)
> #
> # Copy over your embedded_rootfs from you development system to your target
> # system and the directory /embedded_rootfs. This needs to be done via NFS
> as # need to preserve the permissions.
> #
> #The following commands are done from the
> # target development rootfs.
> mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
> mount -t nfs\
> 192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
> /mnt/nfs_embedded_rootfs
> cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
>
>
> # Modify your target system's gurb.conf (or lilo.conf) for allow you to
Typo, should read grub.conf.
> boot # to the embedded_rootfs partition.
> #
> # Reboot, and if all goes well you'll be greeted with a login prompt.
> #
> # Fin.
>
>
> --
> heath holcomb
> liquidcable at bulah.com
> www.bulah.com
Yeah, thanks for the nice How-To! I'm looking forward to embed X into the
system (after playing around some more time with it).
Regards,
Marius
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-09-19 13:53 ` Marius Schäfer
@ 2005-09-21 14:48 ` Pierre Cassimans
2005-09-21 14:55 ` Tuurlijk
0 siblings, 1 reply; 17+ messages in thread
From: Pierre Cassimans @ 2005-09-21 14:48 UTC (permalink / raw
To: gentoo-embedded
>From: Marius Schäfer <mschaefer@mimamau.de>
>Reply-To: gentoo-embedded@lists.gentoo.org
>To: gentoo-embedded@lists.gentoo.org
>CC: Heath Holcomb <liquidcable@bulah.com>
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
>Date: Mon, 19 Sep 2005 15:53:22 +0200
>
>Hi,
>
>I just tried out the How-To, some things came to my mind while doing so...
>
>On Thursday 18 August 2005 02:19, Heath Holcomb wrote:
> > Version 0.08
> > Please add, delete, modify. Thanks!
> >
> > Small fixes, but one very important. All work arounds are back.
> >
> > I've update my website with this version also.
> > http://www.bulah.com/embeddedgentoo.html
> >
> >
> >
> >
>#--------------------------------------------------------------------------
> >------ # Embedded Gentoo How-To for x86
> > #
> > # A how-to guide to setup a Gentoo embedded environment, you must be
>root.
> > # These commands are to be run on your development system,
> > # any x86 Gentoo Linux computer will do. The system should be fast,
> > # to speed development. The target can be any x86 based SBC. I'm
> > # using a Geode based SBC. Latter I'll use a Via based SBC.
> > #
> > # versio 0.08
> > # 2005.8.13
> > #
> > # Heath Holcomb (heath at bulah.com)
> > # Ned Ludd (original commands posted)
> > # Lloyd Sargent (contributor)
> > # Yuri Vasilevski (contributor)
> > # Mike George (contributor)
> > # Kammi Cazze (contributor)
> > # Marius Schaefer (contributor)
> > #
> > # Definitions and Terms
> > # system_rootfs = your regular rootfs, development computer
> > # development_rootfs = what you use to build the embedded_rootfs
> > # embedded_rootfs = rootfs you deploy to the target system
> > # SBC = single board computer (here it's an x86 based)
> > #
> > # References
> > # http://www.gentoo.org/doc/en/handbook/index.xml
> > # http://www.epiawiki.org
> > # http://epia.kalf.org
> > # Gentoo embedded mailing list (gentoo-embedded@lists.gentoo.org)
> > #
> > #
> > # Overview of process (steps)
> > # 1 - Prepare the development_rootfs from your system_rootfs
> > # 2 - Build the development_rootfs
> > # 3 - Build the embedded_rootfs
> > # 4 - Build and install non-system programs to the embedded_rootfs
> > # 5 - Build and install a kernel to the embedded_rootfs
> > # 6 - Deploy embedded_rootfs to target
> > #
> >
>#--------------------------------------------------------------------------
> >------
> >
> > #----- Step 1 - Prepare the development_rootfs from your system_rootfs
> > -------
> >
> > # You must be root.
> > su -
> > cd /opt
> >
> > # Create the development_rootfs directory.
> > # I use i586 because of target is a Geode processor.
> > mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage
> >
> > # Download the latest stage 1 tarball.
> > wget \
> > http://mirror.usu.edu/mirrors/gentoo/experimental/x86/embedded/stages/\
> > stage1-x86-uclibc-2005.0.tar.bz2
> >
> > # Untar the stage to the development_rootfs.
> > tar -xvjpf stage1-x86-uclibc-2005.0.tar.bz2 -C
> > /opt/i586-gentoo-uclibc-linux/
> >
> > # Mount the proc and portage directories to your development_rootfs.
> > # Makes your system_rootfs's proc and portage directory available from
> > inside # of your development_rootfs (after chrooting).
> > 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 development_rootfs.
> > cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf
> >
> > # Chroot into the development_rootfs.
> > chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login
> >
> >
> > #----- Step 2 - Build the development_rootfs
> > ---------------------------------
> >
> > # Create new environment and load variables into memory.
> > env-update
> > source /etc/profile
> >
> > # Modify make.conf file to your liking/needs.
> > nano -w /etc/make.conf
> > # This is for my target, Geode x86 processor.
> > /*
> > USE="bitmap-fonts minimal truetype-fonts mmx"
> > CHOST="i586-gentoo-linux-uclibc"
> > CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx"
> > CXXFLAGS="${CFLAGS}"
> > FEATURES="buildpkg"
> >
> > VIDEO_CARDS="chips"
> > UCLIBC_CPU="586MMX"
> > */
> >
> > # Set profile to use 2.6 kernel.
> > # The current stage uses 2.4 by default, and for most cases you are
>going
> > # to want a 2.6.x kernel.
> > cd /etc/
> > unlink make.profile
> > ln -s ../usr/portage/profiles/uclibc/x86 make.profile
> >
> > # Start the bootstrap script.
> > cd /usr/portage/scripts
> > ./bootstrap.sh -p -v
> > ./bootstrap.sh
> >
> > # Workaround - bootstraping
> > # Failure compiling uclibc (gcc-config error: Could not run/locate
>"gcc")?
> > # If you get a failure while bootstrap is compileing uclibc here are the
> > steps # to work around the problem.
> > gcc-config 1
> > source /etc/profile
> > ./bootstrap.sh
> >
> > # Emerge the system ebuild for the development_rootfs.
> > emerge -e system
> >
> > # Workaround - emerge system
> > # During emerge -e system, python-fchksum failes complaing about
> > # gcc-config error: Could not run/locate "i386-gentoo-linux-uclibc-gcc"
> > # The following commands work around this problem.
> > emerge python
> > emerge -e system
>
>I didn't have to do any of these two workarounds.
>
> >
> > #----- Step 3 - Build the embedded_rootfs
> > ------------------------------------
> >
> > # Create the embedded_rootfs directory.
> > mkdir /embedded_rootfs
> >
> > # Emerge baselayout-lite into embedded_rootfs.
> > # This gives your system a basic file structure.
> > # 1.0_pre1 is the only one that is stable, right?
> > cd /usr/portage/sys-apps/baselayout-lite/
> > ROOT=/embedded_rootfs emerge baselayout-lite-1.0_pre1.ebuild
> >
> > # Workaround - baselayout-lite
> > # Baselayout-lite is still beta, so a few fixes are needed.
> > # There needs to be a directory "log" in /var.
> > # Inittab calls for /usr/bin/tail, but it needs to /usr/bin.
> > mkdir /embedded_rootfs/var/log
> > nano -w /embedded_rootfs/etc/inittab
> > /*
> > #tty3::respawn:/usr/bin/tail -f /var/log/messages
> > tty3::respawn:/bin/tail -f /var/log/messages
> > */
> >
> > # Emerge uclibc into the embedded_rootfs.
> > # Use the -K option because we don't get the extra files created by the
> > # build/emerge process into our embedded rootfs which needs to be as
> > # small as possible.
> > ROOT=/embedded_rootfs emerge -K uclibc
> >
> > # Emerge busybox into the embedded_rootfs.
> > # First you must emerge it into your development_rootfs.
> > # This does not create the symlinks in our development embedded rootfs.
> > emerge busybox
> > ROOT=/embedded_rootfs emerge -K busybox
> >
> > # Create the symlinks for busybox in the embedded_rootfs.
> > mkdir /embedded_rootfs/proc
> > mount -o bind /proc/ /embedded_rootfs/proc/
> > chroot /embedded_rootfs /bin/busybox --install -s
> > umount /embedded_rootfs/proc
> >
> > # Set time zone in your embedded_rootfs.
> > # See http://leaf.sourceforge.net/doc/guide/buci-tz.html for details.
> > # For central standard time in the US, use "CST6CDT".
> > nano -w /embedded_rootfs/etc/TZ
> > /*
> > CST6CDT
> > */
> >
> > # Install a boot loader (usually grub or lilo).
> > # Once you copy/deploy your embedded_rootfs to your target SBC you will
> > # have to run grub on the command line to write to the master boot
>record
> > # (MBR).
> > # For some reason not all of /boot/grub is copied over to the
> > # embedded_rootfs, so a extra manual copy step is needed.
> > # The --nodeps gets rip of the run time need of ncurses.
> > emerge --nodeps grub
> > ROOT=/embedded_rootfs emerge -K --nodeps grub
> > cp -R /boot/grub /embedded_rootfs/boot/
> >
> > # Modify your boot configure file.
> > # The example below is for a gurb, for a boot partition on /dev/hda1 and
> > only # one partition on the target SBC system.
> > nano -w /embedded_rootfs/boot/grub/grub.conf
> > /*
> > default 0
> > timeout 10
> > splashimage=(hd0,0)/boot/grub/splash.xpm.gz
> >
> > title=Linux 2.6.x
> > root (hd0,0)
> > kernel /vmlinuz-2.6.x root=/dev/hda1 vga=792
> > */
> >
> > # Set root password for the embedded_rootfs
> > chroot /embedded_rootfs
>
>This gave me 'cannot run command `/bin/bash': No such file or directory'.
>So I had to use 'chroot /embedded_rootfs /bin/sh'.
>
> > passwd
> > rm /embedded_rootfs/etc/passwd-
> > exit
>
>Correct order should be:
>chroot /embedded_rootfs
>passwd
>exit
>rm /embedded_rootfs/etc/passwd-
>
>Or use 'rm /etc/passwd-'.
>
This is not the first comment on this. I hope the writer want to look at it
and change it in the Howto
> >
> > # Modify fstab.
> > # Below is mine, yours may vary.
> > nano -w /embedded_rootfs/etc/fstab
> > /*
> > /dev/hda1 / reiserfs defaults 0 0
> > none /proc proc defaults 0 0
> > none /sys sysfs defaults 0 0
> > none /dev/shm tmpfs defaults 0 0
> > */
> >
> > # Clean up the embedded_rootfs.
> > # Don't know why these files are there in the first place, so if anyone
> > # can tell me why.....
> > rm -R /embedded_rootfs/var/db/pkg/*
> > rm -R /embedded_rootfs/var/lib/portage/
> >
> > #---- Step 4 - Build and install non-system programs to the
>embedded_rootfs
> > --
> >
> > # Emerge other software you need for you embedded target.
> > # This is very wildly depending on your needs.
> > # Also your proprietary application will be done here.
> > emerge foo*
> > ROOT=/embedded_rootfs emerge -K foo*
> >
> >
> > #---- Step 5 - Build and install a kernel to the embedded_rootfs
> > -------------
> >
> > # Install a kernel into embedded_rootfs.
> > # First we will emerge it into our development_rootfs, then configure
>and
> > # build it.
> > emerge vanilla-sources
> > cd /usr/src/
> > cd linux
> > make menuconfig
>
>Here I got 'scripts/kconfig/lkc.h:11:21: libintl.h: No such file or
>directory'. Even after emerging libiconv and gettext it didn' work, any
>hints?
>
>An alternative would be compiling the kernel on the host system.
You need a patch for the kernels > 2.6.12.
The link is available on the ml.
>
> > # Configure your kernel for your TARGET SBC here. I HIGHLY suggest you
> > # configure the kernel to compile everything into the kernel, and
>nothing
> > # as a module.
> > make
> > ROOT=/embedded_rootfs make modules_install
> > cp /usr/src/linux/arch/i386/boot/bzImage
> > /embedded_rootfs/boot/vmlinuz-2.6.x
> >
> > # A few notes on compiling your kernel.
> > # If deploying to Compact Flash/DiskOnChip/SD use ext2, as the
>journaling
> > # filing systems "write" to much for a flash device.
> > # If deploying to a hard drive use a journaling filing system, such as
> > # ext3 or reiserfs.
> >
> >
> > #---- Step 6 - Deploy embedded_rootfs to target
> > ------------------------------
> >
> > # Prepare a Gentoo (or any Linux distro) system on the target SBC using
>a
> > # harddrive. This is known as the target development rootfs.
> > # We will create a partition (/embedded_rootfs) that will server as our
> > # "test" partition to deploy our embedded_rootfs that we generate on our
> > # development_system.
> > #
> > # I use the following partitions to speed development (yours may vary):
> > # /dev/hda1 - /embedded_rootfs - 1 GB
> > # /dev/hda2 - /boot - 100 MB
> > # /dev/hda3 - swap - (size varies, 512 MB is a good number)
> > # /dev/hda4 - / - (what is left, at least 1.5 GB per 2005.0 install
>guide
> > specs)
> > #
> > # Copy over your embedded_rootfs from you development system to your
>target
> > # system and the directory /embedded_rootfs. This needs to be done via
>NFS
> > as # need to preserve the permissions.
> > #
> > #The following commands are done from the
> > # target development rootfs.
> > mount -t reiserfs /dev/hda1 /mnt/embedded_rootfs
> > mount -t nfs\
> > 192.168.0.10:/opt/i586-gentoo-uclibc-linux/embedded_rootfs\
> > /mnt/nfs_embedded_rootfs
> > cp -adpR /mnt/nfs_embedded_rootfs/* /mnt/embedded_rootfs
> >
> >
> > # Modify your target system's gurb.conf (or lilo.conf) for allow you to
>
>Typo, should read grub.conf.
>
> > boot # to the embedded_rootfs partition.
> > #
> > # Reboot, and if all goes well you'll be greeted with a login prompt.
> > #
> > # Fin.
> >
> >
> > --
> > heath holcomb
> > liquidcable at bulah.com
> > www.bulah.com
>
>Yeah, thanks for the nice How-To! I'm looking forward to embed X into the
>system (after playing around some more time with it).
>
>Regards,
>Marius
>
>--
>gentoo-embedded@gentoo.org mailing list
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-09-21 14:48 ` Pierre Cassimans
@ 2005-09-21 14:55 ` Tuurlijk
2005-09-21 15:44 ` Natanael Copa
0 siblings, 1 reply; 17+ messages in thread
From: Tuurlijk @ 2005-09-21 14:55 UTC (permalink / raw
To: gentoo-embedded
Isn't -fomit-frame-ponter automatically enabled when using -Os?
Op 21-sep-05 om 16:48 heeft Pierre Cassimans het volgende geschreven:
>> -fomit-frame-pointer
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-09-21 14:55 ` Tuurlijk
@ 2005-09-21 15:44 ` Natanael Copa
2005-09-22 7:18 ` Tuurlijk
0 siblings, 1 reply; 17+ messages in thread
From: Natanael Copa @ 2005-09-21 15:44 UTC (permalink / raw
To: gentoo-embedded
Tuurlijk wrote:
> Isn't -fomit-frame-ponter automatically enabled when using -Os?
>
> Op 21-sep-05 om 16:48 heeft Pierre Cassimans het volgende geschreven:
>
>>> -fomit-frame-pointer
>>
>
>From the gcc man page:
-O also turns on -fomit-frame-pointer on machines where doing so
does not interfere with debugging.
If I have undestood this correctly, -fomit-frame-pointer does interfere
with debugging on x86 so -O does not turn it on.
In other words: On x86 -Os does not turn on -fomit-frame-pointer.
Correct me if I'm wrong.
--
Natanael Copa
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-09-21 15:44 ` Natanael Copa
@ 2005-09-22 7:18 ` Tuurlijk
2005-09-22 7:49 ` Natanael Copa
0 siblings, 1 reply; 17+ messages in thread
From: Tuurlijk @ 2005-09-22 7:18 UTC (permalink / raw
To: gentoo-embedded
[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]
Op 21-sep-05 om 17:44 heeft Natanael Copa het volgende geschreven:
>
> From the gcc man page:
> -O also turns on -fomit-frame-pointer on machines where doing so
> does not interfere with debugging.
>
> If I have undestood this correctly, -fomit-frame-pointer does interfere
> with debugging on x86 so -O does not turn it on.
>
> In other words: On x86 -Os does not turn on -fomit-frame-pointer.
>
> Correct me if I'm wrong.
On closer inspection, this appears to be correct indeed. I was misled
by:
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions
that don't
need one. This avoids the instructions to save, set up and
restore
frame pointers; it also makes an extra register available in
many
functions. It also makes debugging impossible on some
machines.
On some machines, such as the VAX, this flag has no effect,
because
the standard calling sequence automatically handles the frame
pointer and nothing is saved by pretending it doesn't exist.
The
machine-description macro "FRAME_POINTER_REQUIRED" controls
whether
a target machine supports this flag.
Enabled at levels -O, -O2, -O3, -Os.
[-- Attachment #2: Type: text/enriched, Size: 1295 bytes --]
Op 21-sep-05 om 17:44 heeft Natanael Copa het volgende geschreven:
<excerpt>
>From the gcc man page:
-O also turns on -fomit-frame-pointer on machines where doing so
does not interfere with debugging.
If I have undestood this correctly, -fomit-frame-pointer does interfere
with debugging on x86 so -O does not turn it on.
In other words: On x86 -Os does not turn on -fomit-frame-pointer.
Correct me if I'm wrong.
</excerpt>
On closer inspection, this appears to be correct indeed. I was misled
by:
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions
that don't
need one. This avoids the instructions to save, set up and
restore
frame pointers; it also makes an extra register available
in many
functions. It also makes debugging impossible on some
machines.
On some machines, such as the VAX, this flag has no effect,
because
the standard calling sequence automatically handles the
frame
pointer and nothing is saved by pretending it doesn't
exist. The
machine-description macro "FRAME_POINTER_REQUIRED" controls
whether
a target machine supports this flag.
<bold> Enabled at levels -O, -O2, -O3, -Os.</bold>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08
2005-09-22 7:18 ` Tuurlijk
@ 2005-09-22 7:49 ` Natanael Copa
0 siblings, 0 replies; 17+ messages in thread
From: Natanael Copa @ 2005-09-22 7:49 UTC (permalink / raw
To: gentoo-embedded
Tuurlijk wrote:
>
> Op 21-sep-05 om 17:44 heeft Natanael Copa het volgende geschreven:
>
>> In other words: On x86 -Os does not turn on -fomit-frame-pointer.
>
...
> On closer inspection, this appears to be correct indeed. I was misled by:
You are not the first one :-)
--
Natanael Copa
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2005-09-22 7:49 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-18 0:19 [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.08 Heath Holcomb
2005-08-18 6:35 ` Pierre Cassimans
2005-08-18 7:30 ` Natanael Copa
2005-08-18 7:39 ` Pierre Cassimans
2005-08-18 7:47 ` Natanael Copa
2005-08-18 7:56 ` Pierre Cassimans
2005-08-18 15:06 ` Joshua ChaitinPollak
2005-09-19 13:53 ` Marius Schäfer
2005-09-21 14:48 ` Pierre Cassimans
2005-09-21 14:55 ` Tuurlijk
2005-09-21 15:44 ` Natanael Copa
2005-09-22 7:18 ` Tuurlijk
2005-09-22 7:49 ` Natanael Copa
-- strict thread matches above, loose matches on Subject: below --
2005-08-18 6:46 Marcel Romijn
2005-08-18 7:02 ` Pierre Cassimans
2005-08-18 10:33 ` Marius Schaefer/Camberg/ISBAC
2005-08-18 15:03 ` Joshua ChaitinPollak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox