summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
blob: 4e288b1ba243b78f43c5986fe1cc8a364e4e6e2a (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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053

#-    __("AT&T 20C409/20C499 (S3, autodetected)"),	=> 'att20c409',
#-    __("AT&T 20C505 (S3)"),				=> 'att20c505',
#-    __("BrookTree BT481 (AGX)"),			=> 'bt481',
#-    __("BrookTree BT482 (AGX)"),			=> 'bt482',
#-    __("BrookTree BT485/9485 (S3)"),			=> 'bt485',
#-    __("Sierra SC15025 (S3, AGX)"),			=> 'sc15025',
#-    __("S3 GenDAC (86C708) (autodetected)"),		=> 's3gendac',
#-    __("S3 SDAC (86C716) (autodetected)"),		=> 's3_sdac',
#-    __("STG-1700 (S3, autodetected)"),			=> 'stg1700',
#-    __("STG-1703 (S3, autodetected)"),			=> 'stg1703',
#-    __("TI 3020 (S3)"),					=> 'ti3020',
#-    __("TI 3025 (S3, autodetected)"),			=> 'ti3025',
#-    __("TI 3026 (S3, autodetected)"),			=> 'ti3026',
#-    __("IBM RGB 514 (S3, autodetected)"),		=> 'ibm_rgb514',
#-    __("IBM RGB 524 (S3, autodetected)"),		=> 'ibm_rgb524',
#-    __("IBM RGB 525 (S3, autodetected)"),		=> 'ibm_rgb525',
#-    __("IBM RGB 526 (S3)"),				=> 'ibm_rgb526',
#-    __("IBM RGB 528 (S3, autodetected)"),		=> 'ibm_rgb528',
#-    __("ICS5342 (S3, ARK)"),				=> 'ics5342',
#-    __("ICS5341 (W32)"),				=> 'ics5341',
#-    __("IC Works w30C516 ZoomDac (ARK)"),		=> 'zoomdac',
#-    __("Normal DAC"),					=> 'normal',
#-);
#-
#-@clockchip_name = (
#-    __("No Clockchip Setting (recommended)")                         => '',
#-    __("Chrontel 8391")                                              => 'ch8391',
#-    __("ICD2061A and compatibles (ICS9161A => DCS2824)")	     => 'icd2061a',
#-    __("ICS2595")                                                    => 'ics2595',
#-    __("ICS5342 (similar to SDAC, but not completely compatible)")   => 'ics5342',
#-    __("ICS5341")						     => 'ics5341',
#-    __("S3 GenDAC (86C708) and ICS5300 (autodetected)")	             => 's3gendac',
#-    __("S3 SDAC (86C716)")					     => 's3_sdac',
#-    __("STG 1703 (autodetected)")				     => 'stg1703',
#-    __("Sierra SC11412")					     => 'sc11412',
#-    __("TI 3025 (autodetected)")				     => 'ti3025',
#-    __("TI 3026 (autodetected)")				     => 'ti3026',
#-    __("IBM RGB 51x/52x (autodetected)")			     => 'ibm_rgb5xx',
#-);
#-

$intro_text = "
This program will create a basic XF86Config file, based on menu selections you make.

The XF86Config file usually resides in /usr/X11R6/lib/X11 or /etc/X11. A
sample XF86Config file is supplied with XFree86; it is configured for a
standard VGA card and monitor with 640x480 resolution.

You can either take the sample XF86Config as a base and edit it for your
configuration, or let this program produce a base XF86Config file for your
configuration and fine-tune it. Refer to /usr/X11R6/lib/X11/doc/README.Config
for a detailed overview of the configuration process.

For accelerated servers (including accelerated drivers in the SVGA server),
there are many chipset and card-specific options and settings. This program
does not know about these. On some configurations some of these settings must
be specified. Refer to the server man pages and chipset-specific READMEs.

Before continuing with this program, make sure you know the chipset and
amount of video memory on your video card. SuperProbe can help with this.
It is also helpful if you know what server you want to run.";

$finalcomment_text = "
configuration file has been written. Take a look at it before running 'startx'.
Note that the XF86Config file must be in one of the directories searched by the
server (e.g. /etc/X11/XF86Config) in order to be used. Within the server press
ctrl, alt and '+' simultaneously to cycle video resolutions. Pressing ctrl, alt
and backspace simultaneously immediately exits the server (use if the monitor
doesn't sync for a particular mode).

For further configuration, refer to /usr/X11R6/lib/X11/doc/README.Config.
";

$s3_comment = '
# Use Option "nolinear" if the server doesn\'t start up correctly
# (this avoids the linear framebuffer probe). If that fails try
# option \"nomemaccess\".
#
# Refer to /usr/X11R6/lib/doc/README.S3, and the XF86_S3 man page.
';

$cirrus_comment = '
# Use Option \"no_bitblt\" if you have graphics problems. If that fails
# try Option \"noaccel\".
# Refer to /usr/X11R6/lib/doc/README.cirrus.
# To allow linear addressing, uncomment the Option line and the
# address that the card maps the framebuffer to.
';

$probeonlywarning_text = '
It is possible that the hardware detection routines in the server some how
cause the system to crash and the screen to remain blank. If this is the
case, skip this step the next time. The server may need a
Ramdac, ClockChip or special option (e.g. "nolinear" for S3) to probe
and start-up correctly.
';

$monitorintro_text = __('
Now we want to set the specifications of the monitor. The two critical
parameters are the vertical refresh rate, which is the rate at which the
the whole screen is refreshed, and most importantly the horizontal sync rate,
which is the rate at which scanlines are displayed.

The valid range for horizontal sync and vertical sync should be documented
in the manual of your monitor. If in doubt, check the monitor database
/usr/X11R6/lib/X11/doc/Monitors to see if your monitor is there.
');

$hsyncintro_text = __('
You must indicate the horizontal sync range of your monitor. You can either
select one of the predefined ranges below that correspond to industry-
standard monitor types, or give a specific range.

It is VERY IMPORTANT that you do not specify a monitor type with a horizontal
sync range that is beyond the capabilities of your monitor. If in doubt,
choose a conservative setting.
');

$vsyncintro_text = __('
You must indicate the vertical sync range of your monitor. You can either
select one of the predefined ranges below that correspond to industry-
standard monitor types, or give a specific range. For interlaced modes,
the number that counts is the high one (e.g. 87 Hz rather than 43 Hz).
');

$XF86firstchunk_text = '
# File generated by XConfigurator.

# **********************************************************************
# Refer to the XF86Config(4/5) man page for details about the format of
# this file.
# **********************************************************************

# **********************************************************************
# Files section.  This allows default font and rgb paths to be set
# **********************************************************************

Section "Files"

# The location of the RGB database.  Note, this is the name of the
# file minus the extension (like ".txt" or ".db").  There is normally
# no need to change the default.

    RgbPath	"/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.

    FontPath   "unix/:-1"

EndSection

# **********************************************************************
# Server flags section.
# **********************************************************************

Section "ServerFlags"

    # Uncomment this to cause a core dump at the spot where a signal is
    # received.  This may leave the console in an unusable state, but may
    # provide a better stack trace in the core dump to aid in debugging
    #NoTrapSignals

    # Uncomment this to disable the <Crtl><Alt><BS> server abort sequence
    # This allows clients to receive this key event.
    #DontZap

    # Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching
    # sequences.  This allows clients to receive these key events.
    #DontZoom

EndSection

# **********************************************************************
# Input devices
# **********************************************************************
';

$keyboardsection_start = '
# **********************************************************************
# Keyboard section
# **********************************************************************

Section "Keyboard"

    Protocol    "Standard"

    # when using XQUEUE, comment out the above line, and uncomment the
    # following line
    #Protocol   "Xqueue"

    AutoRepeat  500 5

    # Let the server do the NumLock processing.  This should only be
    # required when using pre-R6 clients
    #ServerNumLock

    # Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
    #Xleds      1 2 3

    #To set the LeftAlt to Meta, RightAlt key to ModeShift,
    #RightCtl key to Compose, and ScrollLock key to ModeLock:

    LeftAlt        Meta
';

$keyboardsection_part2 = '
   ScrollLock      Compose
   RightCtl        Control

# To disable the XKEYBOARD extension, uncomment XkbDisable.

#    XkbDisable

# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults).  For example, for a non-U.S.
# keyboard, you will probably want to use:
#    XkbModel    "pc102"
# If you have a US Microsoft Natural keyboard, you can use:
#    XkbModel    "microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
#    XkbLayout   "de"
# or:
#    XkbLayout   "de"
#    XkbVariant  "nodeadkeys"
#
# If you\'d like to switch the positions of your capslock and
# control keys, use:
#    XkbOptions  "ctrl:swapcaps"

# These are the default XKB settings for XFree86
#    XkbRules    "xfree86"
#    XkbModel    "pc101"
#    XkbLayout   "us"
#    XkbVariant  ""
#    XkbOptions  ""

    XkbKeycodes     "xfree86"
    XkbTypes        "default"
    XkbCompat       "default"
    XkbSymbols      "us(pc101)"
    XkbGeometry     "pc"
    XkbRules        "xfree86"
    XkbModel        "pc101"
';

$keyboardsection_end = '
EndSection
';

$pointersection_text1 = '
# **********************************************************************
# Pointer section
# **********************************************************************

Section "Pointer"
';

$pointersection_text2 = '

# When using XQUEUE, comment out the above two lines, and uncomment
# the following line.

#    Protocol	"Xqueue"

# Baudrate and SampleRate are only for some Logitech mice

#    BaudRate	9600
#    SampleRate	150

# Emulate3Buttons is an option for 2-button Microsoft mice
# Emulate3Timeout is the timeout in milliseconds (default is 50ms)
';

$monitorsection_text1 = '
# **********************************************************************
# Monitor section
# **********************************************************************

# Any number of monitor sections may be present

Section "Monitor"
';

$monitorsection_text2 = '
# HorizSync is in kHz unless units are specified.
# HorizSync may be a comma separated list of discrete values, or a
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR\'S
# USER MANUAL FOR THE CORRECT NUMBERS.
';

$monitorsection_text3 = '
# VertRefresh is in Hz unless units are specified.
# VertRefresh may be a comma separated list of discrete values, or a
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR\'S
# USER MANUAL FOR THE CORRECT NUMBERS.
';

$monitorsection_text4 = '
# Modes can be specified in two formats.  A compact one-line format, or
# a multi-line format.

# These two are equivalent

#    ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace

#    Mode "1024x768i"
#        DotClock	45
#        HTimings	1024 1048 1208 1264
#        VTimings	768 776 784 817
#        Flags		"Interlace"
#    EndMode
';

$modelines_text_Trident_TG_96xx = '
# This is a set of standard mode timings. Modes that are out of monitor spec
# are automatically deleted by the server (provided the HorizSync and
# VertRefresh lines are correct), so there\'s no immediate need to
# delete mode timings (unless particular mode timings don\'t work on your
# monitor). With these modes, the best standard mode that your monitor
# and video card can support for a given resolution is automatically
# used.

# These are special modelines for Trident Providia 9685. It is for VA Linux
# systems only.
# 640x480 @ 72 Hz, 36.5 kHz hsync
Modeline "640x480"     31.5   640  680  720  864   480  488  491  521
# 800x600 @ 72 Hz, 48.0 kHz hsync
Modeline "800x600"     50     800  856  976 1040   600  637  643  666 +hsync +vsync
# 1024x768 @ 60 Hz, 48.4 kHz hsync
#Modeline "1024x768"    65    1024 1032 1176 1344   768  771  777  806 -hsync -vsync
# 1024x768 @ 70 Hz, 56.5 kHz hsync
Modeline "1024x768"    75    1024 1048 1184 1328   768  771  777  806 -hsync -vsync
';
$modelines_text = '
# This is a set of standard mode timings. Modes that are out of monitor spec
# are automatically deleted by the server (provided the HorizSync and
# VertRefresh lines are correct), so there\'s no immediate need to
# delete mode timings (unless particular mode timings don\'t work on your
# monitor). With these modes, the best standard mode that your monitor
# and video card can support for a given resolution is automatically
# used.

# 640x400 @ 70 Hz, 31.5 kHz hsync
Modeline "640x400"     25.175 640  664  760  800   400  409  411  450
# 640x480 @ 60 Hz, 31.5 kHz hsync
Modeline "640x480"     25.175 640  664  760  800   480  491  493  525
# 800x600 @ 56 Hz, 35.15 kHz hsync
ModeLine "800x600"     36     800  824  896 1024   600  601  603  625
# 1024x768 @ 87 Hz interlaced, 35.5 kHz hsync
Modeline "1024x768"    44.9  1024 1048 1208 1264   768  776  784  817 Interlace

# 640x400 @ 85 Hz, 37.86 kHz hsync
Modeline "640x400"     31.5   640  672 736   832   400  401  404  445 -HSync +VSync
# 640x480 @ 72 Hz, 36.5 kHz hsync
Modeline "640x480"     31.5   640  680  720  864   480  488  491  521
# 640x480 @ 75 Hz, 37.50 kHz hsync
ModeLine  "640x480"    31.5   640  656  720  840   480  481  484  500 -HSync -VSync
# 800x600 @ 60 Hz, 37.8 kHz hsync
Modeline "800x600"     40     800  840  968 1056   600  601  605  628 +hsync +vsync

# 640x480 @ 85 Hz, 43.27 kHz hsync
Modeline "640x480"     36     640  696  752  832   480  481  484  509 -HSync -VSync
# 1152x864 @ 89 Hz interlaced, 44 kHz hsync
ModeLine "1152x864"    65    1152 1168 1384 1480   864  865  875  985 Interlace

# 800x600 @ 72 Hz, 48.0 kHz hsync
Modeline "800x600"     50     800  856  976 1040   600  637  643  666 +hsync +vsync
# 1024x768 @ 60 Hz, 48.4 kHz hsync
Modeline "1024x768"    65    1024 1032 1176 1344   768  771  777  806 -hsync -vsync

# 640x480 @ 100 Hz, 53.01 kHz hsync
Modeline "640x480"     45.8   640  672  768  864   480  488  494  530 -HSync -VSync
# 1152x864 @ 60 Hz, 53.5 kHz hsync
Modeline  "1152x864"   89.9  1152 1216 1472 1680   864  868  876  892 -HSync -VSync
# 800x600 @ 85 Hz, 55.84 kHz hsync
Modeline  "800x600"    60.75  800  864  928 1088   600  616  621  657 -HSync -VSync

# 1024x768 @ 70 Hz, 56.5 kHz hsync
Modeline "1024x768"    75    1024 1048 1184 1328   768  771  777  806 -hsync -vsync
# 1280x1024 @ 87 Hz interlaced, 51 kHz hsync
Modeline "1280x1024"   80    1280 1296 1512 1568  1024 1025 1037 1165 Interlace

# 800x600 @ 100 Hz, 64.02 kHz hsync
Modeline  "800x600"    69.65  800  864  928 1088   600  604  610  640 -HSync -VSync
# 1024x768 @ 76 Hz, 62.5 kHz hsync
Modeline "1024x768"    85    1024 1032 1152 1360   768  784  787  823
# 1152x864 @ 70 Hz, 62.4 kHz hsync
Modeline  "1152x864"   92    1152 1208 1368 1474   864  865  875  895
# 1280x1024 @ 61 Hz, 64.2 kHz hsync
Modeline "1280x1024"  110    1280 1328 1512 1712  1024 1025 1028 1054

# 1024x768 @ 85 Hz, 70.24 kHz hsync
Modeline "1024x768"   98.9  1024 1056 1216 1408   768 782 788 822 -HSync -VSync
# 1152x864 @ 78 Hz, 70.8 kHz hsync
Modeline "1152x864"   110   1152 1240 1324 1552   864  864  876  908

# 1280x1024 @ 70 Hz, 74.59 kHz hsync
Modeline "1280x1024"  126.5 1280 1312 1472 1696  1024 1032 1040 1068 -HSync -VSync
# 1600x1200 @ 60Hz, 75.00 kHz hsync
Modeline "1600x1200"  162   1600 1664 1856 2160  1200 1201 1204 1250 +HSync +VSync
# 1152x864 @ 84 Hz, 76.0 kHz hsync
Modeline "1152x864"   135    1152 1464 1592 1776   864  864  876  908

# 1280x1024 @ 74 Hz, 78.85 kHz hsync
Modeline "1280x1024"  135    1280 1312 1456 1712  1024 1027 1030 1064

# 1024x768 @ 100Hz, 80.21 kHz hsync
Modeline "1024x768"   115.5  1024 1056 1248 1440  768  771  781  802 -HSync -VSync
# 1280x1024 @ 76 Hz, 81.13 kHz hsync
Modeline "1280x1024"  135    1280 1312 1416 1664  1024 1027 1030 1064

# 1600x1200 @ 70 Hz, 87.50 kHz hsync
Modeline "1600x1200"  189    1600 1664 1856 2160  1200 1201 1204 1250 -HSync -VSync
# 1152x864 @ 100 Hz, 89.62 kHz hsync
Modeline "1152x864"   137.65 1152 1184 1312 1536   864  866  885  902 -HSync -VSync
# 1280x1024 @ 85 Hz, 91.15 kHz hsync
Modeline "1280x1024"  157.5  1280 1344 1504 1728  1024 1025 1028 1072 +HSync +VSync
# 1600x1200 @ 75 Hz, 93.75 kHz hsync
Modeline "1600x1200"  202.5  1600 1664 1856 2160  1200 1201 1204 1250 +HSync +VSync
# 1600x1200 @ 85 Hz, 105.77 kHz hsync
Modeline "1600x1200"  220    1600 1616 1808 2080  1200 1204 1207 1244 +HSync +VSync
# 1280x1024 @ 100 Hz, 107.16 kHz hsync
Modeline "1280x1024"  181.75 1280 1312 1440 1696  1024 1031 1046 1072 -HSync -VSync

# 1800x1440 @ 64Hz, 96.15 kHz hsync
ModeLine "1800X1440"  230    1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync
# 1800x1440 @ 70Hz, 104.52 kHz hsync
ModeLine "1800X1440"  250    1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync

# 512x384 @ 78 Hz, 31.50 kHz hsync
Modeline "512x384"    20.160 512  528  592  640   384  385  388  404 -HSync -VSync
# 512x384 @ 85 Hz, 34.38 kHz hsync
Modeline "512x384"    22     512  528  592  640   384  385  388  404 -HSync -VSync

# Low-res Doublescan modes
# If your chipset does not support doublescan, you get a \'squashed\'
# resolution like 320x400.

# 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio
Modeline "320x200"     12.588 320  336  384  400   200  204  205  225 Doublescan
# 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio
Modeline "320x240"     12.588 320  336  384  400   240  245  246  262 Doublescan
# 320x240 @ 72 Hz, 36.5 kHz hsync
Modeline "320x240"     15.750 320  336  384  400   240  244  246  262 Doublescan
# 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio
ModeLine "400x300"     18     400  416  448  512   300  301  302  312 Doublescan
# 400x300 @ 60 Hz, 37.8 kHz hsync
Modeline "400x300"     20     400  416  480  528   300  301  303  314 Doublescan
# 400x300 @ 72 Hz, 48.0 kHz hsync
Modeline "400x300"     25     400  424  488  520   300  319  322  333 Doublescan
# 480x300 @ 56 Hz, 35.2 kHz hsync, 8:5 aspect ratio
ModeLine "480x300"     21.656 480  496  536  616   300  301  302  312 Doublescan
# 480x300 @ 60 Hz, 37.8 kHz hsync
Modeline "480x300"     23.890 480  496  576  632   300  301  303  314 Doublescan
# 480x300 @ 63 Hz, 39.6 kHz hsync
Modeline "480x300"     25     480  496  576  632   300  301  303  314 Doublescan
# 480x300 @ 72 Hz, 48.0 kHz hsync
Modeline "480x300"     29.952 480  504  584  624   300  319  322  333 Doublescan

';

$devicesection_text = '
# **********************************************************************
# Graphics device section
# **********************************************************************

# Any number of graphics device sections may be present

Section "Device"
    Identifier        "Generic VGA"
    VendorName        "Unknown"
    BoardName "Unknown"
    Chipset   "generic"

#    VideoRam 256

#    Clocks   25.2 28.3

EndSection

# Device auto configured:
';

$screensection_text1 = '
# **********************************************************************
# Screen sections
# **********************************************************************
';

="hl opt">; $l{&$msg} = $_ foreach @fstab; my $e = $o->ask_from_list('', _("Please choose a partition to use as your root partition."), [ sort keys %l ]); (fsedit::get_root($fstab) || {})->{mntpoint} = ''; $l{$e}{mntpoint} = '/'; } else { $o->ask_from_entries_ref ('', _("Choose the mount points"), [ map { &$msg } @fstab ], [ map { +{ val => \$_->{mntpoint}, list => [ '', fsedit::suggestions_mntpoint([]) ] } } @fstab ]); } $o->SUPER::ask_mntpoint_s($fstab); } #------------------------------------------------------------------------------ sub rebootNeeded($) { my ($o) = @_; $o->ask_warn('', _("You need to reboot for the partition table modifications to take place")); install_steps::rebootNeeded($o); } #------------------------------------------------------------------------------ sub choosePartitionsToFormat($$) { my ($o, $fstab) = @_; $o->SUPER::choosePartitionsToFormat($fstab); my @l = grep { !$_->{isFormatted} && $_->{mntpoint} && !($::beginner && isSwap($_)) && (!isOtherAvailableFS($_) || $::expert || $_->{toFormat}) } @$fstab; $_->{toFormat} = 1 foreach grep { $::beginner && isSwap($_) } @$fstab; return if $::beginner && 0 == grep { ! $_->{toFormat} } @l; $_->{toFormat} ||= $_->{toFormatUnsure} foreach @l; log::l("preparing to format $_->{mntpoint}") foreach grep { $_->{toFormat} } @l; my %label; $label{$_} = sprintf("%s (%s)", isSwap($_) ? type2name($_->{type}) : $_->{mntpoint}, isLoopback($_) ? loopback::file($_) : $_->{device}) foreach @l; $o->ask_many_from_list_ref('', _("Choose the partitions you want to format"), [ map { $label{$_} } @l ], [ map { \$_->{toFormat} } @l ]) or die "cancel"; @l = grep { $_->{toFormat} && !isLoopback($_) && !isReiserfs($_) } @l; $o->ask_many_from_list_ref('', _("Check bad blocks?"), [ map { $label{$_} } @l ], [ map { \$_->{toFormatCheck} } @l ]) or goto &choosePartitionsToFormat if $::expert; } sub formatMountPartitions { my ($o, $fstab) = @_; my $w = $o->wait_message('', _("Formatting partitions")); fs::formatMount_all($o->{raid}, $o->{fstab}, $o->{prefix}, sub { my ($part) = @_; $w->set(isLoopback($part) ? _("Creating and formatting file %s", loopback::file($part)) : _("Formatting partition %s", $part->{device})); }); die _("Not enough swap to fulfill installation, please add some") if availableMemory < 40 * 1024; } #------------------------------------------------------------------------------ sub setPackages { my ($o) = @_; my $w = $o->wait_message('', _("Looking for available packages")); $o->SUPER::setPackages; } #------------------------------------------------------------------------------ sub selectPackagesToUpgrade { my ($o) = @_; my $w = $o->wait_message('', _("Finding packages to upgrade")); $o->SUPER::selectPackagesToUpgrade(); } #------------------------------------------------------------------------------ sub choosePackages { my ($o, $packages, $compss, $compssUsers, $compssUsersSorted, $first_time) = @_; #- this is done at the very beginning to take into account #- selection of CD by user if using a cdrom. $o->chooseCD($packages) if $o->{method} eq 'cdrom'; my $availableC = install_steps::choosePackages(@_); my $individual = $::expert; require pkgs; my $min_size = pkgs::selectedSize($packages); $min_size < $availableC or die _("Your system has not enough space left for installation or upgrade"); $o->chooseGroups($packages, $compssUsers, $compssUsersSorted, \$individual) unless $::beginner || $::corporate; #- avoid reselection of package if individual selection is requested and this is not the first time. if ($first_time || !$individual) { my $min_mark = $::beginner ? 25 : 1; my @l = values %{$packages->[0]}; my @flags = map { pkgs::packageFlagSelected($_) } @l; pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, 0, $o->{installClass}); my $max_size = 1 + pkgs::selectedSize($packages); #- avoid division by zero. mapn { pkgs::packageSetFlagSelected(@_) } \@l, \@flags; #- if (!$::beginner && $max_size > $availableC) { #- $o->ask_okcancel('', #-_("You need %dMB for a full install of the groups you selected. #-You can go on anyway, but be warned that you won't get all packages", $max_size / sqr(1024)), 1) or goto &choosePackages #- } my $size2install = $::beginner && $first_time ? $availableC * 0.7 : $o->chooseSizeToInstall($packages, $min_size, $max_size, $availableC, $individual) or goto &choosePackages; ($o->{packages_}{ind}) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, $size2install, $o->{installClass}); } $o->choosePackagesTree($packages, $compss) if $individual; } sub chooseSizeToInstall { my ($o, $packages, $min, $max, $availableC) = @_; $availableC * 0.7; } sub choosePackagesTree {} sub chooseGroups { my ($o, $packages, $compssUsers, $compssUsersSorted, $individual) = @_; $o->ask_many_from_list_ref('', _("Package Group Selection"), [ @$compssUsersSorted, _("Miscellaneous") ], [ map { \$o->{compssUsersChoice}{$_} } @$compssUsersSorted, "Miscellaneous" ], [ _("Individual package selection") ], [ $individual ], ) or goto &chooseGroups; unless ($o->{compssUsersChoice}{Miscellaneous}) { my %l; $l{@{$compssUsers->{$_}}} = () foreach @$compssUsersSorted; exists $l{$_} or pkgs::packageSetFlagSkip($_, 1) foreach values %{$packages->[0]}; } foreach (@$compssUsersSorted) { $o->{compssUsersChoice}{$_} or pkgs::skipSetWithProvides($packages, @{$compssUsers->{$_}}); } foreach (@$compssUsersSorted) { $o->{compssUsersChoice}{$_} or next; foreach (@{$compssUsers->{$_}}) { pkgs::packageSetFlagUnskip($_, 1); pkgs::packageSetFlagSkip($_, 0); } } } sub chooseCD { my ($o, $packages) = @_; my @mediums = grep { $_ > 1 } pkgs::allMediums($packages); my @mediumsDescr = (); my %mediumsDescr = (); #- if no other medium available or a poor beginner, we are choosing for him! #- note first CD is always selected and should not be unselected! return if scalar(@mediums) == 0 || $::beginner; #- build mediumDescr according to mediums, this avoid asking multiple times #- all the medium grouped together on only one CD. foreach (@mediums) { my $descr = pkgs::mediumDescr($packages, $_); exists $mediumsDescr{$descr} or push @mediumsDescr, $descr; $mediumsDescr{$descr} ||= $packages->[2]{$_}{selected}; } $o->set_help('chooseCD'); $o->ask_many_from_list_ref('', _("If you have all the CDs in the list below, click Ok. If you have none of those CDs, click Cancel. If only some CDs are missing, unselect them, then click Ok."), [ map { _("Cd-Rom labeled \"%s\"", $_) } @mediumsDescr ], [ map { \$mediumsDescr{$_} } @mediumsDescr ] ) or do { map { $mediumsDescr{$_} = 0 } @mediumsDescr; #- force unselection of other CDs. }; $o->set_help('choosePackages'); #- restore true selection of medium (which may have been grouped together) foreach (@mediums) { my $descr = pkgs::mediumDescr($packages, $_); $packages->[2]{$_}{selected} = $mediumsDescr{$descr}; } } #------------------------------------------------------------------------------ sub installPackages { my ($o, $packages) = @_; my ($current, $total) = 0; my $w = $o->wait_message(_("Installing"), _("Preparing installation")); my $old = \&pkgs::installCallback; local *pkgs::installCallback = sub { my $m = shift; if ($m =~ /^Starting installation/) { $total = $_[1]; } elsif ($m =~ /^Starting installing package/) { my $name = $_[0]; $w->set(_("Installing package %s\n%d%%", $name, $total && 100 * $current / $total)); $current += pkgs::packageSize(pkgs::packageByName($o->{packages}, $name)); } else { unshift @_, $m; goto $old } }; $o->SUPER::installPackages($packages); } sub afterInstallPackages($) { my ($o) = @_; my $w = $o->wait_message('', _("Post-install configuration")); $o->SUPER::afterInstallPackages($o); } #------------------------------------------------------------------------------ sub configureNetwork($) { my ($o, $first_time) = @_; local $_; if (@{$o->{intf}} > 0 && $first_time) { my @l = ( __("Keep the current IP configuration"), __("Reconfigure network now"), __("Do not set up networking"), ); $_ = $::beginner ? "Keep" : $o->ask_from_list_([ _("Network Configuration") ], _("Local networking has already been configured. Do you want to:"), [ @l ]) || "Do not"; } else { $_ = $::beginner ? "Do not" : ($o->ask_yesorno([ _("Network Configuration") ], _("Do you want to configure a local network for your system?"), 0) ? "Local LAN" : "Do not"); } if (/^Do not/) { $o->{netc}{NETWORKING} = "false"; } elsif (!/^Keep/) { $o->setup_thiskind('net', !$::expert, 1); my @l = detect_devices::getNet() or die _("no network card found"); my $last; foreach ($::beginner ? $l[0] : @l) { my $intf = network::findIntf($o->{intf} ||= [], $_); add2hash($intf, $last); add2hash($intf, { NETMASK => '255.255.255.0' }); $o->configureNetworkIntf($intf) or last; $o->{netc} ||= {}; delete $o->{netc}{dnsServer}; delete $o->{netc}{GATEWAY}; $last = $intf; } #- { #- my $wait = $o->wait_message(_("Hostname"), _("Determining host name and domain...")); #- network::guessHostname($o->{prefix}, $o->{netc}, $o->{intf}); #- } $o->configureNetworkNet($o->{netc}, $last ||= {}, @l) if $last->{BOOTPROTO} !~ /^(dhcp|bootp)$/; } install_steps::configureNetwork($o); #- added ppp configuration after ethernet one. if (!$::beginner && $o->ask_yesorno([ _("Modem Configuration") ], _("Do you want to configure a dialup connection with modem for your system?"), 0)) { $o->pppConfig; } } sub configureNetworkIntf { my ($o, $intf) = @_; my $pump = $intf->{BOOTPROTO} =~ /^(dhcp|bootp)$/; delete $intf->{NETWORK}; delete $intf->{BROADCAST}; my @fields = qw(IPADDR NETMASK); $o->set_help('configureNetworkIP'); $o->ask_from_entries_ref(_("Configuring network device %s", $intf->{DEVICE}), ($::isStandalone ? '' : _("Configuring network device %s", $intf->{DEVICE}) . "\n\n") . _("Please enter the IP configuration for this machine. Each item should be entered as an IP address in dotted-decimal notation (for example, 1.2.3.4)."), [ _("IP address:"), _("Netmask:"), _("Automatic IP") ], [ \$intf->{IPADDR}, \$intf->{NETMASK}, { val => \$pump, type => "bool", text => _("(bootp/dhcp)") } ], complete => sub { $intf->{BOOTPROTO} = $pump ? "dhcp" : "static"; return 0 if $pump; for (my $i = 0; $i < @fields; $i++) { unless (network::is_ip($intf->{$fields[$i]})) { $o->ask_warn('', _("IP address should be in format 1.2.3.4")); return (1,$i); } return 0; } }, focus_out => sub { $intf->{NETMASK} ||= network::netmask($intf->{IPADDR}) unless $_[0] } ); } sub configureNetworkNet { my ($o, $netc, $intf, @devices) = @_; $netc->{dnsServer} ||= network::dns($intf->{IPADDR}); $netc->{GATEWAY} ||= network::gateway($intf->{IPADDR}); $o->ask_from_entries_ref(_("Configuring network"), _("Please enter your host name. Your host name should be a fully-qualified host name, such as ``mybox.mylab.myco.com''. You may also enter the IP address of the gateway if you have one"), [_("Host name:"), _("DNS server:"), _("Gateway:"), $::expert ? _("Gateway device:") : ()], [(map { \$netc->{$_} } qw(HOSTNAME dnsServer GATEWAY)), {val => \$netc->{GATEWAYDEV}, list => \@devices}] ); $o->miscellaneousNetwork(); } #------------------------------------------------------------------------------ sub pppConfig { my ($o) = @_; my $m = $o->{modem} ||= {}; unless ($m->{device} || $::expert && !$o->ask_yesorno('', _("Try to find a modem?"), 1)) { eval { modules::load("serial"); }; detect_devices::probeSerialDevices(); foreach (0..3) { next if $o->{mouse}{device} =~ /ttyS$_/; detect_devices::hasModem("/dev/ttyS$_") and $m->{device} = "ttyS$_", last; } } $m->{device} ||= $o->set_help('selectSerialPort') && mouse::serial_ports_names2dev( $o->ask_from_list('', _("Please choose which serial port your modem is connected to."), [ grep { my $avoidDevice = mouse::serial_ports_names2dev($_); $o->{mouse}{device} !~ /$avoidDevice/ } mouse::serial_ports_names ])); $o->set_help('configureNetworkISP'); install_steps::pppConfig($o) if $o->ask_from_entries_refH('', _("Dialup options"), [ _("Connection name") => \$m->{connection}, _("Phone number") => \$m->{phone}, _("Login ID") => \$m->{login}, _("Password") => { val => \$m->{passwd}, hidden => 1 }, _("Authentication") => { val => \$m->{auth}, list => [ __("PAP"), __("CHAP"), __("Terminal-based"), __("Script-based") ] }, _("Domain name") => \$m->{domain}, #-$::expert ? ( #- It is not apropriate to remove DNS as kppp need them! only available for "ifup ppp0" _("First DNS Server") => \$m->{dns1}, _("Second DNS Server") => \$m->{dns2}, #-) : (), ]); } #------------------------------------------------------------------------------ sub installCrypto { my ($o) = @_; my $u = $o->{crypto} ||= {}; $::expert and $o->hasNetwork or return; is_empty_hash_ref($u) and $o->ask_yesorno('', _("You have now the possibility to download software aimed for encryption. WARNING: Due to different general requirements applicable to these software and imposed by various jurisdictions, customer and/or end user of theses software should ensure that the laws of his/their jurisdiction allow him/them to download, stock and/or use these software. In addition customer and/or end user shall particularly be aware to not infringe the laws of his/their jurisdiction. Should customer and/or end user not respect the provision of these applicable laws, he/they will incure serious sanctions. In no event shall Mandrakesoft nor its manufacturers and/or suppliers be liable for special, indirect or incidental damages whatsoever (including, but not limited to loss of profits, business interruption, loss of commercial data and other pecuniary losses, and eventual liabilities and indemnification to be paid pursuant to a court decision) arising out of use, possession, or the sole downloading of these software, to which customer and/or end user could eventually have access after having sign up the present agreement. For any queries relating to these agreement, please contact Mandrakesoft, Inc. 2400 N. Lincoln Avenue Suite 243 Altadena California 91001 USA")) || return; require crypto; eval { $u->{mirror} = crypto::text2mirror($o->ask_from_list('', _("Choose a mirror from which to get the packages"), [ crypto::mirrorstext() ], crypto::mirror2text($u->{mirror}))); }; return if $@; #- bring all interface up for installing crypto packages. $o->upNetwork(); my @packages = do { my $w = $o->wait_message('', _("Contacting the mirror to get the list of available packages")); crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror}); #- make sure $o->{packages} is defined when testing }; my %h; $h{$_} = 1 foreach @{$u->{packages} || []}; $o->ask_many_from_list_ref('', _("Please choose the packages you want to install."), \@packages, [ map { \$h{$_} } @packages ]) or return; $u->{packages} = [ grep { $h{$_} } @packages ]; install_steps::installCrypto($o); #- stop interface using ppp only. $o->downNetwork('pppOnly'); } #------------------------------------------------------------------------------ sub timeConfig { my ($o, $f, $clicked) = @_; require timezone; $o->{timezone}{timezone} = $o->ask_from_treelist('', _("Which is your timezone?"), '/', [ timezone::getTimeZones($::g_auto_install ? '' : $o->{prefix}) ], $o->{timezone}{timezone}) if !$::oo->{oem} || $clicked; $o->{timezone}{UTC} = $o->ask_yesorno('', _("Is your hardware clock set to GMT?"), $o->{timezone}{UTC}) if $::expert || $clicked; install_steps::timeConfig($o, $f); } #------------------------------------------------------------------------------ sub servicesConfig { my ($o) = @_; services::drakxservices($o, $o->{prefix}); } #------------------------------------------------------------------------------ sub printerConfig { my ($o, $clicked) = @_; return if $::corporate; require printer; require printerdrake; if ($::beginner && !$clicked) { printerdrake::auto_detect($o) or return; } #- bring interface up for installing ethernet packages but avoid ppp by default, #- else the guy know what he is doing... #$o->upNetwork('pppAvoided'); eval { add2hash($o->{printer} ||= {}, printer::getinfo($o->{prefix})) }; $o->{printer}{PAPERSIZE} = $o->{lang} eq 'en' ? 'letter' : 'a4'; printerdrake::main($o->{printer}, $o, sub { $o->pkg_install($_[0]) }, sub { $o->upNetwork('pppAvoided') }); } #------------------------------------------------------------------------------ sub setRootPassword { my ($o, $clicked) = @_; my $sup = $o->{superuser} ||= {}; my $nis = $o->{authentication}{NIS}; $sup->{password2} ||= $sup->{password} ||= ""; return if $o->{security} < 1 && !$clicked; $o->set_help("setRootPassword", $o->{installClass} =~ "server" || $::expert ? "setRootPasswordMd5" : (), $::beginner ? () : "setRootPasswordNIS"); $o->ask_from_entries_refH([_("Set root password"), _("Ok"), $o->{security} > 2 || $::corporate ? () : _("No password")], [ _("Set root password"), "\n" ], [ _("Password") => { val => \$sup->{password}, hidden => 1 }, _("Password (again)") => { val => \$sup->{password2}, hidden => 1 }, $o->{installClass} eq "server" || $::expert ? ( _("Use shadow file") => { val => \$o->{authentication}{shadow}, type => 'bool', text => _("shadow") }, _("Use MD5 passwords") => { val => \$o->{authentication}{md5}, type => 'bool', text => _("MD5") }, ) : (), $::beginner ? () : ( _("Use NIS") => { val => \$nis, type => 'bool', text => _("yellow pages") }, ) ], complete => sub { $sup->{password} eq $sup->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,1); length $sup->{password} < 2 * $o->{security} and $o->ask_warn('', _("This password is too simple (must be at least %d characters long)", 2 * $o->{security})), return (1,0); return 0 } ) or return; $o->{authentication}{NIS} &&= $nis; $o->ask_from_entries_ref('', _("Authentification NIS"), [ _("NIS Domain"), _("NIS Server") ], [ \ ($o->{netc}{NISDOMAIN} ||= $o->{netc}{DOMAINNAME}), { val => \$o->{authentication}{NIS}, list => ["broadcast"] }, ]) if $nis; install_steps::setRootPassword($o); } #------------------------------------------------------------------------------ #-addUser #------------------------------------------------------------------------------ sub addUser { my ($o, $clicked) = @_; my $u = $o->{user} ||= {}; if ($o->{security} < 1) { add2hash_($u, { name => "mandrake", password => "mandrake", realname => "default", icon => 'automagic' }); $o->{users} ||= [ $u ]; } $u->{password2} ||= $u->{password} ||= ""; $u->{shell} ||= "/bin/bash"; my @fields = qw(realname name password password2); my @shells = install_any::shells($o); if (($o->{security} >= 1 || $clicked)) { $u->{icon} = translate($u->{icon}); if ($o->ask_from_entries_refH( [ _("Add user"), _("Accept user"), $o->{security} >= 4 && !@{$o->{users}} ? () : _("Done") ], _("Enter a user\n%s", $o->{users} ? _("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @{$o->{users}})) : ''), [ _("Real name") => \$u->{realname}, _("User name") => \$u->{name}, $o->{security} < 2 ? () : ( _("Password") => {val => \$u->{password}, hidden => 1}, _("Password (again)") => {val => \$u->{password2}, hidden => 1}, ), $::beginner ? () : ( _("Shell") => {val => \$u->{shell}, list => \@shells, not_edit => !$::expert} ), $o->{security} > 3 || $::beginner ? () : ( _("Icon") => {val => \$u->{icon}, list => [ map { translate($_) } @any::users ], not_edit => 1 }, ), ], focus_out => sub { if ($_[0] eq 0) { $u->{name} ||= lc first($u->{realname} =~ /((\w|-)+)/); } }, complete => sub { $u->{password} eq $u->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,3); $o->{security} > 3 && length($u->{password}) < 6 and $o->ask_warn('', _("This password is too simple")), return (1,2); $u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0); $u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0); member($u->{name}, map { $_->{name} } @{$o->{users}}) and $o->ask_warn('', _("This user name is already added")), return (1,0); $u->{icon} = untranslate($u->{icon}, @any::users); return 0; }, )) { push @{$o->{users}}, $o->{user}; $o->{user} = {}; goto &addUser; } } install_steps::addUser($o); } #------------------------------------------------------------------------------ sub createBootdisk { my ($o, $first_time) = @_; return if $first_time && $::beginner || $o->{lnx4win}; if (arch() =~ /sparc/) { #- as probing floppies is a bit more different on sparc, assume always /dev/fd0. $o->ask_okcancel('', _("A custom bootdisk provides a way of booting into your Linux system without depending on the normal bootloader. This is useful if you don't want to install SILO on your system, or another operating system removes SILO, or SILO doesn't work with your hardware configuration. A custom bootdisk can also be used with the Mandrake rescue image, making it much easier to recover from severe system failures. If you want to create a bootdisk for your system, insert a floppy in the first drive and press \"Ok\"."), $o->{mkbootdisk}) or return $o->{mkbootdisk} = ''; my @l = detect_devices::floppies(); $o->{mkbootdisk} = $l[0] if !$o->{mkbootdisk} || $o->{mkbootdisk} eq "1"; $o->{mkbootdisk} or return; } else { my @l = detect_devices::floppies(); my %l = ( 'fd0' => __("First floppy drive"), 'fd1' => __("Second floppy drive"), 'Skip' => __("Skip"), ); $l{$_} ||= $_ foreach @l; if ($first_time || @l == 1) { $o->ask_yesorno('', _("A custom bootdisk provides a way of booting into your Linux system without depending on the normal bootloader. This is useful if you don't want to install LILO (or grub) on your system, or another operating system removes LILO, or LILO doesn't work with your hardware configuration. A custom bootdisk can also be used with the Mandrake rescue image, making it much easier to recover from severe system failures. Would you like to create a bootdisk for your system?"), $o->{mkbootdisk}) or return $o->{mkbootdisk} = ''; $o->{mkbootdisk} = $l[0] if !$o->{mkbootdisk} || $o->{mkbootdisk} eq "1"; } else { @l or die _("Sorry, no floppy drive available"); $o->{mkbootdisk} = ${{reverse %l}}{$o->ask_from_list_('', _("Choose the floppy drive you want to use to make the bootdisk"), [ @l{@l, "Skip"} ], $o->{mkbootdisk})}; return $o->{mkbootdisk} = '' if $o->{mkbootdisk} eq 'Skip'; } $o->ask_warn('', _("Insert a floppy in drive %s", $l{$o->{mkbootdisk}})); } my $w = $o->wait_message('', _("Creating bootdisk")); install_steps::createBootdisk($o); } #------------------------------------------------------------------------------ sub setupLILO { my ($o, $more) = @_; $o->{lnx4win} or any::setupBootloader($o, $o->{bootloader}, $o->{hds}, $o->{fstab}, $o->{security}, $o->{prefix}, $more) or return; eval { $o->SUPER::setupBootloader }; if ($@) { $o->ask_warn('', [ _("Installation of LILO failed. The following error occured:"), grep { !/^Warning:/ } cat_("$o->{prefix}/tmp/.error") ]); unlink "$o->{prefix}/tmp/.error"; die "already displayed"; } } #------------------------------------------------------------------------------ sub setupSILO { my ($o, $more) = @_; my $b = $o->{bootloader}; if ($::beginner && $more >= 1) { my @silo_install = (__("First sector of drive (MBR)"), __("First sector of boot partition")); $o->set_help('setupBootloaderBeginner') unless $::isStandalone; #- no problem of translation for this one. $b->{use_partition} = $o->ask_from_list_(_("SILO Installation"), _("Where do you want to install the bootloader?"), \@silo_install, $silo_install[$b->{use_partition}]); } elsif ($more || !$::beginner) { $o->set_help("setupSILOGeneral"); $::expert and $o->ask_yesorno('', _("Do you want to use SILO?"), 1) || return; my @silo_install_lang = (_("First sector of drive (MBR)"), _("First sector of boot partition")); my $silo_install_lang = $silo_install_lang[$b->{use_partition}]; my @l = ( _("Bootloader installation") => { val => \$silo_install_lang, list => \@silo_install_lang, not_edit => 1 }, _("Delay before booting default image") => \$b->{timeout}, $o->{security} < 4 ? () : ( _("Password") => { val => \$b->{password}, hidden => 1 }, _("Password (again)") => { val => \$b->{password2}, hidden => 1 }, _("Restrict command line options") => { val => \$b->{restricted}, type => "bool", text => _("restrict") }, ) ); $o->ask_from_entries_refH('', _("SILO main options"), \@l, complete => sub { #- $o->{security} > 4 && length($b->{password}) < 6 and $o->ask_warn('', _("At this level of security, a password (and a good one) in silo is requested")), return 1; $b->{restricted} && !$b->{password} and $o->ask_warn('', _("Option ``Restrict command line options'' is of no use without a password")), return 1; $b->{password} eq $b->{password2} or !$b->{restricted} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return 1; 0; } ) or return; $b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1; } until ($::beginner && $more <= 1) { $o->set_help('setupSILOAddEntry'); my $c = $o->ask_from_list_([''], _("Here are the following entries in SILO. You can add some more or change the existing ones."), [ (sort @{[map { "$_->{label} ($_->{kernel_or_dev})" . ($b->{default} eq $_->{label} && " *") } @{$b->{entries}}]}), __("Add"), __("Done") ], ); $c eq "Done" and last; my ($e); if ($c eq "Add") { my @labels = map { $_->{label} } @{$b->{entries}}; my $prefix; if ($o->ask_from_list_('', _("Which type of entry do you want to add?"), [ __("Linux"), __("Other OS (SunOS...)") ]) eq "Linux") { $e = { type => 'image' }; $prefix = "linux"; } else { $e = { type => 'other' }; $prefix = "sunos"; } $e->{label} = $prefix; for (my $nb = 0; member($e->{label}, @labels); $nb++) { $e->{label} = "$prefix-$nb" } } else { $c =~ /(\S+)/; ($e) = grep { $_->{label} eq $1 } @{$b->{entries}}; } my %old_e = %$e; my $default = my $old_default = $e->{label} eq $b->{default}; my @l; if ($e->{type} eq "image") { @l = ( _("Image") => { val => \$e->{kernel_or_dev}, list => [ eval { map { s/$o->{prefix}//; $_ } glob_("$o->{prefix}/boot/vmlinuz*") } ] }, _("Partition") => { val => \$e->{partition}, list => [ map { ("$o->{prefix}/dev/$_->{device}" =~ /\D*(\d*)/)[0] || 1} @{$o->{fstab}} ], not_edit => !$::expert }, _("Root") => { val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @{$o->{fstab}} ], not_edit => !$::expert }, _("Append") => \$e->{append}, _("Initrd") => { val => \$e->{initrd}, list => [ eval { map { s/$o->{prefix}//; $_ } glob_("$o->{prefix}/boot/initrd*") } ] }, _("Read-write") => { val => \$e->{'read-write'}, type => 'bool' } ); @l = @l[0..7] unless $::expert; } else { @l = ( _("Root") => { val => \$e->{kernel_or_dev}, list => [ map { "/dev/$_->{device}" } @{$o->{fstab}} ], not_edit => !$::expert }, ); } @l = ( _("Label") => \$e->{label}, @l, _("Default") => { val => \$default, type => 'bool' }, ); if ($o->ask_from_entries_refH($c eq "Add" ? '' : ['', _("Ok"), _("Remove entry")], '', \@l, complete => sub { $e->{label} or $o->ask_warn('', _("Empty label not allowed")), return 1; member($e->{label}, map { $_->{label} } grep { $_ != $e } @{$b->{entries}}) and $o->ask_warn('', _("This label is already in use")), return 1; 0; })) { $b->{default} = $old_default || $default ? $default && $e->{label} : $b->{default}; require silo; silo::configure_entry($o->{prefix}, $e); $c eq 'Add' and push @{$b->{entries}}, $e; } else { @{$b->{entries}} = grep { $_ != $e } @{$b->{entries}}; } } eval { $o->SUPER::setupBootloader }; if ($@) { $o->ask_warn('', [ _("Installation of SILO failed. The following error occured:"), grep { !/^Warning:/ } cat_("$o->{prefix}/tmp/.error") ]); unlink "$o->{prefix}/tmp/.error"; die "already displayed"; } } #------------------------------------------------------------------------------ sub setupBootloaderBefore { my ($o) = @_; my $w = $o->wait_message('', _("Preparing bootloader")); $o->SUPER::setupBootloaderBefore($o); } #------------------------------------------------------------------------------ sub setupBootloader { my ($o) = @_; if (arch() =~ /^alpha/) { $o->ask_yesorno('', _("Do you want to use aboot?"), 1) or return; catch_cdie { $o->SUPER::setupBootloader } sub { $o->ask_yesorno('', _("Error installing aboot, try to force installation even if that destroys the first partition?")); }; } elsif (arch() =~ /^sparc/) { &setupSILO; } else { &setupLILO; } } #------------------------------------------------------------------------------ sub miscellaneousNetwork { my ($o, $clicked) = @_; my $u = $o->{miscellaneous} ||= {}; $o->set_help('configureNetworkProxy'); !$::beginner || $clicked and $o->ask_from_entries_ref('', _("Proxies configuration"), [ _("HTTP proxy"), _("FTP proxy"), ], [ \$u->{http_proxy}, \$u->{ftp_proxy}, ], complete => sub { $u->{http_proxy} =~ m,^($|http://), or $o->ask_warn('', _("Proxy should be http://...")), return 1,3; $u->{ftp_proxy} =~ m,^($|ftp://), or $o->ask_warn('', _("Proxy should be ftp://...")), return 1,4; 0; } ) || return; } #------------------------------------------------------------------------------ sub miscellaneous { my ($o, $clicked) = @_; my %l = ( 0 => _("Welcome To Crackers"), 1 => _("Poor"), 2 => _("Low"), 3 => _("Medium"), 4 => _("High"), 5 => _("Paranoid"), ); delete @l{0,1,5} unless $::expert; install_steps::miscellaneous($o); my $u = $o->{miscellaneous} ||= {}; exists $u->{LAPTOP} or $u->{LAPTOP} = 1; my $s = $o->{security}; add2hash_ $o, { useSupermount => $s < 4 && arch() !~ /^sparc/ }; $s = $l{$s} || $s; !$::beginner || $clicked and $o->ask_from_entries_refH('', _("Miscellaneous questions"), [ _("Use hard drive optimisations?") => { val => \$u->{HDPARM}, type => 'bool', text => _("(may cause data corruption)") }, _("Choose security level") => { val => \$s, list => [ map { $l{$_} } ikeys %l ], not_edit => 1 }, _("Precise RAM size if needed (found %d MB)", availableRam / 1024 + 3) => \$u->{memsize}, #- add three for correction. arch() !~ /^sparc/ ? ( _("Removable media automounting") => { val => \$o->{useSupermount}, type => 'bool', text => 'supermount' }, ) : (), $::expert ? ( _("Clean /tmp at each boot") => { val => \$u->{CLEAN_TMP}, type => 'bool' }, ) : (), $o->{pcmcia} && $::expert ? ( _("Enable multi profiles") => { val => \$u->{profiles}, type => 'bool' }, ) : ( _("Enable num lock at startup") => { val => \$u->{numlock}, type => 'bool' }, ), ], complete => sub { !$u->{memsize} || $u->{memsize} =~ s/^(\d+)M?$/$1M/i or $o->ask_warn('', _("Give the ram size in MB")), return 1; my %m = reverse %l; $ENV{SECURE_LEVEL} = $o->{security} = $m{$s}; $o->{useSupermount} && $o->{security} > 3 and $o->ask_warn('', _("Can't use supermount in high security level")), return 1; $o->{security} == 5 and $o->ask_okcancel('', _("beware: IN THIS SECURITY LEVEL, ROOT LOGIN AT CONSOLE IS NOT ALLOWED! If you want to be root, you have to login as a user and then use \"su\". More generally, do not expect to use your machine for anything but as a server. You have been warned.")) || return; 0; } ) || return; } #------------------------------------------------------------------------------ sub setupXfree { my ($o) = @_; $o->setupXfreeBefore; require Xconfig; require Xconfigurator; #- by default do not use existing configuration, so new card will be detected. if ($o->{isUpgrade} && -r "$o->{prefix}/etc/X11/XF86Config") { if ($::beginner || $o->ask_yesorno('', _("Use existing configuration for X11?"), 1)) { Xconfig::getinfoFromXF86Config($o->{X}, $o->{prefix}); } } $::xf4 = $o->ask_yesorno('', _("DrakX will generate config files for both XFree 3.3 and XFree 4.0. By default, the 3.3 server is used because it works on more graphic cards. Do you want to try XFree 4.0?")) if $::expert && arch() != /sparc/; #- strange, xfs must not be started twice... #- trying to stop and restart it does nothing good too... my $xfs_started if 0; run_program::rooted($o->{prefix}, "/etc/rc.d/init.d/xfs", "start") unless $xfs_started; $xfs_started = 1; { local $::testing = 0; #- unset testing local $::auto = $::beginner; local $::noauto = $::expert && !$o->ask_yesorno('', _("Try to find PCI devices?"), 1); local $::skiptest = $::oo->{oem}; #- if lang is forced, assume no test (HACK) $::noauto = $::noauto; #- no warning Xconfigurator::main($o->{prefix}, $o->{X}, $o, $o->{allowFB}, bool($o->{pcmcia}), sub { $o->pkg_install("XFree86-$_[0]"); }); } $o->setupXfreeAfter; } #------------------------------------------------------------------------------ sub generateAutoInstFloppy($) { my ($o) = @_; $::expert || $::g_auto_install or return; my ($floppy) = detect_devices::floppies(); $o->ask_yesorno('', _("Do you want to generate an auto install floppy for linux replication?"), $floppy) or return; $o->ask_warn('', _("Insert a blank floppy in drive %s", $floppy)); my $dev = devices::make($floppy); my $image = $o->{pcmcia} ? "pcmcia" : ${{ hd => 'hd', cdrom => 'cdrom', ftp => 'network', nfs => 'network', http => 'network' }}{$o->{method}}; if (arch() =~ /sparc/) { $image .= arch() =~ /sparc64/ && "64"; #- for sparc64 there are a specific set of image. 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; my $w = $o->wait_message('', _("Creating auto install floppy")); install_any::getAndSaveFile("$image.img", $imagefile) or log::l("failed to write $dev"), return; devices::make($_) foreach qw(/dev/loop6 /dev/ram); run_program::run("losetup", "/dev/loop6", $imagefile); fs::mount("/dev/loop6", $mountdir, "romfs", 'readonly'); commands::cp("-f", $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"; output "$workdir/ks.cfg", install_any::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 !! ", "7m\n"; local $o->{partitioning}{clearall} = 1; install_any::g_auto_install("$workdir/auto_inst.cfg"); 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); commands::dd("if=/dev/ram", "of=$dev", "bs=1440", "count=1024"); commands::rm("-rf", $workdir, $mountdir, $imagefile); } else { { my $w = $o->wait_message('', _("Creating auto install floppy")); install_any::getAndSaveFile("$image.img", $dev) or log::l("failed to write $dev"), return; } fs::mount($dev, "/floppy", "vfat", 0); substInFile { s/timeout.*//; s/^(\s*append)/$1 kickstart=floppy/ } "/floppy/syslinux.cfg"; unlink "/floppy/help.msg"; output "/floppy/ks.cfg", install_any::generate_ks_cfg($o); output "/floppy/boot.msg", "\n0c", "!! If you press enter, an auto-install is going to start. All data on this computer is going to be lost !! ", "07\n"; local $o->{partitioning}{clearall} = 1; install_any::g_auto_install("/floppy/auto_inst.cfg"); fs::umount("/floppy"); } } #------------------------------------------------------------------------------ sub exitInstall { my ($o, $alldone) = @_; return $o->{step} = '' unless $alldone || $o->ask_yesorno('', _("Some steps are not completed. Do you really want to quit now?"), 0); install_any::unlockCdrom; $o->ask_warn('', _("Congratulations, installation is complete. Remove the boot media and press return to reboot. For information on fixes which are available for this release of Linux-Mandrake, consult the Errata available from http://www.linux-mandrake.com/. Information on configuring your system is available in the post install chapter of the Official Linux-Mandrake User's Guide.")) if $alldone && !$::g_auto_install && !$::oo->{oem}; $::global_wait = $o->wait_message('', _("Shutting down")); } #-###################################################################################### #- Misc Steps Functions #-###################################################################################### #-------------------------------------------------------------------------------- sub wait_load_module { my ($o, $type, $text, $module) = @_; $o->wait_message('', [ _("Installing driver for %s card %s", $type, $text), $::beginner ? () : _("(module %s)", $module) ]); } sub load_module { my ($o, $type) = @_; my @options; my $l = $o->ask_from_list('', _("Which %s driver should I try?", $type), [ modules::text_of_type($type) ]) or return; my $m = modules::text2driver($l); require modparm; my @names = modparm::get_options_name($m); if ((@names != 0) && $o->ask_from_list_('', _("In some cases, the %s driver needs to have extra information to work properly, although it normally works fine without. Would you like to specify extra options for it or allow the driver to probe your machine for the information it needs? Occasionally, probing will hang a computer, but it should not cause any damage.", $l), [ __("Autoprobe"), __("Specify options") ], "Autoprobe") ne "Autoprobe") { ASK: if (@names >= 0) { my @l = $o->ask_from_entries('', _("You may now provide its options to module %s.", $l), \@names) or return; @options = modparm::get_options_result($m, @l); } else { @options = split ' ', $o->ask_from_entry('', _("You may now provide its options to module %s. Options are in format ``name=value name2=value2 ...''. For instance, ``io=0x300 irq=7''", $l), _("Module options:"), ); } } eval { my $w = wait_load_module($o, $type, $l, $m); modules::load($m, $type, @options); }; if ($@) { $o->ask_yesorno('', _("Loading module %s failed. Do you want to try again with other parameters?", $l), 1) or return; goto ASK; } $l; } #------------------------------------------------------------------------------ sub load_thiskind { my ($o, $type) = @_; my $w; #- needed to make the wait_message stay alive my $pcmcia = $o->{pcmcia} unless !$::beginner && modules::pcmcia_need_config($o->{pcmcia}) && !$o->ask_yesorno('', _("Try to find PCMCIA cards?"), 1); $w = $o->wait_message(_("PCMCIA"), _("Configuring PCMCIA cards...")) if modules::pcmcia_need_config($pcmcia); modules::load_thiskind($type, sub { $w = wait_load_module($o, $type, @_) }, $pcmcia); } #------------------------------------------------------------------------------ sub setup_thiskind { my ($o, $type, $auto, $at_least_one) = @_; return if arch() eq "ppc"; my @l; my $allow_probe = !$::expert || $o->ask_yesorno('', _("Try to find %s devices?", "PCI" . (arch() =~ /sparc/ && "/SBUS")), 1); if ($allow_probe) { eval { @l = grep { !/ide-/ } $o->load_thiskind($type) }; $o->ask_warn('', $@) if $@; return if $auto && (@l || !$at_least_one); } while (1) { my $msg = @l ? [ _("Found %s %s interfaces", join(", ", @l), $type), _("Do you have another one?") ] : _("Do you have any %s interfaces?", $type); my $opt = [ __("Yes"), __("No") ]; push @$opt, __("See hardware info") if $::expert; my $r = "Yes"; $r = $o->ask_from_list_('', $msg, $opt, "No") unless $at_least_one && @l == 0; if ($r eq "No") { return } elsif ($r eq "Yes") { push @l, $o->load_module($type) || next; } else { #-eval { commands::modprobe("isapnp") }; require pci_probing::main; require sbus_probing::main; $o->ask_warn('', [ pci_probing::main::list(), sbus_probing::main::list() ]); #-, scalar cat_("/proc/isapnp") ]); } } } sub upNetwork { my ($o, $pppAvoided) = @_; my $w = $o->wait_message('', _("Bringing up the network")); install_steps::upNetwork($o, $pppAvoided); } sub downNetwork { my ($o, $pppOnly) = @_; my $w = $o->wait_message('', _("Bringing down the network")); install_steps::downNetwork($o, $pppOnly); } #-###################################################################################### #- Wonderful perl :( #-###################################################################################### 1;