📄 install.sh.svn-base
字号:
#! /bin/sh## Shell script to integrate madwifi sources into a Linux# source tree so it can be built statically. Typically this# is done to simplify debugging with tools like kgdb.#set -edie(){ echo "FATAL ERROR: $1" >&2 exit 1}SRC=..KERNEL_VERSION=$(uname -r)if test -n "$1"; then KERNEL_PATH="$1"else if test -e /lib/modules/${KERNEL_VERSION}/source; then KERNEL_PATH="/lib/modules/${KERNEL_VERSION}/source"else if test -e /lib/modules/${KERNEL_VERSION}/build; then KERNEL_PATH="/lib/modules/${KERNEL_VERSION}/build"else die "Cannot guess kernel source location"fififitest -d ${KERNEL_PATH} || die "No kernel directory ${KERNEL_PATH}"PATCH(){ patch -N $1 < $2}## Location of various pieces. These mimic what is in Makefile.inc# and can be overridden from the environment.#SRC_HAL=${HAL:-${SRC}/hal}test -d ${SRC_HAL} || die "No hal directory ${SRC_HAL}"SRC_NET80211=${WLAN:-${SRC}/net80211}test -d ${SRC_NET80211} || die "No net80211 directory ${SRC_NET80211}"SRC_ATH=${ATH:-${SRC}/ath}test -d ${SRC_ATH} || die "No ath directory ${SRC_ATH}"SRC_ATH_RATE=${SRC}/ath_ratetest -d ${SRC_ATH_RATE} || die "No rate control algorithm directory ${SRC_ATH_RATE}"SRC_COMPAT=${SRC}/includetest -d ${SRC_COMPAT} || die "No compat directory ${SRC_COMPAT}"WIRELESS=${KERNEL_PATH}/drivers/net/wirelesstest -d ${WIRELESS} || die "No wireless directory ${WIRELESS}"if test -f ${WIRELESS}/Kconfig; then kbuild=2.6 kbuildconf=Kconfigelse if test -f ${WIRELESS}/Config.in; then kbuild=2.4 kbuildconf=Config.inelse die "Kernel build system is not supported"fifiecho "Copying top-level files"MADWIFI=${WIRELESS}/madwifirm -rf ${MADWIFI}mkdir -p ${MADWIFI}make -s -C ${SRC} svnversion.hcp -f ${SRC}/BuildCaps.inc ${SRC}/svnversion.h ${SRC}/release.h ${MADWIFI}echo "Copying source files"FILES=$(cd ${SRC} && find ath ath_rate hal include net80211 -name '*.[ch]')FILES="$FILES $(cd ${SRC} && find hal -name '*.ini')"for f in $FILES; do case $f in *.mod.c) continue;; esac mkdir -p $(dirname ${MADWIFI}/$f) cp -f ${SRC}/$f ${MADWIFI}/$fdoneecho "Copying makefiles"FILES=$(cd ${SRC} && find . -name Makefile.kernel)for f in $FILES; do cp -f ${SRC}/$f $(dirname ${MADWIFI}/$f)/Makefiledoneecho "Patching the build system"if test "$kbuild" = 2.6; thencp -f Kconfig ${MADWIFI}sed -i '/madwifi/d;/^endmenu/i\source "drivers/net/wireless/madwifi/Kconfig"' ${WIRELESS}/Kconfigsed -i '$a\obj-$(CONFIG_ATHEROS) += madwifi//madwifi/d;' ${WIRELESS}/Makefileelsecp -f Config.in ${MADWIFI}sed -i '$a\source drivers/net/wireless/madwifi/Config.in/madwifi/d' ${WIRELESS}/Config.insed -i '/madwifi/d;/include/i\subdir-$(CONFIG_ATHEROS) += madwifi\obj-$(CONFIG_ATHEROS) += madwifi/madwifi.o' ${WIRELESS}/MakefileDST_DOC=${KERNEL_PATH}/Documentationgrep -q 'CONFIG_ATHEROS' ${DST_DOC}/Configure.help || \ PATCH ${DST_DOC}/Configure.help Configure.help.patchfiecho "Done"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -