milis-kur 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  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-2020 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. #chroot $HEDEF useradd -m -G $(get_option USERGROUPS) -c "$(get_option USERNAME)" $(get_option USERLOGIN)
  970. useradd -R $HEDEF -m -G $(get_option USERGROUPS) -c "$(get_option USERNAME)" $(get_option USERLOGIN)
  971. #chroot $HEDEF echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  972. echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | chpasswd -R $HEDEF -c SHA512
  973. }
  974. menu_bootloader() {
  975. while true; do
  976. DIALOG --title " $LANG_BOOTLOADER" \
  977. --menu "$MENULABEL" ${MENUSIZE} $(show_disks) none "$LANG_BOOTLOTHER"
  978. if [ $? -eq 0 ]; then
  979. set_option BOOTLOADER "$(cat $ANSWER)"
  980. BOOTLOADER_YAPILDI=1
  981. break
  982. else
  983. return
  984. fi
  985. done
  986. while true; do
  987. DIALOG --yesno "$LANG_BOOTLGRAPH" ${YESNOSIZE}
  988. if [ $? -eq 0 ]; then
  989. set_option TEXTCONSOLE 0
  990. break
  991. elif [ $? -eq 1 ]; then
  992. set_option TEXTCONSOLE 1
  993. break
  994. else
  995. return
  996. fi
  997. done
  998. }
  999. set_bootloader() {
  1000. local dev=$(get_option BOOTLOADER) grub_args="--force "
  1001. if [ "$dev" = "none" ]; then return; fi
  1002. # efi sistem ve efivar kontrolü
  1003. if [ -n "$EFI_SYSTEM" ]; then
  1004. grub_args="--force --target=$EFI_TARGET --efi-directory=/boot/efi --bootloader-id=boot --recheck"
  1005. # efivarfs kernel modülü builtin geldiği varsayılıyor.
  1006. # yoksa modprobe efivarfs
  1007. mount -t efivarfs efivarfs /sys/firmware/efi/efivars
  1008. mount --bind /sys/firmware/efi/efivars $HEDEF/sys/firmware/efi/efivars
  1009. chroot $HEDEF grub-install $grub_args $dev >>$LOG 2>&1
  1010. cp $HEDEF/boot/efi/EFI/boot/grubx64.efi $HEDEF/boot/efi/EFI/boot/bootx64.efi
  1011. else
  1012. echo "`printf "$LANG_GRUBINST" "$grub_args $dev"`" >>$LOG
  1013. chroot $HEDEF grub-install $grub_args $dev >>$LOG 2>&1
  1014. fi
  1015. if [ $? -ne 0 ]; then
  1016. DIALOG --msgbox "`printf "$LANG_GRUBFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1017. DIE 1
  1018. fi
  1019. echo "`printf "$LANG_GRUBMKCONF" "$HEDEF"`" >>$LOG
  1020. chroot $HEDEF grub-mkconfig -o /boot/grub/grub.cfg >>$LOG 2>&1
  1021. if [ $? -ne 0 ]; then
  1022. DIALOG --msgbox "`printf "$LANG_GRUBMKCONFFAIL" "${BOLD}${RED}" "${RESET}" "$LOG"`" ${MSGBOXSIZE}
  1023. DIE 1
  1024. fi
  1025. }
  1026. validate_filesystems() {
  1027. local mnts dev size fstype mntpt mkfs rootfound fmt
  1028. local usrfound efi_system_partition
  1029. unset TARGETFS
  1030. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1031. set -- ${mnts}
  1032. while [ $# -ne 0 ]; do
  1033. fmt=""
  1034. dev=$2; fstype=$3; size=$4; mntpt="$5"; mkfs=$6
  1035. shift 6
  1036. if [ "$mntpt" = "/" ]; then
  1037. rootfound=1
  1038. elif [ "$mntpt" = "/usr" ]; then
  1039. usrfound=1
  1040. elif [ "$fstype" = "vfat" -a "$mntpt" = "/boot/efi" ]; then
  1041. efi_system_partition=1
  1042. fi
  1043. if [ "$mkfs" -eq 1 ]; then
  1044. fmt="$LANG_NEWFSYSTEM: "
  1045. fi
  1046. if [ -z "$TARGETFS" ]; then
  1047. TARGETFS="`printf "$LANG_MOUNTEDON" "${fmt}$dev" "$size" "$mntpt" "${fstype}"`"
  1048. else
  1049. TARGETFS="`printf "$LANG_MOUNTEDON" "${TARGETFS}${fmt}${dev}" "$size" "$mntpt" "${fstype}"`"
  1050. fi
  1051. done
  1052. if [ -z "$rootfound" ]; then
  1053. DIALOG --msgbox "`printf "$LANG_FSYSTEMNOTSET" "${BOLD}${RED}" "${RESET}" `" ${MSGBOXSIZE}
  1054. return 1
  1055. elif [ -n "$usrfound" ]; then
  1056. DIALOG --msgbox "`printf "$LANG_FSYSNOTSUPPORTED" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1057. return 1
  1058. elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then
  1059. DIALOG --msgbox "`printf "$LANG_FSYSEFINOTSET" "${BOLD}${RED}" "${RESET}"`" ${MSGBOXSIZE}
  1060. fi
  1061. FILESYSTEMS_YAPILDI=1
  1062. }
  1063. create_filesystems() {
  1064. local mnts dev mntpt fstype fspassno mkfs size rv uuid
  1065. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1066. set -- ${mnts}
  1067. while [ $# -ne 0 ]; do
  1068. dev=$2; fstype=$3; mntpt="$5"; mkfs=$6
  1069. shift 6
  1070. # swap bölümleme
  1071. if [ "$fstype" = "swap" ]; then
  1072. swapoff $dev >/dev/null 2>&1
  1073. if [ "$mkfs" -eq 1 ]; then
  1074. mkswap $dev >>$LOG 2>&1
  1075. if [ $? -ne 0 ]; then
  1076. if [ $SCRMODE == "text" ];then
  1077. echo "$LANG_SWAPFAIL"
  1078. else
  1079. DIALOG --msgbox "`printf "$LANG_SWAPFAIL" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1080. fi
  1081. DIE 1
  1082. fi
  1083. fi
  1084. swapon $dev >>$LOG 2>&1
  1085. if [ $? -ne 0 ]; then
  1086. if [ $SCRMODE == "text" ];then
  1087. echo "$LANG_SWAPERROR"
  1088. else
  1089. DIALOG --msgbox "`printf "$LANG_SWAPERROR" "${BOLD}${RED}" "${RESET}" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1090. fi
  1091. DIE 1
  1092. fi
  1093. # hedef fstaba girdi eklenmesi
  1094. uuid=$(blkid -o value -s UUID "$dev")
  1095. echo "UUID=$uuid none swap sw 0 0" >>$TARGET_FSTAB
  1096. continue
  1097. fi
  1098. if [ "$mkfs" -eq 1 ]; then
  1099. case "$fstype" in
  1100. btrfs) MKFS="mkfs.btrfs -f"; modprobe btrfs >>$LOG 2>&1;;
  1101. ext2) MKFS="mke2fs -F"; modprobe ext2 >>$LOG 2>&1;;
  1102. ext3) MKFS="mke2fs -F -j"; modprobe ext3 >>$LOG 2>&1;;
  1103. ext4) MKFS="mke2fs -F -t ext4"; modprobe ext4 >>$LOG 2>&1;;
  1104. f2fs) MKFS="mkfs.f2fs -f"; modprobe f2fs >>$LOG 2>&1;;
  1105. vfat) MKFS="mkfs.vfat -F32"; modprobe vfat >>$LOG 2>&1;;
  1106. xfs) MKFS="mkfs.xfs -f"; modprobe xfs >>$LOG 2>&1;;
  1107. esac
  1108. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1109. if [ $SCRMODE == "text" ];then
  1110. echo "$LANG_CREATEFSYS"
  1111. else
  1112. INFOBOX "`printf "$LANG_CREATEFSYS" "$fstype" "$dev" "$mntpt"`" 8 60
  1113. fi
  1114. echo "`printf "$LANG_CREATEMKFS" "$MKFS $dev"`" >>$LOG
  1115. # hedef disk bölümü bağlı olabilir, çözmek için
  1116. mount | grep -q "$dev" && umount -l $dev
  1117. $MKFS $dev >>$LOG 2>&1; rv=$?
  1118. if [ $rv -ne 0 ]; then
  1119. if [ $SCRMODE == "text" ];then
  1120. echo "$LANG_CREATEFAIL"
  1121. else
  1122. DIALOG --msgbox "`printf "$LANG_CREATEFAIL" "${BOLD}${RED}" "${RESET}" "$fstype" "$dev" "$LOG"`" ${MSGBOXSIZE}
  1123. fi
  1124. DIE 1
  1125. fi
  1126. fi
  1127. # rootfs nin bağlanması
  1128. [ "$mntpt" != "/" ] && continue
  1129. mkdir -p $HEDEF
  1130. echo "`printf "$LANG_MOUNTINGON" "$dev" "$mntpt" "$fstype"`" >>$LOG
  1131. mount -t $fstype $dev $HEDEF >>$LOG 2>&1
  1132. if [ $? -ne 0 ]; then
  1133. if [ $SCRMODE == "text" ];then
  1134. echo "$LANG_MOUNTINGERR"
  1135. else
  1136. DIALOG --msgbox "`printf "$LANG_MOUNTINGERR" "${BOLD}${RED}" "${RESET}" "$dev" "${mntpt}" "$LOG"`" ${MSGBOXSIZE}
  1137. fi
  1138. DIE 1
  1139. fi
  1140. # hedef fstaba girdi eklenmesi
  1141. uuid=$(blkid -o value -s UUID "$dev")
  1142. if [ "$fstype" = "f2fs" ]; then
  1143. fspassno=0
  1144. else
  1145. fspassno=1
  1146. fi
  1147. echo "UUID=$uuid $mntpt $fstype defaults 0 $fspassno" >>$TARGET_FSTAB
  1148. done
  1149. # dosya sistemlerinin hedefe bağlanması
  1150. mnts=$(grep -E '^MOUNTPOINT.*' $AYAR_DOSYASI)
  1151. set -- ${mnts}
  1152. while [ $# -ne 0 ]; do
  1153. dev=$2; fstype=$3; mntpt="$5"
  1154. shift 6
  1155. [ "$mntpt" = "/" -o "$fstype" = "swap" ] && continue
  1156. mkdir -p ${HEDEF}${mntpt}
  1157. echo "$LANG_MOUNTINGON" >>$LOG
  1158. mount -t $fstype $dev ${HEDEF}${mntpt} >>$LOG 2>&1
  1159. if [ $? -ne 0 ]; then
  1160. if [ $SCRMODE == "text" ];then
  1161. echo "$LANG_MOUNTINGERR"
  1162. else
  1163. DIALOG --msgbox "$LANG_MOUNTINGERR" ${MSGBOXSIZE}
  1164. fi
  1165. DIE
  1166. fi
  1167. # hedef fstaba girdi eklenmesi
  1168. uuid=$(blkid -o value -s UUID "$dev")
  1169. echo "UUID=$uuid $mntpt $fstype defaults 0 2" >>$TARGET_FSTAB
  1170. done
  1171. }
  1172. mount_filesystems() {
  1173. for f in sys proc dev; do
  1174. [ ! -d $HEDEF/$f ] && mkdir $HEDEF/$f
  1175. echo "Mounting $HEDEF/$f..." >>$LOG
  1176. mount --bind /$f $HEDEF/$f >>$LOG 2>&1
  1177. done
  1178. }
  1179. umount_filesystems() {
  1180. local f
  1181. for f in sys/fs/fuse/connections sys/firmware/efi/efivars sys proc dev; do
  1182. if [ -d $HEDEF/$f ];then
  1183. echo "Unmounting $HEDEF/$f..." >>$LOG
  1184. umount $HEDEF/$f >>$LOG 2>&1
  1185. fi
  1186. done
  1187. local mnts="$(grep -E '^MOUNTPOINT.*$' $AYAR_DOSYASI)"
  1188. set -- ${mnts}
  1189. while [ $# -ne 0 ]; do
  1190. local dev=$2; local fstype=$3; local mntpt=$5
  1191. shift 6
  1192. if [ "$fstype" = "swap" ]; then
  1193. echo "`printf "$LANG_SWAPDISABLING" "$dev" `" >>$LOG
  1194. swapoff $dev >>$LOG 2>&1
  1195. continue
  1196. fi
  1197. if [ "$mntpt" != "/" ]; then
  1198. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF/$mntpt" `" >>$LOG
  1199. umount $HEDEF/$mntpt >>$LOG 2>&1
  1200. fi
  1201. done
  1202. echo "`printf "$LANG_SWAPUNMOUNTING" "$HEDEF"`" >>$LOG
  1203. umount $HEDEF >>$LOG 2>&1
  1204. }
  1205. log_and_count() {
  1206. local progress whole tenth
  1207. while read line; do
  1208. #echo "$line" >>$LOG
  1209. copy_count=$((copy_count + 1))
  1210. progress=$((1000 * copy_count / copy_total))
  1211. if [ "$progress" != "$copy_progress" ]; then
  1212. whole=$((progress / 10))
  1213. tenth=$((progress % 10))
  1214. printf "$LANG_PROGRESS" $whole $tenth $copy_count $copy_total
  1215. copy_progress=$progress
  1216. fi
  1217. #echo "$copy_progress" >>$LOG
  1218. done
  1219. }
  1220. copy_rootfs() {
  1221. local tar_in="--create --one-file-system --xattrs"
  1222. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1223. if [ $SCRMODE == "text" ];then
  1224. echo "$LANG_COUNTFILES"
  1225. else
  1226. INFOBOX "$LANG_COUNTFILES" 4 60
  1227. fi
  1228. copy_total=$(tar ${tar_in} -v -f /dev/null / 2>/dev/null | wc -l)
  1229. export copy_total copy_count=0 copy_progress=
  1230. clear
  1231. if [ $SCRMODE == "text" ];then
  1232. tar ${tar_in} -f - / 2>/dev/null | tar --extract --xattrs --xattrs-include='*' --preserve-permissions -v -f - -C $HEDEF | log_and_count
  1233. else
  1234. 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
  1235. fi
  1236. if [ $? -ne 0 ]; then
  1237. DIE 1
  1238. fi
  1239. unset copy_total copy_count copy_percent
  1240. }
  1241. menu_install() {
  1242. # dosya sistemi hazır değilse devam edilmeyecek.
  1243. validate_filesystems || return 1
  1244. ROOTPASSWORD_YAPILDI="$(get_option ROOTPASSWORD)"
  1245. BOOTLOADER_YAPILDI="$(get_option BOOTLOADER)"
  1246. if [ -z "$FILESYSTEMS_YAPILDI" ]; then
  1247. if [ $SCRMODE == "text" ];then
  1248. echo "$LANG_FSYSNOTCONF"
  1249. else
  1250. DIALOG --msgbox "`printf "$LANG_FSYSNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1251. fi
  1252. return 1
  1253. elif [ -z "$ROOTPASSWORD_YAPILDI" ]; then
  1254. if [ $SCRMODE == "text" ];then
  1255. echo "$LANG_ROOTPWNOTCONF"
  1256. else
  1257. DIALOG --msgbox "`printf "$LANG_ROOTPWNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1258. fi
  1259. return 1
  1260. elif [ -z "$BOOTLOADER_YAPILDI" ]; then
  1261. if [ $SCRMODE == "text" ];then
  1262. echo "$LANG_BOOTLNOTCONF"
  1263. else
  1264. DIALOG --msgbox "`printf "$LANG_BOOTLNOTCONF" "${BOLD}" "${RESET}"`" ${MSGBOXSIZE}
  1265. fi
  1266. return 1
  1267. fi
  1268. if [ -z "$FORMAT_ONAY" ]; then
  1269. DIALOG --yesno "`printf "$LANG_DESTROYWARN" "${BOLD}" "${RESET}" "${BOLD}${TARGETFS}${RESET}" "${BOLD}${RED}" "${RESET}" "${BOLD}" "${RESET}"`" 20 80 || return
  1270. fi
  1271. unset TARGETFS
  1272. # Dosya sistemlerinin oluşturulup-bağlanması
  1273. create_filesystems
  1274. # ağdan paket kurulum eklenecek.
  1275. KAYNAK="YEREL"
  1276. if [ $KAYNAK="YEREL" ]; then
  1277. # dosya sisteminin kopyalanması
  1278. copy_rootfs
  1279. USERNAME=$CANLI_KULLANICI
  1280. # Canlı kulanıcının silinmesi root değilse
  1281. if [ $USERNAME != "root" ];then
  1282. echo "`printf "$LANG_RMTARGET" "$USERNAME"`" >>$LOG
  1283. chroot $HEDEF userdel -r $USERNAME >>$LOG 2>&1
  1284. sed -i -e "/$USERNAME ALL=.*/d" $HEDEF/etc/sudoers
  1285. fi
  1286. TITLE="`printf "$LANG_ERRLOGTITLE" "$LOG"`"
  1287. if [ $SCRMODE == "text" ];then
  1288. echo "$LANG_BUILDINGINITRAMFS"
  1289. else
  1290. INFOBOX "$LANG_BUILDINGINITRAMFS" 4 60
  1291. fi
  1292. echo "$LANG_BUILDINGINITRAMFS" >>$LOG
  1293. # gerekli dosya istemlerinin bağlanması
  1294. mount_filesystems
  1295. rm -f $HEDEF/boot/initramfs*
  1296. rm -f $HEDEF/boot/initrd*
  1297. rm -f $HEDEF/boot/kernel*
  1298. cp /boot/kernel-* $HEDEF/boot/
  1299. local sonek="milis"
  1300. local kversion=`ls $HEDEF/boot/kernel-* | xargs -I {} basename {} | head -n1 |cut -d'-' -f2`
  1301. chroot $HEDEF dracut -H --xz --omit systemd --add-drivers "ahci" -f /boot/initrd.img-${kversion} $kversion-$sonek --force >>$LOG 2>&1
  1302. #chroot $HEDEF ln -s /boot/kernel-* /boot/kernel
  1303. rmdir $HEDEF/mnt/target
  1304. fi
  1305. if [ $SCRMODE == "text" ];then
  1306. echo "$LANG_APPLYSETTINGS"
  1307. else
  1308. INFOBOX "$LANG_APPLYSETTINGS" 4 60
  1309. fi
  1310. # fstab ın hedef diske kopyalanması
  1311. install -Dm644 $TARGET_FSTAB $HEDEF/etc/fstab
  1312. # /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
  1313. # echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> $HEDEF/etc/fstab
  1314. # keymap, bölgesel ve yerel zaman ayarları, hostname, root-kullanıcı şifre
  1315. #set_keymap
  1316. set_locale
  1317. set_timezone
  1318. set_hostname
  1319. set_rootpassword
  1320. set_useraccount
  1321. # Kullanıcı ve root için öntanımlı ayarların kopyalanması
  1322. #cp $HEDEF/etc/skel/.[bix]* $HEDEF/root
  1323. USERLOGIN="$(get_option USERLOGIN)"
  1324. mkdir -p $HEDEF/home/$USERLOGIN/
  1325. # todo!!! kull. ayarları updates/skel altından alınacak.
  1326. # todo!!! alias mps
  1327. # todo!!! source /etc/profile
  1328. if [ $CANLI_KULLANICI == "root" ];then
  1329. [ -d /root/.config ] && cp -rf /root/.config $HEDEF/home/$USERLOGIN/
  1330. [ -f /root/.gitconfig ] && cp -f /root/.gitconfig $HEDEF/home/$USERLOGIN/
  1331. [ -f /root/.xinitrc ] && cp -rf /root/.xinitrc $HEDEF/home/$USERLOGIN/
  1332. [ -f /root/.bashrc ] && cp -f /root/.bashrc $HEDEF/home/$USERLOGIN/
  1333. if [ -d /run/initramfs/live/updates/root ];then
  1334. cp -rf /run/initramfs/live/updates/root/. $HEDEF/etc/skel/
  1335. cp -rf /run/initramfs/live/updates/root/. $HEDEF/home/$USERLOGIN/
  1336. fi
  1337. else
  1338. cp -rf /home/$CANLI_KULLANICI/.config $HEDEF/home/$USERLOGIN
  1339. cp -rf /run/initramfs/live/updates/etc/skel/. $HEDEF/etc/skel/
  1340. cp -rf /run/initramfs/live/updates/etc/skel/. $HEDEF/home/$USERLOGIN/
  1341. fi
  1342. # kurulum özgü dosyaların silinmesi
  1343. rm -f $HEDEF/root/bin/canli_kullanici.sh
  1344. rm -rf $HEDEF/etc/canli_kullanici
  1345. rm -rf $HEDEF/opt/Milis-Yukleyici
  1346. rm -f $HEDEF/usr/share/applications/kurulum.desktop
  1347. rm -f $HEDEF/etc/shadow- $HEDEF/etc/gshadow- $HEDEF/etc/passwd- $HEDEF/etc/group-
  1348. # ly/save ile kurulum kullanıcı adı açılışta gelmesi sağlanacak
  1349. #rm -f $HEDEF/etc/ly/save
  1350. sed -i "1c$USERLOGIN" $HEDEF/etc/ly/save
  1351. #sed -i "/^$USERLOGIN/d" $HEDEF/etc/security/opasswd
  1352. [ -f $HEDEF/etc/lightdm/lightdm.conf.orj ] && cp $HEDEF/etc/lightdm/lightdm.conf.orj $HEDEF/etc/lightdm/lightdm.conf
  1353. #YDIL="$(echo "$(get_option LOCALE)" | tr "." "\n" | head -n1)"
  1354. #echo "$YDIL" > $HEDEF/home/$USERLOGIN/.config/user-dirs.locale
  1355. # dil Türkçe ise kullanıcı dizinlerindeki Türkçe adlandırmanın düzeltilmesi
  1356. set_keymap
  1357. chroot $HEDEF chown $USERLOGIN:$USERLOGIN -R /home/$USERLOGIN
  1358. rm -f $HEDEF/home/$USERLOGIN/.config/user-dirs.dirs
  1359. [ -d $HEDEF/dev/snd ] && chroot $HEDEF setfacl -m u:$USERLOGIN:rw /dev/snd/*
  1360. if [ -f $HEDEF/etc/sudoers ]; then
  1361. if [ -z "$(echo $(get_option USERGROUPS) | grep -w wheel)" -a -n "$USERLOGIN" ]; then
  1362. # wheel grubuna üye olamayan kullanıcı için sudo açılır.
  1363. echo "# `printf "$LANG_ENABLESUDO" "$USERLOGIN"`" >> $HEDEF/etc/sudoers
  1364. echo "$USERLOGIN ALL=(ALL) ALL" >> $HEDEF/etc/sudoers
  1365. else
  1366. # wheel grubuna üye olan kullanıcı için sudoers eklemesi yapılır.
  1367. sed -i $HEDEF/etc/sudoers \
  1368. -e "s;#.*%wheel ALL=(ALL) ALL;%wheel ALL=(ALL) ALL;"
  1369. fi
  1370. unset USERLOGIN
  1371. fi
  1372. # Text tabanlı açılışı aktif et seçiliyse
  1373. if [ "$(get_option TEXTCONSOLE)" = "1" ]; then
  1374. sed -i $HEDEF/etc/default/grub \
  1375. -e 's|#\(GRUB_TERMINAL_INPUT\).*|\1=console|' \
  1376. -e 's|#\(GRUB_TERMINAL_OUTPUT\).*|\1=console|'
  1377. fi
  1378. # Bootloader yüklemesi
  1379. set_bootloader
  1380. sync && sync && sync
  1381. # bağlanan dizinler çözülür
  1382. umount_filesystems
  1383. # sistemin kopyalandıktan sonra yebaşla sorusu
  1384. if [ $SCRMODE == "text" ];then
  1385. echo "OK"
  1386. return
  1387. else
  1388. if [ -z "$YEBASLAT_ONAY" ]; then
  1389. DIALOG --yesno "`printf "$LANG_INSTALLSUCCESS" "${BOLD}" "${RESET}"`" ${YESNOSIZE}
  1390. if [ $? -eq 0 ]; then
  1391. reboot
  1392. else
  1393. DIE
  1394. fi
  1395. fi
  1396. fi
  1397. }
  1398. menu() {
  1399. if [ -z "$DEFITEM" ]; then
  1400. DEFITEM="$LANG_MENUKEYBOARD"
  1401. fi
  1402. DIALOG --default-item $DEFITEM \
  1403. --extra-button --extra-label "$LANG_MENUSETTINGS" \
  1404. --title " $LANG_INSTMENU " \
  1405. --menu "$MENULABEL" 10 70 0 \
  1406. "$LANG_MENUKEYBOARD" "$LANG_KEYBOARDSET" \
  1407. "$LANG_MENUHOSTNAME" "$LANG_HOSTSET" \
  1408. "$LANG_MENULOCALE" "$LANG_LOCALESET" \
  1409. "$LANG_MENUTIMEZONE" "$LANG_TIMEZONESET" \
  1410. "$LANG_MENUROOTPW" "$LANG_ROOTPWSET" \
  1411. "$LANG_MENUUSERACC" "$LANG_USERNPWSET" \
  1412. "$LANG_MENUBOOTLOADER" "$LANG_BOOTLOADERSET" \
  1413. "$LANG_MENUPARTITION" "$LANG_PARTITIONSET" \
  1414. "$LANG_MENUFILESYSTEM" "$LANG_FSYSSET" \
  1415. "$LANG_MENUINSTALL" "$LANG_INSTALLSETTINGS" \
  1416. "$LANG_MENUEXIT" "$LANG_EXITINST"
  1417. if [ $? -eq 3 ]; then
  1418. # Ayarların gösterilmesi
  1419. cp $AYAR_DOSYASI /tmp/conf_hidden.$$;
  1420. sed -i "s/^ROOTPASSWORD.*/ROOTPASSWORD <-hidden->/" /tmp/conf_hidden.$$
  1421. DIALOG --title "$LANG_SAVEDSETTINGS" --textbox /tmp/conf_hidden.$$ 18 90
  1422. rm /tmp/conf_hidden.$$
  1423. return
  1424. fi
  1425. case $(cat $ANSWER) in
  1426. "$LANG_MENUKEYBOARD") menu_keymap && [ -n "$KEYBOARD_YAPILDI" ] && DEFITEM="$LANG_MENUHOSTNAME";;
  1427. "$LANG_MENUHOSTNAME") menu_hostname && [ -n "$HOSTNAME_YAPILDI" ] && DEFITEM="$LANG_MENULOCALE";;
  1428. "$LANG_MENULOCALE") menu_locale && [ -n "$LOCALE_YAPILDI" ] && DEFITEM="$LANG_MENUTIMEZONE";;
  1429. "$LANG_MENUTIMEZONE") menu_timezone && [ -n "$TIMEZONE_YAPILDI" ] && DEFITEM="$LANG_MENUROOTPW";;
  1430. "$LANG_MENUROOTPW") menu_rootpassword && [ -n "$ROOTPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUUSERACC";;
  1431. "$LANG_MENUUSERACC") menu_useraccount && [ -n "$USERNAME_YAPILDI" ] && [ -n "$USERPASSWORD_YAPILDI" ] && DEFITEM="$LANG_MENUBOOTLOADER";;
  1432. "$LANG_MENUBOOTLOADER") menu_bootloader && [ -n "$BOOTLOADER_YAPILDI" ] && DEFITEM="$LANG_MENUPARTITION";;
  1433. "$LANG_MENUPARTITION") menu_partitions && [ -n "$PARTITIONS_YAPILDI" ] && DEFITEM="$LANG_MENUFILESYSTEM";;
  1434. "$LANG_MENUFILESYSTEM") menu_filesystems && [ -n "$FILESYSTEMS_YAPILDI" ] && DEFITEM="$LANG_MENUINSTALL";;
  1435. "$LANG_MENUINSTALL") menu_install;;
  1436. "$LANG_MENUEXIT") DIE;;
  1437. *) DIALOG --yesno "$LANG_ABORTINST" ${YESNOSIZE} && DIE
  1438. esac
  1439. }
  1440. if [ ! -x /bin/dialog ]; then
  1441. echo "$LANG_ERRDIALOG"
  1442. exit 1
  1443. fi
  1444. if [ "$(id -u)" != "0" ]; then
  1445. echo "$LANG_INSTMUSTROOT" 1>&2
  1446. exit 1
  1447. fi
  1448. #
  1449. # kuruluma giriş noktası - eğer kurulum ayar dosyası parametre verilirse direk kuruluma başlayacak.
  1450. #
  1451. [ ! -z $DOSYADAN_KURULUM ] && menu_install && exit 0
  1452. DIALOG --title "${BOLD}${RED} $LANG_ENTERMILIS ${RESET}" --msgbox "`printf "$LANG_MAINDIALOG" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}" "${BOLD}" "${RESET}"`" 16 80
  1453. while true; do
  1454. menu
  1455. done
  1456. exit 0