* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-18 6:24 Marcel Romijn
0 siblings, 0 replies; 19+ messages in thread
From: Marcel Romijn @ 2005-08-18 6:24 UTC (permalink / raw
To: gentoo-embedded
Hi Steph,
I hadn't thought about that... Only mount the read/write part of the
filesystem in ram and mount the rest from CF readonly.
I've been reading up on GNAP. That is close to what I want to
accomplish. It looks like I can use that as a base and extend it for my
needs.
I'm not using catalyst. But it looks like I might use that if I want to
extend GNAP...
Thanks for the hints ;-)
Marcel
-----Original Message-----
From: S. ancelot [mailto:sancelot@free.fr]
Sent: Tuesday, 16 August, 2005 11:29
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.07
Hi,
If I remember, the best thing to do is using a squashfs filesystem.
Taking the filesystem completely in ram is a bad idea and unnecessary
(CF are lifetime warranty if you only read it !).
Are you using catalyst ???
I advice you trying GNAP in order to understand how to go on ...
Best regards
Steph
Marcel Romijn wrote:
>Hi Heath,
>
>I know about the limited number of write cycles on CF. Therefore I want
>the CF only to supply the kernel and the ramdisk image. My intention is
>to run Linux and my application completely from ramdisk.
>I want my device to be complately silent, therefore it has a fanless
>ME6000 board, no fans in the case and no harddisk (actually strange to
>'hear' a computer boot in complete silence!). The CF is on an IDE
>converter and is recognized as /dev/hda1 (although for testing it has a
>normal harddisk connected).
>
>I was able to follow your howto to the end.
>Although I had some problems where the boot process stopped after
>"Freeing unused kernel memory". This turned out to be a typo in
>/etc/fstab on my side.
>
>Now that I have bootable configuration, I can look into what it takes
to
>have the system files in a ramdisk image and have it mounted as '/'.
>
>I think I could just create an initrd from the whole system and have
>grub and the kernel extract it in memory and mount it.
>I have not done much investigation on it, be it seems to me that the
>/linuxrc in the initrd can be fairly simple. Actually just calling the
>/sbin/init once the ramdisk is mountded as '/'.
>
>Anyone any experience with this?
>
>PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>and booting. I saw Pierre Cassimans is interested in this subject as
>well.
>This might go off topic for the Gentoo Embedded Howto.
>
>Marcel
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Sunday, 14 August, 2005 0:53
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>0.07
>
>On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>
>
>>Hello Heath,
>>
>>Nice writedown! I haven't made it to the end yet (lack of time), but
>>
>>
>I'm
>
>
>>getting there...
>>
>>I noticed some issues along the way (not counting grub begin spelled
>>
>>
>as
>
>
>>"grug" or "gurb" ;-) )
>>
>>In step 3 you write:
>>
>><snip>
>># Set root password for the embedded_rootfs
>>chromm /embedded_rootfs
>>passwd
>>rm /embedded_rootfs/etc/passwd-
>>Exit
>></snip>
>>
>>I presume 'chromm' should have been 'chroot' ?
>>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>before the "exit" or the "exit" before the "rm
>>/embedded_rootfs/etc/passwd-".
>>
>>
>
>Yes, "chromm" should be "chroot". The order is correct, as far as I
can
>tell.
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
>
>
>
>
>>A few lines down, you write:
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/ *
>></snip>
>>
>>As a reletive newbie, doing a quick copy/paste of this command late in
>>the evening as root in '/', this wiped out all files, except the ones
>>that were firmly locked.
>>Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>
>>
>a
>
>
>>previous snapshot ;-)
>>
>>I presume the space before the '*' should have been omitted?
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/*
>></snip>
>>
>>
>
>Major typo on my part. Fixed in version 0.08.
>
>
>
>>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>reads the kernel and a ramdisk image from CF and then runs completely
>>from RAM.
>>If I'm not mistaken, you were heading for a Via Epia as well?
>>
>>
>
>My target will be a Via based SBC. From what I have read using a
>ramdisk on a
>x86 based platform really does not buy you much. But you sure don't
>want to
>write to the CF all that often (limited write cycles, usallay 100,000
to
>
>300,000). So I plan on mounting the / partition of the CF as read only
>and
>creating a separate partition that is mounted read/write and have my
>embedded
>application and only my application write to that partition.
>
>
>
>>Regards,
>>
>>Marcel Romijn
>>
>>
>>-----Original Message-----
>>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>Sent: Monday, 08 August, 2005 4:17
>>To: gentoo-embedded@lists.gentoo.org
>>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>
>>Version 0.07
>>Please add, delete, modify. Thanks!
>>
>>Several fixes. Root password now works. Several work arounds are no
>>longer
>>need, as the embedded Gentoo team has fixed them (I'm guess because I
>>
>>
>no
>
>
>>longer get those errors). There is still one problem when "emerge -e
>>system"
>>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>Check
>>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>-e
>>system).
>>
>>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.
>>#
>># version 0.07
>># 2005.8.7
>>#
>># 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 -
>>
>># Create the development_rootfs.
>># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uc
l
>
>
>>ibc-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
>>
>># Emerge the system ebuild for the development_rootfs.
>>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 1
>># 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 grug 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
>>chromm /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
>>
>>
>
>
>
--
gentoo-embedded@gentoo.org mailing list
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-18 6:26 Marcel Romijn
0 siblings, 0 replies; 19+ messages in thread
From: Marcel Romijn @ 2005-08-18 6:26 UTC (permalink / raw
To: gentoo-embedded
Hi,
I use an IDE extender for CF. The CF is seen as /dev/had and my machine
boots nicely from it.
So apparantly no need to change the DMA.
Marcel
-----Original Message-----
From: S. ancelot [mailto:sancelot@free.fr]
Sent: Tuesday, 16 August, 2005 11:30
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.07
One thing more :
In order to boot some compact flash, you may have to solve issues with
DMA (disable in kernel).
Best Regards
Steph
Marcel Romijn wrote:
>Hi Heath,
>
>I know about the limited number of write cycles on CF. Therefore I want
>the CF only to supply the kernel and the ramdisk image. My intention is
>to run Linux and my application completely from ramdisk.
>I want my device to be complately silent, therefore it has a fanless
>ME6000 board, no fans in the case and no harddisk (actually strange to
>'hear' a computer boot in complete silence!). The CF is on an IDE
>converter and is recognized as /dev/hda1 (although for testing it has a
>normal harddisk connected).
>
>I was able to follow your howto to the end.
>Although I had some problems where the boot process stopped after
>"Freeing unused kernel memory". This turned out to be a typo in
>/etc/fstab on my side.
>
>Now that I have bootable configuration, I can look into what it takes
to
>have the system files in a ramdisk image and have it mounted as '/'.
>
>I think I could just create an initrd from the whole system and have
>grub and the kernel extract it in memory and mount it.
>I have not done much investigation on it, be it seems to me that the
>/linuxrc in the initrd can be fairly simple. Actually just calling the
>/sbin/init once the ramdisk is mountded as '/'.
>
>Anyone any experience with this?
>
>PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>and booting. I saw Pierre Cassimans is interested in this subject as
>well.
>This might go off topic for the Gentoo Embedded Howto.
>
>Marcel
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Sunday, 14 August, 2005 0:53
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>0.07
>
>On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>
>
>>Hello Heath,
>>
>>Nice writedown! I haven't made it to the end yet (lack of time), but
>>
>>
>I'm
>
>
>>getting there...
>>
>>I noticed some issues along the way (not counting grub begin spelled
>>
>>
>as
>
>
>>"grug" or "gurb" ;-) )
>>
>>In step 3 you write:
>>
>><snip>
>># Set root password for the embedded_rootfs
>>chromm /embedded_rootfs
>>passwd
>>rm /embedded_rootfs/etc/passwd-
>>Exit
>></snip>
>>
>>I presume 'chromm' should have been 'chroot' ?
>>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>before the "exit" or the "exit" before the "rm
>>/embedded_rootfs/etc/passwd-".
>>
>>
>
>Yes, "chromm" should be "chroot". The order is correct, as far as I
can
>tell.
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
>
>
>
>
>>A few lines down, you write:
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/ *
>></snip>
>>
>>As a reletive newbie, doing a quick copy/paste of this command late in
>>the evening as root in '/', this wiped out all files, except the ones
>>that were firmly locked.
>>Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>
>>
>a
>
>
>>previous snapshot ;-)
>>
>>I presume the space before the '*' should have been omitted?
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/*
>></snip>
>>
>>
>
>Major typo on my part. Fixed in version 0.08.
>
>
>
>>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>reads the kernel and a ramdisk image from CF and then runs completely
>>from RAM.
>>If I'm not mistaken, you were heading for a Via Epia as well?
>>
>>
>
>My target will be a Via based SBC. From what I have read using a
>ramdisk on a
>x86 based platform really does not buy you much. But you sure don't
>want to
>write to the CF all that often (limited write cycles, usallay 100,000
to
>
>300,000). So I plan on mounting the / partition of the CF as read only
>and
>creating a separate partition that is mounted read/write and have my
>embedded
>application and only my application write to that partition.
>
>
>
>>Regards,
>>
>>Marcel Romijn
>>
>>
>>-----Original Message-----
>>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>Sent: Monday, 08 August, 2005 4:17
>>To: gentoo-embedded@lists.gentoo.org
>>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>
>>Version 0.07
>>Please add, delete, modify. Thanks!
>>
>>Several fixes. Root password now works. Several work arounds are no
>>longer
>>need, as the embedded Gentoo team has fixed them (I'm guess because I
>>
>>
>no
>
>
>>longer get those errors). There is still one problem when "emerge -e
>>system"
>>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>Check
>>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>-e
>>system).
>>
>>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.
>>#
>># version 0.07
>># 2005.8.7
>>#
>># 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 -
>>
>># Create the development_rootfs.
>># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uc
l
>
>
>>ibc-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
>>
>># Emerge the system ebuild for the development_rootfs.
>>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 1
>># 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 grug 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
>>chromm /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
>>
>>
>
>
>
--
gentoo-embedded@gentoo.org mailing list
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-16 6:43 Marcel Romijn
2005-08-16 9:28 ` S. ancelot
2005-08-16 9:30 ` S. ancelot
0 siblings, 2 replies; 19+ messages in thread
From: Marcel Romijn @ 2005-08-16 6:43 UTC (permalink / raw
To: gentoo-embedded
Hi Heath,
I know about the limited number of write cycles on CF. Therefore I want
the CF only to supply the kernel and the ramdisk image. My intention is
to run Linux and my application completely from ramdisk.
I want my device to be complately silent, therefore it has a fanless
ME6000 board, no fans in the case and no harddisk (actually strange to
'hear' a computer boot in complete silence!). The CF is on an IDE
converter and is recognized as /dev/hda1 (although for testing it has a
normal harddisk connected).
I was able to follow your howto to the end.
Although I had some problems where the boot process stopped after
"Freeing unused kernel memory". This turned out to be a typo in
/etc/fstab on my side.
Now that I have bootable configuration, I can look into what it takes to
have the system files in a ramdisk image and have it mounted as '/'.
I think I could just create an initrd from the whole system and have
grub and the kernel extract it in memory and mount it.
I have not done much investigation on it, be it seems to me that the
/linuxrc in the initrd can be fairly simple. Actually just calling the
/sbin/init once the ramdisk is mountded as '/'.
Anyone any experience with this?
PS. Maybe we should spawn of another thread about VIA Epia boards, CF
and booting. I saw Pierre Cassimans is interested in this subject as
well.
This might go off topic for the Gentoo Embedded Howto.
Marcel
-----Original Message-----
From: Heath Holcomb [mailto:liquidcable@bulah.com]
Sent: Sunday, 14 August, 2005 0:53
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.07
On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
> Hello Heath,
>
> Nice writedown! I haven't made it to the end yet (lack of time), but
I'm
> getting there...
>
> I noticed some issues along the way (not counting grub begin spelled
as
> "grug" or "gurb" ;-) )
>
> In step 3 you write:
>
> <snip>
> # Set root password for the embedded_rootfs
> chromm /embedded_rootfs
> passwd
> rm /embedded_rootfs/etc/passwd-
> Exit
> </snip>
>
> I presume 'chromm' should have been 'chroot' ?
> If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
> before the "exit" or the "exit" before the "rm
> /embedded_rootfs/etc/passwd-".
Yes, "chromm" should be "chroot". The order is correct, as far as I can
tell.
chroot /embedded_rootfs
passwd
rm /embedded_rootfs/etc/passwd-
exit
> A few lines down, you write:
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/ *
> </snip>
>
> As a reletive newbie, doing a quick copy/paste of this command late in
> the evening as root in '/', this wiped out all files, except the ones
> that were firmly locked.
> Fortunately, I'm going through you HowTo in VMWare, so I could restore
a
> previous snapshot ;-)
>
> I presume the space before the '*' should have been omitted?
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/*
> </snip>
Major typo on my part. Fixed in version 0.08.
>
> My aim is to create an embedded Gentoo for a Via Epia ME6000, which
> reads the kernel and a ramdisk image from CF and then runs completely
> from RAM.
> If I'm not mistaken, you were heading for a Via Epia as well?
My target will be a Via based SBC. From what I have read using a
ramdisk on a
x86 based platform really does not buy you much. But you sure don't
want to
write to the CF all that often (limited write cycles, usallay 100,000 to
300,000). So I plan on mounting the / partition of the CF as read only
and
creating a separate partition that is mounted read/write and have my
embedded
application and only my application write to that partition.
> Regards,
>
> Marcel Romijn
>
>
> -----Original Message-----
> From: Heath Holcomb [mailto:liquidcable@bulah.com]
> Sent: Monday, 08 August, 2005 4:17
> To: gentoo-embedded@lists.gentoo.org
> Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>
> Version 0.07
> Please add, delete, modify. Thanks!
>
> Several fixes. Root password now works. Several work arounds are no
> longer
> need, as the embedded Gentoo team has fixed them (I'm guess because I
no
>
> longer get those errors). There is still one problem when "emerge -e
> system"
> for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
> Check
> out the bug report for the temp fix/work around (USE="-sandbox" emerge
> -e
> system).
>
> 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.
> #
> # version 0.07
> # 2005.8.7
> #
> # 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 -
>
> # Create the development_rootfs.
> # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
> ibc-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
>
> # Emerge the system ebuild for the development_rootfs.
> 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 1
> # 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 grug 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
> chromm /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
--
heath holcomb
liquidcable at bulah.com
www.bulah.com
--
gentoo-embedded@gentoo.org mailing list
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 6:43 Marcel Romijn
@ 2005-08-16 9:28 ` S. ancelot
2005-08-16 11:09 ` Natanael Copa
2005-08-16 9:30 ` S. ancelot
1 sibling, 1 reply; 19+ messages in thread
From: S. ancelot @ 2005-08-16 9:28 UTC (permalink / raw
To: gentoo-embedded
Hi,
If I remember, the best thing to do is using a squashfs filesystem.
Taking the filesystem completely in ram is a bad idea and unnecessary
(CF are lifetime warranty if you only read it !).
Are you using catalyst ???
I advice you trying GNAP in order to understand how to go on ...
Best regards
Steph
Marcel Romijn wrote:
>Hi Heath,
>
>I know about the limited number of write cycles on CF. Therefore I want
>the CF only to supply the kernel and the ramdisk image. My intention is
>to run Linux and my application completely from ramdisk.
>I want my device to be complately silent, therefore it has a fanless
>ME6000 board, no fans in the case and no harddisk (actually strange to
>'hear' a computer boot in complete silence!). The CF is on an IDE
>converter and is recognized as /dev/hda1 (although for testing it has a
>normal harddisk connected).
>
>I was able to follow your howto to the end.
>Although I had some problems where the boot process stopped after
>"Freeing unused kernel memory". This turned out to be a typo in
>/etc/fstab on my side.
>
>Now that I have bootable configuration, I can look into what it takes to
>have the system files in a ramdisk image and have it mounted as '/'.
>
>I think I could just create an initrd from the whole system and have
>grub and the kernel extract it in memory and mount it.
>I have not done much investigation on it, be it seems to me that the
>/linuxrc in the initrd can be fairly simple. Actually just calling the
>/sbin/init once the ramdisk is mountded as '/'.
>
>Anyone any experience with this?
>
>PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>and booting. I saw Pierre Cassimans is interested in this subject as
>well.
>This might go off topic for the Gentoo Embedded Howto.
>
>Marcel
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Sunday, 14 August, 2005 0:53
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>0.07
>
>On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>
>
>>Hello Heath,
>>
>>Nice writedown! I haven't made it to the end yet (lack of time), but
>>
>>
>I'm
>
>
>>getting there...
>>
>>I noticed some issues along the way (not counting grub begin spelled
>>
>>
>as
>
>
>>"grug" or "gurb" ;-) )
>>
>>In step 3 you write:
>>
>><snip>
>># Set root password for the embedded_rootfs
>>chromm /embedded_rootfs
>>passwd
>>rm /embedded_rootfs/etc/passwd-
>>Exit
>></snip>
>>
>>I presume 'chromm' should have been 'chroot' ?
>>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>before the "exit" or the "exit" before the "rm
>>/embedded_rootfs/etc/passwd-".
>>
>>
>
>Yes, "chromm" should be "chroot". The order is correct, as far as I can
>tell.
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
>
>
>
>
>>A few lines down, you write:
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/ *
>></snip>
>>
>>As a reletive newbie, doing a quick copy/paste of this command late in
>>the evening as root in '/', this wiped out all files, except the ones
>>that were firmly locked.
>>Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>
>>
>a
>
>
>>previous snapshot ;-)
>>
>>I presume the space before the '*' should have been omitted?
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/*
>></snip>
>>
>>
>
>Major typo on my part. Fixed in version 0.08.
>
>
>
>>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>reads the kernel and a ramdisk image from CF and then runs completely
>>from RAM.
>>If I'm not mistaken, you were heading for a Via Epia as well?
>>
>>
>
>My target will be a Via based SBC. From what I have read using a
>ramdisk on a
>x86 based platform really does not buy you much. But you sure don't
>want to
>write to the CF all that often (limited write cycles, usallay 100,000 to
>
>300,000). So I plan on mounting the / partition of the CF as read only
>and
>creating a separate partition that is mounted read/write and have my
>embedded
>application and only my application write to that partition.
>
>
>
>>Regards,
>>
>>Marcel Romijn
>>
>>
>>-----Original Message-----
>>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>Sent: Monday, 08 August, 2005 4:17
>>To: gentoo-embedded@lists.gentoo.org
>>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>
>>Version 0.07
>>Please add, delete, modify. Thanks!
>>
>>Several fixes. Root password now works. Several work arounds are no
>>longer
>>need, as the embedded Gentoo team has fixed them (I'm guess because I
>>
>>
>no
>
>
>>longer get those errors). There is still one problem when "emerge -e
>>system"
>>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>Check
>>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>-e
>>system).
>>
>>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.
>>#
>># version 0.07
>># 2005.8.7
>>#
>># 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 -
>>
>># Create the development_rootfs.
>># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
>
>
>>ibc-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
>>
>># Emerge the system ebuild for the development_rootfs.
>>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 1
>># 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 grug 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
>>chromm /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
>>
>>
>
>
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 9:28 ` S. ancelot
@ 2005-08-16 11:09 ` Natanael Copa
2005-08-16 16:46 ` Robert Wohleb
0 siblings, 1 reply; 19+ messages in thread
From: Natanael Copa @ 2005-08-16 11:09 UTC (permalink / raw
To: gentoo-embedded
Best regards
Natanael Copa
people are talking about?
http://en.wikipedia.org/wiki/Top-posting
and then scroll to the top again
to get a clue about what
when you have to scroll to
the bottom of every posting
Is it only me who thinks
that is is pretty annoying
S. ancelot wrote:
>
> Hi,
>
> If I remember, the best thing to do is using a squashfs filesystem.
>
> Taking the filesystem completely in ram is a bad idea and unnecessary
> (CF are lifetime warranty if you only read it !).
>
> Are you using catalyst ???
>
>
> I advice you trying GNAP in order to understand how to go on ...
>
> Best regards
> Steph
>
>
> Marcel Romijn wrote:
>
>> Hi Heath,
>>
>> I know about the limited number of write cycles on CF. Therefore I want
>> the CF only to supply the kernel and the ramdisk image. My intention is
>> to run Linux and my application completely from ramdisk.
>> I want my device to be complately silent, therefore it has a fanless
>> ME6000 board, no fans in the case and no harddisk (actually strange to
>> 'hear' a computer boot in complete silence!). The CF is on an IDE
>> converter and is recognized as /dev/hda1 (although for testing it has a
>> normal harddisk connected).
>>
>> I was able to follow your howto to the end.
>> Although I had some problems where the boot process stopped after
>> "Freeing unused kernel memory". This turned out to be a typo in
>> /etc/fstab on my side.
>>
>> Now that I have bootable configuration, I can look into what it takes to
>> have the system files in a ramdisk image and have it mounted as '/'.
>>
>> I think I could just create an initrd from the whole system and have
>> grub and the kernel extract it in memory and mount it.
>> I have not done much investigation on it, be it seems to me that the
>> /linuxrc in the initrd can be fairly simple. Actually just calling the
>> /sbin/init once the ramdisk is mountded as '/'.
>>
>> Anyone any experience with this?
>>
>> PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>> and booting. I saw Pierre Cassimans is interested in this subject as
>> well.
>> This might go off topic for the Gentoo Embedded Howto.
>>
>> Marcel
>>
>> -----Original Message-----
>> From: Heath Holcomb [mailto:liquidcable@bulah.com] Sent: Sunday, 14
>> August, 2005 0:53
>> To: gentoo-embedded@lists.gentoo.org
>> Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>> 0.07
>>
>> On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>>
>>
>>> Hello Heath,
>>>
>>> Nice writedown! I haven't made it to the end yet (lack of time), but
>>>
>>
>> I'm
>>
>>
>>> getting there...
>>>
>>> I noticed some issues along the way (not counting grub begin spelled
>>>
>>
>> as
>>
>>
>>> "grug" or "gurb" ;-) )
>>>
>>> In step 3 you write:
>>>
>>> <snip>
>>> # Set root password for the embedded_rootfs
>>> chromm /embedded_rootfs
>>> passwd
>>> rm /embedded_rootfs/etc/passwd-
>>> Exit
>>> </snip>
>>>
>>> I presume 'chromm' should have been 'chroot' ?
>>> If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>> before the "exit" or the "exit" before the "rm
>>> /embedded_rootfs/etc/passwd-".
>>>
>>
>>
>> Yes, "chromm" should be "chroot". The order is correct, as far as I can
>> tell.
>> chroot /embedded_rootfs
>> passwd
>> rm /embedded_rootfs/etc/passwd-
>> exit
>>
>>
>>
>>
>>> A few lines down, you write:
>>>
>>> <snip>
>>> rm -R /embedded_rootfs/var/db/pkg/ *
>>> </snip>
>>>
>>> As a reletive newbie, doing a quick copy/paste of this command late in
>>> the evening as root in '/', this wiped out all files, except the ones
>>> that were firmly locked.
>>> Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>>
>>
>> a
>>
>>
>>> previous snapshot ;-)
>>>
>>> I presume the space before the '*' should have been omitted?
>>>
>>> <snip>
>>> rm -R /embedded_rootfs/var/db/pkg/*
>>> </snip>
>>>
>>
>>
>> Major typo on my part. Fixed in version 0.08.
>>
>>
>>
>>> My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>> reads the kernel and a ramdisk image from CF and then runs completely
>>> from RAM.
>>> If I'm not mistaken, you were heading for a Via Epia as well?
>>>
>>
>>
>> My target will be a Via based SBC. From what I have read using a
>> ramdisk on a x86 based platform really does not buy you much. But
>> you sure don't
>> want to write to the CF all that often (limited write cycles, usallay
>> 100,000 to
>>
>> 300,000). So I plan on mounting the / partition of the CF as read only
>> and creating a separate partition that is mounted read/write and have my
>> embedded application and only my application write to that partition.
>>
>>
>>
>>> Regards,
>>>
>>> Marcel Romijn
>>>
>>>
>>> -----Original Message-----
>>> From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>> Sent: Monday, 08 August, 2005 4:17
>>> To: gentoo-embedded@lists.gentoo.org
>>> Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>>
>>> Version 0.07
>>> Please add, delete, modify. Thanks!
>>>
>>> Several fixes. Root password now works. Several work arounds are no
>>> longer
>>> need, as the embedded Gentoo team has fixed them (I'm guess because I
>>>
>>
>> no
>>
>>
>>> longer get those errors). There is still one problem when "emerge -e
>>> system"
>>> for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>> Check
>>> out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>> -e
>>> system).
>>>
>>> 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.
>>> #
>>> # version 0.07
>>> # 2005.8.7
>>> #
>>> # 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 -
>>>
>>> # Create the development_rootfs.
>>> # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
>>
>>
>>> ibc-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
>>>
>>> # Emerge the system ebuild for the development_rootfs.
>>> 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 1
>>> # 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 grug 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
>>> chromm /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
>>>
>>
>>
>>
>>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 11:09 ` Natanael Copa
@ 2005-08-16 16:46 ` Robert Wohleb
0 siblings, 0 replies; 19+ messages in thread
From: Robert Wohleb @ 2005-08-16 16:46 UTC (permalink / raw
To: gentoo-embedded
If you are trying to pick up a thread in the middle, yes it is annoying.
If you are actively involved in the thread, it is annoying to have to
scroll to the bottom for every response. Life sucks and then you die.
You can't have your cake and eat it too.
~Rob
Natanael Copa wrote:
> Best regards
> Natanael Copa
>
> people are talking about?
> http://en.wikipedia.org/wiki/Top-posting
>
> and then scroll to the top again
> to get a clue about what
>
> when you have to scroll to
> the bottom of every posting
>
> Is it only me who thinks
> that is is pretty annoying
>
>
> S. ancelot wrote:
>
>>
>> Hi,
>>
>> If I remember, the best thing to do is using a squashfs filesystem.
>>
>> Taking the filesystem completely in ram is a bad idea and unnecessary
>> (CF are lifetime warranty if you only read it !).
>>
>> Are you using catalyst ???
>>
>>
>> I advice you trying GNAP in order to understand how to go on ...
>>
>> Best regards
>> Steph
>>
>>
>> Marcel Romijn wrote:
>>
>>> Hi Heath,
>>>
>>> I know about the limited number of write cycles on CF. Therefore I want
>>> the CF only to supply the kernel and the ramdisk image. My intention is
>>> to run Linux and my application completely from ramdisk.
>>> I want my device to be complately silent, therefore it has a fanless
>>> ME6000 board, no fans in the case and no harddisk (actually strange to
>>> 'hear' a computer boot in complete silence!). The CF is on an IDE
>>> converter and is recognized as /dev/hda1 (although for testing it has a
>>> normal harddisk connected).
>>>
>>> I was able to follow your howto to the end.
>>> Although I had some problems where the boot process stopped after
>>> "Freeing unused kernel memory". This turned out to be a typo in
>>> /etc/fstab on my side.
>>>
>>> Now that I have bootable configuration, I can look into what it
>>> takes to
>>> have the system files in a ramdisk image and have it mounted as '/'.
>>>
>>> I think I could just create an initrd from the whole system and have
>>> grub and the kernel extract it in memory and mount it.
>>> I have not done much investigation on it, be it seems to me that the
>>> /linuxrc in the initrd can be fairly simple. Actually just calling the
>>> /sbin/init once the ramdisk is mountded as '/'.
>>>
>>> Anyone any experience with this?
>>>
>>> PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>>> and booting. I saw Pierre Cassimans is interested in this subject as
>>> well.
>>> This might go off topic for the Gentoo Embedded Howto.
>>>
>>> Marcel
>>>
>>> -----Original Message-----
>>> From: Heath Holcomb [mailto:liquidcable@bulah.com] Sent: Sunday, 14
>>> August, 2005 0:53
>>> To: gentoo-embedded@lists.gentoo.org
>>> Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>>> 0.07
>>>
>>> On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>>>
>>>
>>>> Hello Heath,
>>>>
>>>> Nice writedown! I haven't made it to the end yet (lack of time), but
>>>>
>>>
>>>
>>> I'm
>>>
>>>
>>>> getting there...
>>>>
>>>> I noticed some issues along the way (not counting grub begin spelled
>>>>
>>>
>>>
>>> as
>>>
>>>
>>>> "grug" or "gurb" ;-) )
>>>>
>>>> In step 3 you write:
>>>>
>>>> <snip>
>>>> # Set root password for the embedded_rootfs
>>>> chromm /embedded_rootfs
>>>> passwd
>>>> rm /embedded_rootfs/etc/passwd-
>>>> Exit
>>>> </snip>
>>>>
>>>> I presume 'chromm' should have been 'chroot' ?
>>>> If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>>> before the "exit" or the "exit" before the "rm
>>>> /embedded_rootfs/etc/passwd-".
>>>>
>>>
>>>
>>>
>>> Yes, "chromm" should be "chroot". The order is correct, as far as I
>>> can
>>> tell.
>>> chroot /embedded_rootfs
>>> passwd
>>> rm /embedded_rootfs/etc/passwd-
>>> exit
>>>
>>>
>>>
>>>
>>>> A few lines down, you write:
>>>>
>>>> <snip>
>>>> rm -R /embedded_rootfs/var/db/pkg/ *
>>>> </snip>
>>>>
>>>> As a reletive newbie, doing a quick copy/paste of this command late in
>>>> the evening as root in '/', this wiped out all files, except the ones
>>>> that were firmly locked.
>>>> Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>>>
>>>
>>>
>>> a
>>>
>>>
>>>> previous snapshot ;-)
>>>>
>>>> I presume the space before the '*' should have been omitted?
>>>>
>>>> <snip>
>>>> rm -R /embedded_rootfs/var/db/pkg/*
>>>> </snip>
>>>>
>>>
>>>
>>>
>>> Major typo on my part. Fixed in version 0.08.
>>>
>>>
>>>
>>>> My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>>> reads the kernel and a ramdisk image from CF and then runs completely
>>>> from RAM.
>>>> If I'm not mistaken, you were heading for a Via Epia as well?
>>>>
>>>
>>>
>>>
>>> My target will be a Via based SBC. From what I have read using a
>>> ramdisk on a x86 based platform really does not buy you much. But
>>> you sure don't
>>> want to write to the CF all that often (limited write cycles,
>>> usallay 100,000 to
>>>
>>> 300,000). So I plan on mounting the / partition of the CF as read only
>>> and creating a separate partition that is mounted read/write and
>>> have my
>>> embedded application and only my application write to that partition.
>>>
>>>
>>>
>>>> Regards,
>>>>
>>>> Marcel Romijn
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>>> Sent: Monday, 08 August, 2005 4:17
>>>> To: gentoo-embedded@lists.gentoo.org
>>>> Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>>>
>>>> Version 0.07
>>>> Please add, delete, modify. Thanks!
>>>>
>>>> Several fixes. Root password now works. Several work arounds are no
>>>> longer
>>>> need, as the embedded Gentoo team has fixed them (I'm guess because I
>>>>
>>>
>>>
>>> no
>>>
>>>
>>>> longer get those errors). There is still one problem when "emerge -e
>>>> system"
>>>> for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>>> Check
>>>> out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>>> -e
>>>> system).
>>>>
>>>> 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.
>>>> #
>>>> # version 0.07
>>>> # 2005.8.7
>>>> #
>>>> # 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 -
>>>>
>>>> # Create the development_rootfs.
>>>> # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
>>>
>>>
>>>
>>>> ibc-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
>>>>
>>>> # Emerge the system ebuild for the development_rootfs.
>>>> 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 1
>>>> # 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 grug 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
>>>> chromm /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
>>>>
>>>
>>>
>>>
>>>
>>>
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 6:43 Marcel Romijn
2005-08-16 9:28 ` S. ancelot
@ 2005-08-16 9:30 ` S. ancelot
1 sibling, 0 replies; 19+ messages in thread
From: S. ancelot @ 2005-08-16 9:30 UTC (permalink / raw
To: gentoo-embedded
One thing more :
In order to boot some compact flash, you may have to solve issues with
DMA (disable in kernel).
Best Regards
Steph
Marcel Romijn wrote:
>Hi Heath,
>
>I know about the limited number of write cycles on CF. Therefore I want
>the CF only to supply the kernel and the ramdisk image. My intention is
>to run Linux and my application completely from ramdisk.
>I want my device to be complately silent, therefore it has a fanless
>ME6000 board, no fans in the case and no harddisk (actually strange to
>'hear' a computer boot in complete silence!). The CF is on an IDE
>converter and is recognized as /dev/hda1 (although for testing it has a
>normal harddisk connected).
>
>I was able to follow your howto to the end.
>Although I had some problems where the boot process stopped after
>"Freeing unused kernel memory". This turned out to be a typo in
>/etc/fstab on my side.
>
>Now that I have bootable configuration, I can look into what it takes to
>have the system files in a ramdisk image and have it mounted as '/'.
>
>I think I could just create an initrd from the whole system and have
>grub and the kernel extract it in memory and mount it.
>I have not done much investigation on it, be it seems to me that the
>/linuxrc in the initrd can be fairly simple. Actually just calling the
>/sbin/init once the ramdisk is mountded as '/'.
>
>Anyone any experience with this?
>
>PS. Maybe we should spawn of another thread about VIA Epia boards, CF
>and booting. I saw Pierre Cassimans is interested in this subject as
>well.
>This might go off topic for the Gentoo Embedded Howto.
>
>Marcel
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Sunday, 14 August, 2005 0:53
>To: gentoo-embedded@lists.gentoo.org
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
>0.07
>
>On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
>
>
>>Hello Heath,
>>
>>Nice writedown! I haven't made it to the end yet (lack of time), but
>>
>>
>I'm
>
>
>>getting there...
>>
>>I noticed some issues along the way (not counting grub begin spelled
>>
>>
>as
>
>
>>"grug" or "gurb" ;-) )
>>
>>In step 3 you write:
>>
>><snip>
>># Set root password for the embedded_rootfs
>>chromm /embedded_rootfs
>>passwd
>>rm /embedded_rootfs/etc/passwd-
>>Exit
>></snip>
>>
>>I presume 'chromm' should have been 'chroot' ?
>>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>>before the "exit" or the "exit" before the "rm
>>/embedded_rootfs/etc/passwd-".
>>
>>
>
>Yes, "chromm" should be "chroot". The order is correct, as far as I can
>tell.
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
>
>
>
>
>>A few lines down, you write:
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/ *
>></snip>
>>
>>As a reletive newbie, doing a quick copy/paste of this command late in
>>the evening as root in '/', this wiped out all files, except the ones
>>that were firmly locked.
>>Fortunately, I'm going through you HowTo in VMWare, so I could restore
>>
>>
>a
>
>
>>previous snapshot ;-)
>>
>>I presume the space before the '*' should have been omitted?
>>
>><snip>
>>rm -R /embedded_rootfs/var/db/pkg/*
>></snip>
>>
>>
>
>Major typo on my part. Fixed in version 0.08.
>
>
>
>>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>>reads the kernel and a ramdisk image from CF and then runs completely
>>from RAM.
>>If I'm not mistaken, you were heading for a Via Epia as well?
>>
>>
>
>My target will be a Via based SBC. From what I have read using a
>ramdisk on a
>x86 based platform really does not buy you much. But you sure don't
>want to
>write to the CF all that often (limited write cycles, usallay 100,000 to
>
>300,000). So I plan on mounting the / partition of the CF as read only
>and
>creating a separate partition that is mounted read/write and have my
>embedded
>application and only my application write to that partition.
>
>
>
>>Regards,
>>
>>Marcel Romijn
>>
>>
>>-----Original Message-----
>>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>>Sent: Monday, 08 August, 2005 4:17
>>To: gentoo-embedded@lists.gentoo.org
>>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>>
>>Version 0.07
>>Please add, delete, modify. Thanks!
>>
>>Several fixes. Root password now works. Several work arounds are no
>>longer
>>need, as the embedded Gentoo team has fixed them (I'm guess because I
>>
>>
>no
>
>
>>longer get those errors). There is still one problem when "emerge -e
>>system"
>>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>>Check
>>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>>-e
>>system).
>>
>>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.
>>#
>># version 0.07
>># 2005.8.7
>>#
>># 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 -
>>
>># Create the development_rootfs.
>># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
>
>
>>ibc-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
>>
>># Emerge the system ebuild for the development_rootfs.
>>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 1
>># 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 grug 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
>>chromm /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
>>
>>
>
>
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-16 6:43 Marcel Romijn
2005-08-16 18:50 ` Lee Azzarello
0 siblings, 1 reply; 19+ messages in thread
From: Marcel Romijn @ 2005-08-16 6:43 UTC (permalink / raw
To: gentoo-embedded
Hi,
I'm using VMware as virtual machine for development.
Theoretically, VMware could also be used as target machine to test a
compiled kernel and system image.
However, the hardware that VMware emulates is of course not the same as
the VIA Epia boards. So a running system on a VMware session is no
guarantee for a running system on the real hardware.
I have no experience with qemu. I see on their site that it can emulate
a number of processors (or use the host processor), but I don't see (or
haven't looked closely enough) what hardware it simulates.
Marcel
-----Original Message-----
From: Pierre Cassimans [mailto:kammicazze@hotmail.com]
Sent: Friday, 12 August, 2005 11:20
To: gentoo-embedded@lists.gentoo.org
Subject: RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version
0.07
I saw these errors also yesterday, but did not find enough time to
submit
the comments yet :(
I still had problems with the python-fchksum stuff and groff compiling.
emerge python did the trick for the first thing and USE="-sandbox"
emerge -e
system did it for the second.
Those commands were available in howto version 0.6, not in the 0.7. But
they are still needed.
For what package is the USE="-sandbox" needed? I thought sandbox was a
FEATURE flag?
I'm also working on a VIA epia M9000 system. What i would like to do is
test
the image (booting etc) on qemu before putting it on a compact flash. It
would be nice if we could bring together some info on that part too (Or
on
other emulator soft). I will try to write it down while i work on this
part
and will post it here. If people already did this stuff, please post ;)
Pierre Cassimans
>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.07
>Date: Fri, 12 Aug 2005 02:39:00 -0400
>
>Hello Heath,
>
>Nice writedown! I haven't made it to the end yet (lack of time), but
I'm
>getting there...
>
>I noticed some issues along the way (not counting grub begin spelled as
>"grug" or "gurb" ;-) )
>
>In step 3 you write:
>
><snip>
># Set root password for the embedded_rootfs
>chromm /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>Exit
></snip>
>
>I presume 'chromm' should have been 'chroot' ?
>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>before the "exit" or the "exit" before the "rm
>/embedded_rootfs/etc/passwd-".
>
>A few lines down, you write:
>
><snip>
>rm -R /embedded_rootfs/var/db/pkg/ *
></snip>
>
>As a reletive newbie, doing a quick copy/paste of this command late in
>the evening as root in '/', this wiped out all files, except the ones
>that were firmly locked.
>Fortunately, I'm going through you HowTo in VMWare, so I could restore
a
>previous snapshot ;-)
>
>I presume the space before the '*' should have been omitted?
>
><snip>
>rm -R /embedded_rootfs/var/db/pkg/*
></snip>
>
>
>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>reads the kernel and a ramdisk image from CF and then runs completely
>from RAM.
>If I'm not mistaken, you were heading for a Via Epia as well?
>
>Regards,
>
>Marcel Romijn
>
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Monday, 08 August, 2005 4:17
>To: gentoo-embedded@lists.gentoo.org
>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>
>Version 0.07
>Please add, delete, modify. Thanks!
>
>Several fixes. Root password now works. Several work arounds are no
>longer
>need, as the embedded Gentoo team has fixed them (I'm guess because I
no
>
>longer get those errors). There is still one problem when "emerge -e
>system"
>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>Check
>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>-e
>system).
>
>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.
>#
># version 0.07
># 2005.8.7
>#
># 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 -
>
># Create the development_rootfs.
># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-uc
l
>ibc-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
>
># Emerge the system ebuild for the development_rootfs.
>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 1
># 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 grug 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
>chromm /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
>
>
>
>--
>gentoo-embedded@gentoo.org mailing list
>
--
gentoo-embedded@gentoo.org mailing list
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 6:43 Marcel Romijn
@ 2005-08-16 18:50 ` Lee Azzarello
0 siblings, 0 replies; 19+ messages in thread
From: Lee Azzarello @ 2005-08-16 18:50 UTC (permalink / raw
To: gentoo-embedded
On Tue, 2005-08-16 at 02:43 -0400, Marcel Romijn wrote:
> I'm using VMware as virtual machine for development.
> Theoretically, VMware could also be used as target machine to test a
> compiled kernel and system image.
> However, the hardware that VMware emulates is of course not the same as
> the VIA Epia boards. So a running system on a VMware session is no
> guarantee for a running system on the real hardware.
For those of you who don't like high licence fees and usage
restrictions, the Xen virtual machine monitor is GPL software and can
run Linux or FreeBSD guest operating systems. It features direct PCI
device access and full hardware emulation at near native speeds. There
are rumors that it'll run Windows as a guest in future versions.
--
Lee Azzarello
Network Engineer
Progressive Solutions
+1 212 937 8939
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-12 6:39 Marcel Romijn
2005-08-12 9:19 ` Pierre Cassimans
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Marcel Romijn @ 2005-08-12 6:39 UTC (permalink / raw
To: gentoo-embedded
Hello Heath,
Nice writedown! I haven't made it to the end yet (lack of time), but I'm
getting there...
I noticed some issues along the way (not counting grub begin spelled as
"grug" or "gurb" ;-) )
In step 3 you write:
<snip>
# Set root password for the embedded_rootfs
chromm /embedded_rootfs
passwd
rm /embedded_rootfs/etc/passwd-
Exit
</snip>
I presume 'chromm' should have been 'chroot' ?
If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
before the "exit" or the "exit" before the "rm
/embedded_rootfs/etc/passwd-".
A few lines down, you write:
<snip>
rm -R /embedded_rootfs/var/db/pkg/ *
</snip>
As a reletive newbie, doing a quick copy/paste of this command late in
the evening as root in '/', this wiped out all files, except the ones
that were firmly locked.
Fortunately, I'm going through you HowTo in VMWare, so I could restore a
previous snapshot ;-)
I presume the space before the '*' should have been omitted?
<snip>
rm -R /embedded_rootfs/var/db/pkg/*
</snip>
My aim is to create an embedded Gentoo for a Via Epia ME6000, which
reads the kernel and a ramdisk image from CF and then runs completely
from RAM.
If I'm not mistaken, you were heading for a Via Epia as well?
Regards,
Marcel Romijn
-----Original Message-----
From: Heath Holcomb [mailto:liquidcable@bulah.com]
Sent: Monday, 08 August, 2005 4:17
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
Version 0.07
Please add, delete, modify. Thanks!
Several fixes. Root password now works. Several work arounds are no
longer
need, as the embedded Gentoo team has fixed them (I'm guess because I no
longer get those errors). There is still one problem when "emerge -e
system"
for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
Check
out the bug report for the temp fix/work around (USE="-sandbox" emerge
-e
system).
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.
#
# version 0.07
# 2005.8.7
#
# 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 -
# Create the development_rootfs.
# 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
ibc-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
# Emerge the system ebuild for the development_rootfs.
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 1
# 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 grug 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
chromm /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
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-12 6:39 Marcel Romijn
@ 2005-08-12 9:19 ` Pierre Cassimans
2005-08-12 13:37 ` Heath Holcomb
2005-08-12 13:34 ` Heath Holcomb
2005-08-13 22:52 ` Heath Holcomb
2 siblings, 1 reply; 19+ messages in thread
From: Pierre Cassimans @ 2005-08-12 9:19 UTC (permalink / raw
To: gentoo-embedded
I saw these errors also yesterday, but did not find enough time to submit
the comments yet :(
I still had problems with the python-fchksum stuff and groff compiling.
emerge python did the trick for the first thing and USE="-sandbox" emerge -e
system did it for the second.
Those commands were available in howto version 0.6, not in the 0.7. But
they are still needed.
For what package is the USE="-sandbox" needed? I thought sandbox was a
FEATURE flag?
I'm also working on a VIA epia M9000 system. What i would like to do is test
the image (booting etc) on qemu before putting it on a compact flash. It
would be nice if we could bring together some info on that part too (Or on
other emulator soft). I will try to write it down while i work on this part
and will post it here. If people already did this stuff, please post ;)
Pierre Cassimans
>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.07
>Date: Fri, 12 Aug 2005 02:39:00 -0400
>
>Hello Heath,
>
>Nice writedown! I haven't made it to the end yet (lack of time), but I'm
>getting there...
>
>I noticed some issues along the way (not counting grub begin spelled as
>"grug" or "gurb" ;-) )
>
>In step 3 you write:
>
><snip>
># Set root password for the embedded_rootfs
>chromm /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>Exit
></snip>
>
>I presume 'chromm' should have been 'chroot' ?
>If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
>before the "exit" or the "exit" before the "rm
>/embedded_rootfs/etc/passwd-".
>
>A few lines down, you write:
>
><snip>
>rm -R /embedded_rootfs/var/db/pkg/ *
></snip>
>
>As a reletive newbie, doing a quick copy/paste of this command late in
>the evening as root in '/', this wiped out all files, except the ones
>that were firmly locked.
>Fortunately, I'm going through you HowTo in VMWare, so I could restore a
>previous snapshot ;-)
>
>I presume the space before the '*' should have been omitted?
>
><snip>
>rm -R /embedded_rootfs/var/db/pkg/*
></snip>
>
>
>My aim is to create an embedded Gentoo for a Via Epia ME6000, which
>reads the kernel and a ramdisk image from CF and then runs completely
>from RAM.
>If I'm not mistaken, you were heading for a Via Epia as well?
>
>Regards,
>
>Marcel Romijn
>
>
>-----Original Message-----
>From: Heath Holcomb [mailto:liquidcable@bulah.com]
>Sent: Monday, 08 August, 2005 4:17
>To: gentoo-embedded@lists.gentoo.org
>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>
>Version 0.07
>Please add, delete, modify. Thanks!
>
>Several fixes. Root password now works. Several work arounds are no
>longer
>need, as the embedded Gentoo team has fixed them (I'm guess because I no
>
>longer get those errors). There is still one problem when "emerge -e
>system"
>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>Check
>out the bug report for the temp fix/work around (USE="-sandbox" emerge
>-e
>system).
>
>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.
>#
># version 0.07
># 2005.8.7
>#
># 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 -
>
># Create the development_rootfs.
># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
>ibc-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
>
># Emerge the system ebuild for the development_rootfs.
>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 1
># 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 grug 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
>chromm /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
>
>
>
>--
>gentoo-embedded@gentoo.org mailing list
>
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-12 9:19 ` Pierre Cassimans
@ 2005-08-12 13:37 ` Heath Holcomb
0 siblings, 0 replies; 19+ messages in thread
From: Heath Holcomb @ 2005-08-12 13:37 UTC (permalink / raw
To: gentoo-embedded
I too am working with a VIA based SBCs. A CLE266 version, CL10000; and a
CN400 based one.
If you ever want the hardware mpeg2 decoding take a look at
http://gentoo-wiki.com/HOWTO_Unichrome
--
heath holcomb
liquidcable at bulah.com
www.bulah.com
On Friday 12 August 2005 04:19 am, Pierre Cassimans wrote:
> I saw these errors also yesterday, but did not find enough time to submit
> the comments yet :(
>
> I still had problems with the python-fchksum stuff and groff compiling.
>
> emerge python did the trick for the first thing and USE="-sandbox" emerge
> -e system did it for the second.
>
> Those commands were available in howto version 0.6, not in the 0.7. But
> they are still needed.
>
> For what package is the USE="-sandbox" needed? I thought sandbox was a
> FEATURE flag?
>
> I'm also working on a VIA epia M9000 system. What i would like to do is
> test the image (booting etc) on qemu before putting it on a compact flash.
> It would be nice if we could bring together some info on that part too (Or
> on other emulator soft). I will try to write it down while i work on this
> part and will post it here. If people already did this stuff, please post
> ;)
>
> Pierre Cassimans
>
> >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.07
> >Date: Fri, 12 Aug 2005 02:39:00 -0400
> >
> >Hello Heath,
> >
> >Nice writedown! I haven't made it to the end yet (lack of time), but I'm
> >getting there...
> >
> >I noticed some issues along the way (not counting grub begin spelled as
> >"grug" or "gurb" ;-) )
> >
> >In step 3 you write:
> >
> ><snip>
> ># Set root password for the embedded_rootfs
> >chromm /embedded_rootfs
> >passwd
> >rm /embedded_rootfs/etc/passwd-
> >Exit
> ></snip>
> >
> >I presume 'chromm' should have been 'chroot' ?
> >If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
> >before the "exit" or the "exit" before the "rm
> >/embedded_rootfs/etc/passwd-".
> >
> >A few lines down, you write:
> >
> ><snip>
> >rm -R /embedded_rootfs/var/db/pkg/ *
> ></snip>
> >
> >As a reletive newbie, doing a quick copy/paste of this command late in
> >the evening as root in '/', this wiped out all files, except the ones
> >that were firmly locked.
> >Fortunately, I'm going through you HowTo in VMWare, so I could restore a
> >previous snapshot ;-)
> >
> >I presume the space before the '*' should have been omitted?
> >
> ><snip>
> >rm -R /embedded_rootfs/var/db/pkg/*
> ></snip>
> >
> >
> >My aim is to create an embedded Gentoo for a Via Epia ME6000, which
> >reads the kernel and a ramdisk image from CF and then runs completely
> >from RAM.
> >If I'm not mistaken, you were heading for a Via Epia as well?
> >
> >Regards,
> >
> >Marcel Romijn
> >
> >
> >-----Original Message-----
> >From: Heath Holcomb [mailto:liquidcable@bulah.com]
> >Sent: Monday, 08 August, 2005 4:17
> >To: gentoo-embedded@lists.gentoo.org
> >Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
> >
> >Version 0.07
> >Please add, delete, modify. Thanks!
> >
> >Several fixes. Root password now works. Several work arounds are no
> >longer
> >need, as the embedded Gentoo team has fixed them (I'm guess because I no
> >
> >longer get those errors). There is still one problem when "emerge -e
> >system"
> >for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
> >Check
> >out the bug report for the temp fix/work around (USE="-sandbox" emerge
> >-e
> >system).
> >
> >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.
> >#
> ># version 0.07
> ># 2005.8.7
> >#
> ># 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 -
> >
> ># Create the development_rootfs.
> ># 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
> >ibc-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
> >
> ># Emerge the system ebuild for the development_rootfs.
> >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 1
> ># 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 grug 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
> >chromm /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
> >
> >
> >
> >--
> >gentoo-embedded@gentoo.org mailing list
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-12 6:39 Marcel Romijn
2005-08-12 9:19 ` Pierre Cassimans
@ 2005-08-12 13:34 ` Heath Holcomb
2005-08-13 22:52 ` Heath Holcomb
2 siblings, 0 replies; 19+ messages in thread
From: Heath Holcomb @ 2005-08-12 13:34 UTC (permalink / raw
To: gentoo-embedded
Those are some major errors on my part. I will release a new version shortly
(this weekend most likely). I will also put back all of the work arounds.
Thanks,
--
heath holcomb
liquidcable at bulah.com
www.bulah.com
On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
> Hello Heath,
>
> Nice writedown! I haven't made it to the end yet (lack of time), but I'm
> getting there...
>
> I noticed some issues along the way (not counting grub begin spelled as
> "grug" or "gurb" ;-) )
>
> In step 3 you write:
>
> <snip>
> # Set root password for the embedded_rootfs
> chromm /embedded_rootfs
> passwd
> rm /embedded_rootfs/etc/passwd-
> Exit
> </snip>
>
> I presume 'chromm' should have been 'chroot' ?
> If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
> before the "exit" or the "exit" before the "rm
> /embedded_rootfs/etc/passwd-".
>
> A few lines down, you write:
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/ *
> </snip>
>
> As a reletive newbie, doing a quick copy/paste of this command late in
> the evening as root in '/', this wiped out all files, except the ones
> that were firmly locked.
> Fortunately, I'm going through you HowTo in VMWare, so I could restore a
> previous snapshot ;-)
>
> I presume the space before the '*' should have been omitted?
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/*
> </snip>
>
>
> My aim is to create an embedded Gentoo for a Via Epia ME6000, which
> reads the kernel and a ramdisk image from CF and then runs completely
> from RAM.
> If I'm not mistaken, you were heading for a Via Epia as well?
>
> Regards,
>
> Marcel Romijn
>
>
> -----Original Message-----
> From: Heath Holcomb [mailto:liquidcable@bulah.com]
> Sent: Monday, 08 August, 2005 4:17
> To: gentoo-embedded@lists.gentoo.org
> Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>
> Version 0.07
> Please add, delete, modify. Thanks!
>
> Several fixes. Root password now works. Several work arounds are no
> longer
> need, as the embedded Gentoo team has fixed them (I'm guess because I no
>
> longer get those errors). There is still one problem when "emerge -e
> system"
> for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
> Check
> out the bug report for the temp fix/work around (USE="-sandbox" emerge
> -e
> system).
>
> 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.
> #
> # version 0.07
> # 2005.8.7
> #
> # 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 -
>
> # Create the development_rootfs.
> # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
> ibc-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
>
> # Emerge the system ebuild for the development_rootfs.
> 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 1
> # 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 grug 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
> chromm /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
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-12 6:39 Marcel Romijn
2005-08-12 9:19 ` Pierre Cassimans
2005-08-12 13:34 ` Heath Holcomb
@ 2005-08-13 22:52 ` Heath Holcomb
2005-08-17 13:02 ` Pierre Cassimans
2 siblings, 1 reply; 19+ messages in thread
From: Heath Holcomb @ 2005-08-13 22:52 UTC (permalink / raw
To: gentoo-embedded
On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
> Hello Heath,
>
> Nice writedown! I haven't made it to the end yet (lack of time), but I'm
> getting there...
>
> I noticed some issues along the way (not counting grub begin spelled as
> "grug" or "gurb" ;-) )
>
> In step 3 you write:
>
> <snip>
> # Set root password for the embedded_rootfs
> chromm /embedded_rootfs
> passwd
> rm /embedded_rootfs/etc/passwd-
> Exit
> </snip>
>
> I presume 'chromm' should have been 'chroot' ?
> If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
> before the "exit" or the "exit" before the "rm
> /embedded_rootfs/etc/passwd-".
Yes, "chromm" should be "chroot". The order is correct, as far as I can tell.
chroot /embedded_rootfs
passwd
rm /embedded_rootfs/etc/passwd-
exit
> A few lines down, you write:
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/ *
> </snip>
>
> As a reletive newbie, doing a quick copy/paste of this command late in
> the evening as root in '/', this wiped out all files, except the ones
> that were firmly locked.
> Fortunately, I'm going through you HowTo in VMWare, so I could restore a
> previous snapshot ;-)
>
> I presume the space before the '*' should have been omitted?
>
> <snip>
> rm -R /embedded_rootfs/var/db/pkg/*
> </snip>
Major typo on my part. Fixed in version 0.08.
>
> My aim is to create an embedded Gentoo for a Via Epia ME6000, which
> reads the kernel and a ramdisk image from CF and then runs completely
> from RAM.
> If I'm not mistaken, you were heading for a Via Epia as well?
My target will be a Via based SBC. From what I have read using a ramdisk on a
x86 based platform really does not buy you much. But you sure don't want to
write to the CF all that often (limited write cycles, usallay 100,000 to
300,000). So I plan on mounting the / partition of the CF as read only and
creating a separate partition that is mounted read/write and have my embedded
application and only my application write to that partition.
> Regards,
>
> Marcel Romijn
>
>
> -----Original Message-----
> From: Heath Holcomb [mailto:liquidcable@bulah.com]
> Sent: Monday, 08 August, 2005 4:17
> To: gentoo-embedded@lists.gentoo.org
> Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>
> Version 0.07
> Please add, delete, modify. Thanks!
>
> Several fixes. Root password now works. Several work arounds are no
> longer
> need, as the embedded Gentoo team has fixed them (I'm guess because I no
>
> longer get those errors). There is still one problem when "emerge -e
> system"
> for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
> Check
> out the bug report for the temp fix/work around (USE="-sandbox" emerge
> -e
> system).
>
> 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.
> #
> # version 0.07
> # 2005.8.7
> #
> # 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 -
>
> # Create the development_rootfs.
> # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
> ibc-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
>
> # Emerge the system ebuild for the development_rootfs.
> 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 1
> # 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 grug 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
> chromm /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
--
heath holcomb
liquidcable at bulah.com
www.bulah.com
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-13 22:52 ` Heath Holcomb
@ 2005-08-17 13:02 ` Pierre Cassimans
0 siblings, 0 replies; 19+ messages in thread
From: Pierre Cassimans @ 2005-08-17 13:02 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
>Subject: Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>Date: Sat, 13 Aug 2005 17:52:40 -0500
>
>On Friday 12 August 2005 01:39 am, Marcel Romijn wrote:
> > Hello Heath,
> >
> > Nice writedown! I haven't made it to the end yet (lack of time), but I'm
> > getting there...
> >
> > I noticed some issues along the way (not counting grub begin spelled as
> > "grug" or "gurb" ;-) )
> >
> > In step 3 you write:
> >
> > <snip>
> > # Set root password for the embedded_rootfs
> > chromm /embedded_rootfs
> > passwd
> > rm /embedded_rootfs/etc/passwd-
> > Exit
> > </snip>
> >
> > I presume 'chromm' should have been 'chroot' ?
> > If it is indeed 'chroot' then you should either do "rm /etc/passwd-"
> > before the "exit" or the "exit" before the "rm
> > /embedded_rootfs/etc/passwd-".
>
>Yes, "chromm" should be "chroot". The order is correct, as far as I can
>tell.
>chroot /embedded_rootfs
>passwd
>rm /embedded_rootfs/etc/passwd-
>exit
>
I think Marcel got it right, first exit the chroot before you can remove
something in /embedded_rootfs
OR
rm /etc/passwd- while you are in the chroot and exit after that.
>
> > A few lines down, you write:
> >
> > <snip>
> > rm -R /embedded_rootfs/var/db/pkg/ *
> > </snip>
> >
> > As a reletive newbie, doing a quick copy/paste of this command late in
> > the evening as root in '/', this wiped out all files, except the ones
> > that were firmly locked.
> > Fortunately, I'm going through you HowTo in VMWare, so I could restore a
> > previous snapshot ;-)
> >
> > I presume the space before the '*' should have been omitted?
> >
> > <snip>
> > rm -R /embedded_rootfs/var/db/pkg/*
> > </snip>
>
>Major typo on my part. Fixed in version 0.08.
>
> >
> > My aim is to create an embedded Gentoo for a Via Epia ME6000, which
> > reads the kernel and a ramdisk image from CF and then runs completely
> > from RAM.
> > If I'm not mistaken, you were heading for a Via Epia as well?
>
>My target will be a Via based SBC. From what I have read using a ramdisk
>on a
>x86 based platform really does not buy you much. But you sure don't want
>to
>write to the CF all that often (limited write cycles, usallay 100,000 to
>300,000). So I plan on mounting the / partition of the CF as read only and
>creating a separate partition that is mounted read/write and have my
>embedded
>application and only my application write to that partition.
>
> > Regards,
> >
> > Marcel Romijn
> >
> >
> > -----Original Message-----
> > From: Heath Holcomb [mailto:liquidcable@bulah.com]
> > Sent: Monday, 08 August, 2005 4:17
> > To: gentoo-embedded@lists.gentoo.org
> > Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
> >
> > Version 0.07
> > Please add, delete, modify. Thanks!
> >
> > Several fixes. Root password now works. Several work arounds are no
> > longer
> > need, as the embedded Gentoo team has fixed them (I'm guess because I no
> >
> > longer get those errors). There is still one problem when "emerge -e
> > system"
> > for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
> > Check
> > out the bug report for the temp fix/work around (USE="-sandbox" emerge
> > -e
> > system).
> >
> > 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.
> > #
> > # version 0.07
> > # 2005.8.7
> > #
> > # 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 -
> >
> > # Create the development_rootfs.
> > # 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://gentoo.osuosl.org/experimental/x86/embedded/stages/stage1-x86-ucl
> > ibc-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
> >
> > # Emerge the system ebuild for the development_rootfs.
> > 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 1
> > # 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 grug 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
> > chromm /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
>
>--
>heath holcomb
>liquidcable at bulah.com
>www.bulah.com
>--
>gentoo-embedded@gentoo.org mailing list
>
Regards,
Pierre Cassimans
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
@ 2005-08-08 2:16 Heath Holcomb
2005-08-16 20:33 ` Joshua ChaitinPollak
2005-08-19 9:05 ` Pierre Cassimans
0 siblings, 2 replies; 19+ messages in thread
From: Heath Holcomb @ 2005-08-08 2:16 UTC (permalink / raw
To: gentoo-embedded
Version 0.07
Please add, delete, modify. Thanks!
Several fixes. Root password now works. Several work arounds are no longer
need, as the embedded Gentoo team has fixed them (I'm guess because I no
longer get those errors). There is still one problem when "emerge -e system"
for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187). Check
out the bug report for the temp fix/work around (USE="-sandbox" emerge -e
system).
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.
#
# version 0.07
# 2005.8.7
#
# 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 -
# Create the development_rootfs.
# 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://gentoo.osuosl.org/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
# Emerge the system ebuild for the development_rootfs.
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 1
# 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 grug 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
chromm /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] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-08 2:16 Heath Holcomb
@ 2005-08-16 20:33 ` Joshua ChaitinPollak
2005-08-17 12:59 ` Pierre Cassimans
2005-08-19 9:05 ` Pierre Cassimans
1 sibling, 1 reply; 19+ messages in thread
From: Joshua ChaitinPollak @ 2005-08-16 20:33 UTC (permalink / raw
To: gentoo-embedded
On Aug 7, 2005, at 10:16 PM, Heath Holcomb wrote:
> Version 0.07
> Please add, delete, modify. Thanks!
Hello, I got as far as below without problems:
> # 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
This didn't work out of the box, the binary package wasn't available.
I'm new to using binaries with gentoo, so I could be wrong, but this
is the process I'm following:
emerge -B uclibc
ROOT=/embedded_rootfs emerge -K uclibc
Assuming this works, I'll repeat for busybox.
Looking forward to future updates to the howto.
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-16 20:33 ` Joshua ChaitinPollak
@ 2005-08-17 12:59 ` Pierre Cassimans
0 siblings, 0 replies; 19+ messages in thread
From: Pierre Cassimans @ 2005-08-17 12:59 UTC (permalink / raw
To: gentoo-embedded
>From: Joshua ChaitinPollak <jpollak@kivasystems.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.07
>Date: Tue, 16 Aug 2005 16:33:19 -0400
>
>
>On Aug 7, 2005, at 10:16 PM, Heath Holcomb wrote:
>
>>Version 0.07
>>Please add, delete, modify. Thanks!
>
>Hello, I got as far as below without problems:
>
>># 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
>
>This didn't work out of the box, the binary package wasn't available. I'm
>new to using binaries with gentoo, so I could be wrong, but this is the
>process I'm following:
>
>emerge -B uclibc
>ROOT=/embedded_rootfs emerge -K uclibc
>
>Assuming this works, I'll repeat for busybox.
I guess you forgot FEATURES="buildpkg" in your /etc/make.conf
>
>Looking forward to future updates to the howto.
>
>--
>gentoo-embedded@gentoo.org mailing list
>
Pierre Cassimans
--
gentoo-embedded@gentoo.org mailing list
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
2005-08-08 2:16 Heath Holcomb
2005-08-16 20:33 ` Joshua ChaitinPollak
@ 2005-08-19 9:05 ` Pierre Cassimans
1 sibling, 0 replies; 19+ messages in thread
From: Pierre Cassimans @ 2005-08-19 9:05 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
>Subject: [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07
>Date: Sun, 7 Aug 2005 21:16:59 -0500
>
>Version 0.07
>Please add, delete, modify. Thanks!
>
>Several fixes. Root password now works. Several work arounds are no
>longer
>need, as the embedded Gentoo team has fixed them (I'm guess because I no
>longer get those errors). There is still one problem when "emerge -e
>system"
>for groff. Bug 98187 (http://bugs.gentoo.org/show_bug.cgi?id=98187).
>Check
>out the bug report for the temp fix/work around (USE="-sandbox" emerge -e
>system).
>
>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.
>#
># version 0.07
># 2005.8.7
>#
># 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 -
>
># Create the development_rootfs.
># 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://gentoo.osuosl.org/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
>
># Emerge the system ebuild for the development_rootfs.
>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 1
># 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 grug 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
>chromm /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
This command installs the modules in the development_rootfs /lib/modules
directory.
A correct command could be:
make install INSTALL_MOD_PATH=/embedded_rootfs/
>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] 19+ messages in thread
end of thread, other threads:[~2005-08-19 9:06 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-18 6:24 [gentoo-embedded] x86 SBC Gentoo Embedded HotTo version 0.07 Marcel Romijn
-- strict thread matches above, loose matches on Subject: below --
2005-08-18 6:26 Marcel Romijn
2005-08-16 6:43 Marcel Romijn
2005-08-16 9:28 ` S. ancelot
2005-08-16 11:09 ` Natanael Copa
2005-08-16 16:46 ` Robert Wohleb
2005-08-16 9:30 ` S. ancelot
2005-08-16 6:43 Marcel Romijn
2005-08-16 18:50 ` Lee Azzarello
2005-08-12 6:39 Marcel Romijn
2005-08-12 9:19 ` Pierre Cassimans
2005-08-12 13:37 ` Heath Holcomb
2005-08-12 13:34 ` Heath Holcomb
2005-08-13 22:52 ` Heath Holcomb
2005-08-17 13:02 ` Pierre Cassimans
2005-08-08 2:16 Heath Holcomb
2005-08-16 20:33 ` Joshua ChaitinPollak
2005-08-17 12:59 ` Pierre Cassimans
2005-08-19 9:05 ` Pierre Cassimans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox