upgraded busybox, activated ntpd, activated mdev, added hotplug scripts for USB storage - /media, added sbin paths to dropbear
This commit is contained in:
26
fs-add/sbin/sd-hotplug.sh
Executable file
26
fs-add/sbin/sd-hotplug.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
BLKID=$(/sbin/blkid /dev/$MDEV)
|
||||
eval ${BLKID#*:}
|
||||
if [ -n "$LABEL" ]; then
|
||||
MOUNT_POINT=/media/$LABEL
|
||||
else
|
||||
MOUNT_POINT=/media/$MDEV
|
||||
fi
|
||||
|
||||
logger -p local0.notice "Mounting $MDEV : $MOUNT_POINT"
|
||||
|
||||
mkdir -p "$MOUNT_POINT"
|
||||
|
||||
for fs_type in vfat msdos ; do
|
||||
if $(mount -t $fs_type -o umask=0 /dev/$MDEV "$MOUNT_POINT" 2>/dev/null) ; then
|
||||
logger -p local0.notice "... $MDEV mounted using $fs_type filesystem"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
for fs_type in ext4 ext3 ext2 ; do
|
||||
if $(mount -t $fs_type /dev/$MDEV "$MOUNT_POINT" 2>/dev/null) ; then
|
||||
logger -p local0.notice "... $MDEV mounted using $fs_type filesystem"
|
||||
exit 0
|
||||
fi
|
||||
done
|
14
fs-add/sbin/sd-hotunplug.sh
Executable file
14
fs-add/sbin/sd-hotunplug.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
logger -p local0.notice "Unmounting $MDEV"
|
||||
|
||||
for MOUNT_POINT in /media/* ; do
|
||||
if test -d "$MOUNT_POINT"; then
|
||||
d=$(mountpoint -n "$MOUNT_POINT" 2> /dev/null | cut -d ' ' -f 1)
|
||||
if test "$d" = "$MDEV" -o "$d" = "UNKNOWN"; then
|
||||
logger -p local0.notice "Unmounting $MDEV : $MOUNT_POINT"
|
||||
umount -f "$MOUNT_POINT"
|
||||
rmdir "$MOUNT_POINT"
|
||||
fi
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user