Move automount to a systemd service so dependencies are managed correctly.

This commit is contained in:
fewtarius 2022-10-14 16:51:45 -04:00
parent 428a8fd5ba
commit c30432f824
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
12 changed files with 31 additions and 18 deletions

View file

@ -102,6 +102,8 @@ jobs:
Download: [[Win600/x86_64](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-handheld.x86_64-${{ steps.version.outputs.version }}.img.gz)] [[RG353V/RG353P](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG353P.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG503](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG503.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG552](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351P](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351V](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351MP](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/JELOS-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)]
> RG353V users, enable "DEVICE IS RG353V" in the system settings menu after flashing.
## Upgrading
* Download and install the update online via the System Settings menu.
* If you are unable to update online

View file

@ -99,6 +99,8 @@ jobs:
Download: [[Win600/x86_64](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-handheld.x86_64-${{ steps.version.outputs.version }}.img.gz)] [[RG353V/RG353P](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG353P.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG503](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG503.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG552](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351P](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351V](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)] [[RG351MP](https://github.com/JustEnoughLinuxOS/distribution/releases/download/${{ steps.version.outputs.version }}/JELOS-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)]
> RG353V users, enable "DEVICE IS RG353V" in the system settings menu after flashing.
## Upgrading
* Download and install the update online via the System Settings menu.
## Upgrading

View file

@ -51,6 +51,7 @@ limitations under the License.
## Installation
* x86_64 versions of JELOS include an installation tool. This tool may be run from the boot menu or from within JELOS by switching to desktop mode and running "installer" in a terminal.
* RG353V users should use the RG353P image, and select "DEVICE IS RG353V" from the system settings menu in EmulationStation.
## Upgrading
* Download and install the update online via the System Settings menu.

View file

@ -3,7 +3,6 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
if [ ! -d "/storage/roms/ports/PortMaster" ]
then
mkdir -p /storage/roms/ports/PortMaster

View file

@ -125,6 +125,7 @@ post_install() {
EOF
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
enable_service jelos-automount.service
if [ -d "${PKG_DIR}/sources/asound/${DEVICE}" ]
then
@ -171,4 +172,5 @@ EOF
then
sed -i "s#ssh.enabled=0#ssh.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
fi
}

View file

@ -117,3 +117,9 @@ if [ ! -e "/storage/.config/smb.conf" ]
then
cp -f /usr/config/smb.conf /storage/.config
fi
# Merge alsa configs on 353P/V
if [[ "${HW_DEVICE}" =~ RG353P ]]
then
cp /usr/config/asound.conf /storage/.config
fi

View file

@ -9,14 +9,11 @@ UPDATE_ROOT="/storage/.update"
MOUNT_GAMES=$(get_setting system.automount)
GAMES_DEVICE=$(get_setting system.gamesdevice)
touch /storage/.mounting
if [[ ! "${MOUNT_GAMES}" =~ [0-9] ]]
then
set_setting system.automount 1
elif [[ "${MOUNT_GAMES}" == "0" ]]
then
rm /storage/.mounting
exit 0
fi
@ -26,6 +23,7 @@ mount_games() {
[ -e "${1}" ] && \
[ ! -e "/storage/.please_resize_me" ]
then
echo "Mounting ${1} on /storage/roms"
mount ${1} /storage/roms >/dev/null 2>&1
/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/jelos-dirs.conf >/dev/null 2>&1
fi
@ -41,14 +39,16 @@ find_games() {
for DEV in $(blkid | awk 'BEGIN {FS=":"}; /ext4/ || /fat/ {print $1}' | sort -r)
do
ROOTDEV=$(echo ${DEV} | sed -e "s#^/.*/##g" -e "s#p[0-9].*\$##g")
SIZE=$(awk '/'${ROOTDEV}'/ {print $3}' /proc/partitions)
if [ "${SIZE}" -le "8388608" ]
SIZE=$(awk '/'${ROOTDEV}'$/ {print $3}' /proc/partitions)
if (( ${SIZE} <= 8388608 ))
then
echo "Device ${ROOTDEV} is too small, ignoring."
# We don't want to mount partitions smaller than ~8GB.
continue
fi
if [ -L "/sys/class/block/${ROOTDEV}boot0" ]
then
echo "Device ${ROOTDEV} might be Android, ignoring."
# Assume this is an android boot device and ignore it.
continue
fi
@ -72,5 +72,3 @@ then
else
find_games
fi
i
rm /storage/.mounting

View file

@ -0,0 +1,13 @@
[Unit]
Description=JELOS user autostart script
Before=autostart.service
After=systemd-tmpfiles-setup.service
[Service]
Type=oneshot
Environment=HOME=/storage
ExecStart=-/bin/sh -c ". /etc/profile; exec /bin/sh /usr/bin/automount"
RemainAfterExit=yes
[Install]
WantedBy=jelos.target

View file

@ -9,11 +9,6 @@
set_audio alsa
export SDL_AUDIODRIVER=alsa
while [ -e "/storage/.mounting" ]
do
sleep .5
done
TZ=$(get_setting system.timezone)
echo -n "TIMEZONE=${TZ}" > /storage/.cache/timezone
echo -n "${TZ}" >/storage/.cache/system_timezone

View file

@ -9,11 +9,6 @@
set_audio alsa
export SDL_AUDIODRIVER=alsa
while [ -e "/storage/.mounting" ]
do
sleep .5
done
TZ=$(get_setting system.timezone)
echo -n "TIMEZONE=${TZ}" > /storage/.cache/timezone
echo -n "${TZ}" >/storage/.cache/system_timezone