Buildroot Package Makefile:如何从 git 获取最新的提交?
我正在努力使用 $BR2_External 将我自己的模块添加到 buildroot 的构建中。我的包的 make 文件如下,
##############################################################
#
# GPIO
#
##############################################################
GPIO_VERSION = '2851a05c9b613c1736f79faa185a11118b229852'
GPIO_SITE = '<URL of git repo>'
GPIO_SITE_METHOD = git
GPIO_GIT_SUBMODULES = YES
GPIO_MODULE_SUBDIRS = GPIO_driver/
# GPIO_MODULE_SUBDIRS += GPIO_driver/
# define LDD_BUILD_CMDS
# $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/misc-modules
# $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/scull
# endef
#
# # TODO add your writer, finder and finder-test utilities/scripts to the installation steps below
define GPIO_INSTALL_TARGET_CMDS
#module
# $(INSTALL) -m 0755 $(@D)/01_simple_LKM/* $(TARGET_DIR)/usr/bin
$(INSTALL) -m 0755 $(@D)/GPIO_driver/* $(TARGET_DIR)/usr/bin
endef
$(eval $(kernel-module))
$(eval $(generic-package))
该 make 文件始终仅从 gitHub 提取特定提交(在 GPIO_VERSION 变量中提到)。这有点令人沮丧,因为每次我将新代码推送到 git 时,我都必须使用新的提交号更新 make 文件。那么,有没有什么方法可以编写 make 文件,以便拉取最近的提交。
I am working on adding my own module to the build of buildroot using $BR2_External. The make file of my package is as follows,
##############################################################
#
# GPIO
#
##############################################################
GPIO_VERSION = '2851a05c9b613c1736f79faa185a11118b229852'
GPIO_SITE = '<URL of git repo>'
GPIO_SITE_METHOD = git
GPIO_GIT_SUBMODULES = YES
GPIO_MODULE_SUBDIRS = GPIO_driver/
# GPIO_MODULE_SUBDIRS += GPIO_driver/
# define LDD_BUILD_CMDS
# $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/misc-modules
# $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/scull
# endef
#
# # TODO add your writer, finder and finder-test utilities/scripts to the installation steps below
define GPIO_INSTALL_TARGET_CMDS
#module
# $(INSTALL) -m 0755 $(@D)/01_simple_LKM/* $(TARGET_DIR)/usr/bin
$(INSTALL) -m 0755 $(@D)/GPIO_driver/* $(TARGET_DIR)/usr/bin
endef
$(eval $(kernel-module))
$(eval $(generic-package))
This make file always pulls only a specific commit (mentioned in GPIO_VERSION variable) from gitHub. This is getting a little frustrating as, everytime I push new code to git I have to update the make file with the new commit number as well. So, is there any way to write the make file such that the most recent commit is pulled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将版本更改为类似的分支名称(本地或远程):
但是,您现在必须强迫Buildroot进行最新更改(每次将新提交给GPIO Repo)。
Just change the version to a branch name (local or remote) like this:
However, you will now have to force Buildroot to pull the latest changes (each time you push new commits to the GPIO repo).