Skip to content

Commit

Permalink
Merge pull request #6 from learningequality/raspbian_fixes
Browse files Browse the repository at this point in the history
Fixes to adapt setup to last Raspbian and Debian versions
  • Loading branch information
jredrejo authored Nov 19, 2024
2 parents 63a60ea + b3e7985 commit 007695b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
21 changes: 14 additions & 7 deletions base.Pifile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ hostname=kolibri
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hostname
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hosts

# Set password for specified user (pi by default)

echo "Changing password of pi..."

# Redirect output to prevent echoing sensitive information to stdout
RUN << EOF &> /dev/null
bash -c "echo ${user}:kolibrifly | chpasswd"
EOF

echo "Done."

Expand Down Expand Up @@ -76,10 +69,24 @@ RUN tee /etc/default/dnsmasq <<EOF
DNSMASQ_EXCEPT=lo
EOF

# latest debian version seems to have this line commented
RUN bash -c "sed -i 's/^#conf-dir=\\/etc\\/dnsmasq.d\\/,.*/conf-dir=\\/etc\\/dnsmasq.d\\/,*.conf/' /etc/dnsmasq.conf"

RUN rm /etc/nginx/sites-enabled/default

RUN systemctl enable hostapd
RUN systemctl enable dnsmasq
RUN systemctl enable nginx
RUN systemctl enable ssh


# Set kolibryfly password for specified user (pi by default)
RUN bash -c 'echo pi:\$6\$OUzfiWw5K8RdwdFV\$7Skel9ojIekqNSE/KVPIhemg9D.tQqoOF2BwZwIgZ/X0CTC0MJPbcUmzvnSSE3CkBdG2zsD1rCHSQ9yQCqVfr/ > /boot/firmware/userconf.txt'

# avoid keyboard setup questions blocking first boot:
RUN sh -c 'echo "keyboard-configuration keyboard-configuration/layout select English (US)" | sudo debconf-set-selections'
RUN tee -a /boot/firmware/cmdline.txt<<EOF
debconf=low
EOF

ENV DEBIAN_FRONTEND
9 changes: 9 additions & 0 deletions kolibri.Pifile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ ENV DEBIAN_FRONTEND noninteractive

echo "--- Using Kolibri deb"

# Preseeding package config
RUN sh -c '
echo "kolibri kolibri/init boolean false" | debconf-set-selections; \
echo "kolibri kolibri/user string pi" | debconf-set-selections; \
echo "kolibri-server kolibri-server/port select 80" | debconf-set-selections; \
echo "kolibri-server kolibri-server/zip_content_port select 81" | debconf-set-selections
'


# All files copied at build stage to /pi-gen
INSTALL dist/*.deb /tmp/kolibri.deb

Expand Down

0 comments on commit 007695b

Please sign in to comment.