summaryrefslogtreecommitdiffstats
path: root/po/pl.po
blob: 1ce02e6e1b746fb46fff47ecef135699dacafd8b (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# translation of mdkonline-pl.po to polski
# translation of pl.po to Polish
# Aplikacja umożliwiająca zdalne korzystanie z usług Mandrakelinux.
# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
# Arkadiusz Lipiec <arkadiusz.lipiec@gazeta.pl>, 2002-2004.
# Tomasz Bednarski <bednarski@skrzynka.pl>, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: mdkonline-pl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-01-31 20:23+0100\n"
"PO-Revision-Date: 2004-08-25 20:55+0200\n"
"Last-Translator: Arkadiusz Lipiec <arkadiusz.lipiec@gazeta.pl>\n"
"Language-Team: polski <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../mdkapplet:63
#, c-format
msgid "Your system is up-to-date"
msgstr "Oprogramowanie systemu jest aktualne"

#: ../mdkapplet:69
#, c-format
msgid ""
"Service configuration problem. Please check logs and send mail to "
"support@mandrakeonline.net"
msgstr ""
"Problem z konfiguracją usługi. Sprawdź logi i wyślij e-mail'a pod adres "
"support@mandrakeonline.net"

#: ../mdkapplet:75
#, c-format
msgid "System is busy. Please wait ..."
msgstr "System jest zajęty. Proszę czekać ..."

#: ../mdkapplet:81
#, c-format
msgid "New updates are available for your system"
msgstr "Dostępne są nowe aktualizacje dla Twojego systemu"

#: ../mdkapplet:87
#, c-format
msgid "Service is not configured. Please click on \"Configure the service\""
msgstr "Usługa jest nieskonfigurowana. Kliknij na \"Konfiguracja usługi\""

#: ../mdkapplet:93
#, c-format
msgid "Network is down. Please configure your network"
msgstr "Sieć jest wyłączona. Skonfiguruj sieć"

#: ../mdkapplet:99
#, c-format
msgid "Service is not activated. Please click on \"Online Website\""
msgstr "Usługa jest nieaktywna. Kliknij na Witryna internetowa\""

#: ../mdkapplet:105
#, c-format
msgid "Release not supported (too old release, or development release)"
msgstr "Nieobsługiwane wydanie (za stare, lub wydanie rozwojowe)"

#: ../mdkapplet:110 ../mdkapplet:164
#, c-format
msgid "Install updates"
msgstr "Zainstaluj aktualizacje"

#: ../mdkapplet:111
#, c-format
msgid "Configure the service"
msgstr "Konfiguracja usługi"

#: ../mdkapplet:112
#, c-format
msgid "Check Updates"
msgstr "Sprawdź aktualizacje"

#: ../mdkapplet:113 ../mdkapplet:167 ../mdkapplet:228 ../mdkonline:89
#: ../mdkonline:93 ../mdkonline:131
#, c-format
msgid "Please wait"
msgstr "Proszę czekać"

#: ../mdkapplet:113 ../mdkapplet:166 ../mdkapplet:167 ../mdkapplet:228
#, c-format
msgid "Check updates"
msgstr "Sprawdź aktualizacje"

#: ../mdkapplet:115
#, c-format
msgid "Online WebSite"
msgstr "Witryna internetowa"

#: ../mdkapplet:116
#, c-format
msgid "Configure Network"
msgstr "Skonfiguruj sieć"

#: ../mdkapplet:117
#, c-format
msgid "Configure Now!"
msgstr "Skonfiguruj teraz!"

#: ../mdkapplet:152 ../mdkapplet:232
#, c-format
msgid "Mandrakelinux Updates Applet"
msgstr "Aplet aktualizacji Mandrakelinux"

#: ../mdkapplet:162
#, c-format
msgid "Actions"
msgstr "Operacje"

#: ../mdkapplet:165
#, c-format
msgid "Configure"
msgstr "Skonfiguruj"

#: ../mdkapplet:169
#, c-format
msgid "See logs"
msgstr "Zobacz dziennik"

#: ../mdkapplet:172
#, c-format
msgid "Status"
msgstr "Stan"

#: ../mdkapplet:176 ../mdkapplet:370
#, c-format
msgid "Close"
msgstr "Zamknij"

#: ../mdkapplet:213
#, c-format
msgid "Network Connection: "
msgstr "Połączenie sieciowe: "

#: ../mdkapplet:213
#, c-format
msgid "Up"
msgstr "W górę"

#: ../mdkapplet:213
#, c-format
msgid "Down"
msgstr "W dół"

#: ../mdkapplet:214
#, c-format
msgid "Last check: "
msgstr "Ostatnie sprawdzenie: "

#: ../mdkapplet:215 ../mdkonline:127
#, c-format
msgid "Machine name:"
msgstr "Nazwa komputera:"

#: ../mdkapplet:216
#, c-format
msgid "Updates: "
msgstr "Aktualizacje: "

#: ../mdkapplet:220
#, c-format
msgid "Launching drakconnect\n"
msgstr "Uruchamianie programu drakconnect\n"

#: ../mdkapplet:224
#, c-format
msgid "Launching mdkupdate --applet\n"
msgstr "Uruchamianie polecenia mdkupdate --applet\n"

#: ../mdkapplet:227
#, c-format
msgid "Mandrakeonline seems to be reinstalled, reloading applet ...."
msgstr ""
"Mandrakeonline prawdopodobnie zostało przeinstalowane. Ładowanie apletu ...."

#: ../mdkapplet:238
#, c-format
msgid "Computing new updates...\n"
msgstr "Przetwarzanie nowych aktualizacji...\n"

#: ../mdkapplet:240
#, c-format
msgid "Connecting to"
msgstr "Łączenie z"

#: ../mdkapplet:247
#, fuzzy, c-format
msgid "Response from Mandrakeonline server\n"
msgstr "Witamy w Mandrakeonline"

#: ../mdkapplet:265
#, c-format
msgid "Checking... Updates are available\n"
msgstr "Sprawdzanie... Uaktualnienia są dostępne\n"

#: ../mdkapplet:270
#, c-format
msgid "Development release not supported by service"
msgstr "Wydanie rozwojowe nie jest obsługiwane przez usługę"

#: ../mdkapplet:271
#, c-format
msgid "Too old release not supported by service"
msgstr "Za stare wydanie nie jest obsługiwane przez usługę"

#: ../mdkapplet:272
#, c-format
msgid "Unknown state"
msgstr "Nieznany stan"

#: ../mdkapplet:273
#, c-format
msgid "Online services disabled. Contact Mandrakeonline site\n"
msgstr ""
"Usługi internetowe są wyłączone. Skontaktuj się z witryną Mandrakeonline\n"

#: ../mdkapplet:274
#, c-format
msgid "Wrong Password.\n"
msgstr "Złe hasło.\n"

#: ../mdkapplet:275
#, c-format
msgid "Wrong Action or host or login.\n"
msgstr "Niepoprawna operacja, komputer lub nazwa użytkownika.\n"

#: ../mdkapplet:276
#, c-format
msgid ""
"Something is wrong with your network settings (check your route, firewall or "
"proxy settings)\n"
msgstr ""
"Coś nieprawidłowego dzieje się z ustawieniami sieci (sprawdź połączenie, "
"zaporę sieciową lub ustawienia pośrednika)\n"

#: ../mdkapplet:278
#, c-format
msgid ""
"Problem occured while connecting to the server, please contact the support "
"team"
msgstr ""

#: ../mdkapplet:280
#, c-format
msgid "System is up-to-date\n"
msgstr "System jest aktualny\n"

#: ../mdkapplet:312
#, c-format
msgid "No check"
msgstr "Bez sprawdzania"

#: ../mdkapplet:325
#, c-format
msgid "Checking Network: seems disabled\n"
msgstr "Sprawdzanie sieci: wygląda na wyłączoną\n"

#: ../mdkapplet:328
#, c-format
msgid "Checking config file: Not present\n"
msgstr "Sprawdzanie pliku konfiguracyjnego: brak pliku\n"

#: ../mdkapplet:360
#, c-format
msgid "Logs"
msgstr "Dziennik"

#: ../mdkapplet:376
#, c-format
msgid "Clear"
msgstr "Wyczyść"

#: ../mdkapplet:403
#, c-format
msgid "About..."
msgstr "O programie"

#: ../mdkapplet:404
#, c-format
msgid "Always launch on startup"
msgstr "Uruchamiaj przy starcie"

#: ../mdkapplet:406
#, c-format
msgid "Quit"
msgstr "Zakończ"

#: ../mdkonline:52 ../mdkonline:106
#, c-format
msgid "Mandrakeonline"
msgstr "Mandrakeonline"

#: ../mdkonline:55
#, c-format
msgid "I already have an account"
msgstr "Mam już konto"

#: ../mdkonline:56
#, c-format
msgid "I want to subscribe"
msgstr "Chcę się zapisać"

#: ../mdkonline:89
#, c-format
msgid "Reading configuration\n"
msgstr "Wczytywanie konfiguracji\n"

#: ../mdkonline:93
#, c-format
msgid "Sending configuration..."
msgstr "Przesyłanie konfiguracji..."

#: ../mdkonline:109
#, c-format
msgid ""
"This assistant will help you to upload your configuration\n"
"(packages, hardware configuration) to a centralized database in\n"
"order to keep you informed about security updates and useful upgrades.\n"
msgstr ""
"Ten asystent pomoże ci w przesłaniu konfiguracji\n"
"(pakiety, konfiguracja sprzętowa) do centralnej bazy danych, aby\n"
"móc lepiej informować cię o odpowiednich uaktualnieniach.\n"

#: ../mdkonline:114
#, c-format
msgid "Account creation or authentication"
msgstr "Tworzenie konta lub uwierzytelnianie"

#: ../mdkonline:119
#, c-format
msgid "Enter your Mandrakeonline login, password and machine name:"
msgstr "Wprowadź swój login Mandrakeonline, hasło i nazwę komputera:"

#: ../mdkonline:125 ../mdkonline:156
#, c-format
msgid "Login:"
msgstr "Login:"

#: ../mdkonline:126 ../mdkonline:157
#, c-format
msgid "Password:"
msgstr "Hasło:"

#: ../mdkonline:131
#, c-format
msgid "Connecting to Mandrakeonline website..."
msgstr "Łączenie z witryną Mandrakeonline..."

#: ../mdkonline:139
#, c-format
msgid ""
"In order to benefit from Mandrakeonline services,\n"
"we are about to upload your configuration.\n"
"\n"
"The Wizard will now send the following information to Mandrakesoft:\n"
"1) the list of packages you have installed on your system,\n"
"2) your hardware configuration.\n"
"\n"
"If you feel uncomfortable by that idea, or do not want to benefit from this "
"service,\n"
"please press 'Cancel'. By pressing 'Next', you allow us to keep you "
"informed\n"
"about security updates and useful upgrades via personalized email alerts.\n"
"Furthermore, you benefit from discounted paid support services on\n"
"www.mandrakeexpert.com."
msgstr ""
"W celu skorzystaniu z usług Mandrakeonline, twoja konfiguracja\n"
"komputera zostanie za chwilę wysłana przez druida.\n"
"\n"
"Do Mandrakesoft zostaną przesłane następujące informacje:\n"
"1) lista pakietów zainstalowanych w systemie,\n"
"2) konfiguracja sprzętowa.\n"
"\n"
"Jeśli nie przepadasz za tego typu pomysłami lub nie chcesz wysyłać tych "
"informacji,\n"
"naciśnij \"Anuluj\". Klikając \"Dalej\" pozwolisz na wysyłanie\n"
"informacji dotyczących uaktualnień za pomocą spersonalizowanych e-maili.\n"
"Co więcej, skorzystasz z usług bez potrzeby uiszczania dodatkowych opłat\n"
"na www.mandrakeexpert.com."

#: ../mdkonline:141 ../mdkonline:180 ../mdkupdate:131
#, c-format
msgid "Connection problem"
msgstr "Problem z połączeniem"

#: ../mdkonline:141
#, c-format
msgid "or"
msgstr "lub"

#: ../mdkonline:141
#, c-format
msgid "wrong password:"
msgstr "niepoprawne hasło:"

#: ../mdkonline:141
#, c-format
msgid ""
"Your login or password was wrong.\n"
" Either you'll have to type it again, or you'll need to create an account on "
"Mandrakeonline.\n"
" In the latter case, go back to the first step to connect to "
"Mandrakeonline.\n"
" Be aware that you must also provide a Machine name \n"
" (only alphabetical characters are admitted)"
msgstr ""
"Twój login lub hasło zostały niepoprawnie wprowadzone.\n"
" Możesz spróbować ponownie lub też utworzyć nowe konto na Mandrakeonline.\n"
" W drugim przypadku wróć do pierwszego kroku nawiązywania \n"
"połączenia z Mandrakeonline. Nie zapomnij podać nazwy komputera\n"
" (przyjmowane są tylko znaki alfanumeryczne)"

#: ../mdkonline:153
#, c-format
msgid "Create a Mandrakeonline Account"
msgstr "Utwórz konto Mandrakeonline "

#: ../mdkonline:158
#, c-format
msgid "Confirm Password:"
msgstr "Potwierdź hasło:"

#: ../mdkonline:159
#, c-format
msgid "Mail contact:"
msgstr "Kontakt pocztowy:"

#: ../mdkonline:163
#, c-format
msgid ""
"The passwords do not match\n"
" Please try again\n"
msgstr ""
"Hasła różnią się\n"
"Spróbuj ponownie\n"

#: ../mdkonline:163
#, c-format
msgid "Please provide a login"
msgstr "Podaj login"

#: ../mdkonline:163
#, c-format
msgid "Not a valid mail address!\n"
msgstr "To nie jest poprawny adres e-mail!\n"

#: ../mdkonline:169
#, c-format
msgid ""
"Mandrakeonline Account successfully created.\n"
"Please click \"Next\" to authenticate and upload your configuration\n"
msgstr ""
"Pomyślnie utworzono konto Mandrakeonline.\n"
"Kliknij \"Naprzód\" aby uwierzytlenić się i pobrać swoją konfigurację\n"

#: ../mdkonline:178
#, c-format
msgid "Your upload was successful!"
msgstr "Informacje zostały pomyślnie przesłane!"

#: ../mdkonline:178
#, c-format
msgid ""
"From now you will receive on security and updates \n"
"announcements thanks to Mandrakeonline."
msgstr ""
"Od tej chwili dzięki Mandrakeonline będziesz otrzymywać \n"
"informacje o wykrytych błędach i uaktualnieniach."

#: ../mdkonline:178
#, c-format
msgid ""
"Mandrakeonline offers you the ability to automate the updates.\n"
"A program will run regulary in your system waiting for new updates\n"
msgstr ""
"Mandrakeonline umożliwia Ci zautomatyzowanie uaktualnień.\n"
"Program będzie uruchamiał się regularnie i oczekiwał na uaktualnienia\n"

#: ../mdkonline:180
#, c-format
msgid "Problem occurs when uploading files, please try again"
msgstr "Podczas wysyłania plików wystąpił błąd. Spróbuj ponownie."

#: ../mdkonline:186
#, c-format
msgid "Country"
msgstr "Kraj"

#: ../mdkonline:203
#, c-format
msgid "Congratulations"
msgstr "Gratulacje"

#: ../mdkonline:203
#, c-format
msgid "Your Mandrakeonline account has been successfully configured\n"
msgstr "Twoje konto Mandrakeonline zostało pomyślnie skonfigurowane\n"

#: ../mdkonline:219
#, fuzzy, c-format
msgid "Configuration uploaded successfully"
msgstr "Informacje zostały pomyślnie przesłane!"

#: ../mdkonline:220
#, fuzzy, c-format
msgid "Problem uploading configuration"
msgstr "Wczytywanie konfiguracji\n"

#: ../mdkonline:221
#, c-format
msgid ""
"Cannot connect to mandrakeonline website: wrong login/password or router/"
"firewall bad settings"
msgstr ""

#: ../mdkonline.pm:66
#, c-format
msgid "Login and password should be less than 12 characters\n"
msgstr "Login i hasło muszą być krótsze niż 12 znaków\n"

#: ../mdkonline.pm:67
#, c-format
msgid "Special characters are not allowed\n"
msgstr "Nie można używać specjalnych znaków\n"

#: ../mdkonline.pm:68
#, c-format
msgid "Please fill in all fields\n"
msgstr "Wypełnij wszystkie pola\n"

#: ../mdkonline.pm:69
#, c-format
msgid "Email not valid\n"
msgstr "Adres e-mail jest nieprawidłowy\n"

#: ../mdkonline.pm:70
#, c-format
msgid "Account already exist\n"
msgstr "Konto już istnieje\n"

#: ../mdkonline.pm:76
#, c-format
msgid "Problem connecting to server \n"
msgstr "Problem podczas nawiązywania połączenia z serwerem\n"

#: ../mdkupdate:58
#, c-format
msgid ""
"mdkupdate version %s\n"
"Copyright (C) %s Mandrakesoft.\n"
"This is free software and may be redistributed under the terms of the GNU "
"GPL.\n"
"\n"
"usage:\n"
msgstr ""
"wersja mdkupdate %s\n"
"Copyright (C) %s Mandrakesoft.\n"
"To jest Wolne Oprogramowanie i może być rozpowszechniane\n"
"na zasadach licencji GNU GPL.\n"
"\n"
"użycie:\n"

#: ../mdkupdate:63
#, c-format
msgid "  --help         - print this help message.\n"
msgstr "  --help         - wyświetla ten komunikat pomocy.\n"

#: ../mdkupdate:64
#, c-format
msgid "  --auto         - Mandrakeupdate launched automatically.\n"
msgstr "  --auto         - automatyczne uruchamiane Mandrakeupdate .\n"

#: ../mdkupdate:65
#, c-format
msgid "  --applet       - launch Mandrakeupdate.\n"
msgstr "  --applet       - uruchamia Mandrakeupdate.\n"

#: ../mdkupdate:73
#, c-format
msgid "No %s file found. Run mdkonline wizard first"
msgstr "Nie znaleziono pliku %s. Uruchom najpierw druida mdkonline"

#: ../mdkupdate:131
#, c-format
msgid "Mandrakeupdate could not contact the site, we will try again."
msgstr ""
"Mandrakeupdate nie może nawiązać połączenia z witryną, spróbujemy później."

#: ../mdkupdate:186
#, c-format
msgid "Unable to update packages from update_source medium.\n"
msgstr "Nie można uaktualnić pakietów z nośnika update_source.\n"

#~ msgid "Unable to update packages from mdkupdate medium.\n"
#~ msgstr "Nie można uaktualnić pakietów z nośnika mdkupdate.\n"

#~ msgid ""
#~ "Mandrakeupdate could not upload the diff files. Send a mail to support "
#~ "[at] mandrakeonline [dot] net"
#~ msgstr ""
#~ "Mandrakeupdate nie może przesłać plików diff. Prześlij e-mail na adres "
#~ "support [at] mandrakeonline [dot] net"

#, fuzzy
#~ msgid "Please Wait"
#~ msgstr "Proszę czekać"

#~ msgid "Next"
#~ msgstr "Następny"

#~ msgid "Cancel"
#~ msgstr "Anuluj"

#~ msgid "Previous"
#~ msgstr "Wstecz"

#~ msgid "I don't have a Mandrakeonline account and I want to subscribe"
#~ msgstr "Nie posiadam konta Mandrakeonline i chcę się zapisać"

#~ msgid "Mandrakelinux Privacy Policy"
#~ msgstr "Zastrzeżenie prywatności Mandrakelinux"

#~ msgid "Authentification"
#~ msgstr "Uwierzytelnienie"

#~ msgid "Send Configuration"
#~ msgstr "Wyślij konfigurację"

#~ msgid "Finish"
#~ msgstr "Zakończ"

#~ msgid "automated Upgrades"
#~ msgstr "automatyczne uaktualnienia"

#~ msgid "Country:"
#~ msgstr "Kraj:"

#~ msgid "Error"
#~ msgstr "Błąd"

#~ msgid "Quitting Wizard\n"
#~ msgstr "Opuszczanie druida\n"

#~ msgid ""
#~ "Mandrakeonline could not be contacted, please try again at a later time"
#~ msgstr ""
#~ "Nie można nawiązać połączenia z Mandrakeonline. Spróbuj ponownie później."

#~ msgid "Wrong password"
#~ msgstr "Niepoprawne hasło"

#~ msgid "  --update       - Update keys\n"
#~ msgstr "  --update       - uaktualnia klucze\n"
4;toCopy), $postinstall_rpms) }; log::l("copying Auto Install Floppy"); getAndSaveInstallFloppy($::o, "$postinstall_rpms/auto_install.img"); } sub clean_postinstall_rpms() { $postinstall_rpms and -d $postinstall_rpms and rm_rf($postinstall_rpms); } #-###################################################################################### #- Specific Hardware to take into account and associated rpms to install #-###################################################################################### sub allowNVIDIA_rpms { my ($packages) = @_; require pkgs; if (pkgs::packageByName($packages, "NVIDIA_GLX")) { #- at this point, we can allow using NVIDIA 3D acceleration packages. my @rpms; foreach (@{$packages->{depslist}}) { my ($ext, $version, $release) = /kernel[^-]*(-smp|-enterprise|-secure)?(?:-(\d.*?)\.(\d+mdk))?$/ or next; my $p = pkgs::packageByName($packages, $_); $p->flag_available or next; $version or ($version, $release) = ($p->version, $p->release); my $name = "NVIDIA_kernel-$version-$release$ext"; pkgs::packageByName($packages, $name) or return; push @rpms, $name; } @rpms > 0 or return; return [ @rpms, "NVIDIA_GLX" ]; } } #-###################################################################################### #- Functions #-###################################################################################### sub kernelVersion { my ($o) = @_; my $kernel = readlink "$o->{prefix}/boot/vmlinuz" || first(all("$o->{prefix}/boot")); first($kernel =~ /vmlinuz-(.*)/); } sub getNextStep { my ($s) = $::o->{steps}{first}; $s = $::o->{steps}{$s}{next} while $::o->{steps}{$s}{done} || !$::o->{steps}{$s}{reachable}; $s; } sub spawnShell { return if $::o->{localInstall} || $::testing; -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; fork and return; $ENV{DISPLAY} ||= ":0"; #- why not :pp local *F; sysopen F, "/dev/tty2", 2 or die "cannot open /dev/tty2 -- no shell will be provided"; open STDIN, "<&F" or die ''; open STDOUT, ">&F" or die ''; open STDERR, ">&F" or die ''; close F; print any::drakx_version(), "\n"; c::setsid(); ioctl(STDIN, c::TIOCSCTTY(), 0) or warn "could not set new controlling tty: $!"; my $busybox = "/usr/bin/busybox"; exec {-e $busybox ? $busybox : "/bin/sh"} "/bin/sh" or log::l("exec of /bin/sh failed: $!"); } sub getAvailableSpace { my ($o) = @_; #- make sure of this place to be available for installation, this could help a lot. #- currently doing a very small install use 36Mb of postinstall-rpm, but installing #- these packages may eat up to 90Mb (of course not all the server may be installed!). #- 65mb may be a good choice to avoid almost all problem of insuficient space left... my $minAvailableSize = 65 * sqr(1024); my $n = !$::testing && getAvailableSpace_mounted($o->{prefix}) || getAvailableSpace_raw($o->{fstab}) * 512 / 1.07; $n - max(0.1 * $n, $minAvailableSize); } sub getAvailableSpace_mounted { my ($prefix) = @_; my $dir = -d "$prefix/usr" ? "$prefix/usr" : "$prefix"; my (undef, $free) = MDK::Common::System::df($dir) or return; log::l("getAvailableSpace_mounted $free KB"); $free * 1024 || 1; } sub getAvailableSpace_raw { my ($fstab) = @_; do { $_->{mntpoint} eq '/usr' and return $_->{size} } foreach @$fstab; do { $_->{mntpoint} eq '/' and return $_->{size} } foreach @$fstab; if ($::testing) { my $nb = 450; log::l("taking ${nb}MB for testing"); return $nb << 11; } die "missing root partition"; } sub preConfigureTimezone { my ($o) = @_; require timezone; #- can't be done in install cuz' timeconfig %post creates funny things add2hash($o->{timezone}, { timezone::read($o->{prefix}) }) if $o->{isUpgrade}; $o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang})); my $utc = $::expert && !grep { isFat($_) || isNT($_) } @{$o->{fstab}}; my $ntp = timezone::ntp_server($o->{prefix}); add2hash_($o->{timezone}, { UTC => $utc, ntp => $ntp }); } sub setPackages { my ($o, $rebuild_needed) = @_; require pkgs; if (!$o->{packages} || is_empty_array_ref($o->{packages}{depslist})) { $o->{packages} = pkgs::psUsingHdlists($o->{prefix}, $o->{method}); #- open rpm db according to right mode needed. $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}, $rebuild_needed); pkgs::getDeps($o->{prefix}, $o->{packages}); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'basesystem') || die("missing basesystem package"), 1); #- must be done after selecting base packages (to save memory) pkgs::getProvides($o->{packages}); #- must be done after getProvides pkgs::read_rpmsrate($o->{packages}, getFile("Mandrake/base/rpmsrate")); ($o->{compssUsers}, $o->{compssUsersSorted}) = pkgs::readCompssUsers($o->{meta_class}); #- preselect default_packages and compssUsersChoices. setDefaultPackages($o); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || next) foreach @{$o->{default_packages}}; } else { #- this has to be done to make sure necessary files for urpmi are #- present. pkgs::psUpdateHdlistsDeps($o->{prefix}, $o->{method}, $o->{packages}); #- open rpm db (always without rebuilding db, it should be false at this point). $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}); } } sub setDefaultPackages { my ($o, $clean) = @_; if ($clean) { delete $o->{$_} foreach qw(default_packages compssUsersChoice); #- clean modified variables. } push @{$o->{default_packages}}, "nfs-utils-clients" if $o->{method} eq "nfs"; push @{$o->{default_packages}}, "numlock" if $o->{miscellaneous}{numlock}; push @{$o->{default_packages}}, "kernel22" if !$::oem && c::kernel_version() =~ /^\Q2.2/; push @{$o->{default_packages}}, "raidtools" if !is_empty_array_ref($o->{all_hds}{raids}); push @{$o->{default_packages}}, "lvm" if !is_empty_array_ref($o->{all_hds}{lvms}); push @{$o->{default_packages}}, "alsa", "alsa-utils" if modules::get_alias("sound-slot-0") =~ /^snd-card-/; push @{$o->{default_packages}}, uniq(grep {$_} map { fsedit::package_needed_for_partition_type($_) } @{$o->{fstab}}); #- if no cleaning needed, populate by default, clean is used for second or more call to this function. unless ($clean) { if ($::auto_install && ($o->{compssUsersChoice} || {})->{ALL}) { $o->{compssUsersChoice}{$_} = 1 foreach map { @{$o->{compssUsers}{$_}{flags}} } @{$o->{compssUsersSorted}}; } if (!$o->{compssUsersChoice} && !$o->{isUpgrade}) { #- by default, choose: if ($o->{meta_class} eq 'server') { $o->{compssUsersChoice}{$_} = 1 foreach 'X', 'MONITORING', 'NETWORKING_REMOTE_ACCESS_SERVER'; } else { $o->{compssUsersChoice}{$_} = 1 foreach 'GNOME', 'KDE', 'CONFIG', 'X'; $o->{lang} eq 'eu_ES' and $o->{compssUsersChoice}{KDE} = 0; $o->{compssUsersChoice}{$_} = 1 foreach map { @{$o->{compssUsers}{$_}{flags}} } 'Workstation|Office Workstation', 'Workstation|Internet station'; } } } $o->{compssUsersChoice}{uc($_)} = 1 foreach grep { modules::probe_category("multimedia/$_") } modules::sub_categories('multimedia'); $o->{compssUsersChoice}{uc($_)} = 1 foreach map { $_->{driver} =~ /Flag:(.*)/ } detect_devices::probeall(); $o->{compssUsersChoice}{SYSTEM} = 1; $o->{compssUsersChoice}{DOCS} = !$o->{excludedocs}; $o->{compssUsersChoice}{BURNER} = 1 if detect_devices::burners(); $o->{compssUsersChoice}{DVD} = 1 if detect_devices::dvdroms(); $o->{compssUsersChoice}{USB} = 1 if modules::get_probeall("usb-interface"); $o->{compssUsersChoice}{PCMCIA} = 1 if detect_devices::hasPCMCIA(); $o->{compssUsersChoice}{HIGH_SECURITY} = 1 if $o->{security} > 3; $o->{compssUsersChoice}{BIGMEM} = 1 if !$::oem && (availableRamMB() > 800) && (arch() !~ /ia64/); $o->{compssUsersChoice}{SMP} = 1 if detect_devices::hasSMP(); $o->{compssUsersChoice}{'3D'} = 1 if detect_devices::matching_desc('Matrox.* G[245][05]0') || detect_devices::matching_desc('Rage X[CL]') || detect_devices::matching_desc('3D Rage (?:LT|Pro)') || detect_devices::matching_desc('Voodoo [35]') || detect_devices::matching_desc('Voodoo Banshee') || detect_devices::matching_desc('8281[05].* CGC') || detect_devices::matching_desc('Rage 128') || detect_devices::matching_desc('Radeon ') && !detect_devices::matching_desc('Radeon 8500') || detect_devices::matching_desc('[nN]Vidia.*T[nN]T2') || #- TNT2 cards detect_devices::matching_desc('[nN]Vidia.*NV[56]') || detect_devices::matching_desc('[nN]Vidia.*Vanta') || detect_devices::matching_desc('[nN]Vidia.*GeForce') || #- GeForce cards detect_devices::matching_desc('[nN]Vidia.*NV1[15]') || detect_devices::matching_desc('[nN]Vidia.*Quadro'); foreach (map { substr($_, 0, 2) } lang::langs($o->{langs})) { pkgs::packageByName($o->{packages}, "locales-$_") or next; push @{$o->{default_packages}}, "locales-$_"; $o->{compssUsersChoice}{qq(LOCALES"$_")} = 1; #- mainly for zh in case of zh_TW.Big5 } foreach (lang::langsLANGUAGE($o->{langs})) { $o->{compssUsersChoice}{qq(LOCALES"$_")} = 1; } $o->{compssUsersChoice}{'CHARSET"' . lang::lang2charset($o->{lang}) . '"'} = 1; } sub unselectMostPackages { my ($o) = @_; pkgs::unselectAllPackages($o->{packages}); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || next) foreach @{$o->{default_packages}}; } sub warnAboutNaughtyServers { my ($o) = @_; my @naughtyServers = pkgs::naughtyServers($o->{packages}) or return 1; if (!$o->ask_yesorno('', formatAlaTeX(_("You have selected the following server(s): %s These servers are activated by default. They don't have any known security issues, but some new could be found. In that case, you must make sure to upgrade as soon as possible. Do you really want to install these servers? ", join(", ", @naughtyServers))), 1)) { pkgs::unselectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_)) foreach @naughtyServers; } } sub addToBeDone(&$) { my ($f, $step) = @_; return &$f() if $::o->{steps}{$step}{done}; push @{$::o->{steps}{$step}{toBeDone}}, $f; } sub setAuthentication { my ($o) = @_; my ($shadow, $md5, $ldap, $nis, $winbind) = @{$o->{authentication} || {}}{qw(shadow md5 LDAP NIS winbind)}; my $p = $o->{prefix}; #- obsoleted always enabled (in /etc/pam.d/system-auth furthermore) #any::enableMD5Shadow($p, $shadow, $md5); any::enableShadow($p) if $shadow; if ($ldap) { $o->pkg_install(qw(chkauth openldap-clients nss_ldap pam_ldap)); run_program::rooted($o->{prefix}, "/usr/sbin/chkauth", "ldap", "-D", $o->{netc}{LDAPDOMAIN}, "-s", $ldap); } elsif ($nis) { #$o->pkg_install(qw(chkauth ypbind yp-tools net-tools)); #run_program::rooted($o->{prefix}, "/usr/sbin/chkauth", "yp", $domain, "-s", $nis); $o->pkg_install("ypbind"); my $domain = $o->{netc}{NISDOMAIN}; $domain || $nis ne "broadcast" or die _("Can't use broadcast with no NIS domain"); my $t = $domain ? "domain $domain" . ($nis ne "broadcast" && " server") : "ypserver"; substInFile { $_ = "#~$_" unless /^#/; $_ .= "$t $nis\n" if eof; } "$p/etc/yp.conf"; require network; network::write_conf("$p/etc/sysconfig/network", $o->{netc}); } elsif ($winbind) { my $domain = $o->{netc}{WINDOMAIN}; $o->pkg_install(qw(samba-winbind samba-common)); { #- setup pam my $f = "$o->{prefix}/etc/pam.d/system-auth"; cp_af($f, "$f.orig"); cp_af("$f-winbind", $f); } write_smb_conf($o, $domain); run_program::rooted($o->{prefix}, "chkconfig", "--level", "35", "winbind", "on"); mkdir "$o->{prefix}/home/$domain", 0755; #- finally join the machine to the Windoze domain run_program::rooted($o->{prefix}, "/usr/bin/smbpasswd", "-j", $domain, "-r", $winbind); } } sub write_smb_conf { my ($domain) = @_; #- was going to just have a canned config in samba-winbind #- and replace the domain, but sylvestre/buchan didn't bless it yet my $f = "$::prefix/etc/samba/smb.conf"; rename $f, "$f.orig"; output($f, " [global] workgroup = $domain server string = Samba Server %v security = domain encrypt passwords = Yes password server = * log file = /var/log/samba/log.%m max log size = 50 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 character set = ISO8859-15 os level = 18 local master = No dns proxy = No winbind uid = 10000-20000 winbind gid = 10000-20000 winbind separator = + template homedir = /home/%D/%U template shell = /bin/bash winbind use default domain = yes "); } sub killCardServices { my $pid = chomp_(cat_("/tmp/cardmgr.pid")); $pid and kill(15, $pid); #- send SIGTERM } sub unlockCdrom(;$) { my ($cdrom) = @_; $cdrom or cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 }; } sub ejectCdrom(;$) { my ($cdrom) = @_; getFile("XXX"); #- close still opened filehandle $cdrom ||= $1 if cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image),; if ($cdrom) { #- umount BEFORE opening the cdrom device otherwise the umount will #- D state if the cdrom is already removed eval { fs::umount("/tmp/image") }; if ($@) { log::l("files still open: ", readlink($_)) foreach map { glob_("$_/fd/*") } glob_("/proc/*") } eval { ioctl detect_devices::tryOpen($cdrom), c::CDROMEJECT(), 1 }; } } sub setupFB { my ($o, $vga) = @_; $vga ||= 785; #- assume at least 640x480x16. require bootloader; #- update bootloader entries with vga, all kernel are now framebuffer. foreach (qw(vmlinuz vmlinuz-secure vmlinuz-smp vmlinuz-hack)) { if (my $e = bootloader::get("/boot/$_", $o->{bootloader})) { $e->{vga} = $vga; } } bootloader::install($o->{prefix}, $o->{bootloader}, $o->{fstab}, $o->{all_hds}{hds}); 1; } sub hdInstallPath() { my $tail = first(readlink("/tmp/image") =~ m|^/tmp/hdimage/(.*)|); my $head = first(readlink("/tmp/hdimage") =~ m|$::prefix(.*)|); $tail && ($head ? "$head/$tail" : "/mnt/hd/$tail"); } sub install_urpmi { my ($prefix, $method, $mediums) = @_; #- rare case where urpmi cannot be installed (no hd install path). $method eq 'disk' && !hdInstallPath() and return; my @cfg = map { my $name = $_->{fakemedium}; local *LIST; my $mask = umask 077; open LIST, ">$prefix/var/lib/urpmi/list.$name" or log::l("failed to write list.$name"); umask $mask; my $dir = ($_->{prefix} || ${{ nfs => "file://mnt/nfs", disk => "file:/" . hdInstallPath(), ftp => $ENV{URLPREFIX}, http => $ENV{URLPREFIX}, cdrom => "removable://mnt/cdrom" }}{$method}) . "/$_->{rpmsdir}"; local *FILES; open FILES, "$ENV{LD_LOADER} parsehdlist /tmp/$_->{hdlist} |"; print LIST "$dir/$_\n" foreach chomp_(<FILES>); close FILES or log::l("parsehdlist failed"), return; close LIST; #- build synthesis file if there are still not existing (ie not copied from mirror). if (-s "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz" <= 32) { unlink "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz"; run_program::rooted($prefix, "parsehdlist", ">", "/var/lib/urpmi/synthesis.hdlist.$name", "--synthesis", "/var/lib/urpmi/hdlist.$name.cz"); run_program::rooted($prefix, "gzip", "-S", ".cz", "/var/lib/urpmi/synthesis.hdlist.$name"); } my ($qname, $qdir) = ($name, $dir); $qname =~ s/(\s)/\\$1/g; $qdir =~ s/(\s)/\\$1/g; #- output new urpmi.cfg format here. "$qname " . ($dir !~ /^(ftp|http)/ && $qdir) . " { hdlist: hdlist.$name.cz with_hdlist: ../base/" . ($_->{update} ? "hdlist.cz" : $_->{hdlist}) . " list: list.$name" . ($dir =~ /removable:/ && " removable: /dev/cdrom") . ($_->{update} && " update") . " } "; } sort { $a->{medium} <=> $b->{medium} } values %$mediums; eval { output "$prefix/etc/urpmi/urpmi.cfg", @cfg }; } #-############################################################################### #- kde stuff #-############################################################################### sub kderc_largedisplay { my ($prefix) = @_; update_gnomekderc($_, 'KDE', Contrast => 7, kfmIconStyle => "Large", kpanelIconStyle => "Normal", #- to change to Large when icons looks better KDEIconStyle => "Large") foreach list_skels($prefix, '.kderc'); substInFile { s/^(GridWidth)=85/$1=100/; s/^(GridHeight)=70/$1=75/; } $_ foreach list_skels($prefix, '.kde/share/config/kfmrc'); } sub kdeicons_postinstall { my ($prefix) = @_; #- parse etc/fstab file to search for dos/win, floppy, zip, cdroms icons. #- handle both supermount and fsdev usage. my %l = ( 'cdrom' => [ 'cdrom', 'Cd-Rom' ], 'zip' => [ 'zip', 'Zip' ], 'floppy-ls' => [ 'floppy', 'LS-120' ], 'floppy' => [ 'floppy', 'Floppy' ], ); foreach (fs::read_fstab($prefix, "/etc/fstab")) { my ($name_, $nb) = $_->{mntpoint} =~ m|.*/(\S+?)(\d*)$/|; my ($name, $text) = @{$l{$name_} || []}; my $f = ${{ supermount => sub { $name .= '.fsdev' if $name }, vfat => sub { $name = 'Dos_'; $text = $name_ }, }}{$_->{type}}; &$f if $f; template2userfile($prefix, "$ENV{SHARE_PATH}/$name.kdelnk.in", "Desktop/$text" . ($nb && " $nb"). ".kdelnk", 1, %$_) if $name; } # rename the .kdelnk to the name found in the .kdelnk as kde doesn't use it # for displaying foreach my $dir (grep { -d $_ } list_skels($prefix, 'Desktop')) { foreach (grep { /\.kdelnk$/ } all($dir)) { cat_("$dir/$_") =~ /^Name\[\Q$ENV{LANG}\E\]=(.{2,14})$/m and rename "$dir/$_", "$dir/$1.kdelnk"; } } } sub kdemove_desktop_file { my ($prefix) = @_; my @toMove = qw(doc.kdelnk news.kdelnk updates.kdelnk home.kdelnk printer.kdelnk floppy.kdelnk cdrom.kdelnk FLOPPY.kdelnk CDROM.kdelnk); #- remove any existing save in Trash of each user and #- move appropriate file there after an upgrade. foreach my $dir (grep { -d $_ } list_skels($prefix, 'Desktop')) { renamef("$dir/$_", "$dir/Trash/$_") foreach grep { -e "$dir/$_" } @toMove, grep { /\.rpmorig$/ } all($dir) } } #-############################################################################### #- auto_install stuff #-############################################################################### sub auto_inst_file() { ($::g_auto_install ? "/tmp" : "$::prefix/root/drakx") . "/auto_inst.cfg.pl" } sub report_bug { my ($prefix) = @_; any::report_bug($prefix, 'auto_inst' => g_auto_install('', 1)); } sub g_auto_install { my ($replay, $respect_privacy) = @_; my $o = {}; require pkgs; $o->{default_packages} = pkgs::selected_leaves($::o->{packages}); my @fields = qw(mntpoint type size); $o->{partitions} = [ map { my %l; @l{@fields} = @$_{@fields}; \%l } grep { $_->{mntpoint} } @{$::o->{fstab}} ]; exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang authentication mouse wacom netc timezone superuser intf keyboard users partitioning isUpgrade manualFstab nomouseprobe crypto security netcnx useSupermount autoExitInstall mkbootdisk); #- TODO modules bootloader if (my $printer = $::o->{printer}) { $o->{printer}{$_} = $::o->{printer}{$_} foreach qw(SPOOLER DEFAULT BROWSEPOLLADDR BROWSEPOLLPORT MANUALCUPSCONFIG); $o->{printer}{configured} = {}; foreach my $queue (keys %{$::o->{printer}{configured}}) { my $val = $::o->{printer}{configured}{$queue}{queuedata}; exists $val->{$_} and $o->{printer}{configured}{$queue}{queuedata}{$_} = $val->{$_} foreach keys %{$val || {}}; } } if (my $card = $::o->{X}{card}) { $o->{X}{$_} = $::o->{X}{$_} foreach qw(default_depth resolution_wanted); if ($o->{X}{default_depth} and my $depth = $card->{depth}{$o->{X}{default_depth}}) { $depth ||= []; $o->{X}{resolution_wanted} ||= join "x", @{$depth->[0]} unless is_empty_array_ref($depth->[0]); $o->{X}{monitor} = $::o->{X}{monitor} if $::o->{X}{monitor}{manual}; } } local $o->{partitioning}{auto_allocate} = !$replay; $o->{autoExitInstall} = !$replay; $o->{interactiveSteps} = [ 'doPartitionDisks', 'formatPartitions'] if $replay; #- deep copy because we're modifying it below $o->{users} = [ @{$o->{users} || []} ]; my @user_info_to_remove = ( if_($respect_privacy, qw(name realname home pw)), qw(oldu oldg password password2), ); $_ = { %{$_ || {}} }, delete @$_{@user_info_to_remove} foreach $o->{superuser}, @{$o->{users} || []}; if ($respect_privacy && $o->{netcnx}) { if (my $type = $o->{netcnx}{type}) { my @netcnx_type_to_remove = qw(passwd passwd2 login phone_in phone_out); $_ = { %{$_ || {}} }, delete @$_{@netcnx_type_to_remove} foreach $o->{netcnx}{$type}; } } require Data::Dumper; my $str = join('', "#!/usr/bin/perl -cw # # You should check the syntax of this file before using it in an auto-install. # You can do this with 'perl -cw auto_inst.cfg.pl' or by executing this file # (note the '#!/usr/bin/perl -cw' on the first line). ", Data::Dumper->Dump([$o], ['$o']), "\0"); $str =~ s/ {8}/\t/g; #- replace all 8 space char by only one tabulation, this reduces file size so much :-) $str; } sub getAndSaveInstallFloppy { my ($o, $where) = @_; if ($postinstall_rpms && -d $postinstall_rpms && -r "$postinstall_rpms/auto_install.img") { log::l("getAndSaveInstallFloppy: using file saved as $postinstall_rpms/auto_install.img"); cp_af("$postinstall_rpms/auto_install.img", $where); } else { my $image = cat_("/proc/cmdline") =~ /pcmcia/ ? "pcmcia" : ${{ disk => 'hd', cdrom => 'cdrom', ftp => 'network', nfs => 'network', http => 'network' }}{$o->{method}}; $image .= arch() =~ /sparc64/ && "64"; #- for sparc64 there are a specific set of image. getAndSaveFile("images/$image.img", $where) or log::l("failed to write Install Floppy ($image.img) to $where"), return; } 1; } sub getAndSaveAutoInstallFloppy { my ($o, $replay, $where) = @_; eval { modules::load('loop') }; if (arch() =~ /sparc/) { my $imagefile = "$o->{prefix}/tmp/autoinst.img"; my $mountdir = "$o->{prefix}/tmp/mount"; -d $mountdir or mkdir $mountdir, 0755; my $workdir = "$o->{prefix}/tmp/work"; -d $workdir or rmdir $workdir; getAndSaveInstallFloppy($o, $imagefile) or return; devices::make($_) foreach qw(/dev/loop6 /dev/ram); run_program::run("losetup", "/dev/loop6", $imagefile); fs::mount("/dev/loop6", $mountdir, "romfs", 'readonly'); cp_af($mountdir, $workdir); fs::umount($mountdir); run_program::run("losetup", "-d", "/dev/loop6"); substInFile { s/timeout.*//; s/^(\s*append\s*=\s*\".*)\"/$1 kickstart=floppy\"/ } "$workdir/silo.conf"; #" for po #-TODO output "$workdir/ks.cfg", generate_ks_cfg($o); output "$workdir/boot.msg", "\n7m", "!! If you press enter, an auto-install is going to start. ALL data on this computer is going to be lost, including any Windows partitions !! ", "7m\n"; local $o->{partitioning}{clearall} = 1; output("$workdir/auto_inst.cfg", g_auto_install()); run_program::run("genromfs", "-d", $workdir, "-f", "/dev/ram", "-A", "2048,/..", "-a", "512", "-V", "DrakX autoinst"); fs::mount("/dev/ram", $mountdir, 'romfs', 0); run_program::run("silo", "-r", $mountdir, "-F", "-i", "/fd.b", "-b", "/second.b", "-C", "/silo.conf"); fs::umount($mountdir); require commands; commands::dd("if=/dev/ram", "of=$where", "bs=1440", "count=1024"); rm_rf($workdir, $mountdir, $imagefile); } elsif (arch() =~ /ia64/) { #- nothing yet } else { my $imagefile = "$o->{prefix}/root/autoinst.img"; my $mountdir = "$o->{prefix}/root/aif-mount"; -d $mountdir or mkdir $mountdir, 0755; my $param = 'kickstart=floppy ' . generate_automatic_stage1_params($o); getAndSaveInstallFloppy($o, $imagefile) or return; my $dev = devices::set_loop($imagefile) or log::l("couldn't set loopback device"), return; fs::mount($dev, $mountdir, 'vfat', 0); substInFile { s/timeout.*/$replay ? 'timeout 1' : ''/e; s/^(\s*append)/$1 $param/ } "$mountdir/syslinux.cfg"; unlink "$mountdir/help.msg"; output "$mountdir/boot.msg", "\n0c", "!! If you press enter, an auto-install is going to start. All data on this computer is going to be lost, including any Windows partitions !! ", "07\n" if !$replay; local $o->{partitioning}{clearall} = !$replay; eval { output("$mountdir/auto_inst.cfg", g_auto_install($replay)); }; $@ and log::l("Warning: <$@>"); fs::umount($mountdir); rmdir $mountdir; devices::del_loop($dev); require commands; commands::dd("if=$imagefile", "of=$where", "bs=1440", "count=1024"); unlink $imagefile; } 1; } sub g_default_packages { my ($o, $quiet) = @_; my $floppy = detect_devices::floppy(); while (1) { $o->ask_okcancel('', _("Insert a FAT formatted floppy in drive %s", $floppy), 1) or return; eval { fs::mount(devices::make($floppy), "/floppy", "vfat", 0) }; last if !$@; $o->ask_warn('', _("This floppy is not FAT formatted")); } require Data::Dumper; my $str = Data::Dumper->Dump([ { default_packages => pkgs::selected_leaves($o->{packages}) } ], ['$o']); $str =~ s/ {8}/\t/g; output('/floppy/auto_inst.cfg', "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl'\n", "# before testing. To use it, boot with ``linux defcfg=floppy''\n", $str, "\0"); fs::umount("/floppy"); $quiet or $o->ask_warn('', _("To use this saved packages selection, boot installation with ``linux defcfg=floppy''")); } sub loadO { my ($O, $f) = @_; $f ||= auto_inst_file; my $o; if ($f =~ /^(floppy|patch)$/) { my $f = $f eq "floppy" ? 'auto_inst.cfg' : "patch"; unless ($::testing) { fs::mount(devices::make(detect_devices::floppy()), "/mnt", (arch() =~ /sparc/ ? "romfs" : "vfat"), 'readonly'); $f = "/mnt/$f"; } -e $f or $f .= '.pl'; my $b = before_leaving { fs::umount("/mnt") unless $::testing; modules::unload(qw(vfat fat)); }; $o = loadO($O, $f); } else { -e "$f.pl" and $f .= ".pl" unless -e $f; my $fh = -e $f ? do { local *F; open F, $f; *F } : getFile($f) or die _("Error reading file %s", $f); { local $/ = "\0"; no strict; eval <$fh>; close $fh; $@ and die; } add2hash_($o ||= {}, $O); } bless $o, ref $O; } sub generate_automatic_stage1_params { my ($o) = @_; my @ks = "method:$o->{method}"; if ($o->{method} eq 'http') { "$ENV{URLPREFIX}" =~ m|http://([^/:]+)/(.*)| or die; push @ks, "server:$1", "directory:$2"; } elsif ($o->{method} eq 'ftp') { push @ks, "server:$ENV{HOST}", "directory:$ENV{PREFIX}", "user:$ENV{LOGIN}", "pass:$ENV{PASSWORD}"; } elsif ($o->{method} eq 'nfs') { cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/image nfs| or die; push @ks, "server:$1", "directory:$2"; } if (member($o->{method}, qw(http ftp nfs))) { my ($intf) = values %{$o->{intf}}; push @ks, "interface:$intf->{DEVICE}"; if ($intf->{BOOTPROTO} eq 'dhcp') { push @ks, "network:dhcp"; } else { require network; push @ks, "network:static", "ip:$intf->{IPADDR}", "netmask:$intf->{NETMASK}", "gateway:$o->{netc}{GATEWAY}"; my @dnss = network::dnsServers($o->{netc}); push @ks, "dns:$dnss[0]" if @dnss; } } "automatic=".join(',', @ks); } sub guess_mount_point { my ($part, $prefix, $user) = @_; my %l = ( '/' => 'etc/fstab', '/boot' => 'vmlinuz', '/tmp' => '.X11-unix', '/usr' => 'X11R6', '/var' => 'catman', ); my $handle = any::inspect($part, $prefix) or return; my $d = $handle->{dir}; my ($mnt) = grep { -e "$d/$l{$_}" } keys %l; $mnt ||= (stat("$d/.bashrc"))[4] ? '/root' : '/home/user' . ++$$user if -e "$d/.bashrc"; $mnt ||= (grep { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_("$d")) ? '/home' : ''; ($mnt, $handle); } sub suggest_mount_points { my ($fstab, $prefix, $uniq) = @_; my $user; foreach my $part (grep { isTrueFS($_) } @$fstab) { $part->{mntpoint} && !$part->{unsafeMntpoint} and next; #- if already found via an fstab my ($mnt, $handle) = guess_mount_point($part, $prefix, \$user) or next; next if $uniq && fsedit::mntpoint2part($mnt, $fstab); $part->{mntpoint} = $mnt; delete $part->{unsafeMntpoint}; #- try to find other mount points via fstab fs::merge_info_from_fstab($fstab, $handle->{dir}, $uniq, 'loose') if $mnt eq '/'; } $_->{mntpoint} and log::l("suggest_mount_points: $_->{device} -> $_->{mntpoint}") foreach @$fstab; } #- mainly for finding the root partitions for upgrade sub find_root_parts { my ($fstab, $prefix) = @_; log::l("find_root_parts"); my $user; grep { my ($mnt) = guess_mount_point($_, $prefix, \$user); $mnt eq '/'; } @$fstab; } sub use_root_part { my ($all_hds, $part, $prefix) = @_; my $fstab = [ fsedit::get_really_all_fstab($all_hds) ]; { my $handle = any::inspect($part, $prefix) or die; fs::merge_info_from_fstab($fstab, $handle->{dir}, 'uniq'); } map { $_->{mntpoint} = 'swap' } grep { isSwap($_) } @$fstab; #- use all available swap. } sub getHds { my ($o, $f_err) = @_; my $ok = 1; my $try_scsi = !$::expert; my $flags = $o->{partitioning}; my @drives = detect_devices::hds(); # add2hash_($o->{partitioning}, { readonly => 1 }) if partition_table_raw::typeOfMBR($drives[0]{device}) eq 'system_commander'; getHds: my $all_hds = catch_cdie { fsedit::hds(\@drives, $flags) } sub { $ok = 0; my $err = formatError($@); log::l("error reading partition table: $err"); !$flags->{readonly} && $f_err and $f_err->($err); }; my $hds = $all_hds->{hds}; if (is_empty_array_ref($hds) && $try_scsi) { $try_scsi = 0; $o->setupSCSI; #- ask for an unautodetected scsi card goto getHds; } if (!$::testing) { @$hds = grep { eval { partition_table_raw::test_for_bad_drives($_) }; !$@ } @$hds; } $ok = fsedit::verifyHds($hds, $flags->{readonly}, $ok) if !($flags->{clearall} || $flags->{clear}); #- try to figure out if the same number of hds is available, use them if ok. $ok && $hds && @$hds > 0 && @{$o->{all_hds}{hds} || []} == @$hds and return $ok; fs::get_raw_hds('', $all_hds); fs::add2all_hds($all_hds, @{$o->{manualFstab}}); $o->{all_hds} = $all_hds; $o->{fstab} = [ fsedit::get_all_fstab($all_hds) ]; fs::merge_info_from_mtab($o->{fstab}); my @win = grep { isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}}; log::l("win parts: ", join ",", map { $_->{device} } @win) if @win; if (@win == 1) { #- Suggest /boot/efi on ia64. $win[0]{mntpoint} = arch() =~ /ia64/ ? "/boot/efi" : "/mnt/windows"; } else { my %w; foreach (@win) { my $v = $w{$_->{device_windobe}}++; $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou } } my @sunos = grep { isSunOS($_) && type2name($_->{type}) =~ /root/i } @{$o->{fstab}}; #- take only into account root partitions. if (@sunos) { my $v = ''; map { $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos; } #- a good job is to mount SunOS root partition, and to use mount point described here in /etc/vfstab. $ok; } sub log_sizes { my ($o) = @_; my @df = MDK::Common::System::df($o->{prefix}); log::l(sprintf "Installed: %s(df), %s(rpm)", formatXiB($df[0] - $df[1], 1024), formatXiB(sum(`$ENV{LD_LOADER} rpm --root $o->{prefix}/ -qa --queryformat "%{size}\n"`))) if -x "$o->{prefix}/bin/rpm"; } sub copy_advertising { my ($o) = @_; return if $::rootwidth < 800; my $f; my $source_dir = "Mandrake/share/advertising"; foreach ("." . $o->{lang}, "." . substr($o->{lang},0,2), '') { $f = getFile("$source_dir$_/list") or next; $source_dir = "$source_dir$_"; } if (my @files = <$f>) { my $dir = "$o->{prefix}/tmp/drakx-images"; mkdir $dir; unlink glob_("$dir/*"); foreach (@files) { chomp; getAndSaveFile("$source_dir/$_", "$dir/$_"); s/\.png/\.pl/;