Skip to content

Commit 587b4bf

Browse files
Issue #13 Adding a new /etc/os-release file (#16)
Signed-off-by: Lalatendu Mohanty <[email protected]>
1 parent ee4a939 commit 587b4bf

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
BUILD_DIR=$(shell pwd)/build
22
CODE_DIR=$(shell pwd)/iso
33
VERSION=1.0.0
4+
GITTAG=$(shell git rev-parse --short HEAD)
5+
DATE=$(shell date +"%d%m%Y%H%M%S")
6+
ISO_NAME=minishift-b2d
7+
OSRELEASE_FILE=os-release
8+
OSRELEASE_TEMPLATE=os-release.template
49

5-
default: b2d_iso
10+
default: iso
611

712
.PHONY: init
813
init:
@@ -11,13 +16,12 @@ init:
1116
.PHONY: clean
1217
clean:
1318
rm -rf $(BUILD_DIR)
19+
rm -f $(CODE_DIR)/$(OSRELEASE_FILE)
1420

15-
.PHONY: b2d_iso
16-
b2d_iso: ISO_NAME=minishift-b2d
17-
b2d_iso: iso_creation
18-
19-
.PHONY: iso_creation
20-
iso_creation: init
21+
.PHONY: iso
22+
iso: init
23+
#Creating minishift-b2d ISO specific /etc/os-release file.
24+
isoname='$(ISO_NAME)' version='$(VERSION)' build_id='$(GITTAG)-$(DATE)' envsubst < $(CODE_DIR)/$(OSRELEASE_TEMPLATE) > $(CODE_DIR)/$(OSRELEASE_FILE)
2125
cd $(CODE_DIR); bash build.sh
2226

2327
.PHONY: get_gh-release
@@ -27,7 +31,7 @@ get_gh-release: init
2731
rm -fr $(BUILD_DIR)/gh-release_2.2.1_linux_x86_64.tgz
2832

2933
.PHONY: release
30-
release: b2d_iso get_gh-release
34+
release: iso get_gh-release
3135
rm -rf release && mkdir -p release
3236
cp $(BUILD_DIR)/minishift-b2d.iso release/
3337
$(BUILD_DIR)/gh-release checksums sha256

iso/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ FROM boot2docker/boot2docker:1.12.3
2020
RUN echo "1.12.3" > $ROOTFS/etc/version
2121
ENV DOCKER_SHA a3bb88649bcc47775c29dab7d95709f4dda04d0e
2222

23+
# Removing the code that creates the /etc/os-release file.
24+
# Refer: https://github.com/boot2docker/boot2docker/blob/master/rootfs/make_iso.sh#L20-L34
25+
RUN sed -i '/^b2dVersion/,/^EOOS/d' /make_iso.sh
26+
27+
# Add the /etc/os-release file
28+
ADD os-release $ROOTFS/etc
29+
2330
# Add other dependencies here to $ROOTFS/
2431
ADD nsenter $ROOTFS/usr/bin/
2532
ADD socat $ROOTFS/usr/bin

iso/os-release.template

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
NAME=${isoname}
2+
VERSION=${version}
3+
BUILD_ID=${build_id}
4+
ID=boot2docker
5+
ID_LIKE=tcl
6+
PRETTY_NAME="Minishift Boot2Docker ISO Version: ${version}"
7+
ANSI_COLOR="1;34"
8+
HOME_URL="https://github.com/minishift/minishift-b2d-iso"
9+
BUG_REPORT_URL="https://github.com/minishift/minishift-b2d-iso/issues"

0 commit comments

Comments
 (0)