IIRC, busybox has enough to do all that.
It does. The problem with busybox is generally compatibility. It's great because of its small footprint and the ability to be built statically, but it's far from being fully compatible with coreutils and company.
I can't remember if I was able to use busybox to build the system libraries the last time I tried this. If not, I'll find out soon.
Edit: Since I don't seem to have stated this before, the hostname for the new system is going to be "
pyrite."
The first two things that I did was create a fresh, new ext4 partition on /dev/sdb5 and populate it with a mostly-FHS compliant directory structure. I did the former using a simple mkfs.ext4 and the latter with the following:
mkdir -pv /mnt/pyrite/{bin,boot,dev,etc,home,lib,mnt,opt,root,sbin,sys,usr/{local/,}{bin,include,lib,sbin,share/{man,doc,misc},src},tmp,var/{cache,lib,mail,opt,run,spool,tmp}}
After that, I went ahead and built a statically linked copy of busybox with a few unnecessary things stripped out of it. To avoid having to manually create the soft links to the busybox binaries, I installed it to a subdirectory inside where I extracted the source tarball, then moved the busybox binary and links to the pyrite root. Finally, I created an /etc/passwd file for the new installation using the following:
echo "root:x:0:0:root:/root:/bin/ash" >> /mnt/pyrite/etc/passwd
Now, let's chroot into the new environment:
chroot /mnt/pyrite /bin/ash
We have a root prompt. Perfect! Now to get development tools working for it...
Edit 2: First up is binutils. Since I'm doing the fakeroot method, I'm going to tell binutils to eventually install to /usr. We will call configure as follows:
./configure --prefix=/usr
Since I have a quad-core processor, I call make as follows to dramatically reduce build time:
make -j5
The build is successful, so I install the packages, manually setting the destination directory:
make DESTDIR=/mnt/pyrite/usr -n install
We'll take care of glibc later. It's always a gigantic pain in the ass to get compiled (mostly because even the "stable" branch never seems to compile properly if you don't patch the fuck out of it) and I'm going to wait until I have a bit more time to focus on it.