WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using a large USB drive to serve photos to a photoframe  (Read 71 times)

Offline MrPorcine

  • Jr. Member
  • **
  • Posts: 69
Using a large USB drive to serve photos to a photoframe
« on: December 04, 2026, 10:30:42 PM »
I'm posting this for two purposes: 1) maybe someone will find my experience useful, and 2) maybe someone can shed light on some of my obsticles.

I use feh to serve photos to the screen. This works perfectly - more about this later. feh runs under X. So the first thing is to install Xorg and feh. Use tce to do this.
Once Xorg is installed, it adds a few lines to .profile to a start an Xorg screen on boot. I don't want this, so comment out the last few lines of .profile.

PiCore will find the USB drive if it's plugged in before boot - sometimes. Add "waitusb=2" to cmdline.txt to make sure the USB drive is recognized. In my case it's found at /dev/sda1.

If you want to use a special keymap for feh, it's contained in a file called feh/keys. For feh to find this file, I've changed the default path by adding in environmental variable to where I keep it. I use this script to start X and feh. I've mount the USB drive to ~/Pictures. I've added these lines to /opt/bootlocal.sh.
Code: [Select]
if [ ! -e /home/tc/Pictures ] ; then mkdir /home/tc/Pictures ; fi
while [ `grep -q sda1 /etc/fstab` ] ; do sleep 1 ; done
mount /dev/sda1 /home/tc/Pictures
echo "mount:$?" >/home/tc/mnt_result
/home/tc/startSlide
startSlide follows. startx worked in the past, but I'm now starting X as below:
Code: [Select]
#!/bin/sh
#
#
export XDG_CONFIG_HOME=/home/tc
export DISPLAY=:0.0
Xorg -s 0 vt07 &
feh -rzFZdD 15 --min-dimension 640x480 --edit /home/tc/Pictures &
#startx /usr/local/bin/feh -rzFZdD 15 --min-dimension 640x480 --edit /home/tc/Pictures -- vt07 -s 0 &
This works, but there is a significant delay on boot. The delay turns out to be the fstab script in the boot process. Since I know ahead of time all my drives, I thought I'd just disable this script. Easily done with the cmdline addition of "nofstab". Now things are really broken!

Ok, decompress the initrd image, modify fstab to add the three drives, then add the mount points to /mnt:
fstab:
Code: [Select]
proc            /proc        proc    defaults          0       0
sysfs           /sys         sysfs   defaults          0       0
devpts          /dev/pts     devpts  defaults          0       0
tmpfs           /dev/shm     tmpfs   defaults          0       0
/dev/zram0      swap         swap    defaults          0       0
/dev/mmcblk0p1  /mnt/mmcblk0p1  vfat     users,exec,umask=000 0 0
/dev/mmcblk0p2  /mnt/mmcblk0p2  ext4     users,exec    0       0
/dev/sda1       /mnt/sda1       ext4     users,exec    0       0
And the contents of /mnt:
Code: [Select]
mmcblk0p1  mmcblk0p2  sda1also I found in the Core Book that you can specify the path the the tce directory. So I added "tce=mmcblk0p2/tce" to the command line.
Boot again - no joy! For some reason the three mount point files in /mnt are missing. This I don't understand. So as a workaround I added the files in rcS:
Code: [Select]
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012

# Mount /proc.
[ -f /proc/cmdline ] || /bin/mount /proc

# Remount rootfs rw.
/bin/mount -o remount,rw /

# Mount system devices from /etc/fstab.
if [ ! -e /mnt/mmcblk0p1 ] ; then mkdir /mnt/mmcblk0p1 ; fi
if [ ! -e /mnt/mmcblk0p2 ] ; then mkdir /mnt/mmcblk0p2 ; fi
if [ ! -e /mnt/sda1 ] ; then mkdir /mnt/sda1 ; fi

/bin/mount -a

clear

/etc/init.d/tc-config
Now all is working. Why? I have no idea!




« Last Edit: December 04, 2026, 10:32:42 PM by MrPorcine »