Play a sound while converting documents.
pull/10/head
Raphaël Vinot 2013-10-09 17:33:54 +02:00
parent 4e811d9e61
commit 05e687c6c6
10 changed files with 35 additions and 7 deletions

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
set -e
set -x
CHROOT_PATH='/mnt/arm_rPi' CHROOT_PATH='/mnt/arm_rPi'
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
@ -14,11 +17,12 @@ fi
tar -cvpzf backup.tar.gz -C fs/ . tar -cvpzf backup.tar.gz -C fs/ .
tar -xzf backup.tar.gz -C ${CHROOT_PATH}/ tar -xzf backup.tar.gz -C ${CHROOT_PATH}/
cp deb/led ${CHROOT_PATH}/usr/sbin/led cp deb/led ${CHROOT_PATH}/usr/sbin/led
cp -rf midi ${CHROOT_PATH}/opt/
# needed just once, make sure the size of the partition is correct # needed just once, make sure the size of the partition is correct
#losetup -o $((122880 * 512)) /dev/loop0 FINAL_2013-09-10-wheezy-raspbian.img #losetup -o $((122880 * 512)) /dev/loop0 FINAL_2013-09-10-wheezy-raspbian.img
e2fsck -f /dev/loop0 #e2fsck -f /dev/loop0
resize2fs /dev/loop0 #resize2fs /dev/loop0
#losetup -d /dev/loop0 #losetup -d /dev/loop0
#sudo dd bs=4M if=FINAL_2013-09-10-wheezy-raspbian.img of=/dev/sdd #sudo dd bs=4M if=FINAL_2013-09-10-wheezy-raspbian.img of=/dev/sdd
@ -27,3 +31,6 @@ resize2fs /dev/loop0
# if it is, use fdisk to remove the second partition and recreate it (you will # if it is, use fdisk to remove the second partition and recreate it (you will
# not lose the data). # not lose the data).
# See resize_img.md # See resize_img.md
# It is also a good idea to run raspi-config once and enable the console login (allow debugging)

0
deb/.keepdir Normal file
View File

View File

@ -21,6 +21,8 @@ if [ -e /dev/sda ]; then
if [ -e /dev/sdb ]; then if [ -e /dev/sdb ]; then
cd /opt/groomer cd /opt/groomer
/usr/sbin/led & /usr/sbin/led &
# avoid possibe misuse
/sbin/ifconfig eth0 down
./init.sh ./init.sh
/sbin/shutdown -h now /sbin/shutdown -h now
fi fi

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
set -x #set -x
if [ $# -eq 2 ]; then if [ $# -eq 2 ]; then
mount -o noexec,nosuid,nodev "${1}" "${2}" mount -o noexec,nosuid,nodev "${1}" "${2}"

View File

@ -1,14 +1,15 @@
DEV_SRC='/dev/sda' DEV_SRC='/dev/sda'
DEV_DST='/dev/sdb1' DEV_DST='/dev/sdb1'
# User allowed to do the following commands without password # User allowed to do the following commands without password
USERNAME='kitten' USERNAME='kitten'
HOME="/home/${USERNAME}" HOME="/home/${USERNAME}"
MUSIC="/opt/midi/"
TMP="/tmp/" TMP="/tmp/"
# Paths used in multiple scripts # Paths used in multiple scripts
SRC="${TMP}/src" SRC="${TMP}/src"
DST="${TMP}/dst" DST="${TMP}/dst"
TEMP="${DST}/temp" TEMP="${DST}/temp"
ZIPTEMP="${DST}/ziptemp" ZIPTEMP="${DST}/ziptemp"
@ -19,6 +20,7 @@ LOGS="${DST}/logs"
SUDO='/usr/bin/sudo' SUDO='/usr/bin/sudo'
ID=`/usr/bin/id -u` ID=`/usr/bin/id -u`
SYNC='/bin/sync' SYNC='/bin/sync'
TIMIDITY='/usr/bin/timidity'
# root commands. # root commands.
# To avoid the risk that an attacker use -o remount on mount and other nasty # To avoid the risk that an attacker use -o remount on mount and other nasty

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
#set -e set -e
set -x #set -x
source ./constraint.sh source ./constraint.sh
source ./constraint_conv.sh source ./constraint_conv.sh

View File

@ -17,6 +17,8 @@ clean(){
trap clean EXIT TERM INT trap clean EXIT TERM INT
./music.sh &
su ${USERNAME} -c ./groomer.sh su ${USERNAME} -c ./groomer.sh

15
fs/opt/groomer/music.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
#set -x
source ./constraint.sh
# Force output on analog
amixer cset numid=3 1
files=(${MUSIC}*)
while true; do
$TIMIDITY ${files[RANDOM % ${#files[@]}]}
done

0
midi/.keepdir Normal file
View File

View File

@ -7,7 +7,7 @@ dpkg-reconfigure locales
apt-get update apt-get update
apt-get dist-upgrade apt-get dist-upgrade
apt-get autoremove apt-get autoremove
apt-get install libreoffice p7zip-full libfontforge1 apt-get install libreoffice p7zip-full libfontforge1 timidity
dpkg -i libpoppler37*.deb pdf2htmlex*.deb dpkg -i libpoppler37*.deb pdf2htmlex*.deb
chown -R kitten:kitten /home/kitten chown -R kitten:kitten /home/kitten