diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c820f6..d39d38c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,19 +43,13 @@ jobs: - name: Export makefile variables run: make env >> $GITHUB_ENV - - name: Create debian package control file - run: make control - - - name: Create version file - run: make package.json - - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Buildx setup uses: docker/setup-buildx-action@v3 - - name: Build [${{ env.TOOLS_DEB }}] + - name: Build [${{ env.TOOLS_TARGZ }}] id: docker_build uses: docker/build-push-action@v5 with: @@ -65,7 +59,7 @@ jobs: push: false load: true build-args: | - TOOLS_DEB=${{ env.TOOLS_DEB }} + TOOLS_TARGZ=${{ env.TOOLS_TARGZ }} IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }} LINUX_VERSION=${{ env.LINUX_VERSION }} LINUX_HEADERS_URLPATH=${{ env.LINUX_HEADERS_URLPATH }} @@ -96,13 +90,13 @@ jobs: with: if-no-files-found: error path: | - ${{ env.TOOLS_DEB }} + ${{ env.TOOLS_TARGZ }} ${{ env.TOOLS_ROOTFS }} - name: Checksum artifacts if: startsWith(github.ref, 'refs/tags/v') run: | - sha512sum ${{ env.TOOLS_DEB }} > ${{ env.TOOLS_DEB }}.sha512 + sha512sum ${{ env.TOOLS_TARGZ }} > ${{ env.TOOLS_TARGZ }}.sha512 sha512sum ${{ env.TOOLS_ROOTFS }} > ${{ env.TOOLS_ROOTFS }}.sha512 - uses: softprops/action-gh-release@v1 diff --git a/.gitignore b/.gitignore index 8a4dcea..8f71610 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ *.ext2 -control machine-emulator-tools-*.tar.gz -machine-emulator-tools-*.deb rootfs.* package.json *.bin diff --git a/Dockerfile b/Dockerfile index f635245..de6a381 100644 --- a/Dockerfile +++ b/Dockerfile @@ -115,23 +115,15 @@ RUN cd ${BUILD_BASE}/tools/rollup-http/echo-dapp && touch src/* && \ # pack tools (deb) # ------------------------------------------------------------------------------ FROM tools-env AS packer -ARG TOOLS_DEB=machine-emulator-tools.deb +ARG TOOLS_TARGZ=machine-emulator-tools.tar.gz ARG STAGING_BASE=${BUILD_BASE}/_install -ARG STAGING_DEBIAN=${STAGING_BASE}/DEBIAN -ARG STAGING_BIN=${STAGING_BASE}/usr/bin -ARG STAGING_SHARE=${STAGING_BASE}/usr/share/machine-emulator-tools -RUN mkdir -p ${STAGING_DEBIAN} ${STAGING_SBIN} ${STAGING_BIN} ${STAGING_BASE}/etc && \ +RUN mkdir -p ${STAGING_BASE}/usr/bin ${STAGING_BASE}/usr/bin ${STAGING_BASE}/etc && \ echo "cartesi-machine" > ${staging_base}/etc/hostname -COPY control ${STAGING_DEBIAN}/control -COPY package.json ${STAGING_SHARE}/package.json -COPY postinst ${STAGING_DEBIAN}/postinst -COPY copyright ${STAGING_BASE}/usr/share/doc/machine-emulator-tools/copyright - COPY --from=c-builder ${BUILD_BASE}/tools/sys-utils_staging ${STAGING_BASE} -COPY --from=rust-builder ${BUILD_BASE}/tools/rollup-http/rollup-init/rollup-init ${STAGING_BIN} -COPY --from=http-server-builder ${BUILD_BASE}/tools/rollup-http/rollup-http-server/target/riscv64gc-unknown-linux-gnu/release/rollup-http-server ${STAGING_BIN} -COPY --from=echo-dapp-builder ${BUILD_BASE}/tools/rollup-http/echo-dapp/target/riscv64gc-unknown-linux-gnu/release/echo-dapp ${STAGING_BIN} +COPY --from=rust-builder ${BUILD_BASE}/tools/rollup-http/rollup-init/rollup-init ${STAGING_BASE}/usr/bin +COPY --from=http-server-builder ${BUILD_BASE}/tools/rollup-http/rollup-http-server/target/riscv64gc-unknown-linux-gnu/release/rollup-http-server ${STAGING_BASE}/usr/bin +COPY --from=echo-dapp-builder ${BUILD_BASE}/tools/rollup-http/echo-dapp/target/riscv64gc-unknown-linux-gnu/release/echo-dapp ${STAGING_BASE}/usr/bin -RUN dpkg-deb -Zxz --root-owner-group --build ${STAGING_BASE} ${BUILD_BASE}/${TOOLS_DEB} +RUN cd ${STAGING_BASE} && tar -czf ${BUILD_BASE}/${TOOLS_TARGZ} * diff --git a/Makefile b/Makefile index dc6c496..408cdd0 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ PATCH := 2 LABEL := -test2 VERSION := $(MAJOR).$(MINOR).$(PATCH)$(LABEL) -TOOLS_DEB := machine-emulator-tools-v$(VERSION).deb +TOOLS_TARGZ := machine-emulator-tools-v$(VERSION).tar.gz TOOLS_IMAGE := cartesi/machine-emulator-tools:$(VERSION) TOOLS_ROOTFS := rootfs-tools-v$(VERSION).ext2 TOOLS_ROOTFS_IMAGE := cartesi/rootfs-tools:$(VERSION) @@ -31,9 +31,9 @@ LINUX_HEADERS_URLPATH := https://github.com/cartesi/image-kernel/releases/downlo all: fs -build: control package.json +build: @docker buildx build --load \ - --build-arg TOOLS_DEB=$(TOOLS_DEB) \ + --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ --build-arg IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION) \ --build-arg LINUX_VERSION=$(LINUX_VERSION) \ --build-arg LINUX_HEADERS_URLPATH=$(LINUX_HEADERS_URLPATH) \ @@ -44,21 +44,16 @@ build: control package.json copy: @ID=`docker create $(TOOLS_IMAGE)` && \ - docker cp $$ID:/opt/cartesi/$(TOOLS_DEB) . && \ + docker cp $$ID:/opt/cartesi/$(TOOLS_TARGZ) . && \ docker rm $$ID -$(TOOLS_DEB) deb: build - -control: Makefile control.in - @sed 's|ARG_VERSION|$(VERSION)|g' control.in > control -package.json: Makefile package.json.in - @sed 's|ARG_VERSION|$(VERSION)|g' package.json.in > package.json +$(TOOLS_TARGZ) targz: build fs: $(TOOLS_ROOTFS) -$(TOOLS_ROOTFS): $(TOOLS_DEB) +$(TOOLS_ROOTFS): $(TOOLS_TARGZ) @docker buildx build --platform linux/riscv64 \ - --build-arg TOOLS_DEB=$(TOOLS_DEB) \ + --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ --output type=tar,dest=rootfs.tar \ --file fs/Dockerfile \ . && \ @@ -67,7 +62,7 @@ $(TOOLS_ROOTFS): $(TOOLS_DEB) fs-license: @docker buildx build --load --platform linux/riscv64 \ - --build-arg TOOLS_DEB=$(TOOLS_DEB) \ + --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ -t $(TOOLS_ROOTFS_IMAGE) \ --file fs/Dockerfile \ . @@ -75,7 +70,7 @@ fs-license: env: @echo VERSION=$(VERSION) - @echo TOOLS_DEB=$(TOOLS_DEB) + @echo TOOLS_TARGZ=$(TOOLS_TARGZ) @echo TOOLS_ROOTFS=$(TOOLS_ROOTFS) @echo TOOLS_IMAGE=$(TOOLS_IMAGE) @echo TOOLS_ROOTFS_IMAGE=$(TOOLS_ROOTFS_IMAGE) @@ -125,7 +120,7 @@ clean-image: @(docker rmi $(TOOLS_IMAGE) > /dev/null 2>&1 || true) clean: - @rm -f $(TOOLS_DEB) control rootfs* + @rm -f $(TOOLS_TARGZ) rootfs* @$(MAKE) -C sys-utils clean distclean: clean clean-image @@ -135,7 +130,7 @@ sys-utils: help: @echo 'available commands:' - @echo ' deb - build machine-emulator-tools .deb package' + @echo ' targz - build machine-emulator-tools .tar.gz' @echo ' fs - build rootfs.ext2' @echo ' fs-license - build rootfs.ext2.html with licence information' @echo ' setup - setup riscv64 buildx' @@ -144,4 +139,4 @@ help: @echo ' env - print useful Makefile variables as a KEY=VALUE list' @echo ' clean - remove the generated artifacts' -.PHONY: build fs fs-license deb env setup setup-required help distclean +.PHONY: build fs fs-license targz env setup setup-required help distclean diff --git a/README.md b/README.md index 2e28e02..f32efee 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ $ make setup ### Building -Invoking make will build all tools and create the `machine-emulator-tools-$VERSION.deb` Debian package along with the `rootfs-tools-$VERSION.ext2` root filesystem artifacts. +Invoking make will build all tools and create the `machine-emulator-tools-$VERSION.tar.gz` archive along with the `rootfs-tools-$VERSION.ext2` root filesystem artifacts. ```bash $ make @@ -33,7 +33,7 @@ $ make The following commands are available as `make` targets: - **all**: Build Debian package and rootfs (Default) -- **deb**: Build machine-emulator-tools.deb package +- **targz**: Build machine-emulator-tools.tar.gz - **fs**: Build rootfs.ext2 - **setup**: Setup riscv64 buildx - **setup-required**: Check if riscv64 buildx setup is required diff --git a/control.in b/control.in deleted file mode 100644 index 204d900..0000000 --- a/control.in +++ /dev/null @@ -1,10 +0,0 @@ -Package: machine-emulator-tools -Version: ARG_VERSION -Section: utils -Priority: optional -Architecture: riscv64 -Maintainer: Machine Reference Unit -Provides: machine-emulator-tools -Depends: busybox-static -Multi-Arch: foreign -Description: The Cartesi Machine Emulator Tools a repository that contains a set of tools developed for the RISC-V Linux OS. diff --git a/copyright b/copyright deleted file mode 100644 index 6e887f5..0000000 --- a/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: machine-emulator-tools -Source: https://github.com/cartesi/machine-emulator-tools - -Files: * -Copyright: 2024 Individual contributors -License: Apache-2.0 - -License: Apache-2.0 - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - . - On Debian systems, the complete text of the Apache version 2.0 license - can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/fs/Dockerfile b/fs/Dockerfile index f6c5f63..e660b57 100644 --- a/fs/Dockerfile +++ b/fs/Dockerfile @@ -1,7 +1,7 @@ # Final image FROM --platform=linux/riscv64 ubuntu:24.04 -ARG TOOLS_DEB=machine-emulator-tools-v0.16.2.deb -ADD ${TOOLS_DEB} /tmp/ +ARG TOOLS_TARGZ=machine-emulator-tools.tar.gz +ADD ${TOOLS_TARGZ} / RUN apt-get update && \ apt-get upgrade -y --no-install-recommends && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -19,6 +19,5 @@ RUN apt-get update && \ file \ stress-ng \ libatomic1 \ - /tmp/${TOOLS_DEB} \ && \ - rm -rf /var/lib/apt/lists/* /tmp/${TOOLS_DEB} + rm -rf /var/lib/apt/lists/*