diff --git a/bsp/board_dir300.bsp b/bsp/board_dir300.bsp index 01551ae..ff41c73 100644 --- a/bsp/board_dir300.bsp +++ b/bsp/board_dir300.bsp @@ -10,10 +10,6 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp ./bsp/$machine/kernel_config-3.3 $target/target/linux/atheros/config-3.3 - cp -r ./bsp/$machine/root_file_system/* $target/files/ - # Remove fastd and configurator start on WAN event /bin/rm $target/files/etc/hotplug.d/iface/50-fastdstart /bin/rm $target/files/etc/hotplug.d/iface/51-configurator diff --git a/bsp/board_fonera.bsp b/bsp/board_fonera.bsp index 384d18f..1571b90 100644 --- a/bsp/board_fonera.bsp +++ b/bsp/board_fonera.bsp @@ -10,10 +10,6 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp ./bsp/$machine/kernel_config-3.3 $target/target/linux/atheros/config-3.3 - cp -r ./bsp/$machine/root_file_system/* $target/files/ - # Remove fastd and configurator start on WAN event /bin/rm $target/files/etc/hotplug.d/iface/50-fastdstart /bin/rm $target/files/etc/hotplug.d/iface/51-configurator diff --git a/bsp/board_wr1043nd.bsp b/bsp/board_wr1043nd.bsp index d99b990..dd7ed1c 100644 --- a/bsp/board_wr1043nd.bsp +++ b/bsp/board_wr1043nd.bsp @@ -7,8 +7,7 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp -r ./bsp/$machine/root_file_system/* $target/files/ + echo "nothing todo" > /dev/null } board_postbuild() { diff --git a/bsp/board_wr741nd2.bsp b/bsp/board_wr741nd2.bsp index 66e25e2..c721802 100644 --- a/bsp/board_wr741nd2.bsp +++ b/bsp/board_wr741nd2.bsp @@ -7,8 +7,7 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp -r ./bsp/$machine/root_file_system/* $target/files/ + echo "nothing todo" > /dev/null } board_postbuild() { diff --git a/bsp/board_wr741nd4.bsp b/bsp/board_wr741nd4.bsp index 68a063e..88f6c74 100644 --- a/bsp/board_wr741nd4.bsp +++ b/bsp/board_wr741nd4.bsp @@ -7,8 +7,7 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp -r ./bsp/$machine/root_file_system/* $target/files/ + echo "nothing todo" > /dev/null } board_postbuild() { diff --git a/bsp/board_wr841n8.bsp b/bsp/board_wr841n8.bsp index 3927d6b..3d57aae 100644 --- a/bsp/board_wr841n8.bsp +++ b/bsp/board_wr841n8.bsp @@ -8,8 +8,7 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp -r ./bsp/$machine/root_file_system/* $target/files/ + echo "nothing todo" > /dev/null } board_postbuild() { diff --git a/bsp/board_wr841nd7.bsp b/bsp/board_wr841nd7.bsp index e68438e..10caeb0 100644 --- a/bsp/board_wr841nd7.bsp +++ b/bsp/board_wr841nd7.bsp @@ -7,8 +7,7 @@ board_prepare() { } board_prebuild() { - cp ./bsp/$machine/.config $target/.config - cp -r ./bsp/$machine/root_file_system/* $target/files/ + echo "nothing todo" > /dev/null } board_postbuild() { diff --git a/buildscript b/buildscript index 8b68198..b1850bd 100755 --- a/buildscript +++ b/buildscript @@ -116,6 +116,14 @@ prebuild() { mkdir $target/files cp -r ./bsp/default/root_file_system/* $target/files/ + cp -r ./bsp/$machine/root_file_system/* $target/files/ + cp ./bsp/$machine/.config $target/.config + + arch=$(awk -F= '/^CONFIG_TARGET_BOARD/{print gsub(/"/,"",$2); print $2;}' ./bsp/$machine/.config) + version=$(awk '/^CONFIG_LINUX/ { sub(/CONFIG_LINUX_/,""); sub(/=y/,""); gsub(/_/,"."); print; }' ./bsp/$machine/.config) + test -f ./bsp/$machine/.kernelconfig-$version && \ + cp ./bsp/$machine/.kernelconfig-$version \ + $target/target/linux/$arch/config-$version board_prebuild @@ -165,6 +173,44 @@ build() { postbuild } +config() { + prebuild + + opath=$(pwd) + cd $target + + case "$1" in + "openwrt") + make menuconfig + ;; + "kernel") + make kernel_menuconfig + ;; + esac + + cd $opath + + save="" + until [ "$save" = "y" -o "$save" = "n" ]; do + echo "Do you want to save the generated config? (y/n)" + read save + done + + if [ "$save" = "y" ]; then + case "$1" in + "openwrt") + grep '^CON\|^# CON' $target/.config | sort > ./bsp/$machine/.config + ;; + "kernel") + arch=$(awk -F= '/^CONFIG_TARGET_BOARD/{gsub(/"/,"",$2); print $2;}' ./bsp/$machine/.config) + version=$(awk '/^CONFIG_LINUX/ { sub(/CONFIG_LINUX_/,""); sub(/=y/,""); gsub(/_/,"."); print; }' ./bsp/$machine/.config) + grep '^CON\|^# CON' $target/target/linux/$arch/config-$version | sort > ./bsp/$machine/.kernelconfig-$version + ;; + esac + fi + +} + postbuild() { board_postbuild } @@ -270,6 +316,21 @@ case "$1" in build "$2" fi ;; + "config") + case "$2" in + openwrt) + config openwrt + ;; + kernel) + config kernel + ;; + *) + echo "This open the OpenWRT menuconfig dialog" + echo + echo "Usage: $0 $1 openwrt|kernel" + ;; + esac + ;; "download") if [ "$2" = "help" ] || [ "$2" = "" ]; then echo "This option downloads the ready configured images from an external location if needet." @@ -324,6 +385,7 @@ case "$1" in echo " selectcommunity [communityfile]" echo " selectbsp [bsp file]" echo " prepare" + echo " config" echo " build" echo " flash" echo " download"