Skip to content

Commit

Permalink
Merge pull request #9 from DieterReuter/upgrade-to-debian-stretch
Browse files Browse the repository at this point in the history
Upgrade to Debian Stretch (but inline from Jessie)
  • Loading branch information
DieterReuter authored Oct 4, 2017
2 parents 5099010 + e1527a0 commit ab2baa0
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ usermod -a -G video pirate
printf "# Spawn a getty on Raspberry Pi serial line\nT0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100\n" >> /etc/inittab

# boot/cmdline.txt
echo "+dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 cgroup_enable=cpuset cgroup_enable=memory swapaccount=1 elevator=deadline fsck.repair=yes rootwait console=ttyAMA0,115200 kgdboc=ttyAMA0,115200" > /boot/cmdline.txt
echo "+dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 cgroup_enable=cpuset cgroup_enable=memory swapaccount=1 elevator=deadline fsck.repair=yes rootwait console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 net.ifnames=0" > /boot/cmdline.txt
# " net.ifnames=0" is neccessary for Debian Stretch: see https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

# create a default boot/config.txt file (details see http://elinux.org/RPiconfig)
echo "
Expand Down Expand Up @@ -238,10 +239,31 @@ echo "Installing rpi-serial-console script"
wget -q https://raw.githubusercontent.com/lurch/rpi-serial-console/master/rpi-serial-console -O usr/local/bin/rpi-serial-console
chmod +x usr/local/bin/rpi-serial-console

#TODO:+++ remove as soon as we do have a Debian Stretch os-rootfs image
# upgrade to Debian Stretch
# see: https://linuxconfig.org/how-to-upgrade-debian-8-jessie-to-debian-9-stretch
apt-get dist-upgrade -y
sed -i 's/jessie/stretch/g' /etc/apt/sources.list
apt-get update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" dist-upgrade
sed -i 's/Linux 8/Linux 9/g' /etc/issue
sed -i 's/Linux 8/Linux 9/g' /etc/issue.net
sed -i 's/Linux 8/Linux 9/g' /etc/motd
#TODO:---

# cleanup APT cache and lists
apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#TODO:+++ remove as soon as we do have a Debian Stretch os-rootfs image
# set HypriotOS version infos
BUILD_ARCH="${BUILD_ARCH:-arm64}"
HYPRIOT_OS_VERSION="${HYPRIOT_OS_VERSION:-v1.1.1}"
echo "HYPRIOT_OS=\"HypriotOS/${BUILD_ARCH}\"" >> /etc/os-release
echo "HYPRIOT_OS_VERSION=\"${HYPRIOT_OS_VERSION}\"" >> /etc/os-release
#TODO:---

# set device label and version number
echo "HYPRIOT_DEVICE=\"$HYPRIOT_DEVICE\"" >> /etc/os-release
echo "HYPRIOT_IMAGE_VERSION=\"$HYPRIOT_IMAGE_VERSION\"" >> /etc/os-release
Expand Down

0 comments on commit ab2baa0

Please sign in to comment.