diff --git a/apply-patch b/apply-patch index 6e900dc1ed516102238d201eab90ace465195216..bb73c5ab4134200462dfe27b53c9e6e278c75d85 100755 --- a/apply-patch +++ b/apply-patch @@ -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 diff --git a/gen-commit.sh b/gen-commit.sh new file mode 100755 index 0000000000000000000000000000000000000000..b4c4c80a751f03d6e04d276a75117d7814ff744a --- /dev/null +++ b/gen-commit.sh @@ -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 diff --git a/git-commit b/git-commit new file mode 100644 index 0000000000000000000000000000000000000000..1fcc075b7c5263c164ec3ccc18814169e5ca2683 --- /dev/null +++ b/git-commit @@ -0,0 +1 @@ +Ib43bafb0ec680082520d85530ef783b68bc08671 diff --git a/patch/0119-runc-use-git-commit-to-store-commit-ID.patch b/patch/0119-runc-use-git-commit-to-store-commit-ID.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ee8ac3084e6ecb3524f8919c88461900b469348 --- /dev/null +++ b/patch/0119-runc-use-git-commit-to-store-commit-ID.patch @@ -0,0 +1,28 @@ +From 0eb0fdb40b1f1a80d07c95c59e391e44ea646b01 Mon Sep 17 00:00:00 2001 +From: xiadanni1 +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 +--- + 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 + diff --git a/runc-openeuler.spec b/runc-openeuler.spec index c0a742d602a97ae678f95dc3638ee038d74e3c84..3efd66408c217e2fd33748799e8b0300ab595f2b 100644 --- a/runc-openeuler.spec +++ b/runc-openeuler.spec @@ -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 diff --git a/series.conf b/series.conf index c7b6362021af31462a6e25061d671c75c716d300..02dc07d02a14586c7f55403197be3b1b2aa49a35 100644 --- a/series.conf +++ b/series.conf @@ -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