milis-kur 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605
  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-2023 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#milislinux%s on %sirc.libera.chat%s or \
  151. ask the %sforums%s on the site.\n\n
  152. %shttps://mls.akdeniz.edu.tr%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="Kullanıcı giriş adını giriniz"
  189. LANG_USERNAME="Kullanıcı gerçek 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 çık?"
  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.libera.chat%s \
  266. %s#milislinux%s kanalımıza katılabilir veya sitemizdeki %sforumdan%s yardım alabilirsiniz.\n\n
  267. %shttps://mls.akdeniz.edu.tr%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=/tmp/kurulum.log
  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. [ ! -z $2 ] && SCRMODE="$2"
  296. else
  297. AYAR_DOSYASI=/tmp/.kurulum.conf
  298. if [ ! -f $AYAR_DOSYASI ]; then
  299. touch -f $AYAR_DOSYASI
  300. fi
  301. fi
  302. ANSWER=$(mktemp -t vinstall-XXXXXXXX || exit 1)
  303. TARGET_FSTAB=$(mktemp -t vinstall-fstab-XXXXXXXX || exit 1)
  304. if [ -f /etc/milis-surum ];then
  305. MILIS_SURUM=$(cat /etc/milis-surum)
  306. else
  307. MILIS_SURUM="Milis 2.1 Test Sürüm"
  308. fi
  309. if [ -f /etc/canli_kullanici ];then
  310. CANLI_KULLANICI=$(cat /etc/canli_kullanici)
  311. else
  312. CANLI_KULLANICI="root"
  313. fi
  314. trap "DIE" INT TERM QUIT
  315. # konsol log yazmasının kapatılması
  316. if [ -w /proc/sys/kernel/printk ]; then
  317. echo 0 >/proc/sys/kernel/printk
  318. fi
  319. # EFIli sistem tesbiti
  320. if [ -e /sys/firmware/efi/systab ]; then
  321. EFI_SYSTEM=1
  322. EFI_FW_BITS=$(cat /sys/firmware/efi/fw_platform_size)
  323. if [ $EFI_FW_BITS -eq 32 ]; then
  324. EFI_TARGET=i386-efi
  325. else
  326. EFI_TARGET=x86_64-efi
  327. fi
  328. fi
  329. # menü renkleri
  330. BLACK="\Z0"
  331. RED="\Z1"
  332. GREEN="\Z2"
  333. YELLOW="\Z3"
  334. BLUE="\Z4"
  335. MAGENTA="\Z5"
  336. CYAN="\Z6"
  337. WHITE="\Z7"
  338. BOLD="\Zb"
  339. REVERSE="\Zr"
  340. UNDERLINE="\Zu"
  341. RESET="\Zn"
  342. # menü pencere özellikleri
  343. MENULABEL="${BOLD}${LANG_MENULABEL}${RESET}"
  344. MENUSIZE="14 60 0"
  345. INPUTSIZE="8 60"
  346. MSGBOXSIZE="8 70"
  347. YESNOSIZE="$INPUTSIZE"
  348. WIDGET_SIZE="10 70"
  349. DIALOG() {
  350. rm -f $ANSWER
  351. dialog --colors --keep-tite --no-shadow --no-mouse \
  352. --backtitle "${BOLD}${WHITE}Milis Linux ${LANG_INSTALLATION} ($MILIS_SURUM)${RESET}" \
  353. --cancel-label "$LANG_BACK" --aspect 20 "$@" 2>$ANSWER
  354. return $?
  355. }
  356. INFOBOX() {
  357. dialog --colors --no-shadow --no-mouse \
  358. --backtitle "${BOLD}${WHITE}Milis Linux ${LANG_INSTALLATION} ($MILIS_SURUM)${RESET}" \
  359. --title "${TITLE}" --aspect 20 --infobox "$@"
  360. }
  361. DIE() {
  362. rval=$1
  363. [ -z "$rval" ] && rval=0
  364. clear
  365. rm -f $ANSWER $TARGET_FSTAB
  366. # printk yeniden aktif etme
  367. if [ -w /proc/sys/kernel/printk ]; then
  368. echo 4 >/proc/sys/kernel/printk
  369. fi
  370. umount_filesystems
  371. exit $rval
  372. }
  373. set_option() {
  374. if grep -Eq "^${1}.*" $AYAR_DOSYASI; then
  375. sed -i -e "/^${1}.*/d" $AYAR_DOSYASI
  376. fi
  377. echo "${1} ${2}" >>$AYAR_DOSYASI
  378. }
  379. get_option() {
  380. echo $(grep -E "^${1}.*" $AYAR_DOSYASI|sed -e "s|${1}||")
  381. }
  382. # ISO-639'e göre dil isimleri
  383. iso639_language() {
  384. case "$1" in
  385. aa) echo "Afar" ;;
  386. af) echo "Afrikaans" ;;
  387. an) echo "Aragonese" ;;
  388. ar) echo "Arabic" ;;
  389. ast) echo "Asturian" ;;
  390. be) echo "Belgian" ;;
  391. bg) echo "Bulgarian" ;;
  392. bhb) echo "Bhili" ;;
  393. br) echo "Breton" ;;
  394. bs) echo "Bosnian" ;;
  395. ca) echo "Catalan" ;;
  396. cs) echo "Czech" ;;
  397. cy) echo "Welsh" ;;
  398. da) echo "Danish" ;;
  399. de) echo "German" ;;
  400. el) echo "Greek" ;;
  401. en) echo "English" ;;
  402. es) echo "Spanish" ;;
  403. et) echo "Estonian" ;;
  404. eu) echo "Basque" ;;
  405. fi) echo "Finnish" ;;
  406. fo) echo "Faroese" ;;
  407. fr) echo "French" ;;
  408. ga) echo "Irish" ;;
  409. gd) echo "Scottish Gaelic" ;;
  410. gl) echo "Galician" ;;
  411. gv) echo "Manx" ;;
  412. he) echo "Hebrew" ;;
  413. hr) echo "Croatian" ;;
  414. hsb) echo "Upper Sorbian" ;;
  415. hu) echo "Hungarian" ;;
  416. id) echo "Indonesian" ;;
  417. is) echo "Icelandic" ;;
  418. it) echo "Italian" ;;
  419. iw) echo "Hebrew" ;;
  420. ja) echo "Japanese" ;;
  421. ka) echo "Georgian" ;;
  422. kk) echo "Kazakh" ;;
  423. kl) echo "Kalaallisut" ;;
  424. ko) echo "Korean" ;;
  425. ku) echo "Kurdish" ;;
  426. kw) echo "Cornish" ;;
  427. lg) echo "Ganda" ;;
  428. lt) echo "Lithuanian" ;;
  429. lv) echo "Latvian" ;;
  430. mg) echo "Malagasy" ;;
  431. mi) echo "Maori" ;;
  432. mk) echo "Macedonian" ;;
  433. ms) echo "Malay" ;;
  434. mt) echo "Maltese" ;;
  435. nb) echo "Norwegian Bokmål" ;;
  436. nl) echo "Dutch" ;;
  437. nn) echo "Norwegian Nynorsk" ;;
  438. oc) echo "Occitan" ;;
  439. om) echo "Oromo" ;;
  440. pl) echo "Polish" ;;
  441. pt) echo "Portugese" ;;
  442. ro) echo "Romanian" ;;
  443. ru) echo "Russian" ;;
  444. sk) echo "Slovak" ;;
  445. sl) echo "Slovenian" ;;
  446. so) echo "Somali" ;;
  447. sq) echo "Albanian" ;;
  448. st) echo "Southern Sotho" ;;
  449. sv) echo "Swedish" ;;
  450. tcy) echo "Tulu" ;;
  451. tg) echo "Tajik" ;;
  452. th) echo "Thai" ;;
  453. tl) echo "Tagalog" ;;
  454. tr) echo "Türkçe" ;;
  455. uk) echo "Ukrainian" ;;
  456. uz) echo "Uzbek" ;;
  457. wa) echo "Walloon" ;;
  458. xh) echo "Xhosa" ;;
  459. yi) echo "Yiddish" ;;
  460. zh) echo "Chinese" ;;
  461. zu) echo "Zulu" ;;
  462. *) echo "$1" ;;
  463. esac
  464. }
  465. # ISO-3166 ülke kodları yerel ayarlar için
  466. iso3166_country() {
  467. case "$1" in
  468. AD) echo "Andorra" ;;
  469. AE) echo "United Arab Emirates" ;;
  470. AL) echo "Albania" ;;
  471. AR) echo "Argentina" ;;
  472. AT) echo "Austria" ;;
  473. AU) echo "Australia" ;;
  474. BA) echo "Bonsia and Herzegovina" ;;
  475. BE) echo "Belgium" ;;
  476. BG) echo "Bulgaria" ;;
  477. BH) echo "Bahrain" ;;
  478. BO) echo "Bolivia" ;;
  479. BR) echo "Brazil" ;;
  480. BW) echo "Botswana" ;;
  481. BY) echo "Belarus" ;;
  482. CA) echo "Canada" ;;
  483. CH) echo "Switzerland" ;;
  484. CL) echo "Chile" ;;
  485. CN) echo "China" ;;
  486. CO) echo "Colombia" ;;
  487. CR) echo "Costa Rica" ;;
  488. CY) echo "Cyprus" ;;
  489. CZ) echo "Czech Republic" ;;
  490. DE) echo "Germany" ;;
  491. DJ) echo "Djibouti" ;;
  492. DK) echo "Denmark" ;;
  493. DO) echo "Dominican Republic" ;;
  494. DZ) echo "Algeria" ;;
  495. EC) echo "Ecuador" ;;
  496. EE) echo "Estonia" ;;
  497. EG) echo "Egypt" ;;
  498. ES) echo "Spain" ;;
  499. FI) echo "Finland" ;;
  500. FO) echo "Faroe Islands" ;;
  501. FR) echo "France" ;;
  502. GB) echo "Great Britain" ;;
  503. GE) echo "Georgia" ;;
  504. GL) echo "Greenland" ;;
  505. GR) echo "Greece" ;;
  506. GT) echo "Guatemala" ;;
  507. HK) echo "Hong Kong" ;;
  508. HN) echo "Honduras" ;;
  509. HR) echo "Croatia" ;;
  510. HU) echo "Hungary" ;;
  511. ID) echo "Indonesia" ;;
  512. IE) echo "Ireland" ;;
  513. IL) echo "Israel" ;;
  514. IN) echo "India" ;;
  515. IQ) echo "Iraq" ;;
  516. IS) echo "Iceland" ;;
  517. IT) echo "Italy" ;;
  518. JO) echo "Jordan" ;;
  519. JP) echo "Japan" ;;
  520. KE) echo "Kenya" ;;
  521. KR) echo "Korea, Republic of" ;;
  522. KW) echo "Kuwait" ;;
  523. KZ) echo "Kazakhstan" ;;
  524. LB) echo "Lebanon" ;;
  525. LT) echo "Lithuania" ;;
  526. LU) echo "Luxembourg" ;;
  527. LV) echo "Latvia" ;;
  528. LY) echo "Libya" ;;
  529. MA) echo "Morocco" ;;
  530. MG) echo "Madagascar" ;;
  531. MK) echo "Macedonia" ;;
  532. MT) echo "Malta" ;;
  533. MX) echo "Mexico" ;;
  534. MY) echo "Malaysia" ;;
  535. NI) echo "Nicaragua" ;;
  536. NL) echo "Netherlands" ;;
  537. NO) echo "Norway" ;;
  538. NZ) echo "New Zealand" ;;
  539. OM) echo "Oman" ;;
  540. PA) echo "Panama" ;;
  541. PE) echo "Peru" ;;
  542. PH) echo "Philippines" ;;
  543. PL) echo "Poland" ;;
  544. PR) echo "Puerto Rico" ;;
  545. PT) echo "Portugal" ;;
  546. PY) echo "Paraguay" ;;
  547. QA) echo "Qatar" ;;
  548. RO) echo "Romania" ;;
  549. RU) echo "Russian Federation" ;;
  550. SA) echo "Saudi Arabia" ;;
  551. SD) echo "Sudan" ;;
  552. SE) echo "Sweden" ;;
  553. SG) echo "Singapore" ;;
  554. SI) echo "Slovenia" ;;
  555. SK) echo "Slovakia" ;;
  556. SO) echo "Somalia" ;;
  557. SV) echo "El Salvador" ;;
  558. SY) echo "Syria" ;;
  559. TH) echo "Thailand" ;;
  560. TJ) echo "Tajikistan" ;;
  561. TN) echo "Tunisia" ;;
  562. TR) echo "Türkiye" ;;
  563. TW) echo "Taiwan" ;;
  564. UA) echo "Ukraine" ;;
  565. UG) echo "Uganda" ;;
  566. US) echo "United States of America" ;;
  567. UY) echo "Uruguay" ;;
  568. UZ) echo "Uzbekistan" ;;
  569. VE) echo "Venezuela" ;;
  570. YE) echo "Yemen" ;;
  571. ZA) echo "South Africa" ;;
  572. ZW) echo "Zimbabwe" ;;
  573. *) echo "$1" ;;
  574. esac
  575. }
  576. show_disks() {
  577. local dev size sectorsize gbytes
  578. # IDE
  579. for dev in $(ls /sys/block|grep -E '^hd'); do
  580. if [ "$(cat /sys/block/$dev/device/media)" = "disk" ]; then
  581. # sektör, alan bilgisinin bulunması;
  582. echo "/dev/$dev"
  583. size=$(cat /sys/block/$dev/size)
  584. sectorsize=$(cat /sys/block/$dev/queue/hw_sector_size)
  585. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  586. echo "size:${gbytes}GB;sector_size:$sectorsize"
  587. fi
  588. done
  589. # SATA/SCSI ve Virtual diskleri (virtio)
  590. for dev in $(ls /sys/block|grep -E '^([sv]|xv)d|mmcblk|nvme'); do
  591. echo "/dev/$dev"
  592. size=$(cat /sys/block/$dev/size)
  593. sectorsize=$(cat /sys/block/$dev/queue/hw_sector_size)
  594. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  595. echo "size:${gbytes}GB;sector_size:$sectorsize"
  596. done
  597. # cciss(4) aygıtları
  598. for dev in $(ls /dev/cciss 2>/dev/null|grep -E 'c[0-9]d[0-9]$'); do
  599. echo "/dev/cciss/$dev"
  600. size=$(cat /sys/block/cciss\!$dev/size)
  601. sectorsize=$(cat /sys/block/cciss\!$dev/queue/hw_sector_size)
  602. gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
  603. echo "size:${gbytes}GB;sector_size:$sectorsize"
  604. done
  605. }
  606. show_partitions() {
  607. local dev fstype fssize p part
  608. set -- $(show_disks)
  609. while [ $# -ne 0 ]; do
  610. disk=$(basename $1)
  611. shift 2
  612. # ATA/SCSI/SATA
  613. for p in /sys/block/$disk/$disk*; do
  614. if [ -d $p ]; then
  615. part=$(basename $p)
  616. fstype=$(lsblk -nfr /dev/$part|awk '{print $2}'|head -1)
  617. [ "$fstype" = "iso9660" ] && continue
  618. [ "$fstype" = "crypto_LUKS" ] && continue
  619. [ "$fstype" = "LVM2_member" ] && continue
  620. fssize=$(lsblk -nr /dev/$part|awk '{print $4}'|head -1)
  621. echo "/dev/$part"
  622. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  623. fi
  624. done
  625. done
  626. # Device Mapper
  627. for p in /dev/mapper/*; do
  628. part=$(basename $p)
  629. [ "${part}" = "live-rw" ] && continue
  630. [ "${part}" = "live-base" ] && continue
  631. [ "${part}" = "control" ] && continue
  632. fstype=$(lsblk -nfr $p|awk '{print $2}'|head -1)
  633. fssize=$(lsblk -nr $p|awk '{print $4}'|head -1)
  634. echo "${p}"
  635. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  636. done
  637. # Software raid (md)
  638. for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do
  639. part=$(basename $p)
  640. if cat /proc/mdstat|grep -qw $part; then
  641. fstype=$(lsblk -nfr /dev/$part|awk '{print $2}')
  642. [ "$fstype" = "crypto_LUKS" ] && continue
  643. [ "$fstype" = "LVM2_member" ] && continue
  644. fssize=$(lsblk -nr /dev/$part|awk '{print $4}')
  645. echo "$p"
  646. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  647. fi
  648. done
  649. # cciss(4) aygıtları
  650. for part in $(ls /dev/cciss 2>/dev/null|grep -E 'c[0-9]d[0-9]p[0-9]+'); do
  651. fstype=$(lsblk -nfr /dev/cciss/$part|awk '{print $2}')
  652. [ "$fstype" = "crypto_LUKS" ] && continue
  653. [ "$fstype" = "LVM2_member" ] && continue
  654. fssize=$(lsblk -nr /dev/cciss/$part|awk '{print $4}')
  655. echo "/dev/cciss/$part"
  656. echo "size:${fssize:-unknown};fstype:${fstype:-none}"
  657. done
  658. if [ -e /sbin/lvs ]; then
  659. # LVM
  660. lvs --noheadings|while read lvname vgname perms size; do
  661. echo "/dev/mapper/${vgname}-${lvname}"
  662. echo "size:${size};fstype:lvm"
  663. done
  664. fi
  665. }
  666. menu_filesystems() {
  667. local dev fstype fssize mntpoint reformat
  668. while true; do
  669. DIALOG --ok-label "$LANG_CHANGE" --cancel-label "$LANG_DONE" \
  670. --title " $LANG_SELECTPARTITION " --menu "$MENULABEL" \
  671. ${MENUSIZE} $(show_partitions)
  672. [ $? -ne 0 ] && return
  673. dev=$(cat $ANSWER)
  674. DIALOG --title " `printf "$LANG_SELECTFILESYSTEM" "$dev"` " \
  675. --menu "$MENULABEL" ${MENUSIZE} \
  676. "btrfs" "Oracle Btrfs" \
  677. "ext2" "Linux ext2 (no journaling)" \
  678. "ext3" "Linux ext3 (journal)" \
  679. "ext4" "Linux ext4 (journal)" \
  680. "f2fs" "Flash-Friendly Filesystem" \
  681. "swap" "Linux swap" \
  682. "vfat" "FAT32" \
  683. "xfs" "SGI's XFS"
  684. if [ $? -eq 0 ]; then
  685. fstype=$(cat $ANSWER)
  686. else
  687. continue
  688. fi
  689. if [ "$fstype" != "swap" ]; then
  690. DIALOG --inputbox "`printf "$LANG_MOUNTPOINT" "$dev"`:" ${INPUTSIZE}
  691. if [ $? -eq 0 ]; then
  692. mntpoint=$(cat $ANSWER)
  693. elif [ $? -eq 1 ]; then
  694. continue
  695. fi
  696. else
  697. mntpoint=swap
  698. fi
  699. DIALOG --yesno "`printf "$LANG_NEWFILESYSTEM" "$dev"`" ${YESNOSIZE}
  700. if [ $? -eq 0 ]; then
  701. reformat=1
  702. elif [ $? -eq 1 ]; then
  703. reformat=0
  704. else
  705. continue
  706. fi
  707. fssize=$(lsblk -nr $dev|awk '{print $4}')
  708. set -- "$fstype" "$fssize" "$mntpoint" "$reformat"
  709. if [ -n "$1" -a -n "$2" -a -n "$3" -a -n "$4" ]; then
  710. local bdev=$(basename $dev)
  711. local ddev=$(basename $(dirname $dev))
  712. if [ "$ddev" != "dev" ]; then
  713. sed -i -e "/^MOUNTPOINT \/dev\/${ddev}\/${bdev}.*/d" $AYAR_DOSYASI
  714. else
  715. sed -i -e "/^MOUNTPOINT \/dev\/${bdev}.*/d" $AYAR_DOSYASI
  716. fi
  717. echo "MOUNTPOINT $dev $1 $2 $3 $4" >>$AYAR_DOSYASI
  718. fi
  719. done
  720. }
  721. menu_partitions() {
  722. DIALOG --title " $LANG_SELECTDISKPART " \
  723. --menu "$MENULABEL" ${MENUSIZE} $(show_disks)
  724. if [ $? -eq 0 ]; then
  725. local device=$(cat $ANSWER)
  726. DIALOG --title "`printf "$LANG_MODPARTTABLE" "$device"`" --msgbox "`printf "$LANG_PARTITIONDIALOG" "${BOLD}" "$device" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}"`" 18 80
  727. if [ $? -eq 0 ]; then
  728. while true; do
  729. clear; cfdisk $device; PARTITIONS_YAPILDI=1
  730. break
  731. done
  732. else
  733. return
  734. fi
  735. fi
  736. }
  737. menu_keymap() {
  738. if [ -f /usr/bin/lightdm ];then
  739. local _keymaps="$(sed '/^! layout$/,/^ *$/!d;//d' /usr/share/X11/xkb/rules/base.lst | awk {'print $1 ":" $2'})"
  740. else
  741. local _keymaps="$(find /usr/share/kbd/keymaps/ -type f -iname "*.map.gz" -printf "%f\n" | sed 's|.map.gz||g' | sort)"
  742. fi
  743. local _KEYMAPS=
  744. for f in ${_keymaps}; do
  745. _KEYMAPS="${_KEYMAPS} ${f} -"
  746. done
  747. while true; do
  748. DIALOG --title " $LANG_SELKEYMAP " --menu "$MENULABEL" 14 70 14 ${_KEYMAPS}
  749. if [ $? -eq 0 ]; then
  750. set_option KEYMAP "$(cat $ANSWER)"
  751. loadkeys "$(cat $ANSWER)"
  752. KEYBOARD_YAPILDI=1
  753. break
  754. else
  755. return
  756. fi
  757. done
  758. }
  759. set_keymap() {
  760. local KEYMAP=$(get_option KEYMAP)
  761. /usr/milis/bin/initc console.keyboard ${KEYMAP}
  762. }
  763. menu_locale() {
  764. local _locales="$(locale -a)"
  765. local LOCALES ISO639 ISO3166
  766. local TMPFILE=$(mktemp -t vinstall-XXXXXXXX || exit 1)
  767. INFOBOX "$LANG_SCANLOCALES ..." 4 60
  768. for f in ${_locales}; do
  769. eval $(echo $f | awk 'BEGIN { FS="." } \
  770. { FS="_"; split($1, a); printf "ISO639=%s ISO3166=%s\n", a[1], a[2] }')
  771. echo "$f|$(iso639_language $ISO639) ($(iso3166_country $ISO3166))|" >> $TMPFILE
  772. done
  773. clear
  774. # ISO-639^e göre dil isimlerinin sıralanması
  775. LOCALES=$(sort -t '|' -k 2 < $TMPFILE | xargs | sed -e's/| /|/g')
  776. rm -f $TMPFILE
  777. while true; do
  778. (IFS="|"; DIALOG --title " $LANG_SELLOCAL " --menu "$MENULABEL" 18 70 18 ${LOCALES})
  779. if [ $? -eq 0 ]; then
  780. set_option LOCALE "$(cat $ANSWER)"
  781. LOCALE_YAPILDI=1
  782. break
  783. else
  784. return
  785. fi
  786. done
  787. }
  788. set_locale() {
  789. local LOCALE=$(get_option LOCALE)
  790. rm -rf $HEDEF/etc/profile.d/i18n.sh
  791. #echo "export LANG=$LOCALE" > $HEDEF/etc/profile.d/i18n.sh
  792. #echo "export LC_ALL=$LOCALE" >> $HEDEF/etc/profile.d/i18n.sh
  793. #echo "export LANGUAGE=$LOCALE" >> $HEDEF/etc/profile.d/i18n.sh
  794. # environment içinde de ayarlanması
  795. #echo "LANG=$LOCALE" > $HEDEF/etc/environment
  796. # yeni init sistemine göre
  797. chroot $HEDEF /usr/milis/bin/initc locale.language $LOCALE
  798. }
  799. menu_timezone() {
  800. local _tzones="$(cd /usr/share/zoneinfo; find Africa/ America/ Antarctica/ Arctic/ Asia/ Atlantic/ Australia/ Europe/ Indian/ Pacific/ UTC Turkey -type f | sort)"
  801. local _TIMEZONES=
  802. for f in ${_tzones}; do
  803. _TIMEZONES="${_TIMEZONES} ${f} -"
  804. done
  805. while true; do
  806. DIALOG --title " $LANG_SELTZONE " --menu "$MENULABEL" 14 70 14 ${_TIMEZONES}
  807. if [ $? -eq 0 ]; then
  808. set_option TIMEZONE "$(cat $ANSWER)"
  809. TIMEZONE_YAPILDI=1
  810. break
  811. else
  812. return
  813. fi
  814. done
  815. }
  816. set_timezone() {
  817. local MYTIMEZONE="$(get_option TIMEZONE)"
  818. if [ -f /usr/share/zoneinfo/$MYTIMEZONE ];then
  819. rm -f $HEDEF/etc/localtime
  820. # yeni init sistemine göre set
  821. chroot $HEDEF /usr/milis/bin/initc clock.timezone $MYTIMEZONE
  822. fi
  823. }
  824. menu_hostname() {
  825. while true; do
  826. DIALOG --inputbox "$LANG_SETHOST:" ${INPUTSIZE}
  827. if [ $? -eq 0 ]; then
  828. set_option HOSTNAME "$(cat $ANSWER)"
  829. HOSTNAME_YAPILDI=1
  830. break
  831. else
  832. return
  833. fi
  834. done
  835. }
  836. set_hostname() {
  837. # init sistemi yapmalı
  838. #echo "$(get_option HOSTNAME)" > $HEDEF/etc/hostname
  839. echo "127.0.0.1 $(get_option HOSTNAME)" >> /etc/hosts
  840. chroot $HEDEF /usr/milis/bin/initc hostname.data "$(get_option HOSTNAME)"
  841. }
  842. menu_rootpassword() {
  843. local _firstpass _secondpass _desc
  844. while true; do
  845. if [ -z "${_firstpass}" ]; then
  846. _desc="$LANG_ROOTPW"
  847. else
  848. _desc="$LANG_ROOTPWAGAIN"
  849. fi
  850. DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE}
  851. if [ $? -eq 0 ]; then
  852. if [ -z "${_firstpass}" ]; then
  853. _firstpass="$(cat $ANSWER)"
  854. else
  855. _secondpass="$(cat $ANSWER)"
  856. fi
  857. if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then
  858. if [ "${_firstpass}" != "${_secondpass}" ]; then
  859. INFOBOX "$LANG_PWNOTMATCH" 6 60
  860. unset _firstpass _secondpass
  861. sleep 2 && clear && continue
  862. fi
  863. set_option ROOTPASSWORD "${_firstpass}"
  864. ROOTPASSWORD_YAPILDI=1
  865. break
  866. fi
  867. else
  868. return
  869. fi
  870. done
  871. }
  872. set_rootpassword() {
  873. echo "root:$(get_option ROOTPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  874. }
  875. menu_useraccount() {
  876. local _firstpass _secondpass _desc
  877. local _groups _status _group _checklist
  878. local _preset
  879. while true; do
  880. _preset=$(get_option USERLOGIN)
  881. [ -z "$_preset" ] && _preset=""
  882. DIALOG --inputbox "$LANG_LOGINNAME:" ${INPUTSIZE} "$_preset"
  883. if [ $? -eq 0 ]; then
  884. set_option USERLOGIN "$(cat $ANSWER)"
  885. USERLOGIN_YAPILDI=1
  886. break
  887. else
  888. return
  889. fi
  890. done
  891. while true; do
  892. _preset=$(get_option USERNAME)
  893. [ -z "$_preset" ] && _preset=""
  894. DIALOG --inputbox "$LANG_USERNAME '$(get_option USERLOGIN)' :" \
  895. ${INPUTSIZE} "$_preset"
  896. if [ $? -eq 0 ]; then
  897. set_option USERNAME "$(cat $ANSWER)"
  898. USERNAME_YAPILDI=1
  899. break
  900. else
  901. return
  902. fi
  903. done
  904. while true; do
  905. if [ -z "${_firstpass}" ]; then
  906. _desc="$LANG_PASSWORD '$(get_option USERLOGIN)'"
  907. else
  908. _desc="$LANG_PASSWORDAGAIN '$(get_option USERLOGIN)'"
  909. fi
  910. DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE}
  911. if [ $? -eq 0 ]; then
  912. if [ -z "${_firstpass}" ]; then
  913. _firstpass="$(cat $ANSWER)"
  914. else
  915. _secondpass="$(cat $ANSWER)"
  916. fi
  917. if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then
  918. if [ "${_firstpass}" != "${_secondpass}" ]; then
  919. INFOBOX "$LANG_PWNOTMATCH" 6 60
  920. unset _firstpass _secondpass
  921. sleep 2 && clear && continue
  922. fi
  923. set_option USERPASSWORD "${_firstpass}"
  924. USERPASSWORD_YAPILDI=1
  925. break
  926. fi
  927. else
  928. return
  929. fi
  930. done
  931. #_groups="wheel,audio,video,floppy,cdrom,optical,kvm"
  932. _groups="users,input,disk,network,floppy,fuse,video,lp,tty,audio,dialout,cdrom,scanner,adm,vboxusers,wheel"
  933. while true; do
  934. _desc="$LANG_GMEMLOGIN '$(get_option USERLOGIN)':"
  935. for _group in $(cat /etc/group); do
  936. _gid="$(echo ${_group} | cut -d: -f3)"
  937. _group="$(echo ${_group} | cut -d: -f1)"
  938. _status="$(echo ${_groups} | grep -w ${_group})"
  939. if [ -z "${_status}" ]; then
  940. _status=off
  941. else
  942. _status=on
  943. fi
  944. if [ -z "${_checklist}" ]; then
  945. _checklist="${_group} ${_group}:${_gid} ${_status}"
  946. else
  947. _checklist="${_checklist} ${_group} ${_group}:${_gid} ${_status}"
  948. fi
  949. done
  950. DIALOG --no-tags --checklist "${_desc}" 20 60 18 ${_checklist}
  951. if [ $? -eq 0 ]; then
  952. set_option USERGROUPS $(cat $ANSWER | sed -e's| |,|g')
  953. USERGROUPS_YAPILDI=1
  954. break
  955. else
  956. return
  957. fi
  958. done
  959. }
  960. set_useraccount() {
  961. USERLOGIN_YAPILDI=$(get_option USERLOGIN)
  962. USERPASSWORD_YAPILDI=$(get_option USERPASSWORD)
  963. USERNAME_YAPILDI=$(get_option USERNAME)
  964. USERGROUPS_YAPILDI=$(get_option USERGROUPS)
  965. [ -z "$USERLOGIN_YAPILDI" ] && return
  966. [ -z "$USERPASSWORD_YAPILDI" ] && return
  967. [ -z "$USERNAME_YAPILDI" ] && return
  968. [ -z "$USERGROUPS_YAPILDI" ] && return
  969. useradd -R $HEDEF -G $(get_option USERGROUPS) -c "$(get_option USERNAME)" $(get_option USERLOGIN)
  970. echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  971. }
  972. menu_bootloader() {
  973. while true; do
  974. DIALOG --title " $LANG_BOOTLOADER" \
  975. --menu "$MENULABEL" ${MENUSIZE} $(show_disks) none "$LANG_BOOTLOTHER"
  976. if [ $? -eq 0 ]; then
  977. set_option BOOTLOADER "$(cat $ANSWER)"
  978. BOOTLOADER_YAPILDI=1
  979. break
  980. else
  981. return
  982. fi
  983. done
  984. while true; do
  985. DIALOG --yesno "$LANG_BOOTLGRAPH" ${YESNOSIZE}
  986. if [ $? -eq 0 ]; then
  987. set_option TEXTCONSOLE 0
  988. break
  989. elif [ $? -eq 1 ]; then
  990. set_option TEXTCONSOLE 1
  991. break
  992. else
  993. return
  994. fi
  995. done
  996. }
  997. set_bootloader() {
  998. local dev=$(get_option BOOTLOADER) grub_args="--force "
  999. if [ "$dev" = "none" ]; then return; fi
  1000. # efi sistem ve efivar kontrolü
  1001. if [ -n "$EFI_SYSTEM" ]; then
  1002. grub_args="--force --target=$EFI_TARGET --efi-directory=/boot/efi --bootloader-id=boot --recheck"
  1003. # efivarfs kernel modülü builtin geldiği varsayılıyor.
  1004. # yoksa modprobe efivarfs
  1005. mount -t efivarfs efivarfs /sys/firmware/efi/efivars
  1006. mount --bind /sys/firmware/efi/efivars $HEDEF/sys/firmware/efi/efivars
  1007. chroot $HEDEF grub-install $grub_args $dev >>$LOG 2>&1
  1008. cp $HEDEF/boot/efi/EFI/boot/grubx64.efi $HEDEF/boot/efi/EFI/boot/bootx64.efi
  1009. else
  1010. echo "`printf "$LANG_GRUBINST" "$grub_args $dev"`" >>$LOG
  1011. chroot $HEDEF grub-install $grub_args $dev >>$LOG 2>&1
  1012. fi
  1013. if [ $? -ne 0 ]; then
  1014. DIALOG --msgbox "`printf "$LANG_GRUBFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1015. DIE 1
  1016. fi
  1017. echo "`printf "$LANG_GRUBMKCONF" "$HEDEF"`" >>$LOG
  1018. chroot $HEDEF grub-mkconfig -o /boot/grub/grub.cfg >>$LOG 2>&1
  1019. if [ $? -ne 0 ]; then
  1020. DIALOG --msgbox "`printf "$LANG_GRUBMKCONFFAIL" "${BOLD}${RED}" "${RESET}" "$LOG"`" ${MSGBOXSIZE}
  1021. DIE 1
  1022. fi
  1023. }
  1024. validate_filesystems() {
  1025. local mnts dev size fstype mntpt mkfs rootfound fmt
  1026. local usrfound efi_system_partition
  1027. unset TARGETFS
  1028. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1029. set -- ${mnts}
  1030. while [ $# -ne 0 ]; do
  1031. fmt=""
  1032. dev=$2; fstype=$3; size=$4; mntpt="$5"; mkfs=$6
  1033. shift 6
  1034. if [ "$mntpt" = "/" ]; then
  1035. rootfound=1
  1036. elif [ "$mntpt" = "/usr" ]; then
  1037. usrfound=1
  1038. elif [ "$fstype" = "vfat" -a "$mntpt" = "/boot/efi" ]; then
  1039. efi_system_partition=1
  1040. fi
  1041. if [ "$mkfs" -eq 1 ]; then
  1042. fmt="$LANG_NEWFSYSTEM: "
  1043. fi
  1044. if [ -z "$TARGETFS" ]; then
  1045. TARGETFS="`printf "$LANG_MOUNTEDON" "${fmt}$dev" "$size" "$mntpt" "${fstype}"`"
  1046. else
  1047. TARGETFS="`printf "$LANG_MOUNTEDON" "${TARGETFS}${fmt}${dev}" "$size" "$mntpt" "${fstype}"`"
  1048. fi
  1049. done
  1050. if [ -z "$rootfound" ]; then
  1051. DIALOG --msgbox "`printf "$LANG_FSYSTEMNOTSET" "${BOLD}${RED}" "${RESET}" `" ${MSGBOXSIZE}
  1052. return 1
  1053. elif [ -n "$usrfound" ]; then
  1054. DIALOG --msgbox "`printf "$LANG_FSYSNOTSUPPORTED" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1055. return 1
  1056. elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then
  1057. DIALOG --msgbox "`printf "$LANG_FSYSEFINOTSET" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1058. fi
  1059. FILESYSTEMS_YAPILDI=1
  1060. }
  1061. create_filesystems() {
  1062. local mnts dev mntpt fstype fspassno mkfs size rv uuid
  1063. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1064. set -- ${mnts}
  1065. while [ $# -ne 0 ]; do
  1066. dev=$2; fstype=$3; mntpt="$5"; mkfs=$6
  1067. shift 6
  1068. # swap bölümleme
  1069. if [ "$fstype" = "swap" ]; then
  1070. swapoff $dev >/dev/null 2>&1
  1071. if [ "$mkfs" -eq 1 ]; then
  1072. mkswap $dev >>$LOG 2>&1
  1073. if [ $? -ne 0 ]; then
  1074. if [ $SCRMODE == "text" ];then
  1075. echo "$LANG_SWAPFAIL"
  1076. else
  1077. DIALOG --msgbox "`printf "$LANG_SWAPFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1078. fi
  1079. DIE 1
  1080. fi
  1081. fi
  1082. swapon $dev >>$LOG 2>&1
  1083. if [ $? -ne 0 ]; then
  1084. if [ $SCRMODE == "text" ];then
  1085. echo "$LANG_SWAPERROR"
  1086. else
  1087. DIALOG --msgbox "`printf "$LANG_SWAPERROR" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1088. fi
  1089. DIE 1
  1090. fi
  1091. # hedef fstaba girdi eklenmesi
  1092. uuid=$(blkid -o value -s UUID "$dev")
  1093. echo "UUID=$uuid none swap sw 0 0" >>$TARGET_FSTAB
  1094. continue
  1095. fi
  1096. if [ "$mkfs" -eq 1 ]; then
  1097. case "$fstype" in
  1098. btrfs) MKFS="mkfs.btrfs -f"; modprobe btrfs >>$LOG 2>&1;;
  1099. ext2) MKFS="mke2fs -F"; modprobe ext2 >>$LOG 2>&1;;
  1100. ext3) MKFS="mke2fs -F -j"; modprobe ext3 >>$LOG 2>&1;;
  1101. ext4) MKFS="mke2fs -F -t ext4"; modprobe ext4 >>$LOG 2>&1;;
  1102. f2fs) MKFS="mkfs.f2fs -f"; modprobe f2fs >>$LOG 2>&1;;
  1103. vfat) MKFS="mkfs.vfat -F32"; modprobe vfat >>$LOG 2>&1;;
  1104. xfs) MKFS="mkfs.xfs -f"; modprobe xfs >>$LOG 2>&1;;
  1105. esac
  1106. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1107. if [ $SCRMODE == "text" ];then
  1108. echo "$LANG_CREATEFSYS"
  1109. else
  1110. INFOBOX "`printf "$LANG_CREATEFSYS" "$fstype" "$dev" "$mntpt"`" 8 60
  1111. fi
  1112. echo "`printf "$LANG_CREATEMKFS" "$MKFS $dev"`" >>$LOG
  1113. # hedef disk bölümü bağlı olabilir, çözmek için
  1114. mount | grep -q "$dev" && umount -l $dev
  1115. $MKFS $dev >>$LOG 2>&1; rv=$?
  1116. if [ $rv -ne 0 ]; then
  1117. if [ $SCRMODE == "text" ];then
  1118. echo "$LANG_CREATEFAIL"
  1119. else
  1120. DIALOG --msgbox "`printf "$LANG_CREATEFAIL" "${BOLD}${RED}" "${RESET}" "$fstype" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1121. fi
  1122. DIE 1
  1123. fi
  1124. fi
  1125. # rootfs nin bağlanması
  1126. [ "$mntpt" != "/" ] && continue
  1127. mkdir -p $HEDEF
  1128. echo "`printf "$LANG_MOUNTINGON" "$dev" "$mntpt" "$fstype"`" >>$LOG
  1129. mount -t $fstype $dev $HEDEF >>$LOG 2>&1
  1130. if [ $? -ne 0 ]; then
  1131. if [ $SCRMODE == "text" ];then
  1132. echo "$LANG_MOUNTINGERR"
  1133. else
  1134. DIALOG --msgbox "`printf "$LANG_MOUNTINGERR" "${BOLD}${RED}" "${RESET}" "$dev" "${mntpt}" "$LOG"`" ${MSGBOXSIZE}
  1135. fi
  1136. DIE 1
  1137. fi
  1138. # hedef fstaba girdi eklenmesi
  1139. uuid=$(blkid -o value -s UUID "$dev")
  1140. if [ "$fstype" = "f2fs" ]; then
  1141. fspassno=0
  1142. else
  1143. fspassno=1
  1144. fi
  1145. echo "UUID=$uuid $mntpt $fstype defaults 0 $fspassno" >>$TARGET_FSTAB
  1146. done
  1147. # dosya sistemlerinin hedefe bağlanması
  1148. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1149. set -- ${mnts}
  1150. while [ $# -ne 0 ]; do
  1151. dev=$2; fstype=$3; mntpt="$5"
  1152. shift 6
  1153. [ "$mntpt" = "/" -o "$fstype" = "swap" ] && continue
  1154. mkdir -p ${HEDEF}${mntpt}
  1155. echo "$LANG_MOUNTINGON" >>$LOG
  1156. mount -t $fstype $dev ${HEDEF}${mntpt} >>$LOG 2>&1
  1157. if [ $? -ne 0 ]; then
  1158. if [ $SCRMODE == "text" ];then
  1159. echo "$LANG_MOUNTINGERR"
  1160. else
  1161. DIALOG --msgbox "$LANG_MOUNTINGERR" ${MSGBOXSIZE}
  1162. fi
  1163. DIE
  1164. fi
  1165. # hedef fstaba girdi eklenmesi
  1166. uuid=$(blkid -o value -s UUID "$dev")
  1167. echo "UUID=$uuid $mntpt $fstype defaults 0 2" >>$TARGET_FSTAB
  1168. done
  1169. }
  1170. mount_filesystems() {
  1171. for f in sys proc dev; do
  1172. [ ! -d $HEDEF/$f ] && mkdir $HEDEF/$f
  1173. echo "Mounting $HEDEF/$f..." >>$LOG
  1174. mount --bind /$f $HEDEF/$f >>$LOG 2>&1
  1175. done
  1176. }
  1177. umount_filesystems() {
  1178. local f
  1179. for f in sys/fs/fuse/connections sys/firmware/efi/efivars sys proc dev; do
  1180. if [ -d $HEDEF/$f ];then
  1181. echo "Unmounting $HEDEF/$f..." >>$LOG
  1182. umount $HEDEF/$f >>$LOG 2>&1
  1183. fi
  1184. done
  1185. local mnts="$(grep -E '^MOUNTPOINT.*$' $AYAR_DOSYASI)"
  1186. set -- ${mnts}
  1187. while [ $# -ne 0 ]; do
  1188. local dev=$2; local fstype=$3; local mntpt=$5
  1189. shift 6
  1190. if [ "$fstype" = "swap" ]; then
  1191. echo "`printf "$LANG_SWAPDISABLING" "$dev" `" >>$LOG
  1192. swapoff $dev >>$LOG 2>&1
  1193. continue
  1194. fi
  1195. if [ "$mntpt" != "/" ]; then
  1196. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF/$mntpt" `" >>$LOG
  1197. umount $HEDEF/$mntpt >>$LOG 2>&1
  1198. fi
  1199. done
  1200. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF"`" >>$LOG
  1201. umount $HEDEF >>$LOG 2>&1
  1202. }
  1203. log_and_count() {
  1204. local progress whole tenth
  1205. while read line; do
  1206. #echo "$line" >>$LOG
  1207. copy_count=$((copy_count + 1))
  1208. progress=$((1000 * copy_count / copy_total))
  1209. if [ "$progress" != "$copy_progress" ]; then
  1210. whole=$((progress / 10))
  1211. tenth=$((progress % 10))
  1212. printf "$LANG_PROGRESS" $whole $tenth $copy_count $copy_total
  1213. copy_progress=$progress
  1214. fi
  1215. #echo "$copy_progress" >>$LOG
  1216. done
  1217. }
  1218. copy_rootfs() {
  1219. local tar_in="--create --one-file-system --xattrs"
  1220. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1221. if [ $SCRMODE == "text" ];then
  1222. echo "$LANG_COUNTFILES"
  1223. else
  1224. INFOBOX "$LANG_COUNTFILES" 4 60
  1225. fi
  1226. copy_total=$(tar ${tar_in} -v -f /dev/null / 2>/dev/null | wc -l)
  1227. export copy_total copy_count=0 copy_progress=
  1228. clear
  1229. if [ $SCRMODE == "text" ];then
  1230. tar ${tar_in} -f - / 2>/dev/null | tar --extract --xattrs --xattrs-include='*' --preserve-permissions -v -f - -C $HEDEF | log_and_count
  1231. else
  1232. tar ${tar_in} -f - / 2>/dev/null | tar --extract --xattrs --xattrs-include='*' --preserve-permissions -v -f - -C $HEDEF | log_and_count | DIALOG --title "${TITLE}" --progressbox "$LANG_CPLIVEIMG" 5 60
  1233. fi
  1234. if [ $? -ne 0 ]; then
  1235. DIE 1
  1236. fi
  1237. unset copy_total copy_count copy_percent
  1238. }
  1239. menu_install() {
  1240. # dosya sistemi hazır değilse devam edilmeyecek.
  1241. validate_filesystems || return 1
  1242. ROOTPASSWORD_YAPILDI="$(get_option ROOTPASSWORD)"
  1243. BOOTLOADER_YAPILDI="$(get_option BOOTLOADER)"
  1244. if [ -z "$FILESYSTEMS_YAPILDI" ]; then
  1245. if [ $SCRMODE == "text" ];then
  1246. echo "$LANG_FSYSNOTCONF"
  1247. else
  1248. DIALOG --msgbox "`printf "$LANG_FSYSNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1249. fi
  1250. return 1
  1251. elif [ -z "$ROOTPASSWORD_YAPILDI" ]; then
  1252. if [ $SCRMODE == "text" ];then
  1253. echo "$LANG_ROOTPWNOTCONF"
  1254. else
  1255. DIALOG --msgbox "`printf "$LANG_ROOTPWNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1256. fi
  1257. return 1
  1258. elif [ -z "$BOOTLOADER_YAPILDI" ]; then
  1259. if [ $SCRMODE == "text" ];then
  1260. echo "$LANG_BOOTLNOTCONF"
  1261. else
  1262. DIALOG --msgbox "`printf "$LANG_BOOTLNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1263. fi
  1264. return 1
  1265. fi
  1266. if [ -z "$FORMAT_ONAY" ]; then
  1267. DIALOG --yesno "`printf "$LANG_DESTROYWARN" "${BOLD}" "${RESET}" "${BOLD}${TARGETFS}${RESET}" "${BOLD}${RED}" "${RESET}" "${BOLD}" "${RESET}"`" 20 80 || return
  1268. fi
  1269. unset TARGETFS
  1270. # Dosya sistemlerinin oluşturulup-bağlanması
  1271. create_filesystems
  1272. # ağdan paket kurulum eklenecek.
  1273. KAYNAK="YEREL"
  1274. if [ $KAYNAK="YEREL" ]; then
  1275. # dosya sisteminin kopyalanması
  1276. copy_rootfs
  1277. USERNAME=$CANLI_KULLANICI
  1278. # Canlı kulanıcının silinmesi root değilse
  1279. if [ $USERNAME != "root" ];then
  1280. echo "`printf "$LANG_RMTARGET" "$USERNAME"`" >>$LOG
  1281. chroot $HEDEF userdel -r $USERNAME >>$LOG 2>&1
  1282. sed -i -e "/$USERNAME ALL=.*/d" $HEDEF/etc/sudoers
  1283. fi
  1284. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1285. if [ $SCRMODE == "text" ];then
  1286. echo "$LANG_BUILDINGINITRAMFS"
  1287. else
  1288. INFOBOX "$LANG_BUILDINGINITRAMFS" 4 60
  1289. fi
  1290. echo "$LANG_BUILDINGINITRAMFS" >>$LOG
  1291. # gerekli dosya istemlerinin bağlanması
  1292. mount_filesystems
  1293. rm -f $HEDEF/boot/initramfs*
  1294. rm -f $HEDEF/boot/initrd*
  1295. rm -f $HEDEF/boot/kernel*
  1296. cp /boot/kernel-* $HEDEF/boot/
  1297. local sonek="milis"
  1298. local kversion=`ls $HEDEF/boot/kernel-* | xargs -I {} basename {} | head -n1 |cut -d'-' -f2`
  1299. chroot $HEDEF dracut -H --xz --omit systemd --add-drivers "ahci" -f /boot/initrd.img-${kversion} $kversion-$sonek --force >>$LOG 2>&1
  1300. #chroot $HEDEF ln -s /boot/kernel-* /boot/kernel
  1301. rmdir $HEDEF/mnt/target
  1302. fi
  1303. if [ $SCRMODE == "text" ];then
  1304. echo "$LANG_APPLYSETTINGS"
  1305. else
  1306. INFOBOX "$LANG_APPLYSETTINGS" 4 60
  1307. fi
  1308. # fstab ın hedef diske kopyalanması
  1309. install -Dm644 $TARGET_FSTAB $HEDEF/etc/fstab
  1310. # /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
  1311. # echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> $HEDEF/etc/fstab
  1312. # keymap, bölgesel ve yerel zaman ayarları, hostname, root-kullanıcı şifre
  1313. #set_keymap
  1314. set_locale
  1315. set_timezone
  1316. set_hostname
  1317. set_rootpassword
  1318. set_useraccount
  1319. # Kullanıcı ve root için öntanımlı ayarların kopyalanması
  1320. USERLOGIN="$(get_option USERLOGIN)"
  1321. mkdir -p $HEDEF/home/$USERLOGIN
  1322. # todo!!! kull. ayarları updates/skel altından alınacak.
  1323. # todo!!! alias mps
  1324. # todo!!! source /etc/profile
  1325. if [ $CANLI_KULLANICI == "root" ];then
  1326. [ -d /root/.config ] && cp -rf /root/.config $HEDEF/home/$USERLOGIN/
  1327. [ -f /root/.gitconfig ] && cp -f /root/.gitconfig $HEDEF/home/$USERLOGIN/
  1328. [ -f /root/.xinitrc ] && cp -rf /root/.xinitrc $HEDEF/home/$USERLOGIN/
  1329. [ -f /root/.bashrc ] && cp -f /root/.bashrc $HEDEF/home/$USERLOGIN/
  1330. if [ -d /run/initramfs/live/updates/root ];then
  1331. cp -rf /run/initramfs/live/updates/root/. $HEDEF/etc/skel/
  1332. cp -rf /run/initramfs/live/updates/root/. $HEDEF/home/$USERLOGIN/
  1333. fi
  1334. else
  1335. cp -rf /run/initramfs/live/updates/etc/skel/. $HEDEF/etc/skel/
  1336. fi
  1337. # kurulum özgü dosyaların silinmesi
  1338. rm -f $HEDEF/root/bin/canli_kullanici.sh
  1339. rm -rf $HEDEF/etc/canli_kullanici
  1340. rm -rf $HEDEF/opt/Milis-Yukleyici
  1341. rm -f $HEDEF/usr/share/applications/kurulum.desktop
  1342. rm -f $HEDEF/etc/shadow- $HEDEF/etc/gshadow- $HEDEF/etc/passwd- $HEDEF/etc/group-
  1343. # ly/save ile kurulum kullanıcı adı açılışta gelmesi sağlanacak
  1344. #rm -f $HEDEF/etc/ly/save
  1345. #sed -i "1c$USERLOGIN" $HEDEF/etc/ly/save
  1346. #sed -i "/^$USERLOGIN/d" $HEDEF/etc/security/opasswd
  1347. #[ -f $HEDEF/etc/lightdm/lightdm.conf.orj ] && cp $HEDEF/etc/lightdm/lightdm.conf.orj $HEDEF/etc/lightdm/lightdm.conf
  1348. #rm -f $HEDEF/home/$USERLOGIN/.config/user-dirs.dirs
  1349. set_keymap
  1350. chroot $HEDEF chown $USERLOGIN:$USERLOGIN -R /home/$USERLOGIN
  1351. [ -d $HEDEF/dev/snd ] && chroot $HEDEF setfacl -m u:$USERLOGIN:rw /dev/snd/*
  1352. if [ -f $HEDEF/etc/sudoers ]; then
  1353. if [ -z "$(echo $(get_option USERGROUPS) | grep -w wheel)" -a -n "$USERLOGIN" ]; then
  1354. # wheel grubuna üye olamayan kullanıcı için sudo açılır.
  1355. echo "# `printf "$LANG_ENABLESUDO" "$USERLOGIN"`" >> $HEDEF/etc/sudoers
  1356. echo "$USERLOGIN ALL=(ALL) ALL" >> $HEDEF/etc/sudoers
  1357. else
  1358. # wheel grubuna üye olan kullanıcı için sudoers eklemesi yapılır.
  1359. sed -i $HEDEF/etc/sudoers \
  1360. -e "s;#.*%wheel ALL=(ALL) ALL;%wheel ALL=(ALL) ALL;"
  1361. fi
  1362. unset USERLOGIN
  1363. fi
  1364. # Text tabanlı açılışı aktif et seçiliyse
  1365. if [ "$(get_option TEXTCONSOLE)" = "1" ]; then
  1366. sed -i $HEDEF/etc/default/grub \
  1367. -e 's|#\(GRUB_TERMINAL_INPUT\).*|\1=console|' \
  1368. -e 's|#\(GRUB_TERMINAL_OUTPUT\).*|\1=console|'
  1369. fi
  1370. # Bootloader yüklemesi
  1371. set_bootloader
  1372. sync && sync && sync
  1373. # bağlanan dizinler çözülür
  1374. umount_filesystems
  1375. # sistemin kopyalandıktan sonra yebaşla sorusu
  1376. if [ $SCRMODE == "text" ];then
  1377. echo "OK"
  1378. return
  1379. else
  1380. if [ -z "$YEBASLAT_ONAY" ]; then
  1381. DIALOG --yesno "`printf "$LANG_INSTALLSUCCESS" "${BOLD}" "${RESET}"`" ${YESNOSIZE}
  1382. if [ $? -eq 0 ]; then
  1383. reboot
  1384. else
  1385. DIE
  1386. fi
  1387. fi
  1388. fi
  1389. }
  1390. menu() {
  1391. if [ -z "$DEFITEM" ]; then
  1392. DEFITEM="$LANG_MENUKEYBOARD"
  1393. fi
  1394. DIALOG --default-item $DEFITEM \
  1395. --extra-button --extra-label "$LANG_MENUSETTINGS" \
  1396. --title " $LANG_INSTMENU " \
  1397. --menu "$MENULABEL" 10 70 0 \
  1398. "$LANG_MENUKEYBOARD" "$LANG_KEYBOARDSET" \
  1399. "$LANG_MENUHOSTNAME" "$LANG_HOSTSET" \
  1400. "$LANG_MENULOCALE" "$LANG_LOCALESET" \
  1401. "$LANG_MENUTIMEZONE" "$LANG_TIMEZONESET" \
  1402. "$LANG_MENUROOTPW" "$LANG_ROOTPWSET" \
  1403. "$LANG_MENUUSERACC" "$LANG_USERNPWSET" \
  1404. "$LANG_MENUBOOTLOADER" "$LANG_BOOTLOADERSET" \
  1405. "$LANG_MENUPARTITION" "$LANG_PARTITIONSET" \
  1406. "$LANG_MENUFILESYSTEM" "$LANG_FSYSSET" \
  1407. "$LANG_MENUINSTALL" "$LANG_INSTALLSETTINGS" \
  1408. "$LANG_MENUEXIT" "$LANG_EXITINST"
  1409. if [ $? -eq 3 ]; then
  1410. # Ayarların gösterilmesi
  1411. cp $AYAR_DOSYASI /tmp/conf_hidden.$$;
  1412. sed -i "s/^ROOTPASSWORD.*/ROOTPASSWORD <-hidden->/" /tmp/conf_hidden.$$
  1413. DIALOG --title "$LANG_SAVEDSETTINGS" --textbox /tmp/conf_hidden.$$ 18 90
  1414. rm /tmp/conf_hidden.$$
  1415. return
  1416. fi
  1417. case $(cat $ANSWER) in
  1418. "$LANG_MENUKEYBOARD") menu_keymap && [ -n "$KEYBOARD_YAPILDI" ] && DEFITEM="$LANG_MENUHOSTNAME";;
  1419. "$LANG_MENUHOSTNAME") menu_hostname && [ -n "$HOSTNAME_YAPILDI" ] && DEFITEM="$LANG_MENULOCALE";;
  1420. "$LANG_MENULOCALE") menu_locale && [ -n "$LOCALE_YAPILDI" ] && DEFITEM="$LANG_MENUTIMEZONE";;
  1421. "$LANG_MENUTIMEZONE") menu_timezone && [ -n "$TIMEZONE_YAPILDI" ] && DEFITEM="$LANG_MENUROOTPW";;
  1422. "$LANG_MENUROOTPW") menu_rootpassword && [ -n "$ROOTPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUUSERACC";;
  1423. "$LANG_MENUUSERACC") menu_useraccount && [ -n "$USERNAME_YAPILDI" ] && [ -n "$USERPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUBOOTLOADER";;
  1424. "$LANG_MENUBOOTLOADER") menu_bootloader && [ -n "$BOOTLOADER_YAPILDI" ] && DEFITEM="$LANG_MENUPARTITION";;
  1425. "$LANG_MENUPARTITION") menu_partitions && [ -n "$PARTITIONS_YAPILDI" ] && DEFITEM="$LANG_MENUFILESYSTEM";;
  1426. "$LANG_MENUFILESYSTEM") menu_filesystems && [ -n "$FILESYSTEMS_YAPILDI" ] && DEFITEM="$LANG_MENUINSTALL";;
  1427. "$LANG_MENUINSTALL") menu_install;;
  1428. "$LANG_MENUEXIT") DIE;;
  1429. *) DIALOG --yesno "$LANG_ABORTINST" ${YESNOSIZE} && DIE
  1430. esac
  1431. }
  1432. if [ ! -x /bin/dialog ]; then
  1433. echo "$LANG_ERRDIALOG"
  1434. exit 1
  1435. fi
  1436. if [ "$(id -u)" != "0" ]; then
  1437. echo "$LANG_INSTMUSTROOT" 1>&2
  1438. exit 1
  1439. fi
  1440. #
  1441. # kuruluma giriş noktası - eğer kurulum ayar dosyası parametre verilirse direk kuruluma başlayacak.
  1442. #
  1443. [ ! -z $DOSYADAN_KURULUM ] && menu_install && exit 0
  1444. DIALOG --title "${BOLD}${RED} $LANG_ENTERMILIS ${RESET}" --msgbox "`printf "$LANG_MAINDIALOG" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}"`" 16 80
  1445. while true; do
  1446. menu
  1447. done
  1448. exit 0