milis-kur 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565
  1. #!/bin/bash
  2. #
  3. # Milis Linux konsol kurulumu için Void Linux kurulum çatallaması
  4. # This installer forked from Void Linux installer for Milis Linux terminal based installation
  5. #
  6. # 2018 milisarge <milisarge@gmail.com>.
  7. # 2018 Aydin <yakar@live.com>
  8. #
  9. # 2012-2015 Juan Romero Pardines <xtraeme@Voidlinux.org>.
  10. # 2012 Dave Elusive <davehome@redthumb.info.tm>.
  11. #
  12. # All rights reserved.
  13. #
  14. # Redistribution and use in source and binary forms, with or without
  15. # modification, are permitted provided that the following conditions
  16. # are met:
  17. # 1. Redistributions of source code must retain the above copyright
  18. # notice, this list of conditions and the following disclaimer.
  19. # 2. Redistributions in binary form must reproduce the above copyright
  20. # notice, this list of conditions and the following disclaimer in the
  21. # documentation and/or other materials provided with the distribution.
  22. #
  23. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  24. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  25. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  26. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  28. # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  29. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  30. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  32. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. #-
  34. DIZIN=`dirname $(readlink -f $0)`
  35. dil=${LANG/.*}
  36. if [ $dil == "en_US" ];then
  37. # Language
  38. LANG_LANG="English"
  39. LANG_MENULABEL="Use UP and DOWN keys to navigate menus. Use TAB to switch between buttons and ENTER to select."
  40. LANG_INSTALLATION="Installation"
  41. LANG_BACK="Back"
  42. LANG_CHANGE="Change"
  43. LANG_DONE="Done"
  44. LANG_PROCESSING="processing as settings"
  45. LANG_SELECTPARTITION="Select the partition to edit"
  46. LANG_SELECTFILESYSTEM="Select the filesystem type for %s"
  47. LANG_MOUNTPOINT="Please specify the mount point for %s (use / as default)"
  48. LANG_NEWFILESYSTEM="Do you want to create a new filesystem on %s?"
  49. LANG_SELECTDISKPART="Select the disk to partition"
  50. LANG_SCANLOCALES="Scanning locales"
  51. LANG_MODPARTTABLE="Modify Partition Table on %s"
  52. LANG_PARTITIONDIALOG="\n
  53. %scfdisk will be executed in disk %s.%s\n\n
  54. For BIOS systems, MBR or GPT partition tables are supported.\n
  55. To use GPT on PC BIOS systems an empty partition of 1MB must be added\n
  56. at the first 2GB of the disk with the TOGGLE \`bios_grub' enabled.\n
  57. %sNOTE: you don't need this on EFI systems.%s\n\n
  58. For EFI systems GPT is mandatory and a FAT32 partition with at least\n
  59. 100MB must be created with the TOGGLE \`boot', this will be used as\n
  60. EFI System Partition. This partition must have mountpoint as \`/boot/efi'.\n\n
  61. At least 1 partition is required for the rootfs (/).\n
  62. For swap, RAM*2 must be really enough. For / 600MB are required.\n\n
  63. %sWARNING: /usr is not supported as a separate partition.%s\n\n"
  64. LANG_SELKEYMAP="Select your keymap"
  65. LANG_SELLOCAL="Select your locale"
  66. LANG_SELTZONE="Select your timezone"
  67. LANG_SETHOST="Set the machine hostname"
  68. LANG_ROOTPW="Enter the root password"
  69. LANG_ROOTPWAGAIN="Enter the root password again"
  70. LANG_PWNOTMATCH="Passwords do not match! Please enter again."
  71. LANG_LOGINNAME="Enter a primary login name"
  72. LANG_USERNAME="Enter a user name for login"
  73. LANG_PASSWORD="Enter the password for login"
  74. LANG_PASSWORDAGAIN="Enter the password for login again"
  75. LANG_GMEMLOGIN="Select group membership for login"
  76. LANG_BOOTLOADER="Select the disk to install the bootloader"
  77. LANG_BOOTLOTHER="Manage bootloader otherwise"
  78. LANG_BOOTLGRAPH="Use a graphical terminal for the boot loader?"
  79. LANG_GRUBINST="Running grub-install %s..."
  80. LANG_GRUBFAIL="%sERROR:%s failed to install GRUB to %s!\nCheck %s for errors."
  81. LANG_GRUBMKCONF="Running grub-mkconfig on %s..."
  82. LANG_GRUBMKCONFFAIL="%sERROR%s: failed to run grub-mkconfig!\nCheck %s for errors."
  83. LANG_NEWFSYSTEM="NEW FILESYSTEM"
  84. LANG_MOUNTEDON="%s (%s) mounted on %s as %s\n"
  85. LANG_FSYSTEMNOTSET="%sERROR:%s the mount point for the root filesystem (/) has not yet been configured."
  86. LANG_FSYSNOTSUPPORTED="%sERROR:%s /usr mount point has been configured but is not supported, please remove it to continue."
  87. LANG_FSYSEFINOTSET="%sERROR:%s The EFI System Partition has not yet been configured, please create it\n
  88. as FAT32, mountpoint /boot/efi and at least with 100MB of size."
  89. LANG_SWAPFAIL="%sERROR:%s failed to create swap on %s!\ncheck %s for errors."
  90. LANG_SWAPERROR="%sERROR:%s failed to activate swap on %s!\ncheck %s for errors."
  91. LANG_ERRLOGTITLE="Check %s for details ..."
  92. LANG_CREATEFSYS="Creating filesystem %s on %s for %s ..."
  93. LANG_CREATEMKFS="Running %s..."
  94. LANG_CREATEFAIL="%sERROR:%s failed to create filesystem %s on %s!\ncheck %s for errors."
  95. LANG_MOUNTINGON="Mounting %s on %s (%s)..."
  96. LANG_MOUNTINGERR="%sERROR:%s failed to mount %s on %s! check %s for errors."
  97. LANG_SWAPDISABLING="Disabling swap space on %s..."
  98. LANG_SWAPUNMOUNTING="Unmounting %s..."
  99. LANG_PROGRESS="Progress: %d.%d%% (%d of %d files)\n"
  100. LANG_COUNTFILES="Counting files, please be patient ..."
  101. LANG_CPLIVEIMG="Copying live image to target rootfs."
  102. LANG_DHCPON="enabled"
  103. LANG_FSYSNOTCONF="%sRequired filesystems were not configured, please do so before starting the installation.%s"
  104. LANG_ROOTPWNOTCONF="%sThe root password has not been configured, please do so before starting the installation.%s"
  105. LANG_BOOTLNOTCONF="%sThe disk to install the bootloader has not been configured, please do so before starting the installation.%s"
  106. LANG_DESTROYWARN="%sThe following operations will be executed:%s\n\n
  107. %s\n
  108. %sWARNING: data on partitions will be COMPLETELY DESTROYED for new \
  109. filesystems.%s\n\n
  110. %sDo you want to continue?%s"
  111. LANG_RMTARGET="Removing %s live user from targetdir ..."
  112. LANG_BUILDINGINITRAMFS="Rebuilding initramfs for target ..."
  113. LANG_APPLYSETTINGS="Applying installer settings..."
  114. LANG_ENABLESUDO="Enable sudo for login '%s'"
  115. LANG_INSTALLSUCCESS="%sMilis Linux has been installed successfully!%s\nDo you want to reboot the system?"
  116. LANG_MENUSETTINGS="Settings"
  117. LANG_INSTMENU="Milis Linux installation menu"
  118. LANG_MENUKEYBOARD="Keyboard"
  119. LANG_MENUHOSTNAME="Hostname"
  120. LANG_MENULOCALE="Locale"
  121. LANG_MENUTIMEZONE="Timezone"
  122. LANG_MENUROOTPW="RootPassword"
  123. LANG_MENUUSERACC="UserAccount"
  124. LANG_MENUBOOTLOADER="BootLoader"
  125. LANG_MENUPARTITION="Partition"
  126. LANG_MENUFILESYSTEM="Filesystems"
  127. LANG_MENUINSTALL="Install"
  128. LANG_MENUEXIT="Exit"
  129. LANG_KEYBOARDSET="Set system keyboard"
  130. LANG_HOSTSET="Set system hostname"
  131. LANG_LOCALESET="Set system locale"
  132. LANG_TIMEZONESET="Set system time zone"
  133. LANG_ROOTPWSET="Set system root password"
  134. LANG_USERNPWSET="Set primary user name and password"
  135. LANG_BOOTLOADERSET="Set disk to install bootloader"
  136. LANG_PARTITIONSET="Partition disk(s)"
  137. LANG_FSYSSET="Configure filesystems and mount points"
  138. LANG_INSTALLSETTINGS="Start installation with saved settings"
  139. LANG_EXITINST="Exit installation"
  140. LANG_ABORTINST="Abort Installation?"
  141. LANG_ERRDIALOG="ERROR: missing dialog command, exiting..."
  142. LANG_INSTMUSTROOT="Milis-installer must run as root"
  143. LANG_SAVEDSETTINGS="Saved settings for installation"
  144. LANG_ENTERMILIS="Milis Linux / $LANG_LANG"
  145. LANG_MAINDIALOG="\n
  146. Welcome to the Milis Linux installation. A simple and minimal \
  147. Linux distribution made from scratch and built from the source package tree \
  148. available for MPS, a new alternative package system.\n\n
  149. The installation should be pretty straightforward. If you are in trouble \
  150. please join us at %s#milisarge%s on %sirc.freenode.org%s or \
  151. ask the %sforums%s on the site.\n\n
  152. %shttp://www.milislinux.org%s\n\n"
  153. else
  154. # Language
  155. LANG_LANG="Türkçe"
  156. LANG_MENULABEL="YUKARI ve AŞAĞI ok tuşları ile menüde ilerleyebilirsiniz. TAB tuşu ile butonlar arasında geçebilir ve ENTER ile seçebilirsiniz."
  157. LANG_INSTALLATION="Yükleyici"
  158. LANG_BACK="Geri"
  159. LANG_CHANGE="Değiştir"
  160. LANG_DONE="Bitti"
  161. LANG_PROCESSING="ayar dosyası işleniyor"
  162. LANG_SELECTPARTITION="Düzenlenecek bölümü seçiniz"
  163. LANG_SELECTFILESYSTEM="%s için dosya sistemi türü seçiniz"
  164. LANG_MOUNTPOINT="Lütfen %s için atama (mount) noktası belirtiniz. (öntanımlı kullanım için / kullanın.)"
  165. LANG_NEWFILESYSTEM="%s üzerinde yeni dosya sistemi oluşturmak ister misiniz?"
  166. LANG_SELECTDISKPART="Bölümleme için disk seçiniz"
  167. LANG_SCANLOCALES="Yerel diller araştırılıyor"
  168. LANG_MODPARTTABLE="%s üzerinde bölümleme (partition) tablosunu düzenle"
  169. LANG_PARTITIONDIALOG="\n
  170. %scfdisk %s üzerinde çalıştırıldı.%s\n\n
  171. BIOS sistemler için MBR veya GPT bölümleme tablosu desteklenmektedir.\n
  172. PC BIOS sistemlerde GPT kullanmak için TOGGLE \`bios_grub' aktifse diskin\n
  173. ilk 2GB kısmına 1MB boş bir bölüm eklenmelidir.\n
  174. %sNOT: EFI sistemleri üzerinde buna ihtiyacınız yoktur.%s\n\n
  175. EFI sistemleri için GPT zorunludur ve TOGGLE \`boot' ile en az\n
  176. 100MB bir FAT32 bölümü oluşturulmalıdır, bu EFI sistem bölümü olarak\n
  177. kullanılacaktır. Bu bölüm \`/boot/efi' olarak atanmış (mount) olmalıdır.\n\n
  178. En az 1 bölüm kök dizini (rootfs) (/) için gereklidir.\n
  179. Swap için RAM*2 yeterlidir. Kök dizini (/) için 600MB zorunludur.\n\n
  180. %sUYARI: /usr ayrı bir bölümleme olarak desteklenmemektedir.%s\n\n"
  181. LANG_SELKEYMAP="Klavye düzenini seçiniz"
  182. LANG_SELLOCAL="Bölgesel ayarları seçiniz"
  183. LANG_SELTZONE="Zaman diliminizi seçiniz"
  184. LANG_SETHOST="Bilgisayar adını giriniz"
  185. LANG_ROOTPW="Root parolasını giriniz"
  186. LANG_ROOTPWAGAIN="Root parolasını tekrar giriniz"
  187. LANG_PWNOTMATCH="Parolalar uyuşmamaktadır! Lütfen tekrar deneyiniz."
  188. LANG_LOGINNAME="Öncelikli kullanıcının adını giriniz"
  189. LANG_USERNAME="Kullanıcı adını giriniz"
  190. LANG_PASSWORD="Parolanızı giriniz"
  191. LANG_PASSWORDAGAIN="Parolanızı tekrar giriniz"
  192. LANG_GMEMLOGIN="Kullanıcının grup üyeliklerini seçiniz"
  193. LANG_BOOTLOADER="Önyükleyicinin (bootloader) yükleneceği diski seçiniz"
  194. LANG_BOOTLOTHER="Önyükleyici kullanma"
  195. LANG_BOOTLGRAPH="Terminalde önyükleyici için grafik arayüzü kullanmak ister misiniz?"
  196. LANG_GRUBINST="Çalıştırılıyor grub-install %s..."
  197. LANG_GRUBFAIL="%sHATA:%s %s GRUB kurulamadı!\nHata için %s kontrol ediniz."
  198. LANG_GRUBMKCONF="%s üzerinde grub-mkconfig çalıştırılıyor..."
  199. LANG_GRUBMKCONFFAIL="%sHATA%s: grub-mkconfig çalıştırılamadı!\nHata için %s kontrol ediniz."
  200. LANG_NEWFSYSTEM="YENİ DOSYA SİSTEMİ"
  201. LANG_MOUNTEDON="%s (%s) için atama noktası %s (%s)\n"
  202. LANG_FSYSTEMNOTSET="%sHATA:%s Root dosya sistemi (/) için atama noktası henüz ayarlanmadı."
  203. LANG_FSYSNOTSUPPORTED="%sHATA:%s /usr atama noktası ayarlandı fakat desteklenmiyor, lütfen kaldırıp devam ediniz."
  204. LANG_FSYSEFINOTSET="%sHATA:%s EFI sistem bölümlemesi henüz ayarlanmadı, lütfen FAT32 olarak oluşturun,\n
  205. /boot/efi atama noktası en az 100MB olamalıdır."
  206. LANG_SWAPFAIL="%sHATA:%s swap alanı %s üzerinde oluşturulamadı!\nHata için %s kontrol ediniz."
  207. LANG_SWAPERROR="%sHATA:%s swap alanı %s üzerinde aktif edilemedi!\nHata için %s kontrol ediniz."
  208. LANG_ERRLOGTITLE="Detaylar için %s kontrol ediniz ..."
  209. LANG_CREATEFSYS="Dosya sistemi %s %s üzerinde %s için oluşturuluyor..."
  210. LANG_CREATEMKFS="%s çalıştırılıyor..."
  211. LANG_CREATEFAIL="%sHATA:%s failed to create filesystem %s on %s!\nHata için %s kontrol ediniz."
  212. LANG_MOUNTINGON="Atanıyor %s %s üzerine (%s)..."
  213. LANG_MOUNTINGERR="%sHATA:%s %s %s üzerine atanamadı! Hata için %s kontrol ediniz."
  214. LANG_SWAPDISABLING="%s üzerindeki swap alanı iptal ediliyor..."
  215. LANG_SWAPUNMOUNTING="%s ataması ayrılıyor (unmount)..."
  216. LANG_PROGRESS="İlerleme: %d.%d%% (dosyalar %d / %d)\n"
  217. LANG_COUNTFILES="Dosyalar hesaplanıyor, lütfen sabırlı olunuz ..."
  218. LANG_CPLIVEIMG="Canlı imaj hedef kök dizine (rootfs) kopyalanıyor."
  219. LANG_DHCPON="aktifleşti"
  220. LANG_FSYSNOTCONF="%sGerekli dosya sistemleri yapılandırılmadı, lütfen yüklemeye başlamadan önce yapılandırınız.%s"
  221. LANG_ROOTPWNOTCONF="%sRoot parola yapılandırılmamış, lütfen yüklemeye başlamadan önce yapılandırınız.%s"
  222. LANG_BOOTLNOTCONF="%sÖnyükleyiciyi yüklemek için disk yapılandırılmamış, lütfen yüklemeye başlamadan önce yapılandırınız.%s"
  223. LANG_DESTROYWARN="%sAşağıdaki operasyon çalıştırılacak:%s\n\n
  224. %s\n
  225. %sUYARI: Yeni dosya sistemi için bölümlerdeki veri TAMAMEN SİLİNECEKTİR.%s\n\n
  226. %sDevam etmek istiyor musunuz?%s"
  227. LANG_RMTARGET="Hedef dizin için %s canlı kullanıcısı kaldırılıyor ..."
  228. LANG_BUILDINGINITRAMFS="Hedef için initramfs oluşturuluyor ..."
  229. LANG_APPLYSETTINGS="Yükleyici ayarları uygulanıyor..."
  230. LANG_ENABLESUDO="Giriş için sudo '%s' aktifleştiriliyor"
  231. LANG_INSTALLSUCCESS="%sMilis Linux başarıyla yüklendi!%s\nSistemi yeniden başlatmak ister misiniz?"
  232. LANG_MENUSETTINGS="Ayarlar"
  233. LANG_INSTMENU="Milis Linux Yükleyici Menüsü"
  234. LANG_MENUKEYBOARD="Klavye"
  235. LANG_MENUHOSTNAME="BilgisayarAdı"
  236. LANG_MENULOCALE="BölgeselAyarlar" #"Bölgesel Ayarlar"
  237. LANG_MENUTIMEZONE="ZamanDilimi"
  238. LANG_MENUROOTPW="RootParolası"
  239. LANG_MENUUSERACC="KullanıcıHesabı"
  240. LANG_MENUBOOTLOADER="Önyükleyici"
  241. LANG_MENUPARTITION="Bölümleme"
  242. LANG_MENUFILESYSTEM="DosyaSistemi"
  243. LANG_MENUINSTALL="Yükle"
  244. LANG_MENUEXIT="Çıkış"
  245. LANG_KEYBOARDSET="Klavye ayarlarını seçiniz"
  246. LANG_HOSTSET="Bilgisayar adını giriniz"
  247. LANG_LOCALESET="Bölgesel ayarları seçiniz"
  248. LANG_TIMEZONESET="Zaman dilimini seçiniz"
  249. LANG_ROOTPWSET="Root parolarını giriniz"
  250. LANG_USERNPWSET="Öncelikli kullanıcı adı ve parolayı giriniz"
  251. LANG_BOOTLOADERSET="Önyükleyici için disk seçiniz"
  252. LANG_PARTITIONSET="Disk bölümleme"
  253. LANG_FSYSSET="Dosya sistemi ve atama (mount) noktası ayarları"
  254. LANG_INSTALLSETTINGS="Kayıtlı ayarlar ile yüklemeye başla"
  255. LANG_EXITINST="Yükleyiciden çık"
  256. LANG_ABORTINST="Yüklemekten vazgeç?"
  257. LANG_ERRDIALOG="HATA: dialog komutu bulunamadı, çıkış yapılıyor..."
  258. LANG_INSTMUSTROOT="Milis-yükleyici root hakları ile çalıştırılmalıdır"
  259. LANG_SAVEDSETTINGS="Yükleme için ayarlar kaydedildi"
  260. LANG_ENTERMILIS="Milis Linux / $LANG_LANG"
  261. LANG_MAINDIALOG="\n
  262. Milis Linux kurulumuna hoş geldiniz. Sıfırdan hazırlanan, kolay ve \
  263. minimal bir Linux dağıtımıdır ve yeni bir alternatif paket sistemi olan \
  264. MPS için kullanılabilen kaynak paketlerinden üretilmiştir.\n\n
  265. Kurulum oldukça basittir. Eğer yardıma ihtiyacınız olursa %sirc.freenode.org%s \
  266. %s#milisarge%s kanalımıza katılabilir veya sitemizdeki %sforumlardan%s yardım alabilirsiniz.\n\n
  267. %shttp://www.milislinux.org%s\n\n"
  268. fi
  269. # menülerin işlem görme durumları.
  270. HOSTNAME_YAPILDI=
  271. KEYBOARD_YAPILDI=
  272. LOCALE_YAPILDI=
  273. TIMEZONE_YAPILDI=
  274. ROOTPASSWORD_YAPILDI=
  275. USERLOGIN_YAPILDI=
  276. USERPASSWORD_YAPILDI=
  277. USERNAME_YAPILDI=
  278. USERGROUPS_YAPILDI=
  279. BOOTLOADER_YAPILDI=
  280. PARTITIONS_YAPILDI=
  281. FILESYSTEMS_YAPILDI=
  282. FORMAT_ONAY=
  283. YEBASLAT_ONAY=
  284. DOSYADAN_KURULUM=
  285. HEDEF=/mnt/target
  286. LOG=/dev/tty9
  287. if [ ! -z $1 ];then
  288. AYAR_DOSYASI=$1
  289. if [ -f $AYAR_DOSYASI ];then
  290. echo "$AYAR_DOSYASI $LANG_PROCESSING ......."
  291. FORMAT_ONAY="HAYIR"
  292. YEBASLAT_ONAY="HAYIR"
  293. DOSYADAN_KURULUM="EVET"
  294. fi
  295. else
  296. AYAR_DOSYASI=/tmp/.kurulum.conf
  297. if [ ! -f $AYAR_DOSYASI ]; then
  298. touch -f $AYAR_DOSYASI
  299. fi
  300. fi
  301. ANSWER=$(mktemp -t vinstall-XXXXXXXX || exit 1)
  302. TARGET_FSTAB=$(mktemp -t vinstall-fstab-XXXXXXXX || exit 1)
  303. if [ -f /etc/milis-surum ];then
  304. MILIS_SURUM=$(cat /etc/milis-surum)
  305. else
  306. MILIS_SURUM="Milis 2.0 Deneme Sürüm"
  307. fi
  308. if [ -f /etc/canli_kullanici ];then
  309. CANLI_KULLANICI=$(cat /etc/canli_kullanici)
  310. else
  311. CANLI_KULLANICI="root"
  312. fi
  313. trap "DIE" INT TERM QUIT
  314. # konsol log yazmasının kapatılması
  315. if [ -w /proc/sys/kernel/printk ]; then
  316. echo 0 >/proc/sys/kernel/printk
  317. fi
  318. # EFIli sistem tesbiti
  319. if [ -e /sys/firmware/efi/systab ]; then
  320. EFI_SYSTEM=1
  321. EFI_FW_BITS=$(cat /sys/firmware/efi/fw_platform_size)
  322. if [ $EFI_FW_BITS -eq 32 ]; then
  323. EFI_TARGET=i386-efi
  324. else
  325. EFI_TARGET=x86_64-efi
  326. fi
  327. fi
  328. # menü renkleri
  329. BLACK="\Z0"
  330. RED="\Z1"
  331. GREEN="\Z2"
  332. YELLOW="\Z3"
  333. BLUE="\Z4"
  334. MAGENTA="\Z5"
  335. CYAN="\Z6"
  336. WHITE="\Z7"
  337. BOLD="\Zb"
  338. REVERSE="\Zr"
  339. UNDERLINE="\Zu"
  340. RESET="\Zn"
  341. # menü pencere özellikleri
  342. MENULABEL="${BOLD}${LANG_MENULABEL}${RESET}"
  343. MENUSIZE="14 60 0"
  344. INPUTSIZE="8 60"
  345. MSGBOXSIZE="8 70"
  346. YESNOSIZE="$INPUTSIZE"
  347. WIDGET_SIZE="10 70"
  348. DIALOG() {
  349. rm -f $ANSWER
  350. dialog --colors --keep-tite --no-shadow --no-mouse \
  351. --backtitle "${BOLD}${WHITE}Milis Linux ${LANG_INSTALLATION} ($MILIS_SURUM)${RESET}" \
  352. --cancel-label "$LANG_BACK" --aspect 20 "$@" 2>$ANSWER
  353. return $?
  354. }
  355. INFOBOX() {
  356. dialog --colors --no-shadow --no-mouse \
  357. --backtitle "${BOLD}${WHITE}Milis Linux ${LANG_INSTALLATION} ($MILIS_SURUM)${RESET}" \
  358. --title "${TITLE}" --aspect 20 --infobox "$@"
  359. }
  360. DIE() {
  361. rval=$1
  362. [ -z "$rval" ] && rval=0
  363. clear
  364. rm -f $ANSWER $TARGET_FSTAB
  365. # printk yeniden aktif etme
  366. if [ -w /proc/sys/kernel/printk ]; then
  367. echo 4 >/proc/sys/kernel/printk
  368. fi
  369. umount_filesystems
  370. exit $rval
  371. }
  372. set_option() {
  373. if grep -Eq "^${1}.*" $AYAR_DOSYASI; then
  374. sed -i -e "/^${1}.*/d" $AYAR_DOSYASI
  375. fi
  376. echo "${1} ${2}" >>$AYAR_DOSYASI
  377. }
  378. get_option() {
  379. echo $(grep -E "^${1}.*" $AYAR_DOSYASI|sed -e "s|${1}||")
  380. }
  381. # ISO-639'e göre dil isimleri
  382. iso639_language() {
  383. case "$1" in
  384. aa) echo "Afar" ;;
  385. af) echo "Afrikaans" ;;
  386. an) echo "Aragonese" ;;
  387. ar) echo "Arabic" ;;
  388. ast) echo "Asturian" ;;
  389. be) echo "Belgian" ;;
  390. bg) echo "Bulgarian" ;;
  391. bhb) echo "Bhili" ;;
  392. br) echo "Breton" ;;
  393. bs) echo "Bosnian" ;;
  394. ca) echo "Catalan" ;;
  395. cs) echo "Czech" ;;
  396. cy) echo "Welsh" ;;
  397. da) echo "Danish" ;;
  398. de) echo "German" ;;
  399. el) echo "Greek" ;;
  400. en) echo "English" ;;
  401. es) echo "Spanish" ;;
  402. et) echo "Estonian" ;;
  403. eu) echo "Basque" ;;
  404. fi) echo "Finnish" ;;
  405. fo) echo "Faroese" ;;
  406. fr) echo "French" ;;
  407. ga) echo "Irish" ;;
  408. gd) echo "Scottish Gaelic" ;;
  409. gl) echo "Galician" ;;
  410. gv) echo "Manx" ;;
  411. he) echo "Hebrew" ;;
  412. hr) echo "Croatian" ;;
  413. hsb) echo "Upper Sorbian" ;;
  414. hu) echo "Hungarian" ;;
  415. id) echo "Indonesian" ;;
  416. is) echo "Icelandic" ;;
  417. it) echo "Italian" ;;
  418. iw) echo "Hebrew" ;;
  419. ja) echo "Japanese" ;;
  420. ka) echo "Georgian" ;;
  421. kk) echo "Kazakh" ;;
  422. kl) echo "Kalaallisut" ;;
  423. ko) echo "Korean" ;;
  424. ku) echo "Kurdish" ;;
  425. kw) echo "Cornish" ;;
  426. lg) echo "Ganda" ;;
  427. lt) echo "Lithuanian" ;;
  428. lv) echo "Latvian" ;;
  429. mg) echo "Malagasy" ;;
  430. mi) echo "Maori" ;;
  431. mk) echo "Macedonian" ;;
  432. ms) echo "Malay" ;;
  433. mt) echo "Maltese" ;;
  434. nb) echo "Norwegian Bokmål" ;;
  435. nl) echo "Dutch" ;;
  436. nn) echo "Norwegian Nynorsk" ;;
  437. oc) echo "Occitan" ;;
  438. om) echo "Oromo" ;;
  439. pl) echo "Polish" ;;
  440. pt) echo "Portugese" ;;
  441. ro) echo "Romanian" ;;
  442. ru) echo "Russian" ;;
  443. sk) echo "Slovak" ;;
  444. sl) echo "Slovenian" ;;
  445. so) echo "Somali" ;;
  446. sq) echo "Albanian" ;;
  447. st) echo "Southern Sotho" ;;
  448. sv) echo "Swedish" ;;
  449. tcy) echo "Tulu" ;;
  450. tg) echo "Tajik" ;;
  451. th) echo "Thai" ;;
  452. tl) echo "Tagalog" ;;
  453. tr) echo "Türkçe" ;;
  454. uk) echo "Ukrainian" ;;
  455. uz) echo "Uzbek" ;;
  456. wa) echo "Walloon" ;;
  457. xh) echo "Xhosa" ;;
  458. yi) echo "Yiddish" ;;
  459. zh) echo "Chinese" ;;
  460. zu) echo "Zulu" ;;
  461. *) echo "$1" ;;
  462. esac
  463. }
  464. # ISO-3166 ülke kodları yerel ayarlar için
  465. iso3166_country() {
  466. case "$1" in
  467. AD) echo "Andorra" ;;
  468. AE) echo "United Arab Emirates" ;;
  469. AL) echo "Albania" ;;
  470. AR) echo "Argentina" ;;
  471. AT) echo "Austria" ;;
  472. AU) echo "Australia" ;;
  473. BA) echo "Bonsia and Herzegovina" ;;
  474. BE) echo "Belgium" ;;
  475. BG) echo "Bulgaria" ;;
  476. BH) echo "Bahrain" ;;
  477. BO) echo "Bolivia" ;;
  478. BR) echo "Brazil" ;;
  479. BW) echo "Botswana" ;;
  480. BY) echo "Belarus" ;;
  481. CA) echo "Canada" ;;
  482. CH) echo "Switzerland" ;;
  483. CL) echo "Chile" ;;
  484. CN) echo "China" ;;
  485. CO) echo "Colombia" ;;
  486. CR) echo "Costa Rica" ;;
  487. CY) echo "Cyprus" ;;
  488. CZ) echo "Czech Republic" ;;
  489. DE) echo "Germany" ;;
  490. DJ) echo "Djibouti" ;;
  491. DK) echo "Denmark" ;;
  492. DO) echo "Dominican Republic" ;;
  493. DZ) echo "Algeria" ;;
  494. EC) echo "Ecuador" ;;
  495. EE) echo "Estonia" ;;
  496. EG) echo "Egypt" ;;
  497. ES) echo "Spain" ;;
  498. FI) echo "Finland" ;;
  499. FO) echo "Faroe Islands" ;;
  500. FR) echo "France" ;;
  501. GB) echo "Great Britain" ;;
  502. GE) echo "Georgia" ;;
  503. GL) echo "Greenland" ;;
  504. GR) echo "Greece" ;;
  505. GT) echo "Guatemala" ;;
  506. HK) echo "Hong Kong" ;;
  507. HN) echo "Honduras" ;;
  508. HR) echo "Croatia" ;;
  509. HU) echo "Hungary" ;;
  510. ID) echo "Indonesia" ;;
  511. IE) echo "Ireland" ;;
  512. IL) echo "Israel" ;;
  513. IN) echo "India" ;;
  514. IQ) echo "Iraq" ;;
  515. IS) echo "Iceland" ;;
  516. IT) echo "Italy" ;;
  517. JO) echo "Jordan" ;;
  518. JP) echo "Japan" ;;
  519. KE) echo "Kenya" ;;
  520. KR) echo "Korea, Republic of" ;;
  521. KW) echo "Kuwait" ;;
  522. KZ) echo "Kazakhstan" ;;
  523. LB) echo "Lebanon" ;;
  524. LT) echo "Lithuania" ;;
  525. LU) echo "Luxembourg" ;;
  526. LV) echo "Latvia" ;;
  527. LY) echo "Libya" ;;
  528. MA) echo "Morocco" ;;
  529. MG) echo "Madagascar" ;;
  530. MK) echo "Macedonia" ;;
  531. MT) echo "Malta" ;;
  532. MX) echo "Mexico" ;;
  533. MY) echo "Malaysia" ;;
  534. NI) echo "Nicaragua" ;;
  535. NL) echo "Netherlands" ;;
  536. NO) echo "Norway" ;;
  537. NZ) echo "New Zealand" ;;
  538. OM) echo "Oman" ;;
  539. PA) echo "Panama" ;;
  540. PE) echo "Peru" ;;
  541. PH) echo "Philippines" ;;
  542. PL) echo "Poland" ;;
  543. PR) echo "Puerto Rico" ;;
  544. PT) echo "Portugal" ;;
  545. PY) echo "Paraguay" ;;
  546. QA) echo "Qatar" ;;
  547. RO) echo "Romania" ;;
  548. RU) echo "Russian Federation" ;;
  549. SA) echo "Saudi Arabia" ;;
  550. SD) echo "Sudan" ;;
  551. SE) echo "Sweden" ;;
  552. SG) echo "Singapore" ;;
  553. SI) echo "Slovenia" ;;
  554. SK) echo "Slovakia" ;;
  555. SO) echo "Somalia" ;;
  556. SV) echo "El Salvador" ;;
  557. SY) echo "Syria" ;;
  558. TH) echo "Thailand" ;;
  559. TJ) echo "Tajikistan" ;;
  560. TN) echo "Tunisia" ;;
  561. TR) echo "Türkiye" ;;
  562. TW) echo "Taiwan" ;;
  563. UA) echo "Ukraine" ;;
  564. UG) echo "Uganda" ;;
  565. US) echo "United States of America" ;;
  566. UY) echo "Uruguay" ;;
  567. UZ) echo "Uzbekistan" ;;
  568. VE) echo "Venezuela" ;;
  569. YE) echo "Yemen" ;;
  570. ZA) echo "South Africa" ;;
  571. ZW) echo "Zimbabwe" ;;
  572. *) echo "$1" ;;
  573. esac
  574. }
  575. show_disks() {
  576. local dev size sectorsize gbytes
  577. # IDE
  578. for dev in $(ls /sys/block|grep -E '^hd'); do
  579. if [ "$(cat /sys/block/$dev/device/media)" = "disk" ]; then
  580. # sektör, alan bilgisinin bulunması;
  581. echo "/dev/$dev"
  582. size=$(cat /sys/block/$dev/size)
  583. sectorsize=$(cat /sys/block/$dev/queue/hw_sector_size)
  584. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  585. echo "size:${gbytes}GB;sector_size:$sectorsize"
  586. fi
  587. done
  588. # SATA/SCSI ve Virtual diskleri (virtio)
  589. for dev in $(ls /sys/block|grep -E '^([sv]|xv)d|mmcblk|nvme'); do
  590. echo "/dev/$dev"
  591. size=$(cat /sys/block/$dev/size)
  592. sectorsize=$(cat /sys/block/$dev/queue/hw_sector_size)
  593. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  594. echo "size:${gbytes}GB;sector_size:$sectorsize"
  595. done
  596. # cciss(4) aygıtları
  597. for dev in $(ls /dev/cciss 2>/dev/null|grep -E 'c[0-9]d[0-9]$'); do
  598. echo "/dev/cciss/$dev"
  599. size=$(cat /sys/block/cciss\!$dev/size)
  600. sectorsize=$(cat /sys/block/cciss\!$dev/queue/hw_sector_size)
  601. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  602. echo "size:${gbytes}GB;sector_size:$sectorsize"
  603. done
  604. }
  605. show_partitions() {
  606. local dev fstype fssize p part
  607. set -- $(show_disks)
  608. while [ $# -ne 0 ]; do
  609. disk=$(basename $1)
  610. shift 2
  611. # ATA/SCSI/SATA
  612. for p in /sys/block/$disk/$disk*; do
  613. if [ -d $p ]; then
  614. part=$(basename $p)
  615. fstype=$(lsblk -nfr /dev/$part|awk '{print $2}'|head -1)
  616. [ "$fstype" = "iso9660" ] && continue
  617. [ "$fstype" = "crypto_LUKS" ] && continue
  618. [ "$fstype" = "LVM2_member" ] && continue
  619. fssize=$(lsblk -nr /dev/$part|awk '{print $4}'|head -1)
  620. echo "/dev/$part"
  621. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  622. fi
  623. done
  624. done
  625. # Device Mapper
  626. for p in /dev/mapper/*; do
  627. part=$(basename $p)
  628. [ "${part}" = "live-rw" ] && continue
  629. [ "${part}" = "live-base" ] && continue
  630. [ "${part}" = "control" ] && continue
  631. fstype=$(lsblk -nfr $p|awk '{print $2}'|head -1)
  632. fssize=$(lsblk -nr $p|awk '{print $4}'|head -1)
  633. echo "${p}"
  634. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  635. done
  636. # Software raid (md)
  637. for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do
  638. part=$(basename $p)
  639. if cat /proc/mdstat|grep -qw $part; then
  640. fstype=$(lsblk -nfr /dev/$part|awk '{print $2}')
  641. [ "$fstype" = "crypto_LUKS" ] && continue
  642. [ "$fstype" = "LVM2_member" ] && continue
  643. fssize=$(lsblk -nr /dev/$part|awk '{print $4}')
  644. echo "$p"
  645. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  646. fi
  647. done
  648. # cciss(4) aygıtları
  649. for part in $(ls /dev/cciss 2>/dev/null|grep -E 'c[0-9]d[0-9]p[0-9]+'); do
  650. fstype=$(lsblk -nfr /dev/cciss/$part|awk '{print $2}')
  651. [ "$fstype" = "crypto_LUKS" ] && continue
  652. [ "$fstype" = "LVM2_member" ] && continue
  653. fssize=$(lsblk -nr /dev/cciss/$part|awk '{print $4}')
  654. echo "/dev/cciss/$part"
  655. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  656. done
  657. if [ -e /sbin/lvs ]; then
  658. # LVM
  659. lvs --noheadings|while read lvname vgname perms size; do
  660. echo "/dev/mapper/${vgname}-${lvname}"
  661. echo "size:${size};fstype:lvm"
  662. done
  663. fi
  664. }
  665. menu_filesystems() {
  666. local dev fstype fssize mntpoint reformat
  667. while true; do
  668. DIALOG --ok-label "$LANG_CHANGE" --cancel-label "$LANG_DONE" \
  669. --title " $LANG_SELECTPARTITION " --menu "$MENULABEL" \
  670. ${MENUSIZE} $(show_partitions)
  671. [ $? -ne 0 ] && return
  672. dev=$(cat $ANSWER)
  673. DIALOG --title " `printf "$LANG_SELECTFILESYSTEM" "$dev"` " \
  674. --menu "$MENULABEL" ${MENUSIZE} \
  675. "btrfs" "Oracle Btrfs" \
  676. "ext2" "Linux ext2 (no journaling)" \
  677. "ext3" "Linux ext3 (journal)" \
  678. "ext4" "Linux ext4 (journal)" \
  679. "f2fs" "Flash-Friendly Filesystem" \
  680. "swap" "Linux swap" \
  681. "vfat" "FAT32" \
  682. "xfs" "SGI's XFS"
  683. if [ $? -eq 0 ]; then
  684. fstype=$(cat $ANSWER)
  685. else
  686. continue
  687. fi
  688. if [ "$fstype" != "swap" ]; then
  689. DIALOG --inputbox "`printf "$LANG_MOUNTPOINT" "$dev"`:" ${INPUTSIZE}
  690. if [ $? -eq 0 ]; then
  691. mntpoint=$(cat $ANSWER)
  692. elif [ $? -eq 1 ]; then
  693. continue
  694. fi
  695. else
  696. mntpoint=swap
  697. fi
  698. DIALOG --yesno "`printf "$LANG_NEWFILESYSTEM" "$dev"`" ${YESNOSIZE}
  699. if [ $? -eq 0 ]; then
  700. reformat=1
  701. elif [ $? -eq 1 ]; then
  702. reformat=0
  703. else
  704. continue
  705. fi
  706. fssize=$(lsblk -nr $dev|awk '{print $4}')
  707. set -- "$fstype" "$fssize" "$mntpoint" "$reformat"
  708. if [ -n "$1" -a -n "$2" -a -n "$3" -a -n "$4" ]; then
  709. local bdev=$(basename $dev)
  710. local ddev=$(basename $(dirname $dev))
  711. if [ "$ddev" != "dev" ]; then
  712. sed -i -e "/^MOUNTPOINT \/dev\/${ddev}\/${bdev}.*/d" $AYAR_DOSYASI
  713. else
  714. sed -i -e "/^MOUNTPOINT \/dev\/${bdev}.*/d" $AYAR_DOSYASI
  715. fi
  716. echo "MOUNTPOINT $dev $1 $2 $3 $4" >>$AYAR_DOSYASI
  717. fi
  718. done
  719. }
  720. menu_partitions() {
  721. DIALOG --title " $LANG_SELECTDISKPART " \
  722. --menu "$MENULABEL" ${MENUSIZE} $(show_disks)
  723. if [ $? -eq 0 ]; then
  724. local device=$(cat $ANSWER)
  725. DIALOG --title "`printf "$LANG_MODPARTTABLE" "$device"`" --msgbox "`printf "$LANG_PARTITIONDIALOG" "${BOLD}" "$device" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}"`" 18 80
  726. if [ $? -eq 0 ]; then
  727. while true; do
  728. clear; cfdisk $device; PARTITIONS_YAPILDI=1
  729. break
  730. done
  731. else
  732. return
  733. fi
  734. fi
  735. }
  736. menu_keymap() {
  737. local _keymaps="$(find /usr/share/kbd/keymaps/ -type f -iname "*.map.gz" -printf "%f\n" | sed 's|.map.gz||g' | sort)"
  738. local _KEYMAPS=
  739. for f in ${_keymaps}; do
  740. _KEYMAPS="${_KEYMAPS} ${f} -"
  741. done
  742. while true; do
  743. DIALOG --title " $LANG_SELKEYMAP " --menu "$MENULABEL" 14 70 14 ${_KEYMAPS}
  744. if [ $? -eq 0 ]; then
  745. set_option KEYMAP "$(cat $ANSWER)"
  746. loadkeys "$(cat $ANSWER)"
  747. KEYBOARD_YAPILDI=1
  748. break
  749. else
  750. return
  751. fi
  752. done
  753. }
  754. set_keymap() {
  755. local KEYMAP=$(get_option KEYMAP)
  756. if [ -f /etc/vconsole.conf ]; then
  757. sed -i -e "s|KEYMAP=.*|KEYMAP=$KEYMAP|g" $HEDEF/etc/vconsole.conf
  758. else
  759. sed -i -e "s|KEYMAP=.*|KEYMAP=$KEYMAP|g" $HEDEF/etc/sysconfig/rc.site
  760. fi
  761. }
  762. menu_locale() {
  763. local _locales="$(locale -a)"
  764. local LOCALES ISO639 ISO3166
  765. local TMPFILE=$(mktemp -t vinstall-XXXXXXXX || exit 1)
  766. INFOBOX "$LANG_SCANLOCALES ..." 4 60
  767. for f in ${_locales}; do
  768. eval $(echo $f | awk 'BEGIN { FS="." } \
  769. { FS="_"; split($1, a); printf "ISO639=%s ISO3166=%s\n", a[1], a[2] }')
  770. echo "$f|$(iso639_language $ISO639) ($(iso3166_country $ISO3166))|" >> $TMPFILE
  771. done
  772. clear
  773. # ISO-639^e göre dil isimlerinin sıralanması
  774. LOCALES=$(sort -t '|' -k 2 < $TMPFILE | xargs | sed -e's/| /|/g')
  775. rm -f $TMPFILE
  776. while true; do
  777. (IFS="|"; DIALOG --title " $LANG_SELLOCAL " --menu "$MENULABEL" 18 70 18 ${LOCALES})
  778. if [ $? -eq 0 ]; then
  779. set_option LOCALE "$(cat $ANSWER)"
  780. LOCALE_YAPILDI=1
  781. break
  782. else
  783. return
  784. fi
  785. done
  786. }
  787. set_locale() {
  788. local LOCALE=$(get_option LOCALE)
  789. rm -rf $HEDEF/etc/profile.d/i18n.sh
  790. echo "export LANG=$LOCALE" > $HEDEF/etc/profile.d/i18n.sh
  791. echo "export LC_ALL=$LOCALE" >> $HEDEF/etc/profile.d/i18n.sh
  792. echo "export LANGUAGE=$LOCALE" >> $HEDEF/etc/profile.d/i18n.sh
  793. # environment içinde de ayarlanması
  794. echo "LANG=$LOCALE" > $HEDEF/etc/environment
  795. }
  796. menu_timezone() {
  797. local _tzones="$(cd /usr/share/zoneinfo; find Africa/ America/ Antarctica/ Arctic/ Asia/ Atlantic/ Australia/ Europe/ Indian/ Pacific/ posix/ -type f | sort)"
  798. local _TIMEZONES=
  799. for f in ${_tzones}; do
  800. _TIMEZONES="${_TIMEZONES} ${f} -"
  801. done
  802. while true; do
  803. DIALOG --title " $LANG_SELTZONE " --menu "$MENULABEL" 14 70 14 ${_TIMEZONES}
  804. if [ $? -eq 0 ]; then
  805. set_option TIMEZONE "$(cat $ANSWER)"
  806. TIMEZONE_YAPILDI=1
  807. break
  808. else
  809. return
  810. fi
  811. done
  812. }
  813. set_timezone() {
  814. local TIMEZONE="$(get_option TIMEZONE)"
  815. rm -f $HEDEF/etc/localtime
  816. ln -s /usr/share/zoneinfo/$TIMEZONE $HEDEF/etc/localtime
  817. }
  818. menu_hostname() {
  819. while true; do
  820. DIALOG --inputbox "$LANG_SETHOST:" ${INPUTSIZE}
  821. if [ $? -eq 0 ]; then
  822. set_option HOSTNAME "$(cat $ANSWER)"
  823. HOSTNAME_YAPILDI=1
  824. break
  825. else
  826. return
  827. fi
  828. done
  829. }
  830. set_hostname() {
  831. echo "$(get_option HOSTNAME)" > $HEDEF/etc/hostname
  832. echo "127.0.0.1 $(get_option HOSTNAME)" >> /etc/hosts
  833. #sed -i -e "s|HOSTNAME=.*|HOSTNAME=\"$(get_option HOSTNAME)\"|g" $HEDEF/etc/sysconfig/network
  834. }
  835. menu_rootpassword() {
  836. local _firstpass _secondpass _desc
  837. while true; do
  838. if [ -z "${_firstpass}" ]; then
  839. _desc="$LANG_ROOTPW"
  840. else
  841. _desc="$LANG_ROOTPWAGAIN"
  842. fi
  843. DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE}
  844. if [ $? -eq 0 ]; then
  845. if [ -z "${_firstpass}" ]; then
  846. _firstpass="$(cat $ANSWER)"
  847. else
  848. _secondpass="$(cat $ANSWER)"
  849. fi
  850. if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then
  851. if [ "${_firstpass}" != "${_secondpass}" ]; then
  852. INFOBOX "$LANG_PWNOTMATCH" 6 60
  853. unset _firstpass _secondpass
  854. sleep 2 && clear && continue
  855. fi
  856. set_option ROOTPASSWORD "${_firstpass}"
  857. ROOTPASSWORD_YAPILDI=1
  858. break
  859. fi
  860. else
  861. return
  862. fi
  863. done
  864. }
  865. set_rootpassword() {
  866. echo "root:$(get_option ROOTPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  867. }
  868. menu_useraccount() {
  869. local _firstpass _secondpass _desc
  870. local _groups _status _group _checklist
  871. local _preset
  872. while true; do
  873. _preset=$(get_option USERLOGIN)
  874. [ -z "$_preset" ] && _preset=""
  875. DIALOG --inputbox "$LANG_LOGINNAME:" ${INPUTSIZE} "$_preset"
  876. if [ $? -eq 0 ]; then
  877. set_option USERLOGIN "$(cat $ANSWER)"
  878. USERLOGIN_YAPILDI=1
  879. break
  880. else
  881. return
  882. fi
  883. done
  884. while true; do
  885. _preset=$(get_option USERNAME)
  886. [ -z "$_preset" ] && _preset=""
  887. DIALOG --inputbox "$LANG_USERNAME '$(get_option USERLOGIN)' :" \
  888. ${INPUTSIZE} "$_preset"
  889. if [ $? -eq 0 ]; then
  890. set_option USERNAME "$(cat $ANSWER)"
  891. USERNAME_YAPILDI=1
  892. break
  893. else
  894. return
  895. fi
  896. done
  897. while true; do
  898. if [ -z "${_firstpass}" ]; then
  899. _desc="$LANG_PASSWORD '$(get_option USERLOGIN)'"
  900. else
  901. _desc="$LANG_PASSWORDAGAIN '$(get_option USERLOGIN)'"
  902. fi
  903. DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE}
  904. if [ $? -eq 0 ]; then
  905. if [ -z "${_firstpass}" ]; then
  906. _firstpass="$(cat $ANSWER)"
  907. else
  908. _secondpass="$(cat $ANSWER)"
  909. fi
  910. if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then
  911. if [ "${_firstpass}" != "${_secondpass}" ]; then
  912. INFOBOX "$LANG_PWNOTMATCH" 6 60
  913. unset _firstpass _secondpass
  914. sleep 2 && clear && continue
  915. fi
  916. set_option USERPASSWORD "${_firstpass}"
  917. USERPASSWORD_YAPILDI=1
  918. break
  919. fi
  920. else
  921. return
  922. fi
  923. done
  924. #_groups="wheel,audio,video,floppy,cdrom,optical,kvm"
  925. _groups="users,disk,network,floppy,fuse,video,lp,tty,audio,cdrom,scanner,adm,vboxusers,wheel"
  926. while true; do
  927. _desc="$LANG_GMEMLOGIN '$(get_option USERLOGIN)':"
  928. for _group in $(cat /etc/group); do
  929. _gid="$(echo ${_group} | cut -d: -f3)"
  930. _group="$(echo ${_group} | cut -d: -f1)"
  931. _status="$(echo ${_groups} | grep -w ${_group})"
  932. if [ -z "${_status}" ]; then
  933. _status=off
  934. else
  935. _status=on
  936. fi
  937. if [ -z "${_checklist}" ]; then
  938. _checklist="${_group} ${_group}:${_gid} ${_status}"
  939. else
  940. _checklist="${_checklist} ${_group} ${_group}:${_gid} ${_status}"
  941. fi
  942. done
  943. DIALOG --no-tags --checklist "${_desc}" 20 60 18 ${_checklist}
  944. if [ $? -eq 0 ]; then
  945. set_option USERGROUPS $(cat $ANSWER | sed -e's| |,|g')
  946. USERGROUPS_YAPILDI=1
  947. break
  948. else
  949. return
  950. fi
  951. done
  952. }
  953. set_useraccount() {
  954. USERLOGIN_YAPILDI=$(get_option USERLOGIN)
  955. USERPASSWORD_YAPILDI=$(get_option USERPASSWORD)
  956. USERNAME_YAPILDI=$(get_option USERNAME)
  957. USERGROUPS_YAPILDI=$(get_option USERGROUPS)
  958. [ -z "$USERLOGIN_YAPILDI" ] && return
  959. [ -z "$USERPASSWORD_YAPILDI" ] && return
  960. [ -z "$USERNAME_YAPILDI" ] && return
  961. [ -z "$USERGROUPS_YAPILDI" ] && return
  962. #chroot $HEDEF useradd -m -G $(get_option USERGROUPS) -c "$(get_option USERNAME)" $(get_option USERLOGIN)
  963. useradd -R $HEDEF -m -G $(get_option USERGROUPS) -c "$(get_option USERNAME)" $(get_option USERLOGIN)
  964. #chroot $HEDEF echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  965. echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  966. }
  967. menu_bootloader() {
  968. while true; do
  969. DIALOG --title " $LANG_BOOTLOADER" \
  970. --menu "$MENULABEL" ${MENUSIZE} $(show_disks) none "$LANG_BOOTLOTHER"
  971. if [ $? -eq 0 ]; then
  972. set_option BOOTLOADER "$(cat $ANSWER)"
  973. BOOTLOADER_YAPILDI=1
  974. break
  975. else
  976. return
  977. fi
  978. done
  979. while true; do
  980. DIALOG --yesno "$LANG_BOOTLGRAPH" ${YESNOSIZE}
  981. if [ $? -eq 0 ]; then
  982. set_option TEXTCONSOLE 0
  983. break
  984. elif [ $? -eq 1 ]; then
  985. set_option TEXTCONSOLE 1
  986. break
  987. else
  988. return
  989. fi
  990. done
  991. }
  992. set_bootloader() {
  993. local dev=$(get_option BOOTLOADER) grub_args="--force "
  994. if [ "$dev" = "none" ]; then return; fi
  995. # efi sistem ve efivar kontrolü
  996. if [ -n "$EFI_SYSTEM" ]; then
  997. grub_args="--force --target=$EFI_TARGET --efi-directory=/boot/efi --bootloader-id=BOOT --recheck"
  998. fi
  999. echo "`printf "$LANG_GRUBINST" "$grub_args $dev"`" >$LOG
  1000. chroot $HEDEF grub-install $grub_args $dev >$LOG 2>&1
  1001. if [ $? -ne 0 ]; then
  1002. DIALOG --msgbox "`printf "$LANG_GRUBFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1003. DIE 1
  1004. fi
  1005. echo "`printf "$LANG_GRUBMKCONF" "$HEDEF"`" >$LOG
  1006. chroot $HEDEF grub-mkconfig -o /boot/grub/grub.cfg >$LOG 2>&1
  1007. if [ $? -ne 0 ]; then
  1008. DIALOG --msgbox "`printf "$LANG_GRUBMKCONFFAIL" "${BOLD}${RED}" "${RESET}" "$LOG"`" ${MSGBOXSIZE}
  1009. DIE 1
  1010. fi
  1011. }
  1012. validate_filesystems() {
  1013. local mnts dev size fstype mntpt mkfs rootfound fmt
  1014. local usrfound efi_system_partition
  1015. unset TARGETFS
  1016. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1017. set -- ${mnts}
  1018. while [ $# -ne 0 ]; do
  1019. fmt=""
  1020. dev=$2; fstype=$3; size=$4; mntpt="$5"; mkfs=$6
  1021. shift 6
  1022. if [ "$mntpt" = "/" ]; then
  1023. rootfound=1
  1024. elif [ "$mntpt" = "/usr" ]; then
  1025. usrfound=1
  1026. elif [ "$fstype" = "vfat" -a "$mntpt" = "/boot/efi" ]; then
  1027. efi_system_partition=1
  1028. fi
  1029. if [ "$mkfs" -eq 1 ]; then
  1030. fmt="$LANG_NEWFSYSTEM: "
  1031. fi
  1032. if [ -z "$TARGETFS" ]; then
  1033. TARGETFS="`printf "$LANG_MOUNTEDON" "${fmt}$dev" "$size" "$mntpt" "${fstype}"`"
  1034. else
  1035. TARGETFS="`printf "$LANG_MOUNTEDON" "${TARGETFS}${fmt}${dev}" "$size" "$mntpt" "${fstype}"`"
  1036. fi
  1037. done
  1038. if [ -z "$rootfound" ]; then
  1039. DIALOG --msgbox "`printf "$LANG_FSYSTEMNOTSET" "${BOLD}${RED}" "${RESET}" `" ${MSGBOXSIZE}
  1040. return 1
  1041. elif [ -n "$usrfound" ]; then
  1042. DIALOG --msgbox "`printf "$LANG_FSYSNOTSUPPORTED" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1043. return 1
  1044. elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then
  1045. DIALOG --msgbox "`printf "$LANG_FSYSEFINOTSET" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1046. fi
  1047. FILESYSTEMS_YAPILDI=1
  1048. }
  1049. create_filesystems() {
  1050. local mnts dev mntpt fstype fspassno mkfs size rv uuid
  1051. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1052. set -- ${mnts}
  1053. while [ $# -ne 0 ]; do
  1054. dev=$2; fstype=$3; mntpt="$5"; mkfs=$6
  1055. shift 6
  1056. # swap bölümleme
  1057. if [ "$fstype" = "swap" ]; then
  1058. swapoff $dev >/dev/null 2>&1
  1059. if [ "$mkfs" -eq 1 ]; then
  1060. mkswap $dev >$LOG 2>&1
  1061. if [ $? -ne 0 ]; then
  1062. DIALOG --msgbox "`printf "$LANG_SWAPFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1063. DIE 1
  1064. fi
  1065. fi
  1066. swapon $dev >$LOG 2>&1
  1067. if [ $? -ne 0 ]; then
  1068. DIALOG --msgbox "`printf "$LANG_SWAPERROR" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1069. DIE 1
  1070. fi
  1071. # hedef fstaba girdi eklenmesi
  1072. uuid=$(blkid -o value -s UUID "$dev")
  1073. echo "UUID=$uuid none swap sw 0 0" >>$TARGET_FSTAB
  1074. continue
  1075. fi
  1076. if [ "$mkfs" -eq 1 ]; then
  1077. case "$fstype" in
  1078. btrfs) MKFS="mkfs.btrfs -f"; modprobe btrfs >$LOG 2>&1;;
  1079. ext2) MKFS="mke2fs -F"; modprobe ext2 >$LOG 2>&1;;
  1080. ext3) MKFS="mke2fs -F -j"; modprobe ext3 >$LOG 2>&1;;
  1081. ext4) MKFS="mke2fs -F -t ext4"; modprobe ext4 >$LOG 2>&1;;
  1082. f2fs) MKFS="mkfs.f2fs"; modprobe f2fs >$LOG 2>&1;;
  1083. vfat) MKFS="mkfs.vfat -F32"; modprobe vfat >$LOG 2>&1;;
  1084. xfs) MKFS="mkfs.xfs -f"; modprobe xfs >$LOG 2>&1;;
  1085. esac
  1086. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1087. INFOBOX "`printf "$LANG_CREATEFSYS" "$fstype" "$dev" "$mntpt"`" 8 60
  1088. echo "`printf "$LANG_CREATEMKFS" "$MKFS $dev"`" >$LOG
  1089. # hedef disk bölümü bağlı olabilir, çözmek için
  1090. mount | grep -q "$dev" && umount -l $dev
  1091. $MKFS $dev >$LOG 2>&1; rv=$?
  1092. if [ $rv -ne 0 ]; then
  1093. DIALOG --msgbox "`printf "$LANG_CREATEFAIL" "${BOLD}${RED}" "${RESET}" "$fstype" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1094. DIE 1
  1095. fi
  1096. fi
  1097. # rootfs nin bağlanması
  1098. [ "$mntpt" != "/" ] && continue
  1099. mkdir -p $HEDEF
  1100. echo "`printf "$LANG_MOUNTINGON" "$dev" "$mntpt" "$fstype"`" >$LOG
  1101. mount -t $fstype $dev $HEDEF >$LOG 2>&1
  1102. if [ $? -ne 0 ]; then
  1103. DIALOG --msgbox "`printf "$LANG_MOUNTINGERR" "${BOLD}${RED}" "${RESET}" "$dev" "${mntpt}" "$LOG"`" ${MSGBOXSIZE}
  1104. DIE 1
  1105. fi
  1106. # hedef fstaba girdi eklenmesi
  1107. uuid=$(blkid -o value -s UUID "$dev")
  1108. if [ "$fstype" = "f2fs" ]; then
  1109. fspassno=0
  1110. else
  1111. fspassno=1
  1112. fi
  1113. echo "UUID=$uuid $mntpt $fstype defaults 0 $fspassno" >>$TARGET_FSTAB
  1114. done
  1115. # dosya sistemlerinin hedefe bağlanması
  1116. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1117. set -- ${mnts}
  1118. while [ $# -ne 0 ]; do
  1119. dev=$2; fstype=$3; mntpt="$5"
  1120. shift 6
  1121. [ "$mntpt" = "/" -o "$fstype" = "swap" ] && continue
  1122. mkdir -p ${HEDEF}${mntpt}
  1123. echo "$LANG_MOUNTINGON" >$LOG
  1124. mount -t $fstype $dev ${HEDEF}${mntpt} >$LOG 2>&1
  1125. if [ $? -ne 0 ]; then
  1126. DIALOG --msgbox "$LANG_MOUNTINGERR" ${MSGBOXSIZE}
  1127. DIE
  1128. fi
  1129. # hedef fstaba girdi eklenmesi
  1130. uuid=$(blkid -o value -s UUID "$dev")
  1131. echo "UUID=$uuid $mntpt $fstype defaults 0 2" >>$TARGET_FSTAB
  1132. done
  1133. }
  1134. mount_filesystems() {
  1135. for f in sys proc dev; do
  1136. [ ! -d $HEDEF/$f ] && mkdir $HEDEF/$f
  1137. echo "Mounting $HEDEF/$f..." >$LOG
  1138. mount --bind /$f $HEDEF/$f >$LOG 2>&1
  1139. done
  1140. }
  1141. umount_filesystems() {
  1142. local f
  1143. for f in sys/fs/fuse/connections sys proc dev; do
  1144. echo "Unmounting $HEDEF/$f..." >$LOG
  1145. umount $HEDEF/$f >$LOG 2>&1
  1146. done
  1147. local mnts="$(grep -E '^MOUNTPOINT.*$' $AYAR_DOSYASI)"
  1148. set -- ${mnts}
  1149. while [ $# -ne 0 ]; do
  1150. local dev=$2; local fstype=$3; local mntpt=$5
  1151. shift 6
  1152. if [ "$fstype" = "swap" ]; then
  1153. echo "`printf "$LANG_SWAPDISABLING" "$dev" `" >$LOG
  1154. swapoff $dev >$LOG 2>&1
  1155. continue
  1156. fi
  1157. if [ "$mntpt" != "/" ]; then
  1158. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF/$mntpt" `" >$LOG
  1159. umount $HEDEF/$mntpt >$LOG 2>&1
  1160. fi
  1161. done
  1162. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF"`" >$LOG
  1163. umount $HEDEF >$LOG 2>&1
  1164. }
  1165. log_and_count() {
  1166. local progress whole tenth
  1167. while read line; do
  1168. #echo "$line" >$LOG
  1169. copy_count=$((copy_count + 1))
  1170. progress=$((1000 * copy_count / copy_total))
  1171. if [ "$progress" != "$copy_progress" ]; then
  1172. whole=$((progress / 10))
  1173. tenth=$((progress % 10))
  1174. printf "$LANG_PROGRESS" $whole $tenth $copy_count $copy_total
  1175. copy_progress=$progress
  1176. fi
  1177. echo "$copy_progress" >$LOG
  1178. done
  1179. }
  1180. copy_rootfs() {
  1181. local tar_in="--create --one-file-system --xattrs"
  1182. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1183. INFOBOX "$LANG_COUNTFILES" 4 60
  1184. copy_total=$(tar ${tar_in} -v -f /dev/null / 2>/dev/null | wc -l)
  1185. export copy_total copy_count=0 copy_progress=
  1186. clear
  1187. tar ${tar_in} -f - / 2>/dev/null | \
  1188. tar --extract --xattrs --xattrs-include='*' --preserve-permissions -v -f - -C $HEDEF | \
  1189. log_and_count | \
  1190. DIALOG --title "${TITLE}" \
  1191. --progressbox "$LANG_CPLIVEIMG" 5 60
  1192. if [ $? -ne 0 ]; then
  1193. DIE 1
  1194. fi
  1195. unset copy_total copy_count copy_percent
  1196. }
  1197. install_packages() {
  1198. local _grub= _syspkg=
  1199. if [ -n "$EFI_SYSTEM" ]; then
  1200. if [ $EFI_FW_BITS -eq 32 ]; then
  1201. _grub="grub-i386-efi"
  1202. else
  1203. _grub="grub-x86_64-efi"
  1204. fi
  1205. else
  1206. _grub="grub"
  1207. fi
  1208. mkdir -p $HEDEF/boot/grub
  1209. _arch=$(arch)
  1210. ### seçimli paket kurulumları yaptıralacak.
  1211. }
  1212. enable_dhcpd() {
  1213. ### dhcpd aktiv edilecek.
  1214. echo "dhcpd $LANG_DHCPON"
  1215. }
  1216. menu_install() {
  1217. # dosya sistemi hazır değilse devam edilmeyecek.
  1218. validate_filesystems || return 1
  1219. ROOTPASSWORD_YAPILDI="$(get_option ROOTPASSWORD)"
  1220. BOOTLOADER_YAPILDI="$(get_option BOOTLOADER)"
  1221. if [ -z "$FILESYSTEMS_YAPILDI" ]; then
  1222. DIALOG --msgbox "`printf "$LANG_FSYSNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1223. return 1
  1224. elif [ -z "$ROOTPASSWORD_YAPILDI" ]; then
  1225. DIALOG --msgbox "`printf "$LANG_ROOTPWNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1226. return 1
  1227. elif [ -z "$BOOTLOADER_YAPILDI" ]; then
  1228. DIALOG --msgbox "`printf "$LANG_BOOTLNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1229. return 1
  1230. fi
  1231. if [ -z "$FORMAT_ONAY" ]; then
  1232. DIALOG --yesno "`printf "$LANG_DESTROYWARN" "${BOLD}" "${RESET}" "${BOLD}${TARGETFS}${RESET}" "${BOLD}${RED}" "${RESET}" "${BOLD}" "${RESET}"`" 20 80 || return
  1233. fi
  1234. unset TARGETFS
  1235. # Dosya sistemlerinin oluşturulup-bağlanması
  1236. create_filesystems
  1237. # ağdan paket kurulum eklenecek.
  1238. KAYNAK="YEREL"
  1239. if [ $KAYNAK="YEREL" ]; then
  1240. # dosya sisteminin kopyalanması
  1241. copy_rootfs
  1242. USERNAME=$CANLI_KULLANICI
  1243. # Canlı kulanıcının silinmesi root değilse
  1244. if [ $USERNAME != "root" ];then
  1245. echo "`printf "$LANG_RMTARGET" "$USERNAME"`" >$LOG
  1246. chroot $HEDEF userdel -r $USERNAME >$LOG 2>&1
  1247. sed -i -e "/$USERNAME ALL=.*/d" $HEDEF/etc/sudoers
  1248. fi
  1249. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1250. INFOBOX "$LANG_BUILDINGINITRAMFS" 4 60
  1251. echo "$LANG_BUILDINGINITRAMFS" >$LOG
  1252. # gerekli dosya istemlerinin bağlanması
  1253. mount_filesystems
  1254. rm -f $HEDEF/boot/initramfs
  1255. rm -f $HEDEF/boot/kernel
  1256. cp /boot/kernel-* $HEDEF/boot/
  1257. chroot $HEDEF dracut --no-hostonly --add-drivers "ahci" -f /boot/initramfs --force >>$LOG 2>&1
  1258. chroot $HEDEF ln -s /boot/kernel-* /boot/kernel
  1259. rmdir $HEDEF/mnt/target
  1260. fi
  1261. INFOBOX "$LANG_APPLYSETTINGS" 4 60
  1262. # fstab ın hedef diske kopyalanması
  1263. install -Dm644 $TARGET_FSTAB $HEDEF/etc/fstab
  1264. # /tmp in tmpfs olarak bağlanması - milis2 de sorun verdi. ln: creating hard link `/usr/bin/abc' => `/tmp/abc#123/usr/bin/abc': Invalid cross-device link
  1265. # echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> $HEDEF/etc/fstab
  1266. # keymap, bölgesel ve yerel zaman ayarları, hostname, root-kullanıcı şifre
  1267. set_keymap
  1268. set_locale
  1269. set_timezone
  1270. set_hostname
  1271. set_rootpassword
  1272. set_useraccount
  1273. # Kullanıcı ve root için öntanımlı ayarların kopyalanması
  1274. #cp $HEDEF/etc/skel/.[bix]* $HEDEF/root
  1275. USERLOGIN="$(get_option USERLOGIN)"
  1276. mkdir -p $HEDEF/home/$USERLOGIN/
  1277. # todo!!! kull. ayarları updates/skel altından alınacak.
  1278. # todo!!! alias mps
  1279. # todo!!! source /etc/profile
  1280. if [ $CANLI_KULLANICI == "root" ];then
  1281. [ -d /root/.config ] && cp -rf /root/.config $HEDEF/home/$USERLOGIN/
  1282. [ -f /root/.xinitrc ] && cp -rf /root/.xinitrc $HEDEF/home/$USERLOGIN/
  1283. [ -f /root/.bashrc ] && cp -f /root/.bashrc $HEDEF/home/$USERLOGIN/
  1284. [ -f /root/.jwmrc ] && cp -rf /root/.jwmrc $HEDEF/home/$USERLOGIN/
  1285. if [ -d /run/initramfs/live/updates/root ];then
  1286. cp -rf /run/initramfs/live/updates/root/. $HEDEF/etc/skel/
  1287. cp -rf /run/initramfs/live/updates/root/. $HEDEF/home/$USERLOGIN/
  1288. fi
  1289. else
  1290. cp -rf /home/$CANLI_KULLANICI/.config $HEDEF/home/$USERLOGIN
  1291. cp -rf /run/initramfs/live/updates/home/$CANLI_KULLANICI/. $HEDEF/etc/skel/
  1292. cp -rf /run/initramfs/live/updates/home/$CANLI_KULLANICI/. $HEDEF/home/$USERLOGIN/
  1293. fi
  1294. # kurulum özgü dosyaların silinmesi
  1295. rm -f $HEDEF/root/bin/canli_kullanici.sh
  1296. rm -rf $HEDEF/etc/canli_kullanici
  1297. rm -rf $HEDEF/opt/Milis-Yukleyici
  1298. rm -f $HEDEF/root/Desktop/kurulum.desktop
  1299. rm -f $HEDEF/root/Masaüstü/kurulum.desktop
  1300. rm -f $HEDEF/home/$USERLOGIN/Desktop/kurulum.desktop
  1301. rm -f $HEDEF/home/$USERLOGIN/Masaüstü/kurulum.desktop
  1302. rm -f $HEDEF/root/Masaüstü/milis-kur.desktop
  1303. rm -f $HEDEF/etc/shadow- $HEDEF/etc/gshadow- $HEDEF/etc/passwd- $HEDEF/etc/group-
  1304. #sed -i "/^$USERLOGIN/d" $HEDEF/etc/security/opasswd
  1305. [ -f $HEDEF/etc/lightdm/lightdm.conf.orj ] && cp $HEDEF/etc/lightdm/lightdm.conf.orj $HEDEF/etc/lightdm/lightdm.conf
  1306. chroot $HEDEF chown $USERLOGIN:$USERLOGIN -R /home/$USERLOGIN
  1307. [ -d $HEDEF/dev/snd ] && chroot $HEDEF setfacl -m u:$USERLOGIN:rw /dev/snd/*
  1308. if [ -f $HEDEF/etc/sudoers ]; then
  1309. if [ -z "$(echo $(get_option USERGROUPS) | grep -w wheel)" -a -n "$USERLOGIN" ]; then
  1310. # wheel grubuna üye olamayan kullanıcı için sudo açılır.
  1311. echo "# `printf "$LANG_ENABLESUDO" "$USERLOGIN"`" >> $HEDEF/etc/sudoers
  1312. echo "$USERLOGIN ALL=(ALL) ALL" >> $HEDEF/etc/sudoers
  1313. else
  1314. # wheel grubuna üye olan kullanıcı için sudoers eklemesi yapılır.
  1315. sed -i $HEDEF/etc/sudoers \
  1316. -e "s;#.*%wheel ALL=(ALL) ALL;%wheel ALL=(ALL) ALL;"
  1317. fi
  1318. unset USERLOGIN
  1319. fi
  1320. # Text tabanlı açılışı aktif et seçiliyse
  1321. if [ "$(get_option TEXTCONSOLE)" = "1" ]; then
  1322. sed -i $HEDEF/etc/default/grub \
  1323. -e 's|#\(GRUB_TERMINAL_INPUT\).*|\1=console|' \
  1324. -e 's|#\(GRUB_TERMINAL_OUTPUT\).*|\1=console|'
  1325. fi
  1326. # Bootloader yüklemesi
  1327. set_bootloader
  1328. sync && sync && sync
  1329. # bağlanan dizinler çözülür
  1330. umount_filesystems
  1331. # sistemin kopyalandıktan sonra yebaşla sorusu
  1332. if [ -z "$YEBASLAT_ONAY" ]; then
  1333. DIALOG --yesno "`printf "$LANG_INSTALLSUCCESS" "${BOLD}" "${RESET}"`" ${YESNOSIZE}
  1334. if [ $? -eq 0 ]; then
  1335. shutdown -r now
  1336. else
  1337. return
  1338. fi
  1339. fi
  1340. }
  1341. menu() {
  1342. if [ -z "$DEFITEM" ]; then
  1343. DEFITEM="$LANG_MENUKEYBOARD"
  1344. fi
  1345. DIALOG --default-item $DEFITEM \
  1346. --extra-button --extra-label "$LANG_MENUSETTINGS" \
  1347. --title " $LANG_INSTMENU " \
  1348. --menu "$MENULABEL" 10 70 0 \
  1349. "$LANG_MENUKEYBOARD" "$LANG_KEYBOARDSET" \
  1350. "$LANG_MENUHOSTNAME" "$LANG_HOSTSET" \
  1351. "$LANG_MENULOCALE" "$LANG_LOCALESET" \
  1352. "$LANG_MENUTIMEZONE" "$LANG_TIMEZONESET" \
  1353. "$LANG_MENUROOTPW" "$LANG_ROOTPWSET" \
  1354. "$LANG_MENUUSERACC" "$LANG_USERNPWSET" \
  1355. "$LANG_MENUBOOTLOADER" "$LANG_BOOTLOADERSET" \
  1356. "$LANG_MENUPARTITION" "$LANG_PARTITIONSET" \
  1357. "$LANG_MENUFILESYSTEM" "$LANG_FSYSSET" \
  1358. "$LANG_MENUINSTALL" "$LANG_INSTALLSETTINGS" \
  1359. "$LANG_MENUEXIT" "$LANG_EXITINST"
  1360. if [ $? -eq 3 ]; then
  1361. # Ayarların gösterilmesi
  1362. cp $AYAR_DOSYASI /tmp/conf_hidden.$$;
  1363. sed -i "s/^ROOTPASSWORD.*/ROOTPASSWORD <-hidden->/" /tmp/conf_hidden.$$
  1364. DIALOG --title "$LANG_SAVEDSETTINGS" --textbox /tmp/conf_hidden.$$ 18 90
  1365. rm /tmp/conf_hidden.$$
  1366. return
  1367. fi
  1368. case $(cat $ANSWER) in
  1369. "$LANG_MENUKEYBOARD") menu_keymap && [ -n "$KEYBOARD_YAPILDI" ] && DEFITEM="$LANG_MENUHOSTNAME";;
  1370. "$LANG_MENUHOSTNAME") menu_hostname && [ -n "$HOSTNAME_YAPILDI" ] && DEFITEM="$LANG_MENULOCALE";;
  1371. "$LANG_MENULOCALE") menu_locale && [ -n "$LOCALE_YAPILDI" ] && DEFITEM="$LANG_MENUTIMEZONE";;
  1372. "$LANG_MENUTIMEZONE") menu_timezone && [ -n "$TIMEZONE_YAPILDI" ] && DEFITEM="$LANG_MENUROOTPW";;
  1373. "$LANG_MENUROOTPW") menu_rootpassword && [ -n "$ROOTPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUUSERACC";;
  1374. "$LANG_MENUUSERACC") menu_useraccount && [ -n "$USERNAME_YAPILDI" ] && [ -n "$USERPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUBOOTLOADER";;
  1375. "$LANG_MENUBOOTLOADER") menu_bootloader && [ -n "$BOOTLOADER_YAPILDI" ] && DEFITEM="$LANG_MENUPARTITION";;
  1376. "$LANG_MENUPARTITION") menu_partitions && [ -n "$PARTITIONS_YAPILDI" ] && DEFITEM="$LANG_MENUFILESYSTEM";;
  1377. "$LANG_MENUFILESYSTEM") menu_filesystems && [ -n "$FILESYSTEMS_YAPILDI" ] && DEFITEM="$LANG_MENUINSTALL";;
  1378. "$LANG_MENUINSTALL") menu_install;;
  1379. "$LANG_MENUEXIT") DIE;;
  1380. *) DIALOG --yesno "$LANG_ABORTINST" ${YESNOSIZE} && DIE
  1381. esac
  1382. }
  1383. if [ ! -x /bin/dialog ]; then
  1384. echo "$LANG_ERRDIALOG"
  1385. exit 1
  1386. fi
  1387. if [ "$(id -u)" != "0" ]; then
  1388. echo "$LANG_INSTMUSTROOT" 1>&2
  1389. exit 1
  1390. fi
  1391. #
  1392. # kuruluma giriş noktası - eğer kurulum ayar dosyası parametre verilirse direk kuruluma başlayacak.
  1393. #
  1394. [ ! -z $DOSYADAN_KURULUM ] && menu_install && exit 0
  1395. DIALOG --title "${BOLD}${RED} $LANG_ENTERMILIS ${RESET}" --msgbox "`printf "$LANG_MAINDIALOG" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}"`" 16 80
  1396. while true; do
  1397. menu
  1398. done
  1399. exit 0