2024-02-15 22:07:30 +01:00
|
|
|
|
|
|
|
umount_usb(){
|
|
|
|
mnt=`df -h | grep /root/usb | wc -l`
|
|
|
|
count=0
|
2024-02-15 22:07:48 +01:00
|
|
|
while [ $mnt -gt 0 -a $count -le 5 ]
|
2024-02-15 22:07:30 +01:00
|
|
|
do
|
|
|
|
umount -f /root/usb/
|
|
|
|
mnt=`df -h | grep /root/usb | wc -l`
|
|
|
|
count=`expr $count + 1`
|
|
|
|
sleep 1
|
|
|
|
if [ $count -ge 5 ];then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
umount_usb
|
|
|
|
if [ $1 == "ext4" ];then
|
2024-02-15 22:07:37 +01:00
|
|
|
if [ -b /dev/sda1 ];then
|
|
|
|
echo -e "\ny" | mkfs.ext4 -T largefile /dev/sda1
|
|
|
|
sleep 1
|
|
|
|
mount -t ext4 /dev/sda1 /root/usb
|
|
|
|
elif [ -b /dev/mmcblk0p6 ];then
|
|
|
|
echo -e "\ny" | mkfs.ext4 -T largefile /dev/mmcblk0p6
|
|
|
|
sleep 1
|
|
|
|
mount -o rw,sync,barrier=0 /dev/mmcblk0p6 /root/usb
|
|
|
|
fi
|
2024-02-15 22:07:30 +01:00
|
|
|
else
|
|
|
|
mkfs.vfat -F 32 /dev/sda1
|
|
|
|
sleep 1
|
|
|
|
mount -t vfat /dev/sda1 /root/usb
|
|
|
|
fi
|
|
|
|
|