runc: use git-commit to store commit ID

Change-Id: Ib43bafb0ec680082520d85530ef783b68bc08671
Signed-off-by: xiadanni1 <xiadanni1@huawei.com>
This commit is contained in:
xiadanni1 2020-06-09 02:18:21 +08:00
parent 438be5f0d9
commit ab5af31922
6 changed files with 58 additions and 4 deletions

View File

@ -10,6 +10,9 @@ cwd=$PWD
src=$cwd/$pkg
unzip $pkg.zip
if [ ! -d patch ];then
tar -xzf patch.tar.gz
fi
series=$cwd/series.conf
while IPF= read -r line

12
gen-commit.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
# Description: This shell script is used to generate commitID store file.
# Author: xiadanni1@huawei.com
# Create: 2020-06-09
changeID=`git log -1 | grep Change-Id | awk '{print $2}'`
if [ "${changeID}" = "" ];then
changeID=`date | sha256sum | head -c 40`
fi
echo "${changeID}" > git-commit

1
git-commit Normal file
View File

@ -0,0 +1 @@
Ib43bafb0ec680082520d85530ef783b68bc08671

View File

@ -0,0 +1,28 @@
From 0eb0fdb40b1f1a80d07c95c59e391e44ea646b01 Mon Sep 17 00:00:00 2001
From: xiadanni1 <xiadanni1@huawei.com>
Date: Tue, 9 Jun 2020 01:52:46 +0800
Subject: [PATCH] runc: use git-commit to store commit ID
Change-Id: I9b2e44691dafc2ced0523ed8423f3cb29bebd502
Signed-off-by: xiadanni1 <xiadanni1@huawei.com>
---
Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b24c22b..60d1d57 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,7 @@ GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
PROJECT := github.com/opencontainers/runc
BUILDTAGS := seccomp
-COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
-COMMIT := $(if $(shell git status --porcelain --untracked-files=no),"${COMMIT_NO}-dirty","${COMMIT_NO}")
+COMMIT := $(shell cat ./git-commit | head -c 40)
MAN_DIR := $(CURDIR)/man/man8
MAN_PAGES = $(shell ls $(MAN_DIR)/*.8)
--
1.8.3.1

View File

@ -2,11 +2,16 @@
Name: docker-runc
Version: 1.0.0.rc3
Release: 104
Release: 105
Summary: runc is a CLI tool for spawning and running containers according to the OCI specification.
License: ASL 2.0
Source: %{name}.tar.gz
Source0: runc-1.0.0-rc3.zip
Source1: patch.tar.gz
Source2: apply-patch
Source3: series.conf
Source4: git-commit
Source5: gen-commit.sh
URL: https://www.opencontainers.org/
Vendor: OCI
@ -18,10 +23,14 @@ BuildRequires: golang >= 1.8.3 glibc-static make libseccomp-devel libseccomp-sta
runc is a CLI tool for spawning and running containers according to the OCI specification.
%prep
%setup -c -n runc
cp %{SOURCE0} .
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE3} .
cp %{SOURCE4} .
%install
./apply-patch
sh ./apply-patch
mkdir -p .gopath/src/github.com/opencontainers
export GOPATH=`pwd`/.gopath

View File

@ -115,3 +115,4 @@
0116-runc-check-nil-pointers-in-cgroup-manager.patch
0117-runc-Pass-back-the-pid-of-runc-1-CHILD-so-w.patch
0118-runc-rootfs-do-not-permit-proc-mounts-to-no.patch
0119-runc-use-git-commit-to-store-commit-ID.patch