support for initrd. Right now the image is *WAY* too big, so it boots with
a kernel panic. initrd should be brought back to a few megabytes instead so it can be safely unzipped in memory. Ideas: - klibc instead of glibc - leave out a lot of packages in the initrd: - gcc - linux-headers - ... - have a minimal "stage 1", which mounts the CD (figure out how) and remounts part of the CD on /nix and /nixpkgs svn path=/nixu/trunk/; revision=3502
This commit is contained in:
parent
b9617c9541
commit
9c56696e75
11
fill-disk.sh
11
fill-disk.sh
@ -1,4 +1,5 @@
|
|||||||
#! /bin/sh -e
|
#! @bash@ -e
|
||||||
|
## #! /bin/sh -e
|
||||||
|
|
||||||
sysvinitPath=@sysvinitPath@
|
sysvinitPath=@sysvinitPath@
|
||||||
bootPath=@bootPath@
|
bootPath=@bootPath@
|
||||||
@ -31,12 +32,12 @@ mkdir -p /tmp/mnt
|
|||||||
|
|
||||||
mount $device /tmp/mnt
|
mount $device /tmp/mnt
|
||||||
|
|
||||||
mkdir -p /nix
|
# mkdir -p /nix
|
||||||
mkdir -p /nixpkgs/trunk/pkgs
|
# mkdir -p /nixpkgs/trunk/pkgs
|
||||||
|
|
||||||
# temporary hack
|
# temporary hack
|
||||||
mount --bind /mnt/cdrom1/nix /nix
|
# mount --bind /mnt/cdrom1/nix /nix
|
||||||
mount --bind /mnt/cdrom1/pkgs /nixpkgs/trunk/pkgs
|
# mount --bind /mnt/cdrom1/pkgs /nixpkgs/trunk/pkgs
|
||||||
|
|
||||||
make_dir 00755 /bin
|
make_dir 00755 /bin
|
||||||
make_dir 00755 /dev
|
make_dir 00755 /dev
|
||||||
|
@ -3,4 +3,4 @@ prompt 1
|
|||||||
timeout 600
|
timeout 600
|
||||||
label linux
|
label linux
|
||||||
kernel vmlinuz
|
kernel vmlinuz
|
||||||
append root=/dev/hdc
|
append initrd=initram.img ramdisk_size=1000000
|
||||||
|
33
make-disk.sh
33
make-disk.sh
@ -10,6 +10,8 @@ fill_disk=$archivesDir/scripts/fill-disk.sh
|
|||||||
storePaths=$archivesDir/mystorepaths
|
storePaths=$archivesDir/mystorepaths
|
||||||
validatePaths=$archivesDir/validatepaths
|
validatePaths=$archivesDir/validatepaths
|
||||||
bootiso=/tmp/nixos.iso
|
bootiso=/tmp/nixos.iso
|
||||||
|
#initrd=/tmp/initrd.img
|
||||||
|
initrd=/tmp/initram.img
|
||||||
|
|
||||||
# keep chmod happy
|
# keep chmod happy
|
||||||
touch ${archivesDir}/blah
|
touch ${archivesDir}/blah
|
||||||
@ -42,6 +44,8 @@ echo $($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).ni
|
|||||||
|
|
||||||
utilLinux=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).utillinux' | $NIX_CMD_PATH/nix-instantiate -)))
|
utilLinux=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).utillinux' | $NIX_CMD_PATH/nix-instantiate -)))
|
||||||
|
|
||||||
|
bash=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).bash' | $NIX_CMD_PATH/nix-instantiate -))
|
||||||
|
|
||||||
(while read storepath; do
|
(while read storepath; do
|
||||||
cp -fa --parents ${storepath} ${archivesDir}
|
cp -fa --parents ${storepath} ${archivesDir}
|
||||||
done) < $storePaths
|
done) < $storePaths
|
||||||
@ -58,6 +62,18 @@ for i in $utilLinux; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo creating directories for bootimage
|
||||||
|
|
||||||
|
mkdir ${archivesDir}/bin
|
||||||
|
mkdir ${archivesDir}/sbin
|
||||||
|
mkdir -p ${archivesDir}/usr/bin
|
||||||
|
mkdir -p ${archivesDir}/usr/sbin
|
||||||
|
mkdir ${archivesDir}/tmp
|
||||||
|
mkdir ${archivesDir}/proc
|
||||||
|
mkdir ${archivesDir}/var
|
||||||
|
mkdir ${archivesDir}/etc
|
||||||
|
mkdir ${archivesDir}/dev
|
||||||
|
|
||||||
echo copying nixpkgs
|
echo copying nixpkgs
|
||||||
|
|
||||||
cp -fa ${nixpkgs} ${archivesDir}
|
cp -fa ${nixpkgs} ${archivesDir}
|
||||||
@ -67,6 +83,8 @@ echo copying packges from store
|
|||||||
#cp -fa --parents ${nixDeps} ${archivesDir}
|
#cp -fa --parents ${nixDeps} ${archivesDir}
|
||||||
cp -fau --parents ${utilLinux} ${archivesDir}
|
cp -fau --parents ${utilLinux} ${archivesDir}
|
||||||
|
|
||||||
|
echo bash $bash
|
||||||
|
|
||||||
echo copying scripts
|
echo copying scripts
|
||||||
|
|
||||||
mkdir ${archivesDir}/scripts
|
mkdir ${archivesDir}/scripts
|
||||||
@ -74,6 +92,7 @@ cp -fa * ${archivesDir}/scripts
|
|||||||
sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
|
sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
|
||||||
-e "s^@bootPath\@^$bootPath^g" \
|
-e "s^@bootPath\@^$bootPath^g" \
|
||||||
-e "s^@NIX_CMD_PATH\@^$nix^g" \
|
-e "s^@NIX_CMD_PATH\@^$nix^g" \
|
||||||
|
-e "s^@bash\@^$bash^g" \
|
||||||
< $fill_disk > $fill_disk.tmp
|
< $fill_disk > $fill_disk.tmp
|
||||||
mv $fill_disk.tmp $fill_disk
|
mv $fill_disk.tmp $fill_disk
|
||||||
|
|
||||||
@ -92,8 +111,18 @@ cp -L $kernel/vmlinuz ${archivesDir}/isolinux
|
|||||||
|
|
||||||
# echo making ramdisk
|
# echo making ramdisk
|
||||||
# todo!
|
# todo!
|
||||||
mkdir ${archivesDir}/sbin
|
# mkdir ${archivesDir}/sbin
|
||||||
ln -s /scripts/fill-disk.sh ${archivesDir}/sbin/init
|
# ln -s /scripts/fill-disk.sh ${archivesDir}/sbin/init
|
||||||
|
ln -s /scripts/fill-disk.sh ${archivesDir}/init
|
||||||
|
|
||||||
|
echo creating ramdisk
|
||||||
|
|
||||||
|
rm -f ${initrd}
|
||||||
|
(cd ${archivesDir}; find . |cpio -c -o) | gzip -9 > ${initrd}
|
||||||
|
|
||||||
|
#mkcramfs ${archivesDir} /tmp/initramdisk.img
|
||||||
|
|
||||||
|
cp ${initrd} ${archivesDir}/isolinux
|
||||||
|
|
||||||
echo creating ISO image
|
echo creating ISO image
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user