-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from KTE/dex-os-videolooper
dexOS with videolooper
- Loading branch information
Showing
22 changed files
with
566 additions
and
37 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
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
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,7 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "$WD" | ||
|
||
docker start pigen_work || true | ||
docker exec -it pigen_work /bin/bash |
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,12 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "$WD" | ||
|
||
docker stop dex-os-apt-cacher-ng || true | ||
docker rm dex-os-apt-cacher-ng || true | ||
|
||
docker stop pigen_work || true | ||
docker rm pigen_work || true | ||
|
||
echo "[dev-reset] OK" |
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,10 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "$WD" | ||
|
||
./dev-reset.sh | ||
./prepare.sh | ||
./build.sh | ||
|
||
echo "[dist] OK" |
3 changes: 3 additions & 0 deletions
3
packages/dex-os/pi-gen/stage-dex/00-data-partition/00-packages
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,3 @@ | ||
parted | ||
dosfstools | ||
mtools |
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,7 @@ | ||
# TODO: convert those to proper patches? Makes the repo less readable, but catches unexpected changes from upstream | ||
|
||
# disable the default init_resize.sh script (we dont need to resize the root partition) | ||
sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||' "${ROOTFS_DIR}/boot/cmdline.txt" | ||
|
||
# install our resize2fs_once script, which resizes the data partition on first boot | ||
install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" |
51 changes: 51 additions & 0 deletions
51
packages/dex-os/pi-gen/stage-dex/00-data-partition/files/resize2fs_once
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,51 @@ | ||
#!/bin/sh | ||
### BEGIN INIT INFO | ||
# Provides: resize2fs_once | ||
# Required-Start: | ||
# Required-Stop: | ||
# Default-Start: 3 | ||
# Default-Stop: | ||
# Short-Description: Resize /dexdata partition to fill the SD card | ||
# Description: | ||
### END INIT INFO | ||
. /lib/lsb/init-functions | ||
case "$1" in | ||
start) | ||
log_daemon_msg "Starting resize2fs_once" | ||
set -exu | ||
|
||
DATA_MOUNT="/dexdata/" | ||
|
||
# find device and partition | ||
mount "$DATA_MOUNT" || mount "$DATA_MOUNT" -o remount | ||
DATA_PART="$(findmnt "$DATA_MOUNT" -n -o SOURCE -r)" | ||
DATA_PART_DEV="$(echo "$DATA_PART" | sed 's/p.*//')" | ||
|
||
# backup files | ||
TMP_DIR="$(mktemp -d)${DATA_MOUNT}/" | ||
rsync -avPh "$DATA_MOUNT" "$TMP_DIR" | ||
|
||
# resize partition and recreate filesystem | ||
umount "$DATA_MOUNT" | ||
parted "$DATA_PART_DEV" --align optimal --script 'resizepart 3 100%' | ||
mkfs.vfat -F 32 -n "DEXDATA" "$DATA_PART" | ||
dosfsck -w -l -a -v -f -y "$DATA_PART" | ||
|
||
# restore files | ||
mount "$DATA_MOUNT" | ||
rsync -avPh "$TMP_DIR" "$DATA_MOUNT" | ||
|
||
# remove run-once script | ||
update-rc.d resize2fs_once remove | ||
rm /etc/init.d/resize2fs_once | ||
|
||
log_daemon_msg "resize2fs_once finished" | ||
|
||
log_end_msg $? | ||
|
||
;; | ||
*) | ||
echo "Usage: $0 start" >&2 | ||
exit 3 | ||
;; | ||
esac |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,20 @@ | ||
# shellcheck shell=sh | ||
|
||
# install adafruit pi_video_looper using their install script, omitting omxplayer | ||
|
||
rm -rf "/home/${FIRST_USER_NAME}/pi_video_looper" | ||
cp -r files/pi_video_looper "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/" | ||
|
||
on_chroot << EOF | ||
cd "/home/${FIRST_USER_NAME}/pi_video_looper" | ||
# remove 'omxplayer' from the list of packages to install (we only want hello_video) | ||
sed -i 's/omxplayer//g' ./install.sh | ||
./install.sh | ||
EOF | ||
|
||
# add our custom video_looper.ini configuration file | ||
install -m 644 files/video_looper.ini "${ROOTFS_DIR}/boot/video_looper.ini" |
1 change: 1 addition & 0 deletions
1
packages/dex-os/pi-gen/stage-dex/01-videolooper/files/pi_video_looper
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 @@ | ||
../../../../../pi_video_looper |
Oops, something went wrong.