rewrite to use busybox
TODO: rewrite some of the tools to use the busybox tools instead of the "normal" utilities during installation, so we can shave off another 15 MB from the installer svn path=/nixu/trunk/; revision=6063
This commit is contained in:
parent
33940db2dc
commit
7e6a7d6418
5 changed files with 18 additions and 31 deletions
|
@ -1,6 +1,6 @@
|
|||
#! @bash@/bin/sh -e
|
||||
|
||||
export PATH=/bin:/sbin:@bash@/bin:@coreutilsdiet@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@utilLinux@/bin:@utilLinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin:@eject@/bin:@kudzu@/sbin:@utillinux@/bin:@gzip@/bin
|
||||
export PATH=/bin:/sbin:@bash@/bin:@findutils@/bin:@busybox@/bin:@busybox@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@eject@/bin:@kudzu@/sbin:
|
||||
|
||||
##
|
||||
## In the beginning we want to have a minimalistic environment, built with
|
||||
|
@ -204,6 +204,8 @@ mknod -m 0444 $root/dev/urandom c 1 9
|
|||
rm -f $root/etc/mtab
|
||||
ln -s /proc/mounts $root/etc/mtab
|
||||
|
||||
# prevent df from barfing
|
||||
ln -s /proc/mounts /etc/mtab
|
||||
|
||||
## Probe for CD device which contains our CD here and mount /nix and
|
||||
## /nixpkgs from it inside the ramdisk. Anaconda uses kudzu for this.
|
||||
|
@ -258,7 +260,7 @@ echo verifying Nix DB...
|
|||
$NIX/nix-store --verify
|
||||
|
||||
echo copying nixpkgs...
|
||||
tar --directory=$root -zxvf /cdrom/nixpkgs.tgz
|
||||
tar --directory=$root -zxf /cdrom/nixpkgs.tgz
|
||||
|
||||
make_dir 0755 /tmp/scripts
|
||||
cp -fa /cdrom/scripts $root/tmp
|
||||
|
@ -275,7 +277,7 @@ cp /cdrom/mystorepaths $root/tmp
|
|||
|
||||
echo copying store
|
||||
|
||||
tar --directory=$root -zxvf /cdrom/nixstore.tgz
|
||||
tar --directory=$root -zxf /cdrom/nixstore.tgz
|
||||
|
||||
echo registering valid paths...
|
||||
|
||||
|
|
2
init.sh
2
init.sh
|
@ -1,3 +1,3 @@
|
|||
#! @bash@/bin/sh -e
|
||||
|
||||
exec ./fill-disk.sh | @coreutils@/bin/tee /tmp/install-log
|
||||
exec ./fill-disk.sh | @busybox@/bin/tee /tmp/install-log
|
||||
|
|
35
make-disk.sh
35
make-disk.sh
|
@ -34,6 +34,7 @@ initdir=${archivesDir}/initdir
|
|||
initscript=$archivesDir/scripts/init.sh
|
||||
|
||||
nix=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).nixUnstable' | $NIX/nix-instantiate -))
|
||||
busybox=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).busybox' | $NIX/nix-instantiate -))
|
||||
|
||||
nixDeps=$($NIX/nix-store -qR $nix)
|
||||
|
||||
|
@ -58,10 +59,6 @@ kernel=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).kernel' | $NIX/nix-instan
|
|||
|
||||
#nixDeps=$($NIX/nix-store -qR $(echo '(import ./pkgs.nix).nix' | $NIX/nix-instantiate -))
|
||||
|
||||
#nixDeps=$($NIX/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).nix' | $NIX/nix-instantiate -)))
|
||||
#echo $($NIX/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).nix' | $NIX/nix-instantiate -))) >> $storePaths
|
||||
#$NIX/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).nix' | $NIX/nix-instantiate -)) >> $storePaths
|
||||
|
||||
utillinux=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).utillinux' | $NIX/nix-instantiate -))
|
||||
|
||||
gnugrep=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).gnugrep' | $NIX/nix-instantiate -))
|
||||
|
@ -70,7 +67,8 @@ grub=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).grubWrapper' | $NIX/nix-ins
|
|||
|
||||
findutils=$($NIX/nix-store -q $(echo '(import ./pkgs.nix).findutilsWrapper' | $NIX/nix-instantiate -))
|
||||
|
||||
combideps=$($NIX/nix-store -qR $nix $utillinux $gnugrep $grub $gzip $findutils)
|
||||
#combideps=$($NIX/nix-store -qR $nix $utillinux $gnugrep $grub $gzip $findutils)
|
||||
combideps=$($NIX/nix-store -qR $nix $busybox $grub $findutils)
|
||||
|
||||
for i in $storeExpr
|
||||
do
|
||||
|
@ -125,22 +123,6 @@ eject=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).eject' | $NIX/nix-instanti
|
|||
sysklogd=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).sysklogd' | $NIX/nix-instantiate -))
|
||||
#kudzu=$($NIX/nix-store -r $(echo '(import ./pkgs.nix).kudzu' | $NIX/nix-instantiate -))
|
||||
|
||||
#(while read storepath; do
|
||||
#cp -fa --parents ${storepath} ${archivesDir}
|
||||
#done) < $storePaths
|
||||
|
||||
#echo utillinux $utilLinux
|
||||
|
||||
#for i in $utilLinux; do
|
||||
# echo i $i
|
||||
# deps=( $($NIX/nix-store -q --references $i) )
|
||||
# echo length ${#deps[@]}
|
||||
# if test "${#deps[@]}" = 0
|
||||
# then
|
||||
# echo zarro
|
||||
# fi
|
||||
#done
|
||||
|
||||
echo creating directories for bootimage
|
||||
|
||||
$coreutils/bin/mkdir ${initdir}
|
||||
|
@ -173,6 +155,7 @@ $coreutils/bin/mkdir ${archivesDir}/scripts
|
|||
$coreutils/bin/cp -fa * ${archivesDir}/scripts
|
||||
$gnused/bin/sed -e "s^@bash\@^$bash^g" \
|
||||
-e "s^@coreutils\@^$coreutilsdiet^g" \
|
||||
-e "s^@busybox\@^$busybox^g" \
|
||||
< $initscript > $initscript.tmp
|
||||
$coreutils/bin/mv $initscript.tmp $initscript
|
||||
$gnused/bin/sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
|
||||
|
@ -181,6 +164,7 @@ $gnused/bin/sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
|
|||
-e "s^@bash\@^$bash^g" \
|
||||
-e "s^@bashGlibc\@^$bashGlibc^g" \
|
||||
-e "s^@findutils\@^$findutils^g" \
|
||||
-e "s^@busybox\@^$busybox^g" \
|
||||
-e "s^@coreutilsdiet\@^$coreutilsdiet^g" \
|
||||
-e "s^@coreutils\@^$coreutils^g" \
|
||||
-e "s^@utilLinux\@^$utilLinux^g" \
|
||||
|
@ -251,14 +235,15 @@ $coreutils/bin/chmod u+x ${initdir}/ramdisk-login.sh
|
|||
#cp -fau --parents ${coreUtilsDiet} ${initdir}
|
||||
#cp -fau --parents ${modUtils} ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${bash}/bin ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${utilLinux}/bin ${initdir}
|
||||
$coreutils/bin/chmod -R u+w ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${utilLinux}/sbin ${initdir}
|
||||
#$coreutils/bin/cp -fau --parents ${utilLinux}/bin ${initdir}
|
||||
#$coreutils/bin/chmod -R u+w ${initdir}
|
||||
#$coreutils/bin/cp -fau --parents ${utilLinux}/sbin ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${e2fsProgs} ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${coreutilsdiet}/bin ${initdir}
|
||||
#$coreutils/bin/cp -fau --parents ${coreutilsdiet}/bin ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${modutils}/bin ${initdir}
|
||||
$coreutils/bin/chmod -R u+w ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${modutils}/sbin ${initdir}
|
||||
$coreutils/bin/cp -fau --parents ${busybox} ${initdir}
|
||||
|
||||
$coreutils/bin/touch ${archivesDir}/NIXOS
|
||||
|
||||
|
|
2
pkgs.nix
2
pkgs.nix
|
@ -6,7 +6,7 @@ rec {
|
|||
nixStatic strace shadowutils iputils gnumake curl gnused gnutar gnugrep
|
||||
gzip mingettyWrapper grubWrapper syslinux parted module_init_tools
|
||||
module_init_toolsStatic dhcpWrapper man nano eject sysklogd mktemp
|
||||
cdrtools cpio;
|
||||
cdrtools cpio busybox;
|
||||
|
||||
boot = (import ./boot) {
|
||||
inherit stdenv bash coreutils findutilsWrapper utillinux sysvinit
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! @bash@/bin/sh -e
|
||||
|
||||
export PATH=@bash@/bin:@coreutilsdiet@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin
|
||||
export PATH=@bash@/bin:@coreutilsdiet@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin:@busybox@/bin
|
||||
|
||||
tty=$1
|
||||
|
||||
|
|
Loading…
Reference in a new issue