nixpkgs/boot/builder.sh
Armijn Hemel fe355bba78 replace a lot of tools we initially use with statically linked versions.
This reduces the ramdisk installer size with a few megabytes when gzipped,
but with about 40 MB when unpacked in memory.

There are a few improvements possible:

- strip the binaries. This saves another few MBs.
- only copy the binaries we really need to /bin or /sbin. This could reduce
the size of the installer a lot, especially with util-linux, of which we
don't use that many tools at all.
- try to move some packages we link with glibc right now (like util-linux) to
dietlibc. This will not work for bash, already tried that.
- try to use busybox as a replacement for everything.

svn path=/nixu/trunk/; revision=4428
2005-12-24 11:50:42 +00:00

49 lines
1.6 KiB
Bash
Executable file

#! /bin/sh -e
. $stdenv/setup
mkdir $out
mkdir $out/bin
for i in $boot $halt $login $env; do
dst=$out/bin/$(basename $i | cut -c34-)
sed \
-e "s^@bash\@^$bash^g" \
-e "s^@bashStatic\@^$bashStatic^g" \
-e "s^@coreutils\@^$coreutils^g" \
-e "s^@findutilsWrapper\@^$findutilsWrapper^g" \
-e "s^@utillinux\@^$utillinux^g" \
-e "s^@utillinuxStatic\@^$utillinuxStatic^g" \
-e "s^@sysvinit\@^$sysvinit^g" \
-e "s^@e2fsprogs\@^$e2fsprogs^g" \
-e "s^@nettools\@^$nettools^g" \
-e "s^@nix\@^$nix^g" \
-e "s^@wget\@^$wget^g" \
-e "s^@which\@^$which^g" \
-e "s^@subversion\@^$subversion^g" \
-e "s^@vim\@^$vim^g" \
-e "s^@screen\@^$screen^g" \
-e "s^@less\@^$less^g" \
-e "s^@openssh\@^$openssh^g" \
-e "s^@binutils\@^$binutils^g" \
-e "s^@strace\@^$strace^g" \
-e "s^@shadowutils\@^$shadowutils^g" \
-e "s^@iputils\@^$iputils^g" \
-e "s^@gnumake\@^$gnumake^g" \
-e "s^@curl\@^$curl^g" \
-e "s^@gnused\@^$gnused^g" \
-e "s^@gnutar\@^$gnutar^g" \
-e "s^@gnugrep\@^$gnugrep^g" \
-e "s^@gzip\@^$gzip^g" \
-e "s^@gcc\@^$gcc^g" \
-e "s^@mingettyWrapper\@^$mingettyWrapper^g" \
-e "s^@module_init_tools\@^$module_init_tools^g" \
-e "s^@grub\@^$grubWrapper^g" \
-e "s^@udev\@^$udev^g" \
-e "s^@dhcpWrapper\@^$dhcpWrapper^g" \
-e "s^@man\@^$man^g" \
-e "s^@nano\@^$nano^g" \
-e "s^@out\@^$out^g" \
< $i > $dst
chmod +x $dst
done