From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, seventeen, updated. 57629914e8dd6559c163093312bd51adf677ddb7 Date: Sun, 26 Oct 2014 20:12:22 +0100 Message-ID: <20141026191222.EE17920718@argus.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3064211224440922747==" List-Id: --===============3064211224440922747== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, seventeen has been updated via 57629914e8dd6559c163093312bd51adf677ddb7 (commit) via 681c9bbe619ada94cc614719d276aa31397e2476 (commit) via a8fca24560c74f0c37a270f93bd957f0c0b981f6 (commit) via 335c5bd1cdfa81cac2f2aebf10c089f47039c0a4 (commit) via c0511f3ab35cc059e0777b7481eaee105c738f5e (commit) via 2404450b403607c9f08745b16b04eaf2bd1dac83 (commit) via 211c7984d4fe68d13efb9a71a10e9468aba75c27 (commit) via e41fbb6f0d47b0468f7c3ed2f7dbcae2d8bc9c4b (commit) via ad929675747de68e41b3d013858e42731bf904c2 (commit) via f797c74a2b8eaeaa359f52acf56ec3d3ba72f52d (commit) from f2a7ec21e3abe4085ca113d7962bf60b150de7c6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 57629914e8dd6559c163093312bd51adf677ddb7 Merge: 681c9bb f2a7ec2 Author: Michael Tremer Date: Sun Oct 26 20:11:57 2014 +0100 Merge remote-tracking branch 'origin/seventeen' into seventeen =20 Conflicts: make.sh commit 681c9bbe619ada94cc614719d276aa31397e2476 Author: Michael Tremer Date: Sun Oct 26 20:11:04 2014 +0100 installer: Implement option to run a postinstall script in the installer commit a8fca24560c74f0c37a270f93bd957f0c0b981f6 Author: Michael Tremer Date: Sun Oct 26 16:00:03 2014 +0100 installer: Allow to disable creation of swap space on command line commit 335c5bd1cdfa81cac2f2aebf10c089f47039c0a4 Author: Michael Tremer Date: Sat Oct 25 15:54:45 2014 +0200 installer: Fix loads of compiler warnings commit c0511f3ab35cc059e0777b7481eaee105c738f5e Author: Michael Tremer Date: Sat Oct 25 14:56:23 2014 +0200 installer: Rework downloading ISO and allow using a custom URL commit 2404450b403607c9f08745b16b04eaf2bd1dac83 Author: Michael Tremer Date: Thu Oct 23 01:05:56 2014 +0200 installer: Simplify kernel command line parsing commit 211c7984d4fe68d13efb9a71a10e9468aba75c27 Author: Michael Tremer Date: Tue Oct 21 22:30:36 2014 +0200 installer: Create a config struct commit e41fbb6f0d47b0468f7c3ed2f7dbcae2d8bc9c4b Merge: 6e0b26b ad92967 Author: Michael Tremer Date: Tue Oct 21 21:14:19 2014 +0200 Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into seven= teen ----------------------------------------------------------------------- Summary of changes: config/rootfiles/common/installer | 1 + doc/language_issues.tr | 6 - langs/tr/cgi-bin/tr.pl | 94 ++++---- lfs/installer | 8 +- src/installer/Makefile.am | 2 + src/installer/configure.ac | 15 ++ src/installer/downloadsource.sh | 56 +++-- src/installer/dracut-module/70-dhcpcd.exe | 48 +++- src/installer/dracut-module/module-setup.sh | 14 +- ...{start-networking.sh =3D> execute-postinstall.sh} | 68 +++--- src/installer/hw.c | 75 ++++++- src/installer/hw.h | 7 +- src/installer/main.c | 245 ++++++++++++++-----= -- src/installer/start-networking.sh | 4 + 14 files changed, 416 insertions(+), 227 deletions(-) copy src/installer/{start-networking.sh =3D> execute-postinstall.sh} (60%) Difference in files: diff --git a/config/rootfiles/common/installer b/config/rootfiles/common/inst= aller index 71b537d..a0cb093 100644 --- a/config/rootfiles/common/installer +++ b/config/rootfiles/common/installer @@ -1,4 +1,5 @@ #usr/bin/downloadsource.sh +#usr/bin/execute-postinstall.sh #usr/bin/start-networking.sh #usr/bin/installer #usr/lib/dracut/modules.d/99installer diff --git a/doc/language_issues.tr b/doc/language_issues.tr index cb16a44..f50f01d 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -663,12 +663,6 @@ WARNING: translation string unused: year-graph WARNING: translation string unused: yearly firewallhits WARNING: untranslated string: Scan for Songs WARNING: untranslated string: bytes -WARNING: untranslated string: fwdfw err concon -WARNING: untranslated string: fwdfw err ratecon -WARNING: untranslated string: fwdfw limitconcon -WARNING: untranslated string: fwdfw maxconcon -WARNING: untranslated string: fwdfw numcon -WARNING: untranslated string: fwdfw ratelimit WARNING: untranslated string: fwhost err hostip WARNING: untranslated string: route config changed WARNING: untranslated string: routing config added diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl index 90eed2d..ca199bf 100644 --- a/langs/tr/cgi-bin/tr.pl +++ b/langs/tr/cgi-bin/tr.pl @@ -99,9 +99,9 @@ 'addons' =3D> 'Eklentiler', 'admin user password has been changed' =3D> 'Y=C3=B6netici kullan=C4=B1c=C4= =B1 =C5=9Fifresi de=C4=9Fi=C5=9Ftirildi.', 'admin users' =3D> 'Yetkili kullan=C4=B1c=C4=B1 haklar=C4=B1 ile kullan=C4= =B1c=C4=B1', -'administrator password' =3D> 'Admin parolas=C4=B1', +'administrator password' =3D> 'Y=C3=B6netici parolas=C4=B1', 'administrator user password' =3D> 'Admin kullan=C4=B1c=C4=B1 parolas=C4=B1:= ', -'administrator username' =3D> 'Admin kullan=C4=B1c=C4=B1s=C4=B1', +'administrator username' =3D> 'Y=C3=B6netici kullan=C4=B1c=C4=B1 ad=C4=B1', 'adsl settings' =3D> 'ADSL ayarlar=C4=B1', 'advanced' =3D> 'Geli=C5=9Fmi=C5=9F', 'advanced server' =3D> 'Geli=C5=9Fmi=C5=9F Sunucu Se=C3=A7enekleri', @@ -114,7 +114,7 @@ 'advproxy AUTH method ldap' =3D> 'LDAP', 'advproxy AUTH method ncsa' =3D> 'Yerel', 'advproxy AUTH method none' =3D> 'Yok', -'advproxy AUTH method ntlm' =3D> 'Windows', +'advproxy AUTH method ntlm' =3D> 'Windows NT4 Alan Ad=C4=B1', 'advproxy AUTH method ntlm auth' =3D> 'Windows Aktif Dizini', 'advproxy AUTH method radius' =3D> 'RADIUS', 'advproxy AUTH no auth' =3D> 'Kimlik do=C4=9Frulamas=C4=B1 olmayan hedefler = (her sat=C4=B1rda bir tane)', @@ -196,7 +196,7 @@ 'advproxy back to main page' =3D> 'Ana Sayfaya Geri D=C3=B6n', 'advproxy banned ip clients' =3D> 'Yasaklanan IP adresleri (her sat=C4=B1rda= bir tane)', 'advproxy banned mac clients' =3D> 'Yasaklanan MAC adresleri (her sat=C4=B1r= da bir tane)', -'advproxy basic authentication' =3D> 'Temel HTTP kimlik do=C4=9Frulama izni', +'advproxy basic authentication' =3D> 'Temel HTTP kimlik do=C4=9Frulamas=C4= =B1na izin ver', 'advproxy cache management' =3D> '=C3=96nbellek y=C3=B6netimi', 'advproxy cache replacement policy' =3D> '=C3=96nbellek de=C4=9Fi=C5=9Ftirme= kural=C4=B1', 'advproxy cache-digest' =3D> '=C3=96nbellek-=C3=B6zeti =C3=BCretimini aktifl= e=C5=9Ftir', @@ -692,12 +692,12 @@ 'details' =3D> 'Detaylar', 'device' =3D> 'Ayg=C4=B1t', 'devices on blue' =3D> 'Mavi =C3=BCzerindeki ayg=C4=B1tlar', -'dh' =3D> 'Anahtar de=C4=9Fi=C5=9Fim parametreleri', -'dh key move failed' =3D> 'Anahtar de=C4=9Fi=C5=9Fim parametreleri ta=C5=9F= =C4=B1nmas=C4=B1 ba=C5=9Far=C4=B1s=C4=B1z.', -'dh key warn' =3D> '1024 veya 2048 bit uzunlu=C4=9Funda anahtar de=C4=9Fi=C5= =9Fim paremetrelerini olu=C5=9Fturma birka=C3=A7 dakika s=C3=BCrer. 3072 veya= 4096 bit uzunlu=C4=9Fundaki anahtar olu=C5=9Fturma ise birka=C3=A7 saat s=C3= =BCrebilir. L=C3=BCtfen sab=C4=B1rl=C4=B1 olun.', -'dh key warn1' =3D> 'K=C3=BC=C3=A7=C3=BCk entropi veya zay=C4=B1f sistemler = i=C3=A7in y=C3=BCkleme fonksiyonu kullan=C4=B1m=C4=B1 ile uzun anahtar de=C4= =9Fi=C5=9Fim parametreleri y=C3=BCklemesi tavsiye edilir.', -'dh name is invalid' =3D> 'Ge=C3=A7ersiz ad. L=C3=BCtfen "dh1024.pem" bi=C3= =A7iminde ad kullan=C4=B1n.', -'dh parameter' =3D> 'Anahtar de=C4=9Fi=C5=9Fim parametreleri', +'dh' =3D> 'Diffie-Hellman parametreleri', +'dh key move failed' =3D> 'Diffie-Hellman parametreleri ta=C5=9F=C4=B1namad= =C4=B1.', +'dh key warn' =3D> '1024 veya 2048 bit uzunlu=C4=9Fundaki Diffie-Hellman par= ametrelerini olu=C5=9Fturma birka=C3=A7 dakika s=C3=BCrebilir. 3072 veya 4096= bit uzunlu=C4=9Fundaki parametreleri olu=C5=9Fturmak ise birka=C3=A7 saate i= htiya=C3=A7 olabilir. L=C3=BCtfen sab=C4=B1rl=C4=B1 olun.', +'dh key warn1' =3D> 'Zay=C4=B1f veya entropileri k=C3=BC=C3=A7=C3=BCk olan s= istemler i=C3=A7in bu y=C3=BCkleme fonksiyonun kullan=C4=B1m=C4=B1 ile uzun D= iffie-Hellman parametrelerini y=C3=BCkleme tavsiye edilir.', +'dh name is invalid' =3D> 'Ge=C3=A7ersiz ad, l=C3=BCtfen "dh1024.pem" =C5=9F= eklinde kullan=C4=B1n.', +'dh parameter' =3D> 'Diffie-Hellman parametreleri', 'dhcp advopt add' =3D> 'DHCP se=C3=A7ene=C4=9Fi ekle', 'dhcp advopt added' =3D> 'DHCP se=C3=A7ene=C4=9Fi eklendi', 'dhcp advopt blank value' =3D> 'DHCP se=C3=A7ene=C4=9Fi de=C4=9Feri bo=C5=9F= olamaz.', @@ -782,10 +782,10 @@ 'dnsforward entries' =3D> 'G=C3=BCncel kay=C4=B1tlar:', 'dnsforward forward_server' =3D> 'Ad sunucusu', 'dnsforward zone' =3D> 'B=C3=B6lge', -'dnssec aware' =3D> 'DNSSEC Duyarl=C4=B1l=C4=B1=C4=9F=C4=B1', +'dnssec aware' =3D> 'DNSSEC Fark=C4=B1ndal=C4=B1=C4=9F=C4=B1', 'dnssec information' =3D> 'DNSSEC Bilgisi', 'dnssec not supported' =3D> 'DNSSEC desteklenmiyor', -'dnssec validating' =3D> 'DNSSEC Do=C4=9Frulama', +'dnssec validating' =3D> 'DNSSEC do=C4=9Frulan=C4=B1yor', 'do not log this port list' =3D> 'Otorumdan hemen =C3=B6nce bu ba=C4=9Flant= =C4=B1 noktalar=C4=B1 listesini b=C4=B1rak (g=C3=BCnl=C3=BCk boyutunu k=C3=BC= =C3=A7=C3=BClt=C3=BCr)', 'dod' =3D> '=C3=87evirmeli ba=C4=9Flant=C4=B1 =C3=BCzerinden talep et', 'dod for dns' =3D> 'DNS i=C3=A7in =C3=A7evirmeli ba=C4=9Flant=C4=B1 =C3=BCze= rinden talep et:', @@ -808,7 +808,7 @@ 'download' =3D> '=C4=B0ndir', 'download ca certificate' =3D> 'CA sertifikas=C4=B1 indir', 'download certificate' =3D> 'Sertifika indir', -'download dh parameter' =3D> 'Anahtar de=C4=9Fi=C5=9Fimi parametrelerini ind= ir', +'download dh parameter' =3D> 'Diffie-Hellman parametrelerini indir', 'download host certificate' =3D> 'Ana bilgisayar belgesi indir', 'download new ruleset' =3D> 'Yeni Kural K=C3=BCmesi =C4=B0ndir', 'download pkcs12 file' =3D> 'PKCS12 dosyas=C4=B1n=C4=B1 indir', @@ -951,7 +951,7 @@ 'firewall log' =3D> 'G=C3=BCvenlik duvar=C4=B1 g=C3=BCnl=C3=BC=C4=9F=C3=BC', 'firewall log viewer' =3D> 'G=C3=BCvenlik Duvar=C4=B1 G=C3=BCnl=C3=BCk G=C3= =B6r=C3=BCnt=C3=BCleyicisi', 'firewall logs' =3D> 'G=C3=BCvenlik Duvar=C4=B1 G=C3=BCnl=C3=BCkleri', -'firewall logs country' =3D> 'Fw g=C3=BCnl=C3=BCk grafikleri (=C3=9Clke)', +'firewall logs country' =3D> 'Fw-G=C3=BCnl=C3=BCk Grafikleri (=C3=9Clke)', 'firewall logs ip' =3D> 'Gd-G=C3=BCnl=C3=BCk Grafikleri (IP)', 'firewall logs port' =3D> 'Gd-G=C3=BCnl=C3=BCk Grafikleri (Port)', 'firewall rules' =3D> 'G=C3=BCvenlik Duvar=C4=B1 Kurallar=C4=B1', @@ -1009,12 +1009,14 @@ 'fwdfw dnat porterr' =3D> 'NAT i=C3=A7in tek bir ba=C4=9Flant=C4=B1 noktas= =C4=B1 veya ba=C4=9Flant=C4=B1 noktas=C4=B1 aral=C4=B1=C4=9F=C4=B1 (tcp/udp) = se=C3=A7mek zorundas=C4=B1n=C4=B1z.', 'fwdfw dnat porterr2' =3D> 'Hi=C3=A7bir hedef ba=C4=9Flant=C4=B1 noktas=C4= =B1 tan=C4=B1mlamdan harici bir ba=C4=9Flant=C4=B1 noktas=C4=B1 (NAT) kullana= mazs=C4=B1n=C4=B1z.', 'fwdfw edit' =3D> 'D=C3=BCzenle', +'fwdfw err concon' =3D> 'E=C5=9F zamanl=C4=B1 ba=C4=9Flant=C4=B1 i=C3=A7in g= e=C3=A7ersiz say=C4=B1', 'fwdfw err nosrc' =3D> 'Bir kaynak se=C3=A7ilmedi.', 'fwdfw err nosrcip' =3D> 'L=C3=BCtfen bir kaynak IP adresi belirtin.', 'fwdfw err notgt' =3D> 'Bir hedef se=C3=A7ilmedi.', 'fwdfw err notgtip' =3D> 'L=C3=BCtfen bir hedef IP adresi belirtin.', 'fwdfw err prot_port' =3D> 'Se=C3=A7ilen kuuralla kaynak veya hedef ba=C4=9F= lant=C4=B1 noktas=C4=B1na izin verilmez', 'fwdfw err prot_port1' =3D> 'TCP veya UDP kural=C4=B1 i=C3=A7in kaynak veya = hedef ba=C4=9Flant=C4=B1 noktas=C4=B1 kullan=C4=B1rken se=C3=A7mek zorunda', +'fwdfw err ratecon' =3D> 'Limit h=C4=B1z=C4=B1 ba=C4=9Flant=C4=B1lar=C4=B1 i= =C3=A7in ge=C3=A7ersiz de=C4=9Fer', 'fwdfw err remark' =3D> 'A=C3=A7=C4=B1klama i=C3=A7inde ge=C3=A7ersiz karakt= erler.', 'fwdfw err ruleexists' =3D> 'Bu kural zaten var.', 'fwdfw err same' =3D> 'Kaynak ve hedef ayn=C4=B1.', @@ -1033,15 +1035,18 @@ 'fwdfw hint mac' =3D> 'Kod olu=C5=9Fturma s=C4=B1ras=C4=B1nda g=C3=B6rmezden= gelinecek MAC adresleri.', 'fwdfw iface' =3D> 'Aray=C3=BCz', 'fwdfw ipsec network' =3D> 'IPsec a=C4=9Flar=C4=B1:', +'fwdfw limitconcon' =3D> 'IP adresi ba=C5=9F=C4=B1na e=C5=9F zamanl=C4=B1 ba= =C4=9Flant=C4=B1y=C4=B1 s=C4=B1n=C4=B1rla', 'fwdfw log' =3D> 'G=C3=BCnl=C3=BCk', 'fwdfw log rule' =3D> 'G=C3=BCnl=C3=BCk kural=C4=B1', 'fwdfw man port' =3D> 'Ba=C4=9Flant=C4=B1 noktas=C4=B1:', 'fwdfw many' =3D> '=C3=87ok', +'fwdfw maxconcon' =3D> 'Maksimum e=C5=9F zamanl=C4=B1 ba=C4=9Flant=C4=B1', 'fwdfw menu' =3D> 'G=C3=BCvenlik Duvar=C4=B1 Kurallar=C4=B1', 'fwdfw movedown' =3D> 'A=C5=9Fa=C4=9F=C4=B1 ta=C5=9F=C4=B1', 'fwdfw moveup' =3D> 'Yukar=C4=B1 ta=C5=9F=C4=B1', 'fwdfw natport used' =3D> 'NAPT i=C3=A7in verilen ba=C4=9Flant=C4=B1 noktas= =C4=B1 ba=C5=9Fka bir DNAT kural taraf=C4=B1ndan zaten kullan=C4=B1l=C4=B1yor= .', 'fwdfw newrule' =3D> 'Yeni Kural', +'fwdfw numcon' =3D> 'Ba=C4=9Flant=C4=B1 say=C4=B1s=C4=B1', 'fwdfw p2p txt' =3D> 'P2P a=C4=9Flar=C4=B1na eri=C5=9Fim izni Ver/Verme.', 'fwdfw pol allow' =3D> '=C4=B0zin Verildi', 'fwdfw pol block' =3D> 'Engellendi', @@ -1050,6 +1055,7 @@ 'fwdfw pol title' =3D> 'Varsay=C4=B1lan g=C3=BCvenlik duvar=C4=B1 davran=C4= =B1=C5=9F=C4=B1', 'fwdfw prot41' =3D> 'IPv6 Ku=C5=9Fatmas=C4=B1 (Kural 41)', 'fwdfw prot41 short' =3D> 'IPv6 Ku=C5=9Fatmas=C4=B1', +'fwdfw ratelimit' =3D> 'Yeni ba=C4=9Flant=C4=B1 h=C4=B1z s=C4=B1n=C4=B1r=C4= =B1', 'fwdfw red' =3D> 'KIRMIZI', 'fwdfw reread' =3D> 'De=C4=9Fi=C5=9Fiklikleri Uygula', 'fwdfw rule action' =3D> 'Eylem kural=C4=B1:', @@ -1171,11 +1177,11 @@ 'g.lite' =3D> 'KALDIRILACAK', 'gateway' =3D> 'A=C4=9F ge=C3=A7idi', 'gateway ip' =3D> 'A=C4=9F Ge=C3=A7idi IP Adresi', -'gen dh' =3D> 'Yeni anahtar de=C4=9Fi=C5=9Fimi parametrelerini olu=C5=9Ftur', +'gen dh' =3D> 'Yeni Diffie-Hellman parametrelerini olu=C5=9Fturun', 'gen static key' =3D> 'Statik bir anahtar olu=C5=9Ftur', 'generate' =3D> 'Y=C3=B6netici/Sunucu Sertifikas=C4=B1 Olu=C5=9Ftur', 'generate a certificate' =3D> 'Sertifika olu=C5=9Ftur:', -'generate dh key' =3D> 'Anahtar de=C4=9Fi=C5=9Fimi parametrelerini olu=C5=9F= tur', +'generate dh key' =3D> 'Diffie-Hellman parametrelerini olu=C5=9Fturun', 'generate iso' =3D> 'ISO olu=C5=9Ftur', 'generate root/host certificates' =3D> 'Y=C3=B6netici/Sunucu Sertifikas=C4= =B1 Olu=C5=9Ftur', 'generate tripwire keys and init' =3D> 'tripwire anahtarlar=C4=B1 ve init ol= u=C5=9Ftur', @@ -1471,7 +1477,7 @@ 'marked' =3D> '=C4=B0=C5=9Faretli', 'masquerade blue' =3D> 'MAV=C4=B0 gizli', 'masquerade green' =3D> 'YE=C5=9E=C4=B0L gizli', -'masquerade orange' =3D> 'TURUNCU gizil', +'masquerade orange' =3D> 'TURUNCU gizli', 'masquerading' =3D> 'Gizle', 'masquerading disabled' =3D> 'Gizlemeyi kapat', 'masquerading enabled' =3D> 'Gizlemeyi a=C3=A7', @@ -1523,28 +1529,28 @@ 'modem' =3D> 'Modem', 'modem configuration' =3D> 'Modem yap=C4=B1land=C4=B1rmas=C4=B1', 'modem hardware details' =3D> 'Modem Donan=C4=B1m=C4=B1', -'modem information' =3D> 'Modem Bilgisi', +'modem information' =3D> 'Modem bilgisi', 'modem network bit error rate' =3D> 'Bit hata oran=C4=B1', 'modem network information' =3D> 'A=C4=9F bilgisi', -'modem network mode' =3D> 'A=C4=9F Y=C3=B6ntemi', -'modem network operator' =3D> 'A=C4=9F Oparat=C3=B6r=C3=BC', -'modem network registration' =3D> 'A=C4=9F Kayd=C4=B1', -'modem network signal quality' =3D> 'Sinyal Kalitesi', -'modem no connection' =3D> 'Ba=C4=9Flant=C4=B1 Yok', -'modem no connection message' =3D> 'Modemle ba=C4=9Flant=C4=B1 kurulamad=C4= =B1.', +'modem network mode' =3D> 'A=C4=9F y=C3=B6ntemi', +'modem network operator' =3D> 'A=C4=9F oparat=C3=B6r=C3=BC', +'modem network registration' =3D> 'A=C4=9F kayd=C4=B1', +'modem network signal quality' =3D> 'Sinyal kalitesi', +'modem no connection' =3D> 'Ba=C4=9Flant=C4=B1 yok', +'modem no connection message' =3D> 'Modemle herhangi bir ba=C4=9Flant=C4=B1 = kurulamad=C4=B1.', 'modem on com1' =3D> 'COM1 =C3=BCzerindeki modem', 'modem on com2' =3D> 'COM2 =C3=BCzerindeki modem', 'modem on com3' =3D> 'COM3 =C3=BCzerindeki modem', 'modem on com4' =3D> 'COM4 =C3=BCzerindeki modem', 'modem on com5' =3D> 'COM5 =C3=BCzerindeki modem', 'modem settings have errors' =3D> 'Modem ayarlar=C4=B1 hatal=C4=B1', -'modem sim information' =3D> 'SIM Bilgisi', +'modem sim information' =3D> 'SIM bilgisi', 'modem speaker on' =3D> 'Modem =C3=BCzerindeki hoparl=C3=B6r:', -'modem status' =3D> 'Modem Durumu', +'modem status' =3D> 'Modem durumu', 'modify' =3D> 'D=C3=BCzenle', 'modulation' =3D> 'Ge=C3=A7i=C5=9F', 'monday' =3D> 'Pazartesi', -'monitor interface' =3D> 'Ekran Arabirimi', +'monitor interface' =3D> 'Ekran ara birimi', 'month' =3D> 'Ay', 'month-graph' =3D> 'ay', 'monthly firewallhits' =3D> 'ayl=C4=B1k g=C3=BCvenlik duvar=C4=B1 kayd=C4=B1= ', @@ -1571,7 +1577,7 @@ 'name is invalid' =3D> 'Ge=C3=A7ersiz ad', 'name must only contain characters' =3D> 'Ad sadece karakter i=C3=A7ermelidi= r.', 'name too long' =3D> 'Kullan=C4=B1c=C4=B1n=C4=B1n tam ad=C4=B1 veya sistem a= na bilgisayar ad=C4=B1 =C3=A7ok uzun', -'nameserver' =3D> 'Sunucu ad=C4=B1', +'nameserver' =3D> 'Alan ad=C4=B1 sunucusu', 'nat-traversal' =3D> 'Nat Ge=C3=A7i=C5=9Fi:', 'needreboot' =3D> 'Bu g=C3=BCncelle=C5=9Ftirmeden sonra yeniden ba=C5=9Flatm= ak gerekir', 'net' =3D> 'A=C4=9F', @@ -1623,7 +1629,7 @@ 'nonetworkname' =3D> 'A=C4=9F ad=C4=B1 girilmedi', 'noservicename' =3D> 'Hizmet ad=C4=B1 girilmedi', 'not a valid ca certificate' =3D> 'Ge=C3=A7erli bir CA sertifikas=C4=B1 de= =C4=9Fil.', -'not a valid dh key' =3D> 'Ge=C3=A7erli bir anahtar de=C4=9Fi=C5=9Fim parame= tre dosyas=C4=B1 yok. 1024, 2048, 3072 veya 4096 bit uzunlu=C4=9Funda ve PKCS= #3 bi=C3=A7imini kullan=C4=B1n.', +'not a valid dh key' =3D> 'Ge=C3=A7erli bir Diffie-Hellman parametre dosyas= =C4=B1 yok. 1024, 2048, 3072 veya 4096 bit uzunlu=C4=9Funda ve PKCS#3 bi=C3= =A7imini kullan=C4=B1n.', 'not enough disk space' =3D> 'Yeterli disk alan=C4=B1 yok', 'not present' =3D> 'Mevcut de=C4=9Fil', 'not running' =3D> '=C3=A7al=C4=B1=C5=9Fm=C4=B1yor', @@ -1718,16 +1724,16 @@ 'ovpn config' =3D> 'OVPN-Yap=C4=B1land=C4=B1rmas=C4=B1', 'ovpn crypt options' =3D> '=C5=9Eifreleme se=C3=A7enekleri', 'ovpn device' =3D> 'OpenVPN ayg=C4=B1t=C4=B1:', -'ovpn dh' =3D> 'Anahtar de=C4=9Fi=C5=9Fim uzunlu=C4=9Fu parametreleri', -'ovpn dh new key' =3D> 'Yeni anahtar de=C4=9Fi=C5=9Fimi parametreleri olu=C5= =9Fturun', -'ovpn dh parameters' =3D> 'Anahtar de=C4=9Fi=C5=9Fimi parametre se=C3=A7enek= leri', -'ovpn dh upload' =3D> 'Yeni anahtar de=C4=9Fi=C5=9Fimi parametrelerini y=C3= =BCkle', +'ovpn dh' =3D> 'Diffie-Hellman parametre uzunlu=C4=9Fu', +'ovpn dh new key' =3D> 'Yeni Diffie-Hellman parametrelerini olu=C5=9Fturun', +'ovpn dh parameters' =3D> 'Diffie-Hellman parametre se=C3=A7enekleri', +'ovpn dh upload' =3D> 'Yeni Diffie-Hellman parametreleri y=C3=BCkle', 'ovpn dl' =3D> 'OVPN-Yap=C4=B1land=C4=B1rmas=C4=B1 =C4=B0ndir', -'ovpn engines' =3D> 'kripto motoru', +'ovpn engines' =3D> '=C5=9Eifreleme motoru', 'ovpn errmsg green already pushed' =3D> 'Ye=C5=9Fil a=C4=9F i=C3=A7in her za= man bir yol ayarla', 'ovpn errmsg invalid ip or mask' =3D> 'Ge=C3=A7ersiz a=C4=9F adresi veya alt= a=C4=9F maskesi', -'ovpn generating the root and host certificates' =3D> 'Root ve ana bilgisaya= r belge =C3=BCretimi uzun zaman alabilir.', -'ovpn ha' =3D> 'Hash algoritmas=C4=B1', +'ovpn generating the root and host certificates' =3D> 'Root ve ana bilgisaya= r sertifika =C3=BCretimi uzun zaman alabilir.', +'ovpn ha' =3D> 'Hash algorithmas=C4=B1', 'ovpn hmac' =3D> 'HMAC se=C3=A7enekleri', 'ovpn log' =3D> 'OVPN-G=C3=BCnl=C3=BCk', 'ovpn mgmt in root range' =3D> 'Ba=C4=9Flant=C4=B1 noktas=C4=B1 numaras=C4= =B1 1024 ya da daha y=C3=BCksek bir numara olmal=C4=B1d=C4=B1r.', @@ -1743,7 +1749,7 @@ 'ovpn on orange' =3D> 'TURUNCU =C3=BCzerindeki OpenVPN', 'ovpn on red' =3D> 'KIRMIZI =C3=BCzerindeki OpenVPN', 'ovpn port in root range' =3D> '1024 ya da daha y=C3=BCksek bir ba=C4=9Flant= =C4=B1 noktas=C4=B1 numaras=C4=B1 gereklidir..', -'ovpn reneg sec' =3D> 'Oturum anahtar=C4=B1n=C4=B1n kullan=C4=B1m s=C3=BCres= i:', +'ovpn reneg sec' =3D> 'Oturum anahtar=C4=B1 kullan=C4=B1m s=C3=BCresi:', 'ovpn routes push' =3D> 'Yollar (her sat=C4=B1rda bir tane) =C3=B6rne=C4=9Fi= n 192.168.10.0/255.255.255.0 192.168.20.0/24', 'ovpn routes push options' =3D> 'Yol bask=C4=B1 se=C3=A7enekleri', 'ovpn server status' =3D> 'G=C3=BCncel OpenVPN sunucu durumu:', @@ -1943,8 +1949,8 @@ 'running' =3D> '=C3=87ALI=C5=9EIYOR', 'safe removal of umounted device' =3D> 'Ba=C4=9Flant=C4=B1s=C4=B1 kesilen ay= g=C4=B1t=C4=B1 g=C3=BCvenli bir =C5=9Fekilde kald=C4=B1rabilirsiniz', 'samba' =3D> 'Samba', -'samba join a domain' =3D> 'Bir etki alan=C4=B1na kat=C4=B1l=C4=B1n', -'samba join domain' =3D> 'Etki alan=C4=B1na =C3=BCyelik', +'samba join a domain' =3D> 'Bir etki alan=C4=B1na kat=C4=B1l', +'samba join domain' =3D> 'Etki alan=C4=B1na kat=C4=B1l', 'samba status' =3D> 'Samba durumu', 'saturday' =3D> 'Cumartesi', 'save' =3D> 'Kaydet', @@ -1996,7 +2002,7 @@ 'show ca certificate' =3D> 'CA sertifikalar=C4=B1n=C4=B1 g=C3=B6ster', 'show certificate' =3D> 'Sertifika g=C3=B6ster', 'show crl' =3D> 'Sertifika =C4=B0ptal Listesini G=C3=B6ster', -'show dh' =3D> 'Anahtar de=C4=9Fi=C5=9Fimi parametrelerini g=C3=B6ster', +'show dh' =3D> 'Diffie-Hellman parametrelerini g=C3=B6ster', 'show host certificate' =3D> 'Ana bilgisayar sertifikalar=C4=B1n=C4=B1 g=C3= =B6ster', 'show last x lines' =3D> 'Son x sat=C4=B1rlar=C4=B1n=C4=B1 g=C3=B6ster', 'show lines' =3D> 'Sat=C4=B1rlar=C4=B1 g=C3=B6ster', @@ -2036,7 +2042,7 @@ 'source ip' =3D> 'Kaynak IP', 'source ip and port' =3D> 'Kaynak IP: Ba=C4=9Flant=C4=B1 noktas=C4=B1 numara= s=C4=B1', 'source ip bad' =3D> 'Ge=C3=A7ersiz bir IP adresi ya da a=C4=9F adresi.', -'source ip country' =3D> 'Kaynak Ip =C3=BClke', +'source ip country' =3D> '=C3=9Clke IP kayna=C4=9F=C4=B1', 'source ip in use' =3D> 'Kullan=C4=B1lan kaynak IP:', 'source ip or net' =3D> 'Kaynak IP veya A=C4=9F', 'source net' =3D> 'Kaynak A=C4=9F', @@ -2114,11 +2120,11 @@ 'system log viewer' =3D> 'Sistem G=C3=BCnl=C3=BCk G=C3=B6r=C3=BCnt=C3=BCleyi= cisi', 'system logs' =3D> 'Sistem G=C3=BCnl=C3=BCkleri', 'system status information' =3D> 'Sistem Durum Bilgisi', -'ta key' =3D> 'Tls kimlik do=C4=9Frulama anahtar=C4=B1', +'ta key' =3D> 'TLS Kimlik Do=C4=9Frulama Anahtar=C4=B1', 'telephone not set' =3D> 'Telefon ayarlanmam=C4=B1=C5=9F.', 'template' =3D> '=C3=96n Ayar', 'template warning' =3D> 'QoS kurmak i=C3=A7in iki se=C3=A7ene=C4=9Finiz vard= =C4=B1r. =C4=B0lk olarak kaydet d=C3=BC=C4=9Fmesine bas=C4=B1p kendi s=C4=B1n= =C4=B1f ve kurallar=C4=B1n=C4=B1z=C4=B1 olu=C5=9Fturabilirsiniz. =C4=B0kinci = olarak ise =C3=B6n ayar d=C3=BC=C4=9Fmesine bas=C4=B1p s=C4=B1n=C4=B1f ve kur= allar i=C3=A7in bir =C5=9Fablonun kurulmas=C4=B1n=C4=B1 sa=C4=9Flay=C4=B1n. ', -'teovpn_fragment' =3D> 'Fragment boyutu', +'teovpn_fragment' =3D> 'B=C3=B6l=C3=BCmleme boyutu', 'test' =3D> 'test', 'test email could not be sent' =3D> 'Test e-posta g=C3=B6nderilemedi', 'test email was sent' =3D> 'Test e-posta ba=C5=9Far=C4=B1yla g=C3=B6nderildi= .', @@ -2340,7 +2346,7 @@ 'upload a certificate' =3D> 'Sertifika y=C3=BCkle:', 'upload a certificate request' =3D> 'Sertifika iste=C4=9Fi y=C3=BCkle:', 'upload ca certificate' =3D> 'CA Sertifikas=C4=B1 Y=C3=BCkle', -'upload dh key' =3D> 'Anahtar de=C4=9Fi=C5=9Fimi parametrelerini y=C3=BCkle', +'upload dh key' =3D> 'Diffie-Hellman parametreleri y=C3=BCkle', 'upload fcdsl.o' =3D> 'KALDIRILACAK', 'upload file' =3D> 'Dosya y=C3=BCkle', 'upload new ruleset' =3D> 'Yeni kurallar y=C3=BCkle', diff --git a/lfs/installer b/lfs/installer index 7f73222..3364a4d 100644 --- a/lfs/installer +++ b/lfs/installer @@ -31,6 +31,7 @@ DIR_APP =3D $(DIR_SRC)/$(THISAPP) TARGET =3D $(DIR_INFO)/$(THISAPP) =20 SLOGAN =3D An Open Source Firewall Solution +DOWNLOAD_URL =3D http://downloads.ipfire.org/releases/ipfire-2.x/$(VERSION)-= core$(CORE)/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso =20 ############################################################################= ### # Top-level Rules @@ -58,12 +59,11 @@ $(TARGET) : --with-distro-name=3D"$(NAME)" \ --with-distro-sname=3D"$(SNAME)" \ --with-distro-slogan=3D"$(SLOGAN)" \ - --with-config-root=3D"$(CONFIG_ROOT)" + --with-config-root=3D"$(CONFIG_ROOT)" \ + --with-download-url=3D"$(DOWNLOAD_URL)" + cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install =20 - #Patch ISO Name for download ... - #sed -i -e "s|ipfire.iso|download.ipfire.org/releases/ipfire-2.x/$(VERSION)= -core$(CORE)/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso|g" \ - # /usr/bin/downloadsource.sh @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/installer/Makefile.am b/src/installer/Makefile.am index f52a594..d0e52dc 100644 --- a/src/installer/Makefile.am +++ b/src/installer/Makefile.am @@ -34,6 +34,7 @@ bin_PROGRAMS =3D \ =20 bin_SCRIPTS =3D \ downloadsource.sh \ + execute-postinstall.sh \ start-networking.sh =20 #- installer ---------------------------------------------------------------= ---- @@ -44,6 +45,7 @@ installer_SOURCES =3D \ main.c =20 installer_CFLAGS =3D \ + $(AM_CFLAGS) \ $(BLKID_CFLAGS) \ $(LIBSMOOTH_CFLAGS) \ $(PCI_CFLAGS) \ diff --git a/src/installer/configure.ac b/src/installer/configure.ac index da968f6..85c5c5c 100644 --- a/src/installer/configure.ac +++ b/src/installer/configure.ac @@ -39,6 +39,16 @@ AC_PROG_CC AC_PROG_CC_C99 AC_PROG_CC_C_O =20 +CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ + "-Wformat=3D2 -Wformat-security -Wformat-nonliteral" \ + -Werror=3Doverflow \ + -fno-strict-aliasing \ + -fstack-protector \ + -fstack-protector-strong \ + -fPIE \ + --param=3Dssp-buffer-size=3D4]) +AC_SUBST([OUR_CFLAGS], "$with_cflags") + AC_PATH_PROG([M4], [m4]) =20 # Gettext @@ -84,6 +94,11 @@ AC_ARG_WITH([config-root], AC_DEFINE_UNQUOTED([CONFIG_ROOT], "$withval", [The config-root]), AC_MSG_ERROR([*** you need to set CONFIG_ROOT with --with-config-root=3D])) =20 +AC_ARG_WITH([download-url], + AS_HELP_STRING([--with-download-url] [The default download URL]), + AC_DEFINE_UNQUOTED([DOWNLOAD_URL], "$withval", [The default download URL]), + AC_MSG_ERROR([*** you need to set DOWNLOAD_URL with --with-download-url=3D]= )) + AC_CONFIG_FILES([ Makefile po/Makefile.in diff --git a/src/installer/downloadsource.sh b/src/installer/downloadsource.sh index 7504c19..4a48686 100644 --- a/src/installer/downloadsource.sh +++ b/src/installer/downloadsource.sh @@ -19,29 +19,39 @@ # = # ############################################################################= ### =20 -#lfs change the url while build! -IPFireISO=3Dipfire.iso -# - -#Get user defined download from boot cmdline -grep "netinstall=3D" /proc/cmdline > /dev/null && CMDLINE=3D1 -if ( [ "$CMDLINE" =3D=3D "1" ]); then - read CMDLINE < /proc/cmdline - POS=3D${CMDLINE%%netinstall*} - POS=3D${#POS} - IPFireISO=3D`echo ${CMDLINE:POS} | cut -d"=3D" -f2 | cut -d" " -f1` +function download() { + wget -U "IPFire-NetInstall/2.x" "$@" +} + +if [ $# -lt 2 ]; then + echo "$0: Insufficient number of arguments" >&2 + exit 2 +fi + +OUTPUT=3D"${1}" +URL=3D"${2}" + +echo "Downloading ${URL}..." +if ! download -O "${OUTPUT}" "${URL}"; then + echo "Download failed" >&2 + + rm -f "${OUTPUT}" + exit 1 fi =20 -echo "Download with wget..." -wget $IPFireISO -O /tmp/download.iso -t3 -U IPFire_NetInstall/2.x -wget $IPFireISO.md5 -O /tmp/download.iso.md5 -t3 -U IPFire_NetInstall/2.x -echo -echo "Checking download..." -md5_file=3D`md5sum /tmp/download.iso | cut -d" " -f1` -md5_down=3D`cat /tmp/download.iso.md5 | cut -d" " -f1` -if [ "$md5_file" =3D=3D "$md5_down" ]; then - echo -n "/tmp/download.iso" > /tmp/source_device - exit 0 +# Download went well. Checking for MD5 sum +if download -O "${OUTPUT}.md5" "${URL}.md5" &>/dev/null; then + # Read downloaded checksum + read -r md5sum rest < "${OUTPUT}.md5" + rm -f "${OUTPUT}.md5" + + # Compute checkum of downloaded image file + read -r md5sum_image rest <<< "$(md5sum "${OUTPUT}")" + + if [ "${md5sum}" !=3D "${md5sum_image}" ]; then + echo "MD5 sum mismatch: ${md5sum} !=3D ${md5sum_image}" >&2 + exit 2 + fi fi -echo "Error - SKIP" -exit 10 + +exit 0 diff --git a/src/installer/dracut-module/70-dhcpcd.exe b/src/installer/dracut= -module/70-dhcpcd.exe index 4100fc9..660f269 100755 --- a/src/installer/dracut-module/70-dhcpcd.exe +++ b/src/installer/dracut-module/70-dhcpcd.exe @@ -12,21 +12,45 @@ # ######################################################################## =20 -dhcpcd_up() -{ - set | grep "^new_" | sed "s|^new_||g" | \ - sed "s|'||g" | \ - sort > /var/ipfire/dhcpc/dhcpcd-$interface.info +LEASE_FILE=3D"/var/ipfire/dhcpc/dhcpcd-${interface}.info" =20 - DNS=3D`grep "domain_name_servers" /var/ipfire/dhcpc/dhcpcd-$interface.info = | cut -d"=3D" -f2` - DNS1=3D`echo $DNS | cut -d" " -f1` - DNS2=3D`echo $DNS | cut -d" " -f2` +export_lease() { + set | grep "^new_" | sed "s|^new_||g" | \ + sed "s|'||g" | sort > ${LEASE_FILE} +} =20 - echo "nameserver $DNS1" > /etc/resolv.conf - echo "nameserver $DNS2" >> /etc/resolv.conf +make_resolvconf() { + local DNS=3D"$(grep 'domain_name_servers' ${LEASE_FILE} | cut -d'=3D' -f2)" + local DNS1=3D"$(echo ${DNS} | cut -d' ' -f1)" + local DNS2=3D"$(echo ${DNS} | cut -d' ' -f2)" =20 + ( + echo "nameserver ${DNS1}" + echo "nameserver ${DNS2}" + ) > /etc/resolv.conf } =20 -case "$reason" in -BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up;; +case "${reason}" in + PREINIT) + # Configure MTU + if [ -n "${new_interface_mtu}" ] && [ ${new_interface_mtu} -gt 576 ]; then + echo "Setting MTU to ${new_interface_mtu}" + ip link set "${interface}" mtu "${new_interface_mtu}" + fi + ;; + + BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) + # Export all information about the newly received lease + # to file + export_lease + + # Create system configuration files + make_resolvconf + ;; + + EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) + rm -f "${LEASE_FILE}" + ;; esac + +exit 0 diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/drac= ut-module/module-setup.sh index 31caa54..187b12e 100755 --- a/src/installer/dracut-module/module-setup.sh +++ b/src/installer/dracut-module/module-setup.sh @@ -18,6 +18,7 @@ install() { inst /etc/system-release inst /usr/bin/installer inst /usr/bin/downloadsource.sh + inst /usr/bin/execute-postinstall.sh inst /usr/local/bin/iowrap =20 # Kernel drivers @@ -35,17 +36,18 @@ install() { inst_multiple tar gzip lzma xz =20 # Networking - inst_multiple dhcpcd ethtool hostname ip ping wget + inst_multiple dhcpcd ethtool hostname ip ping sort wget inst /usr/bin/start-networking.sh - inst /var/ipfire/dhcpc/dhcpcd-run-hooks inst /var/ipfire/dhcpc/dhcpcd.conf - for file in /var/ipfire/dhcpc/dhcpcd-hooks/*; do - inst "${file}" - done + inst /var/ipfire/dhcpc/dhcpcd-run-hooks inst "$moddir/70-dhcpcd.exe" "/var/ipfire/dhcpc/dhcpcd-hooks/70-dhcpcd.e= xe" =20 + inst /etc/host.conf /etc/hosts /etc/protocols + inst /etc/nsswitch.conf /etc/resolv.conf + inst_libdir_file "libnss_dns.so.*" + # Misc. tools - inst_multiple cut grep eject killall md5sum touch + inst_multiple chmod cut grep eject id killall md5sum touch inst_multiple -o fdisk cfdisk df ps top =20 # Hardware IDs diff --git a/src/installer/execute-postinstall.sh b/src/installer/execute-pos= tinstall.sh new file mode 100644 index 0000000..695f1b5 --- /dev/null +++ b/src/installer/execute-postinstall.sh @@ -0,0 +1,65 @@ +#!/bin/sh +############################################################################= ### +# = # +# IPFire.org - A linux based firewall = # +# Copyright (C) 2014 IPFire Team = # +# = # +# This program is free software: you can redistribute it and/or modify = # +# it under the terms of the GNU General Public License as published by = # +# the Free Software Foundation, either version 3 of the License, or = # +# (at your option) any later version. = # +# = # +# This program is distributed in the hope that it will be useful, = # +# but WITHOUT ANY WARRANTY; without even the implied warranty of = # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the = # +# GNU General Public License for more details. = # +# = # +# You should have received a copy of the GNU General Public License = # +# along with this program. If not, see . = # +# = # +############################################################################= ### + +function download() { + wget -U "IPFire-NetInstall/2.x" "$@" +} + +if [ $# -lt 2 ]; then + echo "$0: Insufficient number of arguments" >&2 + exit 2 +fi + +DESTINATION=3D"${1}" +DOWNLOAD_URL=3D"${2}" + +DOWNLOAD_TARGET=3D"/tmp/post-install.exe" + +if download -O "${DESTINATION}${DOWNLOAD_TARGET}" "${DOWNLOAD_URL}"; then + echo "Downloading post-install script from ${DOWNLOAD_URL}..." + + # Make it executable + chmod a+x "${DESTINATION}${DOWNLOAD_TARGET}" + + # Replace /etc/resolv.conf so that we will have + cp -fb /etc/resolv.conf ${DESTINATION}/etc/resolv.conf + for i in /dev /proc /sys; do + mount --bind "${i}" "${DESTINATION}${i}" + done + + # Execute the downloaded script + chroot "${DESTINATION}" sh --login -c "${DOWNLOAD_TARGET}" + retval=3D$? + + # Cleanup the environment + mv -f ${DESTINATION}/etc/resolv.conf{~,} + for i in /dev /proc /sys; do + umount "${DESTINATION}${i}" + done + rm -f "${DESTINATION}${DOWNLOAD_TARGET}" + + exit ${retval} + +# In case the download failed +else + echo "Could not download the post-install script" >&2 + exit 1 +fi diff --git a/src/installer/hw.c b/src/installer/hw.c index 9b9a2d0..d745260 100644 --- a/src/installer/hw.c +++ b/src/installer/hw.c @@ -26,12 +26,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -82,11 +84,56 @@ static int strstartswith(const char* a, const char* b) { return (strncmp(a, b, strlen(b)) =3D=3D 0); } =20 +static char loop_device[STRING_SIZE]; + +static int setup_loop_device(const char* source, const char* device) { + int file_fd =3D open(source, O_RDWR); + if (file_fd < 0) + goto ERROR; + + int device_fd =3D -1; + if ((device_fd =3D open(device, O_RDWR)) < 0) + goto ERROR; + + if (ioctl(device_fd, LOOP_SET_FD, file_fd) < 0) + goto ERROR; + + close(file_fd); + close(device_fd); + + return 0; + +ERROR: + if (file_fd >=3D 0) + close(file_fd); + + if (device_fd >=3D 0) { + ioctl(device_fd, LOOP_CLR_FD, 0); + close(device_fd); + } + + return -1; +} + int hw_mount(const char* source, const char* target, const char* fs, int fla= gs) { + const char* loop_device =3D "/dev/loop0"; + // Create target if it does not exist if (access(target, X_OK) !=3D 0) mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO); =20 + struct stat st; + stat(source, &st); + + if (S_ISREG(st.st_mode)) { + int r =3D setup_loop_device(source, loop_device); + if (r =3D=3D 0) { + source =3D loop_device; + } else { + return -1; + } + } + return mount(source, target, fs, flags, NULL); } =20 @@ -293,7 +340,7 @@ void hw_free_disks(struct hw_disk** disks) { free(disks); } =20 -unsigned int hw_count_disks(struct hw_disk** disks) { +unsigned int hw_count_disks(const struct hw_disk** disks) { unsigned int ret =3D 0; =20 while (*disks++) @@ -306,7 +353,7 @@ struct hw_disk** hw_select_disks(struct hw_disk** disks, = int* selection) { struct hw_disk** ret =3D hw_create_disks(); struct hw_disk** selected_disks =3D ret; =20 - unsigned int num_disks =3D hw_count_disks(disks); + unsigned int num_disks =3D hw_count_disks((const struct hw_disk**)disks); =20 for (unsigned int i =3D 0; i < num_disks; i++) { if (!selection || selection[i]) { @@ -393,7 +440,7 @@ static int hw_device_has_p_suffix(const struct hw_destina= tion* dest) { return 0; } =20 -static int hw_calculate_partition_table(struct hw_destination* dest) { +static int hw_calculate_partition_table(struct hw_destination* dest, int dis= able_swap) { char path[DEV_SIZE]; int part_idx =3D 1; =20 @@ -446,9 +493,14 @@ static int hw_calculate_partition_table(struct hw_destin= ation* dest) { } =20 dest->size_boot =3D hw_boot_size(dest); - dest->size_swap =3D hw_swap_size(dest); dest->size_root =3D hw_root_size(dest); =20 + // Should we use swap? + if (disable_swap) + dest->size_swap =3D 0; + else + dest->size_swap =3D hw_swap_size(dest); + // Determine the size of the data partition. unsigned long long used_space =3D dest->size_bootldr + dest->size_boot + dest->size_swap + dest->size_root; @@ -493,7 +545,7 @@ static int hw_calculate_partition_table(struct hw_destina= tion* dest) { return 0; } =20 -struct hw_destination* hw_make_destination(int part_type, struct hw_disk** d= isks) { +struct hw_destination* hw_make_destination(int part_type, struct hw_disk** d= isks, int disable_swap) { struct hw_destination* dest =3D malloc(sizeof(*dest)); =20 if (part_type =3D=3D HW_PART_TYPE_NORMAL) { @@ -513,7 +565,7 @@ struct hw_destination* hw_make_destination(int part_type,= struct hw_disk** disks // Is this a RAID device? dest->is_raid =3D (part_type > HW_PART_TYPE_NORMAL); =20 - int r =3D hw_calculate_partition_table(dest); + int r =3D hw_calculate_partition_table(dest, disable_swap); if (r) return NULL; =20 @@ -982,12 +1034,13 @@ static char* hw_get_uuid(const char* dev) { return uuid; } =20 +#define FSTAB_FMT "UUID=3D%s %-8s %-4s %-10s %d %d\n" + int hw_write_fstab(struct hw_destination* dest) { FILE* f =3D fopen(DESTINATION_MOUNT_PATH "/etc/fstab", "w"); if (!f) return -1; =20 - const char* fmt =3D "UUID=3D%s %-8s %-4s %-10s %d %d\n"; char* uuid =3D NULL; =20 // boot @@ -995,7 +1048,7 @@ int hw_write_fstab(struct hw_destination* dest) { uuid =3D hw_get_uuid(dest->part_boot); =20 if (uuid) { - fprintf(f, fmt, uuid, "/boot", "auto", "defaults", 1, 2); + fprintf(f, FSTAB_FMT, uuid, "/boot", "auto", "defaults", 1, 2); free(uuid); } } @@ -1005,7 +1058,7 @@ int hw_write_fstab(struct hw_destination* dest) { uuid =3D hw_get_uuid(dest->part_swap); =20 if (uuid) { - fprintf(f, fmt, uuid, "swap", "swap", "defaults,pri=3D1", 0, 0); + fprintf(f, FSTAB_FMT, uuid, "swap", "swap", "defaults,pri=3D1", 0, 0); free(uuid); } } @@ -1013,7 +1066,7 @@ int hw_write_fstab(struct hw_destination* dest) { // root uuid =3D hw_get_uuid(dest->part_root); if (uuid) { - fprintf(f, fmt, uuid, "/", "auto", "defaults", 1, 1); + fprintf(f, FSTAB_FMT, uuid, "/", "auto", "defaults", 1, 1); free(uuid); } =20 @@ -1022,7 +1075,7 @@ int hw_write_fstab(struct hw_destination* dest) { uuid =3D hw_get_uuid(dest->part_data); =20 if (uuid) { - fprintf(f, fmt, uuid, "/var", "auto", "defaults", 1, 1); + fprintf(f, FSTAB_FMT, uuid, "/var", "auto", "defaults", 1, 1); free(uuid); } } diff --git a/src/installer/hw.h b/src/installer/hw.h index 41ff093..f16b39c 100644 --- a/src/installer/hw.h +++ b/src/installer/hw.h @@ -107,11 +107,12 @@ char* hw_find_source_medium(struct hw* hw); =20 struct hw_disk** hw_find_disks(struct hw* hw, const char* sourcedrive); void hw_free_disks(struct hw_disk** disks); -unsigned int hw_count_disks(struct hw_disk** disks); +unsigned int hw_count_disks(const struct hw_disk** disks); struct hw_disk** hw_select_disks(struct hw_disk** disks, int* selection); struct hw_disk** hw_select_first_disk(const struct hw_disk** disks); =20 -struct hw_destination* hw_make_destination(int part_type, struct hw_disk** d= isks); +struct hw_destination* hw_make_destination(int part_type, struct hw_disk** d= isks, + int disable_swap); =20 unsigned long long hw_memory(); =20 @@ -131,6 +132,8 @@ int hw_write_fstab(struct hw_destination* dest); char* hw_find_backup_file(const char* output, const char* search_path); int hw_restore_backup(const char* output, const char* backup_path, const cha= r* destination); =20 +int hw_start_networking(const char* output); + void hw_sync(); =20 #endif /* HEADER_HW_H */ diff --git a/src/installer/main.c b/src/installer/main.c index 36f8dfe..ad388e6 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -7,6 +7,7 @@ * Contains main entry point, and misc functions.6 *=20 */ +#define _GNU_SOURCE =20 #include #include @@ -23,7 +24,6 @@ #define _(x) dgettext("installer", x) =20 #define INST_FILECOUNT 21000 -#define UNATTENDED_CONF "/cdrom/boot/unattended.conf" #define LICENSE_FILE "/cdrom/COPYING" #define SOURCE_TEMPFILE "/tmp/downloaded-image.iso" =20 @@ -163,7 +163,7 @@ static int newtLicenseBox(const char* title, const char* = text, int width, int he return ret; } =20 -int write_lang_configs(const char *lang) { +int write_lang_configs(char* lang) { struct keyvalue *kv =3D initkeyvalues(); =20 /* default stuff for main/settings. */ @@ -207,7 +207,7 @@ static char* center_string(const char* str, int width) { } =20 #define DEFAULT_LANG "English" -#define NUM_LANGS 8 +#define NUM_LANGS 10 =20 static struct lang { const char* code; @@ -226,6 +226,80 @@ static struct lang { { NULL, NULL }, }; =20 +static struct config { + int unattended; + int serial_console; + int require_networking; + int perform_download; + int disable_swap; + char download_url[STRING_SIZE]; + char postinstall[STRING_SIZE]; +} config =3D { + .unattended =3D 0, + .serial_console =3D 0, + .require_networking =3D 0, + .perform_download =3D 0, + .disable_swap =3D 0, + .download_url =3D DOWNLOAD_URL, + .postinstall =3D "\0", +}; + +static void parse_command_line(struct config* c) { + char buffer[STRING_SIZE]; + char cmdline[STRING_SIZE]; + + FILE* f =3D fopen("/proc/cmdline", "r"); + if (!f) + return; + + int r =3D fread(&cmdline, 1, sizeof(cmdline) - 1, f); + if (r > 0) { + char* token =3D strtok(cmdline, " "); + + while (token) { + strncpy(buffer, token, sizeof(buffer)); + char* val =3D buffer; + char* key =3D strsep(&val, "=3D"); + + // serial console + if (strcmp(token, "console=3DttyS0") =3D=3D 0) + c->serial_console =3D 1; + + // enable networking? + else if (strcmp(token, "installer.net") =3D=3D 0) + c->require_networking =3D 1; + + // unattended mode + else if (strcmp(token, "installer.unattended") =3D=3D 0) + c->unattended =3D 1; + + // disable swap + else if (strcmp(token, "installer.disable-swap") =3D=3D 0) + c->disable_swap =3D 1; + + // download url + else if (strcmp(key, "installer.download-url") =3D=3D 0) { + strncpy(c->download_url, val, sizeof(c->download_url)); + c->perform_download =3D 1; + + // Require networking for the download + c->require_networking =3D 1; + + // postinstall script + } else if (strcmp(key, "installer.postinstall") =3D=3D 0) { + strncpy(c->postinstall, val, sizeof(c->postinstall)); + + // Require networking for the download + c->require_networking =3D 1; + } + + token =3D strtok(NULL, " "); + } + } + + fclose(f); +} + int main(int argc, char *argv[]) { struct hw* hw =3D hw_init(); const char* logfile =3D NULL; @@ -243,17 +317,10 @@ int main(int argc, char *argv[]) { char message[STRING_SIZE]; char title[STRING_SIZE]; int allok =3D 0; - FILE *handle, *cmdfile, *copying; - char line[STRING_SIZE]; - =09 - int unattended =3D 0; - int serialconsole =3D 0; - int require_networking =3D 0; - struct keyvalue *unattendedkv =3D initkeyvalues(); - char restore_file[STRING_SIZE] =3D ""; + FILE *copying; =20 - setlocale (LC_ALL, ""); - sethostname( SNAME , 10); + setlocale(LC_ALL, ""); + sethostname(SNAME, 10); =20 /* Log file/terminal stuff. */ FILE* flog =3D NULL; @@ -283,33 +350,18 @@ int main(int argc, char *argv[]) { =20 snprintf(title, sizeof(title), "%s - %s", NAME, SLOGAN); =20 - if (! (cmdfile =3D fopen("/proc/cmdline", "r"))) { - fprintf(flog, "Couldn't open commandline: /proc/cmdline\n"); - } else { - fgets(line, STRING_SIZE, cmdfile); - - // check if we have to make an unattended install - if (strstr(line, "installer.unattended") !=3D NULL) { - splashWindow(title, _("Warning: Unattended installation will start in = 10 seconds..."), 10); - unattended =3D 1; - } + // Parse parameters from the kernel command line + parse_command_line(&config); =20 - // check if the installer should start networking - if (strstr(line, "installer.net") !=3D NULL) { - require_networking =3D 1; - } - - // check if we have to patch for serial console - if (strstr (line, "console=3DttyS0") !=3D NULL) { - serialconsole =3D 1; - } + if (config.unattended) { + splashWindow(title, _("Warning: Unattended installation will start in 10 s= econds..."), 10); } =20 // Load common modules mysystem(logfile, "/sbin/modprobe vfat"); // USB key hw_stop_all_raid_arrays(logfile); =20 - if (!unattended) { + if (!config.unattended) { // Language selection char* langnames[NUM_LANGS + 1]; =20 @@ -327,7 +379,7 @@ int main(int argc, char *argv[]) { assert(choice <=3D NUM_LANGS); =20 fprintf(flog, "Selected language: %s (%s)\n", languages[choice].name, lang= uages[choice].code); - snprintf(language, sizeof(language), languages[choice].code); + snprintf(language, sizeof(language), "%s", languages[choice].code); =20 setenv("LANGUAGE", language, 1); setlocale(LC_ALL, language); @@ -336,7 +388,7 @@ int main(int argc, char *argv[]) { char* helpline =3D center_string(_("/ between elements | selects | next screen"), screen_cols); newtPushHelpLine(helpline); =20 - if (!unattended) { + if (!config.unattended) { snprintf(message, sizeof(message), _("Welcome to the %s installation program.\n\n" "Selecting Cancel on any of the following screens will reboot the compute= r."), NAME); @@ -345,16 +397,21 @@ int main(int argc, char *argv[]) { =20 /* Search for a source drive that holds the right * version of the image we are going to install. */ - sourcedrive =3D hw_find_source_medium(hw); - fprintf(flog, "Source drive: %s\n", sourcedrive); + if (!config.perform_download) { + sourcedrive =3D hw_find_source_medium(hw); + fprintf(flog, "Source drive: %s\n", sourcedrive); + } =20 /* If we could not find a source drive, we will try * downloading the install image */ - if (!sourcedrive) { - if (!unattended) { + if (!sourcedrive) + config.perform_download =3D 1; + + if (config.perform_download) { + if (!config.unattended) { // Show the right message to the user char reason[STRING_SIZE]; - if (require_networking) { + if (config.perform_download) { snprintf(reason, sizeof(reason), _("The installer will now try downloading the installation image.")); } else { @@ -373,11 +430,12 @@ int main(int argc, char *argv[]) { goto EXIT; } =20 - require_networking =3D 1; + // Make sure that we enable networking before download + config.require_networking =3D 1; } =20 // Try starting the networking if we require it - if (require_networking) { + if (config.require_networking) { while (1) { statuswindow(60, 4, title, _("Trying to start networking (DHCP)...")); =20 @@ -401,20 +459,31 @@ int main(int argc, char *argv[]) { } =20 // Download the image if required - while (!sourcedrive) { - snprintf(commandstring, sizeof(commandstring), "/usr/bin/downloadsource.s= h %s", SOURCE_TEMPFILE); - runcommandwithstatus(commandstring, title, _("Downloading installation im= age..."), logfile); - - FILE* f =3D fopen(SOURCE_TEMPFILE, "r"); - if (f) { - sourcedrive =3D SOURCE_TEMPFILE; - fclose(f); - } else { - rc =3D newtWinOkCancel(title, _("The installation image could not be dow= nloaded."), - 60, 8, _("Retry"), _("Cancel")); + if (config.perform_download) { + fprintf(flog, "Download URL: %s\n", config.download_url); + snprintf(commandstring, sizeof(commandstring), "/usr/bin/downloadsource.s= h %s %s", + SOURCE_TEMPFILE, config.download_url); + + while (!sourcedrive) { + rc =3D runcommandwithstatus(commandstring, title, _("Downloading install= ation image..."), logfile); + + FILE* f =3D fopen(SOURCE_TEMPFILE, "r"); + if (f) { + sourcedrive =3D SOURCE_TEMPFILE; + fclose(f); + } else { + char reason[STRING_SIZE] =3D "-"; + if (rc =3D=3D 2) + snprintf(reason, sizeof(STRING_SIZE), _("MD5 checksum mismatch")); =20 - if (rc) - goto EXIT; + snprintf(message, sizeof(message), + _("The installation image could not be downloaded.\n Reason: %s\n\n%s= "), + reason, config.download_url); + + rc =3D newtWinOkCancel(title, message, 75, 12, _("Retry"), _("Cancel")); + if (rc) + goto EXIT; + } } } } @@ -423,24 +492,17 @@ int main(int argc, char *argv[]) { =20 int r =3D hw_mount(sourcedrive, SOURCE_MOUNT_PATH, "iso9660", MS_RDONLY); if (r) { - fprintf(flog, "Could not mount %s to %s\n", sourcedrive, SOURCE_MOUNT_PATH= ); - fprintf(flog, strerror(errno)); - exit(1); - } - - /* load unattended configuration */ - if (unattended) { - fprintf(flog, "unattended: Reading unattended.conf\n"); - - (void) readkeyvalues(unattendedkv, UNATTENDED_CONF); - findkey(unattendedkv, "RESTORE_FILE", restore_file); + snprintf(message, sizeof(message), _("Could not mount %s to %s:\n %s\n"), + sourcedrive, SOURCE_MOUNT_PATH, strerror(errno)); + errorbox(message); + goto EXIT; } =20 - if (!unattended) { + if (!config.unattended) { // Read the license file. if (!(copying =3D fopen(LICENSE_FILE, "r"))) { sprintf(discl_msg, "Could not open license file: %s\n", LICENSE_FILE); - fprintf(flog, discl_msg); + fprintf(flog, "%s", discl_msg); } else { fread(discl_msg, 1, 40000, copying); fclose(copying); @@ -463,7 +525,7 @@ int main(int argc, char *argv[]) { =20 // Check how many disks have been found and what // we can do with them. - unsigned int num_disks =3D hw_count_disks(disks); + unsigned int num_disks =3D hw_count_disks((const struct hw_disk**)disks); =20 while (1) { // no harddisks found @@ -474,8 +536,8 @@ int main(int argc, char *argv[]) { // exactly one disk has been found // or if we are running in unattended mode, we will select // the first disk and go with that one - } else if ((num_disks =3D=3D 1) || (unattended && num_disks >=3D 1)) { - selected_disks =3D hw_select_first_disk(disks); + } else if ((num_disks =3D=3D 1) || (config.unattended && num_disks >=3D 1)= ) { + selected_disks =3D hw_select_first_disk((const struct hw_disk**)disks); =20 // more than one usable disk has been found and // the user needs to choose what to do with them @@ -484,7 +546,7 @@ int main(int argc, char *argv[]) { int disk_selection[num_disks]; =20 for (unsigned int i =3D 0; i < num_disks; i++) { - disk_names[i] =3D &disks[i]->description; + disk_names[i] =3D disks[i]->description; disk_selection[i] =3D 0; } =20 @@ -512,10 +574,10 @@ int main(int argc, char *argv[]) { =20 // Don't print the auto-selected harddisk setup in // unattended mode. - if (unattended) + if (config.unattended) break; =20 - num_selected_disks =3D hw_count_disks(selected_disks); + num_selected_disks =3D hw_count_disks((const struct hw_disk**)selected_dis= ks); =20 if (num_selected_disks =3D=3D 1) { snprintf(message, sizeof(message), @@ -554,7 +616,7 @@ int main(int argc, char *argv[]) { =20 hw_free_disks(disks); =20 - struct hw_destination* destination =3D hw_make_destination(part_type, selec= ted_disks); + struct hw_destination* destination =3D hw_make_destination(part_type, selec= ted_disks, config.disable_swap); =20 if (!destination) { errorbox(_("Your harddisk is too small.")); @@ -570,19 +632,21 @@ int main(int argc, char *argv[]) { fprintf(flog, "Memory : %lluMB\n", BYTES2MB(hw_memory())); =20 // Warn the user if there is not enough space to create a swap partition - if (!unattended && !*destination->part_swap) { - rc =3D newtWinChoice(title, _("OK"), _("Cancel"), - _("Your harddisk is very small, but you can continue without a swap parti= tion.")); + if (!config.unattended) { + if (!config.disable_swap && !*destination->part_swap) { + rc =3D newtWinChoice(title, _("OK"), _("Cancel"), + _("Your harddisk is very small, but you can continue without a swap part= ition.")); =20 - if (rc !=3D 1) - goto EXIT; + if (rc !=3D 1) + goto EXIT; + } } =20 // Filesystem selection - if (!unattended) { + if (!config.unattended) { struct filesystems { int fstype; - const char* description; + char* description; } filesystems[] =3D { { HW_FS_EXT4, _("ext4 Filesystem") }, { HW_FS_EXT4_WO_JOURNAL, _("ext4 Filesystem without journal") }, @@ -686,7 +750,7 @@ int main(int argc, char *argv[]) { statuswindow(60, 4, title, _("Installing the bootloader...")); =20 /* Serial console ? */ - if (serialconsole) { + if (config.serial_console) { /* grub */ FILE* f =3D fopen(DESTINATION_MOUNT_PATH "/etc/default/grub", "a"); if (!f) { @@ -725,7 +789,7 @@ int main(int argc, char *argv[]) { char* backup_file =3D hw_find_backup_file(logfile, SOURCE_MOUNT_PATH); if (backup_file) { rc =3D 0; - if (!unattended) { + if (!config.unattended) { rc =3D newtWinOkCancel(title, _("A backup file has been found on the inst= allation image.\n\n" "Do you want to restore the backup?"), 50, 10, _("Yes"), _("No")); } @@ -752,10 +816,21 @@ int main(int argc, char *argv[]) { // Umount source drive and eject hw_umount(SOURCE_MOUNT_PATH); =20 + // Download and execute the postinstall script + if (*config.postinstall) { + snprintf(commandstring, sizeof(commandstring), + "/usr/bin/execute-postinstall.sh %s %s", DESTINATION_MOUNT_PATH, config.p= ostinstall); + + if (runcommandwithstatus(commandstring, title, _("Running post-install scr= ipt..."), logfile)) { + errorbox(_("Post-install script failed.")); + goto EXIT; + } + } + snprintf(commandstring, STRING_SIZE, "/usr/bin/eject %s", sourcedrive); mysystem(logfile, commandstring); =20 - if (!unattended) { + if (!config.unattended) { snprintf(message, sizeof(message), _( "%s was successfully installed!\n\n" "Please remove any installation mediums from this system and hit the rebo= ot button. " diff --git a/src/installer/start-networking.sh b/src/installer/start-networki= ng.sh index faeeb17..3cb7a21 100644 --- a/src/installer/start-networking.sh +++ b/src/installer/start-networking.sh @@ -56,6 +56,10 @@ function main() { fi =20 echo "Successfully started on ${interface}" + + # Wait until everything is settled + sleep 15 + return 0 done =20 hooks/post-receive -- IPFire 2.x development tree --===============3064211224440922747==--