Dude, this is freakin' awesome! Thanks a lot for you effort.
For users who mount and unmount their EFI partition a lot, I've attached a collection of scripts for easy access
If you want, you can include them in your download archive.
They should go to /usr/bin or /usr/local/bin or wherever you like them.
Here's what the scripts do:
- mcsmart
For users who mount and unmount their EFI partition a lot, I've attached a collection of scripts for easy access
They should go to /usr/bin or /usr/local/bin or wherever you like them.
Here's what the scripts do:
- efimount
- determines your root-disk (even in safe mode!)
- creates /Volumes/EFI
- mounts /Volumes/EFI
- efiumount
- repairs permissions in /Volumes/EFI/Extensions (you just need to dump your kexts there, that's it)
- executes /Volumes/EFI/update.sh
- unmounts /Volumes/EFI
- mcsmart
I would suggest two things if you are going to release these scripts for use. I know we all know these need to be executed as root, but I have seen several comments from people that had problems because they ran them as regular users. So, that should be checked.
The other thing that happens is the efi partition sometimes gets corrupted in such a way that it won't mount until it is checked. The code below is what I use in my mount script. use it if you wish.
CODE
# Make sure the user is Root
if [ $USER != "root" ]; then
echo "Error ==> This script must be run as root"
exit
fi
# Make sure the EFI partition file system is clean
fsck_hfs /dev/$diskID
if [ $USER != "root" ]; then
echo "Error ==> This script must be run as root"
exit
fi
# Make sure the EFI partition file system is clean
fsck_hfs /dev/$diskID
I used a variable for diskID because I frequently work on an efi partition other than the one I booted from. There is my test partition and my emergency boot/maintenance partition both of which use efi partitions to boot.
A combination of your technique and mine could be used with a simple command line parameter and an if statement. Given a numeric parameter combine it with "disk$1s1" to make the drive ID, and if there is no parameter use your code as the default.
Just a thought.
btw: thanks for sharing - I should have done the same
