diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-12 09:28:37 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-12 13:40:24 +0000 |
commit | 9ad30869b86dd827fbbf56a67122d662a51514f5 (patch) | |
tree | 5ed776da0ecf3e8c9b00c59fbcb6e1d1c0415e86 | |
parent | 135b3f64167826a3d7c912e976128c0e77d4d439 (diff) | |
download | rockbox-9ad30869b86dd827fbbf56a67122d662a51514f5.tar.gz rockbox-9ad30869b86dd827fbbf56a67122d662a51514f5.zip |
xduoox3ii/x20: Work around a nasty OF interaction bug
...that can result in your sd card getting wiped at startup
Change-Id: I19fc9836b321adbb1df3fc741bc2593965c624f6
-rwxr-xr-x | tools/hiby_patcher.pl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/hiby_patcher.pl b/tools/hiby_patcher.pl index 86b8ad3d3f..af98cfdafc 100755 --- a/tools/hiby_patcher.pl +++ b/tools/hiby_patcher.pl | |||
@@ -140,7 +140,7 @@ print FILE $bootloader_sh; | |||
140 | close FILE; | 140 | close FILE; |
141 | chmod 0755, "$rootfsdir/usr/bin/hiby_player.sh"; | 141 | chmod 0755, "$rootfsdir/usr/bin/hiby_player.sh"; |
142 | 142 | ||
143 | # Auto mount/unmount external USB drives | 143 | # Auto mount/unmount external USB drives and SD card |
144 | open FILE, ">>$rootfsdir/etc/mdev.conf" || die ("can't access mdev conf!"); | 144 | open FILE, ">>$rootfsdir/etc/mdev.conf" || die ("can't access mdev conf!"); |
145 | print FILE "sd[a-z][0-9]+ 0:0 664 @ /etc/rb_inserting.sh\n"; | 145 | print FILE "sd[a-z][0-9]+ 0:0 664 @ /etc/rb_inserting.sh\n"; |
146 | print FILE "mmcblk[0-9]p[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; | 146 | print FILE "mmcblk[0-9]p[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; |
@@ -154,16 +154,16 @@ my $insert_sh = ' | |||
154 | # $MDEV is the device | 154 | # $MDEV is the device |
155 | 155 | ||
156 | case $MDEV in | 156 | case $MDEV in |
157 | mmc*) | 157 | mmc*) |
158 | MNT_POINT=/mnt/sd_0 | 158 | MNT_POINT=/mnt/sd_0 |
159 | ;; | 159 | ;; |
160 | sd*) | 160 | sd*) |
161 | MNT_POINT=/mnt/sd_0/USB | 161 | MNT_POINT=/mnt/sd_0/USB |
162 | ;; | 162 | ;; |
163 | esac | 163 | esac |
164 | 164 | ||
165 | if [ ! -d $MNT_POINT ];then | 165 | if [ ! -d $MNT_POINT ];then |
166 | mkdir $MNT_POINT | 166 | mkdir $MNT_POINT |
167 | fi | 167 | fi |
168 | 168 | ||
169 | mount $MDEV $MNT_POINT | 169 | mount $MDEV $MNT_POINT |
@@ -186,6 +186,9 @@ print FILE $remove_sh; | |||
186 | close FILE; | 186 | close FILE; |
187 | chmod 0755, "$rootfsdir/etc/rb_removing.sh"; | 187 | chmod 0755, "$rootfsdir/etc/rb_removing.sh"; |
188 | 188 | ||
189 | # Deal with a nasty race condition in automount scripts | ||
190 | system("perl -pni -e 's/rm -rf/#rm -Rf/;' $rootfsdir/etc/init.d/S50sys_server"); | ||
191 | |||
189 | # Copy bootloader over | 192 | # Copy bootloader over |
190 | @sysargs=("cp", "$rbbname", "$rootfsdir/usr/bin/$rbbasename"); | 193 | @sysargs=("cp", "$rbbname", "$rootfsdir/usr/bin/$rbbasename"); |
191 | system(@sysargs); | 194 | system(@sysargs); |