mirror of
https://github.com/optim-enterprises-bv/secureblue.git
synced 2025-11-01 19:07:52 +00:00
chore: deprecate images that are no longer needed
This commit is contained in:
7
config/files/usr/libexec/deprecated-images.json
Normal file
7
config/files/usr/libexec/deprecated-images.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"imageTypes": [
|
||||
"framework",
|
||||
"main-laptop",
|
||||
"nvidia-laptop"
|
||||
]
|
||||
}
|
||||
18
config/files/usr/libexec/deprecated-images.json.md
Normal file
18
config/files/usr/libexec/deprecated-images.json.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Deprecated Images
|
||||
|
||||
The following image types have been deprecated:
|
||||
|
||||
## framework
|
||||
|
||||
Rationale: [Deprecated upstream](https://github.com/ublue-os/framework#this-image-is-deprecated)
|
||||
Rebase to: The equivalent image replacing `-framework` with `-main`. For example, for `kinoite-framework-hardened`, rebase to `kinoite-main-hardened`.
|
||||
|
||||
## main-laptop
|
||||
|
||||
Rationale: Upstream recommendations have changed and improvements are being made to PPD.
|
||||
Rebase to: The equivalent image without `-laptop`. For example, for `kinoite-main-laptop-hardened`, rebase to `kinoite-main-hardened`.
|
||||
|
||||
## nvidia-laptop
|
||||
|
||||
Rationale: Upstream recommendations have changed and improvements are being made to PPD. Additionally, nvidia optimus configuration has moved to upstream `just` commands.
|
||||
Rebase to: The equivalent image without `-laptop`. For example, for `kinoite-nvidia-laptop-hardened`, rebase to `kinoite-nvidia-hardened` and reboot. Then, run `ujust configure-nvidia-optimus`.
|
||||
@@ -13,13 +13,26 @@ IMAGE_DATE_SECONDS=$(date -d "$IMAGE_DATE" +%s)
|
||||
CURRENT_SECONDS=$(date +%s)
|
||||
DIFFERENCE=$((CURRENT_SECONDS - IMAGE_DATE_SECONDS))
|
||||
MONTH=$((7 * 24 * 60 * 60))
|
||||
if [ "$DIFFERENCE" -ge "$MONTH" ]; then
|
||||
|
||||
readarray -t imageTypes < <(jq -r '.imageTypes[]' deprecated-images.json)
|
||||
|
||||
isDeprecated=false
|
||||
for imageType in "${imageTypes[@]}"; do
|
||||
if [[ "$IMAGE_REF_NAME" == *"$imageType"* ]]; then
|
||||
isDeprecated=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if $isDeprecated; then
|
||||
TIP='~~~ NOTICE: You are on a deprecated image, please rebase. ~~~\n~~~ For more information, visit https://github.com/secureblue/secureblue/blob/live/config/files/usr/libexec/deprecated-images.json.md ~~~'
|
||||
elif [ "$DIFFERENCE" -ge "$MONTH" ]; then
|
||||
TIP='~~~ NOTICE: Your current image is over 1 week old, run `ujust update`. ~~~'
|
||||
else
|
||||
TIP='~~~ NOTICE: There is currently no notice. ~~~'
|
||||
fi
|
||||
|
||||
TIP_OUTPUT=$(sed -e "s/%IMAGE_REF_NAME%/$IMAGE_REF_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s/%TIP%/$TIP/g" /usr/share/ublue-os/motd/secureblue.txt)
|
||||
TIP_OUTPUT=$(sed -e "s/%IMAGE_REF_NAME%/$IMAGE_REF_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s#%TIP%#$TIP#g" /usr/share/ublue-os/motd/secureblue.txt)
|
||||
while IFS= read -r line; do
|
||||
echo "$line"
|
||||
done <<< $TIP_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user