summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-17 18:13:24 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-17 18:38:53 -0400
commit7d3e39cfd8c1ab73126fb8b626ee697334302d16 (patch)
tree361fbcd2f8bc1482e4e8c49fe8bffa7d9e88e13a /tools
parent6f9a157fcac76466df8834eb73e04d7127e78b52 (diff)
downloadrockbox-7d3e39cfd8c1ab73126fb8b626ee697334302d16.tar.gz
rockbox-7d3e39cfd8c1ab73126fb8b626ee697334302d16.tar.bz2
rockbox-7d3e39cfd8c1ab73126fb8b626ee697334302d16.zip
hiby_patcher: Fix a couple of bugs in the hotplug scripts
Change-Id: Id8782b843c626aba37a954b930f9bcaac21bc073
Diffstat (limited to 'tools')
-rwxr-xr-xtools/hiby_patcher.pl20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/hiby_patcher.pl b/tools/hiby_patcher.pl
index e8ade006b1..8218362f8d 100755
--- a/tools/hiby_patcher.pl
+++ b/tools/hiby_patcher.pl
@@ -167,12 +167,11 @@ reboot
print FILE "sd[a-z][0-9]+ 0:0 664 @ /etc/rb_inserting.sh\n";
print FILE "mmcblk[0-9]p[0-9] 0:0 664 @ /etc/rb_inserting.sh\n";
print FILE "mmcblk[0-9] 0:0 664 @ /etc/rb_inserting.sh\n";
- print FILE "sd[a-z] 0:0 664 \$ /etc/rb_removing.sh";
+ print FILE "sd[a-z] 0:0 664 \$ /etc/rb_removing.sh\n";
print FILE "mmcblk[0-9] 0:0 664 \$ /etc/rb_removing.sh\n";
close FILE;
- my $insert_sh = '
-#!/bin/sh
+ my $insert_sh = '#!/bin/sh
# $MDEV is the device
case $MDEV in
@@ -196,11 +195,20 @@ mount $MDEV $MNT_POINT
close FILE;
chmod 0755, "$rootfsdir/etc/rb_inserting.sh";
- my $remove_sh = '
-#!/bin/sh
+ my $remove_sh = '#!/bin/sh
# $MDEV is the device
+
+case $MDEV in
+ mmc*)
+ MNT_POINT=/mnt/sd_0
+ ;;
+ sd*)
+ MNT_POINT=/mnt/usb
+ ;;
+esac
+
sync;
-unmount -f $MDEV;
+umount -f $MNT_POINT || umount -f $MDEV;
';
open FILE, ">$rootfsdir/etc/rb_removing.sh" || die("can't write hotplug helpers!");