Commit e8e3fa0c authored by Blaine Murphy's avatar Blaine Murphy

Initial commit

parents
BSD 2-Clause License
Copyright (c) 2020, Blaine Murphy
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Wasteland Jukebox OS
Operating system setup script for the
[Wasteland Jukebox](https://blaines.world/projects/wasteland-jukebox.html).
This guide assumes the use of a Linux box for preparation and a Raspberry Pi
3B+ for the target SBC. Parts of this guide are taken from [the official Alpine
guide](https://wiki.alpinelinux.org/wiki/Raspberry_Pi).
## Preparation
The following steps are performed on a Linux host to prepare an SD card for the
Pi:
1. Download the latest [Alpine image](https://alpinelinux.org/downloads/) for
Raspberry Pi (for 3B+ use the `armv7` image)
2. Insert the SD card into the computer
3. Create a bootable FAT32 partition on the card using
[fdisk](https://wiki.alpinelinux.org/wiki/Create_a_Bootable_USB#Format_USB_stick)
or a GUI tool like gparted
4. Mount the SD card
5. Extract the content of the downloaded Alpine image to the root of the card
6. Copy the file `usercfg.txt` and the directory `install` from this directory
to the root of the SD card
7. Unmount and remove the SD card from the computer
## Installation
The following steps are performed on the Raspberry Pi:
1. Connect an ethernet cable to the Pi if using a wired connection
2. Insert the SD card into the Pi and plug power in to turn it on
3. Login using username `root` and empty password
4. Run `setup-alpine` and complete the setup wizard
5. Run `cd /media/mmcbkl0p1/install; sh install` to run the installer
6. Run `reboot` to reboot into the initialized system
## Licensing
Source in this repository is licensed under the 2-clause BSD license, see
`LICENSE` for details.
#!/bin/sh
# Wasteland Jukebox OS setup script
# This prepares Alpine Linux to run MPD as a service and boot into ncmpc
# add edge and add community repos
MIRROR_BASE_URL="http://dl-cdn.alpinelinux.org/alpine/edge"
echo "$MIRROR_BASE_URL/main" >> /etc/apk/repositories
echo "$MIRROR_BASE_URL/community" >> /etc/apk/repositories
# install packages
apk update
apk upgrade --update-cache --available
apk add nano sudo kbd terminus-font mpd ncmpc
# enable services
rc-update add mpd
# create a user to run the jukebox script
addgroup --system jukebox
adduser --system jukebox --ingroup jukebox --home /home/jukebox
# copy configurations and scripts
#TODO copy ncmpc config
install -m 755 run /home/jukebox
# set tty1 to autologin ncmpc user
sed -i "s/^tty1::respawn:\/sbin\/getty/tty1::respawn:\/home\/jukebox\/run/g" \
/etc/inittab
# commit changed files to persistent layer
lbu include /home/jukebox
lbu commit -d
sync
#!/bin/sh
setfont ter-128b
sudo -u jukebox ncmpc
# Configure Raspberry Pi base hardware
# see https://www.raspberrypi.org/documentation/configuration/config-txt/
# configure video for black and white TV driven by composite output
enable_tvout=1
sdtv_mode=0
sdtv_aspect=1
sdtv_disable_colourburst=1
disable_overscan=1
overscan_left=55
overscan_right=50
overscan_top=30
overscan_bottom=35
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment