Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

hiby: r1_patcher: add hotplug support

Change-Id: I8b82842f26ac6444b32e166308b7c5deb17fab7a

+39
+39
tools/r1_patcher/r1_patcher.sh
··· 59 59 chmod 0755 $workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh 60 60 61 61 ################################################################################ 62 + ### Rockbox Hotplug Logic 63 + ################################################################################ 64 + 65 + # 1. Create hotplug helper script 66 + cat << 'EOF' > $workingdir_in/rootfs/extracted/usr/bin/rb_hotplug.sh 67 + #!/bin/sh 68 + MNT_SD="/data/mnt/sd_0" 69 + MNT_USB="/data/mnt/usb" 70 + 71 + case "$MDEV" in 72 + mmcblk*) MNT="$MNT_SD" ;; 73 + sd*) MNT="$MNT_USB" ;; 74 + *) exit 0 ;; 75 + esac 76 + 77 + case "$ACTION" in 78 + add|"") 79 + mkdir -p "$MNT" 80 + mount -t auto -o flush,noatime "/dev/$MDEV" "$MNT" 81 + ;; 82 + remove) 83 + umount -l "$MNT" 84 + ;; 85 + esac 86 + EOF 87 + chmod 0755 $workingdir_in/rootfs/extracted/usr/bin/rb_hotplug.sh 88 + 89 + # 2. Check mdev.conf and append rules only if missing 90 + MDEV_CONF="$workingdir_in/rootfs/extracted/etc/mdev.conf" 91 + 92 + if ! grep -q "mmcblk" "$MDEV_CONF"; then 93 + echo "mmcblk[0-9]p[0-9] 0:0 660 */usr/bin/rb_hotplug.sh" >> "$MDEV_CONF" 94 + fi 95 + 96 + if ! grep -q "sd\[a-z\]" "$MDEV_CONF"; then 97 + echo "sd[a-z][0-9] 0:0 660 */usr/bin/rb_hotplug.sh" >> "$MDEV_CONF" 98 + fi 99 + 100 + ################################################################################ 62 101 ### rebuild 63 102 ################################################################################ 64 103