1 |
Version 0.03 |
2 |
Please add, delete, modify. Thanks! |
3 |
|
4 |
|
5 |
#--------------------------------------------------------------------------------------- |
6 |
# Embedded Gentoo How-To for x86 |
7 |
# |
8 |
# Commands to setup a Gentoo embedded environment, you must be root. |
9 |
# These commands are to be run on your developement system, |
10 |
# any x86 Gentoo Linux computer will do. The system should be fast, |
11 |
# to speed developement. The target can be any x86 based SBC. I'm |
12 |
# using a Geode based SBC. Latter I'll use a Via based SBC. |
13 |
# |
14 |
# version 0.03 |
15 |
# 2005.29.04 |
16 |
# |
17 |
# Heath Holcomb (heath at bulah.com) |
18 |
# Ned Ludd (original commands posted) |
19 |
# Yuri Vasilevshi (contributor) |
20 |
# Mike George (contributor) |
21 |
# |
22 |
# Development RootFS = what you use to build the Embedded RootFS |
23 |
# Embedded RootFS = rootfs you deploy to the target system |
24 |
# SBC = single board computer (here it's an x86 based) |
25 |
# |
26 |
# References |
27 |
# http://www.gentoo.org/doc/en/handbook/index.xml |
28 |
# http://www.epiawiki.org |
29 |
# http://epia.kalf.org |
30 |
# Gentoo embedded mailing list (gentoo-embedded@l.g.o) |
31 |
# |
32 |
# |
33 |
#--------------------------------------------------------------------------------------- |
34 |
|
35 |
# create the Development RootFS |
36 |
# I use i586 becasue of target is a Geode processor |
37 |
mkdir -p /opt/i586-gentoo-uclibc-linux/usr/portage |
38 |
|
39 |
# download the latest stage 1 tarball |
40 |
wget \ |
41 |
http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uclibc-2005.0.tar.bz2 |
42 |
|
43 |
# untar the stage to the Development RootFS |
44 |
tar -xvjf stage1-x86-uclibc-2005.0.tar.bz2 -C /opt/i586-gentoo-uclibc-linux/ |
45 |
|
46 |
# mount the Development RootFS proc and portage directories |
47 |
# don't understand this someone please add comments |
48 |
mount --bind /proc /opt/i586-gentoo-uclibc-linux/proc/ |
49 |
mount --bind /usr/portage /opt/i586-gentoo-uclibc-linux/usr/portage |
50 |
|
51 |
# copy over DNS information to the Development RootFS |
52 |
cp /etc/resolv.conf /opt/i586-gentoo-uclibc-linux/etc/resolv.conf |
53 |
|
54 |
# chroot into the Development RootFS, create new environment, load variables |
55 |
into memory |
56 |
chroot /opt/i586-gentoo-uclibc-linux /bin/bash --login |
57 |
env-update |
58 |
source /etc/profile |
59 |
|
60 |
# modify make.conf file to your liking |
61 |
nano -w /etc/make.conf |
62 |
# this is for my target, Geode x86 processor |
63 |
CHOST="i586-gentoo-linux-uclibc" |
64 |
CFLAGS="-march=i586 -Os -pipe -fomit-frame-pointer -mmmx" |
65 |
CXXFLAGS="${CFLAGS}" |
66 |
FEATURES="buildpkg" |
67 |
|
68 |
# work around for bug 90306 |
69 |
mknod -m 0444 /dev/random c 1 8 |
70 |
mknod -m 0444 /dev/urandom c 1 9 |
71 |
|
72 |
# start the bootstrip script |
73 |
cd /usr/portage/scripts |
74 |
./bootstrap.sh -p -v |
75 |
./bootstrap.sh |
76 |
|
77 |
# emerge system |
78 |
emerge -e system |
79 |
# fixes a emerge ebuild bug, this should go away soon |
80 |
emerge python |
81 |
# continue with the rest of the emerge system |
82 |
emerge -e system |
83 |
|
84 |
# modify make.conf and set you USE flags for the target embedded build |
85 |
# these use flags build a smaller system with no documentation, man or info |
86 |
pages installed |
87 |
# the make-symlinks option of for busybox to automatically create the symlinks |
88 |
to it |
89 |
nano -w /etc/make.conf |
90 |
USE="make-symlinks nodoc noinfo noman" |
91 |
|
92 |
# build busybox and uclibc, put into the Embedded RootFS (/Embedded RootFS) |
93 |
# don't understand exactally how this works, someone please add comments |
94 |
mkdir /Embedded RootFS |
95 |
ROOT=/Embedded RootFS emerge busybox uclibc |
96 |
|
97 |
# emerge other software you need for you embedded target |
98 |
ROOT=/Embedded RootFS emerge xxxxxxxxx |
99 |
|
100 |
# install a kernel into Embedded RootFS |
101 |
ROOT=/Embedded RootFS emerge vanilla-sources |
102 |
cd /Embedded RootFS/usr/src |
103 |
ln -s linux- |
104 |
|
105 |
......... more stuff here ........... |
106 |
......... install xorg-x11, less than 10MB hopefully |
107 |
......... install light window manager (blackbox, windowmaker, ???) |
108 |
......... install very light X11 toolkit (?????) |
109 |
......... purge to the Embedded RootFS of unwanted files and libaries |
110 |
......... edit all config files |
111 |
......... set up the test harddrive on the target SBC |
112 |
......... install grub or lilo on the test harddrive on the target SBC |
113 |
......... transfer Embedded RootFS to the test harddrive on the target SBC |
114 |
......... debug system, and rebuild |
115 |
......... deploy Embedded RootFS from the test harddrive to flash |
116 |
......... (DiskOnChip, Compact Flash) |
117 |
......... tweak, rebuild, redeploy |
118 |
|
119 |
-- |
120 |
Heath Holcomb |
121 |
heath@×××××.com |
122 |
www.bulah.com |
123 |
-- |
124 |
gentoo-embedded@g.o mailing list |