diff --git a/src/config b/src/config index a2f0e91..56225b4 100755 --- a/src/config +++ b/src/config @@ -8,7 +8,7 @@ export BASE_IMAGE_ENLARGEROOT=2000 # if set will resize root partition on image after build to minimum size + # provided size in MB export BASE_IMAGE_RESIZEROOT=200 -export GUI_STARTUP_SCRIPT=/home/pi/scripts/run_onepageos +export GUI_STARTUP_SCRIPT=/opt/custompios/scripts/run_onepageos export RPI_IMAGER_NAME="${DIST_NAME}" export RPI_IMAGER_DESCRIPTION="A raspberrypi distro to display a full page browser on boot" diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/fullscreen b/src/modules/fullpageos/filesystem/opt/custompios/scripts/fullscreen similarity index 100% rename from src/modules/fullpageos/filesystem/home/pi/scripts/fullscreen rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/fullscreen diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/get_url b/src/modules/fullpageos/filesystem/opt/custompios/scripts/get_url similarity index 100% rename from src/modules/fullpageos/filesystem/home/pi/scripts/get_url rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/get_url diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/refresh b/src/modules/fullpageos/filesystem/opt/custompios/scripts/refresh similarity index 100% rename from src/modules/fullpageos/filesystem/home/pi/scripts/refresh rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/refresh diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/reload_fullpageos_txt b/src/modules/fullpageos/filesystem/opt/custompios/scripts/reload_fullpageos_txt similarity index 100% rename from src/modules/fullpageos/filesystem/home/pi/scripts/reload_fullpageos_txt rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/reload_fullpageos_txt diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos b/src/modules/fullpageos/filesystem/opt/custompios/scripts/run_onepageos similarity index 64% rename from src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/run_onepageos index a720fba..4fb96fb 100755 --- a/src/modules/fullpageos/filesystem/home/pi/scripts/run_onepageos +++ b/src/modules/fullpageos/filesystem/opt/custompios/scripts/run_onepageos @@ -4,7 +4,7 @@ USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Geck while true do - if [[ $(curl -sL -b cookiefile -w "%{http_code}\\n" -H "user-agent: ${USER_AGENT}" "$(/home/pi/scripts/get_url)" -o /dev/null) =~ ^([23][0-9]{2,2}|401)$ ]] || grep -q disabled "/boot/firmware/check_for_httpd" ; then + if [[ $(curl -sL -b cookiefile -w "%{http_code}\\n" -H "user-agent: ${USER_AGENT}" "$(/opt/custompios/scripts/get_url)" -o /dev/null) =~ ^([23][0-9]{2,2}|401)$ ]] || grep -q disabled "/boot/firmware/check_for_httpd" ; then xdotool mousemove 9000 9000 %BROWSER_START_SCRIPT% fi diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/safe_refresh b/src/modules/fullpageos/filesystem/opt/custompios/scripts/safe_refresh similarity index 85% rename from src/modules/fullpageos/filesystem/home/pi/scripts/safe_refresh rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/safe_refresh index 011d3bf..376efe3 100644 --- a/src/modules/fullpageos/filesystem/home/pi/scripts/safe_refresh +++ b/src/modules/fullpageos/filesystem/opt/custompios/scripts/safe_refresh @@ -2,7 +2,7 @@ # This script attempts a refresh, but only if the requested page returns successfully. -curl --fail "$(/home/pi/scripts/get_url)" &> /dev/null +curl --fail "$(/opt/custompios/scripts/get_url)" &> /dev/null curlRetr="$?" if [[ "$curlRetr" -ne "0" ]]; then diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/setX11vncPass b/src/modules/fullpageos/filesystem/opt/custompios/scripts/setX11vncPass similarity index 100% rename from src/modules/fullpageos/filesystem/home/pi/scripts/setX11vncPass rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/setX11vncPass diff --git a/src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser b/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser similarity index 78% rename from src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser rename to src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser index be0f683..be5eafa 100755 --- a/src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser +++ b/src/modules/fullpageos/filesystem/opt/custompios/scripts/start_chromium_browser @@ -14,14 +14,14 @@ flags=( ) # Standard behavior - runs chromium -chromium-browser "${flags[@]}" --app=$(/home/pi/scripts/get_url) +chromium-browser "${flags[@]}" --app=$(/opt/custompios/scripts/get_url) exit; # Remove the two lines above to enable signage mode - refresh the browser whenever errors are seen in log -chromium-browser --enable-logging --log-level=2 --v=0 "${flags[@]}" --app=$(/home/pi/scripts/get_url) & +chromium-browser --enable-logging --log-level=2 --v=0 "${flags[@]}" --app=$(/opt/custompios/scripts/get_url) & -export logfile="/home/pi/.config/chromium/chrome_debug.log" +export logfile="/home/$(id -nu 1000)/.config/chromium/chrome_debug.log" # Refreshes after a crash by watching logs @@ -29,6 +29,6 @@ tail -n 0 -F "$logfile" | while read LOGLINE &> /dev/null; do echo "Refreshing after crash" echo "Restarting at `date` after a reported crash. Logline: ${LOGLINE}" >> /tmp/crashlog - [[ ("${LOGLINE}" == *"ERROR"*) || ("${LOGLINE}" == *"FATAL"*) ]] && /home/pi/scripts/refresh + [[ ("${LOGLINE}" == *"ERROR"*) || ("${LOGLINE}" == *"FATAL"*) ]] && /home/$(id -nu 1000)/scripts/refresh done diff --git a/src/modules/fullpageos/start_chroot_script b/src/modules/fullpageos/start_chroot_script index 5dbe898..933babe 100755 --- a/src/modules/fullpageos/start_chroot_script +++ b/src/modules/fullpageos/start_chroot_script @@ -9,7 +9,7 @@ set -e source /common.sh -unpack /filesystem/home/pi /home/pi pi +unpack /filesystem/opt /opt unpack /filesystem/boot /"${BASE_BOOT_MOUNT_PATH}" unpack /filesystem/root_init / @@ -37,7 +37,7 @@ apt-get -y --force-yes install git screen checkinstall avahi-daemon libavahi-com if [ "$FULLPAGEOS_INCLUDE_CHROMIUM" == "yes" ] then apt-get install -y --force-yes chromium-browser - sudo -u pi sed -i 's@%BROWSER_START_SCRIPT%@/home/pi/scripts/start_chromium_browser@g' /home/pi/scripts/run_onepageos + sed -i 's@%BROWSER_START_SCRIPT%@/opt/custompios/scripts/start_chromium_browser@g' /opt/custompios/scripts/run_onepageos fi #Install web stack @@ -124,11 +124,11 @@ then # Set x11vnc password if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" != "default" ] then - sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" + sudo -u pi /opt/custompios/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" sync if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created. Trying again." - sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" + sudo -u pi /opt/custompios/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" sync if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created again. Giving up." @@ -137,11 +137,11 @@ then fi fi else - sudo -u pi /home/pi/scripts/setX11vncPass raspberry + sudo -u pi /opt/custompios/scripts/setX11vncPass raspberry sync if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created. Trying again." - sudo -u pi /home/pi/scripts/setX11vncPass raspberry + sudo -u pi /opt/custompios/scripts/setX11vncPass raspberry sync if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created again. Giving up." @@ -156,8 +156,8 @@ then systemctl enable x11vnc.service fi -#echo "sudo -u pi startx /home/pi/scripts/run_onepageos &" >> /etc/rc.local -#echo "(sleep 15 ; sudo -u pi /home/pi/scripts/fullscreen) &" >> /etc/rc.local +#echo "sudo -u pi startx /opt/custompios/scripts/run_onepageos &" >> /etc/rc.local +#echo "(sleep 15 ; sudo -u pi /opt/custompios/scripts/fullscreen) &" >> /etc/rc.local ##################################################################### ### setup services