Results 1 to 5 of 5
Discuss [AppleTV] My 'bootscript' for Take2 at the AppleTV 1 - Hackint0sh.org; Hi, After i did this tutorial: http://wiki.awkwardtv.org/wiki/Take_2_Full_Update (with focus on paragraph 3.9.9) i wanted to ...
  1. #1
    Rookie Array cousincocaine's Avatar

    Join Date
    Apr 2007
    Posts
    23
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Post [AppleTV] My 'bootscript' for Take2

    Hi,

    After i did this tutorial: http://wiki.awkwardtv.org/wiki/Take_2_Full_Update (with focus on paragraph 3.9.9) i wanted to automate things. Thats why i build a bootscirpt. Here is my bootscript.
    I still have to run it manually (ssh) because i can't get it to work at boot (when put in rc.local the TVComposite.kext does not work).
    Not anymore thanks to 'ash'.


    You can run bash / shell scripts from your ATV menu with iScript: http://wiki.awkwardtv.org/wiki/IScripts. This script works fine with iScript.

    I post it here cause sometimes your looking for a particular script line and than these posts come in handy.

    Commends are welcome. And if you know how to create a menu item to run this script plz post it here / pm me.

    To run the bootscript remotely i use this:
    on my mac / linux / iphone machine i run my /usr/bin/atv :hack::
    Code:
    #!/bin/bash
    # made by cousinCocaine
    # RUN bootscript on server
    ssh -1 frontrow:frontrow@192.168.1.20 'sudo /usr/bin/bootscript'
    clear
    echo "AppleTV loaded the bootscript"
    echo "done"
    sleep 2
    exit
    and now the real thing
    i have this script saved in /usr/bin/bootscript :hack:

    Code:
    #!/bin/sh
    #
    # ############################# #
    # bootscript made by cousinCocaine #
    # ############################# #
    #
    # ########################################################## #
    # this script runs all your none apple boot settings at once #
    # ########################################################## #
    #
    # SETUP
    # let the script fill in the root password
    # this is unsafe but makes it noob easy.
    PW="frontrow"
    
    # SMB MOUNTPOINTS
    # the name of the disk on the remote machine
    SMB_MOUNT_1="/KoekoekMedia"
    # the folder on the disk that contains your video files
    SMB_VIDEODIR_1="Videos"
    # ip address of the remote machine
    SMB_IP_1="192.168.1.10"
    # login on the remote machine (Airport Express likes everyone!)
    SMB_USER_1="frontrow"
    # password on remote machine (Airport Express wants the correct pw)
    SMB_PW_1="password"
    
    # START SCRIPT
    echo $PW | sudo -S echo "Starting $0"
    echo $PW | sudo -S date
    
    # Make disk RW accessible. Undo this at the bottom.
    echo $PW | sudo -S mount -uw /
    echo $PW | sudo -S touch /.readwrite
    echo $PW | sudo -S sync
    echo "Root directory is mounted with write acces."
    echo ""
    
    # We need to be able to load kext files
    echo $PW | sudo -S /sbin/turbo_kext_enabler.bin 
    echo "Turbo's kext enabler loaded."
    echo ""
    
    # Load USB kext files
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/msdosfs.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/IOUSBMassStorageClass.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/AppleSMBIOS.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/IOSCSIArchitectureModelFamily.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/IOStorageFamily.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/smbfs.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/udf.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/IOHDIXController.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/ntfs.kext
    echo "USB kextfiles loaded."
    echo ""
    
    # Load TVComposite kext file
    # Unload first: If the composite kext is loaded to early it does not work
    echo $PW | sudo -S /sbin/kextunload /System/Library/Extensions/TVComposite.kext
    echo $PW | sudo -S /sbin/kextload /System/Library/Extensions/TVComposite.kext
    echo "TVComposite kextfile loaded."
    echo ""
    
    # Mount SMB disks and create there mount points and symbolic links
    # Cleanup old mountpoints.
    echo $PW | sudo -S umount -f $SMB_MOUNT_1
    echo $PW | sudo -S rm -rf $SMB_MOUNT_1
    echo $PW | sudo -S mkdir $SMB_MOUNT_1
    echo $PW | sudo -S chmod 755 $SMB_MOUNT_1
    echo $PW | sudo -S chown frontrow:frontrow $SMB_MOUNT_1
    echo "Old mountpoints are cleaned up."
    echo ""
    
    # Mount disks
    sudo mount -t smbfs //$SMB_USER_1:$SMB_PW_1@$SMB_IP_1$SMB_MOUNT_1 $SMB_MOUNT_1
    echo "SMB Disks are mounted."
    echo ""
    
    # Create symbolic links
    echo $PW | sudo -S -u frontrow ln -s $SMB_MOUNT_1/$SMB_VIDEODIR_1/* /Users/frontrow/Movies/
    echo "Symbolic links created."
    echo ""
    
    
    # Make disk Read only
    echo $PW | sudo -S rm /.readwrite
    echo $PW | sudo -S sync
    echo $PW | sudo -S mount -ur /
    echo "Root directory is mounted with read acces."
    echo ""
    
    # Leave a note to make shure we did run this script.
    echo $PW | sudo -S touch /Users/frontrow/loaded.txt
    echo $PW | sudo -S echo $0 "Loaded on:" `date` > /Users/frontrow/loaded.txt
    
    echo "Exiting $0"
    echo ""
    # end of file
    Last edited by cousincocaine; 06-19-2008 at 08:43 AM. Reason: iScript for running bash and shell scripts from within the ATV menu



  2. #2
    ash
    ash is offline
    Senior Professional Array

    Join Date
    Mar 2008
    Posts
    273
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    20

    Default

    Why don't you use nitotv to setup the kext loading within rc.local? At least with my atv 2.0.2 it does work! Though I don't use the composite kext.

    The samba mounting can also be done with nitotv:
    * http://wiki.awkwardtv.org/wiki/NitoTV_Take_2#Network
    * http://wiki.awkwardtv.org/wiki/NitoTV#Network


    ash

  3. #3
    Rookie Array cousincocaine's Avatar

    Join Date
    Apr 2007
    Posts
    23
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    i know about nitotv, that works great. but the Composite.kext does not work and i want to keep all the 'Hacks' in one place. But thnx for your thoughts.

  4. #4
    ash
    ash is offline
    Senior Professional Array

    Join Date
    Mar 2008
    Posts
    273
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    20

    Default

    You could use iScript to start your script, so you wouldn't need load the start script from another pc.

  5. #5
    Rookie Array cousincocaine's Avatar

    Join Date
    Apr 2007
    Posts
    23
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    thnx,
    iScript works great!
    http://wiki.awkwardtv.org/wiki/IScripts


 

 

Similar Threads

  1. how to install AFP on AppleTV Take2?
    By jowo in forum AppleTV 1
    Replies: 12
    Last Post: 03-07-2010, 11:50 AM
  2. [VLC] Setting up a Http Streaming on Take2
    By michael_fowler in forum AppleTV 1
    Replies: 0
    Last Post: 07-08-2008, 12:00 PM
  3. [nitoTV] Can i install/use it on Take2 ?
    By melbdean in forum AppleTV 1
    Replies: 4
    Last Post: 06-13-2008, 06:08 AM
  4. Take2 Lost Resolutions...
    By DocTauri in forum AppleTV 1
    Replies: 0
    Last Post: 04-06-2008, 12:36 AM
  5. Take2 Safe Update
    By DocTauri in forum AppleTV 1
    Replies: 6
    Last Post: 02-13-2008, 01:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 03:29 PM.
twitter, follow us!