mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
This update fixes a few critical errors:
- cd to the right directory when making the initramfs image (stupid stupid stupid mistake, cost me a day of work!) - make a bunch of devices inside the ramdisk - copy the kernel and all modules to the CD image - set the #! line in fill-disk to the right place (as in, append /bin/sh, another stupidity, which was luckily easily spot after fixing the first mistake, which was far more important) svn path=/nixu/trunk/; revision=3523
This commit is contained in:
parent
45492df16b
commit
93bcd71b15
45
fill-disk.sh
45
fill-disk.sh
@ -1,12 +1,51 @@
|
||||
#! @bash@ -e
|
||||
#! @bash@/bin/sh -e
|
||||
|
||||
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin
|
||||
|
||||
sysvinitPath=@sysvinitPath@
|
||||
bootPath=@bootPath@
|
||||
|
||||
mknod /dev/null c 1 3
|
||||
mknod /dev/console c 5 1
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sys /sys
|
||||
|
||||
#mount -t /dev/hdc /installimage
|
||||
|
||||
# make a complete /dev filesystem
|
||||
# ripped permissions and everything from anaconda (loader2/devices.h)
|
||||
|
||||
# consoles
|
||||
|
||||
mknod -m 0600 /dev/console c 5 1
|
||||
mknod -m 0600 /dev/ttyS0 c 4 64
|
||||
mknod -m 0600 /dev/ttyS1 c 4 65
|
||||
mknod -m 0600 /dev/ttyS2 c 4 66
|
||||
mknod -m 0600 /dev/ttyS3 c 4 67
|
||||
|
||||
# base UNIX devices
|
||||
mknod -m 0600 /dev/mem c 1 1
|
||||
mknod -m 0666 /dev/null c 1 3
|
||||
mknod -m 0666 /dev/zero c 1 5
|
||||
|
||||
# tty
|
||||
mknod -m 0600 /dev/tty c 5 0
|
||||
mknod -m 0600 /dev/tty0 c 4 0
|
||||
mknod -m 0600 /dev/tty1 c 4 1
|
||||
mknod -m 0600 /dev/tty2 c 4 2
|
||||
mknod -m 0600 /dev/tty3 c 4 3
|
||||
mknod -m 0600 /dev/tty4 c 4 4
|
||||
mknod -m 0600 /dev/tty5 c 4 5
|
||||
mknod -m 0600 /dev/tty6 c 4 6
|
||||
mknod -m 0600 /dev/tty7 c 4 7
|
||||
mknod -m 0600 /dev/tty8 c 4 8
|
||||
mknod -m 0600 /dev/tty9 c 4 9
|
||||
|
||||
mkdir -m 0755 /dev/pts
|
||||
mknod -m 0666 /dev/ptmx c 5 2
|
||||
|
||||
# random
|
||||
|
||||
mknod -m 0644 /dev/random c 1 8
|
||||
mknod -m 0644 /dev/urandom c 1 9
|
||||
|
||||
echo "blaat"
|
||||
|
||||
|
@ -3,4 +3,4 @@ prompt 1
|
||||
timeout 600
|
||||
label linux
|
||||
kernel vmlinuz
|
||||
append initrd=initram.img ramdisk_size=1000000
|
||||
append initrd=initram.img init=/bin/sh
|
||||
|
21
make-disk.sh
21
make-disk.sh
@ -70,14 +70,16 @@ echo creating directories for bootimage
|
||||
|
||||
mkdir ${initdir}
|
||||
mkdir ${initdir}/bin
|
||||
mkdir ${initdir}/dev
|
||||
mkdir ${initdir}/etc
|
||||
mkdir ${initdir}/installimage
|
||||
mkdir ${initdir}/proc
|
||||
mkdir ${initdir}/sbin
|
||||
mkdir ${initdir}/sys
|
||||
mkdir ${initdir}/tmp
|
||||
mkdir -p ${initdir}/usr/bin
|
||||
mkdir -p ${initdir}/usr/sbin
|
||||
mkdir ${initdir}/tmp
|
||||
mkdir ${initdir}/proc
|
||||
mkdir ${initdir}/var
|
||||
mkdir ${initdir}/etc
|
||||
mkdir ${initdir}/dev
|
||||
|
||||
echo copying nixpkgs
|
||||
|
||||
@ -87,6 +89,7 @@ echo copying packges from store
|
||||
|
||||
#cp -fa --parents ${nixDeps} ${archivesDir}
|
||||
cp -fau --parents ${utilLinux} ${archivesDir}
|
||||
#cp -fau --parents ${kernel} ${archivesDir}
|
||||
|
||||
bashdeps=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).bash' | $NIX_CMD_PATH/nix-instantiate -)))
|
||||
|
||||
@ -128,16 +131,12 @@ echo creating ramdisk
|
||||
rm -f ${initrd}
|
||||
cp ${archivesDir}/scripts/fill-disk.sh ${initdir}/init
|
||||
cp ${bash}/bin/* ${initdir}/bin
|
||||
#cp /nix/store/570hmhmx3v57605cqg9yfvvyh0nnb8k8-bash ${initdir}/bin/sh
|
||||
#cp -f /nix/store/570hmhmx3v57605cqg9yfvvyh0nnb8k8-bash ${initdir}/bin/sh
|
||||
chmod u+x ${initdir}/init
|
||||
cp -fau --parents ${bashdeps} ${initdir}
|
||||
|
||||
#mknod ${initdir}/dev/null c 1 3
|
||||
#mknod ${initdir}/dev/console c 5 1
|
||||
|
||||
(cd ${archivesDir}/initdisk; find . |cpio -c -o) | gzip -9 > ${initrd}
|
||||
|
||||
#mkcramfs ${archivesDir} /tmp/initramdisk.img
|
||||
#(cd ${initdir}; find . |cpio -c -o) | gzip -9 > ${initrd}
|
||||
(cd ${archivesDir}/initdir; find . |cpio -c -o) | gzip -9 > ${initrd}
|
||||
|
||||
cp ${initrd} ${archivesDir}/isolinux
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user