Skip to content

Commit d96ea1e

Browse files
committed
feat: add auto-generated license info for rootfs
1 parent 1fbaccc commit d96ea1e

File tree

10 files changed

+460
-364
lines changed

10 files changed

+460
-364
lines changed

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
path: |
102102
${{ env.TOOLS_DEB }}
103103
${{ env.TOOLS_ROOTFS }}
104+
${{ env.TOOLS_ROOTFS }}.md
104105
libcmt/deb/*
105106
106107
- name: Checksum artifacts
@@ -118,6 +119,7 @@ jobs:
118119
${{ env.TOOLS_DEB }}
119120
${{ env.TOOLS_DEB }}.sha512
120121
${{ env.TOOLS_ROOTFS }}
122+
${{ env.TOOLS_ROOTFS }}.md
121123
${{ env.TOOLS_ROOTFS }}.sha512
122124
libcmt/deb/*
123125

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Changed
99
- Bump dependencies versions
10+
- Added rootfs.ext2:/etc/LICENSES file listing licenses of all installed packages
1011

1112
## [0.16.1] - 2024-08-12
1213
### Fixed

Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616

1717
MAJOR := 0
1818
MINOR := 16
19-
PATCH := 1
19+
PATCH := 2
2020
LABEL :=
2121
VERSION := $(MAJOR).$(MINOR).$(PATCH)$(LABEL)
2222

2323
TOOLS_DEB := machine-emulator-tools-v$(VERSION).deb
2424
TOOLS_IMAGE := cartesi/machine-emulator-tools:$(VERSION)
2525
TOOLS_ROOTFS := rootfs-tools-v$(VERSION).ext2
26+
TOOLS_ROOTFS_IMAGE := cartesi/rootfs-tools:$(VERSION)
2627

2728
IMAGE_KERNEL_VERSION ?= v0.20.0
2829
LINUX_VERSION ?= 6.5.13-ctsi-1
@@ -54,13 +55,19 @@ package.json: Makefile package.json.in
5455
@sed 's|ARG_VERSION|$(VERSION)|g' package.json.in > package.json
5556

5657
$(TOOLS_ROOTFS) fs: $(TOOLS_DEB)
57-
@docker buildx build --platform=linux/riscv64 \
58+
@docker buildx build --platform linux/riscv64 \
5859
--build-arg TOOLS_DEB=$(TOOLS_DEB) \
5960
--output type=tar,dest=rootfs.tar \
6061
--file fs/Dockerfile \
6162
. && \
6263
xgenext2fs -fzB 4096 -b 25600 -i 4096 -a rootfs.tar -L rootfs $(TOOLS_ROOTFS) && \
63-
rm -f rootfs.tar
64+
rm -f rootfs.tar && \
65+
docker buildx build --load --platform linux/riscv64 \
66+
--build-arg TOOLS_DEB=$(TOOLS_DEB) \
67+
-t $(TOOLS_ROOTFS_IMAGE) \
68+
--file fs/Dockerfile \
69+
. && \
70+
fs/third-party/repo-info/scan-local.sh $(TOOLS_ROOTFS_IMAGE) | tee $(TOOLS_ROOTFS).md
6471

6572
libcmt:
6673
@mkdir $@
@@ -84,6 +91,7 @@ env:
8491
@echo TOOLS_DEB=$(TOOLS_DEB)
8592
@echo TOOLS_ROOTFS=$(TOOLS_ROOTFS)
8693
@echo TOOLS_IMAGE=$(TOOLS_IMAGE)
94+
@echo TOOLS_ROOTFS_IMAGE=$(TOOLS_ROOTFS_IMAGE)
8795
@echo IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION)
8896
@echo LINUX_VERSION=$(LINUX_VERSION)
8997
@echo LINUX_HEADERS_URLPATH=$(LINUX_HEADERS_URLPATH)

fs/Dockerfile

+16-48
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,22 @@
1-
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS cross-builder
2-
ENV BUILD_BASE=/tmp/build-extra
3-
4-
# Install dependencies
5-
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
6-
apt-get install -y --no-install-recommends \
7-
ca-certificates \
8-
wget \
9-
patch \
10-
libdigest-sha-perl \
11-
libc6-dev-riscv64-cross \
12-
gcc-12-riscv64-linux-gnu \
13-
&& \
14-
adduser developer -u 499 --gecos ",,," --disabled-password && \
15-
mkdir -p ${BUILD_BASE} && chown -R developer:developer ${BUILD_BASE} && \
16-
rm -rf /var/lib/apt/lists/*
17-
18-
USER developer
19-
WORKDIR ${BUILD_BASE}
20-
21-
# Build benchmark binaries
22-
COPY fs/dhrystone.patch ${BUILD_BASE}/
23-
COPY fs/shasumfile ${BUILD_BASE}/
24-
RUN mkdir benchmarks && cd benchmarks && \
25-
wget https://www.netlib.org/benchmark/whetstone.c https://www.netlib.org/benchmark/dhry-c && \
26-
shasum -ca 256 ../shasumfile &&\
27-
bash dhry-c && \
28-
patch -p1 < ../dhrystone.patch && \
29-
riscv64-linux-gnu-gcc-12 -O2 -o whetstone whetstone.c -lm && \
30-
riscv64-linux-gnu-gcc-12 -O2 -o dhrystone dhry_1.c dhry_2.c -lm
31-
321
# Final image
332
FROM --platform=linux/riscv64 riscv64/ubuntu:22.04
34-
ARG TOOLS_DEB=machine-emulator-tools-v0.15.0.deb
3+
ARG TOOLS_DEB=machine-emulator-tools-v0.16.2.deb
354
ADD ${TOOLS_DEB} /tmp/
365
RUN apt-get update && \
37-
apt-get install -y --no-install-recommends \
38-
busybox-static=1:1.30.1-7ubuntu3 \
39-
coreutils=8.32-4.1ubuntu1.2 \
40-
bash=5.1-6ubuntu1.1 \
41-
psmisc=23.4-2build3 \
42-
bc=1.07.1-3build1 \
43-
curl=7.81.0-1ubuntu1.17 \
44-
device-tree-compiler=1.6.1-1 \
45-
jq=1.6-2.1ubuntu3 \
46-
lua5.4=5.4.4-1 \
47-
lua-socket=3.0~rc1+git+ac3201d-6 \
48-
xxd=2:8.2.3995-1ubuntu2.16 \
49-
file=1:5.41-3ubuntu0.1 \
50-
/tmp/${TOOLS_DEB} \
6+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7+
busybox-static=1:1.30.1-7ubuntu3 \
8+
coreutils=8.32-4.1ubuntu1.2 \
9+
bash=5.1-6ubuntu1.1 \
10+
psmisc=23.4-2build3 \
11+
bc=1.07.1-3build1 \
12+
curl=7.81.0-1ubuntu1.18 \
13+
device-tree-compiler=1.6.1-1 \
14+
jq=1.6-2.1ubuntu3 \
15+
lua5.4=5.4.4-1 \
16+
lua-socket=3.0~rc1+git+ac3201d-6 \
17+
xxd=2:8.2.3995-1ubuntu2.18 \
18+
file=1:5.41-3ubuntu0.1 \
19+
stress-ng=0.13.12-2ubuntu1 \
20+
/tmp/${TOOLS_DEB} \
5121
&& \
5222
rm -rf /var/lib/apt/lists/* /tmp/${TOOLS_DEB}
53-
COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/whetstone /usr/bin/
54-
COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/dhrystone /usr/bin/

0 commit comments

Comments
 (0)