Advertisement
Frannoe

DMDc-installer

Mar 30th, 2014
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 33.51 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #
  4. #  DMDc-installer is an alternative installer for remastered livecd/dvd's
  5. #  Based remastersys-installet to Tony "Fragadelic" Brijeski
  6. #  DMDc-installer created by "Frannoe" frannoe@gmail.com <http://frannoe.blogspot.com.es/> 2014/Mar/26
  7. #  Copyright 2008-2014 Under the GNU GPL2 License
  8.  
  9.  
  10. DIALOGMENU="`which yad` --window-icon=/usr/share/pixmaps/dmdc-installe.png "
  11. DIALOG="`which yad` --window-icon=/usr/share/pixmaps/dmdc-installer.png"
  12. TITLE="--always-print-result --dialog-sep --image=/usr/share/pixmaps/dmdc-installe.png --image-on-top --title="
  13. TEXT="--text="
  14. ENTRY="--entry "
  15. ENTRYTEXT="--entry-text "
  16. MENU="--list --column=Pick --column=Info --column="""
  17. YESNO=" --button=yes:0 --button=No:1 "
  18. MSGBOX=" --button=Ok:0 "
  19. PASSWORD="--entry --hide-text "
  20. TITLETEXT="DMDc Installer"
  21. #########LIVE_USERNAME##########0
  22. . /etc/live/config.conf
  23. #########LIVE_USERNAME##########1
  24.  
  25. # checking to make sure script is running with root privileges
  26. ###################0
  27. testroot="`whoami`"
  28. testmode=`grep "1000" /etc/passwd | grep -v "Live"`
  29. if [ "$testroot" != "root" ]; then
  30. $DIALOG $TITLE"$TITLETEXT" --button=Exit $TEXT"The installer must be run as root"
  31. exit 1
  32. fi
  33.  
  34. if [ "$testmode" != "" ]; then
  35. $DIALOG $TITLE"$TITLETEXT" --button=Exit $TEXT"This installer must be run in a Live session"
  36. exit 1
  37. fi
  38. ###################1
  39. progressbar () {
  40. tail -f /opt/dmdc-locales/es_ES/dmdc-installer | $DIALOG $TITLE"$TITLETEXT" $TEXT"$@" --no-buttons --progress --pulsate --auto-close
  41. }
  42.  
  43. ###################0
  44. GPARTEDISK ()  {
  45. $DIALOG $TITLE"$TITLETEXT" --button=Exit:2 --button=Continue:1 --button="Create Partition":0 $TEXT"<b>gparted</b> also allow you to create new partitions if necessary to install the system. \nIf you already have partitions to install the system, press <b>Continue</b>.  "
  46. QUES=$?
  47. if [ $QUES = 2 ]; then
  48. exit 0
  49. fi
  50.  
  51. if [ $QUES = 0 ]; then
  52.  
  53. lsblk -l -o NAME,TYPE,SIZE,FSTYPE,GROUP | grep -e disk -e floppy | grep -v loop | grep -v cdrom | grep -v $LIVECD | grep -v part | grep -v swap | sed "s/        \+/ '-----' /g" | awk '{print $1, $3, $2, $5, $4}' >> /tmp/disks
  54. sed -i 's/floppy/Externo/g' /tmp/disks
  55. while read disks; do
  56. diskmenu="$diskmenu $disks"
  57. done < /tmp/disks
  58. rm /tmp/disks
  59.  
  60. PARTDRIVE=""
  61. QUES=""
  62. until [[ "$PARTDRIVE" !=  "" ||  "$QUES" =  "1" ]]
  63. do
  64. PARTDRIVE=`$DIALOGMENU --height=250 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0 --list --column=Disk --column="Size(GB)" --column=Tipe --column="Location"  --column=Infom --no-click $TEXT"Please select a drive on which to create new partitions <b>Gparted</b>." $diskmenu`
  65. QUES="$?"
  66. done
  67. if [ $QUES != 0 ]; then
  68. exit 0
  69. fi
  70.  
  71. PARTDRIVE=`echo $PARTDRIVE | cut -d "|" -f 1`
  72. gparted /dev/$PARTDRIVE
  73. diskmenu=""
  74. fi
  75. }
  76. ###################1
  77.  
  78.  
  79.  
  80. ###################0
  81.  
  82.  
  83. LIVECD=`lsblk -l -o NAME,MOUNTPOINT | grep live | grep -v loop | awk '{print $1}' | cut -c 1-3`
  84.  
  85. $DIALOG $TITLE"$TITLETEXT" $YESNO $TEXT"This is the installer of DMDc. Do you want to continue? "
  86.  
  87. if [ $? != 0 ]; then
  88. exit 0
  89. fi
  90.  
  91. $DIALOG $TITLE"$TITLETEXT" --button="Exit":2 --button="No":1  --button="yes":0 $TEXT"The installer will use the locale, the language and keyboard layout by default. \nDid you install or remove other keyboard options and location?. "
  92. QUES=$?
  93. if [ $QUES = 0 ]; then
  94. dpkg-reconfigure -f gnome locales
  95. dpkg-reconfigure -f gnome console-data
  96. #dpkg-reconfigure -f gnome console-setup
  97. dpkg-reconfigure -f gnome keyboard-configuration
  98. else
  99. if [ $QUES = 2 ]; then
  100. exit 1
  101. fi
  102. fi
  103. QUES=""
  104. ###################1
  105.  
  106. killall -KILL udisks-daemon
  107.  
  108. ###################0
  109. QUES=""
  110. $DIALOG $TITLE"$TITLETEXT" --button="Exit":3 --button="Use SWAP existing":2 --button="Not used SWAP":1 --button="Create SWAP":0 $TEXT"If your computer is low on RAM (less than 2GB) is convenient and appropriate to use a swap partition. \nIf you do not have it you can create one by pressing the appropriate button. \nWhat would you like to do?. "
  111.  
  112. QUES="$?"
  113. if [ $QUES = 3 ]; then
  114. exit 0
  115. fi
  116.  
  117. if [[ $QUES = 0 || $QUES = 2 ]]; then
  118.  
  119. YESNOSWAP="yes"
  120.  
  121.  
  122. if [ $QUES = 0 ]; then
  123.  
  124. lsblk -l -o NAME,TYPE,SIZE,FSTYPE,GROUP | grep -e disk -e floppy | grep -v loop | grep -v cdrom | grep -v $LIVECD | grep -v part | grep -v swap | sed "s/        \+/ '-----' /g" | awk '{print $1, $3, $2, $5}' >> /tmp/disks
  125.  
  126. sed -i 's/floppy/Externo/g' /tmp/disks
  127.  
  128. while read disks; do
  129. diskmenuswap="$diskmenuswap $disks"
  130. done < /tmp/disks
  131. rm /tmp/disks
  132.  
  133. QUES=""
  134. until [[ "$PARTDRIVESWAP" !=  "" ||  "$QUES" =  "1" ]]
  135. do
  136. PARTDRIVESWAP=`$DIALOGMENU --height=250 $TITLE"$TITLETEXT"--button="Exit":1 --button="OK":0  --list --column=Disk --column="Size(GB)" --column=Tipe --column=Tipe --no-click $TEXT"Please select a unit \nwhich to create the partition <b>Swap</b>.  " $diskmenuswap`
  137. QUES="$?"
  138. done
  139.  
  140.  
  141. if [ $QUES != 0 ]; then
  142. exit 0
  143. fi
  144.  
  145. PARTDRIVESWAP=`echo $PARTDRIVESWAP | cut -d "|" -f 1`
  146.  
  147. gparted /dev/$PARTDRIVESWAP
  148.  
  149. fi
  150.  
  151. ###################1
  152.  
  153.  
  154. ###################0
  155. lsblk -l -o NAME,SIZE,FSTYPE,GROUP | grep swap | awk '{print $1, $2, $3, $4}' >> /tmp/diskswap
  156. sed -i 's/floppy/Externo/g' /tmp/diskswap
  157.  
  158.  
  159. while read diskswap; do
  160. diskswapmenu="$diskswapmenu $diskswap"
  161. done < /tmp/diskswap
  162. rm /tmp/diskswap
  163.  
  164. SWAP=""
  165. QUES=""
  166. until [[ "$SWAP" !=  "" ||  "$QUES" =  "1" ]]
  167. do
  168. SWAP=`$DIALOGMENU --height=250 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=Part --column="Size(GB)" --column="Partition type" --column="Location"  --no-click $TEXT"Please select a swap partition to use.  " $diskswapmenu`
  169. QUES="$?"
  170. done
  171.  
  172. if [ $QUES != 0 ]; then
  173. exit 0
  174. fi
  175. SWAP=`echo $SWAP | cut -d "|" -f 1`
  176.  
  177. GPARTEDISK
  178.  
  179. else
  180.  
  181.  
  182. SWAP="no"
  183. QUES=""
  184. GPARTEDISK
  185.  
  186. fi
  187. ###################1
  188.  
  189.  
  190. ###################0
  191. lsblk -l -o NAME,SIZE,TYPE,FSTYPE,GROUP | grep -e part -e floppy | grep -v loop | grep -v swap  | grep -v cdrom | grep -v $LIVECD | grep part | sed "s/        \+/ '-----' /g" | awk '{print $1, $2, $3, $4, $5}' >> /tmp/diskpart
  192.  
  193. sed -i 's/floppy/Externo/g' /tmp/diskpart
  194. while read diskpart; do
  195. diskpartmenu="$diskpartmenu $diskpart"
  196. done < /tmp/diskpart
  197. rm /tmp/diskpart
  198.  
  199.  
  200. TARGETPART=""
  201. QUES=""
  202. until [[ "$TARGETPART" !=  "" ||  "$QUES" =  "1" ]]
  203. do
  204. TARGETPART=`$DIALOGMENU --height=350 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=Part --column=Size --column=Tipe --column="FsTipe" --column="Location"  --no-click $TEXT"Please select a partition to install the system.  " $diskpartmenu`
  205. QUES="$?"
  206. done
  207.  
  208. if [ $QUES != 0 ]; then
  209. exit 0
  210. fi
  211. TARGETPARTGB=`echo $TARGETPART | cut -d "|" -f 2`
  212. TARGETPARTTP=`echo $TARGETPART | cut -d "|" -f 3`
  213. TARGETPARTGP=`echo $TARGETPART | cut -d "|" -f 5`
  214. TARGETPART=`echo $TARGETPART | cut -d "|" -f 1`
  215.  
  216. FSTYPES=""
  217. QUES=""
  218. until [[ "$FSTYPES" !=  "" ||  "$QUES" =  "1" ]]
  219. do
  220. FSTYPES=`$DIALOGMENU --height=200 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=EXT --column="Format in..."  --no-click $TEXT"Please select the type of file system to use. " ext2 "Filesystem Ext2" ext3 "Filesystem Ext3" ext4 "Filesystem Ext4"`
  221. QUES="$?"
  222. done
  223.  
  224. if [ $QUES != 0 ]; then
  225. exit 0
  226. fi
  227.  
  228. FSTYPES=`echo $FSTYPES | cut -d "|" -f 1`
  229. ###################1
  230.  
  231. ###################0
  232.  
  233. lsblk -l -o NAME,SIZE,TYPE,FSTYPE,GROUP | grep -e part -e floppy | grep -v loop | grep -v swap  | grep -v cdrom | grep -v $TARGETPART | grep -v $LIVECD | grep part | sed "s/        \+/ '-----' /g" | awk '{print $1, $2, $3, $4, $5}' >> /tmp/diskparth
  234. sed -i 's/floppy/Externo/g' /tmp/diskparth
  235. while read diskparth; do
  236. homepartmenu="$homepartmenu $diskparth"
  237. done < /tmp/diskparth
  238. rm /tmp/diskparth
  239.  
  240.  
  241. HOMEPART=""
  242. QUES=""
  243. until [[ "$HOMEPART" !=  "" ||  "$QUES" =  "1" ]]
  244. do
  245. HOMEPART=`$DIALOGMENU --height=350 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=Part --column=Size --column=Tipe --column="FsTipe" --column="Location" --no-click $TEXT"Please select a partition to install <b>/home</b>. \nIf you do not understand what you are doing, then install the HOME where the system is installed. \nYou selected to install the system on the partition <b>$TARGETPART</b> you can see labeled: <b>*</b>. " $TARGETPART "$TARGETPARTGB*" "$TARGETPARTTP*" "$FSTYPES*" "$TARGETPARTGP *" $homepartmenu`
  246. QUES="$?"
  247. done
  248.  
  249. if [ $QUES != 0 ]; then
  250. exit 0
  251. fi
  252.  
  253. HOMEPART=`echo $HOMEPART | cut -d "|" -f 1`
  254.  
  255.  
  256. if [ "$HOMEPART" != "$TARGETPART" ]; then
  257.  
  258. HFSTYPE=""
  259. QUES=""
  260. until [[ "$HFSTYPE" !=  "" ||  "$QUES" =  "1" ]]
  261. do
  262. HFSTYPE=`$DIALOGMENU --height=250 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=EXT --column="Format in..."  --no-click $TEXT"Please select the type of file system for the partition <b>home</b>. If there is another <b>home</b> and want to share, select no formatting. Otherwise select a format type. " ext2 "Filesystem Ext2" ext3 "Filesystem Ext3" ext4 "Filesystem Ext4"  NoFormat "Do Not Format the home partition"`
  263. QUES="$?"
  264. done
  265. fi
  266.  
  267.  
  268. if [ $QUES != 0 ]; then
  269. exit 0
  270. fi
  271.  
  272. HFSTYPE=`echo $HFSTYPE | cut -d "|" -f 1`
  273.  
  274. ###################1
  275.  
  276.  
  277. ###################0
  278.  
  279. while [ "$PASSOK" != "Yes" ]; do
  280.  
  281. CHOICES=`$DIALOGMENU --align=right $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  $TEXT"Please complete all the fields properly. \n\n<b>Very Important note: </b>Capital letters, spaces and special characters are not allowed in the user name, user real name or name computer, does not support special characters or spaces, but supports uppercase letters" --form \
  282. --field=:LBL "" \
  283. --field="Password for Root":H \
  284. --field="Password for Root again":H \
  285. --field=:LBL "" \
  286. --field="New User Real Name" \
  287. --field="New Username" \
  288. --field="Password for new user":H \
  289. --field="Password for new user again":H \
  290. --field="Enable sudo:":CB "" "" "" "" "" "" "no"!"yes" \
  291. --field="Automatic login:":CB "yes"!"no" \
  292. --field="Animated boot (Splash):":CB "no"!"yes" \
  293. --field=:LBL "" \
  294. --field="Host Name for the computer"`
  295.  
  296. if [ "$?" = "0" ]; then
  297. TARGETROOTPASS=`echo $CHOICES | cut -d "|" -f 2`
  298. TARGETROOTPASS2=`echo $CHOICES | cut -d "|" -f 3`
  299. TARGETUSERFULLNAME=`echo $CHOICES | cut -d "|" -f 5`
  300. TARGETUSER=`echo $CHOICES | cut -d "|" -f 6`
  301. TARGETPASS=`echo $CHOICES | cut -d "|" -f 7`
  302. TARGETPASS2=`echo $CHOICES | cut -d "|" -f 8`
  303. USERSUDO=`echo $CHOICES | cut -d "|" -f 9`
  304. AUTOINI=`echo $CHOICES | cut -d "|" -f 10`
  305. SPLASH=`echo $CHOICES | cut -d "|" -f 11`
  306. TARGETHOSTNAME=`echo $CHOICES | cut -d "|" -f 13`
  307. else
  308.   exit 1
  309. fi
  310.  
  311. [ "$TARGETROOTPASS" != "" ] && \
  312. [ "$TARGETROOTPASS" = "$TARGETROOTPASS2" ] && \
  313. [ "$TARGETUSERFULLNAME" != "" ] && \
  314. [[ "$TARGETUSERFULLNAME" = "${TARGETUSERFULLNAME//[\' ]/}" ]] && \
  315. [ "$TARGETUSER" != "" ] && \
  316. [ "$TARGETUSER" != "$LIVE_USERNAME" ] && \
  317. [[ "$TARGETUSER" = "${TARGETUSER//[\' ]/}" ]] && \
  318. [ "$TARGETPASS" != "" ] && \
  319. [ "$TARGETPASS" = "$TARGETPASS2" ] && \
  320. [ "$TARGETROOTPASS" != "$TARGETPASS" ] && \
  321. [ "$TARGETHOSTNAME" != "" ] && \
  322. [[ "$TARGETHOSTNAME" = "${TARGETHOSTNAME//[\' ]/}" ]] && \
  323. PASSOK="Yes"
  324.  
  325. [ "$TARGETROOTPASS" = "" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Root password is blank. "
  326.  
  327. [ "$TARGETROOTPASS" != "$TARGETROOTPASS2" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Root passwords do not match. "
  328.  
  329. [ "$TARGETUSERFULLNAME" = "" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"User Full Name is blank. "
  330.  
  331. [[ "$TARGETUSERFULLNAME" != "${TARGETUSERFULLNAME//[\' ]/}" ]] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"The real user name can not contain spaces or special characters. "
  332.  
  333. [ "$TARGETUSER" = "" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Username is blank. "
  334.  
  335. [[ "$TARGETUSER" != "${TARGETUSER//[\' ]/}" ]] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"The username can not contain spaces or special characters. "
  336.  
  337. [ "$TARGETUSER" = "$LIVE_USERNAME" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Username can't be the same as the live username. "
  338.  
  339. [ "$TARGETPASS" = "" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"User password is blank. "
  340.  
  341. [ "$TARGETPASS" != "$TARGETPASS2" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"User passwords do not match. "
  342.  
  343. [ "$TARGETROOTPASS" = "$TARGETPASS" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Root and user passwords are the same.\n\nPlease use different password. "
  344.  
  345. [ "$TARGETHOSTNAME" = "" ] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"Host Name is blank. "
  346.  
  347. [[ "$TARGETHOSTNAME" != "${TARGETHOSTNAME//[\' ]/}" ]] && $DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"The computer name can not contain spaces or special characters. "
  348.  
  349. done
  350.  
  351. ###################1
  352.  
  353. ###################0
  354. INSTDISK=`echo $TARGETPART | cut -c 1-3`
  355. lsblk -l -o NAME,SIZE,TYPE,FSTYPE,GROUP | grep -e disk -e floppy -e part | grep -v loop | grep -v cdrom | grep -v $LIVECD | grep -v swap | sed "s/        \+/ '-----' /g" | awk '{print $1, $2, $3, $4, $5}' >> /tmp/diskgrub
  356.  
  357. sed -i 's/floppy/Externo/g' /tmp/diskgrub
  358.  
  359. while read diskgrub; do
  360.  
  361. diskmenugrub="$diskmenugrub $diskgrub"
  362. done < /tmp/diskgrub
  363. rm /tmp/diskgrub
  364.  
  365. GRUBSELT=""
  366. QUES=""
  367. until [[ "$GRUBSELT" !=  "" ||  "$QUES" =  "1" ]]
  368. do
  369.  
  370. GRUBSELT=`$DIALOGMENU --height=500 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0  --list --column=Disk --column=Size --column=Tipe --column=FsTipe --column="Información" --no-click $TEXT"Select a place to install Grub. If you do not know you are doing, it is recommended to install the master boot disk where the system is installed. That is, if the system is installed in <b>$TARGETPART</b> select <b>$INSTDISK</b> to install Grub. \nOn the other hand, if your system has a boot <b>EFI</b>, select the appropriate partition for this purpose." $diskmenugrub`
  371. QUES="$?"
  372. done
  373. if [ $QUES != 0 ]; then
  374. exit 0
  375. fi
  376.  
  377. GRUBSELT=`echo $GRUBSELT | cut -d "|" -f 1`
  378.  
  379. GRUBLOC="/dev/$GRUBSELT"
  380. ###################1
  381.  
  382.  
  383. ###################0
  384. #Timezone setting
  385. QUES=""
  386. $DIALOG $TITLE"$TITLETEXT" --button="Exit":2  --button="No":1 --button="yes":0 $TEXT"Is your system clock set to your current local time?. \nAnswering no will indicate it is set to UTC. "
  387. QUES=$?
  388. if [ $QUES = 2 ]; then
  389. exit 0
  390. fi
  391.  
  392. if [ $QUES = 0 ]; then
  393. if [ "$(grep "UTC" /etc/adjtime)" != "" ]; then
  394.  sed -i -e 's|UTC|LOCALTIME|g' /etc/adjtime
  395. fi
  396. else
  397. if [ "$(grep "LOCALTIME" /etc/adjtime)" != "" ]; then
  398.  sed -i -e 's|LOCALTIME|UTC|g' /etc/adjtime
  399. fi
  400. fi
  401. progressbar "Generating Time Zones... Please Wait. " &
  402. cat /usr/share/zoneinfo/zone.tab | awk '{print $3}' | grep "/" | sort > /tmp/dmdc.zoneinfo
  403. for i in `cat /tmp/dmdc.zoneinfo`; do
  404. ZONES="$ZONES $i `(TZ=$i date +"%A %R" | awk '{print $1, $2}')`"
  405. done
  406. killall -KILL tail
  407. ZONESINFO=""
  408. QUES=""
  409. until [[ "$ZONESINFO" !=  "" ||  "$QUES" =  "1" ]]
  410. do
  411. ZONESINFO=`$DIALOGMENU --width=400 --height=600 $TITLE"$TITLETEXT" --button="Exit":1 --button="OK":0 --list --column=Zone --column="Day" --column=Time  $TEXT"Please select a timezone for your system. " $ZONES`
  412. QUES="$?"
  413. done
  414.  
  415.  
  416. if [ $QUES != 0 ]; then
  417. exit 0
  418. fi
  419.  
  420. ZONESINFO=`echo $ZONESINFO | cut -d "|" -f 1`
  421.  
  422.  
  423. ###################1
  424.  
  425. ###################0
  426. ###########################################################################
  427. ###########################################################################
  428. progressbar "Processing the input data ... Please Wait. " &
  429. FNZONEINFO=`cat /tmp/dmdc.zoneinfo | sort | uniq`
  430. FNZONEINFO=`echo $FNZONEINFO | sed 's/ /!/g'`
  431. FNTARGETPART=`lsblk -l -o NAME,SIZE,TYPE,FSTYPE,GROUP | grep -e part -e floppy | grep -v loop | grep -v swap  | grep -v cdrom | grep -v $LIVECD | grep part | awk '{print $1}'`
  432. FNGRUB=`lsblk -l -o NAME,TYPE,SIZE,GROUP,FSTYPE | grep -e disk -e floppy -e part | grep -v loop | grep -v cdrom | grep -v $LIVECD | grep -v swap | awk '{print $1}'`
  433. FNSWAP=`lsblk -l -o NAME,SIZE,FSTYPE,GROUP | grep swap | awk '{print $1}'`
  434. if [[ "$SWAP" = "no" ]]; then
  435. YESNOSWAP="no"
  436. fi
  437. FNTARGETPART=`echo $FNTARGETPART | sed 's/ /!/g'`
  438. FNGRUB=`echo $FNGRUB | sed 's/ /!/g'`
  439. FNSWAP=`echo $FNSWAP | sed 's/ /!/g'`
  440. if [ "$HFSTYPE" = "" ]; then
  441. HFSTYPE='NoFormat'
  442. fi
  443. killall -KILL tail
  444.  
  445. hb3=""
  446. hb4=""
  447. hb6=""
  448. QUES=""
  449. while [[ "$hb3" != "${hb3//[\' ]/}" || "$hb4" != "${hb4//[\' ]/}" || "$hb7" != "${hb7//[\' ]/}" || "$hb3" = "" ||  "$hb4" = "" ||  "$hb7" = "" ]]
  450. do
  451. CONFIR=`$DIALOG --align=right --columns=2 $TITLE"$TITLETEXT" --button="Abort":1 --button="Install":0 $TEXT"\nPlease verify that the information is correct. If you intend to modify some data, make sure you do it correctly. " \
  452. --form \
  453. --field=:LBL "" \
  454. --field="<b>Current user configuration</b>":LBL "" \
  455. --field="User Real Name:" $TARGETUSERFULLNAME \
  456. --field="Username:" $TARGETUSER \
  457. --field="Automatic login:":CB $AUTOINI!"yes"!"no" \
  458. --field="Enable user sudo:":CB $USERSUDO!"yes"!"no" \
  459. --field="Name for computer:" $TARGETHOSTNAME  \
  460. --field=:LBL "" \
  461. --field="<b>Currently selected time zone:</b>":LBL "" \
  462. --field="Time zone:":CB $ZONESINFO!$FNZONEINFO \
  463. --field=:LBL "" \
  464. --field="                ":LBL "" \
  465. --field="                ":LBL "" \
  466. --field="                ":LBL "" \
  467. --field="<b>Settings the physical installation</b>":LBL "" \
  468. --field="The system will be installed in:":CB $TARGETPART!$FNTARGETPART   \
  469. --field="System File Format:":CB $FSTYPES!ext2!ext3!ext4  \
  470. --field=:LBL "" \
  471. --field="The HOME will be installed in:":CB $HOMEPART!$FNTARGETPART  \
  472. --field="Format partition HOME:":CB "$HFSTYPE"!NoFormat!ext2!ext3!ext4  \
  473. --field=:LBL "" \
  474. --field="Swap:":CB $SWAP!$FNSWAP  \
  475. --field="Use Swap:":CB $YESNOSWAP!"yes"!"no"  \
  476. --field=:LBL "" \
  477. --field="Use Splash:":CB $SPLASH!"yes"!"no" \
  478. --field="The GRUB will be installed in:":CB $GRUBSELT!$FNGRUB`
  479.  
  480. QUES="$?"
  481. if [ $QUES != 0 ]; then
  482. exit 0
  483. fi
  484.  
  485. hb3=`echo $CONFIR | cut -d "|" -f 3`
  486. hb4=`echo $CONFIR | cut -d "|" -f 4`
  487. hb5=`echo $CONFIR | cut -d "|" -f 5`
  488. hb6=`echo $CONFIR | cut -d "|" -f 6`
  489. hb7=`echo $CONFIR | cut -d "|" -f 7`
  490.  
  491. hb10=`echo $CONFIR | cut -d "|" -f 10`
  492.  
  493. hb16=`echo $CONFIR | cut -d "|" -f 16`
  494. hb17=`echo $CONFIR | cut -d "|" -f 17`
  495.  
  496. hb19=`echo $CONFIR | cut -d "|" -f 19`
  497. hb20=`echo $CONFIR | cut -d "|" -f 20`
  498.  
  499. hb22=`echo $CONFIR | cut -d "|" -f 22`
  500. hb23=`echo $CONFIR | cut -d "|" -f 23`
  501.  
  502. hb25=`echo $CONFIR | cut -d "|" -f 25`
  503. hb26=`echo $CONFIR | cut -d "|" -f 26`
  504.  
  505. done
  506.  
  507. if [[ $hb3 != $TARGETUSERFULLNAME || $hb4 != $TARGETUSER || $hb5 != $AUTOINI || $hb6 != $USERSUDO || $hb7 != $TARGETHOSTNAME || $hb10 != $ZONESINFO || $hb16 != $TARGETPART || $hb17 != $FSTYPES || $hb19 != $HOMEPART || $hb20 != $HFSTYPE || $hb22 != $SWAP || $hb23 != $YESNOSWAP || $hb25 != $SPLASH || $hb26 != $GRUBSELT ]]; then
  508. QUES=""
  509. $DIALOG $TITLE"$TITLETEXT" --button="Abort":1 --button="Install":0  $TEXT"There have been changes in the above data. \nIf you are certain changes press <b>Install</b>."
  510. QUES="$?"
  511. if [ $QUES != 0 ]; then
  512. exit 0
  513. fi
  514.  
  515.  
  516. TARGETUSERFULLNAME=$hb3
  517. TARGETUSER=$hb4
  518. AUTOINI=$hb5
  519. USERSUDO=$hb6
  520. TARGETHOSTNAME=$hb7
  521.  
  522. ZONESINFO=$hb10
  523.  
  524. TARGETPART=$hb16
  525. FSTYPES=$hb17
  526.  
  527. HOMEPART=$hb19
  528.  
  529. SPLASH=$hb25
  530. GRUBLOC="/dev/$hb26"
  531.  
  532. if [ "$hb19" = "$hb16" ]; then
  533. HFSTYPE="NoFormat"
  534. else
  535. HFSTYPE=$hb20
  536. fi
  537.  
  538. if [[ "$hb22" = "no" || "$hb23" = "no" ]]; then
  539. YESNOSWAP="no"
  540. else
  541. SWAP=$hb22
  542. YESNOSWAP=$hb23
  543. fi
  544.  
  545. fi
  546. ###########################################################################
  547. ###########################################################################
  548. ###################1
  549.  
  550.  
  551. ###################0
  552.  
  553.  
  554. echo "$ZONESINFO" > /etc/timezone
  555. cp /usr/share/zoneinfo/$ZONESINFO /etc/localtime
  556.  
  557.  
  558.       if [ "$YESNOSWAP" = "yes" ] ; then
  559. progressbar "Configuring <b>SWAP</b>. Please Wait... " &
  560. sleep 2
  561. #mkswap /dev/$SWAP
  562. swapon /dev/$SWAP
  563.          fi
  564. killall -KILL tail
  565.  
  566.  
  567. cp -f /etc/mdm/mdm.conf /tmp/mdm.conf
  568.  
  569. if [ "$AUTOINI" = "yes" ]; then
  570. sed -i 's/AutomaticLogin=dmdc/AutomaticLogin='$TARGETUSER'/g' /tmp/mdm.conf
  571. else
  572. sed -i -e 's/AutomaticLogin=dmdc/AutomaticLogin='$TARGETUSER'/g' -e 's/AutomaticLoginEnable=true/AutomaticLoginEnable=false/g' /tmp/mdm.conf
  573. fi
  574.  
  575.  
  576. if [ "$SPLASH" = "yes" ]; then
  577. cat > /etc/default/grub <<FOO
  578. # If you change this file, run 'update-grub' afterwards to update
  579. # /boot/grub/grub.cfg.
  580. # For full documentation of the options in this file, see:
  581. #   info -f grub -n 'Simple configuration'
  582.  
  583. GRUB_DEFAULT=0
  584. GRUB_TIMEOUT=5
  585. GRUB_DISTRIBUTOR=\`lsb_release -i -s 2> /dev/null || echo Debian\`
  586. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash \\\$vt_handoff"
  587. GRUB_CMDLINE_LINUX="init=/bin/systemd vga=792"
  588.  
  589. # Uncomment to enable BadRAM filtering, modify to suit your needs
  590. # This works with Linux (no patch required) and with any kernel that obtains
  591. # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
  592. #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
  593.  
  594. # Uncomment to disable graphical terminal (grub-pc only)
  595. #GRUB_TERMINAL=console
  596.  
  597. # The resolution used on graphical terminal
  598. # note that you can use only modes which your graphic card supports via VBE
  599. # you can see them in real GRUB with the command \`vbeinfo'
  600. #GRUB_GFXMODE=640x480
  601.  
  602. # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
  603. #GRUB_DISABLE_LINUX_UUID=true
  604.  
  605. # Uncomment to disable generation of recovery mode menu entries
  606. #GRUB_DISABLE_RECOVERY="true"
  607.  
  608. # Uncomment to get a beep at grub start
  609. #GRUB_INIT_TUNE="480 440 1"
  610.  
  611. FOO
  612.  
  613. else
  614. cat > /etc/default/grub <<FOO
  615. # If you change this file, run 'update-grub' afterwards to update
  616. # /boot/grub/grub.cfg.
  617. # For full documentation of the options in this file, see:
  618. #   info -f grub -n 'Simple configuration'
  619.  
  620. GRUB_DEFAULT=0
  621. GRUB_TIMEOUT=5
  622. GRUB_DISTRIBUTOR=\`lsb_release -i -s 2> /dev/null || echo Debian\`
  623. GRUB_CMDLINE_LINUX_DEFAULT="quiet"
  624. GRUB_CMDLINE_LINUX="init=/bin/systemd vga=792"
  625.  
  626. # Uncomment to enable BadRAM filtering, modify to suit your needs
  627. # This works with Linux (no patch required) and with any kernel that obtains
  628. # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
  629. #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
  630.  
  631. # Uncomment to disable graphical terminal (grub-pc only)
  632. #GRUB_TERMINAL=console
  633.  
  634. # The resolution used on graphical terminal
  635. # note that you can use only modes which your graphic card supports via VBE
  636. # you can see them in real GRUB with the command \`vbeinfo'
  637. #GRUB_GFXMODE=640x480
  638.  
  639. # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
  640. #GRUB_DISABLE_LINUX_UUID=true
  641.  
  642. # Uncomment to disable generation of recovery mode menu entries
  643. #GRUB_DISABLE_RECOVERY="true"
  644.  
  645. # Uncomment to get a beep at grub start
  646. #GRUB_INIT_TUNE="480 440 1"
  647.  
  648. FOO
  649.  
  650. fi
  651.  
  652. progressbar "Formatting the partition: <b>$TARGETPART</b> para el sistema. \nPlease Wait... " &
  653.  
  654. if [ "`mount | grep $TARGETPART`" ]; then
  655. echo "Unmounting the partition we are going to use and format now"
  656. umount /dev/$TARGETPART
  657. fi
  658. mke2fs -t $FSTYPES /dev/$TARGETPART
  659. mkdir -p /TARGET
  660. sleep 2
  661. echo "Mounting the TARGET partition now"
  662. mount /dev/$TARGETPART /TARGET -o rw
  663. sleep 2
  664. echo "Using tune2fs to prevent the forced checks on boot"
  665. tune2fs -c 0 -i 0 /dev/$TARGETPART
  666. rm -rf "/TARGET/lost+found"
  667.  
  668.  
  669. killall -KILL tail
  670.  
  671. if [ "$HOMEPART" != "$TARGETPART" ]; then
  672. if [ "$HFSTYPE" != "NoFormat" ]; then
  673.  
  674. progressbar "Formatting the partition: <b>$HOMEPART</b> for <b>HOME</b>. \nPlease Wait... " &
  675.  
  676. if [ "`mount | grep $HOMEPART`" ]; then
  677. echo "Unmounting the partition we are going to use and format now"
  678. umount /dev/$HOMEPART
  679. fi
  680. mke2fs -t $HFSTYPE /dev/$HOMEPART
  681. fi
  682. echo "Mounting the TARGET home partition now"
  683. mkdir -p /TARGET/home
  684. mount /dev/$HOMEPART /TARGET/home -o rw
  685. tune2fs -c 0 -i 0 /dev/$HOMEPART
  686. rm -rf "/TARGET/home/lost+found"
  687. sleep 2
  688.  
  689. killall -KILL tail
  690.  
  691. fi
  692.  
  693.  
  694. #TARGETCDROM=`cat /proc/mounts | grep "/live/image" | awk '{print $1}'`
  695. TARGETCDROM="/dev/cdrom"
  696.  
  697. sleep 1
  698.  
  699. killall -KILL tail
  700.  
  701.  
  702. #testmode=`grep "1000" /etc/passwd | grep -v "Live"`
  703.  
  704. cat > /var/log/dmdc-installer.log <<FOO
  705. ==============================
  706. DMDc-Installer log file
  707. ==============================
  708. LIVEMODE=DIST
  709. ==============================================================
  710. TARGETUSER=$TARGETUSER
  711. ==============================================================
  712. TARGETHOSTNAME=$TARGETHOSTNAME
  713. ==============================================================
  714. SWAP=$SWAP
  715. ==============================================================
  716. TARGETPART=$TARGETPART
  717. ==============================================================
  718. FSTYPES=$FSTYPES
  719. ==============================================================
  720. HOMEPART=$HOMEPART
  721. ==============================================================
  722. HFSTYPE=$HFSTYPE
  723. ==============================================================
  724. AUTOINI=$AUTOINI
  725. ==============================================================
  726. USERSUDO=$USERSUDO
  727. ==============================================================
  728. SPLASH=$SPLASH
  729. ==============================================================
  730. GRUBLOC=$GRUBLOC
  731. ==============================================================
  732. FOO
  733.  
  734. echo "==============================================================" >> /var/log/dmdc-installer.log
  735. echo "MOUNTS" >> /var/log/dmdc-installer.log
  736. echo "==============================================================" >> /var/log/dmdc-installer.log
  737. mount >> /var/log/dmdc-installer.log
  738. echo "==============================================================" >> /var/log/dmdc-installer.log
  739. echo "LSBLK listing" >> /var/log/dmdc-installer.log
  740. echo "==============================================================" >> /var/log/dmdc-installer.log
  741. ###3# 'fdisk' no funciona con disco 'GDT' utilizaremos entonces 'lsblk'
  742. lsblk -l -o NAME,TYPE,SIZE,FSTYPE,GROUP >> /var/log/dmdc-installer.log
  743. echo "==============================================================" >> /var/log/dmdc-installer.log
  744. echo "live config listing" >> /var/log/dmdc-installer.log
  745. echo "==============================================================" >> /var/log/dmdc-installer.log
  746. cat /etc/live/config.conf >> /var/log/dmdc-installer.log
  747. echo "==============================================================" >> /var/log/dmdc-installer.log
  748. echo "End of Log" >> /var/log/dmdc-installer.log
  749. echo "==============================================================" >> /var/log/dmdc-installer.log
  750.  
  751.  
  752. progressbar "Copy files to the target disk <b>$TARGETPART</b>. \nPlease Wait... " &
  753. # copy the live system to the hd
  754. echo "Copying the live system to the hard drive now."
  755. echo "This may take a while so please wait until completed."
  756. rsync -a / /TARGET --ignore-existing --exclude=/{TARGET,lib/live/mount,live,cdrom,mnt,proc,run,sys,media}
  757.  
  758. mkdir -p /TARGET/{proc,mnt,lib/live/mount,run,sys,media/cdrom}
  759.  
  760. killall -KILL tail
  761.  
  762. progressbar "Completing the installation. Please Wait... " &
  763.  
  764.  
  765. mount -o bind /proc /TARGET/proc
  766. mount -o bind /dev /TARGET/dev
  767. mount -o bind /sys /TARGET/sys
  768. rm -f /TARGET/etc/fstab
  769. rm -f /TARGET/etc/profile.d/zz-live.sh
  770.  
  771. ###7# Creamos fstab con la SWAP
  772.          if [ "$YESNOSWAP" = "yes" ] ; then
  773.  
  774. #create the new fstab
  775. if [ "$HOMEPART" = "$TARGETPART" ]; then
  776. cat > /TARGET/etc/fstab <<FOO
  777. # /etc/fstab: static file system information.
  778. #
  779. # <file system> <mount point>   <type>  <options>       <dump>  <pass>
  780.  
  781. proc /proc proc defaults 0 0
  782. # /dev/$TARGETPART
  783. UUID=`blkid -s UUID -o value /dev/$TARGETPART` / $FSTYPES relatime,errors=remount-ro 0 1
  784. # /dev/$SWAP
  785. UUID=`blkid -s UUID -o value /dev/$SWAP` none swap sw 0 0
  786. # cdrom
  787. $TARGETCDROM /media/cdrom udf,iso9660 user,noauto,exec,utf8 0 0
  788.  
  789. FOO
  790.  
  791. else
  792.  
  793. cat > /TARGET/etc/fstab <<FOO
  794. # /etc/fstab: static file system information.
  795. #
  796. # <file system> <mount point>   <type>  <options>       <dump>  <pass>
  797.  
  798. proc /proc proc defaults 0 0
  799. # /dev/$TARGETPART
  800. UUID=`blkid -s UUID -o value /dev/$TARGETPART` / $FSTYPES relatime,errors=remount-ro 0 1
  801. # /dev/$HOMEPART home
  802. UUID=`blkid -s UUID -o value /dev/$HOMEPART` /home `lsblk -l -o FSTYPE /dev/$HOMEPART | grep -v FSTYPE | awk '{print $1}'` relatime 0 0
  803. # /dev/$SWAP
  804. UUID=`blkid -s UUID -o value /dev/$SWAP` none swap sw 0 0
  805. # cdrom
  806. $TARGETCDROM /media/cdrom udf,iso9660 user,noauto,exec,utf8 0 0
  807.  
  808. FOO
  809.  
  810. fi
  811.  
  812.          else
  813.  
  814. if [ "$HOMEPART" = "$TARGETPART" ]; then
  815. cat > /TARGET/etc/fstab <<FOO
  816. # /etc/fstab: static file system information.
  817. #
  818. # <file system> <mount point>   <type>  <options>       <dump>  <pass>
  819.  
  820. proc /proc proc defaults 0 0
  821. # /dev/$TARGETPART
  822. UUID=`blkid -s UUID -o value /dev/$TARGETPART` / $FSTYPES relatime,errors=remount-ro 0 1
  823. # cdrom
  824. $TARGETCDROM /media/cdrom udf,iso9660 user,noauto,exec,utf8 0 0
  825.  
  826. FOO
  827.  
  828. else
  829.  
  830. cat > /TARGET/etc/fstab <<FOO
  831. # /etc/fstab: static file system information.
  832. #
  833. # <file system> <mount point>   <type>  <options>       <dump>  <pass>
  834.  
  835. proc /proc proc defaults 0 0
  836. # /dev/$TARGETPART
  837. UUID=`blkid -s UUID -o value /dev/$TARGETPART` / $FSTYPES relatime,errors=remount-ro 0 1
  838. # /dev/$HOMEPART home
  839. UUID=`blkid -s UUID -o value /dev/$HOMEPART` /home `lsblk -l -o FSTYPE /dev/$HOMEPART | grep -v FSTYPE | awk '{print $1}'` relatime 0 0
  840. # cdrom
  841. $TARGETCDROM /media/cdrom udf,iso9660 user,noauto,exec,utf8 0 0
  842.  
  843. FOO
  844.  
  845. fi
  846.          fi
  847.  
  848.  
  849.  
  850. # remove diverted update-initramfs as live-initramfs makes it a dummy file when booting the livecd
  851. if [ -f /TARGET/usr/sbin/update-initramfs.debian ]; then
  852. rm -f /TARGET/usr/sbin/update-initramfs
  853. fi
  854.  
  855. # remove diverted update-notifier as it is disabled by live-config
  856. if [ -f /TARGET/usr/lib/update-notifier/apt-check.debian ]; then
  857. rm -f /TARGET/usr/lib/update-notifier/apt-check
  858. fi
  859.  
  860. # remove diverted anacron as it is disabled by live-config
  861. if [ -f /TARGET/usr/sbin/anacron.debian ]; then
  862. rm -f /TARGET/usr/sbin/anacron
  863. fi
  864.  
  865. # fix adept_notifier by copying the file we saved when remastersys first ran as live-initramfs removes it
  866. if [ -f /TARGET/etc/remastersys/adept_notifier_auto.desktop ]; then
  867. mv /TARGET/etc/remastersys/adept_notifier_auto.desktop /TARGET/usr/share/autostart/adept_notifier_auto.desktop
  868. fi
  869.  
  870. # copy trackerd stuff as live-initramfs disables it
  871. if [ -f /TARGET/etc/remastersys/tracker-applet.desktop ]; then
  872. mv /TARGET/etc/remastersys/tracker-applet.desktop /TARGET/etc/xdg/autostart/tracker-applet.desktop
  873. fi
  874. if [ -f /TARGET/etc/remastersys/trackerd.desktop.xdg ]; then
  875. mv /TARGET/etc/remastersys/trackerd.desktop.xdg /TARGET/etc/xdg/autostart/trackerd.desktop
  876. fi
  877. if [ -f /TARGET/etc/remastersys/trackerd.desktop.share ]; then
  878. mv /TARGET/etc/remastersys/trackerd.desktop.share /TARGET/usr/share/autostart/trackerd.desktop
  879. fi
  880.  
  881. #restore original inittab as live-initramfs changes it
  882. cp /TARGET/usr/share/sysvinit/inittab /TARGET/etc/inittab
  883.  
  884. #check if this is a backup livecd or a dist livecd
  885. #if [ "$TARGETUSER" != "" ]; then
  886.  
  887. echo "$TARGETHOSTNAME" > /TARGET/etc/hostname
  888. echo "127.0.0.1 localhost" > /TARGET/etc/hosts
  889. echo "127.0.0.1 $TARGETHOSTNAME" >> /TARGET/etc/hosts
  890. touch /TARGET/etc/resolv.conf
  891.  
  892. #cleanup live polkit file from new install
  893. rm -f /TARGET/var/lib/polkit-1/localauthority/10-vendor.d/10-live-cd.pkla
  894.  
  895. if [ -f /etc/remastersys/remastersys-installer.conf ]; then
  896. . /etc/remastersys/remastersys-installer.conf
  897. fi
  898. if [ "$DEFAULTGROUPS" = "" ]; then
  899. DEFAULTGROUPS="audio,cdrom,dialout,floppy,video,plugdev,netdev"
  900. fi
  901.  
  902. if [ $USERSUDO = "yes" ]; then
  903. SUDO="sed -i '/User privilege specification/a\'$TARGETUSER'  ALL=(ALL:ALL) ALL' /etc/sudoers"
  904. else
  905. SUDO="echo"
  906. fi
  907.  
  908.  
  909. cat > /TARGET/bin/tempinstallerscript <<FOO
  910. #!/bin/bash
  911.  
  912. echo -e '$TARGETROOTPASS\n$TARGETROOTPASS\n' | passwd root
  913. userdel -f -r $LIVE_USERNAME
  914. sed -i '/'$LIVE_USERNAME'/d' /etc/sudoers
  915. groupadd -g 1000 $TARGETUSER
  916. useradd -u 1000 -g 1000 -c "$TARGETUSERFULLNAME,,," -G $DEFAULTGROUPS -s /bin/bash -m $TARGETUSER
  917. $SUDO
  918. echo -e "$TARGETPASS\n$TARGETPASS\n" | passwd $TARGETUSER
  919. dpkg-divert --remove --rename --quiet /usr/lib/update-notifier/apt-check
  920. dpkg-divert --remove --rename --quiet /usr/sbin/update-initramfs
  921. dpkg-divert --remove --rename --quiet /usr/sbin/anacron
  922. update-initramfs -t -c -k $(/bin/uname -r)
  923. shadowconfig on
  924.  
  925. FOO
  926.  
  927.  
  928. #else
  929.  
  930. #cat > /TARGET/bin/tempinstallerscript <<FOO
  931. #!/bin/bash
  932.  
  933. #dpkg-divert --remove --rename --quiet /usr/lib/update-notifier/apt-check
  934. #dpkg-divert --remove --rename --quiet /usr/sbin/update-initramfs
  935. #dpkg-divert --remove --rename --quiet /usr/sbin/anacron
  936. #update-initramfs -t -c -k $(uname -r)
  937. #for i in `ls -d /home/*`; do
  938.  
  939. #if [ /$i/.config/Thunar/volmanrc ]; then
  940.   #sed -i -e 's/FALSE/TRUE/g' /$i/.config/Thunar/volmanrc
  941.  # cp -f /$i/.config/volmanrc /root/.config/Thunar/volmanrc
  942. #fi
  943.  
  944. #done
  945.  
  946. ##FOO
  947.  
  948.  
  949. ##fi
  950.  
  951. chmod 755 /TARGET/bin/tempinstallerscript
  952. chroot /TARGET /bin/tempinstallerscript
  953. rm /TARGET/bin/tempinstallerscript
  954.  
  955. killall -KILL tail
  956.  
  957. # Setup grub
  958.  
  959. #if [ $GPT = "not" ]; then
  960.  
  961. cat > /tmp/dmdc-Grub-Install << FOO
  962. #!/bin/bash
  963. chroot /TARGET grub-install --force --no-floppy "$GRUBLOC"
  964. chroot /TARGET update-grub
  965. exit 0
  966. FOO
  967. #else
  968. #cat > /tmp/dmdc-Grub-Install << FOO
  969. ##!/bin/bash
  970. #chroot /TARGET grub-install --force --no-floppy "$GRUBLOC"
  971. #chroot /TARGET update-grub
  972. #exit 0
  973. #FOO
  974. #fi
  975.  
  976.  
  977. chmod +x /tmp/dmdc-Grub-Install
  978.  
  979.  
  980. progressbar "Installing and setting up GRUB... Please Wait. " &
  981. /tmp/dmdc-Grub-Install
  982. sleep 1
  983.  
  984. rm -rf /tmp/dmdc-Grub-Install
  985. rm -f /TARGET/usr/share/applications/dmdc-installer*.desktop
  986. rm -f /TARGET/etc/xdg/autostart/add-dmdc-installer.desktop
  987. rm -f /TARGET/usr/bin/remastersys*
  988. rm -rf /TARGET/etc/remastersys*
  989. rm -rf /TARGET/opt/dmdc-locales
  990. rm -f /TARGET/etc/live/config.conf
  991. mv -f /TARGET/opt/yad.png /TARGET/usr/share/pixmaps
  992. mv -f /TARGET/usr/bin/gksu /TARGET/usr/bin/gksuX
  993. mv -f /TARGET/usr/bin/gksuY /TARGET/usr/bin/gksu
  994. mv -f /tmp/mdm.conf /TARGET/etc/mdm/mdm.conf
  995.  
  996.  
  997.  
  998. sleep 1
  999. umount /TARGET/proc
  1000. sleep 1
  1001. umount /TARGET/dev
  1002. sleep 1
  1003. umount /TARGET/sys
  1004. sleep 1
  1005. umount /TARGET/home
  1006. sleep 1
  1007. umount /TARGET
  1008. sleep 1
  1009.  
  1010.  
  1011. killall -KILL tail
  1012.  
  1013.  
  1014. $DIALOG $TITLE"$TITLETEXT" $YESNO $TEXT"Installation is complete. \nIf everything went well you should have your new system installed and ready. \nDo you want to reboot now to try it out?. "
  1015.  
  1016. if [ $? != 0 ]; then
  1017. exit 0
  1018. else
  1019. reboot
  1020. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement