Ignore:
Timestamp:
Feb 15, 2012, 11:10:42 PM (8 years ago)
Author:
amain
Message:

Fix ticket #167: handle kernel version 3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/openwrt-deliver.mk

    r185 r332  
    1919# save in a special config file during OpenWrt's build process
    2020#
    21 # OPENWRT_BIN_DIR       - directory where OpenWrt firmware is stored
    22 # OPENWRT_PACKAGE_DIR   - directory where OpenWrt packages are stored
    23 # OPENWRT_TMP_DIR       - directory where OpenWrt stored all kernel modules
    24 # OPENWRT_LINUX_VERSION - kernel version of the kernel build by OpenWrt
    25 # OPENWRT_LINUX_DIR     - OpenWrt's kernel build directory
     21# OPENWRT_BIN_DIR               - directory where OpenWrt firmware is stored
     22# OPENWRT_PACKAGE_DIR           - directory where OpenWrt packages are stored
     23# OPENWRT_TMP_DIR               - directory where OpenWrt stored all kernel modules
     24# OPENWRT_LINUX_VERSION         - kernel version of the kernel build by OpenWrt
     25# OPENWRT_LINUX_UNAME_VERSION   - uname kernel version of the kernel build by OpenWrt
     26# OPENWRT_LINUX_DIR             - OpenWrt's kernel build directory
    2627#
    2728-include $(OPENWRT_SAVE_CONFIG_FILE)
     
    4647        @echo OPENWRT_TMP_DIR=$(OPENWRT_TMP_DIR)
    4748        @echo OPENWRT_LINUX_VERSION=$(OPENWRT_LINUX_VERSION)
     49        @echo OPENWRT_LINUX_UNAME_VERSION=$(OPENWRT_LINUX_UNAME_VERSION)
    4850        @echo OPENWRT_LINUX_DIR=$(OPENWRT_LINUX_DIR)
    4951
     
    5759  ifndef OPENWRT_LINUX_VERSION
    5860        @echo OPENWRT_LINUX_VERSION$(ERROR_MSG_NOCONF) && false
     61  endif
     62  ifndef OPENWRT_LINUX_UNAME_VERSION
     63        @echo OPENWRT_LINUX_UNAME_VERSION$(ERROR_MSG_NOCONF) && false
    5964  endif
    6065  ifndef OPENWRT_LINUX_DIR
     
    7681        mkdir -p $(INSTALL_DIR) $(INSTALL_DIR_OPENWRT) $(INSTALL_DIR_OPENWRT_MODULES)
    7782        mkdir -p $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules
    78         cp -r ${OPENWRT_TMP_DIR}/modules/lib/modules/${OPENWRT_LINUX_VERSION} $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules
    79         rm -f $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules/${OPENWRT_LINUX_VERSION}/build
    80         rm -f $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules/${OPENWRT_LINUX_VERSION}/source
     83        cp -r ${OPENWRT_TMP_DIR}/modules/lib/modules/${OPENWRT_LINUX_UNAME_VERSION} $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules
     84        rm -f $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules/${OPENWRT_LINUX_UNAME_VERSION}/build
     85        rm -f $(INSTALL_DIR_OPENWRT_MODULES)/lib/modules/${OPENWRT_LINUX_UNAME_VERSION}/source
    8186        find $(OPENWRT_PACKAGE_DIR) -name "kmod-*" | while read fkmod; do \
    8287            $(SCRIPT_EXTRACT_KMODPKG) $$fkmod $(INSTALL_DIR_OPENWRT_MODULES) $(TMP_DIR) || true; \
    8388        done
    84         PATH="/sbin:/bin:/usr/sbin:/usr/bin" depmod -a -b $(INSTALL_DIR_OPENWRT_MODULES) ${OPENWRT_LINUX_VERSION}
     89        PATH="/sbin:/bin:/usr/sbin:/usr/bin" depmod -a -b $(INSTALL_DIR_OPENWRT_MODULES) ${OPENWRT_LINUX_UNAME_VERSION}
    8590        tar czf $(INSTALL_DIR)/$(MODULES_TAR_GZ) -C $(INSTALL_DIR_OPENWRT_MODULES) .
    8691
     
    8893        rm -rf $(INSTALL_DIR_OPENWRT_HEADERS)
    8994        mkdir -p $(INSTALL_DIR_OPENWRT_HEADERS)
    90         mkdir -p $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_VERSION}
    91         cd $(OPENWRT_LINUX_DIR) && make headers_install ARCH=$(patsubst %el,%,$(TARGET_ARCH)) INSTALL_HDR_PATH=$(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_VERSION}
     95        mkdir -p $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_UNAME_VERSION}
     96        cd $(OPENWRT_LINUX_DIR) && make headers_install ARCH=$(patsubst %el,%,$(TARGET_ARCH)) INSTALL_HDR_PATH=$(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_UNAME_VERSION}
    9297        # some overrides which are not cleanly installed by make headers_install
    93         cp $(OPENWRT_LINUX_DIR)/include/linux/switch.h $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_VERSION}/include/linux/switch.h
    94         cp ${OPENWRT_LINUX_DIR}/.config $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_VERSION}
     98        cp $(OPENWRT_LINUX_DIR)/include/linux/switch.h $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_UNAME_VERSION}/include/linux/switch.h
     99        cp ${OPENWRT_LINUX_DIR}/.config $(INSTALL_DIR_OPENWRT_HEADERS)/usr/src/linux-headers-${OPENWRT_LINUX_UNAME_VERSION}
    95100        tar czf $(INSTALL_DIR)/$(HEADERS_TAR_GZ) -C $(INSTALL_DIR_OPENWRT_HEADERS) .
    96101
Note: See TracChangeset for help on using the changeset viewer.