-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1543 from Groovylein/remove_userspecific_installa…
…tion Remove hardcoded homedir in install scritp
- Loading branch information
Showing
7 changed files
with
533 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM debian:buster | ||
|
||
COPY . /code | ||
WORKDIR /code | ||
|
||
RUN groupadd --gid 1000 wurst ;\ | ||
useradd -u 1000 -g 1000 -G sudo -d /home/hans -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' hans ;\ | ||
chown -R 1000:1000 /code /home/hans ;\ | ||
chmod +x /code/scripts/installscripts/buster-install-default.sh ;\ | ||
chmod +x /code/scripts/installscripts/tests/run_installation_tests_altuser.sh ;\ | ||
chmod +x /code/scripts/installscripts/tests/run_installation_tests2_altuser.sh ;\ | ||
chmod +x /code/scripts/installscripts/tests/run_installation_tests3_altuser.sh | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive ;\ | ||
apt-get update ;\ | ||
apt-get -y install curl gnupg sudo nano systemd apt-utils;\ | ||
echo 'deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi' > /etc/apt/sources.list.d/raspi.list ;\ | ||
echo 'deb http://archive.raspberrypi.org/debian/ buster main' >> /etc/apt/sources.list.d/raspi.list ;\ | ||
curl http://raspbian.raspberrypi.org/raspbian.public.key | apt-key add - ;\ | ||
curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add - ;\ | ||
echo 'hans ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/hans ;\ | ||
apt-get clean ;\ | ||
rm -rf /var/cache/apt/* /var/lib/apt/lists/* | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive ;\ | ||
apt-get update ;\ | ||
apt-get -y dist-upgrade --auto-remove --purge ;\ | ||
apt-get -y install wget build-essential git iw locales wpasupplicant;\ | ||
apt-get clean ;\ | ||
touch /boot/cmdlinetxt ;\ | ||
rm -rf /var/cache/apt/* /var/lib/apt/lists/* | ||
|
||
USER hans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
scripts/installscripts/tests/run_installation_tests2_altuser.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install Phoniebox and test it | ||
# Used e.g. for tests on Docker | ||
|
||
# Objective: Test installation with script using a RC522 reader | ||
|
||
# Print current path | ||
echo $PWD | ||
|
||
# Preparations | ||
# Skip interactive Samba WINS config dialog | ||
echo "samba-common samba-common/dhcp boolean false" | sudo debconf-set-selections | ||
# No interactive frontend | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Run installation (in interactive mode) | ||
# y confirm interactive | ||
# n dont configure wifi | ||
# y PCM as iface | ||
# n no spotify | ||
# y configure mpd | ||
# y audio default location | ||
# y use gpio | ||
# y RFID registration | ||
# 2 use RC522 reader | ||
# yes, reader is connected | ||
# n No reboot | ||
|
||
# TODO check, how this behaves on branches other than develop | ||
GIT_BRANCH=develop bash ./scripts/installscripts/buster-install-default.sh <<< $'y\nn\n\ny\n\nn\n\ny\n\ny\n\ny\n\ny\ny\n2\ny\nn\n' | ||
|
||
# Test installation | ||
./scripts/installscripts/tests/test_installation_altuser.sh |
32 changes: 32 additions & 0 deletions
32
scripts/installscripts/tests/run_installation_tests3_altuser.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install Phoniebox and test it | ||
# Used e.g. for tests on Docker | ||
|
||
# Objective: Test installation with script using a configuration with mopidy | ||
|
||
# Print current path | ||
echo $PWD | ||
|
||
# Preparations | ||
# Skip interactive Samba WINS config dialog | ||
echo "samba-common samba-common/dhcp boolean false" | sudo debconf-set-selections | ||
# No interactive frontend | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Run installation (in interactive mode) | ||
# y confirm interactive | ||
# n dont configure wifi | ||
# y Headphone as iface | ||
# y spotify with myuser, mypassword, myclient_id, myclient_secret | ||
# y configure mpd | ||
# y audio default location | ||
# y config gpio | ||
# n no RFID registration | ||
# n No reboot | ||
|
||
# TODO check, how this behaves on branches other than develop | ||
GIT_BRANCH=develop bash ./scripts/installscripts/buster-install-default.sh <<< $'y\nn\n\ny\n\ny\nmyuser\nmypassword\nmyclient_id\nmyclient_secret\n\ny\n\ny\n\ny\n\ny\nn\nn\n' | ||
|
||
# Test installation | ||
./scripts/installscripts/tests/test_installation_altuser.sh |
32 changes: 32 additions & 0 deletions
32
scripts/installscripts/tests/run_installation_tests_altuser.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install Phoniebox and test it | ||
# Used e.g. for tests on Docker | ||
|
||
# Objective: Test installation with script using a simple configuration | ||
|
||
# Print current path | ||
echo $PWD | ||
|
||
# Preparations | ||
# Skip interactive Samba WINS config dialog | ||
echo "samba-common samba-common/dhcp boolean false" | sudo debconf-set-selections | ||
# No interactive frontend | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Run installation (in interactive mode) | ||
# y confirm interactive | ||
# n dont configure wifi | ||
# y Headphone as iface | ||
# n no spotify | ||
# y configure mpd | ||
# y audio default location | ||
# y config gpio | ||
# n no RFID registration | ||
# n No reboot | ||
|
||
# TODO check, how this behaves on branches other than develop | ||
GIT_BRANCH=develop bash ./scripts/installscripts/buster-install-default.sh <<< $'y\nn\n\ny\n\nn\n\ny\n\ny\n\ny\n\ny\nn\nn\n' | ||
|
||
# Test installation | ||
./scripts/installscripts/tests/test_installation_altuser.sh |
Oops, something went wrong.