source: debwrt/trunk/rules/get_sub_board.sh @ 19

Last change on this file since 19 was 19, checked in by amain, 9 years ago

Replace CONFIG_DEBWRT_TARGET_ARCH with CONFIG_TARGET_ARCH

  • Property svn:executable set to *
File size: 1014 bytes
Line 
1#!/bin/bash
2#
3# DebWrt - Debian on Embedded devices
4#
5# Copyright (C) 2010 Johan van Zoomeren <amain@debwrt.net>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20CONFIG_FILE=$1
21BOARD=$2
22
23if [ -f $CONFIG_FILE ]; then
24        cat $CONFIG_FILE \
25        | grep CONFIG_TARGET_${BOARD}[^=] \
26        | grep -v "#" \
27        | awk '{print length($0)"\t"$0}' \
28        | sort -n -r \
29        | cut -f 2- \
30        | head -1 \
31        | sed -e "s/CONFIG_TARGET_${BOARD}_//" -e 's/=.*//'
32fi
Note: See TracBrowser for help on using the repository browser.