Version 2.26 - 22 May 2015 by Thomas Backlund - use xorriso for proper efi metadata - generate proper efi isohybrid Version 2.25 - 9 May 2015 by Thomas Backlund - update UEFI menu Version 2.24 - 8 May 2015 by Thierry Vignaud - include r8723bs (mga#15874) Version 2.23 - 4 May 2015 by Anne Nicolas - add noiswmd to all entries of isolinux.cfg Version 2.22 - 13 April 2015 by Thierry Vignaud - honor BOOT_AUTOMATIC_METHOD env var for UEFI too - reduce timeout when using BOOT_AUTOMATIC_METHOD env var Version 2.21 - 7 April 2015 by Thomas Backlund - fix finding grub legacy files for hd_grub generation - syslinux needs more space on all.img Version 2.20 - 7 April 2015 by Thomas Backlund - drop nonexistant linuxefi grub2-efi module Version 2.19 - 7 April 2015 by Thomas Backlund - create efi loader at build time Version 2.18 - 6 April 2015 by Anne Nicolas - use noiswmd as default boot option (mga#11105) Version 2.17 - 17 March 2015 by Thierry Vignaud - include virtio_rng Version 2.16 - 28 January 2015 by Thierry Vignaud - sync with kernel-3.19 Version 2.15 - 20 December 2014 by Thierry Vignaud - sync with kernel-3.18 (mga#14799) Version 2.14 - 20 December 2014 by Thierry Vignaud - include new 3.18 USB host drivers (mga#14799) Version 2.13 - 16 December 2014 by Erwan Velu - make_boot_img: Avoid gfxboot install string for chain.c32 - make_boot_img: Using chain.c32 instead of localboot Version 2.12 - 12 December 2014 by Thierry Vignaud - include hv_balloon & hyperv_fb - include virtio_balloon & vmw_balloon as well Version 2.11 - 31 August 2014 by Thierry Vignaud - sync with kernel-3.17 Version 2.10 - 22 August 2014 by Thierry Vignaud - include paravirtual network driver for hyper-v Version 2.9 - 6 August 2014 by Thierry Vignaud - sync with kernel-3.16 Version 2.8 - 15 June 2014 by Thierry Vignaud - include acpi-cpufreq - sync with kernel-3.15 Version 2.7 - 28 April 2014 by Thierry Vignaud - sync with kernel-3.14 Version 2.6 - 16 February 2014 by Thierry Vignaud - sync with kernel-3.13 Version 2.5 - 24 January 2014 by Colin Guthrie - Double syslinux overhead to 256. mga#11795 Version 2.4 - 15 December 2013 by Anne Nicolas - remove buggy control caracters (#11602) - use audit=0 in rescue isolinux config to allow systemd-nspawn to work smoothly Version 2.3 - 2 December 2013 by Thierry Vignaud - include "sdhci-acpi" for eMMC (mga#11812) Version 2.2 - 13 November 2013 by Colin Guthrie - pass the modules we want in modules.alias, but not in the initrd through to dracut via an environment variable - add BOOT_AUTOMATIC_METHOD to inject command line params into boot.iso syslinux Version 2.1 - 5 November 2013 by Colin Guthrie - revert back to static per-arch isolinux.cfg files Version 2.00 - 2 November 2013 by Thomas Backlund - ensure initrd is created with 644 perms (normally 600 for security reasons) - fix 32-bit isolinux wrapper (s/i586/i386) Version 1.95 - 2 November 2013 by Colin Guthrie - omit the dracut network module now that we include our own networking kernel modules - add a dracut.conf rather than adding lots of command line options - ensure initrd is xz compressed - include network modules as specified by kernel/list_modules.pm Version 1.94 - 29 October 2013 by Colin Guthrie - adapt to a dracut based stage1 Version 1.93 - 14 October 2013 by Thierry Vignaud - sync with kernel-3.12 Version 1.92 - 10 October 2013 by Thierry Vignaud - sync with kernel-3.11 (might fix mga#11377) Version 1.91 - 10 October 2013 by Thierry Vignaud - partial sync with kernel-3.11 regarding USB: include ehci-tegra, ohci-pci ohci-platform fusbh200-hcd & usb_common (might fix mga#11377) Version 1.90 - 16 July 2013 by Thierry Vignaud - sync with kernel-3.10 Version 1.89 - 2 June 2013 by Thomas Backlund - fix URL in help message (mga#9772) - sync with kernel-3.9 Version 1.88.1 - 2 March 2013 by Thomas Backlund - update list_modules for xen dom0 and virtio support (#9242) Version 1.88 - 21 January 2013 by Thomas Backlund - update usb host list for kernel 3.8 Version 1.87 - 16 January 2013 by Thomas Backlund - include new kernel 3.8 drivers: o phy: at91_ether, macb, mvmdio o usb: cdc_mbim o wifi: ar5523, rtl8723ae o scsi: mpt3sas o raid; csiostor o hid: hid-icade, hid-roccat-lua o sound: snd-scs1x - do not include firmware loader anywhere Version 1.86 - 10 December 2012 by Thierry Vignaud - include new drivers: o input: hid-sensor-hub o PHY: at803x Version 1.85 - 21 October 2012 by Thomas Backlund - add alx ethernet module (#7853) Version 1.84 - 18 October 2012 by Thierry Vignaud - include new drivers: o HID: hid-roccat-savu, hid-holtek-kbd, hid-lenovo-tpkbd o NFS: nfsv[2-4] o PHY: bcm87xx o WIFI: iwldvm - no more need to fix modules.order Version 1.83 - 17 September 2012 by Thierry Vignaud - fix modules.order so that cciss got detected (mga#5833) - use new hotplug (mga#6323) Version 1.82 - 12 September 2012 by Thierry Vignaud - include overlayfs module instead of unionfs Version 1.81 - 4 September 2012 by Thierry Vignaud - include new drivers: o crypto: aesni_intel o input: hid-aureal synaptics_usb o wifi: qmi_wwan, mwifiex_usb - remove tokenring drivers Version 1.80 - 3 September 2012 by Thierry Vignaud - fix creating some directories when not in debug mode Version 1.79 - 3 September 2012 by Thierry Vignaud - do not include ka stuff unlesse BUILD_KA is set - precreate /sys Version 1.78 - 31 August 2012 by Thierry Vignaud - include new 'hid-generic' driver (mga#7130, #7248) Version 1.77 - 5 June 2012 by Thierry Vignaud - do not include "screen" terminfo anymore Version 1.76 - 1 June 2012 by Thierry Vignaud - enable to do a debug build in the BS - include new drivers: o HID: hid-saitek, hid-tivo o PHY: amd o virt: hv_storvsc, virtio_scsi & xen-netfront o WIFI: ath6kl_usb Version 1.75 - 17 May 2012 by Thomas Backlund - add modules.order and modules.builtin in initrd Version 1.74 - 13 May 2012 by Thierry Vignaud - include "fuse" module (mga#5685) Version 1.73 - 10 May 2012 by Thomas Backlund - add all network phys Version 1.72 - 10 May 2012 by Thomas Backlund - add broadcom and libphy to get tg3 to work (#5567) Version 1.71 - 8 April 2012 by Thomas Backlund - make isohybrid start first partition on sector 1 (mga #5036) Version 1.70 - 5 April 2012 by Thierry Vignaud - include "screen" terminfo (mga#4894) Version 1.69 - 13 March 2012 by Thierry Vignaud - include more HID drivers (mga#4905) Version 1.68 - 12 March 2012 by Thierry Vignaud - include more USB host controller modules (mga#4905) Version 1.67 - 24 February 2012 by Thierry Vignaud - include 'cryptd' & 'xts' modules for new crypted fs (mga#3749) Version 1.66 - 23 February 2012 by Thierry Vignaud - include more HID drivers (mga#4129) Version 1.65 - 15 February 2012 by Thierry Vignaud - do not recompress modules as XZ since kernel now compress them with XZ Version 1.64 - 9 February 2012 by Anne Nicolas - fix isolinux.bin copy due to syslinux 4 Version 1.63 - 27 January 2012 by Thierry Vignaud - include dkms-modules.alias too (mga#1405) Version 1.62 - 20 January 2012 by Thierry Vignaud - smaller stage1: o compress initrd with XZ instead of gzip o recompress gz modules as XZ Version 1.61 - 19 January 2012 by Thierry Vignaud - smaller stage1: remove busybox if not in debug mode Version 1.60 - 5 January 2012 by Thierry Vignaud - use upstream pppd & pppoe instead of a 10 years old snapshot Version 1.59 - 29 December 2011 by Thomas Backlund - sync with kernel-3.2.0-0.rc7.1.mga2 * add wireless drivers: at76c50x_usb, ath9k_htc, brcmfmac, i2400m_usb, orinoco_usb, rtl8187, usb8xxx * add usb network adapters: dm9601, smsc75xx, smsc95xx * add network drivers: cxgb4, myri10ge Version 1.58 - 24 October 2011 by Thierry Vignaud - include nilfs2 module (#3807) Version 1.57 - 24 October 2011 by Thomas Backlund - sync with kernel-3.1.0-1.mga2 * add hid devices: hid-keytouch, hid-uclogic * add sas/raid driver: isci * add sound devices: snd-lola, snd-firewire-speakers snd-isight, snd-usb-6fire * add usb/storage: ums-eneub6250, ums-realtek * add wireless drivers: brcmsmac, rtl8187se, rtusb, rtl8192se, rtl8192cu, rtl8192de Version 1.56 - 06 October 2011 by Thierry Vignaud - fix isolinux.bin path with new syslinux - use gfxboot.c32 as graphical boot loader Version 1.55 - 22 August 2011 by Thierry Vignaud - include microcode Version 1.54 - 20 May 2011 by Olivier Blin - add ums-* (USB mass storage) modules in disk/usb category - merge mkdosfs patch from packages SVN (to replace mkdosfs-with-dir which requires obsolete perl-suid) Version 1.53 - 5 May 2011 by Anne Nicolas - make boot.iso isohybrid Version 1.52 - 25 Apr 2011, by Thomas Backlund - add sdhci-pci to card-reader list - add xhci-hcd (usb3 support) Version 1.51 - 2 Apr 2011, by Thomas Backlund - update modules list needed for md raid456 and dm-raid 4/5/6 target - compress tarball with xz Version 1.50 - 13 Oct 2010, by Thierry Vignaud - 2011.0 build Version 1.49 - 27 May 2010, by Olivier Blin - disable restore option Version 1.48 - 28 February 2010, by Thierry Vignaud - handle new SCSI driver: mpt2sas (#57833) Version 1.47 - 4 January 2010, by Pascal Terjan - use /bin/busybox.static Version 1.46 - 12 October 2009, by Olivier Blin - properly fix FileHandle issue Version 1.45 - 12 October 2009, by Thierry Vignaud - fix firmware again (#53220) Version 1.44 - 6 October 2009, by Thierry Vignaud - do not do anything anymore with bootsplash.cfg Version 1.43 - 22 September 2009, by Olivier Blin - fix firmware loading (#49195) - revert squashfs-lzma and sqlzma inclusion (this breaks install) - list asix module in network/usb group Version 1.42 - 9 September 2009, by Pascal Terjan - include squashfs-lzma and sqlzma kernel modules in all.rdz - add /dev/ptmx (for screen to work) - drop duplicated code including busybox, ka version is better than the one of DEBUGSTAGE1 - embed all firmwares that are needed by the modules we embed Version 1.40 - 14 April 2009, by Pascal Terjan - handle firmware loading in stage2 too Version 1.39 - 6 April 2009, by Pascal Terjan - fix firmware helper generation Version 1.38 - 3 April 2009, by Thierry Vignaud - include firmwares for most common network cards (#49195) - pass restore instead of --restore option - add a userspace helper to load firmwares Version 1.37 - 3 April 2009, by Pascal Terjan - fix crypto module names when arch is not i586 (#46814) Version 1.36 - 9 March 2009, by Thierry Vignaud - add /dev/random and /dev/urandom (for curl) Version 1.35 - 18 February 2009, by Thierry Vignaud - pass --restore instead of restore option Version 1.34 - 10 February 2009, by Thierry Vignaud - enable to select restore option Version 1.33 - 23 January 2009, by Christophe Fergeau - adjust to new syslinux 3.72 gfxboot COM32 module Version 1.32 - 15 January 2008, by Thierry Vignaud - include: o network drivers: enic, et131x, qlge, smsc95xx, sxg & w35und o IDE driver: tx4939ide - ext4dev was renamed as ext4 in 2.6.29-rc1 (keep ext4dev for older kernels) Version 1.31 - 19 September 2008, by Pascal "pixel" Rigaux - add modules "sha256_generic cbc amd768_rng" for crypsetup/LUKS Version 1.30 - 12 June 2008, by Olivier "blino" Blin - handle ide-cd being renamed as ide-cd_mod Version 1.29 - 2 April 2008, by Olivier "blino" Blin - use "Mdv Boot ISO" as label for boot.iso Version 1.28 - 12 February 2008, by Olivier "blino" Blin - restore full modules.alias (depmod keeps only available modules in modules.alias, but we want them all) Version 1.27 - 12 February 2008, by Olivier "blino" Blin - add modules in /modules/`uname -r` and use depmod to build modules.dep and modules.alias - remove symlinks in toplevel /modules - fix custom bootsplash theme support Version 1.26 - 21 December 2007, by Olivier "blino" Blin - rebuild with list_modules to handle atl2 ethernet driver - fix live stage2 support Version 1.25 - 12 December 2007, by Pascal "Pixel" Rigaux - rebuild for new list_modules Version 1.24 - 15 October 2007, by Olivier "blino" Blin - rebuild for new list_modules (to include ipw3945) Version 1.23 - 17 September 2007, by Pascal "Pixel" Rigaux - add dm-zero for dmraid Version 1.22 - 11 September 2007, by Olivier "blino" Blin - add /lib/module-init-tools/ldetect-lst-modules.alias Version 1.21 - 7 September 2007, by Olivier "blino" Blin - add jmicron driver - provide /usr/share/ldetect-lst/*-modules.alias in installer images Version 1.20 - 31 August 2007, by Pascal "Pixel" Rigaux - dynamically determine the size of all.img Version 1.19 - 27 August 2007, by Olivier "blino" Blin - add raid456 module Version 1.18 - 21 August 2007, by Olivier "blino" Blin - release with latest scripts from drakx/kernel Version 1.17 - 21 August 2007, by Olivier "blino" Blin - keep modules without dependencies in modules.dep Version 1.16 - 21 August 2007, by Olivier "blino" Blin - build with new list_modules Version 1.15 - 15 August 2007, by Olivier "blino" Blin - add pcitable, usbtable and pci.ids - fix typos affecting mtab and /var/run creation - add a /lib/modules symlink Version 1.14 - 9 August 2007, by Pascal "Pixel" Rigaux - update_kernel: now require install rpms or rpm files as arguments (this allow specifying precisely which installed kernels are used) Version 1.13 - 8 August 2007, by Pascal "Pixel" Rigaux - add modules.alias in /modules/ as required by stage2 with new libldetect - add unionfs module - revert isolinux starting install by default instead of booting on harddrive (#32040) Version 1.12 - 17 July 2007, by Olivier "blino" Blin - add ide-disk module Version 1.11 - 29 June 2007, by Pascal "Pixel" Rigaux - increase all.img size to 10.5MB - default to theme Mandriva-Free, and allow setting another one through THEME environment variable Version 1.9 - 3 April 2007, by Pascal "Pixel" Rigaux - include mmc_block for card readers Version 1.8 - 23 March 2007, by Pascal "Pixel" Rigaux - restore F1 & F2 in boot.iso (#29766) Version 1.6 - 14 March 2007, by Olivier Blin - add tifm modules (Titi) Version 1.5 - 9 March 2007, by Pascal "Pixel" Rigaux - copy isolinux images for x86_64 as well Version 1.4 - 8 March 2007, by Pascal "Pixel" Rigaux - restore vga= and automatic= default options. also restore noacpi, alt0, vgalo, vgahi, text entries (all this is needed when gfxboot is not working or not there) Version 1.3 - 16 February 2007, by Pascal "Pixel" Rigaux - rely on gfxboot for options (vga=, automatic=...) - really use memtest instead of memtest.bin (with file name "memtest.bin" it fails with error 8000, with "memtest" it works) (it seems to be an ancient bug as far as google says) ='n254' href='#n254'>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 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343
package install_steps_interactive; # $Id$


use strict;
use vars qw(@ISA $new_bootstrap);

@ISA = qw(install_steps);


#-######################################################################################
#- misc imports
#-######################################################################################
use common;
use partition_table;
use fs::type;
use install_steps;
use install_interactive;
use install_any;
use install_messages;
use detect_devices;
use run_program;
use devices;
use fsedit;
use mouse;
use modules;
use modules::interactive;
use lang;
use keyboard;
use any;
use log;

#-######################################################################################
#- In/Out Steps Functions
#-######################################################################################
sub errorInStep {
    my ($o, $err) = @_;
    $o->ask_warn(N("Error"), [ N("An error occurred"), formatError($err) ]);
}

sub kill_action {
    my ($o) = @_;
    $o->kill;
}

#-######################################################################################
#- Steps Functions
#-######################################################################################
#------------------------------------------------------------------------------
sub selectLanguage {
    my ($o) = @_;

    any::selectLanguage_install($o, $o->{locale});
    install_steps::selectLanguage($o);

    if ($o->isa('interactive::gtk')) {
	$o->ask_warn('', formatAlaTeX(
"If you see this message it is because you chose a language for
which DrakX does not include a translation yet; however the fact
that it is listed means there is some support for it anyway.

That is, once GNU/Linux will be installed, you will be able to at
least read and write in that language; and possibly more (various
fonts, spell checkers, various programs translated etc. that
varies from language to language).")) if $o->{locale}{lang} !~ /^en/ && !lang::load_mo();
    } else {
	#- no need to have this in po since it is never translated
	$o->ask_warn('', "The characters of your language can not be displayed in console,
so the messages will be displayed in english during installation") if $ENV{LANGUAGE} eq 'C';
    }
}
    
sub acceptLicense {
    my ($o) = @_;

    $o->{release_notes} = join("\n\n", map { 
	my $f = install_any::getFile($_);
	$f && cat__($f);
    } 'release-notes.txt', 'release-notes.' . arch() . '.txt');

    return if $o->{useless_thing_accepted};

    my $r = $::testing ? 'Accept' : 'Refuse';

    $o->ask_from_({ title => N("License agreement"), 
		     cancel => N("Quit"),
		     messages => formatAlaTeX(install_messages::main_license() . "\n\n\n" . install_messages::warning_about_patents()),
		     interactive_help_id => 'acceptLicense',
		     if_(!$::globetrotter, more_buttons => [ [ N("Release Notes"), sub { $o->ask_warn(N("Release Notes"), $o->{release_notes}) }, 1 ] ]),
		     callbacks => { ok_disabled => sub { $r eq 'Refuse' } },
		   },
		   [ { list => [ N_("Accept"), N_("Refuse") ], val => \$r, type => 'list', format => sub { translate($_[0]) } } ])
      or do {
	  if ($::globetrotter) {
           run_program::run('killall', 'Xorg');
	      exec("/sbin/reboot");
	  }
	  install_any::ejectCdrom();
	  $o->exit;
      };
}

#------------------------------------------------------------------------------
sub selectKeyboard {
    my ($o, $clicked) = @_;

    my $from_usb = keyboard::from_usb();
    my $l = keyboard::lang2keyboards(lang::langs($o->{locale}{langs}));

    if ($::expert || $clicked || !($from_usb || @$l && $l->[0][1] >= 90) || listlength(lang::langs($o->{locale}{langs})) > 1) {
	add2hash($o->{keyboard}, $from_usb);
	my @best = uniq($from_usb ? $from_usb->{KEYBOARD} : (), map { $_->[0] } @$l);

	my $format = sub { translate(keyboard::KEYBOARD2text($_[0])) };
	my $other;
	my $ext_keyboard = my $KEYBOARD = $o->{keyboard}{KEYBOARD};
	$o->ask_from_(
		      { title => N("Keyboard"), 
			messages => N("Please choose your keyboard layout."),
			interactive_help_id => 'selectKeyboard',
			advanced_messages => N("Here is the full list of available keyboards"),
			advanced_label => N("More"),
			callbacks => { changed => sub { $other = $_[0] == 1 } },
		      },
		      [ if_(@best > 1, { val => \$KEYBOARD, type => 'list', format => $format, sort => 1,
					 list => [ @best ] }),
			{ val => \$ext_keyboard, type => 'list', format => $format,
			  list => [ difference2([ keyboard::KEYBOARDs() ], \@best) ], advanced => @best > 1 }
		      ]);
	$o->{keyboard}{KEYBOARD} = @best <= 1 || $other ? $ext_keyboard : $KEYBOARD;
	delete $o->{keyboard}{unsafe};
    }
    keyboard::group_toggle_choose($o, $o->{keyboard}) or goto &selectKeyboard;
    install_steps::selectKeyboard($o);
}

#------------------------------------------------------------------------------
sub selectInstallClass {
    my ($o) = @_;

    if (my @l = install_any::find_root_parts($o->{fstab}, $o->{prefix})) {
	log::l("proposing to upgrade partitions " . join(" ", map { $_->{part} && $_->{part}{device} } @l));

	my @releases = uniq(map { $_->{release} } @l);
	if (@releases != @l) {
	    #- same release name so adding the device to differentiate them:
	    $_->{release} .= " ($_->{part}{device})" foreach @l;
	}

	my $p;
	$o->ask_from_({ title => N("Install/Upgrade"),
			messages => N("Is this an install or an upgrade?"),
			interactive_help_id => 'selectInstallClass',
		      },
		      [ { val => \$p,
			  list => [ @l, N_("Install") ], 
			  type => 'list',
			  format => sub { ref($_[0]) ? N("Upgrade %s", $_[0]{release}) : translate($_[0]) }
			} ]);
	if (ref $p) {
	    if ($p->{part}) {
		log::l("choosing to upgrade partition $p->{part}{device}");
		$o->{migrate_device_names} = install_any::use_root_part($o->{all_hds}, $p->{part}, $o);
	    }
	    foreach (grep { $_->{mntpoint} } @{$o->{fstab}}) {
		my ($options, $_unknown) = fs::mount_options::unpack($_);
		$options->{encrypted} or next;
		$o->ask_from_({ focus_first => 1 },
			      [ { label => N("Encryption key for %s", $_->{mntpoint}),
				  hidden => 1, val => \$_->{encrypt_key} } ]);
	    }
	    $o->{isUpgrade} = $p->{release_file} =~ /redhat/ ? 'redhat' : 'mandrake';
	}
    }
}

#------------------------------------------------------------------------------
sub selectMouse {
    my ($o, $force) = @_;

    $force ||= $o->{mouse}{unsafe};

    if ($force) {
	my $prev = $o->{mouse}{type} . '|' . $o->{mouse}{name};

	$o->ask_from_({ messages => N("Please choose your type of mouse."),
			interactive_help_id => 'selectMouse',
		      },
		     [ { list => [ mouse::fullnames() ], separator => '|', val => \$prev, format => sub { join('|', map { translate($_) } split('\|', $_[0])) } } ]);
	$o->{mouse} = mouse::fullname2mouse($prev);
    }

    if ($force && $o->{mouse}{type} eq 'serial') {
	$o->{mouse}{device} = 
	  $o->ask_from_listf_raw({ title => N("Mouse Port"),
				   messages => N("Please choose which serial port your mouse is connected to."),
				   interactive_help_id => 'selectSerialPort',
				 },
			    \&mouse::serial_port2text,
			    [ mouse::serial_ports() ]) or return &selectMouse;
    }
    if (arch() =~ /ppc/ && $o->{mouse}{nbuttons} == 1) {
	#- set a sane default F11/F12
	$o->{mouse}{button2_key} = 87;
	$o->{mouse}{button3_key} = 88;
	$o->ask_from('', N("Buttons emulation"),
		[
		{ label => N("Button 2 Emulation"), val => \$o->{mouse}{button2_key}, list => [ mouse::ppc_one_button_keys() ], format => \&mouse::ppc_one_button_key2text },
		{ label => N("Button 3 Emulation"), val => \$o->{mouse}{button3_key}, list => [ mouse::ppc_one_button_keys() ], format => \&mouse::ppc_one_button_key2text },
		]) or return;
    }
    
    if ($o->{mouse}{device} eq "usbmouse") {
	modules::interactive::load_category($o, $o->{modules_conf}, 'bus/usb', 1, 1);
	eval { 
	    devices::make("usbmouse");
	    modules::load(qw(hid mousedev usbmouse));
	};
    }

    $o->SUPER::selectMouse;
    1;
}
#------------------------------------------------------------------------------
sub setupSCSI {
    my ($o) = @_;

    if (!$::noauto && arch() =~ /i.86/) {
	if ($o->{pcmcia} ||= detect_devices::real_pcmcia_probe()) {
	    my $w = $o->wait_message(N("PCMCIA"), N("Configuring PCMCIA cards..."));
	    my $results = install_any::configure_pcmcia($o->{modules_conf}, $o->{pcmcia});
	    undef $w;
	    $results and $o->ask_warn('', $results);
	}
    }
    { 
	my $_w = $o->wait_message(N("IDE"), N("Configuring IDE"));
	modules::load(modules::category2modules('disk/cdrom'));
    }
    modules::interactive::load_category($o, $o->{modules_conf}, 'bus/firewire', 1);

    my $have_non_scsi = detect_devices::hds(); #- at_least_one scsi device if we have no disks
    modules::interactive::load_category($o, $o->{modules_conf}, 'disk/ide|scsi|hardware_raid|sata|firewire', 1, !$have_non_scsi);
    modules::interactive::load_category($o, $o->{modules_conf}, 'disk/ide|scsi|hardware_raid|sata|firewire') if !detect_devices::hds(); #- we really want a disk!

    install_interactive::tellAboutProprietaryModules($o);

    install_any::getHds($o, $o);
}

sub ask_mntpoint_s { #- }{}
    my ($o, $fstab) = @_;

    my @fstab = grep { isTrueFS($_) } @$fstab;
    @fstab = grep { isSwap($_) } @$fstab if @fstab == 0;
    @fstab = @$fstab if @fstab == 0;
    die N("No partition available") if @fstab == 0;

    {
	my $_w = $o->wait_message('', N("Scanning partitions to find mount points"));
	install_any::suggest_mount_points($fstab, $o->{prefix}, 'uniq');
	log::l("default mntpoint $_->{mntpoint} $_->{device}") foreach @fstab;
    }
    if (@fstab == 1) {
	$fstab[0]{mntpoint} = '/';
    } else {
	$o->ask_from_({ messages => N("Choose the mount points"),
			interactive_help_id => 'ask_mntpoint_s',
			callbacks => {
			    complete => sub {
				require diskdrake::interactive;
				eval { 1, find_index {
				    !diskdrake::interactive::check_mntpoint($o, $_->{mntpoint}, $_, $o->{all_hds});
				} @fstab };
			    },
			},
		      },
		      [ map { 
			  { 
			      label => partition_table::description($_), 
			      val => \$_->{mntpoint},
			      not_edit => 0,
			      list => [ '', fsedit::suggestions_mntpoint(fs::get::empty_all_hds()) ],
			  };
		        } @fstab ]) or return;
    }
    $o->SUPER::ask_mntpoint_s($fstab);
}

#------------------------------------------------------------------------------
sub doPartitionDisks {
    my ($o) = @_;

    if (arch() =~ /ppc/) {
	my $generation = detect_devices::get_mac_generation();
	if ($generation =~ /NewWorld/) {
	    #- mac partition table
	    if (defined $partition_table::mac::bootstrap_part) {
    		#- do not do anything if we've got the bootstrap setup
    		#- otherwise, go ahead and create one somewhere in the drive free space
	    } else {
		my $freepart = $partition_table::mac::freepart;
		if ($freepart && $freepart->{size} >= 1) {
		    log::l("creating bootstrap partition on drive /dev/$freepart->{hd}{device}, block $freepart->{start}");
		    $partition_table::mac::bootstrap_part = $freepart->{part};
		    log::l("bootstrap now at $partition_table::mac::bootstrap_part");
		    my $p = { start => $freepart->{start}, size => 1 << 11, mntpoint => '' };
		    fs::type::set_pt_type($p, 0x401);
		    fsedit::add($freepart->{hd}, $p, $o->{all_hds}, { force => 1, primaryOrExtended => 'Primary' });
		    $new_bootstrap = 1;

    		} else {
		    $o->ask_warn('', N("No free space for 1MB bootstrap! Install will continue, but to boot your system, you'll need to create the bootstrap partition in DiskDrake"));
    		}
	    }
	} elsif ($generation =~ /IBM/) {
	    #- dos partition table
	    $o->ask_warn('', N("You'll need to create a PPC PReP Boot bootstrap! Install will continue, but to boot your system, you'll need to create the bootstrap partition in DiskDrake"));
	}
    }

    if (!$o->{isUpgrade}) {
        install_interactive::partitionWizard($o);
    }
}

#------------------------------------------------------------------------------
sub rebootNeeded {
    my ($o) = @_;
    $o->ask_warn('', N("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 { !$_->{isMounted} && $_->{mntpoint} && 
		   (!isSwap($_) || $::expert) &&
		   (!isFat_or_NTFS($_) || $_->{notFormatted} || $::expert) &&
		   (!isOtherAvailableFS($_) || $::expert || $_->{toFormat});
	       } @$fstab;
    $_->{toFormat} = 1 foreach grep { isSwap($_) && !$::expert } @$fstab;

    return if @l == 0 || !$::expert && every { $_->{toFormat} } @l;

    #- keep it temporary until the guy has accepted
    $_->{toFormatTmp} = $_->{toFormat} || $_->{toFormatUnsure} foreach @l;

    $o->ask_from_(
        { messages => N("Choose the partitions you want to format"),
	  interactive_help_id => 'formatPartitions',
          advanced_messages => N("Check bad blocks?"),
        },
        [ map { 
	    my $e = $_;
	    ({
	      text => partition_table::description($e), type => 'bool',
	      val => \$e->{toFormatTmp}
	     }, if_(!isLoopback($_) && !member($_->{fs_type}, 'reiserfs', 'xfs', 'jfs'), {
	      text => partition_table::description($e), type => 'bool', advanced => 1, 
	      disabled => sub { !$e->{toFormatTmp} },
	      val => \$e->{toFormatCheck}
        })) } @l ]
    ) or die 'already displayed';
    #- ok now we can really set toFormat
    foreach (@l) {
	$_->{toFormat} = delete $_->{toFormatTmp};
	set_isFormatted($_, 0);
    }
}


sub formatMountPartitions {
    my ($o, $_fstab) = @_;
    my ($w, $wait_message) = fs::format::wait_message($o);
    catch_cdie {
        fs::format::formatMount_all($o->{all_hds}, $o->{fstab}, $wait_message);
    } sub { 
	$@ =~ /fsck failed on (\S+)/ or return;
	$o->ask_yesorno('', N("Failed to check filesystem %s. Do you want to repair the errors? (beware, you can lose data)", $1), 1);
    };
    undef $w; #- help perl (otherwise wait_message stays forever in newt)
    die N("Not enough swap space to fulfill installation, please add some") if availableMemory() < 40 * 1024;
}

#------------------------------------------------------------------------------
sub setPackages {
    my ($o) = @_;

    my $w = $o->wait_message('', $o->{isUpgrade} ? N("Looking for available packages and rebuilding rpm database...") :
			     N("Looking for available packages..."));
    install_any::setPackages($o);

    $w->set(N("Looking at packages already installed..."));
    pkgs::selectPackagesAlreadyInstalled($o->{packages});

    if ($o->{isUpgrade}) {
	$w->set(N("Finding packages to upgrade..."));
	pkgs::selectPackagesToUpgrade($o->{packages});
    }
}

sub mirror2text { $crypto::mirrors{$_[0]} ? $crypto::mirrors{$_[0]}[0] . '|' . $_[0] : "-|URL" }
sub askSupplMirror {
    my ($o, $message) = @_;
    my $u = $o->{updates} ||= {};
    require crypto;
    my @mirrors = do {
	#- Direct the user to the community mirror tree for an install from a mini-iso
	$o->{distro_type} ||= 'community';
	#- get the list of mirrors locally, to avoid weird bugs with making an
	#- http request before ftp at this point of the install
	crypto::mirrors($o->{distro_type}, 1);
    };
    push @mirrors, '-';
    $o->ask_from_(
	{
	    messages => N("Choose a mirror from which to get the packages"),
	    cancel => N("Cancel"),
	},
	[ { separator => '|',
	    format => \&mirror2text,
	    list => \@mirrors,
	    val => \$u->{mirror},
	}, ],
    ) or $u->{mirror} = '';
    delete $o->{updates};
    if ($u->{mirror} eq '-') {
	return $o->ask_from_entry('', $message) || '';
    }
    my $url = "ftp://$u->{mirror}$crypto::mirrors{$u->{mirror}}[1]";
    $url =~ s!/(?:media/)?main/?\z!!;
    log::l("mirror chosen [$url]");
    return $url;
}

sub selectSupplMedia {
    my ($o, $suppl_method) = @_;
    install_any::selectSupplMedia($o, $suppl_method);
}