mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Add a version string to pause.c
The version string is based on the TAG and revision. Also: * Bump the TAG to 3.1 * Update the arm compiler binary used in kube-cross
This commit is contained in:
parent
8d24ce1137
commit
4665303c92
@ -18,14 +18,15 @@ REGISTRY ?= k8s.gcr.io
|
|||||||
IMAGE = $(REGISTRY)/pause-$(ARCH)
|
IMAGE = $(REGISTRY)/pause-$(ARCH)
|
||||||
LEGACY_AMD64_IMAGE = $(REGISTRY)/pause
|
LEGACY_AMD64_IMAGE = $(REGISTRY)/pause
|
||||||
|
|
||||||
TAG = 3.0
|
TAG = 3.1
|
||||||
|
REV = $(shell git describe --contains --always --match='v*')
|
||||||
|
|
||||||
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
|
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
|
||||||
ARCH ?= amd64
|
ARCH ?= amd64
|
||||||
|
|
||||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||||
|
|
||||||
CFLAGS = -Os -Wall -Werror -static
|
CFLAGS = -Os -Wall -Werror -static -DVERSION=v$(TAG)-$(REV)
|
||||||
KUBE_CROSS_IMAGE ?= k8s.gcr.io/kube-cross
|
KUBE_CROSS_IMAGE ?= k8s.gcr.io/kube-cross
|
||||||
KUBE_CROSS_VERSION ?= $(shell cat ../build-image/cross/VERSION)
|
KUBE_CROSS_VERSION ?= $(shell cat ../build-image/cross/VERSION)
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ ifeq ($(ARCH),amd64)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
TRIPLE ?= arm-linux-gnueabi
|
TRIPLE ?= arm-linux-gnueabihf
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),arm64)
|
ifeq ($(ARCH),arm64)
|
||||||
|
@ -17,20 +17,37 @@ limitations under the License.
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#define STRINGIFY(x) #x
|
||||||
|
#define VERSION_STRING(x) STRINGIFY(x)
|
||||||
|
|
||||||
|
#ifndef VERSION
|
||||||
|
#define VERSION HEAD
|
||||||
|
#endif
|
||||||
|
|
||||||
static void sigdown(int signo) {
|
static void sigdown(int signo) {
|
||||||
psignal(signo, "Shutting down, got signal");
|
psignal(signo, "Shutting down, got signal");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sigreap(int signo) {
|
static void sigreap(int signo) {
|
||||||
while (waitpid(-1, NULL, WNOHANG) > 0);
|
while (waitpid(-1, NULL, WNOHANG) > 0)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main(int argc, char **argv) {
|
||||||
|
int i;
|
||||||
|
for (i = 1; i < argc; ++i) {
|
||||||
|
if (!strcasecmp(argv[i], "-v")) {
|
||||||
|
printf("pause.c %s\n", VERSION_STRING(VERSION));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getpid() != 1)
|
if (getpid() != 1)
|
||||||
/* Not an error because pause sees use outside of infra containers. */
|
/* Not an error because pause sees use outside of infra containers. */
|
||||||
fprintf(stderr, "Warning: pause should be the first process\n");
|
fprintf(stderr, "Warning: pause should be the first process\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user