uclibc: trim config
[qi-bootmenu-system/guyou.git] / initramfs.sh
blobc4a20e1c67719c6c3a9a07229b61fb4463fca631
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
15 [ -e "$ROOT_DIR/lib/modules" ] && find "$ROOT_DIR/lib/modules" -name '*.ko' | xargs ${STRIP}
17 # remove libthread_db which is used for cross debuging with gdb
18 rm -f "$ROOT_DIR"/lib/libthread_db*
21 # generate file with the contents of the initramfs it's later used
22 # by the kernel build system to create a gziped cpio archive which
23 # is then embedded into the kernel binary.
25 $SCRIPTS/gen_initramfs_list.sh -u squash -g squash $ROOT_DIR > \
26 initramfs-files
28 echo "Now run './build.sh kernel' which will build a kernel with initramfs-files as"
29 echo "CONFIG_INITRAMFS_SOURCE or run ./package.sh to create a rootfs.tar.gz tarball"
30 echo "that you can extract on a SD card."