tina-openwrt编译

参考:

https://www.cnblogs.com/embedded-linux/p/6654094.html

https://www.cnblogs.com/sammei/p/3968916.html

 https://zhuanlan.zhihu.com/p/57784678

 

 

1、TINA  .config生成

 

.config: ./scripts/config/conf $(if $(CONFIG_HAVE_DOT_CONFIG),,prepare-tmpinfo)
    @+if [ \! -e .config ] || ! grep CONFIG_HAVE_DOT_CONFIG .config >/dev/null; then \
        if [ "x$(TARGET_BUILD_VARIANT)" = "xtina" ]; then \
            [ -e $(TARGET_CONFIG) ] && \
            cp $(TARGET_CONFIG) .config; \
        fi \
    elif [ -e .config -a "x$(TARGET_BUILD_VARIANT)" = "xtina" ]; then \
        cp $(TARGET_CONFIG) .config; \
    fi
 
 
defconfig: scripts/config/conf prepare-tmpinfo FORCE
    touch .config
    @if [ -z $(TARGET_BOARD) ]; then \
        echo "please run command:"; \
        echo "$ source build/envsetup.sh"; \
        echo "$ make defconfig"; \
    else \
        [ "x$(TARGET_BUILD_VARIANT)" = "xtina" ] && \
        [ -e target/allwinner/$(TARGET_BOARD)/defconfig ] && \
        cp target/allwinner/$(TARGET_BOARD)/defconfig .config; \
        $< --defconfig=.config Config.in; \
        if cat .config|grep CONFIG_TARGET_BOARD=\"$(TARGET_BOARD)\" >> /dev/null; then \
            [ "x$(TARGET_BUILD_VARIANT)" = "xtina" ] && \
            cp .config target/allwinner/$(TARGET_BOARD)/defconfig; \
            echo ; \
        else \
            rm .config; \
        fi \
    fi
 
menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
    if [ -z $(TARGET_BOARD) ]; then \
        echo "please run command:"; \
        echo "$ source build/envsetup.sh"; \
        echo "$ make menuconfig"; \
    else \
        [ "x$(TARGET_BUILD_VARIANT)" = "xtina" ] && \
        [ -e target/allwinner/$(TARGET_BOARD)/defconfig ] && \
        cp target/allwinner/$(TARGET_BOARD)/defconfig .config; \
        $< Config.in; \
        if cat .config|grep CONFIG_TARGET_BOARD=\"$(TARGET_BOARD)\" >> /dev/null; then \
            [ "x$(TARGET_BUILD_VARIANT)" = "xtina" ] && \
            cp .config target/allwinner/$(TARGET_BOARD)/defconfig; \
            echo ; \
        else \
            rm .config; \
        fi \
    fi
 

 

1、内核.config生成

oldconfig menuconfig nconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
rm -f $(LINUX_DIR)/.config.prev
rm -f $(STAMP_CONFIGURED)
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
$(_SINGLE)$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $$@
@if [ ! -f "$(LICHEE_CHIP_CONFIG_DIR)/configs/$(subst $(TARGET_PLATFORM)-,,$(TARGET_BOARD))/linux/config-$(KERNEL_PATCHVER)" ]; then \
$(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config > $(LINUX_RECONFIG_TARGET); \
else \
cmp -s $(LINUX_DIR)/.config $(LINUX_RECONFIG_TARGET) || { \
cp -rf $(LINUX_DIR)/.config $(LINUX_DIR)/arch/$(LINUX_KARCH)/configs/tina_defconfig; \
$(MAKE) CC=$(TARGET_CC) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) tina_defconfig > /dev/null; \
cp $(LINUX_DIR)/.config $(LINUX_RECONFIG_TARGET); \
rm -rf $(LINUX_DIR)/arch/$(LINUX_KARCH)/configs/tina_defconfig; \
} \
fi

执行结果:

第一步:合并两个config文件为.config文件,放置到  out路径,目标 路径为虚拟连接link路径。

第二步:配置

第三步:对比更新

command make V=s kernel_menuconfig

export MAKEFLAGS= ;make V=ss -C target/allwinner menuconfig
make[1]: Entering directory `/home/aic/work/tina/target/allwinner'
make[2]: Entering directory `/home/aic/work/tina/target/allwinner/mr813-shi'
rm -f /home/aic/work/tina/out/mr813-shi/compile_dir/target/linux-mr813-shi/linux-4.9.191/.config.prev
rm -f /home/aic/work/tina/out/mr813-shi/compile_dir/target/linux-mr813-shi/linux-4.9.191/.configured
/home/aic/work/tina/scripts/kconfig.pl + /home/aic/work/tina/target/allwinner/generic/config-4.9 /home/aic/work/tina/device/config/chips/mr813/configs/shi/linux/config-4.9 > /home/aic/work/tina/out/mr813-shi/compile_dir/target/linux-mr813-shi/linux-4.9.191/.config

export MAKEFLAGS= ;make -C /home/aic/work/tina/out/mr813-shi/compile_dir/target/linux-mr813-shi/linux-4.9.191 -C /home/aic/work/tina/out/mr813-shi/compile_dir/target/linux-mr813-shi/linux-4.9.191 HOSTCFLAGS="-O2 -I/home/aic/work/tina/out/host/include -I/home/aic/work/tina/out/host/usr/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="aarch64-openwrt-linux-gnu-" ARCH="arm64" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" CONFIG_SHELL="bash" V='' CC="aarch64-openwrt-linux-gnu-gcc" menuconfig
make[3]: Entering directory `/home/aic/work/tina/lichee/linux-4.9'
HOSTCC scripts/kconfig/mconf.o
In file included from scripts/kconfig/mconf.c:22:0:
scripts/kconfig/lkc.h:34:0: warning: "_" redefined [enabled by default]
#define _(text) gettext(text)
^
In file included from scripts/kconfig/lkc.h:12:0,
from scripts/kconfig/mconf.c:22:
/home/aic/work/tina/out/host/include/libintl.h:41:0: note: this is the location of the previous definition
#define _(String) (String)
^
In file included from scripts/kconfig/mconf.c:22:0:
scripts/kconfig/lkc.h:35:0: warning: "N_" redefined [enabled by default]
#define N_(text) (text)
^
In file included from scripts/kconfig/lkc.h:12:0,
from scripts/kconfig/mconf.c:22:
/home/aic/work/tina/out/host/include/libintl.h:42:0: note: this is the location of the previous definition
#define N_(String) String
^
scripts/kconfig/mconf.c: In function 'main':
/home/aic/work/tina/out/host/include/libintl.h:49:43: warning: statement with no effect [-Wunused-value]
#define bindtextdomain(Domain, Directory) (Domain)
^
scripts/kconfig/mconf.c:1013:2: note: in expansion of macro 'bindtextdomain'
bindtextdomain(PACKAGE, LOCALEDIR);
^
/home/aic/work/tina/out/host/include/libintl.h:51:28: warning: statement with no effect [-Wunused-value]
#define textdomain(String) (String) ?: "messages"
^
scripts/kconfig/mconf.c:1014:2: note: in expansion of macro 'textdomain'
textdomain(PACKAGE);
^
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:89:0:
scripts/kconfig/lkc.h:34:0: warning: "_" redefined [enabled by default]
#define _(text) gettext(text)
^
In file included from scripts/kconfig/lkc.h:12:0,
from scripts/kconfig/zconf.tab.c:89:
/home/aic/work/tina/out/host/include/libintl.h:41:0: note: this is the location of the previous definition
#define _(String) (String)
^
In file included from scripts/kconfig/zconf.tab.c:89:0:
scripts/kconfig/lkc.h:35:0: warning: "N_" redefined [enabled by default]
#define N_(text) (text)
^
In file included from scripts/kconfig/lkc.h:12:0,
from scripts/kconfig/zconf.tab.c:89:
/home/aic/work/tina/out/host/include/libintl.h:42:0: note: this is the location of the previous definition
#define N_(String) String
^
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
.config:4604:warning: override: SPARSEMEM_MANUAL changes choice state
configuration written to .config

 

posted @ 2022-06-22 16:54  liujunhuasd  阅读(308)  评论(0编辑  收藏  举报