Skip to content

Commit

Permalink
Stretch Update: Add upgrade path to v4.x.x
Browse files Browse the repository at this point in the history
Addresses OS-29.

Up to now the Debian sources lists have been unmanaged and placed in the
system manually, migrate them into a package to allow them to be
properly managed, recoverable and verifiable.

Add a pre-update step to the updater to switch the sources over to the
new repository for those users who have hardware compatible with v4.x.x
and relaunch the updater flow once those are in place to trigger the
update. For those staying on Jessie, 3.16.0 will be the final update and
the updater will clean up to ensure that all is well.
  • Loading branch information
tombettany committed Aug 14, 2018
1 parent dfa5cf1 commit 6842544
Show file tree
Hide file tree
Showing 12 changed files with 283 additions and 119 deletions.
1 change: 1 addition & 0 deletions conf/apt/apt.conf.d/00-kano-default-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APT::Default-Release "release";
10 changes: 9 additions & 1 deletion conf/apt/preferences → conf/apt/preferences.d/99-kano-pinning
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ Pin-Priority: 900

Package: *
Pin: release n=devel
Pin-Priority: 500
Pin-Priority: 100

Package: *
Pin: release n=rc
Pin-Priority: 100

Package: *
Pin: release n=scratch
Pin-Priority: 100
32 changes: 32 additions & 0 deletions conf/apt/sources.list.d/kano-jessie.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Kano OS Jessie Official Package Repository
# Key:
# curl -L http://repo.kano.me/archive-stretch/repo.gpg.key | apt-key add -
#

deb http://repo.kano.me/archive-jessie/ release main
deb http://dev.kano.me/archive-jessie/ devel main
deb http://dev.kano.me/archive-jessie/ rc main
deb http://dev.kano.me/archive-jessie/ scratch main

# Release urgent repository
deb http://repo.kano.me/archive-jessie/ release-urgent main

# i18n Repository
deb http://repo.kano.me/raspberrypi-jessie-i18n/ release-i18n main

#
# Mirrored version of Raspberry Pi Foundation's repository
# Key:
# curl -L http://repo.kano.me/raspberrypi-stretch/raspberrypi.gpg.key | apt-key add -
#
# The original repo is avaiable at:
# http://archive.raspberrypi.org/debian/
#
deb http://repo.kano.me/raspberrypi-jessie/ jessie main ui


#
# Raspbian repository
#
deb http://raspbian.raspberrypi.org/raspbian/ jessie main contrib non-free rpi
33 changes: 33 additions & 0 deletions conf/apt/sources.list.d/kano-stretch.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Kano OS Stretch Official Package Repository
# Key:
# curl -L http://repo.kano.me/archive-jessie/repo.gpg.key | apt-key add -
#

deb http://repo.kano.me/archive-stretch/ release main
deb http://dev.kano.me/archive-stretch/ devel main
deb http://dev.kano.me/archive-stretch/ rc main
deb http://dev.kano.me/archive-stretch/ scratch main

# Release urgent repository
deb http://repo.kano.me/archive-stretch/ release-urgent main

# i18n Repository
# Note: Doesn't exist at the moment
# deb http://repo.kano.me/raspberrypi-stretch-i18n/ release-i18n main

#
# Mirrored version of Raspberry Pi Foundation's repository
# Key:
# curl -L http://repo.kano.me/raspberrypi-stretch/raspberrypi.gpg.key | apt-key add -
#
# The original repo is avaiable at:
# http://archive.raspberrypi.org/debian/
#
deb http://repo.kano.me/raspberrypi-stretch/ stretch main ui


#
# Raspbian repository
#
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ kano-updater (4.0.0-0) unstable; urgency=low

-- Team Kano <[email protected]> Fri, 6 Jul 2018 11:48:00 +0100

kano-updater (3.16.0-0) unstable; urgency=low

* Bump version for Kano OS v3.16.0 "Lovelace". Provides the final update for
Jessie and allows transition over to Stretch (and 4.x.x) for those with
the correct hardware

-- Team Kano <[email protected]> Fri, 6 Jul 2018 11:48:00 +0100

kano-updater (3.15.0-0) unstable; urgency=low

* Bump version for Kanux Beta v3.15.0
Expand Down
5 changes: 5 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ Build-Depends:
python-sphinx,
gettext

Package: kano-os-sources
Architecture: all
Description: Debian sources for Kano OS

Package: kano-updater
Architecture: any
Depends:
${misc:Depends},
kano-os-sources,
kano-os-pip-transition,
kano-toolset (>= 4.0.0-0),
python,
Expand Down
4 changes: 4 additions & 0 deletions debian/kano-os-sources.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
conf/apt/sources.list.d/kano-stretch.list etc/apt/sources.list.d/
conf/apt/apt.conf.d/* etc/apt/apt.conf.d/
conf/apt/preferences.d/* etc/apt/preferences.d/
conf/apt usr/share/kano-os-sources/
36 changes: 36 additions & 0 deletions debian/kano-os-sources.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# postinst
#
# Copyright (C) 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Post deb package install script.
#


SOURCES_DIR="/etc/apt/"
SOURCES_FILES=(
sources.list
sources.list.d/kano.list
sources.list.d/raspi.list
sources.list.d/collabora.list
)

case "$1" in
configure)
last_configured_version="$2"

# This package now handles the sources, remove others on install
if [ -z "$last_configured_version" ]; then
for DEB_SRC in ${SOURCES_FILES[@]}; do
rm -f $SOURCES_DIR/$DEB_SRC
done
fi

;;
esac

#DEBHELPER#

exit 0
1 change: 0 additions & 1 deletion debian/kano-updater.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ icon/kano-updater.png usr/share/icons/Kano/66x66/apps/

locale/* /usr/share/locale

conf/apt etc/
conf/dhcpcd-hooks lib/dhcpcd/
conf/systemd usr/lib/
conf/dist-packages usr/lib/python2.7/
11 changes: 0 additions & 11 deletions debian/kano-updater.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

TMP_FILE=/tmp/kano-updater_conf
OLD_UPDATER_STATUS=/var/cache/kano-updater/status
KANO_SOURCES="/etc/apt/sources.list.d/kano.list"

case "$1" in
configure)
Expand All @@ -35,16 +34,6 @@ case "$1" in
rm $OLD_UPDATER_STATUS
fi

# Add the urgent repo to sources - if not already existent (jessie users)
grep -q 'release-urgent' $KANO_SOURCES || \
grep -m 1 '^deb http://.*.kano.me/archive-jessie/' $KANO_SOURCES | \
sed -r "s|^deb http://([a-z]*).kano.me.*$|deb http://\1.kano.me/archive-jessie/ release-urgent main|" >> $KANO_SOURCES

# Add the urgent repo to sources - if not already existent (wheezy users)
grep -q 'release-urgent' $KANO_SOURCES || \
grep -m 1 '^deb http://.*.kano.me/archive/' $KANO_SOURCES | \
sed -r "s|^deb http://([a-z]*).kano.me.*$|deb http://\1.kano.me/archive/ release-urgent main|" >> $KANO_SOURCES

;;
esac

Expand Down
9 changes: 7 additions & 2 deletions kano_updater/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ def install_standard(progress, status):

progress.start('preupdate')
try:
preup.run()
preup.run(progress)
except Relaunch:
raise
except Exception as err:
logger.error("The pre-update scenarios failed.")
logger.error(err.encode('utf-8'))
Expand All @@ -319,7 +321,10 @@ def install_standard(progress, status):

progress.start('postupdate')
try:
postup.run()
postup.run(progress)
except Relaunch:
bump_system_version()
raise
except Exception as err:
logger.error("The post-update scenarios failed.")
logger.error(err.encode('utf-8'))
Expand Down
Loading

0 comments on commit 6842544

Please sign in to comment.