Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add desktop UI and clone Peggy project, set to user. #12

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ls -alh /image_with_kernel_*.tar.gz

# download the ready-made raw image for the RPi
if [ ! -f "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" ]; then
wget -q -O "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" "https://github.com/hypriot/image-builder-raw/releases/download/${RAW_IMAGE_VERSION}/${RAW_IMAGE}.zip"
wget -q -O "${BUILD_RESULT_PATH}/${RAW_IMAGE}.zip" "https://jenkins.laboratoriopublico.org/job/image-builder-raw/ws/${RAW_IMAGE}.zip"
fi

# verify checksum of the ready-made raw image
Expand Down
14 changes: 11 additions & 3 deletions builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ echo 'deb http://archive.raspberrypi.org/debian/ stretch main' | tee /etc/apt/so
apt-get update
# apt-get upgrade -y

# Check free space
df -h /

# install packages
apt-get -o Dpkg::Options::=--force-confdef \
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=--force-confdef \
install -y \
--no-install-recommends \
firmware-atheros \
Expand All @@ -147,8 +150,10 @@ apt-get -o Dpkg::Options::=--force-confdef \
pi-bluetooth \
lsb-release \
gettext \
cloud-init

cloud-init \
pt-ui-mods \
xserver-xorg \
git

# install special Docker enabled kernel
if [ -z "${KERNEL_URL}" ]; then
Expand Down Expand Up @@ -220,3 +225,6 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
echo "HYPRIOT_DEVICE=\"$HYPRIOT_DEVICE\"" >> /etc/os-release
echo "HYPRIOT_IMAGE_VERSION=\"$HYPRIOT_IMAGE_VERSION\"" >> /etc/os-release
cp /etc/os-release /boot/os-release

# Integrate camera development work (see https://publiclab.org/notes/MaggPi/08-09-2018/raspberry-pi-manual-camera-control )
git clone https://github.com/MargaretAN9/Peggy/ /home/publiclab/Peggy
3 changes: 3 additions & 0 deletions builder/files/boot/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ runcmd:
# Pickup the hostname changes
- 'systemctl restart avahi-daemon'

# Give ownership of scripts
- 'chown publiclab.publiclab /home/publiclab/Peggy -R'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, will this often be necessary? Does chroot-script run as root, and could this in theory be put there? Thinking about how to learn from this example. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I predict it is necessary because at the time of git cloning (image build time), it is running as root.
Commands in user-data run on first boot (including user creation!). This is my understanding from seeing cloud-init documentation.

We'll see!


# # Activate WiFi interface
# - 'ifup wlan0'
4 changes: 2 additions & 2 deletions versions.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ROOTFS_TAR_CHECKSUM="d1e7e6d48a25b4a206c5df99ecb8815388ec6945e4f97e78413d5a80778

# name of the ready made raw image for RPi
RAW_IMAGE="rpi-raw.img"
RAW_IMAGE_VERSION="v0.2.2"
RAW_IMAGE_CHECKSUM="2fbeb13b7b0f2308dbd0d82780b54c33003ad43d145ff08498b25fb8bbe1c2c6"
RAW_IMAGE_VERSION="master"
RAW_IMAGE_CHECKSUM="e32c0b9f3cdb9c60bad97a724103fc1283cdc135848e6142d588cd96fac1d6a8"

# specific versions of kernel/firmware and docker tools
export KERNEL_BUILD="20180422-141901"
Expand Down