From 325e1a4965ca58b9a60a5d837a6b9801a3847d65 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 25 May 2023 20:08:36 +0200 Subject: [PATCH 01/13] Update .github/workflows/docker-publish.yml --- .github/workflows/docker-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ec7bc24..8402895 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -12,6 +12,7 @@ on: branches: - main - latest + - 14.x-x86_64 - 13.x-x86_64 - 12.x-x86_64 - 11.x-x86_64 @@ -22,6 +23,7 @@ on: branches: - main - latest + - 14.x-x86_64 - 13.x-x86_64 - 12.x-x86_64 - 11.x-x86_64 From ae819a4d49642f5c80e1c85e2c7f8f7bc1d65ecc Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:20:33 +0100 Subject: [PATCH 02/13] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd51ea8..9b4345d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ docker build -t docker-tinycore-scratch . To run, just `docker run` as show below: ~~~ -sudo docker run -it ghcr.io/innovarew/docker-tinycore +sudo docker run -it ghcr.io/innovarew/docker-tinycore:latest ~~~ To build locally, just `make` as show below: @@ -36,10 +36,11 @@ sudo make TC_URL=http://tinycorelinux.net/13.x/x86_64/ Ready to use docker images from [docker-tinycore](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/versions): -| Release/Arch | Docker Image | -| -------------- | ---------------------------------------------------- | -| [latest](https://github.com/innovarew/docker-tinycore/) | `FROM ghcr.io/innovarew/docker-tinycore:latest` | +| Release/Arch | Docker Image | +| -------------- | ----------------------------------------------------------------------------------------------------------------- | +| [latest](https://github.com/innovarew/docker-tinycore/) | `FROM ghcr.io/innovarew/docker-tinycore:latest` | | [14.x-x86_64](https://github.com/innovarew/docker-tinycore/tree/14.x-x86_64)| `FROM ghcr.io/innovarew/docker-tinycore:14.x-x86_64` | +| [14.x-x86](https://github.com/innovarew/docker-tinycore/tree/14.x-x86) | `FROM ghcr.io/innovarew/docker-tinycore:14.x-x86` | | [13.x-x86_64](https://github.com/innovarew/docker-tinycore/tree/13.x-x86_64)| `FROM ghcr.io/innovarew/docker-tinycore:13.x-x86_64` | | [12.x-x86_64](https://github.com/innovarew/docker-tinycore/tree/12.x-x86_64)| `FROM ghcr.io/innovarew/docker-tinycore:12.x-x86_64` | | [11.x-x86_64](https://github.com/innovarew/docker-tinycore/tree/11.x-x86_64)| `FROM ghcr.io/innovarew/docker-tinycore:11.x-x86_64` | From fe7caf7b6481d3597bf14fd482b16e71addd916d Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:21:46 +0100 Subject: [PATCH 03/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b4345d..8586277 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ To build locally, just `make` as show below: ~~~ # prepare the rootfs, build, and run the container -sudo make TC_URL=http://tinycorelinux.net/13.x/x86_64/ +sudo make TC_URL=http://tinycorelinux.net/14.x/x86_64/ ~~~ ## Supported versions From 574d19042189e4a8bd8239d10a4ca29af5abaf82 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:38:29 +0100 Subject: [PATCH 04/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8586277..316eba5 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ EOF sudo scripts/tc-docker tce_rootfs_init data/ # build and run the tinycore docker container -sudo docker build -t tinycore:latest . -sudo docker run -it tinycore:latest /bin/sh +sudo docker build -t docker-tinycore-local:latest . +sudo docker run -it docker-tinycore-local:latest /bin/sh ~~~ ## Overview From 93450812056bd673041af6a71af9ce978cadff5d Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:37:16 +0100 Subject: [PATCH 05/13] Update Makefile --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c894571..559fbcc 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +# +# @description Makefile, for building innovarew/docker-tinycore +# @author innovarew (c) Copyright 2022 +# @url github.com/innovarew/docker-tinycore +# + # Set tinycore release TC_URL=http://tinycorelinux.net/14.x/x86_64/ TC_VER=$(shell echo "${TC_URL}" | awk -F/ '{print $$4"-"$$5}') @@ -7,6 +13,6 @@ all: rootfs build run rootfs: scripts/tc-docker tce_rootfs_init build: - docker build --build-arg TC_VER=${TC_VER} -t tinycore:${TC_VER} -t tinycore:latest . + docker build --build-arg TC_VER=${TC_VER} -t tinycore:${TC_VER} -t docker-tinycore-local:latest . run: - docker run -it tinycore:latest /bin/sh + docker run -it docker-tinycore-local:latest /bin/sh From 3156a0ad374ad1b2b290472cef238b7c57972b31 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:37:19 +0100 Subject: [PATCH 06/13] Update Dockerfile --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index fa278b6..3b96564 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,12 @@ +# +# @description Dockerfile, for building innovarew/docker-tinycore +# @author innovarew (c) Copyright 2022 +# @url github.com/innovarew/docker-tinycore +# + FROM scratch +MAINTAINER "innovarew (c) Copyright 2022" +LABEL author="@author innovarew (c) Copyright 2022." ARG TC_VER=14.x-x86_64 ADD data/rootfs-$TC_VER.tar.xz / From 9219772bfe55bfe2ffdfd542407f44a398050a63 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:47:39 +0100 Subject: [PATCH 07/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 316eba5..2369a7c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ What goes on under the hood is shown below: ~~~ cat > Dockerfile < Date: Thu, 1 Feb 2024 09:56:47 +0100 Subject: [PATCH 08/13] Update scripts/tc-docker --- scripts/tc-docker | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tc-docker b/scripts/tc-docker index 3bdab53..1fccf3c 100755 --- a/scripts/tc-docker +++ b/scripts/tc-docker @@ -1,10 +1,10 @@ #!/bin/sh # # @file tc-docker -# @version v1.0 -# @description tinycore (tc) in docker -# @author innovarew (c) Copyright 2022. +# @description tc-docker, helper script for building innovarew/docker-tinycore +# @author innovarew (c) Copyright 2022 # @copyright All rights reserved. Read LICENSE.txt file for the license terms. +# @url github.com/innovarew/docker-tinycore # # Changelog: # From 4ff600d5017c27df0d878e50b73ba618c15e7e03 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:03:33 +0100 Subject: [PATCH 09/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2369a7c..4c3bf80 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ sudo make TC_URL=http://tinycorelinux.net/14.x/x86_64/ ## Supported versions -Ready to use docker images from [docker-tinycore](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/versions): +Ready to use docker images from [docker-tinycore](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/versions) (see link on how-to use): | Release/Arch | Docker Image | | -------------- | ----------------------------------------------------------------------------------------------------------------- | From 01373e82373d19c745f3dc177994e79c893e5f18 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:07:16 +0100 Subject: [PATCH 10/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c3bf80..f5bb8fc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ sudo make TC_URL=http://tinycorelinux.net/14.x/x86_64/ ## Supported versions -Ready to use docker images from [docker-tinycore](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/versions) (see link on how-to use): +Ready to use docker images from [docker-tinycore](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/) (see link on how-to use): | Release/Arch | Docker Image | | -------------- | ----------------------------------------------------------------------------------------------------------------- | From 539069c19c07074f2ee38716b55b4400af6a2e5b Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Thu, 1 Feb 2024 21:07:43 +0100 Subject: [PATCH 11/13] Update scripts/tc-docker --- scripts/tc-docker | 51 ++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/scripts/tc-docker b/scripts/tc-docker index 1fccf3c..74dbbb5 100755 --- a/scripts/tc-docker +++ b/scripts/tc-docker @@ -2,7 +2,7 @@ # # @file tc-docker # @description tc-docker, helper script for building innovarew/docker-tinycore -# @author innovarew (c) Copyright 2022 +# @author innovarew (c) Copyright 2022 GPLv2 # @copyright All rights reserved. Read LICENSE.txt file for the license terms. # @url github.com/innovarew/docker-tinycore # @@ -19,8 +19,9 @@ # PROGNAME=${0##*/} -PROGAUTHOR="innovarew (c) 2022." PROGVERSION=v1.2 +PROGAUTHOR="innovarew" +PROGURL="https://github.com/innovarew/docker-tinycore" set -euf @@ -38,7 +39,7 @@ fi tce_rootfs_init() { - TC_VER=$(echo $TC_URL | awk -F/ '{print $4"-"$5}') + TC_VER=$(echo "$TC_URL" | awk -F/ '{print $4"-"$5}') TC_TAR="rootfs-$TC_VER.tar.xz" TC_PATCH="rootfs-$TC_VER.patch" @@ -57,11 +58,11 @@ tce_rootfs_init() tce_rootfs_unpack "$@" # rootfs contains .ko.gz not used by docker - find $PWD/root/ -name '*.ko.gz' -exec rm {} \; + find "$PWD/root/" -name '*.ko.gz' -exec rm {} \; # get unsquashfs into container to unpack tcz - tce_install liblzma.tcz $PWD/root/ - tce_install squashfs-tools.tcz $PWD/root/ + tce_install liblzma.tcz "$PWD/root/" + tce_install squashfs-tools.tcz "$PWD/root/" patch -p2 < $TC_PATCH ) @@ -71,7 +72,7 @@ tce_rootfs_init() tce_rootfs_unpack() { - ISO_FILE=$(basename "$ISO_URL") + ISO_FILE="${ISO_URL##*/}" wget -qc "$ISO_URL" # wget -qc "$ISO_URL.md5.txt" && md5sum -c $(basename "$ISO_URL.md5.txt") @@ -107,7 +108,7 @@ tce_install() local app=$1 local root=$2 - if [ -e $root/usr/local/tce.installed/${app%.tcz} ] + if [ -e "$root/usr/local/tce.installed/${app%.tcz}" ] then usage "warn: $app already installed in $root" fi @@ -115,25 +116,25 @@ tce_install() ( tce_cddir - if wget -qc $TCZ_URL/$app.dep + if wget -qc "$TCZ_URL/$app.dep" then - for dep in `cat $app.dep` + for dep in $(cat "$app.dep") do tce_install $dep $root done fi - wget -qc $TCZ_URL/$app - wget -qc $TCZ_URL/$app.md5.txt - [ -e "$app.md5.txt" ] && md5sum -c $app.md5.txt + wget -qc "$TCZ_URL/$app" + wget -qc "$TCZ_URL/$app.md5.txt" + [ -e "$app.md5.txt" ] && md5sum -c "$app.md5.txt" if [ -n "$UNSQUASHFS" ] then - unsquashfs -n -d "$root" -f $app >/dev/null + unsquashfs -n -d "$root" -f "$app" >/dev/null # update system - mkdir -p $root/usr/local/tce.installed/ - touch $root/usr/local/tce.installed/${app%.tcz} + mkdir -p "$root/usr/local/tce.installed/" + touch "$root/usr/local/tce.installed/${app%.tcz}" fi # update libs @@ -150,8 +151,8 @@ tce_info() local app=$1 ( tce_cddir - [ ! -e $app.info ] && wget -qc $TCZ_URL/$app.info - cat $app.info + [ ! -e "$app.info" ] && wget -qc "$TCZ_URL/$app.info" + cat "$app.info" ) } @@ -161,8 +162,8 @@ tce_list() local app=$1 ( tce_cddir - [ ! -e $app.list ] && wget -qc $TCZ_URL/$app.list - cat $app.list + [ ! -e "$app.list" ] && wget -qc "$TCZ_URL/$app.list" + cat "$app.list" ) } @@ -172,8 +173,8 @@ tce_dep() local app=$1 ( tce_cddir - [ ! -e $app.list ] && wget -qc $TCZ_URL/$app.dep - cat $app.dep + [ ! -e "$app.list" ] && wget -qc "$TCZ_URL/$app.dep" + cat "$app.dep" ) } @@ -181,8 +182,8 @@ tce_search() { ( tce_cddir - wget -qc $TCZ_URL - cat $(basename "$TCZ_URL") + wget -qc "$TCZ_URL" + cat "${TCZ_URL##*/}" ) } @@ -190,7 +191,7 @@ usage() { if [ $# -eq 0 ] then - echo "usage: $PROGNAME [tce_rootfs_init|tce_install] # @version $PROGVERSION @copyright $PROGAUTHOR"; + echo "usage: $PROGNAME [tce_rootfs_init|tce_install] # @version $PROGVERSION (c) $PROGAUTHOR $PROGURL"; exit; else echo "$@" From 202067851e6300e01f430bdfdc970422469c396b Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:38:55 +0100 Subject: [PATCH 12/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5bb8fc..f53c547 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ## Quick guide -To build on top of it, just pull from the [docker-tinycore package](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/versions) +To build on top of it, just pull from the [docker-tinycore package](https://github.com/innovarew/docker-tinycore/pkgs/container/docker-tinycore/) ~~~ echo FROM ghcr.io/innovarew/docker-tinycore > Dockerfile From badc11b9869c6a8033228bded09858477c5f4f91 Mon Sep 17 00:00:00 2001 From: innovarew <48243982+innovarew@users.noreply.github.com> Date: Fri, 2 Feb 2024 11:03:01 +0100 Subject: [PATCH 13/13] Update scripts/tc-docker --- scripts/tc-docker | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/scripts/tc-docker b/scripts/tc-docker index 74dbbb5..440c300 100755 --- a/scripts/tc-docker +++ b/scripts/tc-docker @@ -15,7 +15,10 @@ # v1.0 Initial version # # 26/08/2023 innovarew -# v1.1 Bump version +# v1.1 Bump version x86_64 +# +# 02/02/2024 innovarew +# v1.2 Bump version x86 # PROGNAME=${0##*/} @@ -27,8 +30,14 @@ set -euf TC_ARCH=${TC_ARCH:-x86_64} TC_URL=${TC_URL:-http://tinycorelinux.net/14.x/${TC_ARCH}} -ISO_URL=${ISO_URL:-$TC_URL/release/TinyCorePure64-current.iso} +TC_ISO=${TC_ISO:-$TC_URL/release/TinyCorePure64-current.iso} TCZ_URL=$TC_URL/tcz +TC_CPIO=${TC_CPIO:-corepure64.gz} + +if [ "$TC_ARCH" = "x86" ]; then + TC_CPIO=core.gz + TC_ISO=$TC_URL/release/TinyCore-current.iso +fi TCE_DIR=$PWD/data/tce/optional if grep -qi tinycore /etc/os-release @@ -43,10 +52,10 @@ tce_rootfs_init() TC_TAR="rootfs-$TC_VER.tar.xz" TC_PATCH="rootfs-$TC_VER.patch" - echo "# $ISO_URL" + echo "# $TC_ISO" ( rm -r data/tce - mkdir -p $TCE_DIR + mkdir -p "$TCE_DIR" rm -rf data/root rm -rf data/tinycore @@ -64,7 +73,7 @@ tce_rootfs_init() tce_install liblzma.tcz "$PWD/root/" tce_install squashfs-tools.tcz "$PWD/root/" - patch -p2 < $TC_PATCH + patch -p2 < "$TC_PATCH" ) (cd data/root; tar cJf "../$TC_TAR" .) @@ -72,17 +81,17 @@ tce_rootfs_init() tce_rootfs_unpack() { - ISO_FILE="${ISO_URL##*/}" + ISO_FILE="${TC_ISO##*/}" - wget -qc "$ISO_URL" - # wget -qc "$ISO_URL.md5.txt" && md5sum -c $(basename "$ISO_URL.md5.txt") + wget -qc "$TC_ISO" + # wget -qc "$TC_ISO.md5.txt" && md5sum -c $(basename "$TC_ISO.md5.txt") if [ ! -d "tinycore" ] then mkdir -p tinycore 7z x -otinycore "$ISO_FILE" >/dev/null mkdir -p root - (cd root; zcat ../tinycore/boot/corepure64.gz | cpio --extract) + (cd root; zcat "../tinycore/boot/$TC_CPIO" | cpio --extract) fi }