Is it? Maybe this template will save a little time. You'll need to supply a
new linuxrc script, add your new executables, and possibly new libraries (you
know the drill: whereis thingy, ldd /path/thingy, see if the list has
anything new. The strip technique I'm using follows symlinks nicely...), and
you may not need losetup, of course. :)
echo --- "Creating image for bootloader ramdisk (initrd)..." &&
dd if=/dev/zero of=ramdisk.img bs=1024 count=3072 &&
mke2fs -b 1024 -F -m 0 ramdisk.img &&
tune2fs -c 0 -i 0 ramdisk.img &&
mkdir ramdisktmp &&
mount -o loop ramdisk.img ramdisktmp &&
cd ramdisktmp &&
rmdir lost+found &&
mkdir dev lib bin var &&
echo --- Creating device nodes... &&
mknod dev/hda1 b 3 1 &&
mknod dev/hda2 b 3 2 &&
mknod dev/hda3 b 3 3 &&
mknod dev/hda4 b 3 4 &&
mknod dev/loop0 b 7 0 &&
mknod dev/console c 5 1 &&
mknod dev/zero c 1 5 &&
echo --- Copying stripped executable files... &&
strip /bin/bash -o bin/bash &&
strip /bin/mount -o bin/mount &&
strip /sbin/losetup -o bin/losetup &&
echo --- Copying stripped libraries... &&
strip /lib/libc.so.6 -o lib/libc.so.6 &&
strip /lib/libncurses.so.5 -o lib/libncurses.so.5 &&
strip /lib/libdl.so.2 -o lib/libdl.so.2 &&
strip /lib/ld-linux.so.2 -o lib/ld-linux.so.2 &&
chmod +x lib/* &&
echo --- Writing ramdisk boot script... &&
cat > linuxrc << EOF &&
#!/bin/bash
mount -n /dev/$VAR /var
losetup /dev/loop0 /var/local/firmware/$DATE/zisofs.img
EOF
chmod +x linuxrc &&
echo --- Compressing ramdisk image... &&
cd .. &&
umount ramdisktmp &&
rmdir ramdisktmp &&
gzip -9 ramdisk.img
if [ $? -ne 0 ]; then exit 1; fi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/