qi-bootmenu: add build instructions
[qi-bootmenu-system/guyou.git] / initramfs.sh
blob326ab8af0583c4347ad3ba708d0794eb4ed4764b
1 #!/bin/bash
3 source sources/include.sh || exit 1
5 cd $TOP || dienow
7 # copy root overlay
9 tar -C "$ROOT_OVERLAY" -cf - . | tar -C "$ROOT_DIR" -xf -
11 if [ -z "$NO_STRIP" ]; then
12 # strip all binaries
13 ${STRIP} "$ROOT_DIR"/usr/{bin/*,sbin/*} 2> /dev/null
14 find "$ROOT_DIR/usr/lib" -name '*.so' | xargs ${STRIP} --strip-unneeded 2>/dev/null
16 # remove libthread_db which is used for cross debuging with gdb
17 rm "$ROOT_DIR/lib/libthread_db*"
20 # generate file with the contents of the initramfs it's later used
21 # by the kernel build system to create a gziped cpio archive which
22 # is then embedded into the kernel binary.
24 $SCRIPTS/gen_initramfs_list.sh -u squash -g squash $ROOT_DIR > \
25 initramfs-files
27 # Add some more device nodes
29 echo "nod /dev/tty 644 0 0 c 5 0" >> initramfs-files
30 echo "nod /dev/tty0 644 0 0 c 4 0" >> initramfs-files
31 echo "nod /dev/tty1 644 0 0 c 4 1" >> initramfs-files
32 echo "nod /dev/tty2 644 0 0 c 4 2" >> initramfs-files
33 echo "nod /dev/ttyGS0 644 0 0 c 253 0" >> initramfs-files
34 echo "nod /dev/ttySAC2 644 0 0 c 204 66" >> initramfs-files
35 echo "nod /dev/console 622 0 0 c 5 1" >> initramfs-files
36 echo "nod /dev/null 622 0 0 c 1 3" >> initramfs-files
37 echo "nod /dev/fb0 644 0 0 c 29 0" >> initramfs-files
39 echo "Specify initramfs-files during kernel compilation as CONFIG_INITRAMFS_SOURCE"
40 echo "or run ./package.sh to create rootfs.tar.gz tarball for a chroot environment."