Skip to content

Commit

Permalink
v4l-dvb: check hash of generated source tarball
Browse files Browse the repository at this point in the history
These are internally genrated but integrity wasn't checked.

Signed-off-by: Tomasz Maciej Nowak <[email protected]>
  • Loading branch information
tmn505 committed May 8, 2023
1 parent 03d6239 commit e05c5f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions v4l-dvb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@ define Build/Prepare
-e 's,tar rvf ,tar --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name --mtime="$$$$(TAR_TS)" -r -v -f ,g' \
$(PKG_BUILD_DIR)/linux/Makefile

(if [ -s $(DL_DIR)/$(V4L_SOURCE_FILE) ]; \
(if [ "`mkhash -N sha256 $(DL_DIR)/$(V4L_SOURCE_FILE)`" = "$(V4L_HASH)" ]; \
then $(CP) $(DL_DIR)/$(V4L_SOURCE_FILE) $(PKG_BUILD_DIR)/linux/linux-media.tar.bz2; \
else if [ -d $(DL_DIR)/$(V4L_REPO_NAME) ]; \
else if [ -d $(DL_DIR)/$(V4L_REPO_NAME)/.git ]; \
then git -C $(DL_DIR)/$(V4L_REPO_NAME) fetch --progress; \
else git clone --progress --single-branch $(V4L_SOURCE_URL) $(DL_DIR)/$(V4L_REPO_NAME); \
fi; \
git -C $(DL_DIR)/$(V4L_REPO_NAME) checkout --progress $(V4L_SOURCE_VERSION); \
cd $(PKG_BUILD_DIR)/linux; make tar DIR=$(DL_DIR)/$(V4L_REPO_NAME); \
$(CP) linux-media.tar.bz2 $(DL_DIR)/$(V4L_SOURCE_FILE); \
if [ "`mkhash -N sha256 linux-media.tar.bz2`" = "$(V4L_HASH)" ]; \
then $(CP) linux-media.tar.bz2 $(DL_DIR)/$(V4L_SOURCE_FILE); \
else echo 'Error: linux-media.tar.bz2 check sum does not match V4L_HASH.'; false; \
fi; \
fi;)

$(MAKE) -C $(PKG_BUILD_DIR) untar
Expand Down
2 changes: 2 additions & 0 deletions v4l-dvb/origin/linuxtv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := git://linuxtv.org/media_build.git
PKG_SOURCE_VERSION := 0fe857b86addf382f6fd383948bd7736a3201403
PKG_SOURCE_DATE := 2022-05-24
PKG_MIRROR_HASH := d7eecb327f2e0509c293c068cb9be8f2362419b547b8eebf57277e349890b0be

V4L_SOURCE_URL := git://linuxtv.org/media_tree.git
V4L_SOURCE_VERSION := 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
V4L_SOURCE_DATE := 2022-05-22
V4L_REPO_NAME := linux-media-linuxtv
V4L_SOURCE_FILE := $(V4L_REPO_NAME)-$(V4L_SOURCE_DATE)-$(shell printf '%.8s' $(V4L_SOURCE_VERSION)).tar.bz2
V4L_HASH := 9c2ee201302412ddd84d64de4b06278800c04add2542ee1d1b0fa606e433200f

PATCH_DIR := patches-linuxtv
1 change: 1 addition & 0 deletions v4l-dvb/origin/tbsdtv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ V4L_SOURCE_VERSION := 16c763979217cd58c35ffd5ad776d73f1e5a950e
V4L_SOURCE_DATE := 2023-01-15
V4L_REPO_NAME := linux-media-tbsdtv
V4L_SOURCE_FILE := $(V4L_REPO_NAME)-$(V4L_SOURCE_DATE)-$(shell printf '%.8s' $(V4L_SOURCE_VERSION)).tar.bz2
V4L_HASH := bc8a96235963c3a90251d7eaf68a956f463058a02ffb9ff41d875229b1b335f1

PATCH_DIR := patches-tbsdtv

0 comments on commit e05c5f3

Please sign in to comment.