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
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
|
#!/bin/sh
#
# Copyright 1994, 1998, 1999 Patrick Volkerding, Moorhead, Minnesota USA
# Copyright 2002, 2003 Slackware Linux, Inc, Concord, CA
# Copyright 2007, 2008, 2011 Patrick Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
TMP=/var/log/setup/tmp
CONSOLETYPE=standard
unset UTFVT
# Set the OS root directory (called T_PX for some unknown reason).
# If an argument is given to this script and it is a directory, it
# is taken to be the root directory. First though, we check for a
# directory named $T_PX, and that gets the first priority.
if [ ! -d "$T_PX" ]; then
if [ ! "$1" = "" ]; then
if [ -d "$1" ]; then
T_PX="$1"
fi
else
# Are we on the installer image?
if [ -r /usr/lib/setup/SeTpartitions ]; then
T_PX=/mnt
# Or, are we on a running system?
elif [ -r /etc/slackware-version ]; then
T_PX=/
# One more installer-likely thing:
elif [ -r /usr/lib/setup/setup ]; then
T_PX=/mnt
else
# We will have to assume we're on an installed and running system.
T_PX=/
fi
fi
fi
# Determine LILO documentation directory:
LILODOCDIR="$(ls -d /usr/doc/lilo-* | tail -n 1)"
if [ ! -d "$LILODOCDIR" ]; then
LILODOCDIR="/usr/doc/lilo/"
fi
# If there's no boot_message.txt, start the header for one now:
if [ ! -r $T_PX/boot/boot_message.txt ]; then
cat << EOF > $T_PX/boot/boot_message.txt
Welcome to the LILO Boot Loader!
Please enter the name of the partition you would like to boot
at the prompt below. The choices are:
EOF
fi
# The default install location may be set here:
DEFAULT=" --default-item MBR "
# This is a different 'probe' than the function below.
PROBE() {
if [ -x /sbin/probe ]; then
/sbin/probe -l
elif fdisk -l | grep "Disk /dev/ide" 1> /dev/null 2> /dev/null ; then # no devfs yet
for devs in /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg \
/dev/hdh /dev/hdi /dev/hdj /dev/hdk /dev/hdl /dev/hdm /dev/hdn /dev/hdo /dev/hdp \
/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi \
/dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp ; do
fdisk -l $devs 2> /dev/null
done
elif fdisk -l | grep "Disk /dev/scsi" 1> /dev/null 2> /dev/null ; then # no devfs yet
for devs in /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg \
/dev/hdh /dev/hdi /dev/hdj /dev/hdk /dev/hdl /dev/hdm /dev/hdn /dev/hdo /dev/hdp \
/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi \
/dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp ; do
fdisk -l $devs 2> /dev/null
done
elif [ -z "`fdisk -l`" ]; then
for devs in /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg \
/dev/hdh /dev/hdi /dev/hdj /dev/hdk /dev/hdl /dev/hdm /dev/hdn /dev/hdo /dev/hdp \
/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi \
/dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp ; do
fdisk -l $devs 2> /dev/null
done
else # We got output without /dev/ide or /dev/scsi, so it can probably be trusted:
fdisk -l 2> /dev/null
fi
}
# Function to ask if the Slackware logo boot screen should be used.
ask_boot_splash() {
dialog --title "OPTIONAL SLACKWARE LOGO BOOT SCREEN" \
--yesno \
"Would you like to use a boot screen with the Slackware logo \
against a black background? If you answer no here, the standard \
LILO menu will be used.\n\
" 7 65 2> $TMP/reply
RETVAL=$?
return $RETVAL
}
boot_bmp() {
cat << EO_BMP
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
EO_BMP
}
# Menu to check if we want to use VESA framebuffer support:
use_framebuffer() {
if cat /proc/devices | grep "29 fb" 1> /dev/null ; then
dialog --title "CONFIGURE LILO TO USE FRAME BUFFER CONSOLE?" \
--default-item standard \
--menu "Looking at /proc/devices, it seems your kernel has support for \
the VESA frame buffer console. If we enable this in /etc/lilo.conf, it \
will allow more rows and columns of text on the screen and give you a cool \
penguin logo at boot time. However, the frame buffer text console is \
slower than a standard text console. In addition, not every video card \
or monitor supports all of these video modes, and some X drivers could be \
confused by them. Would you like to use the frame buffer console, \
or the standard Linux console?" 0 0 0 \
"standard" "Use the standard Linux console (the safe choice)" \
"ask" "Ask about using VESA modes at boot; time out to standard" \
"640x480x64k" "Frame buffer console, 640x480x64k" \
"800x600x64k" "Frame buffer console, 800x600x64k" \
"1024x768x64k" "Frame buffer console, 1024x768x64k" \
"640x480x32k" "Frame buffer console, 640x480x32k" \
"800x600x32k" "Frame buffer console, 800x600x32k" \
"1024x768x32k" "Frame buffer console, 1024x768x32k" \
"640x480x256" "Frame buffer console, 640x480x256" \
"800x600x256" "Frame buffer console, 800x600x256" \
"1024x768x256" "Frame buffer console, 1024x768x256" \
2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
exit
fi
# Frame buffer modes above 1024x768 look terrible except
# on LCD panels, and 32 bit color is slow. Since we don't
# even need to run a framebuffer console to run framebuffer
# X anymore, these modes aren't of much real use.
# "1280x1024x256" "Frame buffer console, 1280x1024x256" \
# "1600x1200x256" "Frame buffer console, 1600x1200x256" \
# "1280x1024x32k" "Frame buffer console, 1280x1024x32k" \
# "1600x1200x32k" "Frame buffer console, 1600x1200x32k" \
# "1280x1024x64k" "Frame buffer console, 1280x1024x64k" \
# "1600x1200x64k" "Frame buffer console, 1600x1200x64k" \
# "640x480x16m" "Frame buffer console, 640x480x16.8m" \
# "800x600x16m" "Frame buffer console, 800x600x16.8m" \
# "1024x768x16m" "Frame buffer console, 1024x768x16.8m" \
# "1280x1024x16m" "Frame buffer console, 1280x1024x16.8m" \
# "1600x1200x16m" "Frame buffer console, 1600x1200x16.8m"
CONSOLETYPE="`cat $TMP/reply`"
if [ "$CONSOLETYPE" = "1600x1200x16m" ]; then
CONSOLENUM=799
elif [ "$CONSOLETYPE" = "1600x1200x64k" ]; then
CONSOLENUM=798
elif [ "$CONSOLETYPE" = "1600x1200x32k" ]; then
CONSOLENUM=797
elif [ "$CONSOLETYPE" = "1600x1200x256" ]; then
CONSOLENUM=796
elif [ "$CONSOLETYPE" = "1280x1024x16m" ]; then
CONSOLENUM=795
elif [ "$CONSOLETYPE" = "1280x1024x64k" ]; then
CONSOLENUM=794
elif [ "$CONSOLETYPE" = "1280x1024x32k" ]; then
CONSOLENUM=793
elif [ "$CONSOLETYPE" = "1280x1024x256" ]; then
CONSOLENUM=775
elif [ "$CONSOLETYPE" = "1024x768x16m" ]; then
CONSOLENUM=792
elif [ "$CONSOLETYPE" = "1024x768x64k" ]; then
CONSOLENUM=791
elif [ "$CONSOLETYPE" = "1024x768x32k" ]; then
CONSOLENUM=790
elif [ "$CONSOLETYPE" = "1024x768x256" ]; then
CONSOLENUM=773
elif [ "$CONSOLETYPE" = "800x600x16m" ]; then
CONSOLENUM=789
elif [ "$CONSOLETYPE" = "800x600x64k" ]; then
CONSOLENUM=788
elif [ "$CONSOLETYPE" = "800x600x32k" ]; then
CONSOLENUM=787
elif [ "$CONSOLETYPE" = "800x600x256" ]; then
CONSOLENUM=771
elif [ "$CONSOLETYPE" = "640x480x16m" ]; then
CONSOLENUM=786
elif [ "$CONSOLETYPE" = "640x480x64k" ]; then
CONSOLENUM=785
elif [ "$CONSOLETYPE" = "640x480x32k" ]; then
CONSOLENUM=784
elif [ "$CONSOLETYPE" = "640x480x256" ]; then
CONSOLENUM=769
fi
fi
}
# A function to ask for append= parameters.
ask_append() {
dialog --title "OPTIONAL LILO append=\"<kernel parameters>\" LINE" --inputbox \
"Some systems might require extra parameters to be passed to the kernel. \
If you needed to pass parameters to the kernel when you booted the Slackware \
bootdisk, you'll probably want to enter the same ones here. Most \
systems won't require any extra parameters. If you don't need any, just \
hit ENTER to continue.\n\
" 12 72 2> $TMP/reply
RETVAL=$?
return $RETVAL
}
ask_utf() {
if [ "$(uname -r | cut -f 3 -d .)" -gt "23" ]; then
dialog --defaultno --title "USE UTF-8 TEXT CONSOLE?" --yesno \
"Beginning with the 2.6.24 kernel, the text consoles default to UTF-8 mode. \
Unless you are using a UTF-8 locale (\$LANG setting), using the old default \
of a non-UTF text console is safer until some issues with various console \
programs are addressed. This option has no effect on the use of UTF-8 with X. \
\"No\" is the safe choice here." 10 70
fi
}
# This function scans for bootable partitions (making some assumptions along
# the way which may or may not be correct, but usually work), and sets up
# LILO in either the superblock, or the MBR.
simplelilo()
{
use_framebuffer;
ask_append;
if [ $? = 1 -o $? = 255 ]; then
APPEND=""
fi
APPEND="`cat $TMP/reply`"
ask_utf;
if [ $? = 1 -o $? = 255 ]; then
UTFVT="vt.default_utf8=0"
else
UTFVT="vt.default_utf8=1"
fi
if PROBE -l | grep 'OS/2 Boot Manager' 1> /dev/null 2> /dev/null ; then
dialog --title "OS/2 BOOT MANAGER FOUND" --yesno \
"Your system appears to have Boot Manager, a boot menu system provided \
with OS/2 and Partition Magic. If you like, we can install a very simple \
LILO boot block at the start of your Linux partition. Then, you can \
add the partition to the Boot Manager menu, and you'll be able to use \
Boot Manager to boot Linux. Would you like to install LILO in a Boot \
Manager compatible way?" 11 65
FLAG=$?
if [ ! $FLAG = 0 -a ! $FLAG = 1 ]; then
exit 1
fi
if [ $FLAG = 0 ]; then # yes, use BM
if [ -r $T_PX/etc/lilo.conf ]; then
mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.orig
fi
cat << EOF > $T_PX/etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
#
EOF
if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
echo "# Append any additional kernel parameters:" >> $T_PX/etc/lilo.conf
echo "append=\"$APPEND $UTFVT\"" >> $T_PX/etc/lilo.conf
fi
cat << EOF >> $T_PX/etc/lilo.conf
boot = $ROOT_DEVICE
#delay = 5
EOF
if [ $CONSOLETYPE = standard ]; then
cat << EOF >> $T_PX/etc/lilo.conf
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
EOF
elif [ $CONSOLETYPE = ask ]; then
cat << EOF >> $T_PX/etc/lilo.conf
# Ask for video mode at boot (time out to normal in 30s)
vga = ask
# Normal VGA console
#vga = normal
EOF
else
cat << EOF >> $T_PX/etc/lilo.conf
# VESA framebuffer at $CONSOLETYPE
vga = $CONSOLENUM
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# Normal VGA console
#vga = normal
EOF
fi
cat << EOF >> $T_PX/etc/lilo.conf
# End LILO global section
# Linux root partition section
image = $KERNEL
root = $ROOT_DEVICE
label = Linux
read-only
# End root Linux partition section
EOF
installcolor;
return
fi # Use Boot Manager
fi # Boot Manager detected
# If we got here, we either don't have boot manager or don't want to use it
dialog --title "SELECT LILO DESTINATION" $DEFAULT --menu \
"LILO can be installed to a variety of places:\n\
\n\
1. The superblock of your root Linux partition. (which could\n\
be made the bootable partition with Windows or Linux fdisk, or\n\
booted with a program like OS/2 Boot Manager)\n\
2. A formatted floppy disk.\n\
3. The Master Boot Record of your first hard drive.\n\
\n\
Options 1 and 2 are the safest, but option 1 does require a little\n\
extra work later (setting the partition bootable with fdisk).\n\
Which option would you like?" \
20 72 3 \
"Root" "Install to superblock (not for use with XFS)" \
"Floppy" "Install to a formatted floppy in /dev/fd0 (A:)" \
"MBR" "Install to Master Boot Record" \
2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
exit
fi
TG="`cat $TMP/reply`"
rm -r $TMP/reply
if [ "$TG" = "MBR" ]; then
MBR_TARGET=/dev/sda
echo $MBR_TARGET > $TMP/LILOMBR
cat /proc/partitions | while read LINE ; do
MAJOR="`echo $LINE | cut -f 1 -d ' '`"
MINOR="`echo $LINE | cut -f 2 -d ' '`"
if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
if [ "$MAJOR" = "3" ]; then
MBR_TARGET=/dev/hda
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
MBR_TARGET=/dev/hdc
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
MBR_TARGET=/dev/hde
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
MBR_TARGET=/dev/hdg
echo $MBR_TARGET > $TMP/LILOMBR
fi
fi
done
LILO_TARGET=`cat $TMP/LILOMBR`
elif [ "$TG" = "Root" ]; then
LILO_TARGET=`echo $ROOT_DEVICE`
elif [ "$TG" = "Floppy" ]; then
LILO_TARGET="/dev/fd0"
fi
cat << EOF > $T_PX/etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
EOF
if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
echo "# Append any additional kernel parameters:" >> $T_PX/etc/lilo.conf
echo "append=\"$APPEND $UTFVT\"" >> $T_PX/etc/lilo.conf
fi
cat << EOF >> $T_PX/etc/lilo.conf
boot = $LILO_TARGET
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
EOF
if [ $CONSOLETYPE = standard ]; then
cat << EOF >> $T_PX/etc/lilo.conf
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
EOF
elif [ $CONSOLETYPE = ask ]; then
cat << EOF >> $T_PX/etc/lilo.conf
# Ask for video mode at boot (time out to normal in 30s)
vga = ask
# Normal VGA console
#vga = normal
EOF
else
cat << EOF >> $T_PX/etc/lilo.conf
# VESA framebuffer console @ $CONSOLETYPE
vga = $CONSOLENUM
# Normal VGA console
#vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
EOF
fi
cat << EOF >> $T_PX/etc/lilo.conf
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=787
# VESA framebuffer console @ 800x600x256
#vga=771
# VESA framebuffer console @ 640x480x64k
#vga=785
# VESA framebuffer console @ 640x480x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
EOF
cat << EOF >> $T_PX/etc/lilo.conf
# End LILO global section
EOF
# OK, now let's look for Windows partitions:
DOSP="`PROBE -l | grep "DOS
Win
W95
FAT12
FAT16
HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort`"
DOSP="`echo $DOSP | cut -f 1 -d ' '`"
if [ ! "$DOSP" = "" ]; then
TABLE="`echo $DOSP | cut -b1-8`"
cat << EOF >> $T_PX/etc/lilo.conf
# Windows bootable partition config begins
other = $DOSP
label = Windows
table = $TABLE
# Windows bootable partition config ends
EOF
echo "Windows - (Windows FAT/NTFS partition)" >> $T_PX/boot/boot_message.txt
fi
# Next, we search for Linux partitions:
LNXP="`PROBE -l | grep "Linux$"`"
LNXP="`echo $LNXP | cut -f 1 -d ' ' | sort`"
if [ ! "$LNXP" = "" ]; then
cat << EOF >> $T_PX/etc/lilo.conf
# Linux bootable partition config begins
image = $KERNEL
root = $ROOT_DEVICE
label = Linux
read-only
# Linux bootable partition config ends
EOF
echo "Linux - (Linux partition)" >> $T_PX/boot/boot_message.txt
fi
# DEAD CODE, BUT IN CASE OS/2 MAKES A COMEBACK!
# # OK, hopefully we can remember how to deal with OS/2 :^)
# OS2P="`PROBE -l | grep "HPFS"`"
# OS2P="`echo $OS2P | cut -f 1 -d ' ' | sort`"
# if [ ! "$OS2P" = "" ]; then
# TABLE="`echo $OS2P | cut -b1-8`"
# if [ "$TABLE" = "/dev/hda" ]; then
# cat << EOF >> $T_PX/etc/lilo.conf
## OS/2 bootable partition config begins
#other = $OS2P
# label = OS2
# table = $TABLE
## OS/2 bootable partition config ends
#EOF
# else
# cat << EOF >> $T_PX/etc/lilo.conf
## OS/2 bootable partition config begins
#other = $OS2P
# label = OS2
# table = $TABLE
# loader = /boot/os2_d.b
## map-drive = 0x80
## to = 0x81
## map-drive = 0x81
## to = 0x80
## OS/2 bootable partition config ends
#EOF
# echo "OS2 - OS/2 Warp (HPFS partition)" >> $T_PX/boot/boot_message.txt
# fi
# fi
echo >> $T_PX/boot/boot_message.txt
# Done, now we must install lilo:
installcolor;
}
checkp_text()
{
if [ ! -r $1 ]; then
echo
echo "I can't find a device named '$1'!"
echo
echo -n "Are you sure you want to use this device name [y]es, [n]o? "
read use_device;
if [ ! "$use_device" = "y" ]; then
return 1;
fi
return 0;
fi
}
checkp_dialog()
{
if [ ! -r $1 ]; then
dialog --title "DEVICE FILE NOT FOUND" --yesno "I can't find a \
device named '$1'. Are you sure you want to use this device \
name?" 7 60
return $?;
fi
}
checkbootsplash()
{
if [ "$(uname -m)" = "x86_64" ]; then
if [ -r $LILODOCDIR/sample/slack64.bmp ]; then
cp -a $LILODOCDIR/sample/slack64.bmp /boot/slack.bmp
fi
else
if [ -r $LILODOCDIR/sample/slack.bmp ]; then
cp -a $LILODOCDIR/sample/slack.bmp /boot/slack.bmp
fi
fi
if [ -r $HOME/1337 ]; then
if [ -r $LILODOCDIR/sample/sl1337.bmp ]; then
cp -a $LILODOCDIR/sample/sl1337.bmp /boot/slack.bmp
fi
fi
# Thanks to amrit@slackware.com:
if grep -wq 13.37.0 /etc/slackware-version ; then
if ls -l /etc/lilo.conf | grep -q 13:37 ; then
if [ -r $LILODOCDIR/sample/sl1337.bmp ]; then
cp -a $LILODOCDIR/sample/sl1337.bmp /boot/slack.bmp
fi
fi
fi
}
installcolor()
{
checkbootsplash;
dialog --infobox "\nInstalling the Linux Loader..." 5 40
if [ "$T_PX" = "/" ]; then
lilo 1> /dev/null 2> /etc/lilo-error.$$
SUCCESS=$?
else
lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /etc/lilo-error.$$
SUCCESS=$?
fi
if [ ! "$SUCCESS" = "0" ]; then # edit file to try lba32 mode:
cat $T_PX/etc/lilo.conf | while read line ; do
echo $line
if [ "$line" = "# Start LILO global section" ] ; then
echo "lba32 # Allow booting past 1024th cylinder with a recent BIOS"
fi
done > $T_PX/etc/lilo.conf.lba32
mv $T_PX/etc/lilo.conf.lba32 $T_PX/etc/lilo.conf
if [ "$T_PX" = "/" ]; then
lilo 1> /dev/null 2> /etc/lilo-error.$$
SUCCESS=$?
else
lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /etc/lilo-error.$$
SUCCESS=$?
fi
fi
sleep 1
if [ ! "$SUCCESS" = "0" ]; then # some LILO error occured
echo >> /etc/lilo-error.$$
cat << EOF >> /etc/lilo-error.$$
Sorry, but the attempt to install LILO has returned an error, so LILO \
has not been correctly installed. You'll have to use a bootdisk \
to start your \
machine instead. It should still be possible to get LILO working by \
editing the /etc/lilo.conf and reinstalling LILO manually. See the \
LILO man page and documentation in $LILODOCDIR for more help. \
The error message may be seen above.
EOF
dialog --msgbox "$(cat /etc/lilo-error.$$)" 0 0
fi
}
installtext()
{
checkbootsplash;
echo "Installing the Linux Loader..."
if [ "$T_PX" = "/" ]; then
lilo
SUCCESS=$?
else
lilo -r $T_PX -m /boot/map -C /etc/lilo.conf
SUCCESS=$?
fi
if [ ! "$SUCCESS" = "0" ]; then # try lba32 mode:
cat $T_PX/etc/lilo.conf | while read line ; do
echo $line
if [ "$line" = "# Start LILO global section" ] ; then
echo "lba32 # Allow booting past 1024th cylinder with a recent BIOS"
fi
done > $T_PX/etc/lilo.conf.lba32
mv $T_PX/etc/lilo.conf.lba32 $T_PX/etc/lilo.conf
if [ "$T_PX" = "/" ]; then
lilo 1> /dev/null 2> /dev/null
SUCCESS=$?
else
lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /dev/null
SUCCESS=$?
fi
fi
sleep 1
if [ ! "$SUCCESS" = "0" ]; then # some LILO error occured
cat << EOF
LILO INSTALL ERROR # $SUCCESS
Sorry, but the attempt to install LILO has returned an error, so LILO
has not been correctly installed. You'll have to use a bootdisk to
start your machine instead. It should still be possible to get LILO
working by editing the /etc/lilo.conf and reinstalling LILO manually.
See the LILO man page and documentation in $LILODOCDIR for more
help.
EOF
fi
}
# 'probe()' borrowed from LILO QuickInst.
probe()
{
[ ! -z "`dd if=$1 bs=1 count=1 2>/dev/null | tr '\0' x`" ]
return
}
# Figure out if we're installing from the hard drive
if [ -r $TMP/SeTT_PX ]; then
T_PX="`cat $TMP/SeTT_PX`"
else
if [ "$T_PX" = "" -a ! "$1" = "" ]; then
T_PX=$1
else
T_PX=/
fi
fi
HDR="no" # this means the header section of /etc/lilo.conf has not yet
# been configured
LNX="no" # this means no Linux partition has been defined as bootable
# through LILO. Both of these must change to "yes" before LILO will
# install from this script.
# Determine the root partition (such as /dev/hda2)
ROOT_DEVICE=$2
if [ "$ROOT_DEVICE" = "" ]; then
if [ -r $TMP/SeTrootdev ]; then
ROOT_DEVICE="`cat $TMP/SeTrootdev`"
else
ROOT_DEVICE="`mount | cut -f 1 -d " " | sed -n "1 p"`"
fi
fi
# Figure out where the kernel is:
ARCHTYPE=i386
if [ -r $T_PX/vmlinuz ]; then
KERNEL=/vmlinuz
elif [ -r $T_PX/boot/vmlinuz ]; then
KERNEL=/boot/vmlinuz
elif [ -r $T_PX/usr/src/linux/arch/$ARCHTYPE/boot/bzImage ]; then
KERNEL=/usr/src/linux/arch/$ARCHTYPE/boot/bzImage
elif [ -r $T_PX/usr/src/linux/arch/$ARCHTYPE/boot/zImage ]; then
KERNEL=/usr/src/linux/arch/$ARCHTYPE/boot/zImage
else
exit 99 # no kernel? guess you couldn't read. bye bye.
fi
# If we're installing from the umsdos.gz rootdisk, suggest skipping LILO:
if [ ! "$T_PX" = "/" ]; then
if mount | grep " on /mnt " | grep umsdos 1> /dev/null 2> /dev/null ; then
dialog --title "SKIP LILO CONFIGURATION? (RECOMMENDED)" --yesno "Since \
you are installing to a FAT partition, it's suggested that you do not \
configure LILO at this time. (Instead, use your bootdisk. For booting \
off the hard drive from MS-DOS, you can use Loadlin. You'll find \
Loadlin on your hard drive in \LINUX\ROOT) Skip LILO configuration \
(highly recommended)?" 10 70
if [ $? = 0 ]; then
exit
fi
fi
fi
# OK, now let's see if we should automate things:
dialog --title "INSTALL LILO" --menu "LILO (Linux Loader) is a generic \
boot loader. There's a simple installation which tries to automatically \
set up LILO to boot Linux (also Windows if found). For \
more advanced users, the expert option offers more control over the \
installation process. Since LILO does not work in all cases (and can \
damage partitions if incorrectly installed), there's the third (safe) \
option, which is to skip installing LILO for now. You can always install \
it later with the 'liloconfig' command. Which option would you like?" \
18 67 3 \
"simple" "Try to install LILO automatically" \
"expert" "Use expert lilo.conf setup menu" \
"skip" "Do not install LILO" 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
exit
fi
REPLY="`cat $TMP/reply`"
rm -f $TMP/reply
if [ "$REPLY" = "skip" ]; then
exit
elif [ "$REPLY" = "simple" ]; then
# Do simple LILO setup
simplelilo
exit
fi
# drop through to last option: (use the expert menus)
while [ 0 ]; do
dialog --title "EXPERT LILO INSTALLATION" --menu \
"This menu directs the creation of the LILO config file, lilo.conf. \
To install, you make a new LILO configuration file by creating a new header \
and then adding one or more bootable partitions to the file. Once you've done \
this, you can select the install option. Alternately, if you already have an \
/etc/lilo.conf, you may reinstall using that. If you make a mistake, you can \
always start over by choosing 'Begin'. \
Which option would you like?" 21 73 8 \
"Begin" "Start LILO configuration with a new LILO header" \
"Linux" "Add a Linux partition to the LILO config" \
"Windows" "Add a Windows FAT or NTFS partition to the LILO config" \
"Install" "Install LILO" \
"Recycle" "Reinstall LILO using the existing lilo.conf" \
"Skip" "Skip LILO installation and exit this menu" \
"View" "View your current /etc/lilo.conf" \
"Help" "Read the Linux Loader HELP file" 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
REPLY="Skip"
else
REPLY="`cat $TMP/reply`"
fi
rm -r $TMP/reply
if [ "$REPLY" = "Begin" ]; then
ask_append;
if [ $? = 1 -o $? = 255 ]; then
APPEND=""
HDR="no"
continue;
else
APPEND="`cat $TMP/reply`"
fi
ask_utf;
if [ $? = 1 -o $? = 255 ]; then
UTFVT="vt.default_utf8=0"
else
UTFVT="vt.default_utf8=1"
fi
use_framebuffer;
dialog --title "SELECT LILO TARGET LOCATION" $DEFAULT --menu "LILO can be installed \
to a variety of places: \
the superblock of your root Linux partition (which could then be made the \
bootable partition with fdisk), a formatted floppy disk, \
or the master boot record of your first hard drive. If you're using \
a boot system such as Boot Manager, you should use the "Root" \
selection. Please pick a target location:" 15 65 3 \
"Root" "Install to superblock (not for use with XFS)" \
"Floppy" "Use a formatted floppy disk in the boot drive" \
"MBR" "Use the Master Boot Record (possibly unsafe)" \
2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
HDR="no"
continue;
else
LNX="no"
TG="`cat $TMP/reply`"
fi
rm -r $TMP/reply
if [ "$TG" = "MBR" ]; then
MBR_TARGET=/dev/sda
echo $MBR_TARGET > $TMP/LILOMBR
cat /proc/partitions | while read LINE ; do
MAJOR="`echo $LINE | cut -f 1 -d ' '`"
MINOR="`echo $LINE | cut -f 2 -d ' '`"
if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
if [ "$MAJOR" = "3" ]; then
MBR_TARGET=/dev/hda
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
MBR_TARGET=/dev/hdc
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
MBR_TARGET=/dev/hde
echo $MBR_TARGET > $TMP/LILOMBR
elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
MBR_TARGET=/dev/hdg
echo $MBR_TARGET > $TMP/LILOMBR
fi
fi
done
LILO_TARGET=`cat $TMP/LILOMBR`
dialog --title "CONFIRM LOCATION TO INSTALL LILO" --inputbox \
"The auto-detected location to install the LILO boot block is shown below. \
If you need to make any changes, you can make them below. Otherwise, hit \
ENTER to accept the target location shown." 11 60 $LILO_TARGET 2> $TMP/reply
if [ $? = 0 ]; then
LILO_TARGET="`cat $TMP/reply`"
fi
rm -f $TMP/reply
elif [ "$TG" = "Root" ]; then
LILO_TARGET=`echo $ROOT_DEVICE`
elif [ "$TG" = "Floppy" ]; then
LILO_TARGET="/dev/fd0"
else
HDR="no"
continue;
fi
dialog --title "CHOOSE LILO TIMEOUT" --menu "At boot time, how long would \
you like LILO to wait for you to select an operating system? If you \
let LILO time out, it will boot the first OS in the configuration file by \
default." 13 74 4 \
"None" "Don't wait at all - boot straight into the first OS" \
"5" "5 seconds" \
"30" "30 seconds" \
"Forever" "Present a prompt and wait until a choice is made" 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
HDR="no"
continue;
else
TIMEOUT="`cat $TMP/reply`"
fi
rm -r $TMP/reply
if [ "$TIMEOUT" = "None" ]; then
PROMPT="#prompt"
TIMEOUT="#timeout = 5"
elif [ "$TIMEOUT" = "5" ]; then
PROMPT="prompt"
TIMEOUT="timeout = 50"
elif [ "$TIMEOUT" = "30" ]; then
PROMPT="prompt"
TIMEOUT="timeout = 300"
elif [ "$TIMEOUT" = "Forever" ]; then
PROMPT="prompt"
TIMEOUT="#timeout = 300"
else
HDR="no"
continue;
fi
cat << EOF > $TMP/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = $LILO_TARGET
#compact # faster, but won't work on all systems.
EOF
# Boot splash
if [ "$PROMPT" = "prompt" ]; then
if ask_boot_splash ; then
boot_bmp >> $TMP/lilo.conf
cat << EOF >> $TMP/lilo.conf
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
EOF
fi
else
cat << EOF >> $TMP/lilo.conf
# Standard menu.
message = /boot/boot_message.txt
EOF
fi
if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
echo "# Append any additional kernel parameters:" >> $TMP/lilo.conf
echo "append=\"$APPEND $UTFVT\"" >> $TMP/lilo.conf
fi
cat << EOF >> $TMP/lilo.conf
$PROMPT
$TIMEOUT
EOF
if [ "$CONSOLETYPE" = "standard" ]; then
cat << EOF >> $TMP/lilo.conf
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
EOF
elif [ "$CONSOLETYPE" = "ask" ]; then
cat << EOF >> $TMP/lilo.conf
# Ask for video mode at boot (time out to normal in 30s)
vga = ask
# Normal VGA console
#vga = normal
EOF
else
cat << EOF >> $TMP/lilo.conf
# VESA framebuffer console @ $CONSOLETYPE
vga = $CONSOLENUM
# Normal VGA console
#vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
EOF
fi
cat << EOF >> $TMP/lilo.conf
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
EOF
cat << EOF >> $TMP/lilo.conf
# ramdisk = 0 # paranoia setting
# End LILO global section
EOF
HDR="yes"
elif [ "$REPLY" = "Linux" ]; then
if [ "$HDR" = "yes" ]; then
if [ "$ROOT_DEVICE" != "" ]; then
DEFROOT="--default-item $ROOT_DEVICE"
fi
echo "dialog --title \"SELECT LINUX PARTITION\" $DEFROOT --menu \\" > $TMP/tmpmsg
echo "\"Which Linux partition would you like LILO to boot?\n\
\n\
Partition Start End Sectors ID\" 22 74 13 \\" >> $TMP/tmpmsg
PROBE -l 2> /dev/null | grep "Linux$" | sort | while read STR; do
STR1="$(echo -n "$STR" | cut -f 1 -d ' ')"
STR2="$(echo -n "$STR" | cut -f 2- -d ' ')"
echo "\"$STR1\" \"$STR2\" \\" >> $TMP/tmpmsg
done
echo "2> $TMP/reply" >> $TMP/tmpmsg
. $TMP/tmpmsg
if [ $? = 1 -o $? = 255 ]; then
rm $TMP/tmpmsg
continue
fi
rm $TMP/tmpmsg
LINUX_PART="`cat $TMP/reply`"
checkp_dialog $LINUX_PART
if [ ! $? = 0 ]; then
continue;
fi
dialog --title "SELECT PARTITION NAME FOR $LINUX_PART" --inputbox \
"Now you must select a short, unique name for this partition. \
You'll use this name if you specify a partition to boot at the \
LILO prompt. 'Linux' might not be a bad choice. THIS MUST BE A \
SINGLE WORD." 11 60 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
continue
fi
LABEL="`cat $TMP/reply`"
cat << EOF >> $TMP/lilo.conf
# Linux bootable partition config begins
image = $KERNEL
root = $LINUX_PART
label = $LABEL
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
EOF
else
dialog --title "CAN'T ADD LINUX PARTITION" --msgbox "You can't add \
partitions unless you start over with a new LILO header." 6 60
continue
fi
LNX="yes"
# MORE OS/2 DEAD CODE... DOESN'T HURT.
# THIS ITEM HAS LONG BEEN REMOVED FROM THE MENU...
elif [ "$REPLY" = "OS/2" ]; then
if [ "$HDR" = "yes" ]; then
echo "These are possibly OS/2 partitions. They will be treated" > $TMP/tmpmsg
echo "as such if you install them using this menu." >> $TMP/tmpmsg
echo >> $TMP/tmpmsg
echo " Device Boot Start End Blocks Id System" >> $TMP/tmpmsg
PROBE -l | grep DOS | sort >> $TMP/tmpmsg
PROBE -l | grep HPFS | sort >> $TMP/tmpmsg
echo >> $TMP/tmpmsg
echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
dialog --title "SELECT OS/2 PARTITION" --no-collapse --inputbox \
"`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
rm $TMP/tmpmsg
continue
fi
rm $TMP/tmpmsg
OS_2_PART="`cat $TMP/reply`"
checkp_dialog $OS_2_PART
if [ ! $? = 0 ]; then
continue;
fi
dialog --title "SELECT PARTITION NAME" --inputbox \
"Now you must select a short, unique name for this partition. \
You'll use this name if you specify a partition to boot at the \
LILO prompt. 'OS/2' might not be a bad choice. THIS MUST BE A \
SINGLE WORD." 11 60 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
continue
fi
LABEL="`cat $TMP/reply`"
TABLE="`echo $OS_2_PART | cut -b1-8`"
if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
cat << EOF >> $TMP/lilo.conf
# OS/2 bootable partition config begins
other = $OS_2_PART
label = $LABEL
table = $TABLE
# OS/2 bootable partition config ends
EOF
else
cat << EOF >> $TMP/lilo.conf
# OS/2 bootable partition config begins
other = $OS_2_PART
label = $LABEL
table = $TABLE
loader = /boot/os2_d.b
# map-drive = 0x80
# to = 0x81
# map-drive = 0x81
# to = 0x80
# OS/2 bootable partition config ends
EOF
fi
else
dialog --title "CAN'T ADD OS/2 PARTITION" --msgbox "You can't add \
partitions unless you start over with a new LILO header." 6 60
continue
fi
LNX="yes"
elif [ "$REPLY" = "Windows" ]; then
if [ "$HDR" = "yes" ]; then
echo "These are possibly Windows or DOS partitions. They will be treated" > $TMP/tmpmsg
echo "as such if you install them using this menu." >> $TMP/tmpmsg
echo >> $TMP/tmpmsg
echo " Device Boot Start End Blocks Id System" >> $TMP/tmpmsg
PROBE -l | grep "DOS
Win
W95
FAT12
FAT16
HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort >> $TMP/tmpmsg
echo >> $TMP/tmpmsg
echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
dialog --title "SELECT WINDOWS PARTITION" --no-collapse --inputbox \
"`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
rm $TMP/tmpmsg
continue
fi
rm $TMP/tmpmsg
DOSPART="`cat $TMP/reply`"
checkp_dialog $DOSPART
if [ ! $? = 0 ]; then
continue;
fi
dialog --title "SELECT PARTITION NAME" --inputbox \
"Now you must select a short, unique name for this partition. \
You'll use this name if you specify a partition to boot at the \
LILO prompt. 'Windows' might not be a bad choice. THIS MUST BE A \
SINGLE WORD." 11 60 2> $TMP/reply
if [ $? = 1 -o $? = 255 ]; then
continue
fi
LABEL="`cat $TMP/reply`"
unset USE_LOADER
TABLE="`echo $DOSPART | cut -b1-8`"
if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
USE_LOADER="no"
fi
if [ "`echo $TABLE | cut -b6-8`" = "sda" ]; then
if probe /dev/hda; then
USE_LOADER="yes"
else
USE_LOADER="no"
fi
fi
if [ "$USE_LOADER" = "no" ]; then
cat << EOF >> $TMP/lilo.conf
# Windows bootable partition config begins
other = $DOSPART
label = $LABEL
table = $TABLE
# Windows bootable partition config ends
EOF
else
cat << EOF >> $TMP/lilo.conf
# Windows bootable partition config begins
other = $DOSPART
label = $LABEL
# map-drive = 0x80
# to = 0x81
# map-drive = 0x81
# to = 0x80
table = $TABLE
# Windows bootable partition config ends
EOF
fi
else
dialog --title "CAN'T ADD WINDOWS PARTITION" --msgbox "You can't add \
partitions unless you start over with a new LILO header." 6 60
continue
fi
LNX="yes"
elif [ "$REPLY" = "Install" -o "$REPLY" = "Recycle" ]; then
if [ "$REPLY" = "Recycle" -a -r $T_PX/etc/lilo.conf ]; then
LNX="yes"
fi
if [ "$LNX" = "no" ]; then
dialog --title "CAN'T INSTALL LILO" --msgbox "LILO could not be \
installed. If you have not created a LILO configuration file by defining \
a new header and adding at least one bootable partition to it, you must do \
so before installing LILO. If you were attempting to use an existing LILO \
configuration file, it could not be found. Try making a new one." 9 70
continue
else
if [ "$REPLY" = "Install" ]; then
if [ -r $TMP/lilo.conf ]; then
if [ -r $T_PX/etc/lilo.conf ]; then
mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.bak
fi
cp $TMP/lilo.conf $T_PX/etc/lilo.conf
chmod 644 $T_PX/etc/lilo.conf
fi
fi
installcolor;
fi
rm -f $TMP/tmpmsg $TMP/reply
break
elif [ "$REPLY" = "Skip" ]; then
rm -f $TMP/tmpmsg $TMP/reply
break
elif [ "$REPLY" = "View" ]; then
if [ -r $TMP/lilo.conf ]; then
dialog --title "YOUR NEW /etc/lilo.conf" --textbox "$TMP/lilo.conf" 22 70
else
if [ -r /mnt/etc/lilo.conf ]; then
dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/mnt/etc/lilo.conf" 22 70
elif [ "$T_PX" = "/" -a -r /etc/lilo.conf ]; then
dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/etc/lilo.conf" 22 70
else
dialog --title "NO CONFIG FILE FOUND" --msgbox "Sorry, but you don't \
have a LILO configuration file that can be viewed." 6 60
fi
fi
elif [ "$REPLY" = "Help" ]; then
dialog --title "LILO INSTALLATION HELP" --textbox "$T_PX/var/log/setup/text.lilohelp" 22 68
fi
done
|