1
0

GB-PC1_debian-modules.sh 1.2 KB

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # Pack external modules for Debian rootfs - LEDE
  3. LINUX=4.4
  4. VERSION=$(echo ${LINUX}$(grep "^LINUX_VERSION-${LINUX}" include/kernel-version.mk | cut -d' ' -f 3))
  5. ARCH=$(sed -n 's/^CONFIG_ARCH=//p' .config | sed 's/^"\|"$//g')
  6. CPU_TYPE=$(sed -n 's/^CONFIG_CPU_TYPE=//p' .config | sed 's/^"\|"$//g')
  7. CONFIG_LIBC=$(sed -n 's/^CONFIG_LIBC=//p' .config | sed 's/^"\|"$//g')
  8. CONFIG_LIBC_VERSION=$(sed -n 's/^CONFIG_LIBC_VERSION=//p' .config | sed 's/^"\|"$//g')
  9. CONFIG_TARGET_BOARD=$(sed -n 's/^CONFIG_TARGET_BOARD=//p' .config | sed 's/^"\|"$//g')
  10. CONFIG_TARGET_SUBTARGET=$(sed -n 's/^CONFIG_TARGET_SUBTARGET=//p' .config | sed 's/"//g')
  11. BOARD=${CONFIG_TARGET_SUBTARGET}
  12. #VERSION=$(sed -n 's/^LINUX_VERSION:=//p' target/linux/${CONFIG_TARGET_BOARD}/${CONFIG_TARGET_SUBTARGET}/Makefile | cut -f 1 -d-)
  13. TARGET_DIR=build_dir/target-${ARCH}_${CPU_TYPE}_${CONFIG_LIBC}-${CONFIG_LIBC_VERSION}/linux-${CONFIG_TARGET_BOARD}_${BOARD}/linux-${VERSION}
  14. cd $TARGET_DIR
  15. find . -name "*.ko" -or -wholename "./modules.builtin" -or -wholename "./modules.order" | tar -cvzf modules.$VERSION.tar.gz -T -
  16. cd -
  17. scp $TARGET_DIR/modules.$VERSION.tar.gz bin/targets/${CONFIG_TARGET_BOARD}/${BOARD}/modules.$VERSION-gnu.tar.gz