Describe how to install with testenvironment

This commit is contained in:
2026-04-30 18:01:48 +02:00
parent 8263d92b5b
commit b088a03f88
3 changed files with 19 additions and 17 deletions
+13
View File
@@ -26,6 +26,19 @@ curl -fsSL https://gitea.dtext.online/obel1x/fedora-OEMDRV/raw/branch/main/syste
sudo bash /tmp/install.sh sudo bash /tmp/install.sh
``` ```
## Run directly from another repository
If you are on another fork or branch and you want to test your changes, do:
```bash
export REPO_URL="https://yourgitserver.tld/.../fedora-OEMDRV.git"
export REPO_BRANCH="anotherbranch"
curl -fsSL ${REPO_URL%.git}/raw/branch/${REPO_BRANCH}/system_setup/install.sh -o /tmp/install.sh
sudo -E bash /tmp/install.sh
```
That way, install.sh should know what to pull.
## After the script completes ## After the script completes
Configure your environment before running any installation: Configure your environment before running any installation:
+6 -5
View File
@@ -14,7 +14,8 @@ SHRINK_MIB=4096
OEMDRV_LABEL="OEMDRV" OEMDRV_LABEL="OEMDRV"
MOUNT_POINT="/opt/sys_config" MOUNT_POINT="/opt/sys_config"
MOUNT_OPTS="compress=zstd:6" MOUNT_OPTS="compress=zstd:6"
REPO_URL="${1:-https://gitea.dtext.online/obel1x/fedora-OEMDRV.git}" REPO_URL="${REPO_URL:-https://gitea.dtext.online/obel1x/fedora-OEMDRV.git}"
REPO_BRANCH="${REPO_BRANCH:-main}"
MIN_FREE_MIB=$(( SHRINK_MIB + 512 )) # require 512 MiB headroom above the shrink size MIN_FREE_MIB=$(( SHRINK_MIB + 512 )) # require 512 MiB headroom above the shrink size
# ── Helpers ─────────────────────────────────────────────────────────────────── # ── Helpers ───────────────────────────────────────────────────────────────────
@@ -69,7 +70,7 @@ check_repo_url() {
tmpdir=$(mktemp -d /tmp/oemdrv_repocheck.XXXXXX) tmpdir=$(mktemp -d /tmp/oemdrv_repocheck.XXXXXX)
if ! curl -fsSL "${REPO_URL%.git}/raw/branch/main/system_setup/install.sh" \ if ! curl -fsSL "${REPO_URL%.git}/raw/branch/${REPO_BRANCH}/system_setup/install.sh" \
-o "$tmpdir/install.sh" 2>/dev/null; then -o "$tmpdir/install.sh" 2>/dev/null; then
rm -rf "$tmpdir" rm -rf "$tmpdir"
return 1 return 1
@@ -293,13 +294,13 @@ info "Verifying repository URL..."
check_repo_url check_repo_url
case $? in case $? in
1) echo 1) echo
echo "WARNING: '$REPO_URL' is not a reachable git repository." echo "WARNING: '$REPO_URL' branch '${REPO_BRANCH}' is not a reachable git repository."
read -r -p " Continue anyway? [y/N]: " ans read -r -p " Continue anyway? [y/N]: " ans
[[ "${ans,,}" == "y" ]] || { echo "Aborted."; exit 0; } [[ "${ans,,}" == "y" ]] || { echo "Aborted."; exit 0; }
;; ;;
2) echo 2) echo
echo "WARNING: The checksum of this script does not match 'system_setup/install.sh'" echo "WARNING: The checksum of this script does not match 'system_setup/install.sh'"
echo " at '$REPO_URL'." echo " at '$REPO_URL' branch '${REPO_BRANCH}'."
echo " You may be running an outdated or modified version of install.sh." echo " You may be running an outdated or modified version of install.sh."
read -r -p " Continue anyway? [y/N]: " ans read -r -p " Continue anyway? [y/N]: " ans
[[ "${ans,,}" == "y" ]] || { echo "Aborted."; exit 0; } [[ "${ans,,}" == "y" ]] || { echo "Aborted."; exit 0; }
@@ -496,7 +497,7 @@ mount -o "$MOUNT_OPTS" "$OEMDRV_DEV" "$MOUNT_POINT" || die "mount failed."
info "Cloning $REPO_URL into $MOUNT_POINT..." info "Cloning $REPO_URL into $MOUNT_POINT..."
cd "$MOUNT_POINT" || die "Cannot cd to $MOUNT_POINT." cd "$MOUNT_POINT" || die "Cannot cd to $MOUNT_POINT."
git clone --progress --depth 1 "$REPO_URL" . || die "git clone failed." git clone --progress --depth 1 -b $REPO_BRANCH "$REPO_URL" . || die "git clone failed."
# Write hardware UUID to a user-readable per-machine file # Write hardware UUID to a user-readable per-machine file
dmidecode -t system | grep -i 'UUID' \ dmidecode -t system | grep -i 'UUID' \
-12
View File
@@ -1,12 +0,0 @@
#!/usr/bin/env sh
# SPDX-FileCopyrightText: Daniel Pätzold
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Fetches the installfile from a repository and runs it
#
REPO_URL="${1:-https://gitea.dtext.online/obel1x/fedora-OEMDRV.git}"
REPO_BRANCH="${2:-main}"
SCRIPTURL="${REPO_URL%.git}/raw/branch/${REPO_BRANCH}/system_setup/install.sh"
echo "Fetching from ${SCRIPTURL} and running script with sudo"
curl -fsSL ${SCRIPTURL} -o /tmp/install.sh && sudo bash /tmp/install.sh ${REPO_URL}