Skip to content

Commit

Permalink
ensure that Linux kernel is updated after a build and that busybox is…
Browse files Browse the repository at this point in the history
… not spuriously rebuilt (#397)
  • Loading branch information
osresearch committed May 3, 2018
1 parent 3d6eeb6 commit 0b644b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ endef
define do-copy =
$(call do,INSTALL ,$1 => $2',\
if ! cmp --quiet "$1" "$2" ; then \
cp -a "$1" "$2"; \
else \
echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \
fi
cp -a "$1" "$2"; \
)
@sha256sum "$(2:$(pwd)/%=%)"
endef
Expand Down Expand Up @@ -294,7 +293,7 @@ define define_module =

# Target for all of the outputs, which depend on their dependent modules
# being built, as well as this module being configured
$(call outputs,$1): $(build)/$($1_dir)/.build
$(build)/$($1_dir)/.build: $(call outputs,$1)

# If any of the outputs are missing, we should force a rebuild
# of the entire module
Expand Down
1 change: 1 addition & 0 deletions modules/busybox
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ $(initrd_tmp_dir)/bin/busybox: $(build)/$(busybox_dir)/.build
| tee -a $(build)/log/busybox.log \
$(VERBOSE_REDIRECT) \
)
@touch $< # ensure that our build file is still newer


busybox_depends := $(musl_dep)
7 changes: 4 additions & 3 deletions modules/linux
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ FOO := $(shell mkdir -p "$(module_initrd_lib_dir)")
define linux_module =

# Each module depends on building the Linux kernel
$(build)/$(linux_dir)/$1: $(build)/$(BOARD)/bzImage
$(build)/$(linux_dir)/$1: $(build)/$(linux_dir)/$(linux_output)

# The cpio file will depend on every module
$(build)/$(BOARD)/modules.cpio: $(module_initrd_lib_dir)/$(notdir $1)
Expand All @@ -141,8 +141,9 @@ $(build)/$(BOARD)/modules.cpio: $(build)/$(linux_dir)/.build
# The output of the linux.intermediate is the bzImage in the
# linus build directory. We need to copy it into our board
# specific directory for ease of locating it later.
$(build)/$(BOARD)/bzImage: $(build)/$(linux_dir)/arch/x86/boot/bzImage
$(call do-copy,$<,$@)
$(build)/$(BOARD)/bzImage: $(build)/$(linux_dir)/.build
$(call do-copy,$(dir $<)/$(linux_output),$@)
@touch $@ # force a timestamp update


# menuconfig target allows us to easily reconfigure this Linux kernel
Expand Down

0 comments on commit 0b644b1

Please sign in to comment.