ubuntu_to_aos.sh
· 10 KiB · Bash
Raw
#!/bin/bash
set -e
set -o pipefail
set -u
PKG_TEMP_FILE=$(mktemp)
trap 'rm -f "$PKG_TEMP_FILE"' EXIT
Green="\033[32m"
Red="\033[31m"
Yellow="\033[33m"
Blue="\033[36m"
Font="\033[0m"
GreenBG="\033[42;37m"
RedBG="\033[41;37m"
OK="${Green}[ OK ]${Font}"
ERROR="${Red}[FAILED]${Font}"
WARNING="${Yellow}[ WARN ]${Font}"
function print_ok() {
echo -e "${OK} ${Blue} $1 ${Font}"
}
function print_error() {
echo -e "${ERROR} ${Red} $1 ${Font}"
}
function print_warn() {
echo -e "${WARNING} ${Yellow} $1 ${Font}"
}
function judge() {
if [[ 0 -eq $? ]]; then
print_ok "$1 succeeded"
sleep 0.2
else
print_error "$1 failed"
exit 1
fi
}
function clean_up() {
print_ok "Cleaning up old files..."
sudo umount /mnt/anduinos_squashfs >/dev/null 2>&1 || true
sudo umount /mnt/anduinos_iso >/dev/null 2>&1 || true
sudo rm -rf /mnt/anduinos_squashfs >/dev/null 2>&1 || true
sudo rm -rf /mnt/anduinos_iso >/dev/null 2>&1 || true
sudo rm /tmp/AnduinOS-1.4.0* >/dev/null 2>&1 || true
judge "Cleanup"
}
clean_up
print_ok "Checking system compatibility..."
codename=$(lsb_release -cs)
if [[ "$codename" != "questing" ]] then
print_error "This upgrade script can only be run *from* AnduinOS Questing."
exit 1
fi
judge "System compatibility check"
print_ok "Ensure current user is not root..."
if [[ "$(id -u)" -eq 0 ]]; then
print_error "This script must not be run as root. Please run as a normal user with sudo privileges."
exit 1
fi
print_ok "Installing required packages (aria2, curl, lsb-release)..."
sudo apt install -y aria2 curl lsb-release
judge "Install required packages"
CURRENT_LANG=${LANG%%.*}
DOWNLOAD_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-${CURRENT_LANG}.torrent"
HASH_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-${CURRENT_LANG}.sha256"
print_ok "Current system language detected: ${CURRENT_LANG}"
print_ok "Attempting to download with URL: ${DOWNLOAD_URL}"
if ! curl --head --silent --fail "$DOWNLOAD_URL" >/dev/null; then
print_warn "Language pack for ${CURRENT_LANG} not found, falling back to en_US"
DOWNLOAD_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-en_US.torrent"
HASH_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-en_US.sha256"
fi
if ! curl --head --silent --fail "$DOWNLOAD_URL" >/dev/null; then
print_error "Download URL is not reachable. Please check your network connection."
exit 1
fi
print_ok "Downloading AnduinOS 1.4.0 torrent, please wait..."
curl -o /tmp/AnduinOS-1.4.0.torrent "$DOWNLOAD_URL"
curl -o /tmp/AnduinOS-1.4.0.sha256 "$HASH_URL"
judge "Download AnduinOS 1.4.0 torrent"
print_ok "Starting download via aria2..."
aria2c --allow-overwrite=true --seed-ratio=0.0 --seed-time=0 -x 16 -s 16 -k 1M -d /tmp /tmp/AnduinOS-1.4.0.torrent
judge "Download AnduinOS 1.4.0 ISO"
ISO_FILE_PATH=$(ls /tmp/AnduinOS-1.4.0*.iso | head -n 1)
print_ok "Ensure downloaded ISO file exists..."
if [[ -f "$ISO_FILE_PATH" ]]; then
print_ok "Downloaded ISO file found: $ISO_FILE_PATH"
else
print_error "Downloaded ISO file not found."
exit 1
fi
SHA256_FILE_PATH="/tmp/AnduinOS-1.4.0.sha256"
print_ok "Verifying download integrity..."
ACTUAL_SHA256=$(sha256sum "$ISO_FILE_PATH" | awk '{print $1}')
EXPECTED_SHA256=$(grep 'SHA256:' "$SHA256_FILE_PATH" | awk '{print $2}')
if [[ "$ACTUAL_SHA256" == "$EXPECTED_SHA256" ]]; then
print_ok "SHA256 checksum verification passed."
else
print_ok "Expected SHA256: $EXPECTED_SHA256"
print_ok "Actual SHA256: $ACTUAL_SHA256"
print_error "SHA256 checksum verification failed. The downloaded file may be corrupted."
exit 1
fi
print_ok "Mounting the ISO..."
sudo mkdir -p /mnt/anduinos_iso
sudo mount -o loop,ro "$ISO_FILE_PATH" /mnt/anduinos_iso
judge "Mount ISO"
print_ok "Verifying content in the ISO..."
(cd /mnt/anduinos_iso && sudo md5sum -c md5sum.txt)
judge "ISO content integrity verification"
print_ok "Mounting the filesystem.squashfs..."
sudo mkdir -p /mnt/anduinos_squashfs
sudo mount -o loop,ro /mnt/anduinos_iso/casper/filesystem.squashfs /mnt/anduinos_squashfs
judge "Mount filesystem.squashfs"
print_ok "Updating package mirrors..."
curl -s https://gitlab.aiursoft.cn/anduin/init-server/-/raw/master/mirror.sh?ref_type=heads | bash
sudo apt update
judge "Update package mirrors"
print_ok "Resetting APT configuration files..."
sudo rm /etc/apt/preferences.d/* >/dev/null 2>&1 || true
judge "Reset APT configuration files"
print_ok "Updating Mozilla Team PPA..."
sudo rm -f /etc/apt/sources.list.d/mozillateam*
sudo rsync -Aax /mnt/anduinos_squashfs/etc/apt/sources.list.d/mozillateam* /etc/apt/sources.list.d/
sudo apt update
judge "Update Mozilla Team PPA"
print_ok "Generating package list for upgrade..."
MANIFEST_FILE="/mnt/anduinos_iso/casper/filesystem.manifest-desktop"
cut -d' ' -f1 "$MANIFEST_FILE" \
| grep -v '^linux-' \
| grep -v '^lib' \
| grep -v '^plymouth-' \
| grep -v '^software-properties-' > "$PKG_TEMP_FILE"
if [ ! -s "$PKG_TEMP_FILE" ]; then
print_ok "No missing packages to install."
else
print_warn "Fast mode failed. Retrying one by one (robust mode)..."
print_ok "This may take 5-10 minutes. Only errors will be displayed."
PKG_INSTALL_LOG="/tmp/anduinos-pkg-install.log"
while read -r pkg; do
if [ -n "$pkg" ]; then
if sudo apt install --no-install-recommends -y "$pkg" > "$PKG_INSTALL_LOG" 2>&1; then
: # Bash的 "no-op" (空操作)
else
print_warn "Failed to install package: '$pkg'. Details:"
cat "$PKG_INSTALL_LOG"
echo -e "${Red}-----------------------------------------------------${Font}"
fi
fi
done < "$PKG_TEMP_FILE"
rm -f "$PKG_INSTALL_LOG"
print_ok "Robust missing package install mode finished."
fi
judge "Install missing packages"
print_ok "Removing obsolete packages..."
sudo apt autoremove -y \
distro-info \
software-properties-gtk \
ubuntu-advantage-tools \
ubuntu-pro-client \
ubuntu-pro-client-l10n \
ubuntu-release-upgrader-gtk \
ubuntu-report \
ubuntu-settings \
update-notifier-common \
update-manager \
update-manager-core \
update-notifier \
ubuntu-release-upgrader-core \
ubuntu-advantage-desktop-daemon \
kgx
judge "Remove obsolete packages"
print_ok "Upgrading installed packages..."
sudo apt upgrade -y
sudo apt autoremove --purge -y
judge "System package cleanup"
print_ok "Upgrading GNOME Shell extensions..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/gnome-shell/extensions/ /usr/share/gnome-shell/extensions/
judge "Upgrade GNOME Shell extensions"
print_ok "Upgrading icon and theme files..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/icons/ /usr/share/icons/
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/themes/ /usr/share/themes/
judge "Upgrade icon and theme files"
print_ok "Upgrading desktop backgrounds..."
sudo rsync -Aax --update /mnt/anduinos_squashfs/usr/share/backgrounds/ /usr/share/backgrounds/
sudo rsync -Aax --update /mnt/anduinos_squashfs/usr/share/gnome-background-properties/ /usr/share/gnome-background-properties/
judge "Upgrade desktop backgrounds"
print_ok "Upgrading APT configuration files..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/apt/apt.conf.d/ /etc/apt/apt.conf.d/
judge "Upgrade APT configuration files"
print_ok "Upgrading APT preferences files..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/apt/preferences.d/ /etc/apt/preferences.d/
judge "Upgrade APT preferences files"
print_ok "Upgrading session files..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/gnome-session/sessions/ /usr/share/gnome-session/sessions/
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/wayland-sessions/ /usr/share/wayland-sessions/
judge "Upgrade session files"
print_ok "Upgrading pixmaps..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/pixmaps/ /usr/share/pixmaps/
judge "Upgrade pixmaps"
print_ok "Upgrading /etc/skel/ files..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/skel/ /etc/skel/
judge "Upgrade /etc/skel/ files"
print_ok "Upgrading python-apt templates and distro info..."
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/python-apt/templates/ /usr/share/python-apt/templates/
sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/distro-info/ /usr/share/distro-info/
judge "Upgrade python-apt templates and distro info"
print_ok "Upgrading deskmon service..."
sudo rsync -Aax /mnt/anduinos_squashfs/usr/local/bin/deskmon /usr/local/bin/deskmon
sudo rsync -Aax /mnt/anduinos_squashfs/etc/systemd/user/deskmon.service /etc/systemd/user/deskmon.service
sudo rsync -Aax /mnt/anduinos_squashfs/etc/systemd/user/default.target.wants/deskmon.service /etc/systemd/user/default.target.wants/deskmon.service
judge "Upgrade deskmon service"
print_ok "Updating system version information..."
sudo rsync -Aax /mnt/anduinos_squashfs/usr/local/bin/do_anduinos_upgrade /usr/local/bin/do_anduinos_upgrade
sudo rsync -Aax /mnt/anduinos_squashfs/usr/bin/add-apt-repository /usr/bin/add-apt-repository
sudo rsync -Aax /mnt/anduinos_squashfs/etc/lsb-release /etc/lsb-release
sudo rsync -Aax /mnt/anduinos_squashfs/etc/issue /etc/issue
sudo rsync -Aax /mnt/anduinos_squashfs/etc/issue.net /etc/issue.net
sudo rsync -Aax /mnt/anduinos_squashfs/etc/os-release /etc/os-release
sudo rsync -Aax /mnt/anduinos_squashfs/usr/lib/os-release /usr/lib/os-release
sudo rsync -Aax /mnt/anduinos_squashfs/etc/legal /etc/legal
sudo rsync -Aax /mnt/anduinos_squashfs/etc/sysctl.d/20-apparmor-donotrestrict.conf /etc/sysctl.d/20-apparmor-donotrestrict.conf
sudo rsync -Aax /mnt/anduinos_squashfs/var/lib/flatpak/repo/config /var/lib/flatpak/repo/config
sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/themes/spinner/bgrt-fallback.png /usr/share/plymouth/themes/spinner/bgrt-fallback.png
sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/themes/spinner/watermark.png /usr/share/plymouth/themes/spinner/watermark.png
sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/ubuntu-logo.png /usr/share/plymouth/ubuntu-logo.png
judge "Update system version information"
print_ok "Applying dconf settings patch..."
PATCH_URL="https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.4/src/mods/35-dconf-patch/dconf.ini?ref_type=heads"
curl -sL "$PATCH_URL" | dconf load /org/gnome/
judge "Apply dconf settings patch"
print_ok "Upgrade completed! Please reboot your system to apply all changes."
print_ok "Starting cleanup..."
clean_up
| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | set -o pipefail |
| 4 | set -u |
| 5 | |
| 6 | PKG_TEMP_FILE=$(mktemp) |
| 7 | trap 'rm -f "$PKG_TEMP_FILE"' EXIT |
| 8 | |
| 9 | Green="\033[32m" |
| 10 | Red="\033[31m" |
| 11 | Yellow="\033[33m" |
| 12 | Blue="\033[36m" |
| 13 | Font="\033[0m" |
| 14 | GreenBG="\033[42;37m" |
| 15 | RedBG="\033[41;37m" |
| 16 | OK="${Green}[ OK ]${Font}" |
| 17 | ERROR="${Red}[FAILED]${Font}" |
| 18 | WARNING="${Yellow}[ WARN ]${Font}" |
| 19 | |
| 20 | function print_ok() { |
| 21 | echo -e "${OK} ${Blue} $1 ${Font}" |
| 22 | } |
| 23 | |
| 24 | function print_error() { |
| 25 | echo -e "${ERROR} ${Red} $1 ${Font}" |
| 26 | } |
| 27 | |
| 28 | function print_warn() { |
| 29 | echo -e "${WARNING} ${Yellow} $1 ${Font}" |
| 30 | } |
| 31 | |
| 32 | function judge() { |
| 33 | if [[ 0 -eq $? ]]; then |
| 34 | print_ok "$1 succeeded" |
| 35 | sleep 0.2 |
| 36 | else |
| 37 | print_error "$1 failed" |
| 38 | exit 1 |
| 39 | fi |
| 40 | } |
| 41 | function clean_up() { |
| 42 | print_ok "Cleaning up old files..." |
| 43 | sudo umount /mnt/anduinos_squashfs >/dev/null 2>&1 || true |
| 44 | sudo umount /mnt/anduinos_iso >/dev/null 2>&1 || true |
| 45 | sudo rm -rf /mnt/anduinos_squashfs >/dev/null 2>&1 || true |
| 46 | sudo rm -rf /mnt/anduinos_iso >/dev/null 2>&1 || true |
| 47 | sudo rm /tmp/AnduinOS-1.4.0* >/dev/null 2>&1 || true |
| 48 | judge "Cleanup" |
| 49 | } |
| 50 | |
| 51 | clean_up |
| 52 | |
| 53 | print_ok "Checking system compatibility..." |
| 54 | codename=$(lsb_release -cs) |
| 55 | if [[ "$codename" != "questing" ]] then |
| 56 | print_error "This upgrade script can only be run *from* AnduinOS Questing." |
| 57 | exit 1 |
| 58 | fi |
| 59 | judge "System compatibility check" |
| 60 | |
| 61 | print_ok "Ensure current user is not root..." |
| 62 | if [[ "$(id -u)" -eq 0 ]]; then |
| 63 | print_error "This script must not be run as root. Please run as a normal user with sudo privileges." |
| 64 | exit 1 |
| 65 | fi |
| 66 | |
| 67 | print_ok "Installing required packages (aria2, curl, lsb-release)..." |
| 68 | sudo apt install -y aria2 curl lsb-release |
| 69 | judge "Install required packages" |
| 70 | |
| 71 | CURRENT_LANG=${LANG%%.*} |
| 72 | DOWNLOAD_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-${CURRENT_LANG}.torrent" |
| 73 | HASH_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-${CURRENT_LANG}.sha256" |
| 74 | |
| 75 | print_ok "Current system language detected: ${CURRENT_LANG}" |
| 76 | print_ok "Attempting to download with URL: ${DOWNLOAD_URL}" |
| 77 | |
| 78 | if ! curl --head --silent --fail "$DOWNLOAD_URL" >/dev/null; then |
| 79 | print_warn "Language pack for ${CURRENT_LANG} not found, falling back to en_US" |
| 80 | DOWNLOAD_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-en_US.torrent" |
| 81 | HASH_URL="https://download.anduinos.com/1.4/1.4.0/AnduinOS-1.4.0-en_US.sha256" |
| 82 | fi |
| 83 | |
| 84 | if ! curl --head --silent --fail "$DOWNLOAD_URL" >/dev/null; then |
| 85 | print_error "Download URL is not reachable. Please check your network connection." |
| 86 | exit 1 |
| 87 | fi |
| 88 | |
| 89 | print_ok "Downloading AnduinOS 1.4.0 torrent, please wait..." |
| 90 | curl -o /tmp/AnduinOS-1.4.0.torrent "$DOWNLOAD_URL" |
| 91 | curl -o /tmp/AnduinOS-1.4.0.sha256 "$HASH_URL" |
| 92 | judge "Download AnduinOS 1.4.0 torrent" |
| 93 | |
| 94 | print_ok "Starting download via aria2..." |
| 95 | aria2c --allow-overwrite=true --seed-ratio=0.0 --seed-time=0 -x 16 -s 16 -k 1M -d /tmp /tmp/AnduinOS-1.4.0.torrent |
| 96 | judge "Download AnduinOS 1.4.0 ISO" |
| 97 | |
| 98 | ISO_FILE_PATH=$(ls /tmp/AnduinOS-1.4.0*.iso | head -n 1) |
| 99 | print_ok "Ensure downloaded ISO file exists..." |
| 100 | if [[ -f "$ISO_FILE_PATH" ]]; then |
| 101 | print_ok "Downloaded ISO file found: $ISO_FILE_PATH" |
| 102 | else |
| 103 | print_error "Downloaded ISO file not found." |
| 104 | exit 1 |
| 105 | fi |
| 106 | |
| 107 | SHA256_FILE_PATH="/tmp/AnduinOS-1.4.0.sha256" |
| 108 | |
| 109 | print_ok "Verifying download integrity..." |
| 110 | ACTUAL_SHA256=$(sha256sum "$ISO_FILE_PATH" | awk '{print $1}') |
| 111 | EXPECTED_SHA256=$(grep 'SHA256:' "$SHA256_FILE_PATH" | awk '{print $2}') |
| 112 | if [[ "$ACTUAL_SHA256" == "$EXPECTED_SHA256" ]]; then |
| 113 | print_ok "SHA256 checksum verification passed." |
| 114 | else |
| 115 | print_ok "Expected SHA256: $EXPECTED_SHA256" |
| 116 | print_ok "Actual SHA256: $ACTUAL_SHA256" |
| 117 | print_error "SHA256 checksum verification failed. The downloaded file may be corrupted." |
| 118 | exit 1 |
| 119 | fi |
| 120 | |
| 121 | print_ok "Mounting the ISO..." |
| 122 | sudo mkdir -p /mnt/anduinos_iso |
| 123 | sudo mount -o loop,ro "$ISO_FILE_PATH" /mnt/anduinos_iso |
| 124 | judge "Mount ISO" |
| 125 | |
| 126 | print_ok "Verifying content in the ISO..." |
| 127 | (cd /mnt/anduinos_iso && sudo md5sum -c md5sum.txt) |
| 128 | judge "ISO content integrity verification" |
| 129 | |
| 130 | print_ok "Mounting the filesystem.squashfs..." |
| 131 | sudo mkdir -p /mnt/anduinos_squashfs |
| 132 | sudo mount -o loop,ro /mnt/anduinos_iso/casper/filesystem.squashfs /mnt/anduinos_squashfs |
| 133 | judge "Mount filesystem.squashfs" |
| 134 | |
| 135 | print_ok "Updating package mirrors..." |
| 136 | curl -s https://gitlab.aiursoft.cn/anduin/init-server/-/raw/master/mirror.sh?ref_type=heads | bash |
| 137 | sudo apt update |
| 138 | judge "Update package mirrors" |
| 139 | |
| 140 | print_ok "Resetting APT configuration files..." |
| 141 | sudo rm /etc/apt/preferences.d/* >/dev/null 2>&1 || true |
| 142 | judge "Reset APT configuration files" |
| 143 | |
| 144 | print_ok "Updating Mozilla Team PPA..." |
| 145 | sudo rm -f /etc/apt/sources.list.d/mozillateam* |
| 146 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/apt/sources.list.d/mozillateam* /etc/apt/sources.list.d/ |
| 147 | sudo apt update |
| 148 | judge "Update Mozilla Team PPA" |
| 149 | |
| 150 | print_ok "Generating package list for upgrade..." |
| 151 | MANIFEST_FILE="/mnt/anduinos_iso/casper/filesystem.manifest-desktop" |
| 152 | |
| 153 | cut -d' ' -f1 "$MANIFEST_FILE" \ |
| 154 | | grep -v '^linux-' \ |
| 155 | | grep -v '^lib' \ |
| 156 | | grep -v '^plymouth-' \ |
| 157 | | grep -v '^software-properties-' > "$PKG_TEMP_FILE" |
| 158 | |
| 159 | if [ ! -s "$PKG_TEMP_FILE" ]; then |
| 160 | print_ok "No missing packages to install." |
| 161 | else |
| 162 | print_warn "Fast mode failed. Retrying one by one (robust mode)..." |
| 163 | print_ok "This may take 5-10 minutes. Only errors will be displayed." |
| 164 | |
| 165 | PKG_INSTALL_LOG="/tmp/anduinos-pkg-install.log" |
| 166 | |
| 167 | while read -r pkg; do |
| 168 | if [ -n "$pkg" ]; then |
| 169 | if sudo apt install --no-install-recommends -y "$pkg" > "$PKG_INSTALL_LOG" 2>&1; then |
| 170 | : # Bash的 "no-op" (空操作) |
| 171 | else |
| 172 | print_warn "Failed to install package: '$pkg'. Details:" |
| 173 | cat "$PKG_INSTALL_LOG" |
| 174 | echo -e "${Red}-----------------------------------------------------${Font}" |
| 175 | fi |
| 176 | fi |
| 177 | done < "$PKG_TEMP_FILE" |
| 178 | |
| 179 | rm -f "$PKG_INSTALL_LOG" |
| 180 | print_ok "Robust missing package install mode finished." |
| 181 | fi |
| 182 | judge "Install missing packages" |
| 183 | |
| 184 | print_ok "Removing obsolete packages..." |
| 185 | sudo apt autoremove -y \ |
| 186 | distro-info \ |
| 187 | software-properties-gtk \ |
| 188 | ubuntu-advantage-tools \ |
| 189 | ubuntu-pro-client \ |
| 190 | ubuntu-pro-client-l10n \ |
| 191 | ubuntu-release-upgrader-gtk \ |
| 192 | ubuntu-report \ |
| 193 | ubuntu-settings \ |
| 194 | update-notifier-common \ |
| 195 | update-manager \ |
| 196 | update-manager-core \ |
| 197 | update-notifier \ |
| 198 | ubuntu-release-upgrader-core \ |
| 199 | ubuntu-advantage-desktop-daemon \ |
| 200 | kgx |
| 201 | judge "Remove obsolete packages" |
| 202 | |
| 203 | print_ok "Upgrading installed packages..." |
| 204 | sudo apt upgrade -y |
| 205 | sudo apt autoremove --purge -y |
| 206 | judge "System package cleanup" |
| 207 | |
| 208 | print_ok "Upgrading GNOME Shell extensions..." |
| 209 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/gnome-shell/extensions/ /usr/share/gnome-shell/extensions/ |
| 210 | judge "Upgrade GNOME Shell extensions" |
| 211 | |
| 212 | print_ok "Upgrading icon and theme files..." |
| 213 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/icons/ /usr/share/icons/ |
| 214 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/themes/ /usr/share/themes/ |
| 215 | judge "Upgrade icon and theme files" |
| 216 | |
| 217 | print_ok "Upgrading desktop backgrounds..." |
| 218 | sudo rsync -Aax --update /mnt/anduinos_squashfs/usr/share/backgrounds/ /usr/share/backgrounds/ |
| 219 | sudo rsync -Aax --update /mnt/anduinos_squashfs/usr/share/gnome-background-properties/ /usr/share/gnome-background-properties/ |
| 220 | judge "Upgrade desktop backgrounds" |
| 221 | |
| 222 | print_ok "Upgrading APT configuration files..." |
| 223 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/apt/apt.conf.d/ /etc/apt/apt.conf.d/ |
| 224 | judge "Upgrade APT configuration files" |
| 225 | |
| 226 | print_ok "Upgrading APT preferences files..." |
| 227 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/apt/preferences.d/ /etc/apt/preferences.d/ |
| 228 | judge "Upgrade APT preferences files" |
| 229 | |
| 230 | print_ok "Upgrading session files..." |
| 231 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/gnome-session/sessions/ /usr/share/gnome-session/sessions/ |
| 232 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/wayland-sessions/ /usr/share/wayland-sessions/ |
| 233 | judge "Upgrade session files" |
| 234 | |
| 235 | print_ok "Upgrading pixmaps..." |
| 236 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/pixmaps/ /usr/share/pixmaps/ |
| 237 | judge "Upgrade pixmaps" |
| 238 | |
| 239 | print_ok "Upgrading /etc/skel/ files..." |
| 240 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/etc/skel/ /etc/skel/ |
| 241 | judge "Upgrade /etc/skel/ files" |
| 242 | |
| 243 | print_ok "Upgrading python-apt templates and distro info..." |
| 244 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/python-apt/templates/ /usr/share/python-apt/templates/ |
| 245 | sudo rsync -Aax --update --delete /mnt/anduinos_squashfs/usr/share/distro-info/ /usr/share/distro-info/ |
| 246 | judge "Upgrade python-apt templates and distro info" |
| 247 | |
| 248 | print_ok "Upgrading deskmon service..." |
| 249 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/local/bin/deskmon /usr/local/bin/deskmon |
| 250 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/systemd/user/deskmon.service /etc/systemd/user/deskmon.service |
| 251 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/systemd/user/default.target.wants/deskmon.service /etc/systemd/user/default.target.wants/deskmon.service |
| 252 | judge "Upgrade deskmon service" |
| 253 | |
| 254 | print_ok "Updating system version information..." |
| 255 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/local/bin/do_anduinos_upgrade /usr/local/bin/do_anduinos_upgrade |
| 256 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/bin/add-apt-repository /usr/bin/add-apt-repository |
| 257 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/lsb-release /etc/lsb-release |
| 258 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/issue /etc/issue |
| 259 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/issue.net /etc/issue.net |
| 260 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/os-release /etc/os-release |
| 261 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/lib/os-release /usr/lib/os-release |
| 262 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/legal /etc/legal |
| 263 | sudo rsync -Aax /mnt/anduinos_squashfs/etc/sysctl.d/20-apparmor-donotrestrict.conf /etc/sysctl.d/20-apparmor-donotrestrict.conf |
| 264 | sudo rsync -Aax /mnt/anduinos_squashfs/var/lib/flatpak/repo/config /var/lib/flatpak/repo/config |
| 265 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/themes/spinner/bgrt-fallback.png /usr/share/plymouth/themes/spinner/bgrt-fallback.png |
| 266 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/themes/spinner/watermark.png /usr/share/plymouth/themes/spinner/watermark.png |
| 267 | sudo rsync -Aax /mnt/anduinos_squashfs/usr/share/plymouth/ubuntu-logo.png /usr/share/plymouth/ubuntu-logo.png |
| 268 | judge "Update system version information" |
| 269 | |
| 270 | print_ok "Applying dconf settings patch..." |
| 271 | PATCH_URL="https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.4/src/mods/35-dconf-patch/dconf.ini?ref_type=heads" |
| 272 | curl -sL "$PATCH_URL" | dconf load /org/gnome/ |
| 273 | judge "Apply dconf settings patch" |
| 274 | |
| 275 | print_ok "Upgrade completed! Please reboot your system to apply all changes." |
| 276 | |
| 277 | print_ok "Starting cleanup..." |
| 278 | clean_up |