embedded gentoo [uclibc] | nothing beats this
A few uclibc embedded gentoo facts:
- the compilation of the box takes around 15 minutes
- at boot up, takes less than 3 megabytes of RAM
- disk space: 17 megabytes
- boots in under 8 seconds on a pentium3
link to stage3 tarballs archive

# this is my make.conf, it should be the same in the stage3, if installing anything in the stage3, and even before updating, comment the line INSTALL_MASK=”*.h HACKING.gz TODO.gz”
CFLAGS="-Os -mtune=i386 -pipe" CXXFLAGS="-Os -mtune=i386 -pipe" CHOST="i386-gentoo-linux-uclibc" FEATURES="strip" MAKEOPTS="-j3" GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" USE="-ipv6 -python3 -cracklib -minimal" LINGUAS="en" VIDEO_CARDS="" ACCEPT_KEYWORDS="~x86" INSTALL_MASK="*.h HACKING.gz TODO.gz"
# download my stage3, from the previous post links, and then prepare to chroot
mount -o bind /dev stage3-*/dev mount -o bind /proc stage3-*/proc chroot stage3-*
# update the system, and create the necessary path, if you come across any errors, post them here, and expect a reply soon
emerge -avuDN world mkdir /mounted
# begin the installation
# install necessary packages
ROOT=/mounted/ emerge -auvND baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop mkdir /mounted/proc mkdir /mounted/dev
# exit the chroot, and then unmount the dev and proc
umount stage3-*/dev umount stage3-*/proc
# chroot again and continue stripping
chroot stage3-*/
# you’ll need to copy what’s already in my stage3 dev/ to the target dev/
cp -r /dev/* /mounted/dev/
# begin unmercilessly throwing out things
rm -rf /mounted/var/db/* rm -rf /mounted/var/log/* rm -rf /mounted/usr/include/ rm -rf /mounted/usr/lib/pkgconfig/ cp -pr /mounted/usr/share/keymaps/i386/qwerty/ ./ rm -rf /mounted/usr/share/keymaps/* mkdir /mounted/usr/share/keymaps/i386/ mv ./qwerty/ /mounted/usr/share/keymaps/i386/ rm -rf /mounted/usr/share/nano/ rm -rf /mounted/var/lib/portage/ rm -rf /mounted/var/lib/gentoo/ rm -rf /mounted/var/lib/misc/ rm -rf /mounted/var/cache/* rm -rf /mounted/usr/share/terminfo/ rm -rf /mounted/usr/share/baselayout/ rm -rf /mounted/usr/share/consoletrans/ rm -rf /mounted/usr/share/openrc rm -rf /mounted/usr/sbin/fdformat rm -rf /mounted/var/lib/misc/ rm -rf /mounted/etc/logrotate.d/ rm -rf /mounted/etc/portage/
# i got the necessary libs for ext4 by doing ldd /sbin/fsck.ext4, if you use another filesystem, do the needful
# installing e2fsprogs hogs too much of valuable space
cp /sbin/fsck.ext4 /mounted/sbin/ cp /lib/libext2fs.so.2* /mounted/lib/ cp /lib/libcom_err.so.2* /mounted/lib/ cp /lib/libblkid.so.1* /mounted/lib/ cp /lib/libuuid.so.1* /mounted/lib/ cp /lib/libe2p.so.2* /mounted/lib/ cp /lib/libpthread* /mounted/lib/ cp /lib/ld-uClibc* /mounted/lib/
# copy, remove and then place the needed stuff for terminal fonts, etc.
cp /mounted/usr/share/unimaps/iso01.uni ./ cp /mounted/usr/share/consolefonts/default8x16.psfu.gz ./ rm -rf /mounted/usr/share/unimaps/* rm -rf /mounted/usr/share/consolefonts/* mv ./default8x16.psfu.gz /mounted/usr/share/consolefonts/ mv ./iso01.uni /mounted/usr/share/unimaps/
# all done
# I’m done, what now?
# Most importantly, get your kernel configured correctly, if anyone would want to use my kernel config as a base, comment, and I will upload it
# chroot into the target system(in this example, chroot /mounted), and run passwd, set the system root password, modify your /etc/fstab, here’s an example:
# <fs> <mountpoint> <type> <opts> <dump/pass> /dev/hda1 / ext4 noatime,nodelalloc 0 1 none /dev/pts devpts mode=0620 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
# now follow the gentoo handbook, and setup your network configuration, and whatever was missed out here
My kernel configuration for the Intel Pentium family is here :)
Pingback: Tweets that mention [going embedded with mGentoo] | jude pereira's blog -- Topsy.com
Pingback: New details emerge on ‘lost’ iPhone raid – New Mexico Business Weekly - Most hotest, Most latest Sci/Tech News Online - Top Sci/Tech News Online – Online News 28
Pingback: Links 18/5/2010: Linux 2.6.34 is Out, Desktop Summit 2011 Extends Deadline | Techrights