From a7487af98b958508c16ed9b2ac9ee8ca17728c97 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 14 Dec 2024 13:05:10 +0100 Subject: [PATCH 1/7] feat: Add Tiny11 Core --- src/define.sh | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/define.sh b/src/define.sh index 1f34ddf..0539449 100644 --- a/src/define.sh +++ b/src/define.sh @@ -14,7 +14,7 @@ set -Eeuo pipefail : "${USERNAME:=""}" : "${PASSWORD:=""}" -MIRRORS=1 +MIRRORS=2 PLATFORM="ARM64" parseVersion() { @@ -96,7 +96,8 @@ parseVersion() { error "Windows Server 2003 $msg" && return 1 ;; "core11" | "core 11" ) - error "Tiny 11 Core $msg" && return 1 + VERSION="core11" + [ -z "$DETECTED" ] && DETECTED="win11arm64" ;; "tiny11" | "tiny 11" ) error "Tiny 11 $msg" && return 1 @@ -386,6 +387,7 @@ printVersion() { local desc="$2" case "${id,,}" in + "core11"* ) desc="Core 11" ;; "win10"* ) desc="Windows 10" ;; "win11"* ) desc="Windows 11" ;; esac @@ -439,8 +441,11 @@ fromFile() { local desc="$1" local file="${1,,}" local arch="${PLATFORM,,}" - - case "${file// /_}" in + + file="${file//-/_}" + file="${file// /_}" + + case "$file" in *"_x64_"* | *"_x64."*) arch="x64" ;; @@ -452,7 +457,10 @@ fromFile() { ;; esac - case "${file// /_}" in + case "$file" in + "tiny11core"* | "tiny11_core"* | "tiny_11_core"* ) + id="core11" + ;; "win10"*| "win_10"* | *"windows10"* | *"windows_10"* ) id="win10${arch}" ;; @@ -600,6 +608,35 @@ getLink1() { return 0 } +getLink2() { + + local id="$1" + local lang="$2" + local ret="$3" + local url="" + local sum="" + local size="" + local host="https://archive.org/download" + + [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0 + + case "${id,,}" in + "core11" ) + size=1 + sum="xxx" + url="tiny11-core-arm64/tiny11%20core%20arm64.iso" + ;; + esac + + case "${ret,,}" in + "sum" ) echo "$sum" ;; + "size" ) echo "$size" ;; + *) [ -n "$url" ] && echo "$host/$url";; + esac + + return 0 +} + getValue() { local val="" From 11ecc3b93552eee7e312e12acb93a74e8c94058f Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 14 Dec 2024 13:09:45 +0100 Subject: [PATCH 2/7] Update define.sh --- src/define.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/define.sh b/src/define.sh index 0539449..e0ece90 100644 --- a/src/define.sh +++ b/src/define.sh @@ -95,13 +95,10 @@ parseVersion() { "2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" ) error "Windows Server 2003 $msg" && return 1 ;; - "core11" | "core 11" ) + "core11" | "core 11" | "tiny11" | "tiny 11" ) VERSION="core11" [ -z "$DETECTED" ] && DETECTED="win11arm64" ;; - "tiny11" | "tiny 11" ) - error "Tiny 11 $msg" && return 1 - ;; "tiny10" | "tiny 10" ) error "Tiny 10 $msg" && return 1 ;; From c0729bbb6425d888423e68055bdbce8ec2095a3b Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 05:36:46 +0100 Subject: [PATCH 3/7] fix: Update download links --- src/mido.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mido.sh b/src/mido.sh index 1b628a6..e03c9f5 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -608,7 +608,7 @@ getMG() { pattern="10_iot_enterprise_ltsc" ;; esac - + fi local body="" @@ -620,10 +620,11 @@ getMG() { } local list="" - list=$(echo "$body" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -i '\.iso$') + list=$(echo "$body" | xmllint --html --nonet --xpath "//a[contains(text(), '.iso')]" - 2>/dev/null) local result="" result=$(echo "$list" | grep -i "${platform}" | grep "${pattern}" | grep -i -m 1 "${locale,,}_") + result=$(echo "$result" | sed -r 's/.*href="([^"]+).*/\1/g') if [ -z "$result" ]; then if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then From e81e83248c747713ce71e1f0186fd25d8c5b07c6 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 05:57:47 +0100 Subject: [PATCH 4/7] feat: Add Tiny11 --- src/define.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/define.sh b/src/define.sh index e0ece90..188055b 100644 --- a/src/define.sh +++ b/src/define.sh @@ -95,7 +95,11 @@ parseVersion() { "2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" ) error "Windows Server 2003 $msg" && return 1 ;; - "core11" | "core 11" | "tiny11" | "tiny 11" ) + "tiny11" | "tiny 11" ) + VERSION="tiny11" + [ -z "$DETECTED" ] && DETECTED="win11arm64" + ;; + "core11" | "core 11" ) VERSION="core11" [ -z "$DETECTED" ] && DETECTED="win11arm64" ;; @@ -384,6 +388,7 @@ printVersion() { local desc="$2" case "${id,,}" in + "tiny11"* ) desc="Tiny 11" ;; "core11"* ) desc="Core 11" ;; "win10"* ) desc="Windows 10" ;; "win11"* ) desc="Windows 11" ;; @@ -458,6 +463,9 @@ fromFile() { "tiny11core"* | "tiny11_core"* | "tiny_11_core"* ) id="core11" ;; + "tiny11"* | "tiny_11"* ) + id="tiny11" + ;; "win10"*| "win_10"* | *"windows10"* | *"windows_10"* ) id="win10${arch}" ;; @@ -618,9 +626,14 @@ getLink2() { [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0 case "${id,,}" in + "tiny11" ) + size=1 + sum="xx" + url="tiny11a64/tiny11a64%20r1.iso" + ;; "core11" ) size=1 - sum="xxx" + sum="812dae6b5bf5215db63b61ae10d8f0ffd3aa8529a18d96e9ced53341e2c676ec" url="tiny11-core-arm64/tiny11%20core%20arm64.iso" ;; esac From e05cb1e0a1336c68f9d2bd5f6696b67987aecfca Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 06:45:33 +0100 Subject: [PATCH 5/7] Update define.sh --- src/define.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/define.sh b/src/define.sh index 188055b..6a80ee3 100644 --- a/src/define.sh +++ b/src/define.sh @@ -632,7 +632,7 @@ getLink2() { url="tiny11a64/tiny11a64%20r1.iso" ;; "core11" ) - size=1 + size=3300327424 sum="812dae6b5bf5215db63b61ae10d8f0ffd3aa8529a18d96e9ced53341e2c676ec" url="tiny11-core-arm64/tiny11%20core%20arm64.iso" ;; From f518c0b305c2ed6e8c786424295047be6d48a8bc Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 14:56:09 +0100 Subject: [PATCH 6/7] feat: Add Tiny11 --- src/define.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/define.sh b/src/define.sh index 6a80ee3..35a2ed3 100644 --- a/src/define.sh +++ b/src/define.sh @@ -627,8 +627,8 @@ getLink2() { case "${id,,}" in "tiny11" ) - size=1 - sum="xx" + size=4480499712 + sum="ec6056aa554c17290224af23e1b99961fe99606bb5ea9102d61838939c63325b" url="tiny11a64/tiny11a64%20r1.iso" ;; "core11" ) From 53fc01a8d234214d3687ce0705d801a84c53b850 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 15:23:55 +0100 Subject: [PATCH 7/7] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0c776a..687e5f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM scratch -COPY --from=qemux/qemu-arm:2.23 / / +COPY --from=qemux/qemu-arm:2.24 / / ARG VERSION_ARG="0.00" ARG DEBCONF_NOWARNINGS="yes"