How to create bare minimum Debian Wheezy rootfs from scratch

olimex

debian-wheezy-download

In this post we will explain how you can create your own Debian rootfs with pre-installed packages of your choice, which to allow tiny Linux images to be created.

All steps below should work on any Debian host (Debian/Ubuntu etc) and are verified with Ubuntu 12.04LTS.

First of all you need to install the support packages on your pc

sudo apt-get install qemu-user-static debootstrap binfmt-support

Next you need to choose the version of Debian in this case we are building a wheezy image.

targetdir=rootfsdistro=wheezy

Now we will build first stage of Debian rootfs :

mkdir $targetdirsudo debootstrap --arch=armhf --foreign $distro $targetdir

Next copy the qemu-arm-static binary into the right place for the binfmt packages to find it and copy in resolv.conf from the host.

sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin/sudo cp /etc/resolv.conf $targetdir/etc

If everything is right we now have a minimal Debian Rootfs

sudo chroot $targetdir

Inside theā€¦

View original post 313 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s