:: Re: [DNG] buster to beowulf
Pàgina inicial
Delete this message
Reply to this message
Autor: Andrew McGlashan
Data:  
A: dng
Assumpte: Re: [DNG] buster to beowulf
Hi,

On 17/1/20 6:37 pm, Mark Hindley wrote:
> On Thu, Jan 16, 2020 at 06:45:44PM -0500, Hendrik Boom wrote:
> Yes, I have been working on this.
>
> Attached is the script I have been testing. It single steps through.


I've attached a patch file.

AIUI it is better to specifically path /bin/bash rather than via env,
escpecially when we know for sure where bash is located....

- save [with verbose] orig sources.list (mv -v)
- save file permissions and timestamps [with verbose] with cp (cp -vp)
- adjust sed to use more normal "sed -i" form...?
- indent cat EOF (better readability).

Also fix http:// ref to https:// with a server that is valid.



Not tested.... not sure if /etc/network/interfaces change is universal
or not.

Perhaps change line 7 for which vim instead of vim.tiny?

Also, if the keyring package (.deb file) is "stable", why not verify
it's checksum?

Passes shellcheck cleanly.

Cheers
A.

--
Andrew McGlashan
IT Support & Broadband Solutions


Affinity Vision Australia Pty Ltd

*** buster_migration.sh.orig    2020-02-03 20:56:10.696650864 +1100
--- buster_migration.sh    2020-02-03 21:09:41.708648329 +1100
***************
*** 1,10 ****
! #!/usr/bin/env bash


# Single step: https://stackoverflow.com/questions/9080431/how-execute-bash-script-line-by-line#9080645
set -x
trap read debug

! update-alternatives --set editor $(which vim.tiny)

# Migrate from Debian buster to Devuan beowulf

--- 1,10 ----
! #!/bin/bash

# Single step: https://stackoverflow.com/questions/9080431/how-execute-bash-script-line-by-line#9080645
set -x
trap read debug

! update-alternatives --set editor "$(which vim.tiny)"

# Migrate from Debian buster to Devuan beowulf

*************** if  [ -d /run/systemd/system ]; then
*** 13,26 ****
      # Must be Buster


      # Install devuan-keyring
!     wget http://titan:9999/pkgmaster.devuan.org/devuan/pool/main/d/devuan-keyring/devuan-keyring_2017.10.03_all.deb
      dpkg -i devuan-keyring_2017.10.03_all.deb


      # Change APT sources
!     cat > /etc/apt/sources.list <<EOF
! deb http://pkgmaster.devuan.org/merged beowulf main 
! deb http://pkgmaster.devuan.org/merged beowulf-security main 
! EOF


      apt update


--- 13,28 ----
      # Must be Buster


      # Install devuan-keyring
!     wget https://pkgmaster.devuan.org/devuan/pool/main/d/devuan-keyring/devuan-keyring_2017.10.03_all.deb
      dpkg -i devuan-keyring_2017.10.03_all.deb


+     mv -v /etc/apt/sources.list /etc/apt/sources.list.debin_buster
+ 
      # Change APT sources
!     cat > /etc/apt/sources.list <<-EOF
!         deb http://pkgmaster.devuan.org/merged beowulf main 
!         deb http://pkgmaster.devuan.org/merged beowulf-security main 
!     EOF


      apt update


*************** EOF
*** 35,41 ****
      #     Depends: libc6 (>= 2.28), libpam0g (>= 0.99.7.1), systemd (= 241-7~deb10u1), libpam-runtime (>= 1.0.1-6), dbus, systemd-sysv
      # 4) Remove ', systemd-sysv from the end of the line, leaving the rest of the line intact
      # 5) Save file
!     cp /var/lib/dpkg/status /var/lib/dpkg/status.save
      editor /var/lib/dpkg/status


      # Install new init and dbus.
--- 37,43 ----
      #     Depends: libc6 (>= 2.28), libpam0g (>= 0.99.7.1), systemd (= 241-7~deb10u1), libpam-runtime (>= 1.0.1-6), dbus, systemd-sysv
      # 4) Remove ', systemd-sysv from the end of the line, leaving the rest of the line intact
      # 5) Save file
!     cp -pv /var/lib/dpkg/status /var/lib/dpkg/status.save
      editor /var/lib/dpkg/status


      # Install new init and dbus.
*************** else
*** 67,73 ****
      apt autoremove --purge


      # Change ens3 to eth0 in /etc/network/interfaces
!     sed s/ens3/eth0/ -i /etc/network/interfaces


fi

--- 69,75 ----
      apt autoremove --purge


      # Change ens3 to eth0 in /etc/network/interfaces
!     sed -i 's/ens3/eth0/' /etc/network/interfaces


fi