forked from freifunk-franken/firmware
buildscript: add support for config targets
With this changes it's possible to open the menuconfig and kernel_menuconfig target and save the corresponding config files to the local bsp. Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
This commit is contained in:
parent
d47e1d1e6c
commit
fbd093d05f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
62
buildscript
62
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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user