Aramo > Ecne upgrade DIY test script (be careful!)
Bug Report Template
1. Goal
Test the Trisquel 11 to 12 upgrade.
2. Details on the script
In order to test/run the upgrade process and don't rely on trusting someone requiring to download the upgrade tool from somewhere, the idea is to build it yourself.
Please be aware, we put a lot of effort on the preparation of the ubuntu-upgrade-release source code. Still, this process has been tested only on VMs. So be careful with your data.
In order to ease the test process, it is done via a bash script, here a small summary:
- The script installs the requirements
- pulls the Trisquel's package-helpers repo
- builds the ubuntu-release-upgrader source with Trisquel's changes
- prepares the ecne.tar.gz tarball
- if the script is executed with
--run-upgradeit starts the upgrade process via text console. - By default the script (if not ran with
--run-upgrade) only prepares everything to run the upgrade tool later. - Goes through the upgrade process to Ecne.
3. Current version of the script.
Create a file named build-ecne-upgrader.sh
touch build-ecne-upgrader.sh
Paste the following script on it.
#!/bin/bash
set -e
# --- Config ---
REPO_URL="https://gitlab.trisquel.org/trisquel/package-helpers/"
BRANCH="ecne"
WORKDIR="$HOME/src"
CLONEDIR="$WORKDIR/package-helpers"
TARBALL_NAME="ecne.tar.gz"
TARBALL_SRC="" # will be detected after build
TARBALL_DST="/tmp/${TARBALL_NAME}"
EXTRACT_DIR="/tmp/ecne-upgrader"
FRONTEND="DistUpgradeViewText"
FRONTEND_ARGS="--frontend=$FRONTEND"
RUN_UPGRADE=0
if [ "${1:-}" == "--run-upgrade" ]; then
RUN_UPGRADE=1
fi
need_cmd() { command -v "$1" >/dev/null 2>&1; }
# --- 1) Install deps ---
if [[ $EUID -ne 0 ]]; then
SUDO="sudo"
else
SUDO=""
fi
echo "[0/10] Installing missing updates"
$SUDO apt-get update
$SUDO apt-get dist-upgrade -y
echo "[1/10] Installing dependencies: git apt-clone intltool and other devtools"
$SUDO apt-get install -y git \
apt-clone \
ca-certificates \
devscripts \
dpkg-dev \
gnupg2 \
intltool \
rename
#python3-urwid
# --- 2) git clone ---
echo "[2/10] Ensuring workdir exists: $WORKDIR"
mkdir -p "$WORKDIR"
if [ -d "$CLONEDIR/.git" ]; then
echo "[2/10] Repo already exists, updating: $CLONEDIR"
git -C "$CLONEDIR" fetch --all --prune
else
echo "[2/10] Cloning: $REPO_URL -> $CLONEDIR"
git clone "$REPO_URL" "$CLONEDIR"
fi
# --- 3) checkout branch ecne ---
echo "[3/10] Checking out branch: $BRANCH"
git -C "$CLONEDIR" checkout "$BRANCH"
git -C "$CLONEDIR" pull --ff-only || true
# --- 4) enter package-helpers/helpers ---
HELPERS_DIR="$CLONEDIR/helpers"
echo "[4/10] Entering: $HELPERS_DIR"
cd "$HELPERS_DIR"
# --- 5) bash make-ubuntu-release-upgrader ---
echo "[5/10] Running: bash make-ubuntu-release-upgrader"
bash make-ubuntu-release-upgrader
# --- 6) cd PACKAGES/ubuntu-release-upgrader/DistUpgrade ---
DISTUPGRADE_DIR="$(find "$HELPERS_DIR/PACKAGES/ubuntu-release-upgrader" \
-maxdepth 2 -type d -name 'DistUpgrade' -path '*/ubuntu-release-upgrader-*/DistUpgrade' \
| sort -V | tail -n 1)"
echo "[6/10] Entering: $DISTUPGRADE_DIR"
cd "$DISTUPGRADE_DIR"
# --- 7) bash build-dist.sh ---
echo "[7/10] Running: bash build-dist.sh"
bash ./build-dist.sh
# --- Confirm tarball location (ecne.tar.gz) ---
echo "[7/10] Locating tarball: $TARBALL_NAME"
TARBALL_SRC="$DISTUPGRADE_DIR/$TARBALL_NAME"
if [ -z "$TARBALL_SRC" ]; then
# Fallback: search within the ubuntu-release-upgrader tree
found="$(find "$HELPERS_DIR/PACKAGES/ubuntu-release-upgrader" \
-maxdepth 4 -type f -name "$TARBALL_NAME" 2>/dev/null | head -n 1 || true)"
if [ -n "$found" ]; then
TARBALL_SRC="$found"
fi
fi
if [ -z "$TARBALL_SRC" ] || [ ! -f "$TARBALL_SRC" ]; then
echo "ERROR: Could not find $TARBALL_NAME after build."
echo "Searched under: $HELPERS_DIR/PACKAGES/ubuntu-release-upgrader"
exit 1
fi
echo "[8/10] Copying tarball to /tmp: $TARBALL_SRC -> $TARBALL_DST"
cp -f "$TARBALL_SRC" "$TARBALL_DST"
# --- 9) extract it ---
echo "[9/10] Extracting: $TARBALL_DST -> $EXTRACT_DIR"
sudo rm -rf "$EXTRACT_DIR"
mkdir -p "$EXTRACT_DIR"
tar -xzf "$TARBALL_DST" -C "$EXTRACT_DIR"
# --- 10) run upgrade script ---
echo "[10/10] Selecting upgrade entrypoint inside: $EXTRACT_DIR"
if [ -f "$EXTRACT_DIR/ecne" ] ; then
ENTRYPOINT="$EXTRACT_DIR/ecne"
fi
if [ -z "$ENTRYPOINT" ]; then
echo "ERROR: executable entrypoint (ecne) not found at $EXTRACT_DIR"
echo "Content:"
ls -la "$EXTRACT_DIR" || true
exit 1
fi
echo "[10/10] Found entrypoint: $ENTRYPOINT"
# IMPORTANT: run from the extracted directory so relative files like "screenrc" resolve
ENTRY_DIR="$(dirname "$ENTRYPOINT")"
ENTRY_BASE="$(basename "$ENTRYPOINT")"
if [[ "$RUN_UPGRADE" -eq 1 ]]; then
echo "[10/10] RUNNING UPGRADE from: $ENTRY_DIR"
$SUDO mkdir -p /var/log/dist-upgrade
$SUDO chmod 755 /var/log/dist-upgrade
cd "$ENTRY_DIR"
exec $SUDO "./$ENTRY_BASE" "${FRONTEND_ARGS}"
else
echo "[10/10] Not running upgrade (missing --run-upgrade)."
echo "To execute it (within the right directory):"
echo " cd $ENTRY_DIR && sudo ./$ENTRY_BASE ${FRONTEND_ARGS}"
echo "You can delete \"$WORKDIR\" once completed."
fi
Run the script using:
bash build-ecne-upgrader.sh
4. Expected Behavior
Get Ecne upgrade from Aramo.
5. Warnings.
Almost no one but me has tested this script.
Please, test this out on
a) a test VM
b) a test/secondary machine with no production data on it.
c) report issues, findings or success tales.
d) under your own risk, test this out on production machines or wait until the official release.
6. Suggestions, Investigation and Possible Causes (optional)
Share any insights, code references, or debugging steps you've taken