diff --git a/fs_filecheck/etc/pmount.allow b/fs_filecheck/etc/pmount.allow index e9bb419..0964946 100644 --- a/fs_filecheck/etc/pmount.allow +++ b/fs_filecheck/etc/pmount.allow @@ -1,5 +1,5 @@ # /etc/pmount.allow # pmount will allow users to additionally mount all devices that are # listed here. -/dev/sdb1 +/dev/sdb* /dev/sda* diff --git a/fs_filecheck/etc/rc.local b/fs_filecheck/etc/rc.local index ad6e7f7..fb86b0b 100755 --- a/fs_filecheck/etc/rc.local +++ b/fs_filecheck/etc/rc.local @@ -35,7 +35,6 @@ if [ -e /dev/sda ]; then setterm -powersave off -blank 0 trap clean EXIT TERM INT cd /opt/groomer - /usr/sbin/led & ./init.sh fi fi diff --git a/fs_filecheck/etc/udev/rules.d/10-usb.rules b/fs_filecheck/etc/udev/rules.d/10-usb.rules index 700bf79..bbe5128 100644 --- a/fs_filecheck/etc/udev/rules.d/10-usb.rules +++ b/fs_filecheck/etc/udev/rules.d/10-usb.rules @@ -1,6 +1,3 @@ # The purpose of this rules file is to ensure that the top left usb port and its partitions have a symlink to /dev/source_key[num], and the other ports to /dev/dest_key[num] -KERNELS=="1-1.2", SUBSYSTEMS=="usb", SYMLINK+="source_key%n" -KERNELS=="1-1.[3-5]*", SUBSYSTEMS=="usb", SYMLINK+="dest_key%n" - -# KERNELS=="1-1.2", SUBSYSTEMS=="usb", ENV{USB} SYMLINK+="source_key%n" -# KERNELS=="1-1.[3-5]*", SUBSYSTEMS=="usb", SYMLINK+="dest_key%n" \ No newline at end of file +KERNEL=="sd*", KERNELS=="1-1.2", SUBSYSTEMS=="usb", SYMLINK+="source_key%n" +KERNEL=="sd*", KERNELS=="1-1.[3-5]", SUBSYSTEMS=="usb", SYMLINK+="dest_key%n" diff --git a/fs_filecheck/etc/udev/rules.d/90-qemu.rules b/fs_filecheck/etc/udev/rules.d/90-qemu.rules index 07dfc21..98b9071 100644 --- a/fs_filecheck/etc/udev/rules.d/90-qemu.rules +++ b/fs_filecheck/etc/udev/rules.d/90-qemu.rules @@ -1,2 +1,5 @@ +# This udev rule is designed to make the hardware appear more like the actual raspi hardware when emulating in Qemu. You might have to change sdc to sda or sdb depending on where the filesystem you are emulating is available from in /dev/. +# See http://pub.phyks.me/respawn/mypersonaldata/public/2014-05-20-11-08-01/ for more info. KERNEL=="sdc", SYMLINK+="mmcblk0" KERNEL=="sdc?", SYMLINK+="mmcblk0p%n", +#KERNEL=="sdc2", SYMLINK+="root" diff --git a/fs_filecheck/opt/groomer/groomer.sh b/fs_filecheck/opt/groomer/groomer.sh index 63d11e8..7a3e989 100755 --- a/fs_filecheck/opt/groomer/groomer.sh +++ b/fs_filecheck/opt/groomer/groomer.sh @@ -23,7 +23,7 @@ clean(){ trap clean EXIT TERM INT -# Find the partition names on the source device +# Find the partition names on the device available at /dev/source_key DEV_PARTITIONS=`ls "${DEV_SRC}"* | grep "${DEV_SRC}[1-9][0-6]*" || true` if [ -z "${DEV_PARTITIONS}" ]; then echo "GROOMER: ${DEV_SRC} does not have any partitions." diff --git a/fs_filecheck/opt/groomer/mount_dest.sh b/fs_filecheck/opt/groomer/mount_dest.sh index 9753680..720ac47 100755 --- a/fs_filecheck/opt/groomer/mount_dest.sh +++ b/fs_filecheck/opt/groomer/mount_dest.sh @@ -17,7 +17,7 @@ clean(){ # Copy the temporary logfile to the destination key cp ${GROOM_LOG} "${DST_MNT}/groomer_log_dst.txt" - + # Write anything in memory to disk ${SYNC} @@ -32,13 +32,13 @@ clean(){ trap clean EXIT TERM INT -# Check that a device is available on /dev/sda +# Check that a device is available on /dev/source_key (symlinked to /dev/sda or sdb) if [ ! -b ${DEV_SRC} ]; then echo "GROOMER: Source device (${DEV_SRC}) does not exist." exit fi -# Check that a device is available on /dev/sdb +# Check that a device is available on /dev/dest_key (symlinked to /dev/sda or sdb) if [ ! -b ${DEV_DST} ]; then echo "GROOMER: Destination device (${DEV_DST}) does not exist." exit @@ -52,9 +52,9 @@ fi # uid= only works on a vfat FS. What should wedo if we get an ext* FS ? # What does this ^ comment mean? -# Mount the first partition of DST (/dev/sdb1) +# Mount the first partition of DST (/dev/dest_key1) # pmount automatically mounts on /media/ (at /media/dst in this case). -${PMOUNT} -w /dev/dest_key1 ${DST} +${PMOUNT} -w "${DEV_DST}1" ${DST} if [ ${?} -ne 0 ]; then echo "GROOMER: Unable to mount ${DEV_DST}1 on ${DST_MNT}" exit diff --git a/fs_filecheck/opt/groomer/music.sh b/fs_filecheck/opt/groomer/music.sh index 8c769f0..c57639d 100755 --- a/fs_filecheck/opt/groomer/music.sh +++ b/fs_filecheck/opt/groomer/music.sh @@ -3,7 +3,7 @@ set -e #set -x -source ./constraint.sh +source ./config.sh killed(){ echo 'Music stopped.' diff --git a/shell_utils/copy_groomer_to_image.sh b/shell_utils/copy_groomer_to_image.sh index b870687..fd1a7c1 100755 --- a/shell_utils/copy_groomer_to_image.sh +++ b/shell_utils/copy_groomer_to_image.sh @@ -2,9 +2,11 @@ set -x -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/music.sh /mnt/rpi/opt/groomer/music.sh -cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/music.sh /mnt/rpi/opt/groomer/music.sh +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/pmount.allow /mnt/rpi/etc/pmount.allow +# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/udev/rules.d/10-usb.rules /mnt/rpi/etc/udev/rules.d/10-usb.rules