-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuilder.sh
More file actions
executable file
·121 lines (107 loc) · 3.7 KB
/
builder.sh
File metadata and controls
executable file
·121 lines (107 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# 28 Kasim 2017
# v1.0.1 / aydin@komutan.org
set -e
# gerekli fonksiyonlar
. scripts/mesaj.sh
. scripts/mount-umount.sh
# builder mevcut dizini
BUILDER_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# yetki kontrol
if [ "$(id -u)" != "0" ]; then mesaj hata "Root hakları ile çalıştırılmalıdır."; exit 1; fi
# gerekli paketlerin kontrolu ve yoksa kurulmasi
if [ ! -d "/var/lib/pkg/DB/lzip" ]; then mps kur lzip; fi
if [ ! -d "/var/lib/pkg/DB/squashfs" ]; then mps kur squashfs; fi
if [ ! -d "/var/lib/pkg/DB/syslinux" ]; then mps kur syslinux; fi
if [ ! -d "/var/lib/pkg/DB/cdrkit" ]; then mps kur cdrkit; fi
# ayarlar
ayarlar() {
if [ -f "$1" ];then
. $1
else
mesaj hata "iso yapımı için bir ayar dosyası yolu bulunamadı."
. $BUILDER_ROOT/ayarlar/ayarlar.conf
fi
# ayarlar.conf'da belirtilmesi gereken degiskenlerin kontrolu
if [ -z "$DAGITIM" ]; then mesaj hata "DAGITIM=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$KODADI" ]; then mesaj hata "KODADI=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$VERSIYON" ];then mesaj hata "VERSIYON=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
#if [ -z "$MASAUSTU" ];then mesaj hata "MASAUSTU=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$GIRISYONETICISI" ];then mesaj hata "GIRISYONETICISI=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$HOSTNAME" ];then mesaj hata "HOSTNAME=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$CANLI_KULLANICI" ];then mesaj hata "CANLI_KULLANICI=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$ROOT_PAROLASI" ];then mesaj hata "ROOT_PAROLASI=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$ISO_ETIKET" ];then mesaj hata "ISO_ETIKET=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$UEFI" ];then mesaj hata "UEFI=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$OZELLESTIRME" ];then mesaj hata "OZELLESTIRME=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ ! -d "$OZELLESTIRME" ];then mesaj hata "ayarlar.conf da belirtilen '$OZELLESTIRME' klasörü bulunamadı!"; exit 1; fi
if [ -z "$PLYMOUTH_TEMA" ];then mesaj hata "PLYMOUTH_TEMA=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$LFS" ];then mesaj hata "LFS=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$MPSCONF" ];then mesaj hata "MPSCONF=\"\" ayarlar.conf dosyasında tanımlanmamış!"; exit 1; fi
if [ -z "$sunucular" ];then mesaj hata "sunucular=\"\" mps.conf dosyasında tanımlanmamış!"; exit 1; fi
}
# mps.conf
if [ -z "$MPSCONF" ];then
. $BUILDER_ROOT/ayarlar/mps.conf
else
if [ ! -f "$MPSCONF" ]; then
mesaj hata "$MPSCONF yolu bulunamadı!";
exit 1;
else
. $MPSCONF
fi
fi
# parametreler
case "$1" in
# iso islemleri
-t|--temizle|adim0)
ayarlar $2
. scripts/temizle.sh
;;
-o|--onhazirlik|adim1)
ayarlar $2
. scripts/iso-onhazirlik.sh
;;
-i|--iso|adim2)
ayarlar $2
SFS_OLUSTUR="var"
. scripts/iso-olustur.sh
;;
-si|--sadece-iso)
ayarlar $2
. scripts/iso-olustur.sh
;;
-c|--chroot)
. scripts/chroot.sh
;;
# qemu
-q|--qemu)
. scripts/qemu.sh
;;
# yps secenekleri
-yo|--yps-olustur)
ayarlar $2
. scripts/yps-olustur.sh
;;
-yb|--yps-baslat)
ayarlar $2
. scripts/yps-baslat.sh
;;
-yd|--yps-durdur)
fuser -k 8888/tcp
;;
-yg|--yps-guncelle)
ayarlar $2
. scripts/yps-guncelle.sh
;;
-yk|--yps-kontrol)
ayarlar $2
. scripts/yps-kontrol.sh
;;
-y|-h|--yardim)
. scripts/yardim.sh
;;
*)
mesaj hata "Lütfen parametre giriniz. Yardım için -y kullanabilirsiniz."
esac
exit