Dwarfland's Rehack Script

From AwkwardTV
Jump to: navigation, search

Thought i'd share the following script file, which i use every time i uprade my ATV, to get everything set in place again. The script expects the ATC to be Patched for SSH (obviously) and all sorts of stuff (i'll try to provide a listlater, but the script actions should tell you ;) to be present in ~/Patch, to do it's install from.

Feedback and extensions appreciated.

sudo -s
cd ~/Patch

# == ATVFiles: ==
sudo sh ATVFiles-1.2.1.run

# == unzip: ==
sudo mount -uw /
sudo cp unzip /usr/bin/
sudo chmod 755 /usr/bin/unzip 

# == Perian: ==

hdiutil attach Perian_1.1.3.dmg 
sudo unzip /Volumes/Perian\ 1.1.3/Perian.prefPane/Contents/Resources/Components/Perian.zip -d /Library/QuickTime/ 
sudo unzip /Volumes/Perian\ 1.1.3/Perian.prefPane/Contents/Resources/Components/CoreAudio/A52Codec.zip -d /Library/Audio/Plug-Ins/Components/
sudo unzip /Volumes/Perian\ 1.1.3/Perian.prefPane/Contents/Resources/Components/QuickTime/AC3MovieImport.zip -d /Library/QuickTime/ 
hdiutil detach /Volumes/Perian\ 1.1.3

# == SMB Server ==
mkdir /mnt/opt
ln -s /mnt/opt /opt
tar -xvpf samba3_macports_bin.tar -C /
cp smb.conf /opt/local/etc/samba3/smb.conf
sudo /opt/local/bin/smbpasswd -a frontrow
sudo chown root:wheel /opt/local/sbin/smbd
sudo chmod 4555 /opt/local/sbin/smbd
sudo chown root:wheel /opt/local/sbin/nmbd
sudo chmod 4555 /opt/local/sbin/nmbd
#echo "/opt/local/sbin/smbd -c /opt/local/etc/samba3/smb.conf" >> /etc/rc.local

# == AFP CLient ==

cd ~/Patch/afp
sudo mount -uw /
sudo cp -R AppleShare /System/Library/Filesystems/
sudo cp -R AppleShareClientCore.framework /System/Library/Frameworks/
sudo cp mount_afp /sbin/
sudo cp pam_afpmount.so /usr/lib/pam/

cd /System/Library/Filesystems
sudo ln -s AppleShare/afpfs.kext afpfs.fs

sudo chmod -R 755 /System/Library/Filesystems/AppleShare
sudo chmod +x /sbin/mount_afp
sudo chown -R root:wheel /System/Library/Filesystems/AppleShare
sudo chown root:wheel /sbin/mount_afp
sudo chmod +s /System/Library/Filesystems/AppleShare/afpLoad 

sudo chmod 755 /usr/lib/pam/pam_afpmount.so

# == KEXT ===

sudo mount -uw /
sudo touch /.readwrite
sudo sync
#  reboot here!
sudo -s  
cd ~/Patch
chmod +x turbo_kext_enabler.bin
sudo ./turbo_kext_enabler.bin
sudo cp turbo_kext_enabler.bin /sbin
sudo rm /.readwrite
sudo sync
sudo mount -ur /

#echo "/sbin/turbo_kext_enabler.bin" >> /etc/rc.local