BreadCrumbs: Apple TV
Apple TV
From Luke Jackson
(Difference between revisions)
| Revision as of 02:10, 13 January 2008 (edit) Ljackson (Talk | contribs) ← Previous diff |
Revision as of 02:10, 13 January 2008 (edit) Ljackson (Talk | contribs) (→Testing) Next diff → |
||
| Line 1: | Line 1: | ||
| - | == Testing == | + | == Testing smbfs.kext == |
| The /System/Library/StartupItems directory is reserved for startup items that ship with Mac OS X. All other startup items should be placed in the /Library/StartupItems directory. Note that this directory does not exist by default and may need to be created during installation of the startup item. | The /System/Library/StartupItems directory is reserved for startup items that ship with Mac OS X. All other startup items should be placed in the /Library/StartupItems directory. Note that this directory does not exist by default and may need to be created during installation of the startup item. | ||
Revision as of 02:10, 13 January 2008
Testing smbfs.kext
The /System/Library/StartupItems directory is reserved for startup items that ship with Mac OS X. All other startup items should be placed in the /Library/StartupItems directory. Note that this directory does not exist by default and may need to be created during installation of the startup item.
It existed on my Apple TV so I just did the following:
sudo mkdir /Library/StartupItems/MountSystem sudo touch /Library/StartupItems/MountSystem/MountSystem sudo touch /Library/StartupItems/MountSystem/StartupParameters.plist
Add the following code to MountSystem executable:
#!/bin/sh
. /etc/rc.common
EN0=`ifconfig en0 | grep 'broadcast' | awk '{print $2}' | awk -F . '{print $3}'`
EN1=`ifconfig en1 | grep 'broadcast' | awk '{print $2}' | awk -F . '{print $3}'`
StartService() {
if [ $EN0 = 85 ] || [ $EN1 = 85 ]; then
#Load kernel extension and mount share
/sbin/turbo_kext_enabler.bin
kextload /System/Library/Extensions/smbfs.kext
mount_smbfs "//<Username>:<Password>@<IP-Address>/<Share>" /Users/frontrow/Movies/<Share>
else
echo 'Not at home!'
fi
}
StopService() {
return 0;
}
RestartService() {
return 0;
}
RunService "$1"
Add the following to StartupParameters.plist:
{
Description = "Mount System";
Provides = ("Network Shares");
Uses = ("Network");
Requires = ("Network");
OrderPreference = "Late";
}
Set permissions:
sudo chowm -R root:wheel /Library/StartupItems/MountSystem sudo chmod -R 755 /Library/StartupItems/MountSystem sudo chmod 744 /Library/StartupItems/MountSystem/StartupParameters.plist