Advertisement
Guest User

Untitled

a guest
May 8th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.13 KB | None | 0 0
  1. #!/bin/sh
  2. #IsiX OS Install script v0.001
  3. VERS="0.001"
  4. PRT="IsiX OS"
  5. VOS="IsiX OS"
  6. TPRT="2.6.27-rc6"
  7. TMP=/tmp/setup
  8. tmp=/tmp/setup
  9. INST_PNT=/var/mnt
  10. CD_MNT=/cdrom
  11. RDIR=/dev/null
  12. ROOT_DEV="/dev/sda"
  13. ROOT_PART="/dev/sda1"
  14. SWAP_PART="/dev/sda2"
  15. device=/dev/sr0
  16. FS_TAB=$TMP/fstemp
  17.  
  18. if [ ! -d $TMP ]; then
  19.   mkdir -p $TMP
  20. fi
  21. if [ ! -d $CD_MNT ]; then
  22.   mkdir -p $CD_MNT
  23. fi
  24. if [ ! -d $INST_PNT ]; then
  25.   mkdir -p $INST_PNT
  26. fi
  27.  
  28. dialog --backtitle "$VOS $VERS                                                  $TPRT"\
  29. --title "Welcome to IsiX OS Install" --msgbox "\n\n\n\
  30. You are about to install a Development Release of $VOS\n\
  31. This is a Fast, Stable, and Refined Linux Multimedia Distribution \
  32. designed for the Linux/Unix Power User.\n\n " 16 70
  33. dialog --backtitle \
  34. "$VOS $VERS                                                     $TPRT" \
  35. --title "Partition Setup" --msgbox "As first you will need to set up 2 partitions manually using Cfdisk\n\n\
  36. -1- as / for the main system.\n\
  37. -2- as Swap for paging memory.\n\
  38. -3- Mark the root parition bootable" 10 70
  39.    cfdisk /dev/sda
  40. dialog --backtitle \
  41. "$VOS $VERS                                                     $TPRT" \
  42. --title "Select the main partition" --inputbox "Wich is your main partition?\n\
  43. If it is the first you made, then it is $ROOT_PART\n\
  44. otherwise insert it here:" 10 70 $ROOT_PART 2>$TMP/ROOT_PART
  45.    ROOT_PART=$(cat $TMP/ROOT_PART);rm $TMP/ROOT_PART
  46.    echo y|mkreiserfs $ROOT_PART
  47. dialog --backtitle \
  48. "$VOS $VERS                                                     $TPRT" \
  49. --title "Select the Swap partition" --inputbox "Wich is your swap partition?\n\
  50. If it is the first you made, then it is $SWAP_PART\n\
  51. otherwise insert it here:" 10 70 $SWAP_PART 2>$TMP/SWAP_PART
  52.    SWAP_PART=$(cat $TMP/SWAP_PART);rm $TMP/SWAP_PART
  53.    mkswap $SWAP_PART >/dev/null
  54.    echo "setting swap";swapon $SWAP_PART
  55. dialog --backtitle \
  56. "$VOS $VERS                                                     $TPRT" \
  57. --title "Mounting Devices" --infobox "The Installer will mount and prepare all spaces for the install." 8 70
  58.    sleep 5
  59. #montamos dispositivos
  60.    mount $ROOT_PART $INST_PNT >/dev/null
  61.    mount -o ro,exec -t iso9660 $device $CD_MNT 1> $RDIR 2> $RDIR
  62. #preparamos directorios
  63.    mkdir -p $INST_PNT/var/log/packages
  64.    mkdir -p $INST_PNT/var/log/scripts
  65.    cd $INST_PNT ; chmod 755 ./; chmod 755 ./var
  66.    
  67.    if [ -d $INST_PNT/usr/src/linux ]; then
  68.       chmod 755 $INST_PNT/usr/src/linux
  69.    fi
  70.    if [ ! -d $INST_PNT/proc ]; then
  71.       mkdir $INST_PNT/proc
  72.       chown root.root $INST_PNT/proc
  73.    fi
  74.    if [ ! -d $INST_PNT/sys ]; then
  75.       mkdir $INST_PNT/sys
  76.       chown root.root $INST_PNT/sys
  77.    fi
  78.    
  79.    chmod 1777 $INST_PNT/tmp
  80.    
  81.    if [ ! -d $INST_PNT/var/spool/mail ]; then
  82.       mkdir -p $INST_PNT/var/spool/mail
  83.       chmod 755 $INST_PNT/var/spool
  84.       chown root.mail $INST_PNT/var/spool/mail
  85.       chmod 1777 $INST_PNT/var/spool/mail
  86.    fi
  87. #montamos proc y sys
  88.    mount -t proc /proc $INST_PNT/proc 1> /dev/null 2> /dev/null
  89.    mount --bind /sys $INST_PNT/sys 1> /dev/null 2> /dev/null
  90. #avisamos
  91. dialog --backtitle \
  92. "$VOS $VERS                                                     $TPRT" \
  93. --title "Starting the Instalation" --msgbox "From Now on the install will do all steps for you automaticly." 5 70
  94. #instalamos
  95. #a
  96. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 1/14"\
  97.  --infobox "Installing Base System Files to disk, this is the first step ......" 5 60
  98.    wait;
  99.    cd $CD_MNT/packages/a ;
  100.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  101. #ap
  102. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 2/14"\
  103.  --infobox "Installing Main System apps, the second step You're Not Done Yet ......" 5 60
  104.    wait;
  105.    cd $CD_MNT/packages/ap ;
  106.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  107. #d
  108. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 3/14"\
  109.  --infobox "Installing Bin files. All needed by the system and for Your own compiles" 5 60
  110.    wait;
  111.    cd $CD_MNT/packages/d ;
  112.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  113. #e
  114. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 4/14"\
  115.  --infobox "Installing Emacs. Just Sitback and Relax ......" 5 60
  116.    wait;
  117.    cd $CD_MNT/packages/e ;
  118.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  119. #f
  120. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 5/14"\
  121.  --infobox "Installing Linux FAQ's and HowTo's  included in any complete distro ......" 5 60
  122.    wait;
  123.    cd $CD_MNT/packages/f ;
  124.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  125. #k
  126. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 6/14"\
  127.  --infobox "Installing the Linux Kernel  - This is a specially compiled Kernel for the XHL 90 laptop" 5 60
  128.    wait;
  129.    cd $CD_MNT/packages/k ;
  130.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  131. #kde
  132. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 7/14"\
  133.  --infobox "Installing KDE environment. Your Desktop environment by default ....." 5 60
  134.    wait;
  135.    cd $CD_MNT/packages/kde ;
  136.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  137. #l
  138. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 8/14"\
  139.  --infobox "Installing main Library Files the most needed by the system ....." 5 60
  140.    wait;
  141.    cd $CD_MNT/packages/l ;
  142.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  143. #n
  144. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 9/14"\
  145.  --infobox "Installing Networking parts, this takes a while ......" 5 60
  146.    wait;
  147.    cd $CD_MNT/packages/n ;
  148.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  149. #t
  150. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 10/14"\
  151.  --infobox "Installing tetex transfig & xfig You Can't Turn Back Now ! ......" 5 60
  152.    wait;
  153.    cd $CD_MNT/packages/t ;
  154.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  155. #tcl
  156. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 11/14"\
  157.  --infobox "Installing tcl Just wait a little more  ......" 5 60
  158.    wait;
  159.    cd $CD_MNT/packages/tcl ;
  160.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  161. #x
  162. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 12/14"\
  163.  --infobox "Installing X core files , those ones needed to start the graphical Interface  ......" 5 60
  164.    wait;
  165.    cd $CD_MNT/packages/x ;
  166.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  167. #xap
  168. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 13/14"\
  169.  --infobox "Installing X app files , those ones needed to use on the graphical Interface  ......" 5 60
  170.    wait;
  171.    cd $CD_MNT/packages/xap ;
  172.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  173. #y
  174. dialog --backtitle "$VOS $VERS                                               $TPRT" --title "Writing to Hard Drive - 14/14"\
  175.  --infobox "Installing Unix Games , not QUAKE but something else ......" 5 60
  176.    wait;
  177.    cd $CD_MNT/packages/y ;
  178.    installpkg -root $INST_PNT -infobox *.tgz > /dev/null;
  179. ####Last step
  180.       chroot $INST_PNT /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null
  181.       chroot $INST_PNT /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null
  182. # There is no root password
  183.    cp /usr/lib/setup/dopass.exp $INST_PNT/sbin
  184.    chroot $INST_PNT /sbin/dopass.exp root isix${RANDOM} > /dev/null
  185.    chroot $INST_PNT useradd -G plugdev,haldaemon,audio,video,cdrom -s /bin/bash -d /home/isixuser -m -k /etc/skel isix
  186.    chroot $INST_PNT /sbin/dopass.exp isix isixos1234
  187.    rm $INST_PNT/sbin/dopass.exp
  188. dialog --title "ATTENTION" --msgbox "A default user is created with the following details, \
  189. please note and remember this to log in to the new system\n\nUsername: isix\nPassword: isixos1234" 12 60
  190. # make fstab
  191.    echo "$ROOT_PART     /        reiserfs        defaults        1   1" >$INST_PNT/etc/fstab
  192.    echo "$SWAP_PART    swap        swap        defaults         0   0">>$INST_PNT/etc/fstab
  193.    echo "proc          /proc     proc     defaults         0     0" >>$INST_PNT/etc/fstab
  194.    echo "sysfs         /sys      sysfs    defaults         0     0" >>$INST_PNT/etc/fstab
  195.    echo "devpts        /dev/pts  devpts   gid=5,mode=620   0     0" >>$INST_PNT/etc/fstab
  196. # make mtab
  197.    echo "$ROOT_PART       /         reiserfs rw  0    0">$INST_PNT/etc/mtab
  198.    echo "proc         /proc         proc     rw  0    0">>$INST_PNT/etc/mtab
  199.    echo "sysfs        /sys          sysfs    rw  0    0">>$INST_PNT/etc/mtab
  200.    echo "usbfs        /proc/bus/usb usbfs    rw  0    0">>$INST_PNT/etc/mtab
  201.    echo "tmpfs        /dev/shm      tmpfs    rw  0    0">>$INST_PNT/etc/mtab
  202. #Generate lilo
  203.    touch $TMP/lilo_echo
  204.    mbrinstdrv="$ROOT_DEV"
  205.    echo "## IsiX OS lilo.conf">$TMP/lilo_echo
  206.    echo "append=\" vt.default_utf8=0\"">>$TMP/lilo_echo
  207.    echo "boot = $ROOT_DEV">>$TMP/lilo_echo
  208.    echo "#bitmap = /boot/boot.bmp">>$TMP/lilo_echo
  209.    echo "#bmp-colors = 120,255,120,255,120,255">>$TMP/lilo_echo
  210.    echo "#bmp-table = 60,6,255,0">>$TMP/lilo_echo
  211.    echo "#bmp-timer = 65,27,255,0">>$TMP/lilo_echo
  212.    echo "prompt">>$TMP/lilo_echo
  213.    echo "timeout = 150">>$TMP/lilo_echo
  214.    echo "change-rules">>$TMP/lilo_echo
  215.    echo "reset">>$TMP/lilo_echo
  216.    echo "vga = 791">>$TMP/lilo_echo
  217.    echo "# Linux bootable partition config begins">>$TMP/lilo_echo
  218.    echo "image = /boot/vmlinuz">>$TMP/lilo_echo
  219.    echo "  root = $ROOT_PART">>$TMP/lilo_echo
  220.    echo "  label = IsiX_OS">>$TMP/lilo_echo
  221.    echo "  read-only">>$TMP/lilo_echo
  222.    echo "# Linux bootable partition config ends">>$TMP/lilo_echo
  223.    cat $TMP/lilo_echo > $INST_PNT/etc/lilo.conf 2> /dev/null
  224.    chmod 644 $INST_PNT/etc/lilo.conf 2> /dev/null
  225. #install lilo
  226.    chroot $INST_PNT /sbin/lilo  2> /dev/null
  227.    chroot $INST_PNT /usr/sbin/nvidia-switch --install >/dev/null
  228.    FECHADEHOY=`date "+%d-%m-%y"`
  229.    chroot $INST_PNT echo "#Isix OS installed on $FECHADEHOY" >/etc/isix-install
  230.    chroot $INST_PNT fc-cache -f
  231. #limpiamos
  232.    rm -Rf $INST_PNT/*pkg*
  233.    rm -Rf $INST_PNT/*install*
  234.    rm -Rf $INST_PNT/*tgz
  235. #dejamos sistema con permisos
  236.    chmod 755 $INST_PNT
  237. #liberamos dispositivos
  238.    cd
  239. #desmontamos
  240.    umount $CD_MNT
  241. #expulsamos disco
  242.    eject $DRIVE_FOUND
  243. #hasta la vista
  244. dialog --backtitle \
  245. "$VOS $VERS                                                  $TPRT" \
  246. --title "In The Begining There Was Darkness" --yesno "Your Finnished! reboot and   \
  247. remove the CD ! \n                          < Ctrl+Alt+Del > \nselect < No > to go back to console. " 8 60
  248.    if [ "$?" = "0" ] ; then
  249.       echo "Remember: isix - isixos1234"
  250.       sleep 3
  251.       reboot
  252.    fi
  253. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement