Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #59 from hypriot/upgrade-to-stretch
Browse files Browse the repository at this point in the history
Upgrade to stretch
  • Loading branch information
DieterReuter authored Dec 23, 2017
2 parents 65fd2b3 + b767bee commit 1204076
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM hypriot/image-builder:latest

RUN apt-get update && apt-get install -y \
binfmt-support \
gpg \
qemu \
qemu-user-static \
--no-install-recommends && \
Expand Down
10 changes: 5 additions & 5 deletions builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ${DEBOOTSTRAP_CMD} \
--arch="${BUILD_ARCH}" \
--include="${DEFAULT_PACKAGES_INCLUDE}" \
--exclude="${DEFAULT_PACKAGES_EXCLUDE}" \
jessie \
stretch \
"${ROOTFS_DIR}" \
"${DEBOOTSTRAP_URL}"

Expand All @@ -70,9 +70,9 @@ cp -R /builder/files/* "$ROOTFS_DIR/"

# only keep apt/sources.list files that we need for the current build
if [[ "$VARIANT" == "debian" ]]; then
rm -f "$ROOTFS_DIR/etc/apt/sources.list.raspbian.jessie"
rm -f "$ROOTFS_DIR/etc/apt/sources.list.raspbian.stretch"
elif [[ "$VARIANT" == "raspbian" ]]; then
mv -f "$ROOTFS_DIR/etc/apt/sources.list.raspbian.jessie" "$ROOTFS_DIR/etc/apt/sources.list"
mv -f "$ROOTFS_DIR/etc/apt/sources.list.raspbian.stretch" "$ROOTFS_DIR/etc/apt/sources.list"
fi

# set up mount points for the pseudo filesystems
Expand Down Expand Up @@ -106,11 +106,11 @@ rm -rf "$ROOTFS_DIR/{dev,sys,proc}/*"
# package rootfs tarball
umask 0000

cd /workspace
pushd /workspace
ARCHIVE_NAME="rootfs-${BUILD_ARCH}-${VARIANT}-${HYPRIOT_OS_VERSION}.tar.gz"
tar -czf "${ARCHIVE_NAME}" -C "${ROOTFS_DIR}/" .
sha256sum "${ARCHIVE_NAME}" > "${ARCHIVE_NAME}.sha256"
cd -
popd

# test if rootfs is OK
HYPRIOT_HOSTNAME="${HYPRIOT_HOSTNAME}" VARIANT="${VARIANT}" /builder/test.sh
12 changes: 6 additions & 6 deletions builder/files/etc/apt/sources.list
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
deb http://httpredir.debian.org/debian jessie main
deb-src http://httpredir.debian.org/debian jessie main
deb http://httpredir.debian.org/debian stretch main
deb-src http://httpredir.debian.org/debian stretch main

deb http://httpredir.debian.org/debian jessie-updates main
deb-src http://httpredir.debian.org/debian jessie-updates main
deb http://httpredir.debian.org/debian stretch-updates main
deb-src http://httpredir.debian.org/debian stretch-updates main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main
3 changes: 0 additions & 3 deletions builder/files/etc/apt/sources.list.raspbian.jessie

This file was deleted.

3 changes: 3 additions & 0 deletions builder/files/etc/apt/sources.list.raspbian.stretch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi
1 change: 1 addition & 0 deletions builder/files/usr/local/bin/hypriot-firstboot
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck disable=SC1090
set -ex

for file in /etc/firstboot.d/*; do
Expand Down
13 changes: 4 additions & 9 deletions builder/test/rootfs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
if ENV['VARIANT'] == 'raspbian'
describe file('etc/apt/sources.list') do
it { should be_file }
its(:content) { should contain 'deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi' }
its(:content) { should contain 'deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi' }
end
elsif ENV['VARIANT'] == 'debian'
describe file('etc/apt/sources.list') do
it { should be_file }
its(:content) { should contain 'deb http://httpredir.debian.org/debian jessie main' }
its(:content) { should contain 'deb http://httpredir.debian.org/debian jessie-updates main' }
its(:content) { should contain 'deb http://security.debian.org/ jessie/updates main' }
its(:content) { should contain 'deb http://httpredir.debian.org/debian stretch main' }
its(:content) { should contain 'deb http://httpredir.debian.org/debian stretch-updates main' }
its(:content) { should contain 'deb http://security.debian.org/ stretch/updates main' }
end
end

Expand All @@ -42,11 +42,6 @@
it { should be_file }
end

describe file('etc/ssh/sshd_config') do
it { should be_file }
its(:content) { should contain /^PermitRootLogin without-password/ }
end

describe file('etc/shadow') do
it { should be_file }
its(:content) { should contain /^root:\*:/ }
Expand Down

0 comments on commit 1204076

Please sign in to comment.