Talk:FreeLinkomatix

FreeLinkomatix

 * 1) ! /bin/bash
 * 2)  ___                _    _       _                       _    _             #
 * | __>_ _ ___  ___ | |  <_>._ _ | |_   ___ ._ _ _  ___ _| |_ <_>__          #
 * | _>| _>/ ._>/ ._>| |_ | || | || / / / . \| | | |<_> | | |  | |\ \/        #
 * |_| |_| \___.\___.|___||_||_|_||_\_\ \___/|_|_|_|<___| |_|  |_|/\_\        #
 * 1) FreeLinkomatix is a tool for the Debian version of Linux used on the        #
 * 2) Buffalo LinkStation called FreeLink. This tool is designed to automate      #
 * 3) the addition of applications, libraries, and the upgrade to a v2.6 kernel   #
 * 4) which is not provided directly in the FreeLink distribution                 #
 * 5) The script is kept on the LinkStation wiki in the talk page:                #
 * 6)        http://www.linkstationwiki.net/index.php?title=Talk:FreeLinkomatix   #
 * 7) A full Description of the Project is at:                                    #
 * 8)        http://linkstationwiki.net/index.php?title=FreeLinkomatix            #
 * 1)        http://www.linkstationwiki.net/index.php?title=Talk:FreeLinkomatix   #
 * 2) A full Description of the Project is at:                                    #
 * 3)        http://linkstationwiki.net/index.php?title=FreeLinkomatix            #
 * 1) A full Description of the Project is at:                                    #
 * 2)        http://linkstationwiki.net/index.php?title=FreeLinkomatix            #
 * 1)        http://linkstationwiki.net/index.php?title=FreeLinkomatix            #

wget http://downloads.linkstationwiki.net/Installers/Freelinkomatix/freelinkomatix.sh -O newest if ! diff freelinkomatix.sh newest >> /dev/null ; then rm newest clear echo "There is a newer version of FreeLinkomatix available" echo "****************************************************" echo " get it from:" echo " " echo " http://downloads.linkstationwiki.net/Installers/Freelinkomatix/freelinkomatix.sh" exit 1 else rm newest fi

clear echo 'Ping ns1.isi.edu to see if you are connected to the internet' echo ' ' echo '**This may take a few moments so be patient**' echo ' ' if ping -q -c 10 192.228.79.201 ; then echo ' use on b.root-servers.net' if ! ping -q -c 1 b.root-servers.net | grep 192.228.79.201  ; then echo 'adding nameserver 217.115.138.24 to /etc/resolv.conf' echo 'nameserver 217.115.138.24' >> /etc/resolv.conf else grep nameserver /etc/resolv.conf echo 'works fine' fi else echo 'Are you connected to the internet?' exit 1 fi
 * 1) See if we are connected to the internet and DNS works                       #
 * 1) See if we are connected to the internet and DNS works                       #


 * 1) First do a quick check to see that you are running a PPC or MIPS based      #
 * 2) Linkstation. Set some enviornment variables we can use later                #
 * 1) Linkstation. Set some enviornment variables we can use later                #

ERROR="1" uname -m | grep -q ppc && ERROR="0" uname -m | grep -q arm && ERROR="0" uname -m | grep -q mips && ERROR="0"

if [ "$ERROR" == "1" ] ; then echo "" echo "FATAL: Currently, only PPC, ARM and MIPSel based Linkstations are supported." echo "--> Cannot continue." echo "" exit 1 fi

uname -m | grep -q ppc && PROCESSOR="ppc" uname -m | grep -q arm && PROCESSOR="arm" uname -m | grep -q mips && PROCESSOR="mips" uname -r | grep -q "2.4.17_mvl21-sandpoint" && FLAVOR="ls1" uname -r | grep -q "2.4.20_mipsel_linkstation" && FLAVOR="ls2" uname -r | grep -q "2.4.20_mvl31-ppc_linkstation" && FLAVOR="hg" uname -r | grep -q "2.4.17_kuro-box" && FLAVOR="kb" uname -r | grep -q "2.4.20_mvl21" && FLAVOR="hg" uname -r | grep "2.6" | grep kurobox | grep -q -v HG && FLAVOR="ls1" uname -r | grep "2.6" | grep kurobox | grep -q HG && FLAVOR="hg" uname -r | grep "2.6" | grep arm | grep -q LS-GL && FLAVOR="gl"
 * 1) Recognize and set processor variable
 * 1) Recognize Kernel 2.4 LinkStation Flavors
 * 1) Recognize Kernel 2.6 LinkStation Flavors


 * 1) Then do a quick check to make sure you have apt-get this should weed out the #
 * 2) Openlink users too                                                          #
 * 1) Openlink users too                                                          #

apt-get -v | grep -q dpkg || ERROR="1" if [ "$ERROR" == "1" ] ; then echo "" echo "FATAL: Do you have apt-get installed, is this Debian(FreeLink)?" echo "--> Cannot continue." echo "" exit 1 fi

clear echo " ___                _    _       _                       _    _      " echo " | __>_ _ ___  ___ | |  <_>._ _ | |_   ___ ._ _ _  ___ _| |_ <_>__   " echo " | _>| _>/ ._>/ ._>| |_ | || | || / / / . \| | | |<_> | | |  | |\ \/ " echo " |_| |_| \___.\___.|___||_||_|_||_\_\ \___/|_|_|_|<___| |_|  |_|/\_\ " echo ' ' echo "FreeLinkomatix is a tool for the Debian version of Linux used on the" echo "Buffalo LinkStation called FreeLink. This tool is designed to automate" echo "the addition of applications, libraries, and the upgrade to a v2.6 kernel" echo " " echo "The following will automatically be installed:" echo " 1. Update apt-repositories...." echo " 2. Install DHCP-3 client if not present" echo " 3. Move /home /usr /var from hda1 to hda3 and create symlinks" echo " 4. Install Samba" echo " 5. Troubleshooting Windows shares (samba) - guest access" echo " 6. Install Webmin 1.3 and StressFree Solutions Tiger Webmin Theme" echo " 7. Allow all IPs for Webmin" echo " 8. Install SSH SSHd and the associated Webmin module" echo " 9. Install ProFTPd and Webmin module" echo "10. Configure the time zone and use NTPdate" echo "11. Install the Precompiled C development environment" echo "12. Upgrade to Kernel 2.6 using Andre's web installer (PPC Only)" echo " " echo -n "Proceed? (y/n)" read -e ANSWER if [ "$ANSWER" == "n" ] ; then exit 1 fi clear echo "Update apt-repositories" echo "---" echo " In Debian new programs can easily be added by using the APT repository" echo " You will have to update this repository first over the internet" echo " " echo " " echo "***This will be done automatically in a few moments***" sleep 2 apt-get update apt-get dist-upgrade -y
 * 1) Let's get started then.....                                                 #
 * 1) Let's get started then.....                                                 #
 * 1) Update apt-repositories....                                                 #
 * 1) Update apt-repositories....                                                 #
 * 1) apt-get upgrade


 * 1) Install DHCP-3 client if not present                                        #
 * 1) Install DHCP-3 client if not present                                        #

dpkg --purge dhcpcd apt-get -y install dhcp3-client


 * 1) (ppc/mips) Move /home /usr /var from hda1 to hda3 and create symlinks       #
 * 2) (arm)     Move /home /usr  from sda1 to sda6 and create symlinks            #
 * 1) (arm)     Move /home /usr  from sda1 to sda6 and create symlinks            #

if ls -l / | grep /mnt > /dev/null ; then echo "you already moved root directories to /mnt" else clear echo " " if [ "$PROCESSOR" == "arm" ] ; then echo "Move /home /usr from sda1 to sda6 and create symlinks" echo "---" echo " Eventually you will probably run out of hard drive space on hda1 " echo " (the location of the OS, and the default location of installed programs)," echo " You can free up space by moving some of the files to hda3 " echo " (the large partition containing the network shares) by moving:" else echo "Move /home /usr /var from hda1 to hda3 and create symlinks" echo "---" echo " Eventually you will probably run out of hard drive space on hda1 " echo " (the location of the OS, and the default location of installed programs)," echo " You can free up space by moving some of the files to hda3 " echo " (the large partition containing the network shares) by moving:" echo " " fi if [ "$PROCESSOR" == "ppc" ] ; then echo " /home to /mnt/home" echo " /usr to  /mnt/usr" echo " /var to  /mnt/var" fi if [ "$PROCESSOR" == "mips" ] ; then echo " /home to /mnt/hda/home" echo " /usr to /mnt/hda/usr" echo " /var to /mnt/hda/var" fi if [ "$PROCESSOR" == "arm" ] ; then echo " /home to /mnt/disk1/home" echo " /usr to /mnt/disk1/usr" fi if [ "$PROCESSOR" == "arm" ] ; then echo " " echo " And creating symlinks. You will rapidly run out of space in debian" echo " unless you do something to free up space on sda1" echo " " echo " " sleep 2

DIR="$(mount | grep sda6 | awk '{print $3}')" cp -Rdp /home ${DIR} rm -R  /home ln -s ${DIR}/home /home cp -Rdp /usr ${DIR} rm -R  /usr ln -s ${DIR}/usr /usr # currently not working because of some nfs-related files in /var/lib/nfs #cp -Rdp /var ${DIR} #rm -R  /var #ln -s ${DIR}/var /var else

echo " " echo " And creating symlinks. You will rapidly run out of space in debian" echo " unless you do something to free up space on hda1" echo " " echo " " sleep 2 DIR="$(mount | grep hda3 | awk '{print $3}')" cp -Rdp /home ${DIR} rm -R  /home ln -s ${DIR}/home /home cp -Rdp /usr ${DIR} rm -R  /usr ln -s ${DIR}/usr /usr cp -Rdp /var ${DIR} rm -R  /var ln -s ${DIR}/var /var fi fi


 * 1) Enable the Debian unstable Branch                                           #
 * 2) clear
 * 3) echo " "
 * 4) echo "Get access to packages from the Debian unstable branch"
 * 5) echo "--"
 * 6) echo " It is often useful to have access to the Debian unstable branch"
 * 7) echo " because it has some interesting packages like PHP5 and rTorrent"
 * 8) echo " Using the unstable packages saves you the time you would spend"
 * 9) echo " compiling, The good thing is you don't have to change your whole"
 * 10) echo " installation to unstable you can simply use your stable or testing"
 * 11) echo " repository and just use the packages not in there from the unstable"
 * 12) echo " repository."
 * 13) echo " "
 * 14) echo " "
 * 15) echo -n "Do you want to gain access to the Debian unstable branch? (y/n)"
 * 16) read -e ANSWER
 * 17) if [ "$ANSWER" == "y" ] ; then
 * 18) echo 'APT::Default-Release' >> /etc/apt/apt.conf
 * 19) echo '"stable"; ' >> /etc/apt/apt.conf
 * 20) echo "deb http://http.us.debian.org/debian unstable main contrib non-free " >> /etc/apt/sources.list
 * 21) echo "deb-src http://http.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list
 * 22) apt-get update
 * fi
 * 1) apt-get update
 * fi

clear echo " " echo "Install Samba" echo "" echo " Samba is a free software implementation of Microsoft's networking" echo " protocol released under the GNU General Public License. As of version 3" echo " Samba not only provides file and print services for various Microsoft" echo " Windows clients" echo " " echo " " sleep 2 apt-get install samba smbfs
 * 1) Install Samba                                                               #
 * 1) Install Samba                                                               #

clear echo " " echo "Troubleshooting Windows shares (samba) - guest access" echo "-"
 * 1) Troubleshooting Windows shares (samba) - guest access                       #
 * 1) Troubleshooting Windows shares (samba) - guest access                       #

if [ "$PROCESSOR" == "ppc" ] ; then echo " This will pick a directory /mnt/share and change the access" fi if [ "$PROCESSOR" == "mips" ] ; then echo " This will pick a directory /mnt/hda/share and change the access" fi if [ "$PROCESSOR" == "arm" ] ; then echo " This will pick a directory /mnt/disk1/share and change the access" fi

echo " permissions to make it readable and writable to everybody." echo " " echo " YOU MAY NOT WANT TO DO THIS AND INSTEAD WISH TO CONFIGURE" echo " SAMBA WITH WEBMIN OR MANUALLY EDIT /etc/samba/smb.conf" echo " YOUR smb.conf WILL BE MOVED TO smb.conf.backup" echo " " echo -n "Do you want to enable guest access for Samba? (y/n)" read -e ANSWER

WORKGROUP="WORKGROUP" LINKSTATION="LinkStation" if [ "$ANSWER" == "y" ] ; then echo " "
 * 1)  echo -n "What is your windows workgroup name ie: MSHOME or WORKGROUP? (Default will be WORKGROUP)"
 * 2)  read -e WORKGROUP
 * 3)  if [ "$WORKGROUP" == "" ] ; then
 * 4)     WORKGROUP="WORKGROUP"
 * 5)  fi
 * 6)  echo " "
 * 7)  echo -n "What do you want the name of your linkstation to be on the network (Default will be LinkStation)"
 * 8)  read -e LINKSTATION
 * 9)  if [ "$LINKSTATION" == "" ] ; then
 * 10)     LINKSTATION="LinkStation"
 * 11)  fi
 * 12)  hostname $LINKSTATION
 * 13)  rm /tmp/file
 * 14)  echo "127.0.0.1 "  $LINKSTATION >> /tmp/file
 * 15)  grep -v 127.0.0.1  /etc/hosts >> /tmp/file
 * 16)  cat /tmp/file > /etc/hosts

if [ "$PROCESSOR" == "ppc" ] ; then mkdir /mnt/share chmod 777 /mnt/share mv -i /etc/samba/smb.conf /etc/samba/smb.conf.backup echo '' >> /etc/samba/smb.conf echo '[global] ' >> /etc/samba/smb.conf echo ' security = share ' >> /etc/samba/smb.conf echo ' workgroup =' $WORKGROUP >> /etc/samba/smb.conf echo ' create mode = 777 ' >> /etc/samba/smb.conf echo ' directory mode = 777 ' >> /etc/samba/smb.conf echo ' ' >> /etc/samba/smb.conf echo '[share] ' >> /etc/samba/smb.conf echo ' comment = LinkStation Share ' >> /etc/samba/smb.conf echo ' path = /mnt/share ' >> /etc/samba/smb.conf echo ' read only = no ' >> /etc/samba/smb.conf echo ' public = yes ' >> /etc/samba/smb.conf /etc/rc.d/init.d/samba restart fi if [ "$PROCESSOR" == "mips" ] ; then mkdir /mnt/hda/share chmod 777 /mnt/hda/share mv -i /etc/samba/smb.conf /etc/samba/smb.conf.backup echo '' >> /etc/samba/smb.conf echo '[global] ' >> /etc/samba/smb.conf echo ' security = share ' >> /etc/samba/smb.conf echo ' workgroup =' $WORKGROUP >> /etc/samba/smb.conf echo ' create mode = 777 ' >> /etc/samba/smb.conf echo ' directory mode = 777 ' >> /etc/samba/smb.conf echo ' ' >> /etc/samba/smb.conf echo '[share] ' >> /etc/samba/smb.conf echo ' comment = LinkStation Share ' >> /etc/samba/smb.conf echo ' path = /mnt/hda/share ' >> /etc/samba/smb.conf echo ' read only = no ' >> /etc/samba/smb.conf echo ' public = yes ' >> /etc/samba/smb.conf /etc/rc.d/init.d/samba restart fi if [ "$PROCESSOR" == "arm" ] ; then mkdir /mnt/disk1/share chmod 777 /mnt/disk1/share mv -i /etc/samba/smb.conf /etc/samba/smb.conf.backup echo '' >> /etc/samba/smb.conf echo '[global] ' >> /etc/samba/smb.conf echo ' security = share ' >> /etc/samba/smb.conf echo ' workgroup =' $WORKGROUP >> /etc/samba/smb.conf echo ' create mode = 777 ' >> /etc/samba/smb.conf echo ' directory mode = 777 ' >> /etc/samba/smb.conf echo ' ' >> /etc/samba/smb.conf echo '[share] ' >> /etc/samba/smb.conf echo ' comment = LinkStation Share ' >> /etc/samba/smb.conf echo ' path = /mnt/disk1/share ' >> /etc/samba/smb.conf echo ' read only = no ' >> /etc/samba/smb.conf echo ' public = yes ' >> /etc/samba/smb.conf /etc/rc.d/init.d/samba restart fi fi

clear echo " " echo "Install Webmin 1.3 and StressFree Solutions Tiger Webmin Theme" echo "" echo " Webmin is a system configuration tool for Unix-like systems. It" echo " has a web-based interface (GUI) desktop environment independent, for" echo " configuring some of the internals of the operating system." echo " Webmin is largely based on Perl, and is running as its own process" echo " and webserver. It usually uses TCP port 10000 for communicating " echo " " echo " The Tiger webmin theme features a completely new graphical look," echo " high colour icons, dropdown menus and an AJAX search tool for " echo " locating Webmin modules quickly. It has been tested in Firefox," echo " Safari and Internet Explorer." echo " " echo "    Find out more here: http://www.stress-free.co.nz/webmin-theme" echo " " sleep 2
 * 1) Install Webmin 1.3 and StressFree Solutions Tiger Webmin Theme              #
 * 1) Install Webmin 1.3 and StressFree Solutions Tiger Webmin Theme              #

apt-get install webmin webmin-core webmin-cpan webmin-inetd webmin-logrotate webmin-firewall apt-get install webmin-samba apt-get install perl libnet-ssleay-perl  openssl libauthen-pam-perl libpam-runtime libio-pty-perl wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://mesh.dl.sourceforge.net/sourceforge/webadmin/webmin_1.300_all.deb wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/freelinkomatix/webmin_1.300_all.deb dpkg -i webmin_1.300_all.deb wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://www.stress-free.co.nz/files/theme-stressfree.tar.gz wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c  http://downloads.linkstationwiki.net/freelinkomatix/theme-stressfree.tar.gz  tar -C /usr/share/webmin -xvzf theme-stressfree.tar.gz   sed -e 's@^preroot.*$@preroot=theme-stressfree@ ; s@^allow.*$@@' < /etc/webmin/miniserv.conf > /tmp/file cat /tmp/file > /etc/webmin/miniserv.conf sed -e 's@^theme.*$@theme=theme-stressfree@' < /etc/webmin/config > /tmp/file cat /tmp/file > /etc/webmin/config /etc/webmin/restart

clear echo " " echo "Allow all IP addresses for Webmin" echo "-" echo " By default Webmin will only allow 127.0.0.1 (localhost) to login." echo " You will have to change /etc/webmin/miniserv.conf to allow at" echo " least one external computer access to log into webmin. " echo " " echo " This script will allow any external IP to login. It's a big security" echo " hole though so after you login to webmin, change the allowed IP" echo " addresses by going to:" echo " " echo "           Webmin Configuration --> IP Access Control" echo " " echo " OR you can just edit /etc/webmin/miniserv.conf and change the line:" echo " " echo "                      allow= 127.0.0.1" echo " " echo "   to what you need and answer no to the following prompt:" echo " " sleep 2
 * 1) Allow all IPs for Webmin                                                    #
 * 1) Allow all IPs for Webmin                                                    #


 * 1) cat /etc/webmin/miniserv.conf | grep -v allow=  > /tmp/file
 * 2) cat /tmp/file > /etc/webmin/miniserv.conf
 * 3) /etc/webmin/stop
 * 4) sleep 2
 * 5) /etc/webmin/start

clear echo " " echo "Install SSH SSHd and the associated Webmin module" echo "-" echo " SSH is a set of standards and an associated network protocol" echo " that allows establishing a secure channel between a local and" echo " a remote computer. SSH is typically used to log into a remote" echo " machine and execute commands, but it also supports tunneling," echo " forwarding arbitrary TCP ports and X11 connections; it can" echo " transfer files using the associated SFTP or SCP protocols." echo " An SSH server (SSHd), by default, listens on the standard" echo " TCP port 22." echo " " echo " By using SSHd on the LinkStation and a client such as PuTTY" echo " you can create a secure replacement for Telnet, you can remove" echo " Telnetd at a later time when you are sure that SSHd works with" echo " the command:" echo " " echo "               rm /etc/rc2.d/S05utelnetd" echo " " sleep 2 apt-get install ssh webmin-sshd
 * 1) Install SSH SSHd and the associated Webmin module                           #
 * 1) Install SSH SSHd and the associated Webmin module                           #

clear echo " " echo "Install ProFTPd" echo "---" echo " ProFTPd is an FTP server. It is stable and secure when configured" echo " properly. This will also install the Webmin module that you can" echo " use to configure ProFTPd from within Webmin" echo " " sleep 2 apt-get install webmin-proftpd proftpd proftpd-common proftpd-doc
 * 1) Install ProFTPd and Webmin module                                          #
 * 1) Install ProFTPd and Webmin module                                          #

clear echo " " echo "Configure the time zone and use NTPdate" echo "---" echo " The ntpd (Network Time Protocol daemon) program is an operating" echo " system daemon which sets and maintains the system time of day in" echo " synchronism with time servers". echo " First you will have to configure your time zone (tzconfig)" echo " This script with also make it a cron job to resynchronize" echo " on an hourly basis" echo " " echo " " sleep 2 tzconfig apt-get install ntp ntp-simple ntp-server ntpdate /etc/init.d/ntpdate restart echo '17 *   * * *   root    /etc/init.d/ntpdate restart' >> /etc/crontab
 * 1) Configure the time zone and use NTPdate                                     #
 * 1) Configure the time zone and use NTPdate                                     #

if gcc --help | grep options  > /dev/null ; then echo "you already installed a C compiler" else clear if [ "$PROCESSOR" == "arm" ] ; then echo " " echo "Install Precompiled C development environment" echo "-" echo " The LinkStation lacks virtually all necessary development tools" echo " such as binutils or gcc, making it quite difficult to natively compile" echo " programs. The development tools for arm are still in development itself" echo " and are not available for public usage." else echo " " echo "Install Precompiled C development environment" echo "-" echo " The LinkStation lacks virtually all necessary development tools" echo " such as binutils or gcc, making it quite difficult to natively compile" echo " programs. This provides a complete package of precompiled development" echo " tools and related libraries." echo " " echo " These tools come from http://www.linkstationwiki.net" echo " " sleep 2 if [ "$PROCESSOR" == "ppc" ] ; then mkdir tmpdevel cd tmpdevel wget http://downloads.linkstationwiki.net/ALL_PPC/ppc-tools-2_1.tgz mkdir devtools cd devtools tar xzvf ../ppc-tools-2_1.tgz ./install.sh        if [ "$FLAVOR" == "hg" ] ; then wget http://downloads.linkstationwiki.net/LSHG_PPC/Kernel/Headers/kernel-headers-2.4.20_hglan_htgl-2.0.tgz tar -C / -xvzf kernel-headers-2.4.20_hglan_htgl-2.0.tgz fi         fi      if [ "$PROCESSOR" == "mips" ] ; then mkdir tmpdevel cd tmpdevel wget http://downloads.linkstationwiki.net/LS2_MIPSel/DevelopmentTools/NativeToolchains/mipsel-tools-2_1.tgz mkdir devtools cd devtools tar xzvf ../mipsel-tools-2_1.tgz ./install.sh     fi      cd .. cd .. rm -r tmpdevel fi fi
 * 1) Install the Precompiled C development environment                           #
 * 1) Install the Precompiled C development environment                           #

if [ "$PROCESSOR" == "ppc" ] ; then clear echo " " echo "Upgrade to Kernel 2.6 using Andre's web installer" echo "-" echo " Upgrade from Buffalo's outdated kernel 2.4, currently included" echo " in the Debian (FreeLink) release, on LS1, HG, HS, KuroBox, and" echo " KuroHG. The 2.6 Kernel addresses virtually all shortcomings of" echo " the LS stock kernels: Very good USB support, NFS, routing, quotas" echo " lots more." echo " The 550+ modules are optional -- you could delete them if you're" echo " short of disk space, as the "LS core functions", support for mass" echo " storage devices and printing, have been compiled into the kernel" echo " " echo " Find out more at: http://hvkls.dyndns.org/downloads/documentation/" echo " " echo "      *****YOU WILL HAVE TO REBOOT AFTER THIS*****" echo " " sleep 2 wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/Installers/Webinstaller/latest-webinstaller.tar.gz wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://hvkls.dyndns.org/downloads/latest-webinstaller.tar.gz  tar -C / -xvzf latest-webinstaller.tar.gz  /usr/local/sbin/webinstaller-kernelinst.sh fi
 * 1)        Upgrade to Kernel 2.6 using Andre's web installer                    #
 * 2)                       System will REBOOT after this                         #
 * 3)               This should always be the last action of this script          #
 * 1)               This should always be the last action of this script          #

Post Install Script

 * 1) ! /bin/bash
 * 2)  ___                _    _       _                       _    _             #
 * | __>_ _ ___  ___ | |  <_>._ _ | |_   ___ ._ _ _  ___ _| |_ <_>__          #
 * | _>| _>/ ._>/ ._>| |_ | || | || / / / . \| | | |<_> | | |  | |\ \/        #
 * |_| |_| \___.\___.|___||_||_|_||_\_\ \___/|_|_|_|<___| |_|  |_|/\_\        #
 * 1) FreeLinkomatix Post install script                                          #
 * 2) This script is ment to be run after the upgrade to a v2.6 kernel            #
 * 3) It will install additional apps some of which are dependant on kernel v2.6  #
 * 1) This script is ment to be run after the upgrade to a v2.6 kernel            #
 * 2) It will install additional apps some of which are dependant on kernel v2.6  #
 * 1) It will install additional apps some of which are dependant on kernel v2.6  #

wget http://downloads.linkstationwiki.net/Installers/Freelinkomatix/postinstall.sh -O newest if ! diff postinstall.sh newest >> /dev/null ; then rm newest clear echo "There is a newer version of the Post Install Script available" echo "*************************************************************" echo " get it from:" echo " " echo " http://downloads.linkstationwiki.net/Installers/Freelinkomatix/postinstall.sh" exit 1 else rm newest fi

clear echo "FreeLinkomatix Post install script: " echo " " echo "This script is ment to be run after the upgrade to a v2.6 kernel" echo "It will install additional apps some of which are dependant on kernel v2.6" echo " " echo "Operating System: " `uname -o` echo "Kernel Release:  " `uname -r` echo "Version:         " `uname -v` echo "Processor:       " `uname -m` echo " " echo " 1. Add Kernel Network File System (NFS) and the Webmin Exports module" echo " 2. Install Rsync and download Webmin module rsyncmin" echo " 3. Add USB Automounting and CUPS Printer Support" echo " 4. Macintosh Specific Netatalk and Howl Zeroconf DNS discovery service" echo " 5. Add Firefly (mt-daapd) Media Server " echo " 6. Install ccxstream XBMSP protocol for XBox Media Center " echo " 7. KAID - XLink Kai online gaming for Xbox, 360, PS2 and PSP" echo " 8. LAMP and Gallery2 Photo gallery " echo " " echo -n "Do you want to add additional apps to your Linkstation? (y/n)" read -e ANSWER if [ "$ANSWER" == "n" ] ; then exit 1 fi


 * 1) First do a quick check to see that you are running a kernel 2.6 on your     #
 * 2) Linkstation and set some variables                                          #
 * 1) Linkstation and set some variables                                          #

ERROR="0" kernelversion | grep -q "2.6" || ERROR="1" uname -m | grep -q ppc || ERROR="1"

if [ "$ERROR" == "1" ] ; then echo "" echo "FATAL: At present only PPC-based Linkstations running kernel v2.6 are supported." echo "--> Cannot continue." echo "" exit 1 fi uname -r | grep "2.6" | grep kurobox | grep -q -v HG && FLAVOR="ls1" uname -r | grep "2.6" | grep kurobox | grep -q HG && FLAVOR="hg"
 * 1) Recognize Kernel 2.6 LinkStation Flavors


 * 1) Then do a quick check to make sure you have apt-get this should weed out the #
 * 2) Openlink users too                                                          #
 * 1) Openlink users too                                                          #

apt-get -v | grep -q dpkg || ERROR="1" if [ "$ERROR" == "1" ] ; then echo "" echo "FATAL: Do you have apt-get installed, is this Debian(FreeLink)?" echo "--> Cannot continue." echo "" exit 1 fi

clear echo " " echo "Install Rsync and download Webmin module rsyncmin" echo "-" echo " rsync is a free software computer program for Unix systems which" echo " synchronizes files and directories from one location to another" echo " while minimizing data transfer using delta encoding when" echo " appropriate. An important feature of rsync not found in most" echo " similar programs/protocols is that the mirroring takes place" echo " with only one transmission in each direction. rsync can copy" echo " or display directory contents and copy files, optionally using" echo " compression and recursion." echo " " echo " This script will also download the webmin module Rsyncmin from" echo " http://opensource.digisec.de/ which configures rsyncd.conf " echo " " echo "                       rsyncmin.wbm" echo " " echo " You will have to install the Rsyncmin module within Webmin yourself" echo " " echo " " echo -n "Do you want to Install Rsync? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F rsync /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "rsync" >> /etc/freelinkomatix_installed apt-get install rsync wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://opensource.digisec.de/webmin/rsyncmin.wbm wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/Installers/Freelinkomatix/rsyncmin.wbm fi fi
 * 1) Install Rsync and download Webmin module rsyncmin                           #
 * 1) Install Rsync and download Webmin module rsyncmin                           #

clear echo " " echo "Add USB Automounting and CUPS Printer Support" echo "-" echo " This will add USB Drive automounting and mount USB" echo " drives to /media/usb0,1,2,3 etc. symbolic links" echo " in /mnt/share will also be created usb0,usb1,usb2,usb3" echo " so that they will be accessable via your samba share" echo " Also CUPS (Common Unix Printing System) Support will" echo " be added. You can configure this in Webmin" echo " " echo " Webmin --> Hardware -->Printer Adminstration -->Module Config -->" echo " -->Printer Configuration Style -->[CUPS]" echo " " echo " " echo -n "Do you want to add USB Automounting and CUPS Printer Support? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F usbcups /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "usbcups" >> /etc/freelinkomatix_installed apt-get remove hotplug apt-get install usbmount sed -e 's@^FILESYSTEMS.*$@FILESYSTEMS="ext3 ext2 vfat"@ ; s@^MOUNTOPTIONS.*$@MOUNTOPTIONS="noexec,nodev,noatime"@ ; s@^FS_MOUNTOPTIONS.*$@FS_MOUNTOPTIONS="-fstype=vfat,umask=000"@' < /etc/usbmount/usbmount.conf > /tmp/file cat /tmp/file > /etc/usbmount/usbmount.conf ln -s /media/usb0/ /mnt/share ln -s /media/usb1/ /mnt/share ln -s /media/usb2/ /mnt/share ln -s /media/usb3/ /mnt/share apt-get install cupsys cupsys-bsd fi fi
 * 1) Add USB Automounting and CUPS Printer Support                               #
 * 1) Add USB Automounting and CUPS Printer Support                               #

clear echo " " echo "Add Kernel Network File System (NFS) and the Webmin Exports module" echo "-" echo " Network File System (NFS) is a protocol originally developed" echo " by Sun Microsystems in 1984, as a distributed file system which" echo " allows a computer to access files over a network as easily as if" echo " they were on its local disks. NFS is one of many protocols built" echo " on the Open Network Computing Remote Procedure Call system" echo " This script will install Kernel NFS server support, it will" echo " require Kernel 2.6 to have been installed. Also the NFS exports" echo " control module for webmin will be installed allowing webmin" echo " to manage NFS exports." echo " " echo " After you set up NFS exports with webmin or manually, you " echo " will have to either restart your system or restart the NFS" echo " daemon with" echo " " echo "              /etc/init.d/nfs-kernel-server start" echo " " echo " " echo -n "Do you want to add Kernel NFS and Webmin Exports? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F kernelnfs /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "kernelnfs" >> /etc/freelinkomatix_installed apt-get install nfs-kernel-server webmin-exports fi fi clear echo " " echo "Macintosh Specific Netatalk and Howl Zeroconf DNS discovery service" echo "---" echo " Protocols that provide Native Mac OS X compatibility" echo " Netatalk is an open-source implementation of the AppleTalk suite" echo " of protocols. It allows Unix-like operating systems to serve as " echo " file, print and time servers for Macintosh computers." echo " Howl -a multicast DNS service discovery is an open source" echo " implementation of the Zeroconf specification a set of techniques" echo " that automatically create a usable IP this allows unknowledgeable" echo " users to connect computers, networked printers, and other items" echo " together and expect them to work. " echo " Zeroconf was pioneered by Apple Computer in the company's move" echo " from AppleTalk to IP." echo " Binaries from: http://hvkls.dyndns.org/downloads/documentation/" echo " " echo " This will also get the third party webmin netatalk module" echo " from Matthew Keller (kellermg@potsdam.edu) you will have to " echo " install it yourself within webmin" echo " " echo -n "Native Mac OS X compatibility with NetaTalk and Howl? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F netatalkhowl /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "netatalkhowl" >> /etc/freelinkomatix_installed apt-get install cracklib-runtime libpam-cracklib netatalk /etc/init.d/netatalk stop wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/LS1_PPC/Packages/binaries-that-need-kernel2.6/netatalk_2.0.3-4_powerpc.deb wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://hvkls.dyndns.org/downloads/netatalk_2.0.3-4_powerpc.deb
 * 1) Add Kernel Network File System (NFS) and the Webmin Exports module          #
 * 1) Add Kernel Network File System (NFS) and the Webmin Exports module          #
 * 1) Macintosh Specific Netatalk and Howl Zeroconf DNS discovery service         #
 * 1) Macintosh Specific Netatalk and Howl Zeroconf DNS discovery service         #
 * 1) INSTALL NETATALK FIRST #
 * 1) INSTALL NETATALK FIRST #

dpkg -i netatalk_2.0.3-4_powerpc.deb rm /etc/default/netatalk echo 'AFPD_MAX_CLIENTS=10 ' >> /etc/default/netatalk echo 'ATALK_NAME=`/bin/hostname` ' >> /etc/default/netatalk echo "ATALK_MAC_CHARSET='MAC_ROMAN' " >> /etc/default/netatalk echo "ATALK_UNIX_CHARSET='LOCALE' " >> /etc/default/netatalk echo 'AFPD_UAMLIST="-U uams_dhx.so" ' >> /etc/default/netatalk echo 'AFPD_GUEST=nobody ' >> /etc/default/netatalk echo 'ATALKD_RUN=no ' >> /etc/default/netatalk echo 'PAPD_RUN=no ' >> /etc/default/netatalk echo 'CNID_METAD_RUN=yes ' >> /etc/default/netatalk echo 'AFPD_RUN=yes ' >> /etc/default/netatalk echo 'TIMELORD_RUN=no ' >> /etc/default/netatalk echo 'A2BOOT_RUN=no ' >> /etc/default/netatalk echo 'ATALK_BGROUND=yes ' >> /etc/default/netatalk echo 'export ATALK_MAC_CHARSET ' >> /etc/default/netatalk echo 'export ATALK_UNIX_CHARSET ' >> /etc/default/netatalk rm /etc/netatalk/afpd.conf echo '- -transall -uamlist uams_dhx.so -nosavepassword -noddp ' >> /etc/netatalk/afpd.conf echo '/mnt/shared "shared" allow:linkstation ' >> /etc/netatalk/AppleVolumes.default

wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://mattwork.potsdam.edu/projects/netatalk/webmin_module/netatalk.wbm wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/Installers/Freelinkomatix/netatalk.wbm

####################   #THEN INSTALL HOWL # ####################   wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/LS1_PPC/Packages/binaries-that-need-kernel2.6/howl_1.0.0-binaries-ppc.tar.gz    wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://hvkls.dyndns.org/downloads/howl_1.0.0-binaries-ppc.tar.gz    tar -C / -xvzf howl_1.0.0-binaries-ppc.tar.gz    #will have to alter /etc/howl/mDNSResponder.conf file to fit what we make and wget it in the future.... /etc/init.d/howl start fi fi clear echo " " echo "Add Firefly (mt-daapd) Media Server" echo "---" echo " Firefly Media Server (formerly mt-daapd) is an open-source media" echo " server (or daemon) for the Roku SoundBridge and iTunes. It serves" echo " media files using Roku Server Protocol (RSP) and Digital Audio" echo " Access Protocol (DAAP).Netatalk is an open-source implementation" echo " of the AppleTalk suite" echo " " echo " Point your web browser to http://linkstation:3689 and login with: " echo "               user:mt-daapd" echo "               password:mt-daapd " echo " " echo " and set up the configuration in the web interface " echo " " echo " " echo " Binaries from: http://hvkls.dyndns.org/downloads/documentation/" echo " " echo -n "Add Firefly (mt-daapd) Media Server? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F firefly /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "firefly" >> /etc/freelinkomatix_installed apt-get install libid3tag0 wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/LS1_PPC/Packages/binaries-that-need-kernel2.6/mtdaapd_0.2.4-binaries-ppc.tar.gz   wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://hvkls.dyndns.org/downloads/mtdaapd_0.2.4-binaries-ppc.tar.gz    tar -C / -xvzf mtdaapd_0.2.4-binaries-ppc.tar.gz     #wget http://puzzle.dl.sourceforge.net/sourceforge/mt-daapd/mt-daapd-0.2.4.tar.gz    #tar -xvzf mt-daapd-0.2.4.tar.gz    #cd mt-daapd-0.2.4 #./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --with-id3tag=/usr/local --sysconfdir=/etc #make #make install #mkdir /etc/mt-daapd #cp contrib/mt-daapd.* /etc/mt-daapd/ mv /etc/mt-daapd.SAMPLE /etc/mt-daapd /etc/init.d/mt-daapd start fi fi
 * 1) Add Firefly (mt-daapd) Media Server                                         #
 * 1) Add Firefly (mt-daapd) Media Server                                         #

clear echo " " echo "Install ccxstream XBMSP protocol for XBox Media Center" echo "--" echo " XBMSP (XBox Media Stream Protocol) or XBMS for short is another way" echo " of sharing media, supposedy it is faster than Samba. It is capable" echo " of streaming all types of media and gives the option of sharing" echo " individual folders or entire drives. XBMS is very bandwith efficient." echo " Once you install ccXStream on your LinkStation all you have to do" echo " is configure your XMBC to use the media share." echo " ccxstream is a part of the XBox Media Center Project" echo "http://www.xboxmediacenter.com/" echo " " echo " It will share /mnt/share by default" echo " " echo -n "Do you want to install ccxstream - XBMSP? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F ccxstream /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "ccxstream" >> /etc/freelinkomatix_installed wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://osdn.dl.sourceforge.net/sourceforge/xbplayer/ccxstream-1.0.15.tar.gz    wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/Installers/Freelinkomatix/ccxstream-1.0.15.tar.gz    tar -xvzf ccxstream-1.0.15.tar.gz    cd ccxstream-1.0.15 make cp ccxstream /usr/local/bin cp ccxtest /usr/local/bin mkdir /usr/doc/ccxstream cp COPYRIGHT /usr/doc/ccxstream/ cp ChangeLog /usr/doc/ccxstream/ cp PORTING /usr/doc/ccxstream/ cp README /usr/doc/ccxstream/ cp TODO /usr/doc/ccxstream/ cp xbmsp-xml.txt /usr/doc/ccxstream/ cp xbmsp.txt /usr/doc/ccxstream/ echo '#! /bin/sh' >> /etc/init.d/ccxstream echo '#' >> /etc/init.d/ccxstream echo '# CCXSTREAM - see /usr/doc/ccxstream/README for options' >> /etc/init.d/ccxstream echo '#' >> /etc/init.d/ccxstream echo '# Set SHAREDIR to directory you want to share' >> /etc/init.d/ccxstream echo '# Set OPTIONS to other command line options you want' >> /etc/init.d/ccxstream echo 'SHAREDIR=/mnt/share' >> /etc/init.d/ccxstream echo 'OPTIONS="-f -F /var/run/ccxstream.pid"' >> /etc/init.d/ccxstream echo '#' >> /etc/init.d/ccxstream echo ' if [ -n "`pidof ccxstream`" ] ; then' >> /etc/init.d/ccxstream echo '    killall ccxstream 2>/dev/null' >> /etc/init.d/ccxstream echo ' fi' >> /etc/init.d/ccxstream echo ' sleep 2' >> /etc/init.d/ccxstream echo ' /usr/local/bin/ccxstream -r $SHAREDIR  $OPTIONS' >> /etc/init.d/ccxstream chmod a+x /etc/init.d/ccxstream # cd /etc/rc.d/rc2.d   # ln -s ../init.d/ccxstream S75ccxstream # cd ../rc0.d   # ln -s ../init.d/ccxstream K02ccxstream # cd ../rc6.d   # ln -s ../init.d/ccxstream K02ccxstream # /etc/init.d/ccxstream fi fi clear echo " " echo "KAID - XLink Kai online gaming for Xbox, 360, PS2 and PSP" echo "-" echo " Xlink Kai: Evolution VII lets you connect with other console users" echo " around the world, and play online games for free. XLink Kai: Evo VII" echo " tricks your console into thinking that the other users it is connecting" echo " to over the Internet, are actually part of a Local Area Network. This" echo " is the basis of system-link gaming, where friends would gather around" echo " in the same house and play over 2 or more consoles. With XLink Kai: Evo VII" echo " you now have the option to test your skills out with anybody in the world." echo " you will need a XTAG (username) and Password for this service." echo " Xlink Kai is developed by Team Xlink - http://www.teamxlink.co.uk/" echo " " echo -n "Do you want to install X-link KAID? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F xlinkkai /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "xlinkkai" >> /etc/freelinkomatix_installed echo -n "Enter your Xlink username:" read -e USERNAME echo -n "Enter your password:" read -e PASSWORD wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://www.teamxlink.co.uk/binary/kaid-ppc-static-libc-2.3.zip wget --tries=3 --dns-cache=off --dns-timeout=8 --connect-timeout=8 --random-wait -c http://downloads.linkstationwiki.net/Installers/Freelinkomatix/kaid-ppc-static-libc-2.3.zip apt-get install unzip unzip kaid-* mv kaid-static* kaid mv kaid /usr/local/sbin chmod 755 /usr/local/sbin/kaid wget http://downloads.linkstationwiki.net/freelinkomatix/kaid mv kaid /etc/init.d/kaid chmod 755 /etc/init.d/kaid # ln -s /etc/init.d/kaid /etc/rc.d/rc0.d/K99kaid # ln -s /etc/init.d/kaid /etc/rc.d/rc2.d/S99kaid # ln -s /etc/init.d/kaid /etc/rc.d/rc6.d/K99kaid wget http://downloads.linkstationwiki.net/freelinkomatix/kaid.conf echo 'Username = ' $USERNAME >> kaid.conf echo 'Password = ' $PASSWORD >> kaid.conf mv kaid.conf /etc/kaid.conf fi fi
 * 1) Install ccxstream XBMSP protocol for XBox Media Center                      #
 * 1) Install ccxstream XBMSP protocol for XBox Media Center                      #
 * 1) KAID - XLink Kai online gaming for Xbox, 360, PS2 and PSP                   #
 * 1) KAID - XLink Kai online gaming for Xbox, 360, PS2 and PSP                   #

clear echo "LAMP and Gallery2 Photo gallery" echo "---" echo " LAMP (or L.A.M.P.) refers to a set of free software programs commonly" echo " used together to run dynamic Web sites or servers:" echo " * Linux, the operating system" echo " * Apache, the Web server" echo " * MySQL, the database management system (or database server)" echo " * PHP scripting/programming language" echo " " echo " Gallery2" echo " The Gallery Project is an open source PHP project enabling simple" echo " management and publication of photographs and other digital media" echo " through a PHP-enabled Apache, IIS or Zeus web server. Photo management" echo " includes automatic thumbnails, resizing, rotation, and flipping, among" echo " other things. Albums can be organized hierarchically and individually" echo " controlled by administrators or privileged users. " echo " " echo -n "Do you want to install LAMP? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F lamp /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "lamp" >> /etc/freelinkomatix_installed apt-get install apache apache-common apt-get install mysql-server php4-mysql libapache-mod-auth-mysql fi fi echo -n "Do you want to install Gallery2? (y/n)" read -e ANSWER if [ "$ANSWER" == "y" ] ; then if grep -F gallery /etc/freelinkomatix_installed ; then clear echo "You already installed this with the FreeLinkomatix Post-install Script" sleep 2 else echo "gallery" >> /etc/freelinkomatix_installed apt-get install apache debconf mysql-client  netpbm  php4  php4-mysql  wwwconfig-common wget http://ftp.debian.org/debian/pool/main/g/gallery2/gallery2_2.1.2-1_all.deb dpkg -i gallery2_2.1.2-1_all.deb fi fi
 * 1) LAMP and Gallery2 Photo gallery                                             #
 * 1) LAMP and Gallery2 Photo gallery                                             #