Pretty sweet man.  Good job, I'll definitely look into implementing
this in my setup.

On Jan 15, 6:34 pm, dkeefe <[email protected]> wrote:
> I've been experimenting with different boot menu (for example kexec-
> loader) but couldn't get them working.  Finally I realized that the
> boot_linux.sh script is just a bash script and I could make a menu
> using bash commands.
>
> So here you go.  It is pretty self explanatory.  There is a optional
> default choice and a configurable timeout.  Crude, but it works.
>
> ---------------
>
> #!/bin/bash
>
> # selection timeout in seconds.  set to 0 to wait forever.
> TIMEOUT=3
>
> # default selection
> DEFAULT=1
>
> VALID=0
>
> while [ $VALID -ne 1 ]; do
>
>         echo
>         echo "    Apple TV Boot Menu"
>         echo
>         echo "    1.  Boot from USB (default)"
>         echo "    2.  Exit"
>         echo
>
>         CHOICE=$DEFAULT
>         if [ $TIMEOUT -ne 0 ]; then
>                 read -n 1 -p "    Selection: " -t $TIMEOUT CHOICE
>         else
>                 read -n 1-p "    Selection: " CHOICE
>         fi
>
>         case $CHOICE in
>                 [1-2])
>                         VALID=1
>                         echo
>                         ;;
>         esac
> done
>
> case $CHOICE in
>         1)
>                 echo
>                 echo "    Booting from Hard Disk..."
>                 echo
>                 if [ ! -d /mnt ]; then
>                         mkdir /mnt
>                 fi
>                 mount /dev/sdb1 /mnt
>
> # put your kexec commands here
>
>                 #kexec --load /mnt/casper/vmlinuz --initrd=/mnt/initrd.img 
> --command-
> line="preseed/umpc.seed initrd=initrd.img boot=casper quiet splash
> noprompt persistent video=vesafb"
>                 #kexec --load /mnt/boot/vmlinuz --initrd=/mnt/boot/initrd.gz 
> --
> command-line="root=/dev/ram0 rw rdinit=linuxrc boot=cdrom lang=en
> remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789
> video=vesafb:ywrap,mtrr"
>                 #kexec --load /mnt/vmlinuz --initrd=/mnt/initrd0.img 
> --command-
> line="initrd=initrd0.img boot=usb xbmc=nvidia video=vesafb"
>                 kexec --load /mnt/install/vmlinuz 
> --initrd=/mnt/install/initrd.gz --
> command-line="preseed/ubuntu.seed initrd=install/initrd.gz
> video=vesafb"
>
>                 kexec -e
>                 ;;
>         2)
>                 echo
>                 ;;
> esac
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
For more options, visit this group at
http://groups.google.com/group/atv-bootloader?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to