Browse Source

Prepare to support multiple devuan/debian versions

Prepare to support multiple devuan/debian versions
master
farmatito 4 months ago
parent
commit
23df5b12f7
1 changed files with 15 additions and 11 deletions
  1. +15
    -11
      migration.sh

+ 15
- 11
migration.sh View File

@@ -1,10 +1,12 @@
#!/bin/sh
#############################################################
# Buster to Beowulf migrator v.1.8 for desktops #
# Debian to Devuan Migrator v.1.8 for desktops #
# #
# farmatito (c) 2021 <farmatito@tiscali.it> GPLv2 #
# Script to migrate a standard debian buster 10.9 desktop #
# to devuan beowulf 3.x #
# Script to migrate a standard debian install to devuan #
# Supported OS versions: #
# a) Debian buster to Devuan beowulf #
# #
# Supported DE's: #
# 1) GNOME #
# 2) LXDE #
@@ -33,9 +35,11 @@ _NONFREE=""
# Prepare for next Debian release and detect version
if test "x$VERSION_ID" = "x10" ; then
echo "Detected: Debian $VERSION"
DEVUAN_CODENAME="beowulf"
else
if test "x$VERSION_ID" = "x11" ; then
echo "Detected: Debian $VERSION"
DEVUAN_CODENAME="chimaera"
fi
fi

@@ -194,15 +198,15 @@ fi
# only add to sources.list if migration is successful?
# Cleanup in case of failure would be easier this way.
{ echo ""; \
echo "deb http://deb.devuan.org/merged beowulf main$_CONTRIB$_NONFREE"; \
echo "deb http://deb.devuan.org/merged beowulf-updates main$_CONTRIB$_NONFREE"; \
echo "deb http://deb.devuan.org/merged beowulf-security main$_CONTRIB$_NONFREE"; } >> /etc/apt/sources.list
echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME main$_CONTRIB$_NONFREE"; \
echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME-updates main$_CONTRIB$_NONFREE"; \
echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME-security main$_CONTRIB$_NONFREE"; } >> /etc/apt/sources.list

# PIN PREFERENCE FOR BEOWULF PACKGES
# PIN PREFERENCE FOR DEVUAN PACKGES
# TODO use mktemp /etc/apt/preferences.d/XXXXXXXXX ?
{ echo "Package: *"; \
echo "Pin: origin \"deb.devuan.org\""; \
echo "Pin-Priority: 900"; } > /etc/apt/preferences.d/beowulf
echo "Pin-Priority: 900"; } > /etc/apt/preferences.d/"$DEVUAN_CODENAME"

# STOP THE TIMERS FOR APT TO AVOID INTERFERENCES (FILE LOCKS)
systemctl stop apt-daily.timer
@@ -373,7 +377,7 @@ dpkg --purge --force-all systemd-sysv
dpkg --purge --force-all libsystemd0
cp "$LIBSYSTEMD".bak "$LIBSYSTEMD"

# FORCE INSTALL BEOWULF PACKAGES TO BE SURE
# FORCE INSTALL DEVUAN PACKAGES TO BE SURE
dpkg -i --force-all ./libeudev1*.deb
dpkg -i --force-all ./util-linux*.deb
dpkg -i --force-all ./libelogind0*.deb
@@ -424,7 +428,7 @@ INFOTMP=$(mktemp Info-XXXXXXXX.txt)
if test $KDE -eq 1 -o $GNOME -eq 1 ; then
echo "* You will be rebooted to console. *"; \
fi
echo "* After reboot remove references to debian buster from /etc/apt/sources.list *" ; \
echo "* After reboot remove references to debian $VERSION_CODENAME from /etc/apt/sources.list *" ; \
echo "* and run in a root terminal: export PATH=\$PATH:/usr/sbin:/sbin *" ; \
echo "* and run: dpkg --purge --force-all systemd *" ; \
if test $LXQT -eq 1 -o $LXDE -eq 1 ; then
@@ -473,7 +477,7 @@ echo "Hit Enter to reboot"
read -r DUMMY

# CLEANUP
rm -f /etc/apt/preferences.d/beowulf
rm -f /etc/apt/preferences.d/"$DEVUAN_CODENAME"
rm -f "$LIBSYSTEMD"

# SYSTEMD IS STILL RUNNING SO USE IT FOR A CLEANER REBOOT


Loading…
Cancel
Save