Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix armbian-release file error #241

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions src/modules/armbian/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,17 @@ if [[ -f "/root/.not_logged_in_yet" ]]; then
fi
## END Step 4

## Step 5: Move armbian-release to display mainsailos-release
### Substep 1: Move armbian-release
if [[ -f "/etc/armbian-release" ]]; then
echo_green "Armbian release file found! moving to: 'armbian-release-info.txt'"
mv /etc/armbian-release /etc/armbian-release-info.txt
else
echo_red "Armbian release file not found! [SKIPPED]"
fi
### END Substep 1
### Substep 2: patch Armbian scripts to new file location
echo_green "Patching armbian scripts (release file path) ..."
pushd "/usr/lib/armbian" &> /dev/null || exit 1
files=()
while IFS='' read -r line; do
files+=("${line}")
done < <(grep -R "/etc/armbian-release" -- * | cut -d":" -f1)
for f in "${files[@]}"; do
sed -i "s|/etc/armbian-release|/etc/armbian-release-info.txt|g" "${f}"
done
popd &> /dev/null || exit 1
## Step 5: Fake release file
### NOTE: Turns out that the 'distro' python package,
### which is used by moonraker, uses the first file after sorting.
### Therefore we need a hacky solution, because armbian relies, on upgrades
### on the original armbian-release file.
### To get around that, we simple symlink mainsailos-release to
### aaaa-release, which is directly read by moonraker.
if [[ -f "/etc/mainsailos-release" ]]; then
echo_green "Apply release file workaround ..."
ln -s /etc/aaaa-release /etc/mainsailos-release
fi
## END Step 5

## Step 6: Patch dynamic motd
Expand Down
Loading