aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/ifup-ctc
diff options
context:
space:
mode:
Diffstat (limited to 'network-scripts/ifup-ctc')
0 files changed, 0 insertions, 0 deletions
e='id' value='0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7'/>
context:
space:
mode:
authordamien <damien@mandriva.com>2000-11-28 16:56:52 +0000
committerdamien <damien@mandriva.com>2000-11-28 16:56:52 +0000
commit0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7 (patch)
tree33f7ac905998f9ad6d85090f777ee4c0d0c67032
parentd5c526273db473a7d87a26000585900fc10dda7d (diff)
downloaddrakx-backup-do-not-use-0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7.tar
drakx-backup-do-not-use-0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7.tar.gz
drakx-backup-do-not-use-0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7.tar.bz2
drakx-backup-do-not-use-0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7.tar.xz
drakx-backup-do-not-use-0880c7ba8ce88e87fa600aeb367a8f88a3ae71e7.zip
branch to build the firewall install.topic/unlabeled-1.1.1
Diffstat
-rw-r--r--.cvsignore10
-rw-r--r--Makefile235
-rwxr-xr-xmake_boot_img311
-rwxr-xr-xmake_ks_from_floppy8
-rw-r--r--perl-install/.cvsignore10
-rw-r--r--perl-install/ChangeLog2736
-rw-r--r--perl-install/Makefile202
-rw-r--r--perl-install/Makefile.config15
-rw-r--r--perl-install/Makefile.drakxtools31
-rw-r--r--perl-install/Newt/Av_CharPtrPtr.c2
-rw-r--r--perl-install/Newt/Newt.pm6
-rw-r--r--perl-install/Newt/Newt.xs139
-rw-r--r--perl-install/Xconfig.pm144
-rw-r--r--perl-install/Xconfigurator.pm1218
-rw-r--r--perl-install/Xconfigurator_consts.pm666
-rw-r--r--perl-install/any.pm573
-rw-r--r--perl-install/bootloader.pm91
-rw-r--r--perl-install/c.pm27
-rw-r--r--perl-install/c/.cvsignore8
-rw-r--r--perl-install/c/Makefile.PL18
-rw-r--r--perl-install/c/sbus.c35
-rw-r--r--perl-install/c/stuff.pm11
-rw-r--r--perl-install/c/stuff.xs.pm483
-rw-r--r--perl-install/class_discard.pm2
-rwxr-xr-xperl-install/commands2
-rw-r--r--perl-install/commands.pm385
-rw-r--r--perl-install/common.pm616
-rw-r--r--perl-install/crypto.pm40
-rw-r--r--perl-install/detect_devices.pm324
-rw-r--r--perl-install/devices.pm106
-rwxr-xr-xperl-install/do_resize_fat4
-rw-r--r--perl-install/fs.pm438
-rw-r--r--perl-install/fsedit.pm504
-rw-r--r--perl-install/ftp.pm84
-rwxr-xr-xperl-install/g_auto_install9
-rw-r--r--perl-install/help.pm1212
-rw-r--r--perl-install/http.pm19
-rwxr-xr-xperl-install/install224
-rw-r--r--perl-install/install2.pm992
-rw-r--r--perl-install/install_any.pm796
-rw-r--r--perl-install/install_gtk.pm103
-rw-r--r--perl-install/install_interactive.pm294
-rw-r--r--perl-install/install_steps.pm1035
-rw-r--r--perl-install/install_steps_auto_install.pm69
-rw-r--r--perl-install/install_steps_gtk.pm1077
-rw-r--r--perl-install/install_steps_interactive.pm1141
-rw-r--r--perl-install/install_steps_newt.pm46
-rw-r--r--perl-install/install_steps_stdio.pm203
-rw-r--r--perl-install/interactive.pm276
-rw-r--r--perl-install/interactive_gtk.pm394
-rw-r--r--perl-install/interactive_newt.pm442
-rw-r--r--perl-install/interactive_stdio.pm51
-rw-r--r--perl-install/keyboard.pm351
-rw-r--r--perl-install/lang.pm470
-rwxr-xr-xperl-install/live_install93
-rwxr-xr-xperl-install/live_install216
-rw-r--r--perl-install/log.pm56
-rw-r--r--perl-install/loopback.pm113
-rw-r--r--perl-install/modparm.pm84
-rw-r--r--perl-install/modules.pm780
-rw-r--r--perl-install/mouse.pm318
-rw-r--r--perl-install/my_gtk.pm761
-rw-r--r--perl-install/network.pm414
-rw-r--r--perl-install/partition_table.pm673
-rw-r--r--perl-install/partition_table_bsd.pm38
-rw-r--r--perl-install/partition_table_dos.pm14
-rw-r--r--perl-install/partition_table_empty.pm4
-rw-r--r--perl-install/partition_table_mac.pm77
-rw-r--r--perl-install/partition_table_raw.pm177
-rw-r--r--perl-install/partition_table_sun.pm169
-rw-r--r--perl-install/pkgs.pm1448
-rw-r--r--perl-install/printer.pm1069
-rw-r--r--perl-install/printerdrake.pm604
-rw-r--r--perl-install/raid.pm85
-rw-r--r--perl-install/resize_fat/Makefile16
-rw-r--r--perl-install/resize_fat/README4
-rw-r--r--perl-install/resize_fat/any.pm97
-rw-r--r--perl-install/resize_fat/boot_sector.pm76
-rw-r--r--perl-install/resize_fat/c_rewritten.pm2
-rw-r--r--perl-install/resize_fat/c_rewritten.xs195
-rw-r--r--perl-install/resize_fat/dir_entry.pm29
-rw-r--r--perl-install/resize_fat/directory.pm45
-rw-r--r--perl-install/resize_fat/fat.pm87
-rw-r--r--perl-install/resize_fat/info_sector.pm17
-rw-r--r--perl-install/resize_fat/io.pm29
-rw-r--r--perl-install/resize_fat/main.pm141
-rw-r--r--perl-install/run_program.pm45
-rw-r--r--perl-install/sbus_probing/main.pm50
-rw-r--r--perl-install/services.pm98
-rw-r--r--perl-install/share/aliases3
-rw-r--r--perl-install/share/compssList2478
-rw-r--r--perl-install/share/compssUsers109
-rw-r--r--perl-install/share/compssUsers.desktop35
-rw-r--r--perl-install/share/diskdrake.rc34
-rw-r--r--perl-install/share/fonts.tar.bz2bin1105268 -> 1110104 bytes
-rw-r--r--perl-install/share/install.rc23
-rw-r--r--perl-install/share/keyboards.tar.bz2bin14730 -> 19494 bytes
-rw-r--r--perl-install/share/keymaps.tar.bz2bin10879 -> 10929 bytes
-rwxr-xr-xperl-install/share/keymaps_generate9
-rw-r--r--perl-install/share/list161
-rw-r--r--perl-install/share/list.alpha71
-rw-r--r--perl-install/share/list.i3864
-rw-r--r--perl-install/share/list.ppc9
-rw-r--r--perl-install/share/list.sparc109
-rw-r--r--perl-install/share/po/Changelog237
-rw-r--r--perl-install/share/po/DrakX.pot5607
-rw-r--r--perl-install/share/po/Makefile39
-rw-r--r--perl-install/share/po/i18n_compssUsers38
-rw-r--r--perl-install/share/po/no.po8958
-rw-r--r--perl-install/share/po/sp.po8395
-rw-r--r--perl-install/share/step-green-click.xpm335
-rw-r--r--perl-install/share/step-green-on.xpm403
-rw-r--r--perl-install/share/step-green.xpm402
-rw-r--r--perl-install/share/step-orange-click.xpm337
-rw-r--r--perl-install/share/step-orange-on.xpm423
-rw-r--r--perl-install/share/step-orange.xpm415
-rw-r--r--perl-install/share/step-red-click.xpm356
-rw-r--r--perl-install/share/step-red-on.xpm425
-rw-r--r--perl-install/share/step-red.xpm411
-rw-r--r--perl-install/share/themes-blackwhite.rc36
-rw-r--r--perl-install/share/themes-blue.rc40
-rw-r--r--perl-install/share/themes-marble3d.rc85
-rw-r--r--perl-install/share/themes-mdk-Desktop.rc4
-rw-r--r--perl-install/share/themes-mdk.rc90
-rw-r--r--perl-install/share/themes-savane.rc47
-rw-r--r--perl-install/share/themes.rc18
-rw-r--r--perl-install/share/themes/mdk-button1.pngbin85 -> 628 bytes
-rw-r--r--perl-install/share/themes/mdk-button4.pngbin4362 -> 625 bytes
-rw-r--r--perl-install/share/themes/mdk-check_off.pngbin604 -> 602 bytes
-rw-r--r--perl-install/share/themes/mdk-check_on.pngbin611 -> 584 bytes
-rwxr-xr-xperl-install/standalone/XFdrake66
-rwxr-xr-xperl-install/standalone/adduserdrake73
-rwxr-xr-xperl-install/standalone/diskdrake14
-rwxr-xr-xperl-install/standalone/drakboot41
-rwxr-xr-xperl-install/standalone/drakgw367
-rwxr-xr-xperl-install/standalone/draknet33
-rwxr-xr-xperl-install/standalone/draksec34
-rwxr-xr-xperl-install/standalone/drakxconf4
-rwxr-xr-xperl-install/standalone/drakxservices20
-rw-r--r--perl-install/standalone/icons/findf.xpm57
-rw-r--r--perl-install/standalone/icons/ftin.xpm46
-rw-r--r--perl-install/standalone/icons/ftout.xpm46
-rwxr-xr-xperl-install/standalone/keyboarddrake33
-rwxr-xr-xperl-install/standalone/livedrake23
-rwxr-xr-xperl-install/standalone/mousedrake51
-rwxr-xr-xperl-install/standalone/printerdrake25
-rw-r--r--perl-install/swap.pm35
-rw-r--r--perl-install/timezone.pm71
-rwxr-xr-xperl-install/verify_c2
-rw-r--r--rescue/.cvsignore1
-rw-r--r--rescue/Makefile4
-rw-r--r--rescue/aliases1
-rw-r--r--rescue/dirs4
-rw-r--r--rescue/kernel_read_part.c13
-rw-r--r--rescue/list24
-rw-r--r--rescue/list.i3864
-rw-r--r--rescue/list.sparc1
-rwxr-xr-xrescue/make_rescue_img20
-rw-r--r--rescue/tree/boot/grub/menu.lst2
-rw-r--r--rescue/tree/etc/issue2
-rwxr-xr-xrescue/tree/etc/oem76
-rw-r--r--rescue/tree/etc/profile2
-rwxr-xr-xrescue/tree/etc/rc.sysinit6
-rwxr-xr-xrescue/tree/sbin/modprobe3
-rw-r--r--tools/.cvsignore1
-rw-r--r--tools/2isdndb.pm6
-rw-r--r--tools/Makefile41
-rw-r--r--tools/alpha/cd/Makefile6
-rw-r--r--tools/alpha/cd/README9
-rw-r--r--tools/alpha/cd/aboot.cnf6
-rwxr-xr-xtools/alpha/cd/up1000/apb.cfg4
-rwxr-xr-xtools/closurepkgs58
-rw-r--r--tools/ddcprobe/Makefile10
-rw-r--r--tools/ddcprobe/lrmi.c2
-rwxr-xr-xtools/gencompss6
-rwxr-xr-xtools/make_mdkinst_stage247
-rwxr-xr-xtools/syncrpms157
-rwxr-xr-xupdate_kernel91
178 files changed, 44863 insertions, 13343 deletions
diff --git a/.cvsignore b/.cvsignore
index e5d9d6cd3..1e8ace8c2 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,3 +1,11 @@
-kernel
+kernel*
pictures
docs
+unused
+*.img
+*.rdz
+modules
+vmlinu*
+install_pcmcia_modules
+System.map
+drakxtools.tar.bz2
diff --git a/Makefile b/Makefile
index 68fe70782..eb2cea021 100644
--- a/Makefile
+++ b/Makefile
@@ -1,114 +1,131 @@
-SO_FILES = c/blib/arch/auto/c/c.so
-PMS = *.pm resize_fat/*.pm commands diskdrake
-DEST = /tmp/t
-DESTREP4PMS = $(DEST)/usr/bin/perl-install
-PERL = ./perl
-BINS = /bin/ash /sbin/mke2fs $(PERL)
+ARCH := $(patsubst i%86,i386,$(shell uname -m))
+ARCH := $(patsubst sparc%,sparc,$(ARCH))
+
+RELEASE_BOOT_IMG = hd.img hdreiser.img cdrom.img network.img
+ifeq (i386,$(ARCH))
+RELEASE_BOOT_IMG += pcmcia.img blank.img all.img other.img
+endif
+ifeq (sparc,$(ARCH))
+BOOT_IMG = live.img tftp.img tftprd.img live64.img tftp64.img tftprd64.img
+RELEASE_BOOT_IMG += hd64.img cdrom64.img network64.img
+endif
+BOOT_IMG += $(RELEASE_BOOT_IMG)
+
+BOOT_RDZ = $(BOOT_IMG:%.img=%.rdz)
+BINS = install/install install/full-install install/local-install install/installinit/init
+DIRS = tools install install/installinit perl-install
+
+ROOTDEST = /export
+UPLOAD_DEST_ = ~/cooker
+UPLOAD_DEST = $(UPLOAD_DEST_)/cooker
+UPLOAD_DEST_CONTRIB = $(UPLOAD_DEST_)/contrib
+UPLOAD_SPARC_DEST = /mnt/BIG/distrib/sparc
+
+.PHONY: dirs $(FLOPPY_IMG) install
+
+install: build autoboot rescue
+ for i in images misc Mandrake Mandrake/base; do install -d $(ROOTDEST)/$$i ; done
+ cp -f $(RELEASE_BOOT_IMG) $(ROOTDEST)/images
+ifeq (alpha,$(ARCH))
+ cp -f $(BOOT_RDZ) $(ROOTDEST)/boot
+ cp -f vmlinux.gz $(ROOTDEST)/boot/instboot.gz
+ make -C tools/$(ARCH)/cd install ROOTDEST=$(ROOTDEST)
+endif
+ install live_update $(ROOTDEST)/live_update
+ make -C perl-install full_stage2
+
+build: $(BOOT_IMG)
+
+autoboot:
+ifeq (i386,$(ARCH))
+ install -d $(ROOTDEST)/boot
+ cp -f vmlinuz {hd,cdrom,pcmcia,network,all,other}.rdz $(ROOTDEST)/boot
+ /usr/sbin/rdev -v $(ROOTDEST)/boot/vmlinuz 788
+endif
+
+dirs:
+ for i in $(DIRS); do make -C $$i; done
+
+rescue: modules
+ make -C $@
+
+network_ks.rdz pcmcia_ks.rdz: %_ks.rdz: %.rdz
+
+$(BOOT_RDZ): dirs modules
+ ./make_boot_img $@ $(@:%.rdz=%)
+
+$(BOOT_IMG): %.img: %.rdz
+ ./make_boot_img $@ $(@:%.img=%)
-.PHONY: all tags install clean verify_c
+tar: clean
+ rpm -qa > needed_rpms.lst
+ cd .. ; tar cfy gi.tar.bz2 gi
+ rm needed_rpms.lst
-all: $(SO_FILES)
+modules:
+ `./tools/specific_arch ./update_kernel`
-tags:
- etags -o - $(PMS) | perl2etags > TAGS
+$(BOOT_IMG:%=%f): %f: %
+ dd if=$< of=/dev/fd0
+ xmessage "Floppy done"
clean:
- test ! -e c/Makefile || $(MAKE) -C c clean
- find . -name "*~" -name "TAGS" -name "*.old" | xargs rm -f
-
-tar: clean
- cd .. ; tar cfy perl-install.tar.bz2 --exclude perl-install/perl perl-install
-
-c/c.xs: c/c.xs.pm
- chmod u+w $@
- perl $< > $@
- chmod a-w $@
-
-$(SO_FILES): c/c.xs
- test -e c/Makefile || (cd c; perl Makefile.PL)
- $(MAKE) -C c
-
-test_pms: verify_c
- perl2fcalls -excludec install2.pm
- (for i in $(PMS); do perl -cw -I. -Ic -Ic/blib/arch $$i || exit 1 ; done)
-
-verify_c:
- ./verify_c $(PMS)
-
-install_pms: $(SO_FILES)
- for i in `perl -ne 's/sub (\w+?)_? {.*/$$1/ and print' commands.pm`; do ln -sf commands $(DEST)/usr/bin/$$i; done
-
- install -d $(DESTREP4PMS)
- for i in $(PMS); do \
- dest=$(DESTREP4PMS)/`dirname $$i`; \
- install -d $$dest; \
- perl -ne 'print #unless /^use (diagnostics|vars|strict)/' $$i > $(DESTREP4PMS)/$$i; \
- done
- @# cp -f $$i $$dest; \
- cp diskdrake.rc $(DESTREP4PMS)
- ln -sf perl-install/install2.pm $(DEST)/usr/bin/install2
- ln -sf perl-install/commands $(DEST)/usr/bin/commands
- chmod a+x $(DESTREP4PMS)/install2.pm
- chmod a+x $(DESTREP4PMS)/commands
-
- cp -af */blib/arch/auto $(DESTREP4PMS)
- find $(DESTREP4PMS) -name "*.so" | xargs strip
-
-full_tar:
- cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/Gtk* $(DESTREP4PMS)
- cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/auto/Gtk $(DESTREP4PMS)/auto
- find $(DESTREP4PMS) -name "*.so" | xargs strip
- cd $(DESTREP4PMS)/.. ; tar cfz /tmp/perl-install.tgz perl-install
-
-get_needed_files: $(SO_FILES)
- export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2.pm < /dev/null
-
- install -d $(DEST)/bin
- install -d $(DEST)/usr/bin
- for i in $(BINS) `grep "\.so" /tmp/list`; do \
- install -s $$i $(DEST)/usr/bin; \
- ldd $$i | sed -e 's/.*=> //' -e 's/ .*//' >> /tmp/list; \
- done
- for i in `sort /tmp/list | uniq`; do \
- install -d $(DEST)/`dirname $$i` && \
- if (echo $$i | grep "\.pm"); then \
- perl -pe '$$_ eq "__END__" and exit(0);' $$i > $(DEST)/$$i; \
- else \
- cp -f $$i $(DEST)/$$i; \
- fi && \
- strip $(DEST)/$$i 2>/dev/null || true; \
- done
- mv $(DEST)/usr/lib/*.so* $(DEST)/lib
-
- ln -sf ../usr/bin/sh $(DEST)/bin/sh
- ln -sf ../usr/bin/tr $(DEST)/bin/tr
- ln -sf sh $(DEST)/bin/bash
- ln -sf ash $(DEST)/usr/bin/sh
-
- echo -e "#!/usr/bin/perl\n\nsymlink '/tmp/rhimage/usr/lib/perl5', '/usr/lib/perl5';\nexec '/bin/sh'" > $(DEST)/usr/bin/runinstall2
- chmod a+x $(DEST)/usr/bin/runinstall2
-
-as_root:
- /bin/dd if=/dev/zero of=/tmp/initrd bs=1k count=4000
- echo y | /sbin/mke2fs /tmp/initrd
- losetup /dev/loop0 /tmp/initrd
- mount /dev/loop0 /mnt/initrd
- chmod a+w /mnt/initrd
-
-full_stage2:
- rm -rf $(DEST)/[^M]*
- @#mkdir -p $(DEST)/Mandrake/base
- @#ln -s .. $(DEST)/Mandrake/instimage
- $(MAKE) get_needed_files
- $(MAKE) stage2
-
-stage2:
- $(MAKE) install_pms
-
- @#rm -rf /mnt/initrd/*
- @#cp -a $(DEST)/* /mnt/initrd
- @#sync
- @#dd if=/dev/loop0 | gzip -9 > /tmp/t/Mandrake/base/stage2.img
-
-
-# function f() { grep "$*" /usr/include/*.h /usr/include/*/*.h; }
+ rm -rf $(BOOT_IMG) $(BOOT_RDZ) $(BINS) modules modules64 install_pcmcia_modules vmlinu* System*.map
+ rm -rf install/*/sbin/install install/*/sbin/init
+ for i in $(DIRS) rescue; do make -C $$i clean; done
+ find . -name "*~" -o -name ".#*" | xargs rm -f
+
+upload: clean install
+ function upload() { rsync -qSavz --verbose --exclude '*~' -e ssh --delete $(ROOTDEST)/$$1/$$2 mandrake@kenobi:/c/cooker/$$1; } ;\
+ upload Mandrake/mdkinst '' ;\
+ upload Mandrake/base compss* ;\
+ upload Mandrake/base *_stage2.gz ;\
+ upload boot '' ;\
+ upload misc genbasefiles ;\
+ upload misc genhdlist_cz2 ;\
+ upload misc make_mdkinst_stage2 ;\
+ upload misc packdrake ;\
+ upload misc rpm2header ;\
+ upload '' live_update ;\
+ for i in $(RELEASE_BOOT_IMG); do upload images $$i; done ;\
+ echo
+
+ perl -pe 'exit if / DrakX </' perl-install/ChangeLog | tools/mailchangelog
+ tools/addchangelog perl-install/ChangeLog 'snapshot uploaded'
+# cvs commit perl-install/ChangeLog # otherwise i always have a conflict :-(
+
+upload_firewall: clean install
+ function upload() { rsync -qSavz --verbose --exclude '*~' -e ssh --delete $(ROOTDEST)/$$1/$$2 mandrake@kenobi:/mnt/BIG/build/corporate/build/Firewall/new/$$1; } ;\
+ upload Mandrake/mdkinst '' ;\
+ upload Mandrake/base compss* ;\
+ upload Mandrake/base *_stage2.gz ;\
+ upload boot '' ;\
+ upload misc genbasefiles ;\
+ upload misc genhdlist_cz2 ;\
+ upload misc make_mdkinst_stage2 ;\
+ upload misc packdrake ;\
+ upload misc rpm2header ;\
+ upload '' live_update ;\
+ for i in $(RELEASE_BOOT_IMG); do upload images $$i; done ;\
+ echo
+
+ perl -pe 'exit if / DrakX </' perl-install/ChangeLog | tools/mailchangelog
+ tools/addchangelog perl-install/ChangeLog 'snapshot uploaded'
+# cvs commit perl-install/ChangeLog # otherwise i always have a conflict :-(
+
+upload_sparc:
+ touch /tmp/mdkinst_done
+ cp -a $(ROOTDEST)/images/* $(UPLOAD_SPARC_DEST)/images ; true
+ cp -a $(ROOTDEST)/boot/* $(UPLOAD_SPARC_DEST)/boot; true
+ cp -a $(ROOTDEST)/misc/* $(UPLOAD_SPARC_DEST)/misc; true
+ rm -rf $(UPLOAD_SPARC_DEST)/Mandrake/mdkinst
+ cp -a $(ROOTDEST)/Mandrake/mdkinst $(UPLOAD_SPARC_DEST)/Mandrake/mdkinst; true
+ ( cd $(ROOTDEST)/Mandrake/base; cp mdkinst_stage2.gz rescue_stage2.gz compss compssList compssUsers compssUsers.desktop $(UPLOAD_SPARC_DEST)/Mandrake/base ); true
+ rm -f /tmp/mdkinst_done
+
+# mkisofs -r -J -b images/cdrom.img -c images/boot.cat /tmp/r /mnt/disk/ | cdrecord -v -eject speed=6 dev=1,0 -
+# as distrib: mv ~/oxygen/oxygen/images ~/tmp/r
+# as mandrake: ~distrib/bin/mkisofs -r -b images/cdrom.img -c images/boot.cat -o /home/ftp/linux-mandrake/pub/mirror/oxyiso/oxygen-3.iso ~distrib/tmp/r ~distrib/oxygen/oxygen
+# as mandrake: remove old iso in /home/ftp/linux-mandrake/pub/mirror/oxyiso
+# as mandrake: cd /home/ftp/linux-mandrake/pub/mirror/oxyiso ; md5sum *.iso > md5sum
+# as distrib: mv ~/tmp/r/images ~/oxygen/oxygen
diff --git a/make_boot_img b/make_boot_img
index e4bea7468..74f2f8b39 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -1,72 +1,321 @@
#!/usr/bin/perl
-@ARGV >= 2 or die "usage: $0 <image> cdrom|hd|network|network_ks\n";
+@ARGV >= 2 or die "usage: $0 <image> all|other|cdrom|hd|hdreiser|network|blank|pcmcia|live|tftp|tftprd\n";
+
+use Config;
+Config->import;
+my ($arch) = $Config{archname} =~ /(.*)-/;
+my $corporate = $ENV{CORPORATE} && " corporate"; #- use this for building a corporate version.
($img, $type) = @ARGV;
-$ks = "kickstart=floppy" if $type =~ s/_ks//;
-$mnt = "/mnt/disk";
+$instdir = "install";
+$mnt = "/tmp/drakx_mnt";
+$mke2fs = "/sbin/mke2fs -q -m 0 -F -s 1";
+
if ($>) {
$sudo = "sudo";
$ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
}
+sub __ { print @_, "\n"; system(@_); }
+sub _ { __ @_; $? and die; }
+
+_ "$sudo mkdir $mnt" unless -e $mnt;
+_ "$sudo mkdir ${mnt}2" unless -e "${mnt}2";
$install = $ {{
+ all => "full-install",
+ other => "full-install",
+ blank => "full-install",
+ live => "full-install",
+ tftp => "full-install",
+ tftprd => "full-install",
+ pcmcia => "full-install",
network => "install",
cdrom => "local-install",
- hd => "local-install"
+ hd => "local-install",
+ hdreiser => "local-install",
+ live64 => "full-install",
+ tftp64 => "full-install",
+ tftprd64 => "full-install",
+ pcmcia64 => "full-install",
+ network64 => "install",
+ cdrom64 => "local-install",
+ hd64 => "local-install",
}}{$type} or die;
-$0 =~ /initrd/ ?
- initrd($mnt, $img) :
- boot_img($mnt, $img);
-
-sub __ { print @_, "\n"; system(@_); }
-sub _ { __ @_; $? and die; }
+$img =~ /rdz$/ ? initrd($mnt, $img) : $::{"boot_img_$arch"}->($mnt, $img);
+sub install_s { _ "strip $_[0]"; _ "$sudo install $_[0] $_[1]" }
sub initrd {
my ($mnt, $img) = @_;
+ my ($ltype, $I) = $type =~ /(.*?)(64)/; $ltype ||= $type;
my $tmp = "$ENV{HOME}/tmp/initrd";
-
- _ "install -s install/installinit/init install/install1/sbin/init";
- _ "install -s install/$install install/install1/sbin/install";
+ my $tar = "$instdir/install1.tar.bz2";
__ "$sudo umount $tmp $mnt 2>/dev/null";
- _ "dd if=/dev/zero of=$tmp bs=1k count=2000";
- _ "echo y | mke2fs $tmp";
- _ "$sudo mount $tmp $mnt -o loop";
- _ "$sudo cp -a install/install1/* $mnt";
- _ "$sudo install -d $mnt/modules";
- _ "$sudo cp -f modules/${type}_modules.cgz $mnt/modules/modules.cgz";
- _ "$sudo cp -f modules/modules.dep $mnt/modules/";
+ _ "dd if=/dev/zero of=$tmp bs=1k count=" . ($type eq "all" ? 4000 : 2000);
+ _ "$mke2fs $tmp";
+ _ "$sudo mount -t ext2 $tmp $mnt -o loop";
+
+ _ "$sudo tar xyC $mnt -f $tar";
+ install_s("$instdir/installinit/init", "$mnt/sbin");
+ install_s("$instdir/$install", "$mnt/sbin/install");
+
+ my $ftype = $type =~ /^(all)$/ ? "pcmcia" : $type;
+ if ($ftype eq "pcmcia") {
+ unlink "$mnt/sbin/sh";
+ _ "$sudo cp -a tools/$arch/sh $mnt/sbin";
+ _ "$sudo cp -a /etc/pcmcia $mnt/etc";
+ _ "$sudo patch -p0 -d $mnt/etc < $instdir/pcmcia_config.patch";
+ }
+ _ "$sudo cp -f install_${ftype}_modules/* $mnt/modules/" if -d "install_${ftype}_modules";
+ _ "$sudo cp -f modules$I/${ltype}_modules.cgz $mnt/modules/modules$I.cgz" if $type !~ /blank/;
+ _ "$sudo cp -f modules$I/modules.dep $mnt/modules/";
_ "$sudo umount $mnt";
- _ "gzip -9 -c $tmp > $img";
- _ "rm -f $tmp";
+
+# Workaround for vfat-loop bug (quite touchy)
+ _ "gzip -9f $tmp";
+ _ "cp -f $tmp.gz $img";
+ _ "rm -f $tmp.gz";
+# _ "gzip -9 -c $tmp > $img";
+# _ "rm -f $tmp";
}
-sub boot_img {
+sub boot_img_i386 {
my ($mnt, $img) = @_;
__ "$sudo umount $mnt 2>/dev/null";
- _ "bunzip2 -c install/installinit/emptyboot.img.bz2 > $img";
- _ "$sudo mount -o umask=0 $img $mnt -o loop";
- _ "cat vmlinuz > $mnt/vmlinuz";
- initrd("${mnt}2", "$mnt/initrd.gz");
-
+ if ($type eq "hd") {
+ _ "bunzip2 -c $instdir/installinit/msgboot.img.bz2 > $img";
+ } elsif ($type eq "all") {
+ _ "bunzip2 -c $instdir/installinit/msgboot-graphicallogo-2880.img.bz2 > $img";
+ } else {
+ _ "bunzip2 -c $instdir/installinit/msgboot-graphicallogo.img.bz2 > $img";
+ }
+ _ "$sudo mount -t msdos -o umask=0 $img $mnt -o loop";
+ _ "cat vmlinuz > $mnt/vmlinuz" if $type !~ /blank/;
+ -f "$type.rdz" ? _ "cp -f $type.rdz $mnt" : initrd("${mnt}2", "$mnt/$type.rdz");
+
+ my $ftype = $type =~ /^(other|all)$/ ? "cdrom" : $type;
+ my $timeout = 72;
output("$mnt/syslinux.cfg", "
default linux
-prompt 0
+prompt 1
+timeout $timeout
+display boot.msg
+F1 help.msg
+F2 boot.msg
label linux
kernel vmlinuz
- append $ks initrd=initrd.gz mdkinst $type
+ append ramdisk_size=32000 initrd=$type.rdz $ftype vga=788
+label vgalo
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype vga=785
+label vgahi
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype vga=791
+label vga16
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype vga16
+label text
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype text
+label patch
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype patch vga=788
+label expert
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype expert vga=788
+label rescue
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype rescue rw
+label lnx4win
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype lnx4win vga=788
+label preinst
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=all.rdz cdrom rescue oem rw
+label oem
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=all.rdz cdrom rescue oem rw
+label auto
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz $ftype auto_install=Mandrake/base/auto_inst.cfg.pl
+label all
+ kernel vmlinuz
+ append ramdisk_size=32000 initrd=$type.rdz pcmcia vga=788
");
- _ "cp -f install/installinit/ks.cfg $mnt 2>/dev/null" if $ks;
_ "sync";
+ _ "df $mnt";
}
+sub boot_img_alpha {
+ my ($mnt, $img) = @_;
+
+ __ "$sudo umount $mnt 2>/dev/null";
+ _ "dd if=/dev/zero of=$img bs=1k count=1440";
+ _ "$mke2fs $img";
+ _ "/sbin/e2writeboot $img /boot/bootlx";
+ _ "$sudo mount -t ext2 $img $mnt -o loop";
+ _ "cp -f vmlinux.gz $mnt" if $type !~ /blank/;
+ -f "$type.rdz" ? _ "cp -f $type.rdz $mnt" : initrd("${mnt}2", "$mnt/$type.rdz");
+
+ mkdir "$mnt/etc", 0777;
+ output("$mnt/etc/aboot.conf",
+"0:vmlinux.gz initrd=$type.rdz rw ramdisk_size=32000 $type
+1:vmlinux.gz initrd=$type.rdz rw ramdisk_size=32000 text $type
+");
+ _ "sync";
+ _ "df $mnt";
+}
+sub boot_img_sparc {
+ my ($mnt, $img) = @_;
+ if ($type =~ /^live(.*)/) {
+ #- hack to produce directly into /export the needed file for cdrom boot.
+ my $dir = "/export";
+ my $boot = "boot"; #- non-absolute pathname only!
+
+ _ "mkdir -p $dir/$boot";
+ _ "cp -f /boot/cd.b /boot/second.b $dir/$boot";
+ _ "cp -f vmlinux$1 $dir/$boot/vmlinux$1";
+ -f "live$1.rdz" ? _ "cp -f live$1.rdz $dir/$boot" : initrd("${mnt}2", "$dir/$boot/live$1.rdz");
+
+ output("$dir/$boot/silo.conf", "
+partition=1
+default=linux
+timeout=100
+read-write
+message=/$boot/boot.msg
+image=\"cat /$boot/boot.msg\"
+ label=1
+ single-key
+image=\"cat /$boot/general.msg\"
+ label=2
+ single-key
+image=\"cat /$boot/expert.msg\"
+ label=3
+ single-key
+image=\"cat /$boot/rescue.msg\"
+ label=4
+ single-key
+image=\"cat /$boot/kickit.msg\"
+ label=5
+ single-key
+image=\"cat /$boot/param.msg\"
+ label=6
+ single-key
+image[sun4c,sun4d,sun4m]=/$boot/vmlinux
+ label=linux
+ alias=install
+ initrd=/$boot/live.rdz
+ append=\"ramdisk_size=32000$corporate\"
+image[sun4c,sun4d,sun4m]=/$boot/vmlinux
+ label=text
+ initrd=/$boot/live.rdz
+ append=\"ramdisk_size=32000 text$corporate\"
+image[sun4c,sun4d,sun4m]=/$boot/vmlinux
+ label=expert
+ initrd=/$boot/live.rdz
+ append=\"ramdisk_size=32000 expert$corporate\"
+image[sun4c,sun4d,sun4m]=/$boot/vmlinux
+ label=ks
+ initrd=/$boot/live.rdz
+ append=\"ramdisk_size=32000 ks$corporate\"
+image[sun4c,sun4d,sun4m]=/$boot/vmlinux
+ label=rescue
+ initrd=/$boot/live.rdz
+ append=\"ramdisk_size=32000 rescue rw root=/dev/ram3$corporate\"
+image[sun4u]=/$boot/vmlinux64
+ label=linux
+ alias=install
+ initrd=/$boot/live64.rdz
+ append=\"ramdisk_size=32000$corporate\"
+image[sun4u]=/$boot/vmlinux64
+ label=text
+ initrd=/$boot/live64.rdz
+ append=\"ramdisk_size=32000 text$corporate\"
+image[sun4u]=/$boot/vmlinux64
+ label=expert
+ initrd=/$boot/live64.rdz
+ append=\"ramdisk_size=32000 expert$corporate\"
+image[sun4u]=/$boot/vmlinux64
+ label=ks
+ initrd=/$boot/live64.rdz
+ append=\"ramdisk_size=32000 ks$corporate\"
+image[sun4u]=/$boot/vmlinux64
+ label=rescue
+ initrd=/$boot/live64.rdz
+ append=\"ramdisk_size=32000 rescue rw root=/dev/ram3$corporate\"
+");
+
+ output("$dir/$boot/README", "
+To Build a Bootable CD-ROM, try:
+ mkisofs -R -o t.iso -s /$boot/silo.conf /export
+");
+ } elsif ($type =~ /^tftprd(.*)/) {
+ my $dir = "/export";
+ my $boot = "images";
+ my $setarch = $1 ? "sparc64" : "sparc32";
+
+ _ "mkdir -p $dir/$boot";
+ -f "$type.rdz" or initrd("${mnt}2", "$type.rdz");
+ _ "cp -f vmlinux$1.aout $dir/$boot/$type.img";
+ _ "$setarch kernel$1/src/arch/sparc$1/boot/piggyback $dir/$boot/$type.img kernel$1/boot/System.map $type.rdz";
+ } elsif ($type =~ /^tftp(.*)/) {
+ my $dir = "/export";
+ my $boot = "images";
+
+ _ "mkdir -p $dir/$boot";
+ _ "cp -f vmlinux$1.aout $dir/$boot/$type.img";
+ } else {
+ my $dir = "floppy";
+ my ($ltype, $I) = $type =~ /(.*?)(64)/; $ltype ||= $type;
+
+ __ "$sudo umount $mnt 2>/dev/null";
+ _ "rm -rf $dir";
+ _ "mkdir -p $dir";
+ _ "cp -f /boot/fd.b /boot/second.b $dir";
+ _ "cp -f vmlinuz$I $dir/vmlinux$I.gz" if $type !~ /blank/;
+ -f "$type.rdz" ? _ "cp -f $type.rdz $dir" : initrd("${mnt}2", "$dir/$type.rdz");
+
+ output("$dir/boot.msg", "
+Welcome to Linux-Mandrake 7.1
+
+Press <Enter> to install or upgrade a system 7mLinux-Mandrake7m
+");
+
+ output("$dir/silo.conf", "
+partition=1
+default=linux
+timeout=100
+read-write
+message=/boot.msg
+image=/vmlinux$I.gz
+ label=linux
+ initrd=/$type.rdz
+ append=\"ramdisk_size=32000 $ltype$corporate\"
+");
+ _ "genromfs -d $dir -f /dev/ram -A 2048,/.. -a 512 -V \'DrakX boot disk\'";
+ _ "$sudo mount -t romfs /dev/ram $mnt";
+ _ "silo -r $mnt -F -i /fd.b -b /second.b -C /silo.conf";
+ _ "$sudo umount $mnt";
+ _ "dd if=/dev/ram of=$type.img bs=1440k count=1";
+ _ "sync";
+ _ "$sudo mount -t romfs /dev/ram $mnt";
+ _ "df $mnt";
+ }
+}
+
+sub boot_img_ppc {
+ my ($mnt, $img) = @_;
+ # Here's a quick hack... just to give the script somethign to do. :)
+ # We do not yet have a set way of making bootable images.
+ _ "cp $type.rdz $img";
+}
sub output {
my $f = shift;
diff --git a/make_ks_from_floppy b/make_ks_from_floppy
index 2ab7dde95..0c2c48331 100755
--- a/make_ks_from_floppy
+++ b/make_ks_from_floppy
@@ -1,4 +1,10 @@
+#!/bin/sh
+
+ks="install/ks.cfg"
+
+[ -e $ks ] || { echo "missing file $ks, create one based on $ks.default"; exit 1; }
+
sudo mount /mnt/floppy
-cp -f install/installinit/ks.cfg /mnt/floppy
+cp -f $ks /mnt/floppy
perl -pi -e 's/prompt 1//; s/\s*kickstart=\S+//g; s/append/append kickstart=auto_inst.cfg.pl/' /mnt/floppy/syslinux.cfg
sudo umount /mnt/floppy
diff --git a/perl-install/.cvsignore b/perl-install/.cvsignore
index 83df09879..d783193d2 100644
--- a/perl-install/.cvsignore
+++ b/perl-install/.cvsignore
@@ -1,8 +1,6 @@
-unused
-keymaps
-consolefonts
-modparm.lst
-locales.tar.bz2
debug.log
auto_inst.cfg
-perl
+auto
+t.pm
+modparm.lst
+*.flog
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 3c1566445..520f7f4da 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,16 +1,2730 @@
-1999-12-19 Pixel <pixel@mandrakesoft.com>
+2000-11-27 DrakX <install@linux-mandrake.com>
- * install2.pm (configureX): write current fstab and conf.modules
- before X configuration (da
+ * snapshot uploaded
+
+2000-11-06 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * keyboard.pm: added QWERTY and "programmers" layouts for Czech and
+ Slovak keyboards
+
+2000-10-19 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-17 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-16 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * standalone/keyboarddrake,keyboard.pm: corrected BackSpace setting
+
+2000-10-10 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/drakgw: make only one call to urpmi in order
+ to install all the needed rpm's
+
+2000-10-10 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-10 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm: increase $::VERSION
+
+2000-10-09 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-09 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/po/fr.po: update after Dam's new messages in netconnect
+
+2000-10-09 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-09 Pixel <pixel@mandrakesoft.com>
+
+ * install_any.pm (kdeicons_postinstall): remove the handling of
+ doc desktop icons. see dadou
+
+2000-10-09 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/compssUsers: new list (with icons)
+
+ * share/list: add icons for compssUsers
+
+2000-10-09 dam's <damien@mandrakesoft.com>
+
+ * standalone/draknet: added wait message
+
+2000-10-09 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-09 Pixel <pixel@mandrakesoft.com>
+
+ * share/themes-*.rc: change the fg[INSENSITIVE] entry
+
+2000-10-09 François Pons <fpons@mandrakesoft.com>
+
+ * install_any.pm: added tuxracer in OpenGL games to install if an
+ accelerated card has been found.
+
+2000-10-09 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (main): asking connection after writing start/stop scripts.
+ (adsl_conf): if during install, don't use chkconfig, make the
+ links directly for the adsl init script.
+
+2000-10-09 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-09 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (afterInstallPackages): UserView in kdmrc is
+ now true by default. So put false if security >= 3 instead of
+ removing it.
+
+2000-10-09 François Pons <fpons@mandrakesoft.com>
+
+ * any.pm: default speed of modem set to 115200.
+
+ * fs.pm: fixed format of RAID partition.
+
+ * install_interactive.pm: take into account RAID partitions for
+ searching / partition.
+
+2000-10-09 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-09 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (selectKeyboard): don't assume $o->{langs} is set
+ (selectLanguage): don't set $o->{langs} (so that you can go back
+ and it works)
+
+ * common.pm (round_up, round_down): ensure number is an integer
+
+ * install_steps_interactive.pm (chooseGroups): take into account
+ the min_level to compute the size
+
+2000-10-08 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePackages): move the
+ computing of max_size before calling chooseGroups (not the one for
+ desktop meta_class)
+ (chooseGroups): compute the size of Miscellaneous
+
+2000-10-07 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-07 Pixel <pixel@mandrakesoft.com>
+
+ * share/compssList: don't install locales-* even in 'all' install
+ (those files are usefull if RPM_INSTALL_LANG doesn't include that
+ lang)
+
+2000-10-07 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-07 Pixel <pixel@mandrakesoft.com>
+
+ * pkgs.pm (install): log the gonna be installed packages (-> be
+ able to track not installed packages that should have been
+ installed)
+
+2000-10-06 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-06 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (pppConfig): the domain used for kppp is copied in resolv.conf
+ (intro): connection detection improved : now use "ifconfig | grep interface"
+ (pppConfig): corrected cnx_up/down
+
+2000-10-06 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-06 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (afterInstallPackages): don't fail if
+ kdeglobals file is not there
+
+ * share/compssUsers.desktop: fix icons
+
+ * detect_devices.pm (cdroms): fix for scsi cdrom drives
+
+ * pci_probing/pcitable: put cs46xx instead of snd-card-cs461x
+ (dixit jeff)
+
+ * diskdrake.pm (Resize): comment ext2&reiserfs resizing for the
+ moment
+
+2000-10-06 Frederic Lepied <flepied@mandrakesoft.com>
+
+ * Xconfigurator.pm (write_XF86Config): added mode of wacom devices
+
+2000-10-06 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (ask_connect_now): connection is now tested.
+
+2000-10-06 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_interactive.pm, install_steps_gtk.pm: updated
+ license.
+
+ * Xconfigurator.pm: removed Matrox G200/G400 3D acceleration by
+ DRI, use only Mesa with Utah GLX, fixed autologin for avoiding
+ drakres and no wm available, moved Riva128 card from experimental
+ to stable, fixed presentations of text.
+
+ * pci_probing/pcitable: fixed Cirrus Logic sound card.
+
+2000-10-06 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-06 François Pons <fpons@mandrakesoft.com>
+
+ * install2.pm: fixed bad call to hasUsb...
+
+ * share/Cards+: fixed wrong use of SiS card with 4.0.1, only keep
+ 530, 620 and 6326 with XFree 4.0.1.
+
+2000-10-06 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-06 Pixel <pixel@mandrakesoft.com>
+
+ * share/list: remove /usr/X11R6/lib/X11/Cards, not needed anymore
+
+ * install_steps.pm (afterInstallPackages): put the Charset in
+ kdeglobals, otherwise kde uses charset iso8859-1 :(
+
+ * lang.pm (charset): created
+
+ * common.pm (update_userkderc): fix it, change the argument
+ passing
+
+2000-10-05 Pixel <pixel@mandrakesoft.com>
+
+ * share/compssList: raise kde-i18n-*, should be installed whenever
+ kdebase is installed
+
+ * pci_probing/pcitable: integrate patch from viet (concerns
+ sym53c8xx cards)
+
+ * share/compssUsers: use "documentation" as the database icon
+
+ * install_steps_interactive.pm (chooseGroups): fix to accept icons
+ not in the format "*_section.xpm"
+
+ * install2.pm (miscellaneous): put yes/no in sysconfig/usb entries
+
+2000-10-05 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (adsl_conf): updated pppoe conf.
+ (main): added $netc->{minus_one} to avoid to count dhcp configured
+ eth when asking to share the connection.
+ (adsl-pppoe): improvement. Should work now.
+ (miscellaneous): corrected chmod 755 to 744 for connections scripts
+
+ * netconnect.pm (main): network is stopped then started, instead
+ of restarted.
+
+2000-10-05 François Pons <fpons@mandrakesoft.com>
+
+ * live_install: added icons (this fixes the yellow on white
+ tooltips problem).
+
+ * install_any.pm: added ghostscript-utils in the list of packages
+ to copy when changing CD.
+
+ * printerdrake.pm: install ghostscript-utils if a lexmark printer
+ is selected on cups.
+
+2000-10-05 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-05 Pixel <pixel@mandrakesoft.com>
+
+ * install_any.pm (loadO): look for auto_inst.cfg in /, not in
+ /Mandrake/base
+
+2000-10-05 François Pons <fpons@mandrakesoft.com>
+
+ * netconnect.pm: fixed syntax error.
+
+ * share/po/i18n_compssUsers: simplified version and fixed
+ dependancies to pkgs.pm (for building drakxtools).
+
+2000-10-04 François Pons <fpons@mandrakesoft.com>
+
+ * install_gtk.pm: removed 80 pixel on height for live upgrade.
+
+ * install_steps.pm: do not set keyboard when live upgrade after
+ setting the language.
+
+ * install_steps_gtk.pm: fixed the trying to start a X server on
+ live.
+
+2000-10-04 Pixel <pixel@mandrakesoft.com>
+
+ * share/po/i18n_compssUsers: fake module ``c'' so that no need to
+ build DrakX to use i18n_compssUsers
+
+ * install_steps_interactive.pm (selectLanguage): update license
+
+ * install_steps_gtk.pm (installPackages): add second license for
+ shitty soft (commercial one)
+
+2000-10-04 dam's <damien@mandrakesoft.com>
+
+ * draknet (netconnect.pm and network.pm): various translations
+ corrected, network is restarted, buttons connect/disconnect
+ debugged.
+
+2000-10-04 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-04 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm (main): kill prefdm instead of autologin
+
+ * install_any.pm (find_root_parts): don't use
+ suggest_mount_points, it couldn't do what we wanted
+ (guess_mount_point): created, contains the common stuff between
+ suggest_mount_points and find_root_parts
+
+2000-10-04 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/drakgw: fix some failing/untranslated i18n messages
+
+ * share/po/fr.po: write translations according to drakgw
+
+2000-10-04 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: removed bad card for 3D Rage Pro.
+
+ * install_any.pm: removed Aurora for SiS card, add more case for
+ detecting right cdrom for live upgrade, fixed wrong list of
+ packages for laptops.
+
+ * c/stuff.xs.pm: added time interval of 200ms between update of
+ progression bar of install, make sure the last step is seen.
+
+2000-10-04 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-04 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (when_load): stricter regexp for $type is scsi or not
+ (so that scsi_mod with is scsi_raw doesn't get an alias
+ scsi_hostadapter)
+
+ * detect_devices.pm (isLS120Drive): extend the regexp to include
+ "Caleb Technology - 144MB FDD UHD Floppy"
+
+ * detect_devices.pm (burners, IDEburners): reworked, renamed, now
+ works!
+ * c/stuff.xs.pm (isBurner): created
+
+ * modules.pm (load_ide): make sure ide-cd is loaded!
+
+ * install_steps_interactive.pm (chooseGroups): the label and help
+ are now translated (at least will be), so use the translations
+
+2000-10-03 Pixel <pixel@mandrakesoft.com>
+
+ * share/po/Makefile (DrakX.pot): added the to-be-translated from
+ compssUsers
+ * share/po/i18n_compssUsers: read the compssUsers's and output the
+ to-be-translated in po format
+
+ * log.pm (l): log to STDERR instead of STDOUT
+
+ * install_any.pm (loadO): use first floppy drive available (won't
+ help much though, as stage1 doesn't follow this...)
+
+2000-10-03 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-03 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm (autologin): don't propose autologin in
+ security > 3
+
+ * common.pm (availableRamMB): HACK HACK if i810 and memsize,
+ returns 127
+
+ * bootloader.pm (suggest): don't use grub if more than 800MB
+
+2000-10-04 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/po/validate.pl: create this tool
+
+ * share/po/fr.po: fix many typos
+
+ * share/po/fr.po: make compssUsers translation
+
+2000-10-03 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator_consts.pm: changed resolution allocation.
+
+ * fs.pm: removed no more used log.
+
+ * install2.pm: add exit button if live upgrade.
+
+ * install_any.pm: increased minimal available size to 65Mb.
+
+ * install_steps.pm, standalone/printerdrake: fixed cups to CUPS
+ for mode.
+
+ * printerdrake.pm: fixed not_edit for lpr mode of printerdrake.
+
+ * share/Cards+: fixed Savage2000 entry.
+
+2000-10-03 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-03 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: updated bad card with Rage Mobility card.
+
+ * live_install: added test of root user, abort if not root.
+
+2000-10-03 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/po/fr.po: fixed bug #518 and fixed other misc errors
+
+2000-10-03 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-10-02 François Pons <fpons@mandrakesoft.com>
+
+ * diskdrake.pm (Resize): fix to make ext2resizing work a little
+ better
+
+ * install_steps.pm: fixed installation of urpmi configuration.
+
+ * detect_devices.pm: updated comment about UltraDMA66/100
+ management.
+
+ * modules.pm: updated comment about UltraDMA66/100 management.
+
+ * diskdrake.pm: adding a cylinder for the minimum of the resize
+ and if there is nothing to do for resize, simply return.
+
+ * install_any.pm: added missing require pkgs.
+
+2000-10-02 Pixel <pixel@mandrakesoft.com>
+
+ * many files: remove many lnx4win special cases which are not
+ needed anymore
+
+ * any.pm (addUsers): grpuser output goes to Mr Dave
+
+ * bootloader.pm (install_lilo): change the default color of menu
+
+ * install_steps_interactive.pm (choosePackages): add 300MB choice
+ in desktop
+
+ * mouse.pm (fullnames): fix i18n fix
+
+ * install_steps.pm (miscellaneous): don't add ide2=0x... for
+ ultra66 (otherwise chmouel is not happy, so is hdc being hde)
+
+ * Xconfigurator.pm (main): add handling of icewm logout
+
+ * c/stuff.xs.pm: changed the stepping of "Progressing installing package"
+
+2000-10-02 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (main): infos are written only when needed.
+ * netconnect.pm (intro): connection checking now works.
+
+2000-10-02 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+
+ * pci_probing/pcitable: s|snd-card-via686a|via82cxxx_audio|; like
+ jeff request.
+
+2000-09-30 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-30 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm: a LOT of bugs fixed. draknet is now completely
+ brok^H^H^H^Hfrozen.
+
+2000-09-29 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-29 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (adsl_conf): dhcp should better work.
+
+ * network.pm (configureNetwork): remove connection script if a
+ gateway is given.
+
+ * common.pm (setVarsInShMode): created. chmod the file with
+ permissions passed in argument.
+
+2000-09-29 François Pons <fpons@mandrakesoft.com>
+
+ * modules.pm (load): fixed when standalone, use modprobe.
+
+ * pkgs.pm: added preference for wu-ftpd.
+
+ * detect_devices.pm: added code to proble USB printer.
+
+ * printer.pm: fixed missing PRINTER=yes on CUPS configuration for
+ USB printer.
+
+ * install_steps.pm: removed possibilty to add an user in urpmi
+ group (jloup).
+
+ * install_steps_interactive.pm: log if CD not ejectable.
+
+2000-09-29 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/compssList: sync with latest packages
+
+ * install_steps_interactive.pm (selectLanguage($)): s/42/43/ in
+ MandrakeSoft physical address
+
+2000-09-29 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-29 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (intro): detection of internet
+ configuration/connexion state.
+
+ * network.pm (write_resolv_conf): better "ppp temp nameserver" in resolv.conf
+
+2000-09-28 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (load_thiskind): add read_already_loaded cuz of
+ pcmcia
+
+2000-09-28 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/compssList: add nasty DrakSync and DrakProfile with 50 0 50
+
+2000-09-28 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-28 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePackages): the minimum is 25
+ in beginner, not 10
+
+ * pkgs.pm (readCompssUsers): fix reading description
+
+ * install_steps.pm (afterInstallPackages): remove the code to
+ handle RPM-GPG-KEYS
+
+2000-09-28 dam's <damien@mandrakesoft.com>
+
+ * interactive_gtk.pm (ask_from_list_with_helpW): no more theme
+ parsing, no more draknet.rc
+
+ * netconnect.pm (read_net_conf): no adsl tree anymore.
+
+ * netconnect.pm: drakgw called if enough card are installed.
+
+ * netconnect.pm: minor bugs correction.
+
+2000-09-28 François Pons <fpons@mandrakesoft.com>
+
+ * Makefile.config: added livedrake for drakxtools.
+ * diskdrake.pm: use corrected partition size when resizing a dos
+ partition (like the others).
+ * install_any.pm: no more pnm2ppa packages and others in package
+ to copy when changing CD.
+ * live_install: exec live_install2 instead.
+ * live_install2: contains post live upgrade stuff now.
+ * printerdrake.pm: protect set_help() usage by if $::isInstall,
+ removed reference to package pnm2ppa and others.
+ * standalone/livedrake: initial release for drakxtools.
+
+2000-09-28 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-28 Pixel <pixel@mandrakesoft.com>
+
+ * install_interactive.pm (partitionWizardSolutions): fix the limit
+ cases for lnx4win
+
+ * share/po/Makefile ($(PMSCFILES)): fix the DrakX.pot generation
+
+2000-09-27 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePackages): set $size2install
+ to $availableC in desktop install, as it should be
+
+ * install2.pm (choosePackages): remove the code for removing kdesu
+ in high security...
+
+ * install_steps_interactive.pm (createBootdisk): format more
+ nicely the text
+
+ * install_steps_gtk.pm (installPackages): add 10 seconds to have a
+ better estimation
+
+ * install_steps_interactive.pm (chooseGroups): now returns a boolean
+ (choosePackages): use chooseGroups return value to redo
+ choosePackages
+
+ * install_steps_gtk.pm (selectMouse): if mouse type is none, then
+ don't test!
+
+ * Xconfigurator.pm (monitorConfiguration): rename Unlisted to Custom
+
+ * various: replace all Rescue by Update
+
+ * pkgs.pm (readCompssUsers): read description for groups
+
+ * install_steps_interactive.pm (chooseGroups): add description for
+ groups
+
+2000-09-27 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/compssUsers.desktop: added description
+
+ * share/compssUsers: added description
+
+ * share/compssUsers.desktop: added icon support, reordered,
+ renamed
+
+ * share/compssUsers: reordered, renamed
+
+2000-09-27 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-27 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (selectLanguage): intregrate
+ license again
+
+ * pkgs.pm (readCompssUsers): reads compssUsers.meta_class
+
+ * diskdrake.pm (Create): replace ``ne "i386"'' by ``!~ /i.86/''
+ (as should be)
+
+ * install_steps_gtk.pm (selectInstallClass1): if @$l (list of
+ install classes) contains only one element, call
+ install_steps_interactive::selectInstallClass1
+
+ * install_steps_interactive.pm (choosePartitionsToFormat): fix for
+ "no partitions selected to format"
+
+ * my_gtk.pm (_create_window): alt-e now *toggles* expert/newbie
+
+2000-09-27 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * share/compssList: more for gnupg, -11 for sucking things,
+ changed compss-groups to be less than 70.
+
+ * share/compssUsers: modified compssUsers with Warly, added
+ compssUsers.desktop, simplified for KD (now uses Graphical
+ Desktop/KDE instead of listing all relevant packages)
+
+2000-09-27 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (get_info_adsl_providers, read_adsl_providers):
+ Created. adsl provider tree.
+ (set_net_conf): better informations storing.
+
+ * my_gtk.pm (new): windows are always centered if standalone.
+
+2000-09-27 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: added option "sw_cursor" for S3 Trio3D. fixed
+ 3D hw acceleration for i815 (VideoRam). prefer XF3 for all
+ NeoMagic cards.
+ * install_gtk.pm: re-enabled themes on live upgrade but without
+ modifying background image.
+ * install_steps_gtk.pm: fixed missing help.
+ * live_install: lot of fixes to enable DrakX font, keep upgraded
+ system clean (libperl.so which allows graphical login).
+ * pkgs.pm: added function allowedToUpgrade to filter kernel
+ package.
+
+2000-09-27 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-27 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (configureX): if `clicked' don't go
+ to auto mode
+
+ * Xconfigurator.pm (monitorConfiguration): fix the translated
+ 'Generic' which is not so (and must not be so) anymore
+
+2000-09-26 Pixel <pixel@mandrakesoft.com>
+
+ * pkgs.pm: remove all Unskip code
+
+ * my_gtk.pm (_create_window): add shortcut alt-e to switch to
+ expert
+
+ * Xconfigurator.pm (resolutionsConfiguration): fix for setting
+ legal resolution
+
+ * install_steps_interactive.pm (selectLanguage): use formatAlaTeX
+ on the license
+
+2000-09-26 François Pons <fpons@mandrakesoft.com>
+
+ * fs.pm: added mounting of swap partition when mounting them
+ all (this can help :-)
+ * pkgs.pm: fixed correction size code to make (really) a true
+ bijection between corrected and rpm size.
+
+2000-09-26 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-26 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (selectLanguage): integrate the
+ license (temporary one)
+
+ * modules.pm (write_conf): fix the /etc/modules generation
+
+ * interactive_gtk.pm (ask_many_from_listW): if more than 5 entries
+ in icon format, use scrollbar. In non-icon format, use scrollbar
+ for more than 11 entries.
+
+ * commands.pm (bug): add ddcxinfos
+
+ * pci_probing/pcitable: replace tulip by de4x5 for 2104x cards
+
+2000-09-26 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: added more 3D Rage Pro card for 3D
+ acceleration with Utah-GLX (Rage Mobility, Rage XC/XL),
+ modified identification for checking acceleration.
+ * install_any.pm: added automatic installation (up 60) for
+ OpenGL games if a graphic card MAY BE accelerated.
+ * live_install: fixed perl idioms in pure shell script and added
+ packdrake symlink if not already installed.
+ * share/compssList: changed level to -1 for all needing 3D hw
+ acceleration packages.
+
+2000-09-26 dam's <damien@mandrakesoft.com>
+
+ * network.pm (write_resolv_conf): write temp dns line to be used
+ with new initscripts package. Use to set dns live.
+
+2000-09-26 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-26 Pixel <pixel@mandrakesoft.com>
+
+ * mouse.pm (read): catch exception if fullname2mouse fails (eg:
+ old FULLNAME format)
+
+2000-09-25 Pixel <pixel@mandrakesoft.com>
+
+ * share/MonitorsDB: merge with latest redhat MonitorsDB
+
+ * pci_probing/pcitable: major merge with latest redhat pcitable
+
+ * share/Cards+: added "Intel 815", renamed "Rage 128 (generic)" to
+ "Rage 128", added "Rage 128 Mobility"
+
+ * install_any.pm (getAvailableSpace): keep 10% of free space on
+ big partitions
+
+ * Xconfigurator.pm (readMonitorsDB): don't translate Generic
+ (otherwise, only a part is translated, see MonitorsDB for the
+ non-translated part)
+
+ * interactive.pm (ask_many_from_list): fix sorting
+
+ * install_gtk.pm (test_mouse): smaller box to fit in 640x480
+
+ * install_steps.pm (afterInstallPackages, beforeInstallPackages):
+ RPM-GPG-KEYS is copied before installing packages
+
+ * pkgs.pm (readCompssUsers): handle icons in compssUsers
+
+ * common.pm (truncate_list): ensure the list is not too big
+
+ * install_steps_gtk.pm (choosePackagesTree): restrict the list to
+ 20 elements if it is too big (use truncate_list)
+
+2000-09-25 François Pons <fpons@mandrakesoft.com>
+
+ * bootloader.pm: add Video mode for entry.
+ * fs.pm: updated for live upgrade.
+ * install2.pm: dropped unuseful steps filtering.
+ * install_any.pm: fixed wrong Device3Dfx package name and clean
+ postinstall rpms directory on upgrade before filling it.
+ * install_gtk.pm: removed window restrictions of live upgrade.
+ * install_steps.pm: fixed initrd symlink following in case of
+ upgrade.
+ * install_steps_gtk.pm, install_steps_interactive.pm: keep always
+ upgrade on live upgrade.
+ * modules.pm: may fixed pcmcia lost driver (typically on network).
+ * pkgs.pm: fixed (uggly?) usage of floating perl data on perl
+ script :-)
+ * printer.pm: back to "Generic PostScript" for default printer (jloup).
+ * printerdrake.pm: make sure an expert can choose among available
+ devices.
+
+2000-09-25 dam's <damien@mandrakesoft.com>
+
+ * network.pm (write_resolv_conf): write '# ppp temp entry adsl' in
+ /etc/resolv.conf if needed.
+
+ * netconnect.pm : adsl connection does'nt need any dns anymore.
+
+ * netconnect.pm (read_net_conf): created. draknet now stores and
+ reload the config.
+
+ * netconnect.pm (main): if the user is french and uses french
+ keyboard, don't ask his country.
+
+2000-09-25 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm: added 8139too
+
+ * share/Cards+: GeForce2 DDR is handled by driver "nv"
+
+ * Xconfigurator.pm (main): in killall X for Xdrakres, also killall
+ kdm/xdm/gdm/autologin :)
+
+2000-09-25 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-25 dam's <damien@mandrakesoft.com>
+
+ * network.pm (configureNetwork): Warn user if he already
+ configured the interface.
+
+2000-09-24 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (mergein_conf): created. call read_conf, fills
+ %modules::conf and set $modules::scsi
+
+2000-09-24 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/drakgw (fatal_quit($)): add log of reason of fatal_quit
+
+2000-09-24 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-24 Pixel <pixel@mandrakesoft.com>
+
+ * commands.pm (bug): use first floppy drive instead of fd0 hard
+ coded (nice for LS120's)
+
+ * install_steps_gtk.pm (selectMouse): if device changed, do the
+ test
+ * standalone/mousedrake: fix for serial mice
+ * install_steps_interactive.pm (selectMouse): fix for serial mice
+
+2000-09-23 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (conf_network_card): now displays the modules of
+ detected ethernet cards.
+
+2000-09-22 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (main): calls drakegw.
+ * netconnect.pm (get_net_device): fixed
+
+2000-09-22 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/drakgw:
+ - added logs
+ - added verbose mode
+ - fixed wrong stopping of named in other languages than english
+
+ * netconnect.pm (get_net_device): try to fix it..
+
+2000-09-22 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (selectKeyboard,
+ choosePartitionsToFormat, chooseCD, installCrypto): use new ask_many_from_list
+ ():
+
+ * interactive.pm (ask_many_from_list): now only ask_many_from_list
+ exists, obsoleting ask_many_from_list_ref and
+ ask_many_from_list_with_help. More flexible and nicer
+ * interactive_newt.pm (ask_many_from_listW): adapted to new
+ calling type
+ * interactive_gtk.pm (ask_many_from_listW): adapted to new calling
+ type, handle 'shadow' and 'icon2f'
+
+2000-09-22 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (main): if /lnx4win/i in VERSION, set $o->{lnx4win}
+
+ * Xconfigurator.pm (cardConfiguration): fix setting 4MB of meg for
+ i810
+ (testFinalConfig): i810 is a verybad_card, aka can't test anything
+ on it :-(
+ (main): fork to background and stay there while waiting for the WM
+ to exit
+ (testFinalConfig): update the backgroung image path
+
+ * interactive_gtk.pm (exit): flush X before leaving (otherwise the
+ mousecursor is not restored)
+
+ * run_program.pm (rooted): don't redirect the stdout and stderr to
+ ddebug.log if not $::isInstall
+
+ * log.pm (l): log on stdout/stderr if !isInstall and !isStandalone
+
+ * modules.pm (load_raw): redirect stderr to tty5
+
+ * install2.pm (main): set variable $::isInstall
+
+2000-09-22 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-22 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/drakgw: now includes information from netconnect to
+ ignore the interface used for Internet connection
+
+2000-09-22 dam's <damien@mandrakesoft.com>
+
+ * install_steps_gtk.pm (selectInstallClass1): pixel's typo.
+
+ * netconnect.pm (get_net_device): added get_net_device to know
+ which interface has been used to configure the internet connection.
+ (conf_network_card): ask to restart network if dhcp too.
+ (main): enable dialing when modem.
+
+ * network.pm (configureNetworkIntf): changed label to warn people
+ about already configured eth cards.
+
+2000-09-22 François Pons <fpons@mandrakesoft.com>
+
+ * install_gtk.pm: added Desktop themes.
+ * share/themes-mdk-Desktop.rc, share/themes/mdk-Desktop-bg.png:
+ initial release.
+ * install2.pm: moved back to all steps for live upgrade.
+ * install_gtk.pm: select right logo if desktop.
+ * install_steps_interactive, install_steps_gtk.pm: avoid asking if
+ upgrade for a live upgrade.
+
+2000-09-22 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm: add some call to log_sizes to log the
+ installed size
+
+ * install_steps_gtk.pm (installPackages): beep before changeMedium
+
+2000-09-21 Pixel <pixel@mandrakesoft.com>
+
+ * interactive.pm (ask_from_listf): try to call the f translation
+ function on the default value with the index
+
+ * install_steps.pm (afterInstallPackages): make the gpg code work,
+ changed the call to
+ "gpg --fast-import --homedir /etc/rpm /root/tmp/RPM-GPG-KEYS"
+
+ * detect_devices.pm: cleanup and removed unused code
+
+2000-09-21 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * detect_devices.pm (getNet()): really remove plip in standalone
+
+2000-09-21 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps.pm, netconnect.pm: changed NETWORKING reference
+ from false to no.
+ * printer.pm: changed timeout from 30 to 60.
+ * printerdrake.pm: added wait message when waiting for cups to
+ start.
+ * pci_probing/pcitable: added erwan VIA Rhine board.
+ * network.pm: added DHCP_HOSTNAME reference.
+
+2000-09-21 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-21 Pixel <pixel@mandrakesoft.com>
+
+ * standalone/keyboarddrake: fix for XF4
+
+ * Xconfigurator.pm (write_XF86Config): comment the omit
+ xfree86-dga
+
+ * install_steps.pm (afterInstallPackages): configure GPG public
+ keyring with mandrake key
+
+ * standalone/mousedrake: updated/fixed for new mouse handling
+
+ * install2.pm (main): update for handling oem installs
+
+ * many files: relGetFile cleanup, updated calls to getFile and
+ getAndSaveFile accordingly
+
+ * Xconfigurator.pm (testFinalConfig): new XFdrake-image-test.jpg
+
+ * detect_devices.pm (@netdevices): plip removed in standalone,
+ otherwise plip is always there (because of kmod)
+
+ * install_steps_interactive.pm (choosePartitionsToFormat): replace
+ the die "cancel" by die "already displayed", so that no error is
+ displayed.
+
+ * pci_probing/pcitable: replace some rtl8139 by 8139too, added
+ cards DELTA8139 and ADDTRON8139 (for jeff)
+
+ * Xconfigurator.pm (show_info): also show the colordepth and
+ resolution. don't show server if none, show XF4 driver if there's
+ one.
+ (main): change the "Forget the changes" to "Keep the changes?"
+ with displaying the current configuration.
+
+2000-09-21 François Pons <fpons@mandrakesoft.com>
+
+ * printer.pm: changed "PostScript" ppd default description to "Raw
+ queue (no filtering)", asked by Till.
+ * Xconfigurator.pm: add log of what user select for 3D hw
+ acceleration.
+ * share/compssList: changed XFree86-glide-module to -2 because the
+ level is the same for XFree86-Glide* which may have multiple
+ different version installed due to dependancies of the first one.
+
+2000-09-21 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (conf_network_card): added check when dhcp. Cable connection
+ should now work.
+
+2000-09-21 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-21 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (exitInstall): call $o->exit if
+ "Some steps are not completed"
+
+2000-09-20 Pixel <pixel@mandrakesoft.com>
+
+ * bootloader.pm (install_loadlin_config_sys,
+ install_loadlin_desktop): extracted from install_loadlin, do not
+ call them anymore (remove it?)
+ (suggest): put grub in lnx4win install
+
+ * common.pm (availableRamMB): fixed (round to a multiple of 4)
+
+2000-09-20 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (get_info_isdn_providers & read_isdn_providers):
+ read file in /usr/share and $prefix/usr/share
+ (isdn_write_config): corrected file to be sh compliant.
+ (isdn_write_config): added default route settings for isdn.
+
+2000-09-20 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-20 Pixel <pixel@mandrakesoft.com>
+
+ * pci_probing/pcitable: replace es1371 by snd-card-ens1371
+
+2000-09-20 dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator.pm (autologin): for urpmi, added `--best-output' and suspend/resume
+
+2000-09-20 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * standalone/printerdrake: for urpmi, added `--best-output' and suspend/resume
+
+ * standalone/XFdrake: for urpmi, added `--best-output' and suspend/resume
+
+2000-09-20 dam's <damien@mandrakesoft.com>
+
+ * standalone/draknet: used new package install function.
+
+2000-09-20 Pixel <pixel@mandrakesoft.com>
+
+ * detect_devices.pm (isFloppyOrHD): detects wether a device is a
+ floppy or not based on its size (for scsi floppy)
+
+ * Xconfigurator.pm (testFinalConfig): check if "server" OR
+ "driver" field is set (otherwise XF4 only card won't pass)
+
+ * bootloader.pm (suggest): fix for ``installing the last cooker
+ from kenobi:/I on an smp machine i don't get anymore an entry for
+ linux-up'' (c chmouel)
+
+2000-09-20 dam's <damien@mandrakesoft.com>
+
+ * netconnect.pm (read_isdn_providers): corrected typo ($_ -> $_[0])
+
+2000-09-20 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-19 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (get_pcmcia_devices): fix (especially, now ethernet
+ should be detected)
+
+ * lang.pm (get_langs): created, gives rpm install langs
+ * install_any.pm (setPackages): give langs::get_langs() to
+ readCompssList
+ * pkgs.pm (readCompssList): don't use RPM_INSTALL_LANG, use given
+ $langs instead. This fixes the RPM_INSTALL_LANG=all install.
+
+2000-09-19 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * netconnect.pm: make dhcp-client, pump and such not translatable.
+ Those are program names and should therefore not be translated,
+ that only confuses translators
+
+2000-09-19 dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator.pm (autologin): corrected @users definition and
+ passwd cat.
+
+2000-09-19 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-19 Pixel <pixel@mandrakesoft.com>
+
+ * many files: changed some access to get_root to get_root_
+
+ * install_steps_interactive.pm (choosePackages): added code for
+ desktop meta_class install type
+
+ * install_steps_gtk.pm (selectMouse): cleanup, give parameter
+ emulate3buttons to setMouseLive
+ * c/stuff.xs.pm (setMouseLive): add argument emulate3buttons
+
+2000-09-19 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * interactive*.pm: changed `suspend' and `resume' to behave as expected,
+ added `enter_console' and `leave_console'
+
+2000-09-19 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-19 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (miscellaneous): replaced LITTLE_FRIED_OIGNONS by
+ META_CLASS
+
+ * Xconfigurator.pm (cardConfiguration): when ddcxinfos gives false
+ result (not enough VideoRam), also remove the found resolutions
+ * Xconfigurator.pm (main): remove the automatic searching of
+ resolutions
+ * Xconfigurator.pm (resolutionsConfiguration): cleanup, remove the
+ automatic searching of resolutions.
+
+ * mouse.pm (fullnames): changed the `_' in `[' before Other
+ (nicer, uh?)
+
+ * install2.pm (selectMouse): changed clicked to !first_time
+
+2000-09-19 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-19 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm (testFinalConfig): remove the bloody prototype
+
+2000-09-19 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-18 Dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator (autologin): do it eve, if newbie. Autologin is
+ now in separated function.
+2000-09-18 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm (testFinalConfig): don't skip the test in auto
+ if called via "Test again"
+ * Xconfigurator.pm (resolutionsConfiguration): ensure all depth
+ are bounded
+
+ * bootloader.pm (suggest): don't put "linux-nonfb" if "linux" is
+ classic and no-fb
+
+ * fsedit.pm (check_mntpoint): add a check for /etc /lib... which
+ must not be mount points. Also check that /home, /tmp and /usr are
+ on trueFS
+
+ * interactive.pm (ask_from_entries_ref): add bounding of "val" in
+ case of type "range". die if min > max.
+
+2000-09-18 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-18 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePartitionsToFormat): nicer
+ partition/device display
+
+ * partition_table_raw.pm (zero_MBR): add on the fly require of the
+ good partition_table_$type
+
+ * detect_devices.pm (cdroms): fix (yet again) the scd$nb device
+ assignment to ide burners
+
+ * install_steps.pm (afterInstallPackages): comment out a part of
+ the icons mess messing
+
+ * Xconfigurator.pm (cardConfiguration): move Unlisted to
+ Other/Unlisted
+ * share/CardsNames: updated (for Voodoo5)
+
+ * install_steps_gtk.pm (selectMouse): fix the test to know wether
+ the guy has changed the mouse type (to know wether to test the
+ mouse or not)
+
+ * install_steps_interactive.pm (selectLanguage): add the license
+
+ * install_steps_interactive.pm (choosePackages): have the
+ "Recommended" size be the default
+ (in the choice Minimum/Recommanded/Complete)
+
+ * diskdrake.pm (Type): fix a typo
+
+ * install_steps.pm (doPartitionDisksAfter): mark partition as
+ mounted
+
+2000-09-17 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-17 Pixel <pixel@mandrakesoft.com>
+
+ * install/pcmcia_config.patch: cleaned
+
+ * diskdrake.pm (Create, Type): have type field not_editable
+
+ * tools/make_mdkinst_stage2: use TMPDIR if available
+
+2000-09-16 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePartitionsToFormat): move
+ the setting of toFormat before asking for bad blocks, seems to fix
+ things?? weird :-/
+
+ * network.pm (miscellaneousNetwork): fix the setting of focus on
+ error (tx2Thomas Poindessous :)
+
+ * install_steps_interactive.pm (configurePrinter): changed
+ "Cancel" to "None" (for Thomas Poindessous :)
+
+ * printer.pm (poll_ppd_base): max polling time raised from 10s to
+ 30s (for Till)
+
+ * install_steps.pm (ask_mntpoint_s): don't force partition type to
+ be ext2 (at least if it's a known fs) (for Warly)
+
+2000-09-15 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-15 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (set_help): save the help message displayed
+ in $o->{current_help}
+ * install_gtk.pm (create_big_help): display $o->{current_help}
+
+ * mouse.pm: reworked quite a lot. Now sorts/categorize nicely the mice.
+ * install_steps_interactive.pm (selectMouse): adapted for reworked mouse.pm
+ * install2.pm (selectMouse): adapted for mouse::read now returning
+ an hash ref
+
+ * detect_devices.pm (hasMousePS2): remove hasMouseMacUSB, do it in
+ one function (now takes the device in the parameter)
+
+ * interactive.pm (ask_from_treelistf): added (just like
+ ask_from_listf, but with a tree)
+
+ * Xconfigurator.pm: the reference is now nbuttons to
+ know wether to put Emulate3Buttons or ZAxisMapping.
+ * Xconfigurator.pm (cardConfiguration): install Glide_V3-DRI on
+ Banshee too.
+
+ * Xconfig.pm: guess nbuttons based on Emulate3Buttons and
+ ZAxisMapping.
+
+ * common.pm (availableRamMB): replace availableRam, now use the
+ size of /proc/kcore (what else to find the real ramsize?)
+
+ * common.pm (cat__): created
+
+ * install2.pm (main): add field meta_class in $o. Can be
+ 'desktop', in case option desktop is given, or if /desktop/i is
+ found in /VERSION
+
+ * install_steps.pm (miscellaneous): for lnx4win, always have
+ 'mem=' (so that the initrd is visible by both windows
+
+ * install2.pm (main): add option "desktop"
+
+ * install_any.pm (generate_ks_cfg): fix for new(?) $o->{intf} format
+
+ * install_interactive.pm (partitionWizardSolutions):
+ use only TrueFS for existing_part
+ (partitionWizard): have only "loopback" for lnx4win
+
+ * pci_probing/pcitable: associate Voodoo5 with Voodoo5
+
+ * share/Cards+: add Voodoo5
+
+ * bootloader.pm (suggest): add entry linux-nonfb (called linux-up
+ for smp)
+
+2000-09-14 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
+2000-09-12 François Pons <fpons@mandrakesoft.com>
+
+ * detect_devices.pm, mouse.pm: moved probing serial port before to
+ detect a wacom tablet (even if a PS/2 or USB mouse is found).
+ * help.pm: corrected reference to previous version of LM (jloup).
+ * install2.pm: removed duplicate code for getting network
+ configuration, using network module.
+ * netconnect.pm: intf is now a hash and no more an array.
+ * network.pm: changed nature of intf to hash from array, reworked
+ write_resolv_conf function to keep old code in comment but only
+ when not used anymore (to make it easier by hand modification).
+ * printer.pm: SOCKET accessible to expert only (jloup).
+ * printerdrake.pm: local port only available for expert if a
+ printer has been detected (jloup).
+
+2000-09-11 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: reorganized choices of 3D optimizations, added
+ experimental support for expert users.
+ * install_steps_interactive.pm: removed question to keep XF3.
+
+2000-09-05 François Pons <fpons@mandrakesoft.com>
+
+ * printerdrake.pm: removed all previous URI specific mode and
+ added socket and expert URI general mode.
+ * printer.pm: fixed bugs, start lo interface before cups.
+
+2000-09-04 François Pons <fpons@mandrakesoft.com>
+
+ * printerdrake.pm: added pnm2ppa and lm110 support in cups
+ configuration. probe for printer device (parallel) and try to
+ install usb for printer.
+ * printer.pm: removed local printer configuration for cups (keep
+ only local configuration using URI).
+
+2000-09-01 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: fixes to configure XF86Config-4 when XFree-3.3
+ is installed, make 16bits by default on 3D hardware acceleration,
+ fixed selection of hardware for hardware acceleration.
+ * install_steps.pm: add cups for printer configuration, used for
+ auto_install. added new function to add packages only if requires
+ are already satisfied.
+ * standalone/printerdrake: updated.
+
+2000-08-31 dam's <damien@mandrakesoft.com>
+
+ * moved many things to network.pm and any.pm
+ * everything should be broken now.
+
+2000-08-31 François Pons <fpons@mandrakesoft.com>
+
+ * install2.pm: removed printer default config (now obsoleted).
+ * install_steps_interactive.pm: add cups support.
+ * printerdrake.pm: add cups support.
+ * printer.pm: add cups support.
+
+2000-08-31 Frederic Lepied <flepied@mandrakesoft.com>
+
+ * install_any.pm (setPackages): install the right glide module
+ according to the Voodoo card detected.
+
+ * Xconfigurator.pm (write_XF86Config): ZAxisMapping for XF 4.
+ (autoDefaultDepth): default depth to 16 for Voodoo cards except
+ for Voodo5 ones.
+
+2000-08-29 dam's <damien@mandrakesoft.com>
+
+ * moved pppConfig in netconnect.pm and any.pm
+ * moved miscellaneousNetwork in any
+ * modem configuration is now useable in standalone mode.
+
+2000-08-29 David BAUDENS <baudens@mandrakesoft.com>
+
+ * install_steps_interactive.pm: change Small/Normal/Full ->
+ Minimum/Recommanded/Complete (aka make FredB happy)
+
+2000-08-28 dam's <damien@mandrakesoft.com>
+
+ * draknet (netconnect): renamed drakfuck -> draknet. standard ADSL
+ and french alcatel ADSL implemented.
+ * Xconfigurator.pm (autologin) : use of the new autologin system.
+
+2000-08-24 François Pons <fpons@mandrakesoft.com>
+
+ * ../update_kernel*: changed reference from extract_archive to
+ packadrake.
+ * Makefile*: added live_install and live_install2.
+ * Xconfigurator.pm: updated Mach64 acceleration to only 3D Rage
+ Pro AGP card type, commented SiS and S3ViRGE support by GLX.
+ * commands.pm, keyboard.pm, lang.pm, pkgs.pm, list, tools/*:
+ updated to use packdrake now.
+ * install2.pm, install_steps.pm, install_steps_gtk, Makefile*:
+ manage live upgrade.
+ * modules.pm: use standard modprobe command for load in live
+ upgrade.
+ * netconnect.pm: added minimal modification for being compilable.
+ * rescue/list: added packdrake and sfdisk.
+ * live_install, live_install2: live upgrade of package.
+
+2000-08-22 dam's <damien@mandrakesoft.com>
+
+ * drakfuck (netconnect):finished isdn PCI/ISA card implemetation
+ * added isdndb.net: providers database
+
+2000-08-20 dam's <damien@mandrakesoft.com>
+
+ * moved Netconnect.pm to netconnect.pm
+ * moved DrakFuck to drakfuck
+
+2000-08-18 Pixel <pixel@mandrakesoft.com>
+
+ * share/Cards+: for i810, force VideoRam
+
+2000-08-18 dam's <damien@mandrakesoft.com>
+
+ * modules.pm: added isdn type in @drivers_by_category. corrected
+ load_thiskind (thx pixel) : it's not unsafe anymore
+ * Netconnect.pm: just display PCI isdn card recognized.
+
+2000-08-17 Pixel <pixel@mandrakesoft.com>
+
+ * install_any.pm: many cleanup. moved some functions to common,
+ any or install_interactive (newly created)
+
+2000-08-16 dam's <damien@mandrakesoft.com>
+
+ * install_steps_interactive.pm(configureNetwork): added call to
+ isdn configuration
+ * added standalone/DrakFuck: standalone entry point to configure
+ internet connexion.
+ * added Netconnect.pm: internet connexion functions.
+
+2000-08-11 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (selectInstallClass): yet a bigger
+ warning so that people don't choose expert installs. Also set the
+ focus on "Custom" by default.
+
+ * install_steps_interactive.pm (doPartitionDisks): created, calls
+ the wizard.
+ * install_steps.pm (doPartitionDisksBefore,
+ doPartitionDisksAfter): created (was mainly in
+ install2::doPartitionDisks)
+ * install2.pm (doPartitionDisks): much cleanup
+ * install_any.pm (partitionWizard): working state (still rough)
+
+2000-08-08 Pixel <pixel@mandrakesoft.com>
+
+ * standalone/rpmdrake (AddMedia): fix the ftp addmedia, fix the
+ cdrom addmedia
+
+2000-08-07 Pixel <pixel@mandrakesoft.com>
+
+ * diskdrake.pm (Resize):
+ * install_steps_gtk.pm (doPartitionDisks): remove the
+ before_leaving ensuring the filehandle is closed
+ * resize_fat/main.pm (DESTROY): use a better solution for ensuring
+ the filehandle is closed
+
+2000-08-07 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: added SiS6326 in the list of chipset that
+ needVideoRam, reported on ml.
+ * install_steps.pm: fixed auto install of printer.
+
+2000-08-06 Pixel <pixel@mandrakesoft.com>
+
+ * interactive.pm (ask_from_listf): created this GREAT function
+ that should have been created a long time ago.
+ * any.pm, install_any.pm, install_steps_gtk.pm,
+ install_steps_interactive.pm: a lot of rewrite to use the new
+ ask_from_listf, a lot of nice cleanup!
+
+ * fs.pm (df): created, returns the free space of the part. Save it
+ in $part->{free}
+
+ * install_steps_gtk.pm (doPartitionDisks): ensure the closing of
+ the device in case of error
+ * resize_fat/main.pm (new): ensure the closing of the device in
+ case of error
+
+ * install_any.pm (partitionWizard): the great partitioning wizard
+ is created. Not finished yet (nor called from anywhere)
+
+ * install_steps.pm (doPartitionDisksLnx4win): created function out
+ of doPartitionDisks
+
+ * install_steps_gtk.pm (installPackages): removed the displaying
+ of size to install (people are bothered cuz not the same size)
+
+2000-08-06 dam's <damien@mandrakesoft.com>
+
+ * install_steps_gtk.pm (create_steps_window): use drawing area
+ instead of button. Implemented all steps events.
+
+2000-08-05 Pixel <pixel@mandrakesoft.com>
+
+ * mouse.pm (detect): test a hack for usb mouse via hub
+ (sparhawk@enteract.com)
+
+ * fsedit.pm (undo): force isDirty and needKernelReread only if hd
+ hasBeenDirty, otherwise believe the flag saved
+ * partition_table.pm (write): flag hd as hasBeenDirty
+
+ * install2.pm: a few renaming of methods so that the step names
+ correspond to install2 function and install_steps* methods (eg:
+ configureX & setupXfree unified to configureX)
+
+2000-08-04 dam's <damien@mandrakesoft.com>
+
+ * any.pm (setAutoLogin): added this method to write xdm-config
+ * Xconfigurator.pm: clenead autologin code and use of above method
+
+2000-08-04 Pixel <pixel@mandrakesoft.com>
+
+ * pkgs.pm (setSelectedFromCompssList): save $nb to able to restore
+ it in case of max_size reached. only purpose is the log!
+
+ * install_steps_interactive.pm (choosePackages): in newbie, ask
+ between Small/Medium/Full install
+ * install_steps_interactive.pm (choosePackages): in expert, have
+ the min_mark be 0 instead of 1
+
+ * common.pm (find_index): added this nice function
+
+ * install_any.pm (getAvailableSpace_mounted): use common::df
+ * loopback.pm (getFree): use common::df
+ * commands.pm (df): use common::df
+ * common.pm (df): added
+
+ * diskdrake.pm (Resize)): add resizing of reiserfs
+ * share/list.i386: add resize_reiserfs
+
+
+2000-08-02 dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator.pm : autologin is functionall. When wmsession.d is
+ more up to date, I'll add the list of wm to launch at boot. It
+ writes in /etc/X11/xdm/xdm-config.
+
+2000-08-01 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (miscellaneous): modify as chmouel want (aka, ""
+ instead of "no" for MOUSE and KEYBOARD in sysconfig/usb)
+
+ * services.pm: separation between interaction and action.
+ * install_steps.pm (servicesConfig): the job is now done here
+ * install_steps_interactive.pm (servicesConfig): only the asking
+ part
+
+2000-08-01 François Pons <fpons@mandrakesoft.com>
+
+ * pkgs.pm: fixed the below fixe, now ok.
+ * Xconfigurator.pm: fixed a bug for using default card flags
+ setting, add support for GeForce DDR for both 3.3 and 4.0.
+ * pci_probing/pcitable: fixed NV15 (GeForce2) card entry, now use
+ XFree 3.3 as unsupported in XFree 4.0.
+ * share/Cards+: added "NVIDIA GeForce2 DDR (generic)".
+
+2000-07-31 François Pons <fpons@mandrakesoft.com>
+
+ * pkgs.pm: fixed provided package with choice in deps used with a
+ base package, complicated but kernel-fb or similar can be
+ unselected now.
+
+2000-07-27 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_interactive.pm: changed expert message to ask
+ using XFree 3.3 instead of XFree 4.0 used by default (server).
+ * Xconfigurator.pm: make sure only one server is installed,
+ default to XFree 4.0 if supported unless XFree 3.3 accept
+ 3D acceleration and not XFree 4.0, ask user in such case.
+ * pci_probing/pcitable: added Intel 815 pci ids.
+
+2000-07-26 dam's <damien@mandrakesoft.com>
+
+ * install_steps_gtk.pm: applied new LN stars, logo title and help
+ logo. improved steps appearences.
+ * modified share/step-*.xpm
+ * added share/help.xpm
+ * updated ../HACKING to ling help logo.
+
+2000-07-21 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: enable 3D acceleration configuration with
+ XFree86, use /usr/X11R6/lib/modules/glx-3.so for X version 3
+ Utah-GLX accelerated module.
+
+2000-07-20 dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator.pm: use {miscellaneous}{autologuser} instead of
+ {miscellaneous}{autologuser} + {miscellaneous}{autologing}.
+ * move some README content to ../HACKING
+
+2000-07-19 dam's <damien@mandrakesoft.com>
+
+ * Xconfigurator.pm: added autologin boxes.
+ result is in {miscellaneous}{autologin} and in
+ {miscellaneous}{autologuser}
+
+2000-07-19 François Pons <fpons@mandrakesoft.com>
+
+ * any.pm: added default root to existing root device when adding
+ an entry in bootloader.
+ * bootloader.pm: avoid duplicating entry (floppy and old-floppy)
+ when they are identical.
+ manage hackkernel by suggest an entry by default if installed.
+ * install_steps.pm: reworked symlink closure for bootloader
+ to keep previous configuration.
+
+2000-07-11 François Pons <fpons@mandrakesoft.com>
+
+ * bootloader.pm: merged lilo.pm and silo.pm inside bootloader.pm,
+ this include a configure_entry from silo.pm to build a initrd if
+ used.
+ * share/compssList: added kde2 packages.
+ * share/compssUsers: added kde2 group, renamed kde to kde1 group
+ specific.
+
+2000-07-07 François Pons <fpons@mandrakesoft.com>
+
+ * install2.pm (choosePackages): always execute setPackage to copy
+ hdlist* and depslist files (support mixed partitionDisks and
+ choosePackages).
+ * install_any.pm (setPackages): avoid clearing upgrade flag.
+ * install_steps.pm (choosePackages): use $first_time to avoid
+ reselection of packages according to compssList.
+ * install_steps_interactive (choosePackages): use $first_time and
+ $individual to avoid reselection of packages according if user go
+ back to step choosePackages.
+ * pkgs.pm: added psUpdateHdlistsDeps to restore hdlist* and
+ depslist files in /var/lib/urpmi.
+ * diskdrake.pm: fixed uneditable combo for Mount point action.
+
+2000-06-23 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: better approach for Sun* server in newbie.
+ * fs.pm: added romfs support for mount.
+ * fsedit.pm: changed auto allocation for partitions for sparc*.
+ * install2.pm: restored bootdisk creation and auto install boot
+ disk creation for sparc*.
+ * install_any.pm: changed vfat to romfs when mounting kickstart
+ floppy on sparc*.
+ * install_steps.pm: avoid proposing formating sunos partition.
+ * install_steps_interactive.pm: boot disk for sparc* and support for
+ installation of SILO on /boot partition (sparc*).
+ * install_steps_newt.pm: removed cylinder 0 bug warning.
+ * interactive.pm: fixed typo for not_edit set to 1 by default.
+ * partition_table.pm: fixed get_holes on sparc* where a whole disk
+ partition caused problems.
+ * partition_table_sun.pm: removed cylinder 0 bug as found in mke2fs.
+ * silo.pm: handle /boot partition, install silo.conf in /boot and
+ make a symlink from /etc.
+ * share/list.sparc: added losetup and genromfs for boot disk creation.
+
+2000-06-21 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * lang.pm: changed the way console font data is written; not all
+ of the [0], [1], [2] values must defined, so three cases must be used.
+ Also added a variable $CHARSET for /etc/sysconfig/i18n; it can then
+ be used by console-tools to load the proper compose table
+
+2000-06-20 François Pons <fpons@mandrakesoft.com>
+
+ * c/sbus.c: added some functions for silo.c integration.
+ * c/silo.c: initial release including write in prom, and translation
+ of disk name from openprom to linux, rh version modified.
+ * silo.pm: added write in prom, support of sunos boot from silo.
+ * partition_table.pm: added support for ufs partition like windows one.
+ * install_steps_interactive.pm: added other entries in silo.
+ * install_steps.pm: support sunos partition.
+ * install_any.pm: automatically mount sunos partition with diskdrake.
+ * fsedit.pm: added /mnt/sunos suggested mount point.
+ * fs.pm: added ufs support for mount.
+
+2000-06-19 François Pons <fpons@mandrakesoft.com>
+
+ * crypto.pm: modified for getting sparc crypto file for sparc*.
+ * modules.pm: make sure to load sd_mod when needed.
+ * pci_probing/main.pm: always use loaw_endian in pci structs.
+ * pci_probing/translate-pcitable.pl: added arch specific module name
+ translation.
+
+2000-06-16 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (write_conf): rename conf.modules to modules.conf if
+ needed. Outputs to modules.conf
+
+ * detect_devices.pm (cdroms): fix using scd0 for ide-burners when
+ already a scsi cdrom drive
+
+2000-06-13 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * pkgs.pm: added 'acon' requirement for all right-to-left languages
+
+2000-06-07 François Pons <fpons@mandrakesoft.com>
+
+ * diskdrake.pm: added SunOS partition as blue for diskdrake.
+ * install_steps_interactive.pm: make sure of no division by zero may
+ happen.
+ * install_steps_newt.pm: added WARNING for fdisk on sparc*.
+ * modules.pm: make sure of loading sd_mod module after any scsi module.
+ * sbus_probing/main.pm: insmod openprom before trying sbus probing.
+ * pkgs.pm: corrected by use of parabolic solution for size approximation.
+ * silo.pm: try with "silo -p 2 -t" if "silo -t" has failed due to bad probe.
+
+2000-06-05 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * install_steps.pm,lang.pm: added load_console_font, to load the
+ proper console fonts (text mode install is not very useful otherwise)
+
+2000-06-03 Pixel <pixel@mandrakesoft.com>
+
+ * diskdrake.pm (Create): don't accept less than 32MB part for reiserfs
+ * diskdrake.pm (Type): don't accept less than 32MB part for reiserfs
+
+2000-06-01 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * share/fonts.tar.bz2: replaced the Korean 16pt fonts by a 12pt font;
+ it fits better with the other fonts. Added a 'README' file with
+ some comments and the required copyright notice
+
+2000-05-29 François Pons <fpons@mandrakesoft.com>
+
+ * Xconfigurator.pm: added support for SBUS card autodetection.
+ * commands.pm: added lssbus to list SBUS devices detected.
+ * detect_devices.pm: removed alpha restriction on USB.
+ * install_steps_interactive.pm: added SBUS support.
+ * c/sbus.c: initial revision, core SBUS support (inspired from kudzu).
+ * c/stuff.xs.pm: added wrapper for sbus.c interface.
+ * sbus_probing/main.pm: initial revision (inspired from kudzu).
+
+2000-05-27 Adam Lebsack <adam@mandrakesoft.com>
+
+ * share/list.ppc: various PPC modifications, for HFS
+ * partition_table_mac.pm: bug fixes
+ * partition_table.pm: various HFS fixes, isHiddenMacPart()
+ * diskdrake.pm: added HFS to top buttons when run on PPC
+ * keyboard.pm: fixed name of mac-fr2-ext keymap
+ * install_steps_gtk.pm: added Xpmac server support for PPC.
+ * install_steps_interactive.pm: disallow hardware configuration on PPC for
+ now. All drivers should be in the kernel. setup_this_kind().
+ * fsedit.pm: fixed verify_hds for PPC, /proc/partitions will never match
+ our partition table read. Added PPC grep condition for PPC in get_visible_fstab.
+ * fs.pm: fix argument for HFS formatting.
+ * Makefile: special installation of PPC files.
+
+2000-05-25 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+
+ * standalone/drakboot: Don't display Configure-/LILO/GRUB/ on
+ alpha|sparc.
+
+2000-05-25 François Pons <fpons@mandrakesoft.com>
+
+ * silo.pm: added configure_entry to try creating an initrd for an image
+ entry in bootloader. fixed wrong usage of run_programm::rooted with 2>.
+ * commands.pm: fixed insmod command to take modules64.cz* on sparc*
+ * install2.pm: removed create boot disk and create auto install disk on
+ sparc*. force writing of /etc/conf.modules for step setupBootloader.
+ * install_steps.pm: fixed upgrade for sparc* and disable supermount for sparc*.
+ * install_steps_interactive.pm: added missing $prefix for glob_. call
+ configure_entry in setupSILO. fixed cancel or None entry on setupBootloader.
+ * modules.pm: updated alias for sparc*.
+ * any.pm: fixed proprable wrong test for setupBootloader in beginner at
+ the very beginning.
+ * printer.pm: fixed typo.
+ * Xconfigurator.pm: avoid testing if using a Sun* server, added depth and
+ resolution for these server too.
+
+2000-05-24 François Pons <fpons@mandrakesoft.com>
+
+ * partition_tabel.pm: fixed wrong detection of DOS partition on sparc*.
+ * partition_table_sun.pm: fixed a bug when reading partition table
+ with unused partition in the middle of the table.
+
+2000-05-23 François Pons <fpons@mandrakesoft.com>
+
+ * common.pm: update arch to take into account sparc and sparc64. added
+ better_arch and compat_arch function.
+ * silo.pm: fixed adding new kernel automatically.
+ * install2.pm: removed create boot disk stuff for sparc*.
+ * install_steps.pm: added initrd generation for alpha. added ldconfig
+ at end of installation. removed /usr/bin/dumpkeys existence test on
+ sparc*, should be added in the future.
+ * install_steps_interactive.pm: removed supermount for sparc*.
+ * install_steps_gtk.pm: added /dev/kbd device creation and permedia2
+ support for sparc*. removed screen limit of 1024x768.
+ * detect_devices.pm: fixed problem on machine with really no IDE interface.
+ * modules.pm: added support for 32 and 64 bit architectures on sparc*.
+ * install_any.pm: fixed getAvailableSpace_mounted if /usr is not a separate
+ partition.
+ * pkgs.pm: added support for multi-arch rpm file (need for sparc*),
+ fixed correctSize and invCorrectSize to take back a linear approximation
+ above 9Gb approximatively. removed ftp rewind as broken currently.
+ * keyboard.pm: fixed bad list of available keyboard (broke sparc*), fixed
+ globing (removed) against existing '*'.
+ * partition_table.pm: removed support for non SUN partition table, as it
+ may freeze the kernel or may be blanked?
+ * Xconfigurator.pm: take Sun24 server by default on sparc*, add support
+ for permedia2 card (3DLabs server).
+ * share/list.sparc: added perl-5.6.0 for sparc*, fixed for sparc*.
+ * Makefile: added support for modules and modules64 for sparc*.
+ * c/stuff.xs.pm: added kernel_arch function for getting the current true
+ architecture provided by the kernel (uname -m).
+
+2000-05-09 Pixel <pixel@mandrakesoft.com>
+
+ * install_any.pm (kdeicons_postinstall): the URL link to doc must
+ be $lang/index.html, not only $lang.
+
+ * standalone/mousedrake: add handling of XF86Config-4
+
+ * any.pm (setupBootloader): fix bug (was adding 2 glob_'s)
+
+2000-05-08 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (main): move the touch of some files here to please linuxconf
+
+ * install2.pm (miscellaneous): s/KBD/KEYBOARD/
+
+ * lilo.pm (install_grub): don't keep symlinks for reiserfs
+ * lilo.pm (suggest): allow grub everytime now (not only if !reiserfs)
+
+ * install_any.pm (getHds): default mount point for windobe in
+ lowercased for StartOffice(!)
+
+2000-05-08 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * share/keyboards.tar.bz2: Fixed Brazilian keyboard (.br); added
+ Iranian (.ir), Arabic (.ar) and new Lithuanian (.lt_new) keyboards
+ * keyboard.pm: Added new Lithuanian keyboard and changed the
+ string for brazilian ABNT-2 to state more clearly its ABNT nature
+ (it is not a standard PC keyboard; it uses some different keycodes)
+
+2000-05-07 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (choosePackages): return availableCorrected
+ instead of available
+
+ * pkgs.pm (correctSize): add 18MB for full multi-cd (many hdlist's)
+
+ * modules.pm (text2driver): same as text2lang below
+ * keyboard.pm (text2keyboard): same as text2lang below
+ * lang.pm (text2lang): replace the while (... each) by a foreach
+ (keys) (because each is dangerous if loop is exited)
+
+ * install_steps_interactive.pm (selectKeyboard): better handling
+ of multiple langs question.
+
+ * ftp.pm (new): Timeout set to 60 (seconds), was default (120)
+
+ * install_steps_interactive.pm (setup_thiskind): remove ide-*
+ from modules displayed as loaded.
+
+2000-05-06 Pixel <pixel@mandrakesoft.com>
+
+ * fsedit.pm (check_mntpoint): verify that standard mntpoints (/
+ /usr) are not on not trueFS
+
+ * any.pm (setupBootloader): add $prefix for the 2 glob_'s
+
+2000-05-07 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * share/keyboards.tar.bz2: added Ukrainian keyboard xmodmap.ua
+
+2000-05-06 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * printerdrake.pm: fixed English error
+
+2000-05-05 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm (monitorConfiguration): remove the special case
+ for fbdev.
+
+ * install_steps_interactive.pm (setup_thiskind): replace return by
+ next in case load_module fails.
+
+ * install_steps_gtk.pm (selectInstallClass1): translate Install/Upgrade
+
+ * Xconfigurator.pm (cardConfiguration): force xf4 for rage 128's
+ * Xconfigurator.pm (testFinalConfig): force $bad_card for xf4
+
+ * pkgs.pm (correctSize): updated for 7.1
+
+ * install_any.pm (getAvailableSpace): move the removing of
+ $minAvailableSize here.
+
+2000-05-04 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (configurePrinter): give clicked to printerConfig
+
+ * interactive.pm (ask_from_entries_ref): set default val if not_edit
+
+ * interactive_newt.pm (ask_from_entries_refW): remove setting of
+ default val. Now done in interactive::ask_from_entries_ref
+
+ * interactive_gtk.pm (ask_from_entries_refW): handle empty value
+
+ * modules.pm (read_already_loaded): ensure that already loaded
+ modules are put in %loaded.
+ * modules.pm (load_ide): add loading if ide-probe-mod (for new kernel)
+
+ * lilo.pm (install_lilo): truncate label's to 15 chars
+
+ * install_any.pm (generate_ks_cfg): fix missing space
+ * install_any.pm (generate_ks_cfg): fix bug for nfs comand
+
+ * install2.pm: get rid of autoformat
+ * install_steps.pm (choosePartitionsToFormat): get rid of autoformat
+
+2000-05-03 Pixel <pixel@mandrakesoft.com>
+
+ * any.pm (setupBootloader): replace ask_many_from_list by
+ ask_from_list for bootloader choice
+
+ * services.pm (drakxservices): stop immediately service if removed
+
+ * install_steps.pm (configureNetwork): replaced dhcpxd by dhcpcd
+ * install_steps.pm (afterInstallPackages): touch some files to
+ please linuxconf
+
+2000-05-03 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps.pm: updated min size, fixed kppprc generation.
+ * install_any.pm: make sure postinstall-rpm is here before
+ erasing (avoid error on reboot only).
+
+2000-05-02 Pixel <pixel@mandrakesoft.com>
+
+ * raid.pm (format_part): don't call raid::make if part is already
+ formatted (as raidstop fails)
+
+ * Xconfigurator_consts.pm: Rage128 and 3dfx are not available any
+ more
+
+ * install_steps_interactive.pm (setup_thiskind): make insmod'ing
+ fail a simple warning.
+
+ * Xconfigurator.pm (readMonitorsDB): adapt to new MonitorsDB
+ * share/MonitorsDB: take new one from RedHat
+
+ * standalone/drakboot: added kfloppy
+
+ * g_auto_install: add $dir/lib to LD_LIBRARY_PATH (it was silly
+ not to have it)
+
+2000-05-01 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (setRootPassword): remove
+ NIS_server, use NIS instead
+ * install_any.pm (setAuthentication): remove NIS_server, use NIS instead
+
+ * standalone/rpmdrake (AddMedia): hdlist.cz2 instead of hdlist
+
+2000-04-28 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (afterInstallPackages): fix yet another bug for
+ ttf from windobe handling
+
+ * install_steps_interactive.pm (selectInstallClass): hide beginner
+ mode in corporate. Display special help.
+
+2000-04-29 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * my_gtk.pm: added call to Gtk->init; that makes 16 bit locales
+ text to be properly aligned (reported by Craig Chang
+ <craig_chang@taipei.siscomm.com.tw>)
+ * common.pm: now that po handling is correct, I changed the order
+ of reading variables so that it follows the standards ($LANGUAGE first)
+ * share/fonts.tar.bz2, lang.pm: added an 8pt font for cp1251
+
+2000-04-28 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps*.pm: added support for selection of package during
+ upgrade the same way it is done for installation. added check of
+ minimal size, abort else (at least let the user know about :-)
+ fixed crypto if no network interface available.
+ * install2.pm: fixed problem during upgrade that lost network
+ configuration.
+
+2000-04-28 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (load_raw): don't call commands::insmod, do it in
+ place. Merge with load_multi
+
+ * install_steps.pm (afterInstallPackages): fix windobe ttfonts
+ symlinking
+
+ * Xconfigurator.pm (cardConfiguration): load module agpgart for
+ i810
+
+ * install_any.pm (getHds): changed the mount point setting for
+ windows partitions as device_windobe is not unique
+
+2000-04-27 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (create_steps_window): changed to adapt to
+ new hidden format
+
+ * install2.pm (@installSteps): changed the way hidden is handled.
+ Now it is a true perl expression (great power now)
+
+ * install_steps_gtk.pm (selectInstallClass1): update steps window
+ before asking normal/devel/server. Nicer!
+
+ * install_steps_interactive.pm (configureNetwork): when "Cancel"
+ pressed at network interface configuration do not skip all
+ configuration.
+
+2000-04-26 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps.pm (pppConfig): modified a lot, removed template
+ file for ifcfg and chat file.
+
+2000-04-26 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (choosePackagesTree): use a fix width for
+ the tree column (so that the checkbox are always visible without
+ scrolling)
+
+ * standalone/drakboot: drakfloppy and gfloppy are X only, no need
+ to propose them in console
+
+ * install_any.pm (relGetFile): added auto_inst to files to get
+ from Mandrake/base
+
+ * install2.pm (main): changed auto_inst behaviour
+
+ * standalone/adduserdrake: fix a bug (s/$o/$in/g)
+
+ * interactive_newt.pm (ask_from_entries_refW): now handling
+ complete/changed/focus_out callbacks (at least more than before)
+
+ * Newt/Newt.xs: added rough callback handling
+
+2000-04-25 François Pons <fpons@mandrakesoft.com>
+
+ * printerdrake.pm: added support for PPA more easily, allow
+ printers entry using ppa driver event if pnm2ppa not installed,
+ install it if neccessary after.
+ * network.pm, install_steps.pm, install_steps_interactive.pm:
+ added support for stoping a network interface, usefull for ppp0 to
+ avoid using it too long.
+ * install_steps.pm: fixed missing local on pap_secrets file.
+
+2000-04-25 Pixel <pixel@mandrakesoft.com>
+
+ * lilo.pm (install): moved the generation of the keytable here. It
+ is used by both lilo & grub (lilo is not always installed as was
+ assumed)
+
+ * common.pm (formatAlaTeX): remove bounding spaces
+
+ * pkgs.pm (setSelectedFromCompssList): remove the hack for min
+ mark 25 in beginner
+ * install_steps_interactive.pm (choosePackages): set $min_mark to
+ 25 in beginner
+
+2000-04-24 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (setupXfree): add a yesorno
+ question for choosing between XF4 and XF3 in expert
+
+ * install_steps_gtk.pm (choosePackagesTree): enlarge the tree window
+
+ * install_any.pm (update_userkderc): make sure uid and gid are kept
+
+ * diskdrake.pm (Create): add Extended_0x85 as a choice for expert
+
+ * partition_table.pm (add_extended): handle a 3rd arg,
+ $extended_type to tell which kind of extended partition is wanted
+ * partition_table.pm (adjust_main_extended): in non-expert,
+ automatically set extended to linux-extended if there's only
+ linux-type partitions.
+
+2000-04-22 Pablo Saratxaga <pablo@madrakesoft.com>
+
+ * install_steps_interactive.pm: s/Mb/MB/ as 'b' is symbol for bit
+ and not for byte. RAM is expressed in megabytes -> MB
+
+2000-04-19 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_interactive.pm: fixed crazy mutli CD manipulation.
+ * printer.pm: fixed wrong prototype of print_pages.
+ * install2.pm: set version to 7.1 for crypto stuff.
+ * crypto.pm: commented ackbar crypto site.
+
+2000-04-17 Pixel <pixel@mandrakesoft.com>
+
+ * lilo.pm (suggest): in failsafe, runlevel ASKRUNLEVEL (handled by
+ linuxconf)
+
+2000-04-14 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePartitionsToFormat): don't
+ ask about checking bad blocks for reiserfs, cuz not handled
+
+ * fs.pm (mount): reiserfs handling
+ * fs.pm (format_reiserfs): added
+ * fs.pm (write_fstab): add option "notail" for reiserfs if
+ the partition holds the kernel (/boot or /)
+
+ * partition_table.pm (isTrueFS): added, replaces most occurences
+ of isExt2
+
+2000-04-12 François Pons <fpons@mandrakesoft.com>
+
+ * install2.pm: force installation step if package have been
+ selected on step choose packages.
+ * install_any.pm: protected against die in perl (setstep or
+ theme_changed).
+
+2000-04-11 François Pons <fpons@mandrakesoft.com>
+
+ * resize_fat: added some limits verification.
+ * interactive_gtk.pm: corrected swap of arg with help adding.
+
+2000-04-10 François Pons <fpons@mandrakesoft.com>
+
+ * interactive_gtk.pm, my_gtk.pm: added tooltips for ask_from_list,
+ which is used by printerdrake only. drops key bindings.
+
+2000-04-07 François Pons <fpons@mandrakesoft.com>
+
+ * tools/serial_probe: obsoleting pnp_serial which is now replaced
+ by this one, taken from kudzu, really faster and probe all serial
+ devices at one time. modified to probe correctly modem :-)
+ * mouse.pm: updated to use serial_probe interface of
+ detect_devices.pm.
+ * detect_devices.pm: modified to use serial_probe, cache probed
+ devices to avoid reprobing.
+
+2000-04-06 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_interactive.pm, install_steps.pm: added support
+ for peerdns options of ppp, so removed dns address unless expert.
+
+2000-04-05 François Pons <fpons@mandrakesoft.com>
+
+ * crypto.pm, install_steps_interactive.pm, install2.pm,
+ install_steps.pm: added crypto stuff to support hdlist-crypto.cz2
+ and depslist-crypto. dependancies are not supported but with a
+ simpler format of depslist file where closure are not done and
+ only package name are used for dependancies.
+ * pkgs.pm: added better support for multi CD manipulation,
+ including selection and refus.
+
+2000-04-04 François Pons <fpons@mandrakesoft.com>
+
+ * pkgs.pm: modified selection packages from compssList by
+ incremental selection, much more quickly.
+ added selected medium for selecting a package.
+ * install_any.pm: refused media hash transfered to selected value
+ of media table.
+ @needToCopy list should only have package of default medium.
+
+2000-04-03 Pixel <pixel@mandrakesoft.com>
+
+ * fs.pm (format_ext2): add options "-b 1024 -O none" for alpha
+
+2000-03-31 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_gtk.pm: made changeMedium sub modification
+ permanent.
+ * pkgs.pm: modified upgrade to avoid use of header.
+
+2000-03-31 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * keyboard.pm: some more choices for PPC keyboards
+
+2000-03-30 François Pons <fpons@mandrakesoft.com>
+
+ * install2pm: added eval around loading af_packet and postinstall
+ copy of RPMS.
+ * devices.pm: added /dev/kdb for SPARC.
+ * install_any.pm: modified multi CD management, postinstall copy
+ of RPMS.
+ * install_steps_gtk.pm: added support for Xsun server for SPARC.
+ * install_steps_interactive.pm: added multi CD dialog box for
+ selecting CD available. Serialized ethernet configuration and ppp
+ configuration.
+ * pkgs.pm: added check for infinite recursion for bad depslist.
+ * printer.pm: better test for reparse of printerdb.
+ * Xconfigurator.pm: added support for Xsun server for SPARC.
+
+2000-03-30 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (choosePackagesTree): enhance tree selection
+
+2000-03-29 Pixel <pixel@mandrakesoft.com>
+
+ * interactive_gtk.pm (wait_messageW): add some padding (nicer)
+
+ * install_steps_interactive.pm (generateAutoInstFloppy): created,
+ creates a floppy for auto installs.
+
+ * install_any.pm (generate_ks_cfg): created, generates stage1
+ ks.cfg file
+
+ * share/po/DrakX.pot: added special comment for grub entry
+
+2000-03-28 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (selectKeyboard): sort langs for
+ many-lang install
+
+ * mouse.pm (write): add WHEEL telling if a wheel mouse is there
+
+2000-03-28 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * keyboard.pm: added entries for all three Armenian keyboards
+
+2000-03-26 Pixel <pixel@mandrakesoft.com>
+
+ * install_any.pm (install_urpmi): full support for multi-hdlist's
+
+ * pkgs.pm (extractHeaders): look for hdlist in /tmp instead of
+ $prefix/var/lib/urpmi
+ * pkgs.pm (psUsingHdlists): put hdlist's in /var/lib/urpmi with a
+ fake name. Access via /tmp/$hdlist is given for non-fake name
+
+ * detect_devices.pm (hasHPT): return undef if no htp (silly me :-/)
+
+2000-03-25 Pixel <pixel@mandrakesoft.com>
+
+ * lilo.pm: updated to the new format of entries. It was an hash.
+ Now the key is field kernel_or_dev, and entries is an array.
+
+ (get): added, it returns the entry using a kernel
+ (needed because entries is no more a hash)
+
+ * install_steps_interactive.pm (setupLILO): adapted to the new format
+
+ * Xconfigurator.pm (write_XF86Config): basic XF86Config-4 handling
+
+ * fsedit.pm (suggest_part): if suggested part contains a field
+ "hd", ensure the partition is created on this hard drive
+
+ * install2.pm (main): before leaving installation, remove
+ /var/lib/urpmi if urpmi not installed
+
+ * diskdrake.pm (Resize): ext2resize to size $part->{size} instead
+ of $size
+
+2000-03-24 Pixel <pixel@mandrakesoft.com>
+
+ * detect_devices.pm (hasHPT): added. Now nice handling of hpt366
+ (ultra66) without rebooting and making special floppy :)
+
+ * lilo.pm (install_grub): much better grub configuration (better
+ than lilo's :pp)
+
+ * install_steps.pm (setupBootloaderBefore): remove entry floppy
+ for security > 3
+
+2000-03-23 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (selectMouse): added, takes care of telling
+ the X server if the user changed the mouse type. Only done if
+ a serial mouse is chosen.
+
+ * install_steps_newt.pm (doPartitionDisks): add a call to
+
+ * mouse.pm (write): added "device=" in etc/sysconfig/mouse for
+ devfs (it looses the symlink /dev/mouse)
+
+2000-03-22 Pixel <pixel@mandrakesoft.com>
+
+ * pci_probing/pcitable: replace Server:Rage128 by proper XFree entry
+
+2000-03-20 François Pons <fpons@mandrakesoft.com>
+
+ * detect_devices.pm, fs.pm, install_any.pm: added supports for
+ LS-120 floppy drive and icons on desktop of KDE (untested).
+ * printer.pm, printerdrake.pm: added supports for PPA interface in
+ new rhs-printfilters, always enable "Print text as postscript"
+ option for such printers.
+
+2000-03-20 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * keyboard.pm: changed XKB name for Swedish keyboard
+ changed XKB names for Russian and German keyboards
+ added a choice for "Croatian" keyboard
+ * share/compss{,List}: added various new locales-*, ispell-*
+ and netscape-* files. changed ppa to pnm2ppa.
+
+2000-03-17 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps.pm: added setup for all configured queue.
+ * install_steps_interactive.pm: modified for retrieving packages
+ or current configuration.
+ * printer.pm: correction, tested retrieve of printer
+ configuration without printtool comments in printcap file: added
+ update of entry according to gsdriver used (untested again).
+ * printerdrake.pm: better handling of cancel, manage of multiple
+ queue definition together (as lp|My printer).
+
+2000-03-16 François Pons <fpons@mandrakesoft.com>
+
+ * install_steps_interactive.pm: moved in printerdrake.pm the test
+ of printer usage.
+ * printerdrake.pm: heavy modification to handle multiple queue,
+ corrected some bugs too, added much more features as printtool.
+ * printer.pm: added more features for filter, allow printer to be
+ retrieved without help of printtool id in printcap file (untested).
+
+2000-03-14 Pixel <pixel@mandrakesoft.com>
+
+ * diskdrake.pm (Loopback): handling of the file loopback: test
+ existence of the file and take its size.
+
+2000-03-14 François Pons <fpons@mandrakesoft.com>
+
+ * install_any.pm: corrected for duplicate file on other CD.
+
+2000-03-13 Pixel <pixel@mandrakesoft.com>
+
+ * detect_devices.pm (floppies): don't return hash but the device name
+
+2000-03-13 François Pons <fpons@mandrakesoft.com>
+
+ * pkgs.pm, install_any.pm: small correction for multiple media
+ installation.
+ * tools/syncrpms: added for handling synchronisation of multiple source
+ rpm directories (and multiple target), include cleaning.
+ * tools/closurepkgs: tools to get rpm that may be installed by DrakX
+ after normal packages installation (printer, network, X11...), may
+ be used to duplicate on other CD some important stuff of the first
+ one.
+
+2000-03-12 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_interactive.pm (choosePackages): compute the
+ max_size very simply (sum of all package sizes), otherwise too costly
+
+ * pkgs.pm (install): call cleanHeaders at the end
+ * pkgs.pm (cleanHeaders): created
+
+ * install2.pm (miscellaneous): /etc/msec/init.sh is now
+ /usr/sbin/msec (yoann thanks for not telling :pp)
+
+ * pkgs.pm (install): remove the $prefix of mountpoints for not
+ enough room to install error message
+
+2000-03-11 Pixel <pixel@mandrakesoft.com>
+
+ * my_gtk.pm (_create_window): add callback on focus to
+ ensure_focus. The result is no more 3 focus states with 2 buttons.
+
+ * interactive_gtk.pm (ask_from_treelistW): better keyboard handling
+
+ * raid.pm (make): check the result of mkraid. Suggest raidtools
+ are missing in standalone diskdrake
+
+ * devices.pm (set_loop): created, searches for an available
+ loopback and sets the file to it
+
+ * lilo.pm (dev2grub): fixed a missing slash
+
+ * interactive_gtk.pm (wait_message_nextW): do not update if same
+ message, otherwise silly gtk won't do anything and we'll wait
+ forever :(
+
+2000-03-10 François Pons <fpons@mandrakesoft.com>
+
+ * *.pm: heavy modification to take into account multiple media
+ installation.
+
+2000-03-10 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (@install_classes): cleanup, no more i18n (is now in
+ install_steps_interactive), remove old entries
+
+2000-03-09 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (write_conf): don't add alias block-major-11 in every case
+ * modules.pm (add_alias): special case oss (post-installs modprobe snd-pcm-oss)
+
+ * fs.pm (format_*): move the @options before the device
+
+ * loopback.pm: created, added a lot of stuff for loopback in
+ diskdrake.pm, fs.pm...
+
+2000-03-08 Pixel <pixel@mandrakesoft.com>
+
+ * partition_table.pm: %type2fs replaced ox402 by 0x402
+
+ * detect_devices.pm (cdroms): fix "scd" (should be "scd0")
+
+ * install_any.pm (install_urpmi): update for new hdlist.cz2
+
+2000-03-07 Pixel <pixel@mandrakesoft.com>
+
+ * interactive_gtk.pm (ask_from_treelistW): s/focus_row/set_focus_row/
+
+ * install_steps_interactive.pm (addUser): force add a normal user
+ for security 4
+
+2000-03-05 Pixel <pixel@mandrakesoft.com>
+
+ * my_gtk.pm (_ask_from_list): replace focus_row with set_focus_row
+ (tis the Gtk-Perl 0.7002 was of doing)
+
+2000-03-04 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (write_conf): add ide-floppy to the modprobes of
+ post-install supermount
+
+2000-03-03 Pixel <pixel@mandrakesoft.com>
+
+ * commands.pm (ps): add RSS to ps command
+
+2000-03-02 Adam Lebsack <adam@mandrakesoft.com>
+
+ * mouse.pm: added mac mouse detection to mouse::detect.
+ * detect_devices.pm: added a routine to probe /dev/usbmouse on macs.
+
+2000-03-01 François Pons <fpons@mandrakesoft.com>
+
+ * *.pm: heavy modification to take into account smaller
+ transaction during installation.
+ still a lot of test to perform, no provides updated currently and
+ building of hdlist.cz2 and depslist.ordered need old files...
+ nothing done for hdlist.gz during post installation, but
+ hdlist.cz2 is already copied in /var/lib/urpmi [and is used during
+ installation of packages as extract_archive need a true file].
+
+2000-03-01 Pixel <pixel@mandrakesoft.com>
+
+ * lilo.pm (install_grub): creation
+
+ * network.pm (write_interface_conf): ONBOOT = !pcmcia
+
+ * install_steps_gtk.pm (new): more intelligent SIGCHLD handler
+
+2000-02-29 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm: moved common network stuff from "net" to "network"
+ (modules like nfs lockd...)
+
+ * fs.pm (write_fstab): moved the sort to the right place
+
+ * services.pm (drakxservices): chkconfig --list is i18n'ed :(
+ set LANGUAGE=C before
+
+ * partition_table_raw.pm (get_geometry): geom{cylinders} must not
+ be a decimal value :)
+
+ * install_steps_gtk.pm (create_logo_window): set_name logo for
+ logo window
+ * share/install.rc: force disabling of background image theme
+
+ * install_steps_gtk.pm (enteringStep): add step information for
+ console 1
+
+ * any.pm (addKdmIcon): new function
+ * install_steps.pm (addUser): handle field icon
+ * install_steps_interactive.pm (addUser): add choice of kdm icon
+ * standalone/adduserdrake: add choice of kdm icon
+
+ * diskdrake.pm (ask_all_data...): change for easier i18n
+
+ * install_steps.pm (miscellaneous): add CLEAN_TMP handling
+ (need cleaning?)
+ * install_steps_interactive.pm (miscellaneous): add CLEAN_TMP
+ option in expert
+ * install2.pm (miscellaneous): add CLEAN_TMP option for
+ /etc/sysconfig/system
+
+ * install_steps_interactive.pm (miscellaneous): forbidden
+ useSupermount if high security.
+
+ * mouse.pm (detect): fix bug (ttyS instead of ttyS0)
+
+2000-02-28 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (createXconf): do not use "Generic VGA" for
+ svga and accel. SVGA also wants 16 bpp. added ugly modeline for
+ 800x600.
+
+ * partition_table_raw.pm (get_geometry): when the
+ HDIO_GET_IDENTITY fails, defaults to what GETGEO gave
+
+ * install2.pm (main): use modules::load_multi to increase boot
+ start time
+
+ * modules.pm (load_multi): added this function for loading many
+ modules at once.
+
+ * install_steps_gtk.pm (new): increase time before timeout
+
+ * detect_devices.pm (cdroms): change the device associated with
+ ide-burners (hdX -> scdX). Problem is how to know the X in scdX :(
+
+ * modules.pm (write_conf): sort scsi_hostadapter's
+
+2000-02-27 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (main): load ide-probe and the like in 'prereq' type
+ so no aliases are added to conf.modules
+
+2000-02-25 Pixel <pixel@mandrakesoft.com>
+
+ * devices.pm (make): small code cleanup
+
+ * partition_table_raw.pm (adjustEnd): more explicit error message
+
+ * fsedit.pm (allocatePartitions): fix a bug (size was getting too
+ big after each allocation) making adjustEnd cry
+
+2000-02-24 Pixel <pixel@mandrakesoft.com>
+
+ * interactive_gtk.pm (new): added the "new" method to initialize
+ windowheight for isStandalone
+
+ * install_steps_gtk.pm (new): returns undef in case no X server
+ works
+
+ * install2.pm (main): moved the ejectCdrom from install_steps::END
+ to here
+ * install2.pm (main): fix the $SIG{SEGV} handler
+ * install2.pm (main): added a "try again" in text install if the
+ "new" fails
+
+ * install_steps_interactive.pm (createBootdisk): fix an error for
+ non fdX choice of floppy drive
+
+ * install_steps_interactive.pm (setup_thiskind): remove the
+ "defined @l"
+
+2000-02-23 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (%suggestedPartitions): remove any /boot entries
+ * install2.pm (selectInstallClass): removed the special code to
+ /boot entries from suggestedPartitions for on non-intel (and it
+ was buggy :)
+ * fsedit.pm (@suggestions): remove the /boot entry
+ * fsedit.pm (check_mntpoint): remove the 1024 cylinder check
+ * fsedit.pm (suggest_part): remove the 1024 cylinder special case
+
+ * install_steps_interactive.pm (setupLILO): replace linear option
+ by lba32
+
+ * lilo.pm (suggest): add lba32 by default
+
+ * install_steps_interactive.pm (load_thiskind): moved the HPT
+ stuff to install_any::ultra66 and call it.
+ Add sound card configuration (3 lines :)
+
+ * my_gtk.pm and interactive_gtk: resize the list and tree based on
+ root window size
+
+ * install_steps_gtk: $width and $height goes $::rootwidth and
+ $::rootheight, also other dimensions goes global (main::)
+
+ * commands.pm (strings): replace the typo \{$n,} by {$n,}
+
+2000-02-23 François Pons <fpons@mandrakesoft.com>
+
+ * build_archive, extract_archive: changed format of TOC to speed
+ up extraction of archive, now 5 to 6 times faster to read TOC :-)
+
+2000-02-22 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm: load "Cards" database only to translate NAME
+ to fields. Added file CardsNames created from Cards using
+ share/Cards2CardsNames. Kind of list of normalized NAMEs
+
+ * MonitorsDB: replace the ` ' separator for vendor by `|'
+
+ * install_steps_interactive.pm (timeConfig): use ask_from_treelist
+
+ * interactive_gtk.pm (ask_from_treelist): creation of
+ ask_from_treelist. Usage is just the same as ask_from_list with
+ one more argument (the separator eg: |, /)
+
+2000-02-21 François Pons <fpons@mandrakesoft.com>
+
+ * diskdrake.pm: fixed deadlock while trying to create partition
+ when available space is equal or less than 2 cylinders. fixed
+ Create action on corrupted partition by removing stalling window.
+ Blocked partition table writing if there are error by forcing user
+ to correct partition table.
+ * partition_table.pm: fixed typo in verifyParts with cdie, added
+ verifyParts on Resize action.
+
+2000-02-21 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (create_big_help): display the help in full
+ screen
+
+ * my_gtk.pm (_create_window): add big help on F1
+
+ * common.pm (add2hash): now returns the first parameter
+
+ * mouse.pm (detect): really defaults to serial mouse
+
+ * interactive.pm: add ask_many_from_list_with_help and
+ ask_many_from_list_with_help_ref
+
+ * services.pm: creation, it handles what was in
+ standalone/drakxservices
+
+2000-02-18 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps_gtk.pm (createXconf): added /dev/ (X wants
+ "/dev/psaux" and not "psaux")
+
+ * diskdrake.pm (Create): show start sector even for non-expert on
+ non-i386
+
+2000-02-16 Pixel <pixel@mandrakesoft.com>
+
+ * mouse.pm (detect): add defaults to serial mouse
+
+ * install_steps_gtk.pm (createXconf): remove the defaults to
+ serial mouse
+
+2000-02-15 Pixel <pixel@mandrakesoft.com>
+
+ * diskdrake.pm: "After %s partition %s," inlined otherwise does
+ not please pablo and translators...
+
+2000-02-14 Pixel <pixel@mandrakesoft.com>
+
+ * diskdrake.pm (Create): hide start sector choice for non-expert
+
+2000-02-11 Pixel <pixel@mandrakesoft.com>
+
+ * partition_table_raw.pm (get_geometry): do not use the cylinder
+ number given by HDIO_GETGEO cuz limited to 16bits. Compute using
+ the total_sectors using HDIO_GET_IDENTITY
+
+ * c/stuff.xs.pm: added total_sectors (gives the number of sector
+ of a drive)
+
+ * modules.pm (load): ignore error in loading prereq's
+
+ * modules.pm (@drivers_by_category): rcpci instead of rcpci45,
+ z85230 added
+
+ * commands.pm (mount): add modules::load_deps otherwise the
+ fs::mount won't succeed insmoding vfat if needed
+
+2000-02-11 François Pons <fpons@mandrakesoft.com>
+
+ * fixed diskdrake to handle limit case when creating and resizing
+ partition table, address size limit and start sector limit.
+
+2000-02-11 Pixel <pixel@mandrakesoft.com>
+
+ * install2.pm (main): add a callback on SEGV
+ -> message printed
+ -> that way, ENDs are called (otherwise skipped)
+
+ * install_steps_interactive.pm (setup_thiskind): handles the undef
+ value returned by load_thiskind
+
+ * install_steps_interactive.pm (exitInstall): do not call
+ install_steps::exitInstall
+
+ * install_steps (exitInstall): removed
+ * install_steps (END): added (it does ejectCdrom)
+
+ * install_steps_interactive.pm (load_thiskind): returns undef if
+ error loading a module
+
+ * fs.pm (format_part): changed the prototype from $;$@ to $;@
+ otherwise, @options always have a value (mostly undef) and mkdosfs
+ fails (with "mkdosfs", "/dev/hdXX", undef, "-F", 32)
+
+ * install_steps_interactive.pm (setup_thiskind):
+ add a $auto_probe_pci that overrules $o->{auto_probe_pci}
+ (that way no pci probe the second time)
+
+2000-02-10 François Pons <fpons@mandrakesoft.com>
+
+ * heavy modification of build_archive and extract_archive to manage
+ a TOC directly in archive file, handle bzip2 or gzip compression,
+ extract_archive can extract multiple files a time, with minimal
+ invocation of uncompress program and follow symlink and expand
+ directory contents.
+ * use build_archive/extract_archive for locales.
+ * fixed a min/max in install_steps_gtk for Resize/Create partition.
+ * fixed adjustEnd with dos partition table, take care of magic 63
+ sectors at beginning of partitions, a more solid method should be
+ used for that.
+
+2000-02-10 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (load_thiskind): skip modules "unknown" and "ignore"
+
+2000-02-09 Pixel <pixel@mandrakesoft.com>
+
+ * partition_table.pm (add): cdie if maximum number of partitions
+ handled by linux is reached
+
+ * Xconfigurator.pm (chooseResolutionsGtk): display the graphic
+ card or server found
- * install_any.pm (install_urpmi): added
- $SIG{CHLD} = 'IGNORE';
- fork and exec("gzip", "-9", $f) || c::_exit(1);
- may cause problems?
+ * install_any.pm (relGetFile): for mdkinst files, take care not to
+ have a double '/' (see debbugs #591)
- * install2.pm (main): moved updating things for kde in
- install_steps::afterInstallPackages
- * install2.pm (main): moved msec in in addToBeDone after
- doInstallStep in install2::miscellaneous
+ * install_steps_interactive.pm (configureNetwork):
+ purpose: add ability to configure both modem and lan
+ clean up the behaviour
+ * fs.pm (write_fstab):
+ purpose: sort the fstab per mount point (cuz /usr must be before /usr/local)
+ also: rewrite of the part writing the fstab.
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 68fe70782..0b3b180dd 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -1,114 +1,156 @@
-SO_FILES = c/blib/arch/auto/c/c.so
-PMS = *.pm resize_fat/*.pm commands diskdrake
-DEST = /tmp/t
-DESTREP4PMS = $(DEST)/usr/bin/perl-install
-PERL = ./perl
-BINS = /bin/ash /sbin/mke2fs $(PERL)
+include Makefile.config
-.PHONY: all tags install clean verify_c
+.PHONY: all $(DIRS) install clean stage2 full_stage2 verify_c
-all: $(SO_FILES)
+all: TAGS $(DIRS)
-tags:
- etags -o - $(PMS) | perl2etags > TAGS
+TAGS: $(PMS)
+ etags -o - $^ | ./perl2etags > $@
clean:
- test ! -e c/Makefile || $(MAKE) -C c clean
- find . -name "*~" -name "TAGS" -name "*.old" | xargs rm -f
+ for i in $(DIRS); do $(MAKE) -C $$i clean; done
+ rm -rf auto ../drakxtools.tar.bz2
+ find . -name "*~" -o -name ".#*" -o -name "TAGS" -o -name "*.old" | xargs rm -f
-tar: clean
- cd .. ; tar cfy perl-install.tar.bz2 --exclude perl-install/perl perl-install
+tar-drakxtools: clean
+ $(MAKE) -C ../tools clean
+ cd .. ; rm -rf drakxtools ; cp -af perl-install drakxtools ; cp -af tools/ddcprobe tools/serial_probe drakxtools
+ cd ../drakxtools ; rm -rf install* pkgs.pm ftp.pm t.pm */CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* .
+ cd .. ; tar cfI drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config share/MonitorsDB share/Cards+ share/CardsNames Newt c ddcprobe serial_probe share/po pci_probing sbus_probing resize_fat share/diskdrake.rc share/isdndb.net $(STANDALONEPMS) icons *.pm)
+ cd .. ; rm -rf drakxtools
-c/c.xs: c/c.xs.pm
- chmod u+w $@
- perl $< > $@
- chmod a-w $@
-
-$(SO_FILES): c/c.xs
- test -e c/Makefile || (cd c; perl Makefile.PL)
- $(MAKE) -C c
+$(DIRS):
+ install -d auto
+ $(MAKE) -C $@
test_pms: verify_c
- perl2fcalls -excludec install2.pm
- (for i in $(PMS); do perl -cw -I. -Ic -Ic/blib/arch $$i || exit 1 ; done)
+ for i in install2 standalone/keyboarddrake standalone/XFdrake standalone/drakboot; do ./perl2fcalls -excludec -excluderesize_fat::c_rewritten $$i; done
+ for i in install2 install_steps_*.pm; do perl -cw -I. $$i; done
verify_c:
./verify_c $(PMS)
-install_pms: $(SO_FILES)
- for i in `perl -ne 's/sub (\w+?)_? {.*/$$1/ and print' commands.pm`; do ln -sf commands $(DEST)/usr/bin/$$i; done
+install_pms: $(DIRS)
+ for i in `perl -ne 's/sub (\w+?)_? {.*/$$1/ and print' commands.pm` sync; do ln -sf commands $(DEST)/usr/bin/$$i; done
install -d $(DESTREP4PMS)
for i in $(PMS); do \
dest=$(DESTREP4PMS)/`dirname $$i`; \
install -d $$dest; \
- perl -ne 'print #unless /^use (diagnostics|vars|strict)/' $$i > $(DESTREP4PMS)/$$i; \
+ perl -ne 'print' $$i > $(DESTREP4PMS)/$$i; \
+ perl -pe 's/#[-+].*//; $$_ = "\n" if (/^=head/ .. /^=cut/) || /use (diagnostics|vars|strict)/' $$i > $(DESTREP4PMS)/$$i; \
done
- @# cp -f $$i $$dest; \
- cp diskdrake.rc $(DESTREP4PMS)
- ln -sf perl-install/install2.pm $(DEST)/usr/bin/install2
- ln -sf perl-install/commands $(DEST)/usr/bin/commands
- chmod a+x $(DESTREP4PMS)/install2.pm
+# perl -pe 's/#-.*//; $$_ = "\n" if (/^=head/ .. /^=cut/) || /use (diagnostics)/' $$i > $(DESTREP4PMS)/$$i; \
+
+ cp share/*.rc $(DESTREP4PMS)
+ install -d $(DESTREP4PMS)/po
+ cp -f share/po/*.po* $(DESTREP4PMS)/po ||:
+ chmod a+x $(DESTREP4PMS)/install2
chmod a+x $(DESTREP4PMS)/commands
+ chmod a+x $(DESTREP4PMS)/standalone/*
+ chmod a+x $(DESTREP4PMS)/g_auto_install
+ chmod a+x $(DESTREP4PMS)/live_install*
- cp -af */blib/arch/auto $(DESTREP4PMS)
- find $(DESTREP4PMS) -name "*.so" | xargs strip
+get_needed_files: $(DIRS)
+# export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2 < /dev/null
+ perl -pe "s/ARCH/$(ARCH)/g" share/list > /tmp/list
-full_tar:
- cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/Gtk* $(DESTREP4PMS)
- cp -af /usr/lib/perl5/site_perl/5.005/i386-linux/auto/Gtk $(DESTREP4PMS)/auto
- find $(DESTREP4PMS) -name "*.so" | xargs strip
- cd $(DESTREP4PMS)/.. ; tar cfz /tmp/perl-install.tgz perl-install
+# perl -pi -e 's/00503/6.0/g' /tmp/list
+# see also /usr/lib/perl5/5.00503/ARCH-linux/Data/Dumper.pm
-get_needed_files: $(SO_FILES)
- export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2.pm < /dev/null
+ cat `../tools/specific_arch share/list` >> /tmp/list
+ find auto -follow -name "*.so" >> /tmp/list
- install -d $(DEST)/bin
- install -d $(DEST)/usr/bin
- for i in $(BINS) `grep "\.so" /tmp/list`; do \
- install -s $$i $(DEST)/usr/bin; \
- ldd $$i | sed -e 's/.*=> //' -e 's/ .*//' >> /tmp/list; \
- done
- for i in `sort /tmp/list | uniq`; do \
- install -d $(DEST)/`dirname $$i` && \
- if (echo $$i | grep "\.pm"); then \
- perl -pe '$$_ eq "__END__" and exit(0);' $$i > $(DEST)/$$i; \
- else \
- cp -f $$i $(DEST)/$$i; \
- fi && \
- strip $(DEST)/$$i 2>/dev/null || true; \
+ for i in $(LOCALFILES) `cat /tmp/list` ; do \
+ ldd $$i 2>/dev/null | grep "=>" | sed -e 's/.*=> //' -e 's/ .*//' | uniq | sort >> /tmp/list; \
done
- mv $(DEST)/usr/lib/*.so* $(DEST)/lib
-
- ln -sf ../usr/bin/sh $(DEST)/bin/sh
- ln -sf ../usr/bin/tr $(DEST)/bin/tr
- ln -sf sh $(DEST)/bin/bash
- ln -sf ash $(DEST)/usr/bin/sh
- echo -e "#!/usr/bin/perl\n\nsymlink '/tmp/rhimage/usr/lib/perl5', '/usr/lib/perl5';\nexec '/bin/sh'" > $(DEST)/usr/bin/runinstall2
- chmod a+x $(DEST)/usr/bin/runinstall2
+ perl -Mlang -I. -e 'print "$$_\n" foreach lang::console_font_files()' >> /tmp/list
-as_root:
- /bin/dd if=/dev/zero of=/tmp/initrd bs=1k count=4000
- echo y | /sbin/mke2fs /tmp/initrd
- losetup /dev/loop0 /tmp/initrd
- mount /dev/loop0 /mnt/initrd
- chmod a+w /mnt/initrd
+ install -d $(DEST)/etc
+ install -d $(DEST)/etc/sysconfig/network-scripts
+ install -d $(DEST)/lib
+ install -d $(DEST)/bin
+ install -d $(DEST)/usr/bin
+ install -d $(DEST)/usr/lib
+ install -d $(DEST)/usr/share
+ install -d $(DEST)/usr/share/gtk
+ install -d $(DEST)/usr/share/xmodmap
+ install -d $(DEST)/usr/X11R6/lib/X11
+ install -d $(ROOTDEST)/Mandrake/base
+ install -s $(LOCALFILES) $(DEST)/usr/bin
+# cp -f $(LOCALFILES2) $(DEST)/usr/bin
+ifeq (sparc,$(ARCH))
+ cp -a /usr/X11R6/lib/X11/xkb $(DEST)/usr/X11R6/lib/X11
+ rm -f $(DEST)/usr/X11R6/lib/X11/xkb/compiled
+ ln -s /tmp $(DEST)/usr/X11R6/lib/X11/xkb/compiled
+ ln -s /usr/X11R6/lib/X11 $(DEST)/usr/lib/X11
+ ln -s /usr/X11R6/lib/X11/xkb/xkbcomp $(DEST)/usr/bin/xkbcomp
+endif
+
+ for i in `cat /tmp/list`; do \
+ if (echo $$i | grep -q "lib/[^/]*\.so"); then \
+ install -s $$i $(DEST)/lib; \
+ else \
+ d=$$i; \
+ (echo $$d | grep -q "^[^/]") && d="$(REP4PMS)/$$d"; \
+ d=`echo $(DEST)/$$d | sed 's/\/usr\/local\//\/usr\//'`; \
+ install -d `dirname $$d` && \
+ if (echo $$i | grep -q "\.pm"); then \
+ perl -pe '$$_ =~ /^__END__/ and exit(0);' $$i > $$d; \
+ elif (echo $$i | grep -q "\.so"); then \
+ install -s $$i $$d; \
+ else \
+ cp -f $$i $$d; \
+ fi; \
+ fi; \
+ done
+ mv -f $(DEST)/lib/libimlib-png.so $(DEST)/usr/lib
+
+ mv -f $(DEST)/bin/* $(DEST)/sbin/* $(DEST)/usr/bin
+ cd $(DEST)/usr/bin ; mv insmod insmod_
+ rmdir $(DEST)/bin $(DEST)/sbin
+
+ perl -ane 'symlink "$$F[1]", "$(DEST)/usr/bin/$$F[0]"' share/aliases
+
+ for i in fonts keyboards locales gconv keymaps; do tar xfI `../tools/specific_arch share/$$i.tar.bz2` -C $(DEST); done
+
+ cd share ; cp -a modparm.lst $(DEST)/usr/share
+ cd share ; cp -a consolefonts $(DEST)/usr/share
+ cd share ; cp template.in/*.in $(DEST)/usr/share
+ cd share ; cp MonitorsDB Cards+ CardsNames $(DEST)/usr/X11R6/lib/X11
+ cd share ; cp *.xpm $(DEST)/usr/share
+ cd share ; cp isdndb.net $(DEST)/usr/share/isdn_db.txt
+ cd share ; cp -a themes $(DEST)/usr/share/gtk
+ cd share ; cp compssUsers compssUsers.desktop compssList $(ROOTDEST)/Mandrake/base
+
+ if [ -f ../modules/modules.cz* ]; then \
+ cp -f ../modules/modules.cz* $(DEST)/lib/; \
+ if [ -f ../modules64/modules.cz* ]; then \
+ cp -f ../modules64/modules.cz* $(DEST)/lib/modules64.cz2; \
+ fi \
+ else \
+ cp -f ../modules/modules.cpio.bz2 $(DEST)/lib/; \
+ install -d $(DEST)/lib/modules; \
+ cp -f ../modules/pristine/* $(DEST)/lib/modules ||: ; \
+ fi
+
+# echo -e '#!/bin/sh\n\nexec "/usr/bin/sh"' > $(DEST)/usr/bin/runinstall2
+# chmod a+x $(DEST)/usr/bin/runinstall2
+
+ifeq (i386,$(ARCH))
+ cp -a /etc/pcmcia $(DEST)/etc
+ patch -p0 -d $(DEST)/etc < ../install/pcmcia_config.patch
+endif
+
+ find $(DEST) -name CVS | xargs rm -rf
full_stage2:
- rm -rf $(DEST)/[^M]*
- @#mkdir -p $(DEST)/Mandrake/base
- @#ln -s .. $(DEST)/Mandrake/instimage
+ if [ `id -u` = 0 ]; then rm -rf $(DEST); else $(SUDO) rm -rf $(DEST); fi
+ mkdir -p $(DEST)
$(MAKE) get_needed_files
$(MAKE) stage2
stage2:
$(MAKE) install_pms
-
- @#rm -rf /mnt/initrd/*
- @#cp -a $(DEST)/* /mnt/initrd
- @#sync
- @#dd if=/dev/loop0 | gzip -9 > /tmp/t/Mandrake/base/stage2.img
-
-
-# function f() { grep "$*" /usr/include/*.h /usr/include/*/*.h; }
+ $(ROOTDEST)/misc/make_mdkinst_stage2 $(DEST) $(ROOTDEST)/Mandrake/base/mdkinst_stage2
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config
index d7a9c0c58..a24f67bc8 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -1,9 +1,12 @@
+ARCH := $(patsubst i%86,i386,$(shell uname -m))
+ARCH := $(patsubst sparc%,sparc,$(ARCH))
+
VERSION = 2.2.10-BOOT
SUDO = sudo
SO_FILES = c/blib/arch/auto/c/c.so
-PMS = *.pm Newt/*.pm c/stuff.pm resize_fat/*.pm pci_probing/*.pm commands install2 g_auto_install
-STANDALONEPMS= diskdrake XFdrake mousedrake lspcidrake printerdrake keyboarddrake netdrake drakxconf drakxservices draksec adduserdrake
-PMS += $(STANDALONEPMS:%=standalone/%) standalone/rpmdrake
+PMS = *.pm Newt/*.pm c/stuff.pm resize_fat/*.pm pci_probing/*.pm sbus_probing/*.pm commands install2 g_auto_install live_install live_install2
+STANDALONEPMS= diskdrake XFdrake mousedrake lspcidrake printerdrake keyboarddrake netdrake draknet drakxconf drakxservices draksec drakboot adduserdrake rpmdrake drakgw livedrake
+PMS += $(STANDALONEPMS:%=standalone/%)
REP4PMS = /usr/bin/perl-install
ROOTDEST = /export
DEST = $(ROOTDEST)/Mandrake/mdkinst
@@ -11,10 +14,8 @@ STAGE2 = $(ROOTDEST)/Mandrake/base/mdkinst_stage2
BASE = $(ROOTDEST)/Mandrake/base
DESTREP4PMS = $(DEST)$(REP4PMS)
PERL = perl
-LOCALFILES = $(patsubst %, ../tools/%,e2fsck.shared ddcprobe/ddcxinfos pnp_serial/pnp_serial)
-LOCALFILES2 = extract_archive
-DIRS = c Newt po pci_probing resize_fat
-EXCLUDE = $(LOCALFILES) boot.img keymaps consolefonts install
+LOCALFILES = $(patsubst %, ../tools/%,$(ARCH)/e2fsck.shared ddcprobe/ddcxinfos serial_probe/serial_probe xhost+)
+DIRS = c Newt pci_probing resize_fat #po
CFLAGS = -Wall
override CFLAGS += -pipe
diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools
index 5e4eff121..dc93aaf29 100644
--- a/perl-install/Makefile.drakxtools
+++ b/perl-install/Makefile.drakxtools
@@ -1,10 +1,14 @@
-DIRS = ddcprobe po Newt c pci_probing resize_fat
+include Makefile.config
+
+DIRS = ddcprobe serial_probe share/po Newt c pci_probing resize_fat
PREFIX =
SBINDEST = $(PREFIX)/usr/sbin
ETCDEST = $(PREFIX)/etc/gtk
+DATADIR = $(PREFIX)/usr/share
BINDEST = $(PREFIX)/usr/bin
LIBDEST = $(PREFIX)/usr/lib/libDrakX
-X11DEST = $(PREFIX)/usr/X11R6/lib/X11
+BINX11DEST = $(PREFIX)/usr/X11R6/bin
+LIBX11DEST = $(PREFIX)/usr/X11R6/lib/X11
.PHONY: $(DIRS)
@@ -12,19 +16,28 @@ all: $(DIRS)
$(DIRS):
install -d auto
+ rm standalone ; ln -s . standalone
+ rm -f po/DrakX.pot # force rebuild of po's
$(MAKE) -C $@
install:
- install -d $(BINDEST) $(ETCDEST) $(SBINDEST) $(LIBDEST) $(X11DEST) $(DIRS:%=$(LIBDEST)/%)
- install diskdrake XFdrake ddcprobe/ddcxinfos $(SBINDEST)
+ install -d $(BINDEST) $(ETCDEST) $(SBINDEST) $(DATADIR) $(LIBDEST) $(BINX11DEST) $(LIBX11DEST) $(LIBDEST)/po $(DIRS:%=$(LIBDEST)/%)
+ install -d $(LIBDEST)/sbus_probing
+ install $(STANDALONEPMS) $(SBINDEST)
+ mv -f $(SBINDEST)/lspcidrake $(BINDEST)
+ install -s ddcprobe/ddcxinfos serial_probe/serial_probe $(SBINDEST)
+ ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres
for i in *.pm ; do perl -pe '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' $$i > $(LIBDEST)/$$i ; done
- install -m 644 MonitorsDB $(X11DEST)
- install -m 644 diskdrake.rc $(ETCDEST)
- install -m 644 po/*.po $(LIBDEST)/po
+ install -m 644 share/isdndb.net $(DATADIR)/isdn_db.txt
+ install -m 644 share/{MonitorsDB,CardsNames,Cards+} $(LIBX11DEST)
+ install -m 644 share/diskdrake.rc $(ETCDEST)
+ install -m 644 share/po/*.po $(LIBDEST)/po
install -m 644 $(patsubst %,Newt/%.pm,Newt) $(LIBDEST)/Newt
install -m 644 $(patsubst %,c/%.pm,stuff) $(LIBDEST)/c
install -m 644 $(patsubst %,pci_probing/%.pm,main pcitable pci_class) $(LIBDEST)/pci_probing
+ install -m 644 $(patsubst %,sbus_probing/%.pm,main) $(LIBDEST)/sbus_probing
install -m 644 $(patsubst %,resize_fat/%.pm,main any boot_sector c_rewritten dir_entry directory fat info_sector io) $(LIBDEST)/resize_fat
- cp -rf auto $(LIBDEST)
-
+ cp -rf auto icons $(LIBDEST)
+ bzip2 -9 $(LIBDEST)/po/*.po
+ find $(LIBDEST) -name "*.so" | xargs strip
diff --git a/perl-install/Newt/Av_CharPtrPtr.c b/perl-install/Newt/Av_CharPtrPtr.c
index d108ef5d0..f28fa6315 100644
--- a/perl-install/Newt/Av_CharPtrPtr.c
+++ b/perl-install/Newt/Av_CharPtrPtr.c
@@ -52,7 +52,7 @@ SV *rv;
if( s[x] == NULL )
warn("XS_unpack_charPtrPtr: unable to malloc char*");
else
- strcpy( s[x], SvPV( *ssv, na ) );
+ strcpy( s[x], SvPV( *ssv, PL_na ) );
}
else
warn("XS_unpack_charPtrPtr: array elem %d was not a string.", x );
diff --git a/perl-install/Newt/Newt.pm b/perl-install/Newt/Newt.pm
index 80dbaf54f..fdf9c0232 100644
--- a/perl-install/Newt/Newt.pm
+++ b/perl-install/Newt/Newt.pm
@@ -1,4 +1,4 @@
-package Newt;
+package Newt; # $Id$
use strict;
use vars qw($VERSION @ISA);
@@ -9,8 +9,8 @@ use vars qw($VERSION @ISA);
$VERSION = '0.01';
bootstrap Newt $VERSION;
-package Newt::Component;
-package Newt::Grid;
+package Newt::Component; # $Id$
+package Newt::Grid; # $Id$
1;
diff --git a/perl-install/Newt/Newt.xs b/perl-install/Newt/Newt.xs
index e60583de1..97c056ee6 100644
--- a/perl-install/Newt/Newt.xs
+++ b/perl-install/Newt/Newt.xs
@@ -9,6 +9,13 @@ static void suspend() {
newtResume();
}
+static void componentCallback(newtComponent co, void *data) {
+ dSP;
+ PUSHMARK(SP);
+ perl_call_sv((SV *) data, G_DISCARD);
+}
+
+
typedef newtComponent Newt__Component;
typedef newtGrid Newt__Grid;
@@ -22,38 +29,6 @@ DESTROY()
newtFinished();
}
-void
-changeColors()
- CODE:
-{
-const struct newtColors colors = {
- "cyan", "black", /* root fg, bg */
- "black", "blue", /* border fg, bg */
- "white", "blue", /* window fg, bg */
- "white", "black", /* shadow fg, bg */
- "white", "blue", /* title fg, bg */
- "yellow", "cyan", /* button fg, bg */
- "white", "cyan", /* active button fg, bg */
- "yellow", "blue", /* checkbox fg, bg */
- "blue", "brown", /* active checkbox fg, bg */
- "yellow", "blue", /* entry box fg, bg */
- "white", "blue", /* label fg, bg */
- "black", "cyan", /* listbox fg, bg */
- "yellow", "cyan", /* active listbox fg, bg */
- "white", "blue", /* textbox fg, bg */
- "cyan", "black", /* active textbox fg, bg */
- "white", "blue", /* help line */
- "yellow", "blue", /* root text */
- "blue", /* scale full */
- "red", /* scale empty */
- "blue", "cyan", /* disabled entry fg, bg */
- "white", "blue", /* compact button fg, bg */
- "yellow", "red", /* active & sel listbox */
- "black", "brown" /* selected listbox */
-};
- newtSetColors(colors);
-}
-
int
newtInit()
@@ -63,6 +38,12 @@ newtFinished()
void
newtCls()
+void
+newtSuspend()
+
+void
+newtResume()
+
int
newtCenteredWindow(width,height,title)
int width;
@@ -161,6 +142,13 @@ newtWinMenu(title,text,suggestedWidth,flexDown,flexUp,maxListHeight,list,def,but
MODULE = Newt PACKAGE = Newt::Component PREFIX = newt
+void
+addCallback(co, callback)
+ Newt::Component co;
+ SV *callback;
+ CODE:
+ newtComponentAddCallback(co, componentCallback, callback);
+
Newt::Component
newtCompactButton(left,top,text)
int left;
@@ -174,15 +162,14 @@ newtButton(left,top,text)
const char * text;
Newt::Component
-newtCheckbox(left,top,text,defValue,seq,result)
+newtCheckbox(left,top,text,defValue,seq)
int left;
int top;
const char * text;
char *defValue;
const char * seq;
- int *result;
CODE:
- RETVAL = newtCheckbox(left, top, text, defValue[0], seq, (char*)result);
+ RETVAL = newtCheckbox(left, top, text, defValue[0], seq, NULL);
OUTPUT:
RETVAL
@@ -229,94 +216,28 @@ newtListbox(left,top,height,flags)
int height;
int flags;
-void *
+char *
newtListboxGetCurrent(co)
Newt::Component co;
void
-newtListboxSetCurrent(co,num)
- Newt::Component co;
- int num;
-
-void
-newtListboxSetCurrentByKey(co,key)
- Newt::Component co;
- void * key;
-
-void
-newtListboxSetText(co,num,text)
+newtListboxSetCurrent(co,indice)
Newt::Component co;
- int num;
- const char * text;
-
-void
-newtListboxSetEntry(co,num,text)
- Newt::Component co;
- int num;
- const char * text;
+ int indice;
void
newtListboxSetWidth(co,width)
Newt::Component co;
int width;
-# return the data passed to AddEntry
-void
-newtListboxSetData(co,num,data)
- Newt::Component co;
- int num;
- void * data;
-
int
-newtListboxAddEntry(co,text,data)
+newtListboxAddEntry(co,text)
Newt::Component co;
const char * text;
- const void * data;
-
-# Send the key to insert after, or NULL to insert at the top
-int
-newtListboxInsertEntry(co,text,data,key)
- Newt::Component co;
- const char * text;
- const void * data;
- void * key;
-
-int
-newtListboxDeleteEntry(co,data)
- Newt::Component co;
- void * data;
-
-# removes all entries from listbox
-void
-newtListboxClear(co)
- Newt::Component co;
-
-void
-newtListboxGetEntry(co,num,text,data)
- Newt::Component co;
- int num;
- char * text;
- void * data;
- PPCODE:
- {
- newtListboxGetEntry(co, num, &text, data);
- }
-
-# Returns an array of data pointers from items, last element is NULL
-void *
-newtListboxGetSelection(co,numitems)
- Newt::Component co;
- int *numitems;
-
-void
-newtListboxClearSelection(co)
- Newt::Component co;
-
-void
-newtListboxSelectItem(co,key,sense)
- Newt::Component co;
- void *key
- enum newtFlagsSense sense;
+CODE:
+ RETVAL = newtListboxAddEntry(co, text, text);
+OUTPUT:
+ RETVAL
Newt::Component
newtTextboxReflowed(left,top,text,width,flexDown,flexUp,flags)
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index 042388e85..350c7df33 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -1,11 +1,17 @@
-package Xconfig;
+package Xconfig; # $Id$
+
+use diagnostics;
+use strict;
use common qw(:common :file :system);
+use mouse;
+use devices;
+use Xconfigurator;
# otherwise uses the rule substr($keymap, 0, 2)
my %keymap_translate = (
cf => "ca_enhanced",
- uk => "gb",
+ uk => "gb",
);
@@ -17,73 +23,121 @@ sub keymap_translate {
sub getinfo {
- my $o = {};
- getinfoFromXF86Config($o);
+ my $o = shift || {};
+ getinfoFromDDC($o);
getinfoFromSysconfig($o);
- unless ($o->{mouse}->{xtype}) {
- my ($type, $dev) = split("\n", `mouseconfig --nointeractive 2>/dev/null`) or die "mouseconfig failed";
- $o->{mouse}->{xtype} ||= $type;
- $o->{mouse}->{device} ||= "/dev/$dev";
- }
- $o->{mouse}->{device} ||= "/dev/mouse" if -e "/dev/mouse";
+ add2hash($o->{mouse}, mouse::detect()) unless $o->{mouse}{XMOUSETYPE};
+
+ $o->{mouse}{device} ||= "mouse" if -e "/dev/mouse";
$o;
}
sub getinfoFromXF86Config {
my $o = shift || {};
- my (%c, $depth);
+ my $prefix = shift || "";
+ my (%c, $depth, $driver);
+
+ $o->{card}{server} ||= $1 if readlink("$prefix/etc/X11/X") =~ /XF86_ (\w+)$/x; #- /x for perl2fcalls
- $o->{card}->{server} ||= $1 if readlink("/etc/X11/X") =~ /XF86_ (\w+)$/x; # /x for perl2fcalls
-
- local *F;
- open F, "/etc/X11/XF86Config" or return {};
- foreach (<F>) {
+ local *F; open F, "$prefix/etc/X11/XF86Config" or return {};
+ local $_;
+ while (<F>) {
if (/^Section "Keyboard"/ .. /^EndSection/) {
- $o->{keyboard}->{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/;
+ $o->{keyboard}{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/;
} elsif (/^Section "Pointer"/ .. /^EndSection/) {
- $o->{mouse}->{xtype} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
- $o->{mouse}->{device} ||= $1 if /^\s*Device\s+"(.*?)"/;
+ $o->{mouse}{XMOUSETYPE} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
+ $o->{mouse}{device} ||= $1 if m|^\s*Device\s+"/dev/(.*?)"|;
+ $o->{mouse}{cleardtrrts} ||= 1 if m/^\s*ClearDTR\s+/;
+ $o->{mouse}{cleardtrrts} ||= 1 if m/^\s*ClearRTS\s+/;
+ $o->{mouse}{nbuttons} = 2 if m/^\s*Emulate3Buttons\s+/;
+ $o->{mouse}{nbuttons} ||= 5 if m/^\s*ZAxisMapping\s.*5/;
+ $o->{mouse}{nbuttons} = 7 if m/^\s*ZAxisMapping\s.*7/;
} elsif (my $i = /^Section "Device"/ .. /^EndSection/) {
- if ($i = 1 && $c{type} && $c{type} ne "Generic VGA") {
- add2hash($o->{card} ||= {}, \%c);
- %c = ();
- }
+ %c = () if $i == 1;
+
$c{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/;
- $c{memory} ||= $1 if /^\s*VideoRam\s+(\d+)/;
+ $c{memory} ||= $1 if /VideoRam\s+(\d+)/;
+ $c{flags}{needVideoRam} ||= 1 if /^\s*VideoRam\s+/;
$c{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/;
$c{board} ||= $1 if /^\s*BoardName\s+"(.*?)"/;
-
- push @{$c{lines}}, $_ unless /(Section|Identifier|VideoRam|VendorName|BoardName)/;
+ $c{driver} ||= $1 if /^\s*Driver\s+"(.*?)"/;
+ $c{options}{$1} ||= 1 if /^\s*Option\s+"(.*?)"/;
+ $c{options}{$1} ||= 0 if /^\s*#\s*Option\s+"(.*?)"/;
+
+ #- clockchip, ramdac, dacspeed read with following line.
+ push @{$c{lines}}, $_ unless /(Section|Identifier|VideoRam|VendorName|BoardName|Option)/;
+
+ add2hash($o->{card} ||= {}, \%c) if ($i =~ /E0/ && $c{type} && $c{type} ne "Generic VGA");
} elsif (/^Section "Monitor"/ .. /^EndSection/) {
- $o->{monitor}->{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/;
- $o->{monitor}->{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/;
- $o->{monitor}->{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/;
- $o->{monitor}->{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/;
- $o->{monitor}->{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/;
- } elsif (/^Section "Screen"/ .. /^EndSection/) {
- $o->{card}->{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/;
- if (my $i = /^\s*Subsection\s+"Display"/ .. /^\s*EndSubsection/) {
- $depth = undef if $i == 1;
- $depth = $1 if /^\s*Depth\s+(\d*)/;
- if (/^\s*Modes\s+(.*)/) {
- my $a = 0;
- push @{$o->{card}->{depth}->{$depth || 8}},
- grep { $_->[0] >= 640 } map { [ /"(\d+)x(\d+)"/ ] } split ' ', $1;
+ $o->{monitor}{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/;
+ $o->{monitor}{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/;
+ $o->{monitor}{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/;
+ $o->{monitor}{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/;
+ $o->{monitor}{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/;
+ $o->{monitor}{modelines} .= $_ if /^\s*Mode[lL]ine\s+/;
+ } elsif (my $s = /^Section "Screen"/ .. /^EndSection/) {
+ undef $driver if $s == 1;
+ $driver = $1 if /^\s*Driver\s+"(.*?)"/;
+ if ($driver eq $Xconfigurator::serversdriver{$o->{card}{server}}) {
+ $o->{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/;
+ if (my $i = /^\s*Subsection\s+"Display"/ .. /^\s*EndSubsection/) {
+ undef $depth if $i == 1;
+ $depth = $1 if /^\s*Depth\s+(\d*)/;
+ if (/^\s*Modes\s+(.*)/) {
+ my $a = 0;
+ unshift @{$o->{card}{depth}{$depth || 8} ||= []}, #- insert at the beginning for resolution_wanted!
+ grep { $_->[0] >= 640 } map { [ /"(\d+)x(\d+)"/ ] } split ' ', $1;
+ }
}
}
}
}
+ #- get the default resolution according the the current file.
+ if (my @depth = keys %{$o->{card}{depth}}) {
+ $o->{resolution_wanted} ||=
+ ($o->{card}{depth}{$o->{default_depth} || $depth[0]}[0][0]) . "x" .
+ ($o->{card}{depth}{$o->{default_depth} || $depth[0]}[0][1]);
+ }
$o;
}
sub getinfoFromSysconfig {
my $o = shift || {};
- if (my %mouse = getVarsFromSh "/etc/sysconfig/mouse") {
- $o->{mouse}->{xtype} ||= $mouse{XMOUSETYPE};
+ my $prefix = shift || "";
+
+ add2hash($o->{mouse} ||= {}, { getVarsFromSh("$prefix/etc/sysconfig/mouse") });
+
+ if (my %keyboard = getVarsFromSh "$prefix/etc/sysconfig/keyboard") {
+ $o->{keyboard}{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE}) if $keyboard{KEYTABLE};
}
- if (my %keyboard = getVarsFromSh "/etc/sysconfig/keyboard") {
- $keyboard{KEYTABLE} or last;
- $o->{keyboard}->{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE});
+ $o;
+}
+
+sub getinfoFromDDC {
+ my $o = shift || {};
+ my $O = $o->{monitor} ||= {};
+ #- return $o if $O->{hsyncrange} && $O->{vsyncrange} && $O->{modelines};
+ devices::make("/dev/zero"); #- needed by ddcxinfos
+ my ($m, @l) = `ddcxinfos`;
+ $? == 0 or return $o;
+
+ $o->{card}{memory} ||= to_int($m);
+ local $_;
+ while (($_ = shift @l) ne "\n") {
+ my ($depth, $x, $y) = split;
+ $depth = int(log($depth) / log(2));
+ if ($depth >= 8 && $x >= 640) {
+ push @{$o->{card}{depth}{$depth}}, [ $x, $y ] unless scalar grep { $_->[0] == $x && $_->[1] == $y } @{$o->{card}{depth}{$depth}};
+ push @{$o->{card}{depth}{32}}, [ $x, $y ] if $depth == 24 && ! scalar grep { $_->[0] == $x && $_->[1] == $y } @{$o->{card}{depth}{32}};
+ }
}
+ my ($h, $v, $size, @m) = @l;
+
+ chop $h; chop $v;
+ $O->{hsyncrange} ||= $h;
+ $O->{vsyncrange} ||= $v;
+ $O->{size} ||= to_float($size);
+ $O->{modelines} ||= join '', @m;
+ $o;
}
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 9749884d2..163801f13 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -1,26 +1,25 @@
-package Xconfigurator;
+package Xconfigurator; # $Id$
use diagnostics;
use strict;
-use vars qw($in $resolution_wanted @depths @resolutions @accelservers @allservers %videomemory @ramdac_name @ramdac_id @clockchip_name @clockchip_id %keymap_translate @vsync_range %standard_monitors $intro_text $finalcomment_text $s3_comment $cirrus_comment $probeonlywarning_text $monitorintro_text $hsyncintro_text $vsyncintro_text $XF86firstchunk_text $keyboardsection_start $keyboardsection_part2 $keyboardsection_end $pointersection_text1 $pointersection_text2 $monitorsection_text1 $monitorsection_text2 $monitorsection_text3 $monitorsection_text4 $modelines_text_Trident_TG_96xx $modelines_text $devicesection_text $screensection_text1);
+use vars qw($in $install $isLaptop @window_managers @depths @monitorSize2resolution @hsyncranges %min_hsync4wres @vsyncranges %depths @resolutions %serversdriver @svgaservers @accelservers @allbutfbservers @allservers %vgamodes %videomemory @ramdac_name @ramdac_id @clockchip_name @clockchip_id %keymap_translate %standard_monitors $XF86firstchunk_text $XF86firstchunk_text2 $keyboardsection_start $keyboardsection_start_v4 $keyboardsection_part2 $keyboardsection_part3 $keyboardsection_part3_v4 $keyboardsection_end $pointersection_text $pointersection_text_v4 $monitorsection_text1 $monitorsection_text2 $monitorsection_text3 $monitorsection_text4 $modelines_text_Trident_TG_96xx $modelines_text $devicesection_text $devicesection_text_v4 $screensection_text1 %lines @options %xkb_options $default_monitor $layoutsection_v4);
-use pci_probing::main;
-use common qw(:common :file);
+use common qw(:common :file :functional :system);
use log;
-
+use detect_devices;
+use run_program;
use Xconfigurator_consts;
+use any;
+use modules;
+use my_gtk qw(:wrappers);
+
+my $tmpconfig = "/tmp/Xconfig";
+
+my ($prefix, %monitors);
1;
-sub setVirtual($) {
- my $vt = '';
- local *C;
- sysopen C, "/dev/console", 2 or die "failed to open /dev/console: $!";
- ioctl(C, c::VT_GETSTATE(), $vt) or die "ioctl VT_GETSTATE failed";
- ioctl(C, c::VT_ACTIVATE(), $_[0]) or die "ioctl VT_ACTIVATE failed";
- ioctl(C, c::VT_WAITACTIVE(), $_[0]) or die "ioctl VT_WAITACTIVE failed";
- unpack "S", $vt;
-}
+sub getVGAMode($) { $_[0]->{card}{vga_mode} || $vgamodes{"640x480x16"}; }
sub readCardsDB {
my ($file) = @_;
@@ -29,422 +28,1137 @@ sub readCardsDB {
local *F;
open F, $file or die "file $file not found";
- my $lineno = 0; foreach (<F>) { $lineno++;
+ my ($lineno, $cmd, $val) = 0;
+ my $fs = {
+ LINE => sub { push @{$card->{lines}}, $val unless $val eq "VideoRam" },
+ NAME => sub {
+ $cards{$card->{type}} = $card if $card;
+ $card = { type => $val };
+ },
+ SEE => sub {
+ my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";
+
+ push @{$card->{lines}}, @{$c->{lines} || []};
+ add2hash($card->{flags}, $c->{flags});
+ add2hash($card, $c);
+ },
+ CHIPSET => sub {
+ $card->{chipset} = $val;
+ $card->{flags}{needChipset} = 1 if $val eq 'GeForce DDR';
+ $card->{flags}{needVideoRam} = 1 if member($val, qw(mgag10 mgag200 RIVA128 SiS6326));
+ },
+ SERVER => sub { $card->{server} = $val; },
+ DRIVER => sub { $card->{driver} = $val; },
+ RAMDAC => sub { $card->{ramdac} = $val; },
+ DACSPEED => sub { $card->{dacspeed} = $val; },
+ CLOCKCHIP => sub { $card->{clockchip} = $val; $card->{flags}{noclockprobe} = 1; },
+ NOCLOCKPROBE => sub { $card->{flags}{noclockprobe} = 1 },
+ UNSUPPORTED => sub { $card->{flags}{unsupported} = 1 },
+ COMMENT => sub {},
+ };
+
+ local $_;
+ while (<F>) { $lineno++;
s/\s+$//;
/^#/ and next;
/^$/ and next;
/^END/ and last;
- my ($cmd, $val) = /(\S+)\s*(.*)/ or log::l("bad line $lineno ($_)"), next;
+ ($cmd, $val) = /(\S+)\s*(.*)/ or next; #log::l("bad line $lineno ($_)"), next;
- my $f = $ {{
- LINE => sub { push @{$card->{lines}}, $val unless $val eq "VideoRam" },
- NAME => sub {
- $cards{$card->{type}} = $card if $card;
- $card = { type => $val };
- },
- SEE => sub {
- my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";
-
- push @{$card->{lines}}, @{$c->{lines} || []};
- add2hash($card->{flags}, $c->{flags});
- add2hash($card, $c);
- },
- CHIPSET => sub { $card->{chipset} = $val;
- $card->{flags}->{needVideoRam} if member($val, qw(RIVA128));
- },
- SERVER => sub { $card->{server} = $val; },
- RAMDAC => sub { $card->{ramdac} = $val; },
- DACSPEED => sub { $card->{dacspeed} = $val; },
- CLOCKCHIP => sub { $card->{clockchip} = $val; $card->{flags}->{noclockprobe} = 1; },
- NOCLOCKPROBE => sub { $card->{flags}->{noclockprobe} = 1 },
- UNSUPPORTED => sub { $card->{flags}->{unsupported} = 1 },
- }}{$cmd};
+ my $f = $fs->{$cmd};
$f ? &$f() : log::l("unknown line $lineno ($_)");
}
- push @{$cards{S3}->{lines}}, $s3_comment;
- push @{$cards{'CL-GD'}->{lines}}, $cirrus_comment;
-
- # this entry is broken in X11R6 cards db
- $cards{I128}->{flags}->{noclockprobe} = 1;
+ \%cards;
+}
+sub readCardsNames {
+ my $file = "/usr/X11R6/lib/X11/CardsNames";
+ local *F; open F, $file or die "can't find $file\n";
+ map { (split '=>')[0] } <F>;
+}
+sub cardName2RealName {
+ my $file = "/usr/X11R6/lib/X11/CardsNames";
+ my ($name) = @_;
+ local *F; open F, $file or die "can't find $file\n";
+ local $_;
+ while (<F>) { chop;
+ my ($name_, $real) = split '=>';
+ return $real if $name eq $name_;
+ }
+ $name;
+}
+sub updateCardAccordingName {
+ my ($card, $name) = @_;
+ my $cards = readCardsDB("/usr/X11R6/lib/X11/Cards+");
- %cards;
+ add2hash($card->{flags}, $cards->{$name}{flags});
+ add2hash($card, $cards->{$name});
+ $card;
}
sub readMonitorsDB {
my ($file) = @_;
- my %monitors;
- local *F;
- open F, $file or die "can't open monitors database ($file): ?!";
- my $lineno = 0; foreach (<F>) {
+ %monitors and return;
+
+ local *F; open F, $file or die "can't open monitors database ($file): $!";
+ local $_;
+ my $lineno = 0; while (<F>) {
$lineno++;
s/\s+$//;
/^#/ and next;
/^$/ and next;
- my @fields = qw(type bandwidth hsyncrange vsyncrange);
+ my @fields = qw(vendor type eisa hsyncrange vsyncrange);
my @l = split /\s*;\s*/;
@l == @fields or log::l("bad line $lineno ($_)"), next;
-
+
my %l; @l{@fields} = @l;
- $monitors{$l{type}} = \%l;
+ if ($monitors{$l{type}}) {
+ my $i; for ($i = 0; $monitors{"$l{type} ($i)"}; $i++) {}
+ $l{type} = "$l{type} ($i)";
+ }
+ $monitors{"$l{vendor}|$l{type}"} = \%l;
}
while (my ($k, $v) = each %standard_monitors) {
- $monitors{$k} =
- $monitors{$v->[0]} =
+ $monitors{'Generic|' . translate($k)} =
{ hsyncrange => $v->[1], vsyncrange => $v->[2] };
}
- %monitors;
}
sub rewriteInittab {
my ($runlevel) = @_;
- {
- local (*F, *G);
- open F, "/etc/inittab" or die "cannot open /etc/inittab: $!";
- open G, "> /etc/inittab-" or die "cannot write in /etc/inittab-: $!";
-
- foreach (<F>) {
- print G /^id:/ ? "id:$runlevel:initdefault:\n" : $_;
- }
- }
- unlink("/etc/inittab");
- rename("/etc/inittab-", "/etc/inittab");
+ my $f = "$prefix/etc/inittab";
+ -r $f or log::l("missing inittab!!!"), return;
+ substInFile { s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/ } $f;
}
-sub findLegalModes {
- my ($card) = @_;
- my $mem = $card->{memory} || 1000000;
-
- foreach (@resolutions) {
- my ($h, $v) = split 'x';
-
- foreach $_ (@depths) {
- push @{$card->{depth}->{$_}}, [ $h, $v ] if 1024 * $mem >= $h * $v * $_ / 8;
- }
+sub keepOnlyLegalModes {
+ my ($card, $monitor) = @_;
+ my $mem = 1024 * ($card->{memory} || ($card->{server} eq 'FBDev' ? 2048 : 99999));
+ my $hsync = max(split(/[,-]/, $monitor->{hsyncrange}));
+
+ while (my ($depth, $res) = each %{$card->{depth}}) {
+ @$res = grep {
+ $mem >= product(@$_, $depth / 8) &&
+ $hsync >= ($min_hsync4wres{$_->[0]} || 0) &&
+ ($card->{server} ne 'FBDev' || $vgamodes{"$_->[0]x$_->[1]x$depth"})
+ } @$res;
+ delete $card->{depth}{$depth} if @$res == 0;
}
}
sub cardConfigurationAuto() {
my $card;
- if (my ($c) = pci_probing::main::probe('video')) {
- local $_;
- ($card->{identifier}, $_) = @$c;
+ if (my ($c) = grep { $_->{driver} =~ /(Card|Server):/ } detect_devices::probeall()) {
+ local $_ = $c->{driver};
$card->{type} = $1 if /Card:(.*)/;
$card->{server} = $1 if /Server:(.*)/;
+ $card->{flags}{needVideoRam} &&= /86c368/;
+ $card->{identifier} = $c->{description};
+ push @{$card->{lines}}, @{$lines{$card->{identifier}} || []};
+ }
+ #- take a default on sparc if nothing has been found.
+ if (arch() =~ /^sparc/ && !$card->{server} && !$card->{type}) {
+ log::l("Using probe with /proc/fb as nothing has been found!");
+ local $_ = cat_("/proc/fb");
+ if (/Mach64/) { $card->{server} = "Mach64" }
+ elsif (/Permedia2/) { $card->{server} = "3DLabs" }
+ else { $card->{server} = "Sun24" }
}
$card;
}
-sub cardConfiguration(;$) {
- my $card = shift || {};
+sub cardConfiguration(;$$$) {
+ my ($card, $noauto, $allowFB) = @_;
+ $card ||= {};
- my %cards = readCardsDB("/usr/X11R6/lib/X11/Cards");
+ updateCardAccordingName($card, $card->{type}) if $card->{type}; #- try to get info from given type
+ undef $card->{type} unless $card->{server}; #- bad type as we can't find the server
+ add2hash($card, cardConfigurationAuto()) unless $card->{server} || $noauto;
+ $card->{server} = 'FBDev' unless !$allowFB || $card->{server} || $card->{type} || $noauto;
+ $card->{type} = cardName2RealName($in->ask_from_treelist(_("Graphic card"), _("Select a graphic card"), '|', ['Other|Unlisted', readCardsNames()])) unless $card->{type} || $card->{server};
+ undef $card->{type}, $card->{server} = $in->ask_from_list(_("X server"), _("Choose a X server"), $allowFB ? \@allservers : \@allbutfbservers ) if $card->{type} eq 'Other|Unlisted';
- add2hash($card, cardConfigurationAuto()) unless $card->{type} || $card->{server} || $::expert;
- add2hash($card, { type => $in->ask_from_list('', _("Choose a graphic card"), [keys %cards]) }) unless $card->{type} || $card->{server};
- add2hash($card, $cards{$card->{type}}) if $card->{type};
+ updateCardAccordingName($card, $card->{type}) if $card->{type};
add2hash($card, { vendor => "Unknown", board => "Unknown" });
+
+ $card->{memory} = 4096, delete $card->{depth} if $card->{driver} eq 'i810';
+ $card->{memory} = 16384, delete $card->{depth} if $card->{chipset} =~ /PERMEDIA/ && $card->{memory} <= 1024;
+
+ #- 3D acceleration configuration for XFree 3.3 using Utah-GLX.
+ $card->{Utah_glx} = ($card->{identifier} =~ /Matrox.* G[24]00/ || #- 8bpp does not work.
+ $card->{identifier} =~ /Riva.*128/ ||
+ $card->{identifier} =~ /Rage X[CL]/ ||
+ $card->{identifier} =~ /Rage Mobility (?:P\/M|L) / ||
+ $card->{identifier} =~ /3D Rage (?:LT|Pro)/);
+ #- NOT WORKING $card->{type} =~ /Intel 810/);
+ #- 3D acceleration configuration for XFree 3.3 using Utah-GLX but EXPERIMENTAL that may freeze the machine (FOR INFO NOT USED).
+ $card->{Utah_glx_EXPERIMENTAL} = ($card->{type} =~ /RIVA TNT/ || #- all RIVA/GeForce comes from NVIDIA and may freeze (gltron).
+ #$card->{type} =~ /RIVA128/ ||
+ $card->{type} =~ /GeForce 256/ ||
+ $card->{type} =~ /S3 Savage3D/ || #- only this one is evoluting (expect a stable release ?)
+ #- $card->{type} =~ /S3 ViRGE/ || #- 15bits only
+ $card->{type} =~ /SiS /);
+ #- 3D acceleration configuration for XFree 4.0 using DRI.
+ $card->{DRI_glx} = ($card->{identifier} =~ /Voodoo [35]/ || $card->{identifier} =~ /Voodoo Banshee/ || #- 16bit only
+ #$card->{identifier} =~ /Matrox.* G[24]00/ || #- prefer 16bit (24bit not well tested according to DRI)
+ $card->{identifier} =~ /8281[05].* CGC/ || #- 16bit (Intel 810 & 815).
+ $card->{identifier} =~ /Rage 128/); #- 16 and 32 bits, prefer 16bit as no DMA.
+
+ #- check to use XFree 4.0 or XFree 3.3.
+ $card->{use_xf4} = $card->{driver} && !$card->{flags}{unsupported};
+ $card->{prefer_xf3} = ($card->{type} =~ /RIVA TNT/ ||
+ $card->{type} =~ /RIVA128/ ||
+ $card->{type} =~ /GeForce/ ||
+ $card->{type} =~ /NeoMagic /);
+
+ #- basic installation, use of XFree 4.0 or XFree 3.3.
+ my ($xf4_ver, $xf3_ver) = ("4.0.1", "3.3.6");
+ my $xf3_tc = { text => _("XFree %s", $xf3_ver),
+ code => sub { $card->{Utah_glx} = $card->{DRI_glx} = ''; $card->{use_xf4} = '';
+ log::l("Using XFree $xf3_ver") } };
+ my $msg = _("Which configuration of XFree do you want to have?");
+ my @choices = $card->{use_xf4} ? (($card->{prefer_xf3} ? ($xf3_tc) : ()),
+ (!$card->{prefer_xf3} || $::expert ?
+ ({ text => _("XFree %s", $xf4_ver),
+ code => sub { $card->{Utah_glx} = $card->{DRI_glx} = '';
+ log::l("Using XFree $xf4_ver") } }) : (),),
+ ($::expert && !$card->{prefer_xf3} ? ($xf3_tc) : ())) : ($xf3_tc);
+
+ #- try to figure if 3D acceleration is supported
+ #- by XFree 3.3 but not XFree 4.0 then ask user to keep XFree 3.3 ?
+ if ($card->{Utah_glx}) {
+ $msg = ($card->{use_xf4} && !$card->{DRI_glx} && !$card->{prefer_xf3} ?
+_("Your card can have 3D hardware acceleration support but only with XFree %s.
+Your card is supported by XFree %s which may have a better support in 2D.", $xf3_ver, $xf4_ver) :
+_("Your card can have 3D hardware acceleration support with XFree %s.", $xf3_ver)) . "\n\n\n" . $msg;
+ $::beginner and @choices = (); #- keep it by default here as it is the only choice available.
+ unshift @choices, { text => _("XFree %s with 3D hardware acceleration", $xf3_ver),
+ code => sub { $card->{use_xf4} = '';
+ log::l("Using XFree $xf3_ver with 3D hardware acceleration") } };
+ }
+
+ #- an expert user may want to try to use an EXPERIMENTAL 3D acceleration, currenlty
+ #- this is with Utah GLX and so, it can provide a way of testing.
+ if ($::expert && $card->{Utah_glx_EXPERIMENTAL}) {
+ $msg = ($card->{use_xf4} && !$card->{DRI_glx} && !$card->{prefer_xf3} ?
+_("Your card can have 3D hardware acceleration support but only with XFree %s,
+NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.
+Your card is supported by XFree %s which may have a better support in 2D.", $xf3_ver, $xf4_ver) :
+_("Your card can have 3D hardware acceleration support with XFree %s,
+NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.", $xf3_ver)) . "\n\n\n" . $msg;
+ push @choices, { text => _("XFree %s with EXPERIMENTAL 3D hardware acceleration", $xf3_ver),
+ code => sub { $card->{use_xf4} = ''; $card->{Utah_glx} = 'EXPERIMENTAL';
+ log::l("Using XFree $xf3_ver with EXPERIMENTAL 3D hardware acceleration") } };
+ }
+
+ #- ask the expert user to enable or not hardware acceleration support.
+ if ($card->{use_xf4} && $card->{DRI_glx}) {
+ $msg = _("Your card can have 3D hardware acceleration support with XFree %s.", $xf4_ver) . "\n\n\n" . $msg;
+ $::expert or @choices = (); #- keep all user by default with XFree 4.0 including 3D acceleration.
+ unshift @choices, { text => _("XFree %s with 3D hardware acceleration", $xf4_ver),
+ code => sub { log::l("Using XFree $xf4_ver with 3D hardware acceleration") } };
+ }
+
+ #- examine choice of user, beware the list MUST NOT BE REORDERED AS the first item should be the
+ #- proposed one by DrakX.
+ my $tc = $in->ask_from_listf(_("XFree configuration"), formatAlaTeX($msg), sub { translate($_[0]{text}) }, \@choices);
+ #- in case of class discarding, this can help ...
+ $tc or $tc = $choices[0];
+ $tc->{code} and $tc->{code}();
+
+ $card->{prog} = "/usr/X11R6/bin/" . ($card->{use_xf4} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ?
+ "Xsun$1" : "XF86_$card->{server}");
+
+ #- additional packages to install according available card.
+ #- add XFree86-libs-DRI here if using DRI (future split of XFree86 TODO)
+ my @l = ();
+ if ($card->{DRI_glx}) {
+ push @l, 'Glide_V5' if $card->{identifier} =~ /Voodoo 5/;
+ push @l, 'Glide_V3-DRI' if $card->{identifier} =~ /Voodoo (3|Banshee)/;
+ push @l, 'Device3Dfx', 'XFree86-glide-module' if $card->{identifier} =~ /Voodoo/;
+ }
+ if ($card->{Utah_glx}) {
+ push @l, 'Mesa' if !$card->{use_xf4};
+ }
+
+ -x "$prefix$card->{prog}" or $install && do {
+ $in->suspend;
+ &$install('server', @l) if $card->{use_xf4};
+ &$install($card->{server}, @l) if !$card->{use_xf4};
+ $in->resume;
+ };
+ -x "$prefix$card->{prog}" or die "server $card->{server} is not available (should be in $prefix$card->{prog})";
+
+ $card->{options}{sw_cursor} = 1 if $card->{type} =~ /S3 Trio3D/;
+ unless ($card->{type}) {
+ $card->{flags}{noclockprobe} = member($card->{server}, qw(I128 S3 S3V Mach64));
+ }
+ $card->{options_xf3}{power_saver} = 1;
+ $card->{options_xf4}{DPMS} = 1;
+
+ $card->{flags}{needVideoRam} and
+ $card->{memory} ||=
+ $videomemory{$in->ask_from_list_('',
+ _("Select the memory size of your graphic card"),
+ [ sort { $videomemory{$a} <=> $videomemory{$b} }
+ keys %videomemory])};
+
+
+ #- hack for ATI Mach64 card where two options should be used if using Utah-GLX.
+ if ($card->{identifier} =~ /Rage X[CL]/ ||
+ $card->{identifier} =~ /Rage Mobility (?:P\/M|L) / ||
+ $card->{identifier} =~ /3D Rage (?:LT|Pro)/) {
+ $card->{options_xf3}{no_font_cache} = $card->{Utah_glx};
+ $card->{options_xf3}{no_pixmap_cache} = $card->{Utah_glx};
+ }
+
+ #- 3D acceleration configuration for XFree 4.0 using DRI, this is enabled by default
+ #- but for some there is a need to specify VideoRam (else it won't run).
+ if ($card->{DRI_glx}) {
+ $card->{identifier} =~ /Matrox.* G[24]00/ and $card->{flags}{needVideoRam} = 'fakeVideoRam';
+ $card->{identifier} =~ /8281[05].* CGC/ and ($card->{flags}{needVideoRam}, $card->{memory}) = ('fakeVideoRam', 16384);
+ }
+
+ if (!$::isStandalone && $card->{driver} eq 'i810') {
+ require modules;
+ eval { modules::load("agpgart"); };
+ }
$card;
}
-sub monitorConfiguration(;$) {
+sub optionsConfiguration($) {
+ my ($o) = @_;
+ my @l;
+ my %l;
+
+ foreach (@options) {
+ if ($o->{card}{server} eq $_->[1] && $o->{card}{identifier} =~ /$_->[2]/) {
+ my $options = 'options_' . ($o->{card}{server} eq 'XFree86' ? 'xf4' : 'xf3');
+ $o->{card}{$options}{$_->[0]} ||= 0;
+ unless ($l{$_->[0]}) {
+ push @l, $_->[0], { val => \$o->{card}{$options}{$_->[0]}, type => 'bool' };
+ $l{$_->[0]} = 1;
+ }
+ }
+ }
+ @l = @l[0..19] if @l > 19; #- reduce list size to 10 for display (it's a hash).
+
+ $in->ask_from_entries_refH('', _("Choose options for server"), \@l);
+}
+
+sub monitorConfiguration(;$$) {
my $monitor = shift || {};
+ my $useFB = shift || 0;
+
+ $monitor->{hsyncrange} && $monitor->{vsyncrange} and return $monitor;
+
+ readMonitorsDB("/usr/X11R6/lib/X11/MonitorsDB");
- my %monitors = readMonitorsDB("MonitorsDB");
+ add2hash($monitor, { type => $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Custom', keys %monitors], 'Generic|' . translate($default_monitor)) }) unless $monitor->{type};
+ if ($monitor->{type} eq 'Custom') {
+ $in->ask_from_entries_ref('',
+_("The two critical parameters are the vertical refresh rate, which is the rate
+at which the whole screen is refreshed, and most importantly the horizontal
+sync rate, which is the rate at which scanlines are displayed.
- add2hash($monitor, { type => $in->ask_from_list('', _("Choose a monitor"), [keys %monitors]) }) unless $monitor->{type};
- add2hash($monitor, $monitors{$monitor->{type}});
- add2hash($monitor, { vendor => "Unknown", model => "Unknown" });
- $monitor;
+It is VERY IMPORTANT that you do not specify a monitor type with a sync range
+that is beyond the capabilities of your monitor: you may damage your monitor.
+ If in doubt, choose a conservative setting."),
+ [ _("Horizontal refresh rate"), _("Vertical refresh rate") ],
+ [ { val => \$monitor->{hsyncrange}, list => \@hsyncranges },
+ { val => \$monitor->{vsyncrange}, list => \@vsyncranges }, ]);
+ } else {
+ add2hash($monitor, $monitors{$monitor->{type}});
+ }
+ add2hash($monitor, { type => "Unknown", vendor => "Unknown", model => "Unknown", manual => 1 });
}
sub testConfig($) {
my ($o) = @_;
my ($resolutions, $clocklines);
- write_XF86Config($o, "/tmp/Xconfig");
+ write_XF86Config($o, $tmpconfig);
+
+ unlink "/tmp/.X9-lock";
+ #- restart_xfs;
+
+ my $f = $tmpconfig . ($o->{card}{use_xf4} && "-4");
+ local *F; open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |";
+ local $_;
+ while (<F>) {
+ $o->{card}{memory} ||= $2 if /(videoram|Video RAM):\s*(\d*)/;
- local *F;
- open F, "/etc/X11/X :9 -probeonly -pn -xf86config /tmp/Xconfig 2>&1 |";
- foreach (<F>) {
- #$videomemory = $2 if /(videoram|Video RAM):\s*(\d*)/;
# look for clocks
push @$clocklines, $1 if /clocks: (.*)/ && !/(pixel |num)clocks:/;
push @$resolutions, [ $1, $2 ] if /: Mode "(\d+)x(\d+)": mode clock/;
+ print;
}
close F or die "X probeonly failed";
($resolutions, $clocklines);
}
-sub autoResolutions($) {
- my ($o) = @_;
- my $card = $o->{card};
+sub testFinalConfig {
+ my ($o, $auto, $skiptest, $skip_badcard) = @_;
- my $hres_wanted = first(split 'x', $o->{resolution_wanted});
+ $o->{monitor}{hsyncrange} && $o->{monitor}{vsyncrange} or
+ $in->ask_warn('', _("Monitor not configured")), return;
- # For the mono and vga16 server, no further configuration is required.
- return if member($card->{server}, "Mono", "VGA16");
+ $o->{card}{server} || $o->{card}{driver} or
+ $in->ask_warn('', _("Graphic card not configured yet")), return;
- # Configure the modes order.
- my ($ok, $best);
- foreach (@depths) {
- local $card->{default_depth} = $_;
+ $o->{card}{depth} or
+ $in->ask_warn('', _("Resolutions not chosen yet")), return;
- my ($resolutions, $clocklines) = eval { testConfig($o) };
- if ($@) {
- delete $card->{depth}->{$_};
- } else {
- $card->{clocklines} ||= $clocklines unless $card->{flags}->{noclockprobe};
- $card->{depth}->{$_} = $resolutions;
+ my $f = "/etc/X11/XF86Config.test";
+ write_XF86Config($o, $::testing ? $tmpconfig : "$prefix/$f");
+
+ $skiptest || $o->{card}{server} =~ 'FBDev|Sun' and return 1; #- avoid testing with these.
+
+ #- needed for bad cards not restoring cleanly framebuffer
+ my $bad_card = $o->{card}{identifier} =~ /i740|ViRGE/;
+ $bad_card ||= $o->{card}{identifier} =~ /Rage Mobility (?:P\/M|L) / || $o->{card}{identifier} =~ /3D Rage LT/;
+ $bad_card ||= $o->{card}{use_xf4}; #- TODO obsoleted to check, when using fbdev of XFree 4.0!
+ log::l("the graphic card does not like X in framebuffer") if $bad_card;
+
+ my $verybad_card = $o->{card}{driver} eq 'i810';
+ $verybad_card and return 1;
+
+ my $mesg = _("Do you want to test the configuration?");
+ my $def = 1;
+ if ($bad_card && !$::isStandalone) {
+ $skip_badcard and return 1;
+ $mesg = $mesg . "\n" . _("Warning: testing this graphic card may freeze your computer");
+ $def = 0;
+ }
+ $auto && $def or $in->ask_yesorno(_("Test of the configuration"), $mesg, $def) or return 1;
+
+ unlink "$prefix/tmp/.X9-lock";
+
+ #- create a link from the non-prefixed /tmp/.X11-unix/X9 to the prefixed one
+ #- that way, you can talk to :9 without doing a chroot
+ #- but take care of non X11 install :-)
+ if (-d "/tmp/.X11-unix") {
+ symlinkf "$prefix/tmp/.X11-unix/X9", "/tmp/.X11-unix/X9" if $prefix;
+ } else {
+ symlinkf "$prefix/tmp/.X11-unix", "/tmp/.X11-unix" if $prefix;
+ }
+ #- restart_xfs;
+
+ my $f_err = "$prefix/tmp/Xoutput";
+ my $pid;
+ unless ($pid = fork) {
+ open STDERR, ">$f_err";
+ chroot $prefix if $prefix;
+ exec $o->{card}{prog},
+ ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($o->{card}{use_xf4} && "-4")) : ()),
+ ":9" or c::_exit(0);
+ }
+
+ do { sleep 1 } until c::Xtest(":9") || waitpid($pid, c::WNOHANG());
- $ok ||= $resolutions;
- my ($b) = sort { $b->[0] <=> $a->[0] } @$resolutions;
+ my $b = before_leaving { unlink $f_err };
- # require $resolution_wanted, no matter what bpp this requires
- $best = $_ if $b->[0] >= $hres_wanted;
+ unless (c::Xtest(":9")) {
+ local $_;
+ local *F; open F, $f_err;
+ i: while (<F>) {
+ if (/\b(error|not supported)\b/i) {
+ my @msg = !/error/ && $_ ;
+ while (<F>) {
+ /not fatal/ and last i;
+ /^$/ and last;
+ push @msg, $_;
+ }
+ $in->ask_warn('', [ _("An error has occurred:"), " ", @msg, _("\ntry to change some parameters") ]);
+ return 0;
+ }
}
}
- $ok or die "no valid modes";
- $card->{default_depth} = $best;
+ local *F;
+ open F, "|perl" or die '';
+ print F "use lib qw(", join(' ', @INC), ");\n";
+ print F q{
+ use interactive_gtk;
+ use my_gtk qw(:wrappers);
+
+ $ENV{DISPLAY} = ":9";
+
+ gtkset_background(200 * 257, 210 * 257, 210 * 257);
+ my ($h, $w) = Gtk::Gdk::Window->new_foreign(Gtk::Gdk->ROOT_WINDOW)->get_size;
+ $my_gtk::force_position = [ $w / 3, $h / 2.4 ];
+ $my_gtk::force_focus = 1;
+ my $text = Gtk::Label->new;
+ my $time = 8;
+ Gtk->timeout_add(1000, sub {
+ $text->set(_("Leaving in %d seconds", $time));
+ $time-- or Gtk->main_quit;
+ 1;
+ });
+
+ my $background = "/usr/share/pixmaps/backgrounds/linux-mandrake/XFdrake-image-test.jpg";
+ my $qiv = "/usr/bin/qiv";
+ -r "} . $prefix . q{/$background" && -x "} . $prefix . q{/$qiv" and
+ system(($::testing ? "} . $prefix . q{" : "chroot } . $prefix . q{/ ") . "$qiv -y $background");
+
+ exit (interactive_gtk->new->ask_yesorno('', [ _("Is this the correct setting?"), $text ], 0) ? 0 : 222);
+ };
+ my $rc = close F;
+ my $err = $?;
+
+ unlink "/tmp/.X11-unix/X9" if $prefix;
+ kill 2, $pid;
+
+ $rc || $err == 222 << 8 or $in->ask_warn('', _("An error has occurred, try to change some parameters"));
+ $rc;
}
+sub autoDefaultDepth($$) {
+ my ($card, $wres_wanted) = @_;
+ my ($best, $depth);
-sub moreCardConfiguration {
- my ($o) = @_;
+ return 24 if $card->{identifier} =~ /SiS/; #- assume 24 bit even for 3D acceleration (not enabled currently).
+ return 16 if $card->{Utah_glx} || $card->{DRI_glx}; #- assume 16bit as most of them need 16.
+
+ for ($card->{server}) {
+ /FBDev/ and return 16; #- this should work by default, FBDev is allowed only if install currently uses it at 16bpp.
+ /Sun24/ and return 24;
+ /SunMono/ and return 2;
+ /Sun/ and return 8;
+ }
+
+ while (my ($d, $r) = each %{$card->{depth}}) {
+ $depth = max($depth || 0, $d);
+
+ #- try to have resolution_wanted
+ $best = max($best || 0, $d) if $r->[0][0] >= $wres_wanted;
+ }
+ $best || $depth or die "no valid modes";
+}
+
+sub autoDefaultResolution {
+ return "1024x768" if $isLaptop;
+
+ my ($size) = @_;
+ $monitorSize2resolution[round($size || 14)] || #- assume a small monitor (size is in inch)
+ $monitorSize2resolution[-1]; #- no corresponding resolution for this size. It means a big monitor, take biggest we have
+}
+
+sub chooseResolutionsGtk($$;$) {
+ my ($card, $chosen_depth, $chosen_w) = @_;
+ my $W = my_gtk->new(_("Resolution"));
+ my %txt2depth = reverse %depths;
+ my ($r, $depth_combo, %w2depth, %w2h, %w2widget);
+
+ my $best_w;
+ while (my ($depth, $res) = each %{$card->{depth}}) {
+ foreach (@$res) {
+ $w2h{$_->[0]} = $_->[1];
+ push @{$w2depth{$_->[0]}}, $depth;
+
+ $best_w = max($_->[0], $best_w) if $_->[0] <= $chosen_w;
+ }
+ }
+ $chosen_w = $best_w;
+
+ my $set_depth = sub { $depth_combo->entry->set_text(translate($depths{$chosen_depth})) };
+
+ #- the set function is usefull to toggle the CheckButton with the callback being ignored
+ my $ignore;
+ my $set = sub { $ignore = 1; $_[0]->set_active(1); $ignore = 0; };
+
+ while (my ($w, $h) = each %w2h) {
+ my $V = $w . "x" . $h;
+ $w2widget{$w} = $r = new Gtk::RadioButton($r ? ($V, $r) : $V);
+ &$set($r) if $chosen_w == $w;
+ $r->signal_connect("clicked" => sub {
+ $ignore and return;
+ $chosen_w = $w;
+ unless (member($chosen_depth, @{$w2depth{$w}})) {
+ $chosen_depth = max(@{$w2depth{$w}});
+ &$set_depth();
+ }
+ });
+ }
+ gtkadd($W->{window},
+ gtkpack_($W->create_box_with_title(_("Choose the resolution and the color depth"),
+ "(" . ($card->{type} ?
+ _("Graphic card: %s", $card->{type}) :
+ _("XFree86 server: %s", $card->{server})) . ")"
+ ),
+ 1, gtkpack(new Gtk::HBox(0,20),
+ $depth_combo = new Gtk::Combo,
+ gtkpack_(new Gtk::VBox(0,0),
+ map {; 0, $w2widget{$_} } ikeys(%w2widget),
+ ),
+ ),
+ 0, gtkadd($W->create_okcancel,
+ gtksignal_connect(new Gtk::Button(_("Show all")), clicked => sub { $W->{retval} = 1; $chosen_w = 0; Gtk->main_quit })),
+ ));
+ $depth_combo->disable_activate;
+ $depth_combo->set_use_arrows_always(1);
+ $depth_combo->entry->set_editable(0);
+ $depth_combo->set_popdown_strings(map { translate($depths{$_}) } ikeys(%{$card->{depth}}));
+ $depth_combo->entry->signal_connect(changed => sub {
+ $chosen_depth = $txt2depth{untranslate($depth_combo->entry->get_text, keys %txt2depth)};
+ my $w = $card->{depth}{$chosen_depth}[0][0];
+ $chosen_w > $w and &$set($w2widget{$chosen_w = $w});
+ });
+ &$set_depth();
+ $W->{ok}->grab_focus;
+
+ $W->main or return;
+ ($chosen_depth, $chosen_w);
+}
+
+sub chooseResolutions($$;$) {
+ goto &chooseResolutionsGtk if ref($in) =~ /gtk/;
+
+ my ($card, $chosen_depth, $chosen_w) = @_;
+
+ my $best_w;
+ local $_ = $in->ask_from_list(_("Resolutions"), "",
+ [ map_each { map { "$_->[0]x$_->[1] ${main::a}bpp" } @$::b } %{$card->{depth}} ]) or return;
+ reverse /(\d+)x\S+ (\d+)/;
+}
+
+
+sub resolutionsConfiguration {
+ my ($o, $auto) = @_;
my $card = $o->{card};
- $card->{vendor} ||= "Unknown";
- $card->{model} ||= "Unknown";
+ #- For the mono and vga16 server, no further configuration is required.
+ if (member($card->{server}, "Mono", "VGA16")) {
+ $card->{depth}{8} = [[ 640, 480 ]];
+ return;
+ } elsif ($card->{server} =~ /Sun/) {
+ $card->{depth}{2} = [[ 1152, 864 ]] if $card->{server} =~ /^(SunMono)$/;
+ $card->{depth}{8} = [[ 1152, 864 ]] if $card->{server} =~ /^(SunMono|Sun)$/;
+ $card->{depth}{24} = [[ 1152, 864 ]] if $card->{server} =~ /^(SunMono|Sun|Sun24)$/;
+ $card->{default_wres} = 1152;
+ $o->{default_depth} = max(keys %{$card->{depth}});
+ return 1; #- aka we cannot test, assumed as good (should be).
+ }
+ if (is_empty_hash_ref($card->{depth})) {
+ $card->{depth}{$_} = [ map { [ split "x" ] } @resolutions ]
+ foreach @depths;
+ }
+ #- sort resolutions in each depth
+ foreach (values %{$card->{depth}}) {
+ my $i = 0;
+ @$_ = grep { first($i != $_->[0], $i = $_->[0]) }
+ sort { $b->[0] <=> $a->[0] } @$_;
+ }
- unless ($card->{type}) {
- $card->{flags}->{noclockprobe} = member($card->{server}, qw(I128 S3 S3V Mach64));
- }
-
- my $manual;
- # some of these guys hate to be poked
- # if we dont know then its at the user's discretion
- #my $manual =
- # $card->{server} =~ /^(TGA|Mach32)/ ||
- # $card->{name} =~ /^Riva 128/ ||
- # $card->{chipset} =~ /^(RIVA128|mgag)/ ||
- # $::expert;
- #
- #my $unknown =
- # member($card->{server}, qw(S3 S3V I128 Mach64)) ||
- # member($card->{type},
- # "Matrox Millennium (MGA)",
- # "Matrox Millennium II",
- # "Matrox Millennium II AGP",
- # "Matrox Mystique",
- # "Matrox Mystique",
- # "S3",
- # "S3V",
- # "I128",
- # ) ||
- # $card->{type} =~ /S3 ViRGE/;
- #
- #$unknown and $manual ||= !$in->ask_okcancel('', [ _("I can try to autodetect information about graphic card, but it may freeze :("),
- # _("Do you want to try?") ]);
-
- $card->{flags}->{needVideoRam} and
- $card->{memory} ||=
- $videomemory{$in->ask_from_list_('',
- _("Give your graphic card memory size"),
- [ sort { $videomemory{$a} <=> $videomemory{$b} }
- keys %videomemory])};
+ #- remove unusable resolutions (based on the video memory size and the monitor hsync rate)
+ keepOnlyLegalModes($card, $o->{monitor});
- findLegalModes($o->{card});
+ my $res = $o->{resolution_wanted} || autoDefaultResolution($o->{monitor}{size});
+ my $wres = first(split 'x', $res);
- unless ($manual || $::expert) {
- # swith to virtual console 1 (hopefully not X :)
- my $vt = setVirtual(1);
+ #- take the first available resolution <= the wanted resolution
+ $wres = max map { first(grep { $_->[0] <= $wres } @$_)->[0] } values %{$card->{depth}};
+ my $depth = eval { $o->{default_depth} || autoDefaultDepth($card, $wres) };
- autoMemoryAndClocksline($o);
- autoResolutions($o);
+ $auto or ($depth, $wres) = chooseResolutions($card, $depth, $wres) or return;
- # restore the virtual console
- setVirtual($vt);
+ unless ($wres) {
+ delete $card->{depth};
+ return resolutionsConfiguration($o);
}
+
+ #- needed in auto mode when all has been provided by the user
+ $card->{depth}{$depth} or die "you selected an unusable depth";
+
+ #- remove all biggest resolution (keep the small ones for ctl-alt-+)
+ #- otherwise there'll be a virtual screen :(
+ $_ = [ grep { $_->[0] <= $wres } @$_ ] foreach values %{$card->{depth}};
+ $card->{default_wres} = $wres;
+ $card->{vga_mode} = $vgamodes{"${wres}xx$depth"} || $vgamodes{"${res}x$depth"}; #- for use with frame buffer.
+ $o->{default_depth} = $depth;
+ 1;
}
-# * Create the XF86Config file.
+#- Create the XF86Config file.
sub write_XF86Config {
my ($o, $file) = @_;
my $O;
- local *F;
- open F, ">$file" or die "can't write XF86Config in $file: $!";
+ local (*F, *G);
+ open F, ">$file" or die "can't write XF86Config in $file: $!";
+ open G, ">$file-4" or die "can't write XF86Config in $file-4: $!";
- print F $XF86firstchunk_text;
+ print F $XF86firstchunk_text, $XF86firstchunk_text2;
+ print G $XF86firstchunk_text;
+ print G qq( Option "Pixmap" "24"\n) if $o->{card}{type} eq "SiS 6326";
+ print G $XF86firstchunk_text2;
- # Write keyboard section.
+ #- Write keyboard section.
$O = $o->{keyboard};
print F $keyboardsection_start;
-
- print F " RightAlt ", ($O->{altmeta} ? "ModeShift" : "Meta"), "\n";
- print F $keyboardsection_part2;
+ print G $keyboardsection_start_v4;
+ print F qq( XkbDisable\n) unless $O->{xkb_keymap};
+ print G qq( Option "XkbDisable"\n) unless $O->{xkb_keymap};
+ print F $keyboardsection_part3;
+ print G $keyboardsection_part3_v4;
print F qq( XkbLayout "$O->{xkb_keymap}"\n);
+ print G qq( Option "XkbLayout" "$O->{xkb_keymap}"\n);
+ print F join '', map { " $_\n" } @{$xkb_options{$O->{xkb_keymap}} || []};
+ print G join '', map { /(\S+)(.*)/; qq( Option "$1" $2\n) } @{$xkb_options{$O->{xkb_keymap}} || []};
print F $keyboardsection_end;
+ print G $keyboardsection_end;
- # Write pointer section.
+ #- Write pointer section.
$O = $o->{mouse};
- print F $pointersection_text1;
- print F qq( Protocol "$O->{type}"\n);
- print F qq( Device "$O->{device}"\n);
- # this will enable the "wheel" or "knob" functionality if the mouse supports it
- print F " ZAxisMapping 4 5\n" if
- member($O->{type}, qw(IntelliMouse IMPS/2 ThinkingMousePS/2 NetScrollPS/2 NetMousePS/2 MouseManPlusPS/2));
-
- print F $pointersection_text2;
- print F "#" unless $O->{emulate3buttons};
- print F " Emulate3Buttons\n";
- print F "#" unless $O->{emulate3buttons};
- print F " Emulate3Timeout 50\n\n";
+ print F $pointersection_text;
+ print G $pointersection_text_v4;
+ print F qq( Protocol "$O->{XMOUSETYPE}"\n);
+ print G qq( Option "Protocol" "$O->{XMOUSETYPE}"\n);
+ print F qq( Device "/dev/$O->{device}"\n);
+ print G qq( Option "Device" "/dev/$O->{device}"\n);
+ #- this will enable the "wheel" or "knob" functionality if the mouse supports it
+ print F " ZAxisMapping 4 5\n" if $O->{nbuttons} > 3;
+ print F " ZAxisMapping 6 7\n" if $O->{nbuttons} > 5;
+ print G qq( Option "ZAxisMapping" "4 5"\n) if $O->{nbuttons} > 3;
+ print G qq( Option "ZAxisMapping" "6 7"\n) if $O->{nbuttons} > 5;
+
+ print F "#" unless $O->{nbuttons} < 3;
+ print G "#" unless $O->{nbuttons} < 3;
+ print F qq( Emulate3Buttons\n);
+ print G qq( Option "Emulate3Buttons"\n);
+ print F "#" unless $O->{nbuttons} < 3;
+ print G "#" unless $O->{nbuttons} < 3;
+ print F qq( Emulate3Timeout 50\n\n);
+ print G qq( Option "Emulate3Timeout" "50"\n\n);
print F "# ChordMiddle is an option for some 3-button Logitech mice\n\n";
+ print G "# ChordMiddle is an option for some 3-button Logitech mice\n\n";
print F "#" unless $O->{chordmiddle};
- print F " ChordMiddle\n\n";
+ print G "#" unless $O->{chordmiddle};
+ print F qq( ChordMiddle\n\n);
+ print G qq( Option "ChordMiddle"\n\n);
print F " ClearDTR\n" if $O->{cleardtrrts};
print F " ClearRTS\n\n" if $O->{cleardtrrts};
print F "EndSection\n\n\n";
+ print G "EndSection\n\n\n";
+
+ #- write module section for version 3.
+ if ($o->{wacom} || $o->{card}{Utah_glx}) {
+ print F qq(Section "Module"
+);
+ print F qq( Load "xf86Wacom.so"\n) if $o->{wacom};
+ print F qq( Load "glx-3.so"\n) if $o->{card}{Utah_glx}; #- glx.so may clash with server version 4.
+ print F qq(EndSection
+
+);
+ }
+
+ #- write wacom device support.
+ print F qq(
+Section "XInput"
+ SubSection "WacomStylus"
+ Port "/dev/$o->{wacom}"
+ AlwaysCore
+ Mode Absolute
+ EndSubSection
+ SubSection "WacomCursor"
+ Port "/dev/$o->{wacom}"
+ AlwaysCore
+ Mode Relative
+ EndSubSection
+ SubSection "WacomEraser"
+ Port "/dev/$o->{wacom}"
+ AlwaysCore
+ Mode Absolute
+ EndSubSection
+EndSection
+
+) if $o->{wacom};
+
+ print G qq(
+Section "InputDevice"
+ Identifier "stylus"
+ Driver "wacom"
+ Option "Type" "stylus"
+ Option "Device" "/dev/$o->{wacom}"
+ Option "Mode" "Absolute"
+EndSection
+Section "InputDevice"
+ Identifier "eraser"
+ Driver "wacom"
+ Option "Type" "eraser"
+ Option "Device" "/dev/$o->{wacom}"
+ Option "Mode" "Absolute"
+EndSection
+Section "InputDevice"
+ Identifier "cursor"
+ Driver "wacom"
+ Option "Type" "cursor"
+ Option "Device" "/dev/$o->{wacom}"
+ Option "Mode" "Relative"
+EndSection
+) if $o->{wacom};
+
+ #- write modules section for version 4.
+ print G qq(
+Section "Module"
+
+# This loads the DBE extension module.
+
+ Load "dbe"
+);
+ print G qq(
+ Load "glx"
+ Load "dri"
+) if $o->{card}{DRI_glx};
+ print G qq(
+
+# This loads the miscellaneous extensions module, and disables
+# initialisation of the XFree86-DGA extension within that module.
+
+ SubSection "extmod"
+ #Option "omit xfree86-dga"
+ EndSubSection
+
+# This loads the Type1 and FreeType font modules
- # Write monitor section.
+ Load "type1"
+ Load "freetype"
+EndSection
+);
+ print G qq(
+
+Section "DRI"
+ Mode 0666
+EndSection
+) if $o->{card}{DRI_glx};
+
+ #- Write monitor section.
$O = $o->{monitor};
print F $monitorsection_text1;
+ print G $monitorsection_text1;
print F qq( Identifier "$O->{type}"\n);
+ print G qq( Identifier "$O->{type}"\n);
print F qq( VendorName "$O->{vendor}"\n);
- print F qq( ModelName "$O->{model}"\n);
- print F "\n";
+ print G qq( VendorName "$O->{vendor}"\n);
+ print F qq( ModelName "$O->{model}"\n\n);
+ print G qq( ModelName "$O->{model}"\n\n);
print F $monitorsection_text2;
- print F qq( HorizSync $O->{hsyncrange}\n);
- print F "\n";
+ print G $monitorsection_text2;
+ print F qq( HorizSync $O->{hsyncrange}\n\n);
+ print G qq( HorizSync $O->{hsyncrange}\n\n);
print F $monitorsection_text3;
- print F qq( VertRefresh $O->{vsyncrange}\n);
- print F "\n";
+ print G $monitorsection_text3;
+ print F qq( VertRefresh $O->{vsyncrange}\n\n);
+ print G qq( VertRefresh $O->{vsyncrange}\n\n);
print F $monitorsection_text4;
- print F ($o->{card}->{type} eq "TG 96" ?
- $modelines_text_Trident_TG_96xx :
- $modelines_text);
- print F "EndSection\n\n\n";
+ print F ($O->{modelines} || '') . ($o->{card}{type} eq "TG 96" ? $modelines_text_Trident_TG_96xx : $modelines_text);
+ print F "\nEndSection\n\n\n";
+ print G "\nEndSection\n\n\n";
- # Write Device section.
+ #- Write Device section.
$O = $o->{card};
print F $devicesection_text;
+ print G $devicesection_text_v4;
print F qq(Section "Device"\n);
+ print G qq(Section "Device"\n);
print F qq( Identifier "$O->{type}"\n);
+ print G qq( Identifier "$O->{type}"\n);
print F qq( VendorName "$O->{vendor}"\n);
+ print G qq( VendorName "$O->{vendor}"\n);
print F qq( BoardName "$O->{board}"\n);
+ print G qq( BoardName "$O->{board}"\n);
+
+ print F "#" if $O->{chipset} && !$O->{flags}{needChipset};
+ print F qq( Chipset "$O->{chipset}"\n) if $O->{chipset};
+ print G qq( Driver "$O->{driver}"\n);
- print F "#" if $O->{memory} && !$O->{flags}->{needVideoRam};
+ print F "#" if $O->{memory} && !$O->{flags}{needVideoRam};
+ print G "#" if $O->{memory} && !$O->{flags}{needVideoRam};
print F " VideoRam $O->{memory}\n" if $O->{memory};
+ print G " VideoRam $O->{memory}\n" if $O->{memory};
- print F map { " $_\n" } @{$O->{lines}};
+ print F map { " $_\n" } @{$O->{lines} || []};
+ print G map { " $_\n" } @{$O->{lines} || []};
print F qq( Ramdac "$O->{ramdac}"\n) if $O->{ramdac};
+ print G qq( Ramdac "$O->{ramdac}"\n) if $O->{ramdac};
print F qq( Dacspeed "$O->{dacspeed}"\n) if $O->{dacspeed};
+ print G qq( Dacspeed "$O->{dacspeed}"\n) if $O->{dacspeed};
if ($O->{clockchip}) {
print F qq( Clockchip "$O->{clockchip}"\n);
+ print G qq( Clockchip "$O->{clockchip}"\n);
} else {
print F " # Clock lines\n";
+ print G " # Clock lines\n";
print F " Clocks $_\n" foreach (@{$O->{clocklines}});
+ print G " Clocks $_\n" foreach (@{$O->{clocklines}});
}
- print F "EndSection\n\n\n";
+ do { print F; print G } for qq(
- # Write Screen sections.
- print F $screensection_text1;
+ # Uncomment following option if you see a big white block
+ # instead of the cursor!
+ # Option "sw_cursor"
+
+);
+ my $p = sub {
+ my $l = $O->{$_[0]};
+ map { (!$l->{$_} && '#') . qq( Option "$_"\n) } keys %{$l || {}};
+ };
+ print F $p->('options');
+ print F $p->('options_xf3');
+ print G $p->('options');
+ print G $p->('options_xf4');
+ print F "EndSection\n\n\n";
+ print G "EndSection\n\n\n";
+
+ #- Write Screen sections.
+ print F $screensection_text1, "\n";
+ print G $screensection_text1, "\n";
+
+ my $subscreen = sub {
+ my ($f, $server, $defdepth, $depths) = @_;
+ print $f " DefaultColorDepth $defdepth\n" if $defdepth;
+
+ foreach (ikeys(%$depths)) {
+ my $m = $server ne "fbdev" ? join(" ", map { qq("$_->[0]x$_->[1]") } @{$depths->{$_}}) : qq("default"); #-"
+ print $f qq( Subsection "Display"\n);
+ print $f qq( Depth $_\n) if $_;
+ print $f qq( Modes $m\n);
+ print $f qq( ViewPort 0 0\n);
+ print $f qq( EndSubsection\n);
+ }
+ print $f "EndSection\n";
+ };
my $screen = sub {
my ($server, $defdepth, $device, $depths) = @_;
print F qq(
-
Section "Screen"
Driver "$server"
Device "$device"
- Monitor "$o->{monitor}->{type}"
-);
- print F " DefaultColorDepth $defdepth\n" if $defdepth;
-
- foreach (sort { $a <=> $b } keys %$depths) {
- my $m = join(" ",
- map { '"' . join("x", @$_) . '"' }
- sort { $b->[0] <=> $a->[0] } @{$depths->{$_}});
- print F qq( Subsection "Display"\n);
- print F qq( Depth $_\n) if $_;
- print F qq( Modes $m\n);
- print F qq( ViewPort 0 0\n);
- print F qq( EndSubsection\n);
- }
- print F "EndSection\n";
+ Monitor "$o->{monitor}{type}"
+); #-"
+ $subscreen->(*F, $server, $defdepth, $depths);
};
-
- # SVGA screen section.
+
+ #- SVGA screen section.
print F qq(
# The Colour SVGA server
);
- if ($O->{server} eq 'SVGA') {
- &$screen("svga", $O->{default_depth}, $O->{type}, $O->{depth});
+ if (member($O->{server}, @svgaservers)) {
+ &$screen("svga", $o->{default_depth}, $O->{type}, $O->{depth});
} else {
&$screen("svga", '', "Generic VGA", { 8 => [[ 320, 200 ]] });
}
&$screen("vga16", '',
- (member($O->{server}, "Mono", "VGA16") ? $O->{type} : "Generic VGA"),
+ (member($O->{server}, "Mono", "VGA16") ? $O->{type} : "Generic VGA"),
{ '' => [[ 640, 480 ], [ 800, 600 ]]});
&$screen("vga2", '',
- (member($O->{server}, "Mono", "VGA16") ? $O->{type} : "Generic VGA"),
+ (member($O->{server}, "Mono", "VGA16") ? $O->{type} : "Generic VGA"),
{ '' => [[ 640, 480 ], [ 800, 600 ]]});
- &$screen("accel", $O->{default_depth}, $O->{type}, $O->{depth});
+ &$screen("accel", $o->{default_depth}, $O->{type}, $O->{depth});
+
+ &$screen("fbdev", $o->{default_depth}, $O->{type}, $O->{depth});
+
+
+ print G qq(
+Section "Screen"
+ Identifier "screen1"
+ Device "$O->{type}"
+ Monitor "$o->{monitor}{type}"
+);
+ #- bpp 32 not handled by XF4
+ $subscreen->(*G, "svga", min($o->{default_depth}, 24), $O->{depth});
+
+ print G '
+
+Section "ServerLayout"
+ Identifier "layout1"
+ Screen "screen1"
+ InputDevice "Mouse1" "CorePointer"
+';
+ print G '
+ InputDevice "stylus" "AlwaysCore"
+ InputDevice "eraser" "AlwaysCore"
+ InputDevice "cursor" "AlwaysCore"
+' if $o->{wacom};
+ print G '
+ InputDevice "Keyboard1" "CoreKeyboard"
+EndSection
+'; #-"
+
+ close F;
+ close G;
}
sub XF86check_link {
- my ($void) = @_;
+ my ($ext) = @_;
- my $f = "/etc/X11/XF86Config";
+ my $f = "$prefix/etc/X11/XF86Config$ext";
touch($f);
- my $l = "/usr/X11R6/lib/X11/XF86Config";
+ my $l = "$prefix/usr/X11R6/lib/X11/XF86Config$ext";
- if (-e $l && (stat($f))[1] != (stat($l))[1]) { # compare the inode, must be the sames
+ if (-e $l && (stat($f))[1] != (stat($l))[1]) { #- compare the inode, must be the sames
-e $l and unlink($l) || die "can't remove bad $l";
- symlink "../../../../etc/X11/XF86Config", $l;
+ symlinkf "../../../../etc/X11/XF86Config$ext", $l;
+ }
+}
+
+sub info {
+ my ($o) = @_;
+ my $info;
+
+ $info .= _("Keyboard layout: %s\n", $o->{keyboard}{xkb_keymap});
+ $info .= _("Mouse type: %s\n", $o->{mouse}{XMOUSETYPE});
+ $info .= _("Mouse device: %s\n", $o->{mouse}{device}) if $::expert;
+ $info .= _("Monitor: %s\n", $o->{monitor}{type});
+ $info .= _("Monitor HorizSync: %s\n", $o->{monitor}{hsyncrange}) if $::expert;
+ $info .= _("Monitor VertRefresh: %s\n", $o->{monitor}{vsyncrange}) if $::expert;
+ $info .= _("Graphic card: %s\n", $o->{card}{type});
+ $info .= _("Graphic memory: %s kB\n", $o->{card}{memory}) if $o->{card}{memory};
+ if ($o->{default_depth} and my $depth = $o->{card}{depth}{$o->{default_depth}}) {
+ $info .= _("Color depth: %s\n", translate($depths{$o->{default_depth}}));
+ $info .= _("Resolution: %s\n", join "x", @{$depth->[0]}) if $depth && !is_empty_array_ref($depth->[0]);
}
+ $info .= _("XFree86 server: %s\n", $o->{card}{server}) if $o->{card}{server};
+ $info .= _("XFree86 driver: %s\n", $o->{card}{driver}) if $o->{card}{driver};
+ $info;
}
-# * Program entry point.
+sub show_info {
+ my ($o) = @_;
+ $in->ask_warn('', info($o));
+}
+
+#- Program entry point.
sub main {
- my ($default, $interact) = @_;
- my $o = $default;
- $in = $interact;
+ my ($o, $allowFB);
+ ($prefix, $o, $in, $allowFB, $isLaptop, $install) = @_;
+ $o ||= {};
- $o->{resolution_wanted} ||= $resolution_wanted;
-
- XF86check_link();
+ XF86check_link('');
+ XF86check_link('-4');
+
+ {
+ my $w = $in->wait_message('', _("Preparing X-Window configuration"), 1);
- $o->{card} = cardConfiguration($o->{card});
+ $o->{card} = cardConfiguration($o->{card}, $::noauto, $allowFB);
- unless ($::testing) {
- my $prog = "/usr/X11R6/bin/XF86_$o->{card}->{server}";
- -x $prog or die "server $o->{card}->{server} is not available (should be in $prog)";
- unlink("/etc/X11/X");
- symlink("../../$prog", "/etc/X11/X");
+ $o->{monitor} = monitorConfiguration($o->{monitor}, $o->{card}{server} eq 'FBDev');
}
+ my $ok = resolutionsConfiguration($o, $::auto);
+
+ $ok &&= testFinalConfig($o, $::auto, $o->{skiptest}, $::auto);
+
+ my $quit;
+ until ($ok || $quit) {
+
+ my %c = my @c = (
+ __("Change Monitor") => sub { $o->{monitor} = monitorConfiguration() },
+ __("Change Graphic card") => sub { $o->{card} = cardConfiguration('', 'noauto', $allowFB) },
+ ($::expert ? (__("Change Server options") => sub { optionsConfiguration($o) }) : ()),
+ __("Change Resolution") => sub { resolutionsConfiguration($o) },
+ __("Show information") => sub { show_info($o) },
+ __("Test again") => sub { $ok = testFinalConfig($o, 1) },
+ __("Quit") => sub { $quit = 1 },
+ );
+ $in->set_help('configureXmain') unless $::isStandalone;
+ my $f = $in->ask_from_list_(['XFdrake'],
+ _("What do you want to do?"),
+ [ grep { !ref } @c ]);
+ eval { &{$c{$f}} };
+ !$@ || $@ =~ /ask_from_list cancel/ or die;
+ $in->kill;
+ }
+ if (!$ok) {
+ $ok = $in->ask_yesorno('', _("Keep the changes?
+Current configuration is:
- $o->{monitor} = monitorConfiguration($o->{monitor});
-
- moreCardConfiguration($o);
+%s", info($o)));
+ }
+ if ($ok) {
+ unless ($::testing) {
+ my $f = "$prefix/etc/X11/XF86Config";
+ if (-e "$f.test") {
+ rename $f, "$f.old" or die "unable to make a backup of XF86Config";
+ rename "$f-4", "$f-4.old";
+ rename "$f.test", $f;
+ rename "$f.test-4", "$f-4";
+ symlinkf "../..$o->{card}{prog}", "$prefix/etc/X11/X";
+ }
+ }
- write_XF86Config($o, "/tmp/Xconfig");
+ if ($::isStandalone && $0 =~ /Xdrakres/) {
+ my $found;
+ foreach (@window_managers) {
+ if (`pidof "$_"` > 0) {
+ if ($in->ask_okcancel('', _("Please relog into %s to activate the changes", ucfirst $_), 1)) {
+ fork and $in->exit;
+ system("kwmcom logout") if /kwm/;
+ system("dcop kdesktop default logout") if /kwin/;
+ system("save-session --kill") if /gnome-session/;
+ system("killall -QUIT icewm") if /icewm/;
+
+ open STDIN, "</dev/zero";
+ open STDOUT, ">/dev/null";
+ open STDERR, ">&STDERR";
+ c::setsid();
+ exec qw(perl -e), q{
+ my $wm = shift;
+ for (my $nb = 30; $nb && `pidof "$wm"` > 0; $nb--) { sleep 1 }
+ system("killall X ; killall -15 xdm gdm kdm prefdm") unless `pidof "$wm"` > 0;
+ }, $_;
+ }
+ $found = 1; last;
+ }
+ }
+ $in->ask_warn('', _("Please log out and then use Ctrl-Alt-BackSpace")) unless $found;
+ } else {
+ $in->set_help('configureXxdm') unless $::isStandalone;
+ my $run = exists $o->{xdm} ? $o->{xdm} : $::auto || $in->ask_yesorno(_("X at startup"),
+_("I can set up your computer to automatically start X upon booting.
+Would you like X to start when you reboot?"), 1);
+ rewriteInittab($run ? 5 : 3) unless $::testing;
+ }
+ autologin($prefix, $o, $in, $install);
+ }
+}
- # Success
- rewriteInittab(rc & STARTX ? 5 : 3);
+sub autologin {
+ my ($prefix, $o, $in, $install) = @_;
+ my $cmd = $prefix ? "chroot $prefix" : "";
+ my @wm = (split (' ', `$cmd /usr/sbin/chksession -l`));
+ my @etc_pass_fields = qw(name pw uid gid realname home shell);
+ my @users = mapgrep {
+ my %l; @l{@etc_pass_fields} = split ':';
+ $l{uid} > 500, $l{name};
+ } cat_("$prefix/etc/passwd");
+ my @runlevel = mapgrep {
+ /^id:([35]):initdefault:\s*$/ > 0, $1;
+ } cat_("$prefix/etc/inittab");
+ if (!($::isStandalone && $0 =~ /Xdrakres/) && !($::auto && $o->{skiptest}) && first(@runlevel, 0) == 5 &&
+ @wm && @users && !$o->{authentication}{NIS} && $ENV{SECURE_LEVEL} <= 3) {
+ my %l = getVarsFromSh("$prefix/etc/sysconfig/autologin");
+ $o->{autologin} ||= $l{USER};
+ $in->ask_from_entries_refH(_("Autologin"),
+ _("I can set up your computer to automatically log on one user.
+If you don't want to use this feature, click on the cancel button."),
+ [ _("Choose the default user:") => { val => \$o->{autologin}, list => [ '', @users ] },
+ _("Choose the window manager to run:") => { val => \$o->{desktop}, list => \@wm }, ]) or delete $o->{autologin};
+ }
+ $o->{autologin} and $::isStandalone ? do { $in->suspend; system("urpmi --auto --best-output autologin"); $in->resume; } : $in->pkg_install("autologin");
+ any::setAutologin($prefix, $o->{autologin}, $o->{desktop});
+ run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone;
}
diff --git a/perl-install/Xconfigurator_consts.pm b/perl-install/Xconfigurator_consts.pm
index 976f65d9e..ebe6ba6b9 100644
--- a/perl-install/Xconfigurator_consts.pm
+++ b/perl-install/Xconfigurator_consts.pm
@@ -1,208 +1,378 @@
+package Xconfigurator; # $Id$
+
use common qw(:common);
-%keymap_translate = (
- uk => "gb",
+%depths = (
+ 8 => __("256 colors (8 bits)"),
+ 15 => __("32 thousand colors (15 bits)"),
+ 16 => __("65 thousand colors (16 bits)"),
+ 24 => __("16 million colors (24 bits)"),
+ 32 => __("4 billion colors (32 bits)"),
);
+@depths = ikeys(%depths);
-@depths = qw(8 15 16 24 32);
-
-$resolution_wanted = "1024x768";
@resolutions = qw(640x480 800x600 1024x768 1152x864 1280x1024 1600x1200);
+@window_managers = ('kdeinit: kwin', qw(gnome-session icewm wmaker kwm afterstep fvwm fvwm2 fvwm95 mwm twm enlightenment xfce blackbox sawfish));
+
+%serversdriver = arch() =~ /^sparc/ ? (
+ 'Mach64' => "accel",
+ '3DLabs' => "accel",
+ 'Sun' => "fbdev",
+ 'Sun24' => "fbdev",
+ 'SunMono' => "fbdev",
+ 'VGA16' => "vga16",
+ 'FBDev' => "fbdev",
+) : (
+ 'SVGA' => "svga",
+#- 'Rage128' => "svga",
+#- '3dfx' => "svga",
+ 'S3' => "accel",
+ 'Mach32' => "accel",
+ 'Mach8' => "accel",
+ '8514' => "accel",
+ 'P9000' => "accel",
+ 'AGX' => "accel",
+ 'W32' => "accel",
+ 'Mach64' => "accel",
+ 'I128' => "accel",
+ 'S3V' => "accel",
+ '3DLabs' => "accel",
+ 'Mono' => "vga2",
+ 'VGA16' => "vga16",
+ 'FBDev' => "fbdev",
+);
+@svgaservers = grep { $serversdriver{$_} eq "svga" } keys(%serversdriver);
+@accelservers = grep { $serversdriver{$_} eq "accel" } keys(%serversdriver);
+@allbutfbservers = grep { arch() =~ /^sparc/ || $serversdriver{$_} ne "fbdev" } keys(%serversdriver);
+@allservers = keys(%serversdriver);
+
+%vgamodes = (
+ '640xx8' => 769,
+ '640x480x8' => 769,
+ '800xx8' => 771,
+ '800x600x8' => 771,
+ '1024xx8' => 773,
+ '1024x768x8' => 773,
+ '1280xx8' => 775,
+ '1280x1024x8' => 775,
+ '640xx15' => 784,
+ '640x480x15' => 784,
+ '800xx15' => 787,
+ '800x600x15' => 787,
+ '1024xx15' => 790,
+ '1024x768x15' => 790,
+ '1280xx15' => 793,
+ '1280x1024x15' => 793,
+ '640xx16' => 785,
+ '640x480x16' => 785,
+ '800xx16' => 788,
+ '800x600x16' => 788,
+ '1024xx16' => 791,
+ '1024x768x16' => 791,
+ '1280xx16' => 794,
+ '1280x1024x16' => 794,
+#- '640xx24' => 786, #- there is a problem with these resolutions since the BIOS may take 24 or 32 planes.
+#- '640x480x24' => 786,
+#- '800xx24' => 789,
+#- '800x600x24' => 789,
+#- '1024xx24' => 792,
+#- '1024x768x24' => 792,
+#- '1280xx24' => 795,
+#- '1280x1024x24' => 795,
+);
-@accelservers = qw(S3 Mach32 Mach8 8514 P9000 AGX W32 Mach64 I128 S3V 3DLabs);
-@allservers = (qw(Mono VGA16 SVGA), @accelservers);
+{ #- @monitorSize2resolution
+ my %l = my @l = ( #- size in inch
+ 13 => "640x480",
+ 14 => "800x600",
+ 15 => "800x600",
+ 16 => "1024x768",
+ 17 => "1024x768",
+ 18 => "1024x768",
+ 19 => "1280x1024",
+ 20 => "1280x1024",
+ 21 => "1600x1200",
+ );
+ for (my $i = 0; $i < $l[0]; $i++) {
+ $monitorSize2resolution[$i] = $l[1];
+ }
+ while (my ($s, $r) = each %l) {
+ $monitorSize2resolution[$s] = $r;
+ }
+}
%videomemory = (
- __("256 kb") => 256,
- __("512 kb") => 512,
- __("1 mb") => 1024,
- __("2 mb") => 2048,
- __("4 mb") => 4096,
- __("8 mb") => 8192,
- __("16 mb or more") => 16384,
+ __("256 kB") => 256,
+ __("512 kB") => 512,
+ __("1 MB") => 1024,
+ __("2 MB") => 2048,
+ __("4 MB") => 4096,
+ __("8 MB") => 8192,
+ __("16 MB or more") => 16384,
);
+$default_monitor = "High Frequency SVGA, 1024x768 at 70 Hz";
%standard_monitors = (
- __("Standard VGA, 640x480 in 60 Hz") => [ '640x480@60', "31.5" , "60" ],
- __("Super VGA, 800x600 in 56 Hz") => [ '800x600@56', "31.5-35.1" , "55-60" ],
- __("8514 Compatible, 1024x768 in 87 Hz interlaced (no 800x600)") => [ '8514 compatible', "31.5,35.5" , "60,70,87" ],
- __("Super VGA, 1024x768 in 87 Hz interlaced, 800x600 in 56 Hz") => [ '1024x768@87i', "31.5,35.15,35.5" , "55-90" ],
- __("Extended Super VGA, 800x600 in 60 Hz, 640x480 in 72 Hz") => [ '800x600@60', "31.5-37.9" , "55-90" ],
- __("Non-Interlaced SVGA, 1024x768 in 60 Hz, 800x600 in 72 Hz") => [ '1024x768@60', "31.5-48.5" , "55-90" ],
- __("High Frequency SVGA, 1024x768 in 70 Hz") => [ '1024x768@70', "31.5-57.0" , "50-90" ],
- __("Multi-frequency that can do 1280x1024 in 60 Hz") => [ '1280x1024@60', "31.5-64.3" , "50-90" ],
- __("Multi-frequency that can do 1280x1024 in 74 Hz") => [ '1280x1024@74', "31.5-79.0" , "50-100" ],
- __("Multi-frequency that can do 1280x1024 in 76 Hz") => [ '1280x1024@76', "31.5-82.0" , "40-100" ],
- __("Monitor that can do 1600x1200 in 70 Hz") => [ '1600x1200@70', "31.5-88.0" , "50-120" ],
- __("Monitor that can do 1600x1200 in 76 Hz") => [ '1600x1200@76', "31.5-94.0" , "50-160" ],
+ __("Standard VGA, 640x480 at 60 Hz") => [ '640x480@60', "31.5" , "60" ],
+ __("Standard VGA, 640x480 at 60 Hz") => [ '640x480@60', "31.5" , "60" ],
+ __("Super VGA, 800x600 at 56 Hz") => [ '800x600@56', "31.5-35.1" , "55-60" ],
+ __("8514 Compatible, 1024x768 at 87 Hz interlaced (no 800x600)") => [ '8514 compatible', "31.5,35.5" , "60,70,87" ],
+ __("Super VGA, 1024x768 at 87 Hz interlaced, 800x600 at 56 Hz") => [ '1024x768@87i', "31.5,35.15,35.5" , "55-90" ],
+ __("Extended Super VGA, 800x600 at 60 Hz, 640x480 at 72 Hz") => [ '800x600@60', "31.5-37.9" , "55-90" ],
+ __("Non-Interlaced SVGA, 1024x768 at 60 Hz, 800x600 at 72 Hz") => [ '1024x768@60', "31.5-48.5" , "55-90" ],
+ __("High Frequency SVGA, 1024x768 at 70 Hz") => [ '1024x768@70', "31.5-57.0" , "50-90" ],
+ __("Multi-frequency that can do 1280x1024 at 60 Hz") => [ '1280x1024@60', "31.5-64.3" , "50-90" ],
+ __("Multi-frequency that can do 1280x1024 at 74 Hz") => [ '1280x1024@74', "31.5-79.0" , "50-100" ],
+ __("Multi-frequency that can do 1280x1024 at 76 Hz") => [ '1280x1024@76', "31.5-82.0" , "40-100" ],
+ __("Monitor that can do 1600x1200 at 70 Hz") => [ '1600x1200@70', "31.5-88.0" , "50-120" ],
+ __("Monitor that can do 1600x1200 at 76 Hz") => [ '1600x1200@76', "31.5-94.0" , "50-160" ],
);
-# * Screen/video card configuration.
-%ramdacs = (
- __("No RAMDAC Setting (recommended)") => '',
- __("AT&T 20C490 (S3 and AGX servers, ARK driver)"), => 'att20c490',
- __("AT&T 20C498/21C498/22C498 (S3, autodetected)"), => 'att20c498',
- __("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',
+@vsyncranges = ("50-70", "50-90", "50-100", "40-150");
+
+@hsyncranges = (
+ "31.5",
+ "31.5-35.1",
+ "31.5, 35.5",
+ "31.5, 35.15, 35.5",
+ "31.5-37.9",
+ "31.5-48.5",
+ "31.5-57.0",
+ "31.5-64.3",
+ "31.5-79.0",
+ "31.5-82.0",
+ "31.5-88.0",
+ "31.5-94.0",
);
-@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',
+%min_hsync4wres = (
+ 640 => 31.5,
+ 800 => 35.1,
+ 1024 => 35.5,
+ 1152 => 44.0,
+ 1280 => 51.0,
+ 1600 => 75.0,
);
+%lines = (
+#- 'Cirrus Logic|GD 5446' => [ ' Option "no_bitblt"' ],
+ 'Silicon Integrated Systems [SiS]|86C326' => [ qq( Option "noaccel"\n Option "sw_cursor") ],
+#- 'Trident Microsystems|Cyber 9525' => [ ' Option "noaccel"' ],
+#- 'S3 Inc.|86c368 [Trio 3D/2X]' => [ ' ChipID 0x8a10' ],
+);
+#- most usefull XFree86-4.0.1 server options. Default values is the first ones.
+@options_serverflags = (
+ 'NoTrapSignals' => [ "Off", "On" ],
+ 'DontZap' => [ "Off", "On" ],
+ 'DontZoom' => [ "Off", "On" ],
+ 'DisableVidModeExtension' => [ "Off", "On" ],
+ 'AllowNonLocalXvidtune' => [ "Off", "On" ],
+ 'DisableModInDev' => [ "Off", "On" ],
+ 'AllowNonLocalModInDev' => [ "Off", "On" ],
+ 'AllowMouseOpenFail' => [ "False", "True" ],
+ 'VTSysReq' => [ "Off", "On" ],
+ 'BlankTime' => [ "10", "5", "3", "15", "30" ],
+ 'StandByTime' => [ "20", "10", "6", "30", "60" ],
+ 'SuspendTime' => [ "30", "15", "9", "45", "90" ],
+ 'OffTime' => [ "40", "20", "12", "60", "120" ],
+ 'Pixmap' => [ "32", "24" ],
+ 'PC98' => [ "auto-detected", "False", "True" ],
+ 'NoPM' => [ "False", "True" ],
+);
+#- most usefull server options have to be accessible at the beginning, since
+#- no more than a small set of options will be available for the user, maybe ?
+@options = (
+ [ 'DPMS', 'XFree86', '.*' ],
+ [ 'SyncOnGreen', 'XFree86', '.*' ],
+ [ 'power_saver', 'Mono', '.*' ],
+ [ 'hibit_low', 'VGA16', 'Tseng.*ET4000' ],
+ [ 'hibit_high', 'VGA16', 'Tseng.*ET4000' ],
+ [ 'power_saver', 'VGA16', '.*' ],
+ [ 'noaccel', 'SVGA', 'Cirrus|C&T|SiS|Oak|Western Digital|Alliance|Trident|Tseng' ],
+ [ 'no_accel', 'SVGA', 'ARK|MGA|i740|Oak|ET6000|W32|Media.*GX|Neomagic' ],
+ [ 'linear', 'SVGA', 'Cirrus|ET6000|ET4000/W32p rev [CD]|Oak|Neomagic|Triden|Tseng' ],
+ [ 'nolinear', 'SVGA', 'Cirrus|C&T|Trident' ],
+ [ 'no_linear', 'SVGA', 'ARK|SiS|Neomagic|Tseng' ],
+ [ 'no_bitblt', 'SVGA', 'Cirrus|C&T|SiS' ],
+ [ 'no_imageblt', 'SVGA', 'Cirrus|C&T|SiS' ],
+ [ 'sw_cursor', 'SVGA', '.*' ],
+ [ 'slow_dram', 'SVGA', 'Cirrus|Trident|ET6000|W32|Western Digital|Tseng' ],
+ [ 'mga_sdram', 'SVGA', 'MGA' ],
+ [ 'no_pixmap_cache', 'SVGA', 'ARK|Cirrus|C&T|MGA|SiS|Trident.*9440|Trident.*9680|Tseng' ],
+ [ 'no_mmio', 'SVGA', 'Cirrus|Neomagic|Trident' ],
+ [ 'pci_burst_off', 'SVGA', 'ET6000|W32|Trident|Tseng' ],
+ [ 'hw_clocks', 'SVGA', 'SiS|C&T' ],
+ [ 'use_modeline', 'SVGA', 'C&T' ],
+ [ 'enable_bitblt', 'SVGA', 'Oak' ],
+ [ 'w32_interleave_off', 'SVGA', 'ET6000|W32|Tseng' ],
+ [ 'fifo_conservative', 'SVGA', 'Cirrus|ARK|SiS|Oak' ],
+ [ 'fifo_moderate', 'SVGA', 'Cirrus|ARK|SiS' ],
+ [ 'all_wait', 'SVGA', 'Oak' ],
+ [ 'one_wait', 'SVGA', 'Oak' ],
+ [ 'first_wait', 'SVGA', 'Oak' ],
+ [ 'first_wwait', 'SVGA', 'Oak' ],
+ [ 'write_wait', 'SVGA', 'Oak' ],
+ [ 'read_wait', 'SVGA', 'Oak' ],
+ [ 'clgd6225_lcd', 'SVGA', 'Cirrus' ],
+ [ 'fix_panel_size', 'SVGA', 'C&T' ],
+ [ 'lcd_center', 'SVGA', 'C&T|Neomagic|Trident' ],
+ [ 'cyber_shadow', 'SVGA', 'Trident' ],
+ [ 'STN', 'SVGA', 'C&T' ],
+ [ 'no_stretch', 'SVGA', 'C&T|Cirrus|Neomagic|Trident' ],
+ [ 'no_prog_lcd_mode_regs', 'SVGA', 'Neomagic' ],
+ [ 'prog_lcd_mode_stretch', 'SVGA', 'Neomagic' ],
+ [ 'suspend_hack', 'SVGA', 'C&T' ],
+ [ 'use_18bit_bus', 'SVGA', 'C&T' ],
+ [ 'hibit_low', 'SVGA', 'Tseng.*ET4000' ],
+ [ 'hibit_high', 'SVGA', 'Tseng.*ET4000' ],
+ [ 'probe_clocks', 'SVGA', 'Cirrus' ],
+ [ 'power_saver', 'SVGA', '.*' ],
+ [ 'use_vlck1', 'SVGA', 'C&T' ],
+ [ 'sgram', 'SVGA', 'i740' ],
+ [ 'sdram', 'SVGA', 'i740' ],
+ [ 'no_2mb_banksel', 'SVGA', 'Cirrus' ],
+ [ 'tgui_pci_read_on', 'SVGA', 'Trident' ],
+ [ 'tgui_pci_write_on', 'SVGA', 'Trident' ],
+ [ 'no_program_clocks', 'SVGA', 'Trident' ],
+ [ 'mmio', 'SVGA', 'Cirrus|C&T|Neomagic' ],
+ [ 'sync_on_green', 'SVGA', 'C&T|MGA' ],
+ [ 'pci_retry', 'SVGA', 'Tseng|MGA|Cirrus' ],
+ [ 'hw_cursor', 'SVGA', 'C&T|SiS|ARK|ET6000|i740|Tseng' ],
+ [ 'xaa_no_color_exp', 'SVGA', 'C&T|Cirrus|Trident|Tseng' ],
+ [ 'xaa_benchmarks', 'SVGA', 'C&T' ],
+ [ 'pci_burst_on', 'SVGA', 'Trident|Tseng' ],
+ [ 'prog_lcd_mode_regs', 'SVGA', 'Neomagic' ],
+ [ 'no_prog_lcd_mode_stretch', 'SVGA', 'Neomagic' ],
+ [ 'no_wait', 'SVGA', 'Oak' ],
+ #- [ 'med_dram', 'SVGA', 'Cirrus|Trident|Western Digital' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'fast_dram', 'SVGA', 'C&T|Cirrus|ET[46]000|Trident|Western Digital' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'fast_vram', 'SVGA', 'SiS' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'clock_50', 'SVGA', 'Oak' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'clock_66', 'SVGA', 'Oak' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'fifo_aggressive', 'SVGA', 'Cirrus|ARK|SiS|Oak' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'override_validate_mode', 'SVGA', 'Neomagic' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'tgui_mclk_66', 'SVGA', 'Trident' ], #- WARNING, MAY DAMAGE CARD
+ #- [ 'favour_bitblt', 'SVGA', 'Cirrus' ], #- OBSELETE
+ [ 'sw_cursor', '3DLabs', '.*' ],
+ [ 'no_pixmap_cache', '3DLabs', '.*' ],
+ [ 'no_accel', '3DLabs', '.*' ],
+ [ 'firegl_3000', '3DLabs', '.*' ],
+ [ 'sync_on_green', '3DLabs', '.*' ],
+ [ 'pci_retry', '3DLabs', '.*' ],
+ #- [ 'overclock_mem', '3DLabs', '.*' ], #- WARNING, MAY DAMAGE CARD
+ [ 'dac_8_bit', 'I128', '.*' ],
+ [ 'no_accel', 'I128', '.*' ],
+ [ 'sync_on_green', 'I128', '.*' ],
+ [ 'composite', 'Mach32', '.*' ],
+ [ 'sw_cursor', 'Mach32', '.*' ],
+ [ 'dac_8_bit', 'Mach32', '.*' ],
+ [ 'ast_mach32', 'Mach32', '.*' ],
+ [ 'intel_gx', 'Mach32', '.*' ],
+ [ 'no_linear', 'Mach32', '.*' ],
+ [ 'sw_cursor', 'Mach64', '.*' ],
+ [ 'nolinear', 'Mach64', '.*' ],
+ [ 'no_block_write', 'Mach64', '.*' ],
+ [ 'block_write', 'Mach64', '.*' ],
+ [ 'fifo_conservative', 'Mach64', '.*' ],
+ [ 'no_font_cache', 'Mach64', '.*' ],
+ [ 'no_pixmap_cache', 'Mach64', '.*' ],
+ [ 'composite', 'Mach64', '.*' ],
+ [ 'power_saver', 'Mach64', '.*' ],
+ [ 'no_program_clocks', 'Mach64', '.*' ],
+ [ 'no_bios_clocks', 'Mach64', '.*' ],
+ [ 'dac_6_bit', 'Mach64', '.*' ],
+ [ 'dac_8_bit', 'Mach64', '.*' ],
+ [ 'hw_cursor', 'Mach64', '.*' ],
+ #- [ 'override_bios', 'Mach64', '.*' ], #- WARNING, MAY DAMAGE CARD
+ [ 'sw_cursor', 'P9000', '.*' ],
+ [ 'noaccel', 'P9000', '.*' ],
+ [ 'sync_on_green', 'P9000', '.*' ],
+ [ 'vram_128', 'P9000', '.*' ],
+ [ 'nolinear', 'S3', '.*' ],
+ [ 'dac_8_bit', 'S3', '.*' ],
+ [ 'slow_vram', 'S3', 'S3.*964' ],
+ [ 'stb_pegasus', 'S3', 'S3.*928' ],
+ [ 'SPEA_Mercury', 'S3', 'S3.*(928|964)' ],
+ [ 'number_nine', 'S3', 'S3.*(864|928)' ],
+ [ 'lcd_center', 'S3', 'S3.*Aurora64V' ],
+ [ 'noaccel', 'S3V', '.*' ],
+ [ 'slow_edodram', 'S3V', '.*' ],
+ [ 'pci_burst_on', 'S3V', '.*' ],
+ [ 'early_ras_precharge', 'S3V', '.*' ],
+ [ 'late_ras_precharge', 'S3V', '.*' ],
+ [ 'fifo_conservative', 'S3V', '.*' ],
+ [ 'fifo_aggressive', 'S3V', '.*' ],
+ [ 'fifo_moderate', 'S3V', '.*' ],
+ [ 'lcd_center', 'S3V', 'S3.*ViRGE\/MX' ],
+ [ 'hw_cursor', 'S3V', '.*' ],
+ [ 'pci_retry', 'S3V', '.*' ],
+ [ 'dac_6_bit', 'AGX', '.*' ],
+ [ 'dac_8_bit', 'AGX', '.*' ],
+ [ 'sync_on_green', 'AGX', '.*' ],
+ [ '8_bit_bus', 'AGX', '.*' ],
+ [ 'wait_state', 'AGX', '.*' ],
+ [ 'no_wait_state', 'AGX', '.*' ],
+ [ 'noaccel', 'AGX', '.*' ],
+ [ 'crtc_delay', 'AGX', '.*' ],
+ [ 'fifo_conserv', 'AGX', '.*' ],
+ [ 'fifo_aggressive', 'AGX', '.*' ],
+ [ 'fifo_moderate', 'AGX', '.*' ],
+ [ 'vram_delay_latch', 'AGX', '.*' ],
+ [ 'vram_delay_ras', 'AGX', '.*' ],
+ [ 'vram_extend_ras', 'AGX', '.*' ],
+ [ 'slow_dram', 'AGX', '.*' ],
+ [ 'slow_vram', 'AGX', '.*' ],
+ [ 'med_dram', 'AGX', '.*' ],
+ [ 'med_vram', 'AGX', '.*' ],
+ [ 'fast_dram', 'AGX', '.*' ],
+ [ 'fast_vram', 'AGX', '.*' ],
+ [ 'engine_delay', 'AGX', '.*' ],
+ [ 'vram_128', 'AGX', '.*' ],
+ [ 'vram_256', 'AGX', '.*' ],
+ [ 'refresh_20', 'AGX', '.*' ],
+ [ 'refresh_25', 'AGX', '.*' ],
+ [ 'screen_refresh', 'AGX', '.*' ],
+ [ 'vlb_a', 'AGX', '.*' ],
+ [ 'vlb_b', 'AGX', '.*' ],
+ [ 'slow_dram', 'W32', '.*' ],
+ [ 'pci_burst_off', 'W32', '.*' ],
+ [ 'w32_interleave_off', 'W32', '.*' ],
+ [ 'no_accel', 'W32', '.*' ],
+ [ 'nolinear', '8514', '.*' ],
+ [ 'sw_cursor', '8514', '.*' ],
+ [ 'no_block_write', '8514', '.*' ],
+ [ 'block_write', '8514', '.*' ],
+ [ 'fifo_conservative', '8514', '.*' ],
+ [ 'no_font_cache', '8514', '.*' ],
+ [ 'no_pixmap_cache', '8514', '.*' ],
+ [ 'composite', '8514', '.*' ],
+ [ 'power_saver', '8514', '.*' ],
+ [ 'power_saver', 'FBDev', '.*' ],
+);
+%xkb_options = (
+ 'ru(winkeys)' => [ 'XkbVariant "winkeys"', 'XkbOptions "grp:caps_toggle"' ],
+ 'jp' => [ 'XkbModel "jp106"' ],
+);
-
-
-
-
-
-
-
-
-
-$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.
+$XF86firstchunk_text = q(
+# File generated by XFdrake.
# **********************************************************************
-# Refer to the XF86Config(4/5) man page for details about the format of
+# 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
+# By default, Mandrake 6.0 and later now use a font server independent of
# the X server to render fonts.
FontPath "unix/:-1"
@@ -215,7 +385,7 @@ EndSection
Section "ServerFlags"
- # Uncomment this to cause a core dump at the spot where a signal is
+ # 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
@@ -228,12 +398,18 @@ Section "ServerFlags"
# sequences. This allows clients to receive these key events.
#DontZoom
+ # This allows the server to start up even if the
+ # mouse device can't be opened/initialised.
+ AllowMouseOpenFail
+);
+
+$XF86firstchunk_text2 = q(
EndSection
# **********************************************************************
# Input devices
# **********************************************************************
-';
+);
$keyboardsection_start = '
# **********************************************************************
@@ -248,29 +424,90 @@ Section "Keyboard"
# following line
#Protocol "Xqueue"
- AutoRepeat 500 5
+ AutoRepeat 250 30
- # Let the server do the NumLock processing. This should only be
+ # 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
+ #Xleds "1 2 3"
- #To set the LeftAlt to Meta, RightAlt key to ModeShift,
+ #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
+ RightAlt Meta
+ ScrollLock Compose
+ RightCtl Control
# To disable the XKEYBOARD extension, uncomment XkbDisable.
# XkbDisable
+';
+
+$keyboardsection_start_v4 = '
+# **********************************************************************
+# Keyboard section
+# **********************************************************************
+
+Section "InputDevice"
+
+ Identifier "Keyboard1"
+ Driver "Keyboard"
+ Option "AutoRepeat" "250 30"
+';
+
+if (arch() =~ /^sparc/) {
+ $keyboardsection_part3 = '
+# To customise the XKB settings to suit your keyboard, modify the
+# lines below (which are the defaults). For example:
+# XkbModel "type6"
+# If you have a SUN keyboard, you may use:
+# XkbModel "sun"
+#
+# 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 on SUN:
+# XkbRules "sun"
+# XkbModel "type5_unix"
+# XkbLayout "us"
+# XkbCompat "compat/complete"
+# XkbTypes "types/complete"
+# XkbKeycodes "sun(type5)"
+# XkbGeometry "sun(type5)"
+# XkbSymbols "sun/us(sun5)"
+
+ XkbRules "sun"
+ XkbModel "sun"
+ XkbLayout "us"
+ XkbCompat "compat/complete"
+ XkbTypes "types/complete"
+ XkbKeycodes "sun(type5)"
+ XkbGeometry "sun(type5)"
+ XkbSymbols "sun/us(sun5)"
+';
+$keyboardsection_part3_v4 = '
+ Option "XkbRules" "sun"
+ Option "XkbModel" "sun"
+ Option "XkbLayout" "us"
+ Option "XkbCompat" "compat/complete"
+ Option "XkbTypes" "types/complete"
+ Option "XkbKeycodes" "sun(type5)"
+ Option "XkbGeometry" "sun(type5)"
+ Option "XkbSymbols" "sun/us(sun5)"
+';
+} else {
+$keyboardsection_part3 = '
# 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:
@@ -296,20 +533,26 @@ $keyboardsection_part2 = '
# XkbVariant ""
# XkbOptions ""
- XkbKeycodes "xfree86"
- XkbTypes "default"
- XkbCompat "default"
- XkbSymbols "us(pc101)"
- XkbGeometry "pc"
- XkbRules "xfree86"
- XkbModel "pc101"
+ XkbKeycodes "xfree86"
+ XkbTypes "default"
+ XkbCompat "default"
+ XkbSymbols "us(pc105)"
+ XkbGeometry "pc"
+ XkbRules "xfree86"
+ XkbModel "pc105"
';
+$keyboardsection_part3_v4 = '
+ Option "XkbRules" "xfree86"
+ Option "XkbModel" "pc105"
+';
+}
+
$keyboardsection_end = '
EndSection
';
-$pointersection_text1 = '
+$pointersection_text = '
# **********************************************************************
# Pointer section
# **********************************************************************
@@ -317,20 +560,15 @@ $pointersection_text1 = '
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
+$pointersection_text_v4 = '
+# **********************************************************************
+# Pointer section
+# **********************************************************************
-# BaudRate 9600
-# SampleRate 150
+Section "InputDevice"
-# Emulate3Buttons is an option for 2-button Microsoft mice
-# Emulate3Timeout is the timeout in milliseconds (default is 50ms)
+ Identifier "Mouse1"
+ Driver "mouse"
';
$monitorsection_text1 = '
@@ -486,9 +724,9 @@ Modeline "1600x1200" 220 1600 1616 1808 2080 1200 1204 1207 1244 +HSync +VS
# 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
+# 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
+# 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
@@ -528,21 +766,23 @@ $devicesection_text = '
# Graphics device section
# **********************************************************************
-# Any number of graphics device sections may be present
-
Section "Device"
- Identifier "Generic VGA"
- VendorName "Unknown"
- BoardName "Unknown"
+ Identifier "Generic VGA"
Chipset "generic"
+EndSection
-# VideoRam 256
+';
-# Clocks 25.2 28.3
+$devicesection_text_v4 = '
+# **********************************************************************
+# Graphics device section
+# **********************************************************************
+Section "Device"
+ Identifier "Generic VGA"
+ Driver "vga"
EndSection
-# Device configured by Xconfigurator:
';
$screensection_text1 = '
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 5b2fef5c3..68d7ae8e9 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -1,37 +1,578 @@
-package any;
+package any; # $Id$
use diagnostics;
use strict;
+use vars qw(@users);
#-######################################################################################
#- misc imports
#-######################################################################################
-use common qw(:file :system :common :functional);
+use common qw(:common :system :file :functional);
+use commands;
+use detect_devices;
+use partition_table qw(:types);
+use fsedit;
+use fs;
+use run_program;
+use modules;
+use log;
-sub addKdmUsers {
+sub facesdir {
+ my ($prefix) = @_;
+ "$prefix/usr/share/faces/";
+}
+sub face2xpm {
+ my ($face, $prefix) = @_;
+ facesdir($prefix) . $face . ".xpm";
+}
+sub facesnames {
+ my ($prefix) = @_;
+ my $dir = facesdir($prefix);
+ grep { -e "$dir/$_.png" } map { /(.*)\.xpm/ } all($dir);
+}
+
+sub addKdmIcon {
+ my ($prefix, $user, $icon) = @_;
+ my $dest = "$prefix/usr/share/faces/$user.png";
+ eval { commands::cp("-f", facesdir($prefix) . $icon . ".png", $dest) } if $icon;
+}
+
+sub allocUsers {
my ($prefix, @users) = @_;
- require timezone;
- my @u1 = my @users_male = qw(tie default curly);
- my @u2 = my @users_female = qw(brunette girl woman-blond);
- foreach (@users) {
- my $l = rand() < timezone::sexProb($_->{name}) ? \@u2 : \@u1;
- my $u = splice(@$l, rand(@$l), 1); #- known biased (see cookbook for better)
- symlink "../../../../icons/user-$u-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/$_.xpm";
- @u1 = @users_male unless @u1;
- @u2 = @users_female unless @u2;
+ my @m = my @l = facesnames($prefix);
+ foreach (grep { !$_->{icon} || $_->{icon} eq "automagic" } @users) {
+ $_->{auto_icon} = splice(@m, rand(@m), 1); #- known biased (see cookbook for better)
+ log::l("auto_icon is $_->{auto_icon}");
+ @m = @l unless @m;
}
- symlinkf "../../../../icons/user-hat-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/root.xpm" unless $::isStandalone;
}
sub addUsers {
my ($prefix, @users) = @_;
my $msec = "$prefix/etc/security/msec";
+
+ allocUsers($prefix, @users);
foreach my $u (@users) {
- substInFile { s/^$u\n//; $_ .= "$u\n" if eof } "$msec/user.conf" if -d $msec;
+ substInFile { s/^$u->{name}\n//; $_ .= "$u->{name}\n" if eof } "$msec/user.conf" if -d $msec;
+ addKdmIcon($prefix, $u->{name}, delete $u->{auto_icon} || $u->{icon});
+ }
+ run_program::rooted($prefix, "/usr/share/msec/grpuser.sh --refresh >/dev/null");
+# addKdmIcon($prefix, 'root', 'root');
+}
+
+sub crypt {
+ my ($password, $md5) = @_;
+ $md5 ?
+ c::crypt_md5($password, salt(8)) :
+ crypt ($password, salt(2));
+}
+sub enableShadow {
+ my ($prefix) = @_;
+ run_program::rooted($prefix, "pwconv") or log::l("pwconv failed");
+ run_program::rooted($prefix, "grpconv") or log::l("grpconv failed");
+}
+sub enableMD5Shadow {
+ my ($prefix, $shadow, $md5) = @_;
+ substInFile {
+ if (/^password.*pam_pwdb.so/) {
+ s/\s*shadow//; s/\s*md5//;
+ s/$/ shadow/ if $shadow;
+ s/$/ md5/ if $md5;
+ }
+ } grep { -r $_ } map { "$prefix/etc/pam.d/$_" } qw(login rlogin passwd);
+}
+
+sub setupBootloader {
+ my ($in, $b, $hds, $fstab, $security, $prefix, $more) = @_;
+
+ $more++ if $b->{bootUnsafe};
+
+ if ($::beginner && $more >= 1) {
+ my @l = (__("First sector of drive (MBR)"), __("First sector of boot partition"));
+
+ $in->set_help('setupBootloaderBeginner') unless $::isStandalone;
+ if (arch() =~ /sparc/) {
+ $b->{use_partition} = $in->ask_from_list_(_("SILO Installation"),
+ _("Where do you want to install the bootloader?"),
+ \@l, $l[$b->{use_partition}]);
+ } else {
+ my $boot = $hds->[0]{device};
+ my $onmbr = "/dev/$boot" eq $b->{boot};
+ $b->{boot} = "/dev/" . ($in->ask_from_list_(_("LILO/grub Installation"),
+ _("Where do you want to install the bootloader?"),
+ \@l, $l[!$onmbr]) eq $l[0]
+ ? $boot : fsedit::get_root($fstab, 'boot')->{device});
+ }
+ } elsif ($more || !$::beginner) {
+ $in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" : "setupBootloaderGeneral") unless $::isStandalone; #- TO MERGE ?
+
+ if ($::expert) {
+ my $default = arch() =~ /sparc/ ? 'silo' : 'grub';
+ my $m = $in->ask_from_list_('', _("Which bootloader(s) do you want to use?"), [ keys(%{$b->{methods}}), __("None") ], $default) or return;
+ $b->{methods}{$_} = 0 foreach keys %{$b->{methods}};
+ $b->{methods}{$m} = 1 if $m ne "None";
+ }
+ #- at least one method
+ grep_each { $::b } %{$b->{methods}} or return;
+
+ #- put lilo if grub is chosen, so that /etc/lilo.conf is generated
+ exists $b->{methods}{lilo} and $b->{methods}{lilo} = 1 if $b->{methods}{grub};
+
+ 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 = (
+arch() =~ /sparc/ ? (
+_("Bootloader installation") => { val => \$silo_install_lang, list => \@silo_install_lang },
+) : (
+_("Boot device") => { val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } @$hds, @$fstab), detect_devices::floppies() ], not_edit => !$::expert },
+_("LBA (doesn't work on old BIOSes)") => { val => \$b->{lba32}, type => "bool", text => "lba" },
+_("Compact") => { val => \$b->{compact}, type => "bool", text => _("compact") },
+_("Video mode") => { val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => $::beginner },
+),
+_("Delay before booting default image") => \$b->{timeout},
+$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") },
+)
+ );
+ @l = @l[0..3] unless $::expert; #- take "bootloader installation" and "delay before ..." on SPARC.
+
+ $b->{vga} ||= 'Normal';
+ $in->ask_from_entries_refH('', _("Bootloader main options"), \@l,
+ complete => sub {
+#- $security > 4 && length($b->{password}) < 6 and $in->ask_warn('', _("At this level of security, a password (and a good one) in lilo is requested")), return 1;
+ $b->{restricted} && !$b->{password} and $in->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 $in->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return 1;
+ 0;
+ }
+ ) or return 0;
+ $b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1;
+ $b->{vga} = $bootloader::vga_modes{$b->{vga}} || $b->{vga};
+ }
+
+ until ($::beginner && $more <= 1) {
+ $in->set_help(arch() =~ /sparc/ ? 'setupSILOAddEntry' : 'setupBootloaderAddEntry') unless $::isStandalone;
+ my $c = $in->ask_from_listf([''],
+_("Here are the different entries.
+You can add some more or change the existing ones."),
+ sub {
+ my ($e) = @_;
+ ref $e ?
+ "$e->{label} ($e->{kernel_or_dev})" . ($b->{default} eq $e->{label} && " *") :
+ translate($e);
+ },
+ [ @{$b->{entries}}, __("Add"), __("Done") ]);
+
+ $c eq "Done" and last;
+
+ my ($e);
+
+ if ($c eq "Add") {
+ my @labels = map { $_->{label} } @{$b->{entries}};
+ my $prefix;
+ if ($in->ask_from_list_('', _("Which type of entry do you want to add?"),
+ [ __("Linux"), arch() =~ /sparc/ ? __("Other OS (SunOS...)") : __("Other OS (windows...)") ]
+ ) eq "Linux") {
+ $e = { type => 'image',
+ root => '/dev/' . fsedit::get_root($fstab)->{device}, #- assume a good default.
+ };
+ $prefix = "linux";
+ } else {
+ $e = { type => 'other' };
+ $prefix = arch() =~ /sparc/ ? "sunos" : "windows";
+ }
+ $e->{label} = $prefix;
+ for (my $nb = 0; member($e->{label}, @labels); $nb++) { $e->{label} = "$prefix-$nb" }
+ } else {
+ $e = $c;
+ }
+ 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 => [ map { s/$prefix//; $_ } glob_("$prefix/boot/vmlinuz*") ], not_edit => 0 },
+_("Root") => { val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
+_("Append") => \$e->{append},
+_("Video mode") => { val => \$e->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert },
+_("Initrd") => { val => \$e->{initrd}, list => [ map { s/$prefix//; $_ } glob_("$prefix/boot/initrd*") ] },
+_("Read-write") => { val => \$e->{'read-write'}, type => 'bool' }
+ );
+ @l = @l[0..5] unless $::expert;
+ } else {
+ @l = (
+_("Root") => { val => \$e->{kernel_or_dev}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
+arch() !~ /sparc/ ? (
+_("Table") => { val => \$e->{table}, list => [ '', map { "/dev/$_->{device}" } @$hds ], not_edit => !$::expert },
+_("Unsafe") => { val => \$e->{unsafe}, type => 'bool' }
+) : (),
+ );
+ @l = @l[0..1] unless $::expert;
+ }
+ @l = (
+_("Label") => \$e->{label},
+@l,
+_("Default") => { val => \$default, type => 'bool' },
+ );
+
+ if ($in->ask_from_entries_refH($c eq "Add" ? '' : ['', _("Ok"), _("Remove entry")],
+ '', \@l,
+ complete => sub {
+ $e->{label} or $in->ask_warn('', _("Empty label not allowed")), return 1;
+ member($e->{label}, map { $_->{label} } grep { $_ != $e } @{$b->{entries}}) and $in->ask_warn('', _("This label is already used")), return 1;
+ 0;
+ })) {
+ $b->{default} = $old_default || $default ? $default && $e->{label} : $b->{default};
+ $e->{vga} = $bootloader::vga_modes{$e->{vga}} || $e->{vga};
+ require bootloader;
+ bootloader::configure_entry($prefix, $e); #- hack to make sure initrd file are built.
+
+ push @{$b->{entries}}, $e if $c eq "Add";
+ } else {
+ @{$b->{entries}} = grep { $_ != $e } @{$b->{entries}};
+ }
+ }
+ 1;
+}
+
+sub setAutologin {
+ my ($prefix, $user, $desktop) = @_;
+ if ($user) {
+ local *F;
+ open F, ">$prefix/etc/sysconfig/desktop" or die "Can't open $!";
+ print F uc($desktop) . "\n";
+ close F;
+ }
+ setVarsInSh("$prefix/etc/sysconfig/autologin",
+ { USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx" });
+}
+
+
+sub writeandclean_ldsoconf {
+ my ($prefix) = @_;
+ my $file = "$prefix/etc/ld.so.conf";
+ output $file,
+ grep { !m|^(/usr)?/lib$| } #- no need to have /lib and /usr/lib in ld.so.conf
+ uniq cat_($file), "/usr/X11R6/lib\n";
+}
+
+sub shells {
+ my ($prefix) = @_;
+ grep { -x "$prefix$_" } map { chomp; $_ } cat_("$prefix/etc/shells");
+}
+
+sub inspect {
+ my ($part, $prefix, $rw) = @_;
+
+ isMountableRW($part) or return;
+
+ my $dir = "/tmp/inspect_tmp_dir";
+
+ if ($part->{isMounted}) {
+ $dir = ($prefix || '') . $part->{mntpoint};
+ } elsif ($part->{notFormatted} && !$part->{isFormatted}) {
+ $dir = '';
+ } else {
+ mkdir $dir, 0700;
+ eval { fs::mount($part->{device}, $dir, type2fs($part->{type}), !$rw) };
+ $@ and return;
+ }
+ my $h = before_leaving {
+ if (!$part->{isMounted} && $dir) {
+ fs::umount($dir);
+ unlink($dir)
+ }
+ };
+ $h->{dir} = $dir;
+ $h;
+}
+
+#-----modem conf
+sub pppConfig {
+ my ($in, $modem, $prefix, $install) = @_;
+ $modem or return;
+
+ symlinkf($modem->{device}, "$prefix/dev/modem") or log::l("creation of $prefix/dev/modem failed");
+ $install->(qw(ppp)) unless $::testing;
+
+ my %toreplace;
+ $toreplace{$_} = $modem->{$_} foreach qw(connection phone login passwd auth domain dns1 dns2);
+ $toreplace{kpppauth} = ${{ 'Script-based' => 0, 'PAP' => 1, 'Terminal-based' => 2, }}{$modem->{auth}};
+ $toreplace{phone} =~ s/\D//g;
+ $toreplace{dnsserver} = join ',', map { $modem->{$_} } "dns1", "dns2";
+ $toreplace{dnsserver} .= $toreplace{dnsserver} && ',';
+
+ #- using peerdns or dns1,dns2 avoid writing a /etc/resolv.conf file.
+ $toreplace{peerdns} = "yes";
+
+ $toreplace{connection} ||= 'DialupConnection';
+ $toreplace{domain} ||= 'localdomain';
+ $toreplace{intf} ||= 'ppp0';
+ $toreplace{papname} = $modem->{auth} eq 'PAP' && $toreplace{login};
+
+ #- build ifcfg-ppp0.
+ my $ifcfg = "$prefix/etc/sysconfig/network-scripts/ifcfg-ppp0";
+ local *IFCFG; open IFCFG, ">$ifcfg" or die "Can't open $ifcfg";
+ print IFCFG <<END;
+DEVICE="$toreplace{intf}"
+ONBOOT="no"
+USERCTL="no"
+MODEMPORT="/dev/modem"
+LINESPEED="115200"
+PERSIST="yes"
+DEFABORT="yes"
+DEBUG="yes"
+INITSTRING="ATZ"
+DEFROUTE="yes"
+HARDFLOWCTL="yes"
+ESCAPECHARS="no"
+PPPOPTIONS=""
+PAPNAME="$toreplace{papname}"
+REMIP=""
+NETMASK=""
+IPADDR=""
+MRU=""
+MTU=""
+DISCONNECTTIMEOUT="5"
+RETRYTIMEOUT="60"
+BOOTPROTO="none"
+PEERDNS="$toreplace{peerdns}"
+END
+ foreach (1..2) {
+ if ($toreplace{"dns$_"}) {
+ print IFCFG <<END;
+DNS$_=$toreplace{"dns$_"}
+END
+ }
+ }
+ close IFCFG;
+
+ #- build chat-ppp0.
+ my $chat = "$prefix/etc/sysconfig/network-scripts/chat-ppp0";
+ local *CHAT; open CHAT, ">$chat" or die "Can't open $chat";
+ print CHAT <<END;
+'ABORT' 'BUSY'
+'ABORT' 'ERROR'
+'ABORT' 'NO CARRIER'
+'ABORT' 'NO DIALTONE'
+'ABORT' 'Invalid Login'
+'ABORT' 'Login incorrect'
+'' 'ATZ'
+END
+ if ($modem->{special_command}) {
+ print CHAT <<END;
+'OK' '$modem->{special_command}'
+END
+ }
+ print CHAT <<END;
+'OK' 'ATDT$toreplace{phone}'
+'CONNECT' ''
+END
+ if ($modem->{auth} eq 'Terminal-based' || $modem->{auth} eq 'Script-based') {
+ print CHAT <<END;
+'ogin:--ogin:' '$toreplace{login}'
+'ord:' '$toreplace{passwd}'
+END
+ }
+ print CHAT <<END;
+'TIMEOUT' '5'
+'~--' ''
+END
+ close CHAT;
+ chmod 0600, $chat;
+
+ if ($modem->{auth} eq 'PAP') {
+ #- need to create a secrets file for the connection.
+ my $secrets = "$prefix/etc/ppp/" . lc($modem->{auth}) . "-secrets";
+ my @l = cat_($secrets);
+ my $replaced = 0;
+ do { $replaced ||= 1
+ if s/^\s*"?$toreplace{login}"?\s+ppp0\s+(\S+)/"$toreplace{login}" ppp0 "$toreplace{passwd}"/; } foreach @l;
+ if ($replaced) {
+ local *F;
+ open F, ">$secrets" or die "Can't open $secrets: $!";
+ print F @l;
+ } else {
+ local *F;
+ open F, ">>$secrets" or die "Can't open $secrets: $!";
+ print F "$toreplace{login} ppp0 \"$toreplace{passwd}\"\n";
+ }
+ #- restore access right to secrets file, just in case.
+ chmod 0600, $secrets;
+ }
+
+ #- install kppprc file according to used configuration.
+ commands::mkdir_("-p", "$prefix/usr/share/config");
+ local *KPPPRC;
+ open KPPPRC, ">$prefix/usr/share/config/kppprc" or die "Can't open $prefix/usr/share/config/kppprc: $!";
+ #chmod 0600, "$prefix/usr/share/config/kppprc";
+ print KPPPRC <<END;
+# KDE Config File
+[Account0]
+ExDNSDisabled=0
+AutoName=0
+ScriptArguments=
+AccountingEnabled=0
+Phonenumber=$toreplace{phone}
+IPAddr=0.0.0.0
+Domain=$toreplace{domain}
+Name=$toreplace{connection}
+VolumeAccountingEnabled=0
+pppdArguments=
+Password=$toreplace{passwd}
+BeforeDisconnect=
+Command=
+ScriptCommands=
+Authentication=$toreplace{kpppauth}
+DNS=$toreplace{dnsserver}
+SubnetMask=0.0.0.0
+AccountingFile=
+DefaultRoute=1
+Username=$toreplace{login}
+Gateway=0.0.0.0
+StorePassword=1
+DisconnectCommand=
+[Modem]
+BusyWait=0
+Enter=CR
+FlowControl=CRTSCTS
+Volume=0
+Timeout=60
+UseCDLine=0
+UseLockFile=1
+Device=/dev/modem
+Speed=115200
+[Graph]
+InBytes=0,0,255
+Text=0,0,0
+Background=255,255,255
+Enabled=true
+OutBytes=255,0,0
+[General]
+QuitOnDisconnect=0
+ShowLogWindow=0
+DisconnectOnXServerExit=1
+DefaultAccount=$toreplace{connection}
+iconifyOnConnect=1
+Hint_QuickHelp=0
+AutomaticRedial=0
+PPPDebug=0
+NumberOfAccounts=1
+ShowClock=1
+DockIntoPanel=0
+pppdTimeout=30
+END
+
+ miscellaneousNetwork($prefix);
+}
+
+sub miscellaneousNetwork {
+ my ($prefix) = @_;
+ setVarsInSh ("$prefix/etc/profile.d/proxy.sh", $::o->{miscellaneous}, qw(http_proxy ftp_proxy));
+ setVarsInCsh("$prefix/etc/profile.d/proxy.csh", $::o->{miscellaneous}, qw(http_proxy ftp_proxy));
+}
+
+sub load_thiskind {
+ my ($in, $type) = @_;
+ my $w;
+ modules::load_thiskind($type, sub { $w = wait_load_module($in, $type, @_) });
+}
+
+sub setup_thiskind {
+ my ($in, $type, $auto, $at_least_one) = @_;
+
+ return if arch() eq "ppc";
+
+ my @l;
+ if (!$::noauto) {
+ @l = load_thiskind($in, $type);
+ if (my @err = grep { $_ } map { $_->{error} } @l) {
+ $in->ask_warn('', join("\n", @err));
+ }
+ return @l if $auto && (@l || !$at_least_one);
}
- run_program::rooted($prefix, "/etc/security/msec/init-sh/grpuser.sh --refresh");
+ @l = map { $_->{description} } @l;
+ while (1) {
+ (my $msg_type = $type) =~ s/\|.*//;
+ my $msg = @l ?
+ [ _("Found %s %s interfaces", join(", ", @l), $msg_type),
+ _("Do you have another one?") ] :
+ _("Do you have any %s interfaces?", $msg_type);
- addKdmUsers($prefix, @users);
+ my $opt = [ __("Yes"), __("No") ];
+ push @$opt, __("See hardware info") if $::expert;
+ my $r = "Yes";
+ $r = $in->ask_from_list_('', $msg, $opt, "No") unless $at_least_one && @l == 0;
+ if ($r eq "No") { return @l }
+ if ($r eq "Yes") {
+ push @l, load_module($in, $type) || next;
+ } else {
+ $in->ask_warn('', [ detect_devices::stringlist() ]);
+ }
+ }
}
+sub wait_load_module {
+ my ($in, $type, $text, $module) = @_;
+#-PO: the first %s is the card type (scsi, network, sound,...)
+#-PO: the second is the vendor+model name
+ $in->wait_message('',
+ [ _("Installing driver for %s card %s", $type, $text),
+ $::beginner ? () : _("(module %s)", $module)
+ ]);
+}
+
+sub load_module {
+ my ($in, $type) = @_;
+ my @options;
+
+ (my $msg_type = $type) =~ s/\|.*//;
+ my $m = $in->ask_from_listf('',
+#-PO: the %s is the driver type (scsi, network, sound,...)
+ _("Which %s driver should I try?", $msg_type),
+ \&modules::module2text,
+ [ modules::module_of_type($type) ]) or return;
+ my $l = modules::module2text($m);
+ require modparm;
+ my @names = modparm::get_options_name($m);
+
+ if ((@names != 0) && $in->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 = $in->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 ' ',
+ $in->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($in, $type, $l, $m);
+ modules::load($m, $type, @options);
+ };
+ if ($@) {
+ $in->ask_yesorno('',
+_("Loading module %s failed.
+Do you want to try again with other parameters?", $l), 1) or return;
+ goto ASK;
+ }
+ $l;
+}
+
+
1;
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 11f9d2ae3..0d33fb8ca 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1,4 +1,4 @@
-package bootloader;
+package bootloader; # $Id$
use diagnostics;
use strict;
@@ -10,6 +10,7 @@ use vars qw(%vga_modes);
use common qw(:common :file :functional :system);
use partition_table qw(:types);
use log;
+use any;
use fsedit;
use loopback;
use commands;
@@ -29,6 +30,10 @@ use modules;
"80x34" => '0x0f05',
"80x60" => '0x0f06',
"100x30" => '0x0122',
+ "640x480 in 16 bits (FrameBuffer only)" => 785,
+ "800x600 in 16 bits (FrameBuffer only)" => 788,
+ "1024x768 in 16 bits (FrameBuffer only)" => 791,
+ "1280x1024 in 16 bits (FrameBuffer only)" => 794,
);
my %vga_modes2nb = (
@@ -113,6 +118,15 @@ sub suggest_onmbr($) {
!$type || member($type, qw(dos dummy lilo grub empty)), !$type;
}
+sub compare_entries($$) {
+ my ($a, $b) = @_;
+ my %entries;
+
+ @entries{keys %$a, keys %$b} = ();
+ $a->{$_} eq $b->{$_} and delete $entries{$_} foreach keys %entries;
+ scalar keys %entries;
+}
+
sub add_entry($$) {
my ($entries, $v) = @_;
my (%usedold, $freeold);
@@ -120,13 +134,18 @@ sub add_entry($$) {
do { $usedold{$1 || 0} = 1 if $_->{label} =~ /^old ([^_]*)_/x } foreach @$entries;
foreach (0..scalar keys %usedold) { exists $usedold{$_} or $freeold = $_ || '', last }
- do { $_->{label} = "old${freeold}_$_->{label}" if $_->{label} eq $v->{label} } foreach @$entries;
+ foreach (@$entries) {
+ if ($_->{label} eq $v->{label}) {
+ compare_entries($_, $v) or return; #- avoid inserting it twice as another entry already exists !
+ $_->{label} = "old${freeold}_$_->{label}";
+ }
+ }
push @$entries, $v;
}
sub add_kernel($$$$$) {
my ($prefix, $lilo, $kernelVersion, $specific, $v) = @_;
- my $ext = $specific && "-$specific";
+ my $ext = $specific && "-$specific"; $specific eq 'hack' and $specific = '';
my ($vmlinuz, $image, $initrdImage) = ("vmlinuz-$kernelVersion$specific", "/boot/vmlinuz$ext", "/boot/initrd$ext.img");
-e "$prefix/boot/$vmlinuz" or log::l("unable to find kernel image $prefix/boot/$vmlinuz"), return;
{
@@ -175,11 +194,12 @@ sub dev2prompath { #- SPARC only
$dev;
}
-sub suggest($$$$$) {
- my ($prefix, $lilo, $hds, $fstab, $kernelVersion) = @_;
+sub suggest {
+ my ($prefix, $lilo, $hds, $fstab, $kernelVersion, $vga_fb) = @_;
my $root_part = fsedit::get_root($fstab);
my $root = isLoopback($root_part) ? "loop7" : $root_part->{device};
my $boot = fsedit::get_root($fstab, 'boot')->{device};
+ my $partition = first($boot =~ /\D*(\d*)/);
require c; c::initSilo() if arch() =~ /sparc/;
@@ -213,9 +233,7 @@ sub suggest($$$$$) {
my $msg_en =
__("Welcome to %s the operating system chooser!
-To list the possible choices, press <TAB>.
-
-To load one of them, write its name and press <ENTER> or
+Choose an operating system in the list above or
wait %d seconds for default boot.
");
@@ -233,22 +251,35 @@ wait %d seconds for default boot.
log::l("SMP machine, but no SMP kernel found") unless $isSecure;
$isSMP = 0;
}
- add_kernel($prefix, $lilo, $kernelVersion, $isSecure ? 'secure' : 'smp',
+ add_kernel($prefix, $lilo, $kernelVersion, $isSecure ? 'secure' : $isSMP ? 'smp' : '',
{
label => 'linux',
root => "/dev/$root",
- }) if $isSecure || $isSMP;
+ $vga_fb ? ( vga => $vga_fb) : (), #- using framebuffer
+ });
add_kernel($prefix, $lilo, $kernelVersion, '',
{
- label => $isSecure || $isSMP ? 'linux-up' : 'linux',
+ label => $isSecure || $isSMP ? 'linux-up' : 'linux-nonfb',
root => "/dev/$root",
- });
+ }) if $isSecure || $isSMP || $vga_fb;
add_kernel($prefix, $lilo, $kernelVersion, '',
{
label => 'failsafe',
root => "/dev/$root",
})->{append} .= " failsafe" unless $lilo->{password};
+ #- manage hackkernel if installed.
+ my $hasHack = -e "$prefix/boot/vmlinuz-hack";
+ if ($hasHack) {
+ my $hackVersion = first(readlink("$prefix/boot/vmlinuz-hack") =~ /vmlinuz-(.*)/);
+ add_kernel($prefix, $lilo, $hackVersion, 'hack',
+ {
+ label => 'hack',
+ root => "/dev/$root",
+ $vga_fb ? ( vga => $vga_fb) : (), #- using framebuffer
+ }) if $hackVersion;
+ }
+
if (arch() =~ /sparc/) {
#- search for SunOS, it could be a really better approach to take into account
#- partition type for mounting point.
@@ -275,6 +306,7 @@ wait %d seconds for default boot.
kernel_or_dev => "/dev/$_->{device}",
label => isDos($_) ? "dos" . ($dos++ ? $dos : '') : "windows" . ($win++ ? $win : '') ,
table => "/dev/$_->{rootDevice}",
+ unsafe => 1
}) if isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) });
}
}
@@ -282,7 +314,7 @@ wait %d seconds for default boot.
my %l = (
silo => bool(arch() =~ /sparc/),
lilo => bool(arch() !~ /sparc/) && !isLoopback(fsedit::get_root($fstab)),
- grub => bool(arch() !~ /sparc/) && !$::o->{lnx4win}, #1,#!isReiserfs(fsedit::get_root($fstab, 'boot')),
+ grub => bool(arch() !~ /sparc/ && availableRamMB() < 800), #- don't use grub if more than 800MB
loadlin => bool(arch() !~ /sparc/) && -e "/initrd/loopfs/lnx4win",
);
$lilo->{methods} ||= { map { $_ => 1 } grep { $l{$_} } keys %l };
@@ -405,6 +437,7 @@ sub install_lilo($$) {
#- print F "password=", $lilo->{password} if $lilo->{restricted} && $lilo->{password}; #- done by msec
print F "timeout=", round(10 * $lilo->{timeout}) if $lilo->{timeout};
print F "message=/boot/message" if $lilo->{message};
+ print F "menu-scheme=wb:bw:wb:bw";
foreach (@{$lilo->{entries}}) {
print F "$_->{type}=$_->{kernel_or_dev}";
@@ -513,6 +546,8 @@ sub install_grub {
print F "color black/cyan yellow/cyan";
print F "i18n ", $file2grub->("/boot/grub/messages");
print F "keytable ", $file2grub->($lilo->{keytable}) if $lilo->{keytable};
+ print F "altconfigfile ", $file2grub->(my $once = "/boot/grub/menu.once");
+ output "$prefix$once", " " x 100;
map_index {
print F "default $::i" if $_->{label} eq $lilo->{default};
@@ -545,7 +580,6 @@ sub install_grub {
}
}
}
- my $fd = first(detect_devices::floppies());
my $hd = fsedit::get_root($fstab, 'boot')->{rootDevice};
my $dev = dev2grub($lilo->{boot}, \%dev2bios);
@@ -606,16 +640,31 @@ sub install_loadlin {
my ($winpart) = grep { $_->{device_windobe} eq 'C' } @$fstab;
log::l("winpart is $winpart->{device}");
- my $winhandle = loopback::inspect($winpart, $prefix, 'rw');
+ my $winhandle = any::inspect($winpart, $prefix, 'rw');
my $windrive = $winhandle->{dir};
log::l("windrive is $windrive");
+ my ($label, $cmd) = loadlin_cmd($prefix, $lilo);
+
+ #install_loadlin_config_sys($lilo, $windrive, $label, $cmd);
+ #install_loadlin_desktop($lilo, $windrive);
+
+ output "/initrd/loopfs/lnx4win/linux.bat", unix2dos(
+'@echo off
+echo Linux Mandrake
+smartdrv /C
+' . "$cmd\n");
+
+}
+
+sub install_loadlin_config_sys {
+ my ($lilo, $windrive, $label, $cmd) = @_;
+
my $config_sys = "$windrive/config.sys";
local $_ = cat_($config_sys);
output "$windrive/config.mdk", $_ if $_;
my $timeout = $lilo->{timeout} || 1;
- my ($label, $cmd) = loadlin_cmd($prefix, $lilo);
$_ = "
[Menu]
@@ -637,12 +686,10 @@ menudefault=Windows,$timeout
shell=$cmd
";
output $config_sys, unix2dos($_);
- output "/initrd/loopfs/lnx4win/linux.bat", unix2dos(
-'@echo off
-echo Linux Mandrake
-smartdrv /C
-' . "$cmd\n");
+}
+sub install_loadlin_desktop {
+ my ($lilo, $windrive) = @_;
my $windir = lc(cat_("$windrive/msdos.sys") =~ /^WinDir=.:\\(\S+)/m ? $1 : "windows");
#-PO: "Desktop" and "Start Menu" are the name of the directories found in c:\windows
@@ -658,9 +705,9 @@ IconFile=%s
IconIndex=0
), lnx4win_file($lilo, "/", "/lnx4win.ico"));
}
-
}
+
sub install {
my ($prefix, $lilo, $fstab, $hds) = @_;
diff --git a/perl-install/c.pm b/perl-install/c.pm
index d1da19f2d..0683c0ef8 100644
--- a/perl-install/c.pm
+++ b/perl-install/c.pm
@@ -1,25 +1,12 @@
-package c;
+package c; # $Id$
-use strict;
-use vars qw($VERSION @ISA);
+use vars qw($AUTOLOAD);
-require DynaLoader;
+use c::stuff;
-@ISA = qw(DynaLoader);
-$VERSION = '0.01';
-
-bootstrap c $VERSION;
-
-1;
-
-sub headerGetEntry {
- my ($h, $q) = @_;
-
- $q eq 'name' and return headerGetEntry_string($h, RPMTAG_NAME());
- $q eq 'group' and return headerGetEntry_string($h, RPMTAG_GROUP());
- $q eq 'version' and return headerGetEntry_string($h, RPMTAG_VERSION());
- $q eq 'release' and return headerGetEntry_string($h, RPMTAG_RELEASE());
- $q eq 'arch' and return headerGetEntry_string($h, RPMTAG_ARCH());
- $q eq 'size' and return headerGetEntry_int($h, RPMTAG_SIZE());
+sub AUTOLOAD {
+ $AUTOLOAD =~ /::(.*)/;
+ goto &{$c::stuff::{$1}};
}
+1;
diff --git a/perl-install/c/.cvsignore b/perl-install/c/.cvsignore
index 0c6427c49..c2c3c1628 100644
--- a/perl-install/c/.cvsignore
+++ b/perl-install/c/.cvsignore
@@ -1,6 +1,8 @@
Makefile
-c.c
-c.bs
+Makefile_c
+stuff.c
+stuff.bs
pm_to_blib
+Makefile_c.old
blib
-c.xs
+stuff.xs
diff --git a/perl-install/c/Makefile.PL b/perl-install/c/Makefile.PL
index bb7eed0d1..0c41585a2 100644
--- a/perl-install/c/Makefile.PL
+++ b/perl-install/c/Makefile.PL
@@ -1,11 +1,17 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
+
+my $libs = '-L/usr/X11R6/lib -lX11 -lgdk -lXxf86misc';
+$libs .= ' -lrpm -ldb1 -lz' if $ENV{C_RPM};
+
WriteMakefile(
- 'NAME' => 'c',
- 'VERSION_FROM' => 'c.pm', # finds $VERSION
- 'LIBS' => ['-ldb1 -lz'], # e.g., '-lm'
-# 'OBJECT' => 'c.o librpm.a',
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'INC' => '-Wall', # e.g., '-I/usr/include/other'
+ 'NAME' => 'stuff',
+ 'OPTIMIZE' => '-Os',
+ 'MAKEFILE' => 'Makefile_c',
+ 'OBJECT' => 'stuff.o smp.o md5.o md5_crypt.o sbus.o silo.o',
+ 'VERSION_FROM' => 'stuff.pm', # finds $VERSION
+ 'LIBS' => [$libs], # e.g., '-lm'
+ 'DEFINE' => '-DHIGHFIRST -D"MD5Name(x)=x"', # e.g., '-DHAVE_SOMETHING'
+ 'INC' => '-I/usr/include/rpm `gtk-config --cflags`', # e.g., '-I/usr/include/other'
);
diff --git a/perl-install/c/sbus.c b/perl-install/c/sbus.c
index 1fed1f886..85d44fa79 100644
--- a/perl-install/c/sbus.c
+++ b/perl-install/c/sbus.c
@@ -86,6 +86,25 @@ int prom_getchild(int node)
return *(int *)op->oprom_array;
}
+char *prom_getopt(char *var, int *lenp)
+{
+ DECL_OP(MAX_VAL);
+
+ strcpy (op->oprom_array, var);
+ if (ioctl (promfd, OPROMGETOPT, op) < 0)
+ return 0;
+ if (lenp) *lenp = op->oprom_size;
+ return op->oprom_array;
+}
+
+void prom_setopt(char *var, char *value) {
+ DECL_OP(MAX_VAL);
+
+ strcpy (op->oprom_array, var);
+ strcpy (op->oprom_array + strlen (var) + 1, value);
+ ioctl (promfd, OPROMSETOPT, op);
+}
+
char *prom_getproperty(char *prop, int *lenp)
{
DECL_OP(MAX_VAL);
@@ -113,11 +132,25 @@ int prom_getbool(char *prop)
}
}
+int prom_pci2node(int bus, int devfn) {
+ DECL_OP(2*sizeof(int));
+
+ ((int *)op->oprom_array)[0] = bus;
+ ((int *)op->oprom_array)[1] = devfn;
+ if (ioctl (promfd, OPROMPCI2NODE, op) < 0)
+ return 0;
+ prom_current_node = *(int *)op->oprom_array;
+ return *(int *)op->oprom_array;
+}
+
#else
int prom_open() { return 0; }
void prom_close() {}
int prom_getsibling(int node) { return 0; }
int prom_getchild(int node) { return 0; }
-char *prom_getproperty(char *prop, int *lenp) { return NULL; }
+char *prom_getopt(char *var, int *lenp) { return 0; /* NULL */ }
+void prom_setopt(char *var, char *value) {}
+char *prom_getproperty(char *prop, int *lenp) { return 0; /* NULL */ }
int prom_getbool(char *prop) { return 0; }
+int prom_pci2node(int bus, int devfn) { return 0; }
#endif /* __sparc__ */
diff --git a/perl-install/c/stuff.pm b/perl-install/c/stuff.pm
index ad5cf316d..0cb3e99f3 100644
--- a/perl-install/c/stuff.pm
+++ b/perl-install/c/stuff.pm
@@ -1,4 +1,4 @@
-package c::stuff;
+package c::stuff; # $Id$
use strict;
use vars qw($VERSION @ISA);
@@ -10,11 +10,9 @@ $VERSION = '0.01';
bootstrap c::stuff $VERSION;
-1;
-
sub headerGetEntry {
my ($h, $q) = @_;
-
+ $h or log::l("empty header in headerGetEntry"), return;
$q eq 'name' and return headerGetEntry_string($h, RPMTAG_NAME());
$q eq 'group' and return headerGetEntry_string($h, RPMTAG_GROUP());
$q eq 'version' and return headerGetEntry_string($h, RPMTAG_VERSION());
@@ -23,7 +21,10 @@ sub headerGetEntry {
$q eq 'description' and return headerGetEntry_string($h, RPMTAG_DESCRIPTION());
$q eq 'arch' and return headerGetEntry_string($h, RPMTAG_ARCH());
$q eq 'size' and return headerGetEntry_int($h, RPMTAG_SIZE());
- $q eq 'filenames' and return headerGetEntry_string_list($h, RPMTAG_FILENAMES());
$q eq 'obsoletes' and return headerGetEntry_string_list($h, RPMTAG_OBSOLETES());
+ $q eq 'requires' and return headerGetEntry_string_list($h, RPMTAG_REQUIRENAME());
+ $q eq 'fileflags' and return headerGetEntry_int_list($h, RPMTAG_FILEFLAGS());
+ $q eq 'filenames' and return headerGetEntry_filenames($h);
}
+1;
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm
index 2b301d1b0..ecffd9c10 100644
--- a/perl-install/c/stuff.xs.pm
+++ b/perl-install/c/stuff.xs.pm
@@ -5,28 +5,38 @@ print '
#include <ctype.h>
#include <unistd.h>
+#include <syslog.h>
#include <fcntl.h>
#include <resolv.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/utsname.h>
+#include <sys/mount.h>
#include <linux/keyboard.h>
#include <linux/kd.h>
-#include <linux/fs.h>
#include <linux/hdreg.h>
#include <linux/vt.h>
+#include <linux/cdrom.h>
+#include <linux/loop.h>
#include <net/if.h>
#include <net/route.h>
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
+#include <X11/extensions/xf86misc.h>
+#include <term.h>
#define SECTORSIZE 512
';
$ENV{C_RPM} and print '
+#undef Fflush
+#undef Mkdir
+#undef Stat
#include <rpm/rpmlib.h>
void rpmError_callback_empty(void) {}
@@ -40,15 +50,32 @@ void rpmError_callback(void) {
}
FD_t fd2FD_t(int fd) {
- static struct _FD f = { -1, NULL, NULL, NULL };
- f.fd_fd = fd;
- return fd == -1 ? NULL : &f;
+ static FD_t f = NULL;
+ if (fd == -1) return NULL;
+ if (f == NULL) f = fdNew("");
+ fdSetFdno(f, fd);
+ return f;
}
';
print '
+void initIMPS2() {
+ unsigned char imps2_s1[] = { 243, 200, 243, 100, 243, 80, };
+ unsigned char imps2_s2[] = { 246, 230, 244, 243, 100, 232, 3, };
+
+ int fd = open("/dev/cdrom", O_WRONLY);
+ if (fd < 0) return;
+
+ write (fd, imps2_s1, sizeof (imps2_s1));
+ usleep (30000);
+ write (fd, imps2_s2, sizeof (imps2_s2));
+ usleep (30000);
+ tcflush (fd, TCIFLUSH);
+ tcdrain(fd);
+}
+
long long llseek(int fd, long long offset, int whence);
MODULE = c::stuff PACKAGE = c::stuff
@@ -64,21 +91,34 @@ Xtest(display)
XSetCloseDownMode(d, RetainPermanent);
XCloseDisplay(d);
}
- {
- char *args[2];
- args[0] = d ? "false" : "true"; /* inverted on purpose! */
- args[1] = NULL;
- execvp(args[0], args);
- }
- printf("***************** SHOUDNT GET THERE ***************\n");
- exit(d != NULL);
+ _exit(d != NULL);
}
-
waitpid(pid, &RETVAL, 0);
OUTPUT:
RETVAL
void
+setMouseLive(display, type, emulate3buttons)
+ char *display
+ int type
+ int emulate3buttons
+ CODE:
+ {
+ XF86MiscMouseSettings mseinfo;
+ Display *d = XOpenDisplay(display);
+ if (d) {
+ if (XF86MiscGetMouseSettings(d, &mseinfo) == True) {
+ mseinfo.type = type;
+ mseinfo.flags |= MF_REOPEN;
+ mseinfo.emulate3buttons = emulate3buttons;
+ XF86MiscSetMouseSettings(d, &mseinfo);
+ XFlush(d);
+ if (type == MTYPE_IMPS2) initIMPS2();
+ }
+ }
+ }
+
+void
XSetInputFocus(window)
int window
CODE:
@@ -102,9 +142,74 @@ lseek_sector(fd, sector, offset)
OUTPUT:
RETVAL
+int
+isBurner(fd)
+ int fd
+ CODE:
+ RETVAL = ioctl(fd, CDROM_GET_CAPABILITY) & CDC_CD_RW;
+ OUTPUT:
+ RETVAL
+
+unsigned int
+total_sectors(fd)
+ int fd
+ CODE:
+ {
+ long s;
+ RETVAL = ioctl(fd, BLKGETSIZE, &s) == 0 ? s : 0;
+ }
+ OUTPUT:
+ RETVAL
+
+void
+unlimit_core()
+ CODE:
+ {
+ struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
+ setrlimit(RLIMIT_CORE, &rlim);
+ }
+
+int
+getlimit_core()
+ CODE:
+ {
+ struct rlimit rlim;
+ getrlimit(RLIMIT_CORE, &rlim);
+ RETVAL = rlim.rlim_cur;
+ }
+ OUTPUT:
+ RETVAL
+
+void
+openlog(ident)
+ char *ident
+ CODE:
+ openlog(ident, 0, 0);
+
+void
+closelog()
+
+void
+syslog(mesg)
+ char *mesg
+ CODE:
+ syslog(LOG_WARNING, mesg);
+
void
setsid()
+void
+_exit(status)
+ int status
+
+int
+detectSMP()
+
+char*
+crypt_md5(pw, salt)
+ char *pw
+ char *salt
+
unsigned int
getpagesize()
@@ -185,7 +290,140 @@ kernel_version()
OUTPUT:
RETVAL
+char *
+kernel_arch()
+ CODE:
+ struct utsname u;
+ if (uname(&u) == 0) RETVAL = u.machine; else RETVAL = NULL;
+ OUTPUT:
+ RETVAL
+
+int
+set_loop(dev_fd, file)
+ int dev_fd
+ char *file
+ CODE:
+ RETVAL = 0;
+{
+ struct loop_info loopinfo;
+ int file_fd = open(file, O_RDWR);
+
+ if (file_fd < 0) return;
+
+ memset(&loopinfo, 0, sizeof(loopinfo));
+ strncpy(loopinfo.lo_name, file, LO_NAME_SIZE);
+ loopinfo.lo_name[LO_NAME_SIZE - 1] = 0;
+
+ if (ioctl(dev_fd, LOOP_SET_FD, file_fd) < 0) return;
+ if (ioctl(dev_fd, LOOP_SET_STATUS, &loopinfo) < 0) {
+ ioctl(dev_fd, LOOP_CLR_FD, 0);
+ return;
+ }
+ close(file_fd);
+ RETVAL = 1;
+}
+ OUTPUT:
+ RETVAL
+
+int
+del_loop(device)
+ char *device
+ CODE:
+ RETVAL = 0;
+{
+ int fd;
+ if ((fd = open(device, O_RDONLY)) < 0) return;
+ if (ioctl(fd, LOOP_CLR_FD, 0) < 0) return;
+ close(fd);
+ RETVAL = 1;
+}
+ OUTPUT:
+ RETVAL
+
+int
+prom_open()
+
+void
+prom_close()
+
+int
+prom_getsibling(node)
+ int node
+
+int
+prom_getchild(node)
+ int node
+
+void
+prom_getopt(key)
+ char *key
+ PPCODE:
+ int lenp = 0;
+ char *value = NULL;
+ value = prom_getopt(key, &lenp);
+ EXTEND(sp, 1);
+ if (value != NULL) {
+ PUSHs(sv_2mortal(newSVpv(value, 0)));
+ } else {
+ PUSHs(&PL_sv_undef);
+ }
+
+void
+prom_setopt(key, value)
+ char *key
+ char *value
+
+void
+prom_getproperty(key)
+ char *key
+ PPCODE:
+ int lenp = 0;
+ char *value = NULL;
+ value = prom_getproperty(key, &lenp);
+ EXTEND(sp, 1);
+ if (value != NULL) {
+ PUSHs(sv_2mortal(newSVpv(value, lenp)));
+ } else {
+ PUSHs(&PL_sv_undef);
+ }
+
+void
+prom_getstring(key)
+ char *key
+ PPCODE:
+ int lenp = 0;
+ char *value = NULL;
+ value = prom_getproperty(key, &lenp);
+ EXTEND(sp, 1);
+ if (value != NULL) {
+ PUSHs(sv_2mortal(newSVpv(value, 0)));
+ } else {
+ PUSHs(&PL_sv_undef);
+ }
+
+int
+prom_getbool(key)
+ char *key
+
+
+void
+initSilo()
+
+char *
+disk2PromPath(disk)
+ unsigned char *disk
+
+int
+hasAliases()
+
+char *
+promRootName()
+
+void
+setPromVars(linuxAlias, bootDevice)
+ char *linuxAlias
+ char *bootDevice
';
$ENV{C_RPM} and print '
@@ -220,7 +458,12 @@ rpmdbOpenForTraversal(root)
char *root
CODE:
static rpmdb db;
+ rpmErrorCallBackType old_cb;
+ old_cb = rpmErrorSetCallback(rpmError_callback_empty);
+ rpmSetVerbosity(RPMMESS_FATALERROR);
RETVAL = rpmdbOpenForTraversal(root, &db) == 0 ? db : NULL;
+ rpmErrorSetCallback(old_cb);
+ rpmSetVerbosity(RPMMESS_NORMAL);
OUTPUT:
RETVAL
@@ -241,7 +484,7 @@ rpmdbTraverse(db, ...)
}
count = 0;
num = rpmdbFirstRecNum(db);
- while (num) {
+ while (num>0) {
if (callback != &PL_sv_undef && SvROK(callback)) {
h = rpmdbGetRecord(db, num);
{
@@ -335,6 +578,31 @@ rpmtransAddPackage(rpmdep, header, key, update)
RETVAL
int
+rpmtransRemovePackages(db, rpmdep, p)
+ void *db
+ void *rpmdep
+ char *p
+ CODE:
+ rpmdb d = db;
+ rpmTransactionSet r = rpmdep;
+ dbiIndexSet matches;
+ int i;
+ int count = 0;
+ if (!rpmdbFindByLabel(d, p, &matches)) {
+ for (i = 0; i < dbiIndexSetCount(matches); ++i) {
+ unsigned int recOffset = dbiIndexRecordOffset(matches, i);
+ if (recOffset) {
+ rpmtransRemovePackage(rpmdep, recOffset);
+ ++count;
+ }
+ }
+ RETVAL=count;
+ } else
+ RETVAL=0;
+ OUTPUT:
+ RETVAL
+
+int
rpmdepOrder(order)
void *order
CODE:
@@ -383,7 +651,12 @@ int
rpmdbRebuild(root)
char *root
CODE:
+ rpmErrorCallBackType old_cb;
+ old_cb = rpmErrorSetCallback(rpmError_callback_empty);
+ rpmSetVerbosity(RPMMESS_FATALERROR);
RETVAL = rpmdbRebuild(root) == 0;
+ rpmErrorSetCallback(old_cb);
+ rpmSetVerbosity(RPMMESS_NORMAL);
OUTPUT:
RETVAL
@@ -409,22 +682,37 @@ rpmtransSetScriptFd(trans, fd)
void *trans
int fd
CODE:
- rpmtransSetScriptFd(trans, fdDup(fd));
+ /* this code core dumps on install...
+ static FD_t scriptFd = NULL;
+ if (scriptFd == NULL) scriptFd = fdNew("");
+ fdSetFdno(scriptFd, fd);
+ rpmtransSetScriptFd(trans, scriptFd);
+ */
+ static FD_t scriptFd = NULL;
+ if (scriptFd != NULL) fdClose(scriptFd);
+ scriptFd = fdDup(fd);
+ rpmtransSetScriptFd(trans, scriptFd);
void
-rpmRunTransactions(trans, callbackOpen, callbackClose, callbackStart, callbackProgress, force)
+rpmRunTransactions(trans, callbackOpen, callbackClose, callbackMessage, force)
void *trans
SV *callbackOpen
SV *callbackClose
- SV *callbackStart
- SV *callbackProgress
+ SV *callbackMessage
int force
PPCODE:
rpmProblemSet probs;
void *rpmRunTransactions_callback(const Header h, const rpmCallbackType what, const unsigned long amount, const unsigned long total, const void * pkgKey, void * data) {
static FD_t fd;
static int last_amount;
+ char *msg = NULL;
+ char *param_s = NULL;
+ const unsigned long *param_ul1 = NULL;
+ const unsigned long *param_ul2 = NULL;
char *n = (char *) pkgKey;
+ static struct timeval tprev;
+ static struct timeval tcurr;
+ long delta;
switch (what) {
case RPMCALLBACK_INST_OPEN_FILE: {
@@ -447,35 +735,86 @@ rpmRunTransactions(trans, callbackOpen, callbackClose, callbackStart, callbackPr
XPUSHs(sv_2mortal(newSVpv(n, 0)));
PUTBACK;
perl_call_sv(callbackClose, G_DISCARD);
- free(n); /* was strdup in rpmtransAddPackage */
+ free(n); /* was strdup in rpmtransAddPackage */
break;
}
+ case RPMCALLBACK_TRANS_START: {
+ switch (amount) {
+ case 1: msg = "Examining packages to install..."; break;
+ case 5: msg = "Examining files to install..."; break;
+ case 6: msg = "Finding overlapping files..."; break;
+ }
+ if (msg) param_ul1 = &total;
+ } break;
+
+ case RPMCALLBACK_UNINST_START: {
+ msg = "Removing old files...";
+ param_ul1 = &total;
+ } break;
+
+ case RPMCALLBACK_TRANS_PROGRESS: {
+ msg = "Progressing transaction";
+ param_ul1 = &amount;
+ } break;
+
+ case RPMCALLBACK_UNINST_PROGRESS: {
+ msg = "Progressing removing old files";
+ param_ul1 = &amount;
+ } break;
+
+ case RPMCALLBACK_TRANS_STOP: {
+ msg = "Done transaction";
+ } break;
+
+ case RPMCALLBACK_UNINST_STOP: {
+ msg = "Done removing old files";
+ } break;
+
case RPMCALLBACK_INST_START: {
- dSP ;
- PUSHMARK(sp) ;
- XPUSHs(sv_2mortal(newSVpv(n, 0)));
- PUTBACK ;
- perl_call_sv(callbackStart, G_DISCARD);
- last_amount = 0;
- } break;
+ msg = "Starting installing package";
+ gettimeofday(&tprev, NULL);
+ param_s = n;
+
+ last_amount = 0;
+ } break;
case RPMCALLBACK_INST_PROGRESS:
- if ((amount - last_amount) * 4 / total) {
- dSP;
- PUSHMARK(sp);
- XPUSHs(sv_2mortal(newSViv(amount)));
- XPUSHs(sv_2mortal(newSViv(total)));
- PUTBACK ;
- perl_call_sv(callbackProgress, G_DISCARD);
+ gettimeofday(&tcurr, NULL);
+ delta = 1000000 * (tcurr.tv_sec - tprev.tv_sec) + (tcurr.tv_usec - tprev.tv_usec);
+ if (delta > 200000 || amount >= total - 1) { /* (total && (amount - last_amount) * 22 / 4 / total)) { */
+ msg = "Progressing installing package";
+ param_s = n;
+ param_ul1 = &amount;
+ param_ul2 = &total;
+
+ tprev = tcurr;
last_amount = amount;
} break;
default: break;
}
+
+ if (msg) {
+ dSP ;
+ PUSHMARK(sp) ;
+ XPUSHs(sv_2mortal(newSVpv(msg, 0)));
+ if (param_s) {
+ XPUSHs(sv_2mortal(newSVpv(param_s, 0)));
+ }
+ if (param_ul1) {
+ XPUSHs(sv_2mortal(newSViv(*param_ul1)));
+ }
+ if (param_ul2) {
+ XPUSHs(sv_2mortal(newSViv(*param_ul2)));
+ }
+ PUTBACK ;
+ perl_call_sv(callbackMessage, G_DISCARD);
+ }
return NULL;
}
if (rpmRunTransactions(trans, rpmRunTransactions_callback, NULL, NULL, &probs, 0, force ? ~0 : ~RPMPROB_FILTER_DISKSPACE)) {
int i;
+ /* printf("rpmRunTransactions finished, errors occured %d\n", probs->numProblems); fflush(stdout); */
EXTEND(SP, probs->numProblems);
for (i = 0; i < probs->numProblems; i++) {
PUSHs(sv_2mortal(newSVpv(rpmProblemString(probs->probs[i]), 0)));
@@ -508,6 +847,10 @@ headerRead(fd, magicp)
OUTPUT:
RETVAL
+void
+headerFree(header)
+ void *header
+
char *
headerGetEntry_string(h, query)
void *h
@@ -530,29 +873,85 @@ headerGetEntry_int(h, query)
RETVAL
void
+headerGetEntry_int_list(h, query)
+ void *h
+ int query
+ PPCODE:
+ int i, type, count = 0;
+ int_32 *intlist = (int_32 *) NULL;
+ if (headerGetEntry((Header) h, query, &type, (void**) &intlist, &count)) {
+ if (count > 0) {
+ EXTEND(SP, count);
+ for (i = 0; i < count; i++) {
+ PUSHs(sv_2mortal(newSViv(intlist[i])));
+ }
+ }
+ }
+
+void
headerGetEntry_string_list(h, query)
void *h
int query
PPCODE:
int i, type, count = 0;
char **strlist = (char **) NULL;
- if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count) && count) {
- EXTEND(SP, count);
- for (i = 0; i < count; i++) {
- PUSHs(sv_2mortal(newSVpv(strlist[i], 0)));
+ if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count)) {
+ if (count > 0) {
+ EXTEND(SP, count);
+ for (i = 0; i < count; i++) {
+ PUSHs(sv_2mortal(newSVpv(strlist[i], 0)));
+ }
+ }
+ free(strlist);
+ }
+
+void
+headerGetEntry_filenames(h)
+ void *h
+ PPCODE:
+ int i, type, count = 0;
+ char ** baseNames, ** dirNames;
+ int_32 * dirIndexes;
+ char **strlist = (char **) NULL;
+
+ if (headerGetEntry((Header) h, RPMTAG_OLDFILENAMES, &type, (void**) &strlist, &count)) {
+ if (count > 0) {
+ EXTEND(SP, count);
+ for (i = 0; i < count; i++) {
+ PUSHs(sv_2mortal(newSVpv(strlist[i], 0)));
+ }
+ }
+ free(strlist);
+ } else {
+
+ headerGetEntry(h, RPMTAG_BASENAMES, &type, (void **) &baseNames, &count);
+ headerGetEntry(h, RPMTAG_DIRINDEXES, &type, (void **) &dirIndexes, NULL);
+ headerGetEntry(h, RPMTAG_DIRNAMES, &type, (void **) &dirNames, NULL);
+
+ if (baseNames && dirNames && dirIndexes) {
+ EXTEND(SP, count);
+ for(i = 0; i < count; i++) {
+ char *p = malloc(strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1);
+ if (p == NULL) croak("malloc failed");
+ strcpy(p, dirNames[dirIndexes[i]]);
+ strcat(p, baseNames[i]);
+ PUSHs(sv_2mortal(newSVpv(p, 0)));
+ free(p);
+ }
+ free(baseNames);
+ free(dirNames);
}
}
- free(strlist);
';
@macros = (
[ qw(int S_IFCHR S_IFBLK KDSKBENT KT_SPEC NR_KEYS MAX_NR_KEYMAPS BLKRRPART TIOCSCTTY
- HDIO_GETGEO BLKGETSIZE
- MS_MGC_VAL MS_RDONLY O_NONBLOCK SECTORSIZE WNOHANG
- VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE
+ HDIO_GETGEO BLKGETSIZE LOOP_GET_STATUS
+ MS_MGC_VAL MS_RDONLY O_NONBLOCK O_CREAT SECTORSIZE WNOHANG
+ VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT
) ],
);
-push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_FILENAMES RPMTAG_OBSOLETES) ]
+push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_OBSOLETES RPMTAG_REQUIRENAME RPMTAG_FILEFLAGS RPMFILE_CONFIG) ]
if $ENV{C_RPM};
$\= "\n";
diff --git a/perl-install/class_discard.pm b/perl-install/class_discard.pm
index 5242e6e8e..2a1b91351 100644
--- a/perl-install/class_discard.pm
+++ b/perl-install/class_discard.pm
@@ -1,4 +1,4 @@
-package class_discard;
+package class_discard; # $Id$
sub new { bless {}, "class_discard" }
diff --git a/perl-install/commands b/perl-install/commands
index 66574c7dc..edd22bb5f 100755
--- a/perl-install/commands
+++ b/perl-install/commands
@@ -3,7 +3,7 @@
use diagnostics;
use strict;
-use lib qw(/usr/bin/perl-install /home/pixel/perl-install . c c/blib/arch);
+use lib qw(/usr/bin/perl-install .);
use common qw(:file);
use commands;
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 8448a9f24..e2d0f4c0d 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -1,16 +1,29 @@
-package commands;
+#-########################################################################
+#- This file implement many common shell commands:
+#- true, false, cat, which, dirname, basename, rmdir, lsmod, grep, tr,
+#- mount, umount, mkdir, mknod, ln, rm, chmod, chown, mkswap, swapon,
+#- swapoff, ls, cp, ps, dd, head, tail, strings, hexdump, more, insmod,
+#- modprobe, route, df, kill, lspci, lssbus, dmesg, sort, du,
+#-########################################################################
+package commands; # $Id$
use diagnostics;
use strict;
use vars qw($printable_chars);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
use common qw(:common :file :system :constant);
+#-#####################################################################################
+#- Globals
+#-#####################################################################################
my $BUFFER_SIZE = 1024;
-1;
-
-
+#-######################################################################################
+#- Functions
+#-######################################################################################
sub getopts {
my $o = shift;
my @r = map { '' } (@_ = split //, $_[0]);
@@ -23,6 +36,8 @@ sub getopts {
@r;
}
+sub true { exit 0 }
+sub false { exit 1 }
sub cat { @ARGV = @_; print while <> }
sub which { ARG: foreach (@_) { foreach my $c (split /:/, $ENV{PATH}) { -x "$c/$_" and print("$c/$_\n"), next ARG; }}}
sub dirname_ { print dirname(@_), "\n" }
@@ -30,13 +45,15 @@ sub basename_ { print basename(@_), "\n" }
sub rmdir_ { foreach (@_) { rmdir $_ or die "rmdir: can't remove $_\n" } }
sub lsmod { print "Module Size Used by\n"; cat("/proc/modules"); }
-sub grep_ {
- my ($h, $v) = getopts(\@_, qw(hv));
- my $r = shift and !$h or die "usage: grep <regexp> [files...]\n";
- @ARGV = @_; (/$r/ ? $v || print : $v && print) while <>
+sub grep_ {
+ my ($h, $v, $i) = getopts(\@_, qw(hvi));
+ @_ == 0 || $h and die "usage: grep <regexp> [files...]\n";
+ my $r = shift;
+ $r = qr/$r/i if $i;
+ @ARGV = @_; (/$r/ ? $v || print : $v && print) while <>
}
-sub tr_ {
+sub tr_ {
my ($s, $c, $d) = getopts(\@_, qw(s c d));
@_ >= 1 + (!$d || $s) or die "usage: tr [-c] [-s [-d]] <set1> <set2> [files...]\n or tr [-c] -d <set1> [files...]\n";
my $set1 = shift;
@@ -47,25 +64,32 @@ sub tr_ {
sub mount {
@_ or return cat("/proc/mounts");
- my ($t) = getopts(\@_, qw(t));
- my $fs = $t ? shift : $_[0] =~ /:/ ? "nfs" : "ext2";
+ my ($t, $r) = getopts(\@_, qw(tr));
+ my $fs = $t && shift;
- @_ == 2 or die "usage: mount [-t <fs>] <device> <dir>\n",
+ @_ == 2 or die "usage: mount [-r] [-t <fs>] <device> <dir>\n",
+ " (use -r for readonly)\n",
" (if /dev/ is left off the device name, a temporary node will be created)\n";
- require 'fs.pm';
- fs::mount(@_, $fs, 0, 1);
+ my ($dev, $where) = @_;
+ $fs ||= $where =~ /:/ ? "nfs" :
+ $dev =~ /fd/ ? "vfat" : "ext2";
+
+ require fs;
+ require modules;
+ modules::load_deps("/modules/modules.dep");
+ fs::mount($dev, $where, $fs, $r);
}
sub umount {
@_ == 1 or die "umount expects a single argument\n";
- require 'fs.pm';
+ require fs;
fs::umount($_[0]);
}
-sub mkdir_ {
- my $rec; $_[0] eq '-p' and $rec = shift;
+sub mkdir_ {
+ my ($rec) = getopts(\@_, qw(p));
my $mkdir; $mkdir = sub {
my $root = dirname $_[0];
@@ -75,48 +99,42 @@ sub mkdir_ {
$rec or die "mkdir: $root does not exist (try option -p)\n";
&$mkdir($root);
}
+ $rec and -d $_[0] and return;
mkdir $_[0], 0755 or die "mkdir: error creating directory $_: $!\n";
};
- foreach (@_) { &$mkdir($_); }
+ &$mkdir($_) foreach @_;
}
sub mknod {
if (@_ == 1) {
- require 'devices.pm';
+ require devices;
eval { devices::make($_[0]) }; $@ and die "mknod: failed to create $_[0]\n";
} elsif (@_ == 4) {
- require 'c.pm';
+ require c;
my $mode = $ {{"b" => c::S_IFBLK(), "c" => c::S_IFCHR()}}{$_[1]} or die "unknown node type $_[1]\n";
syscall_('mknod', my $a = $_[0], $mode | 0600, makedev($_[2], $_[3])) or die "mknod failed: $!\n";
} else { die "usage: mknod <path> [b|c] <major> <minor> or mknod <path>\n"; }
}
sub ln {
- my ($force, $soft, $i);
-
- while ($i = shift) {
- if ($i eq '-f') { $force = 1; }
- elsif ($i eq '-s') { $soft = 1; }
- elsif ($i eq '-fs' || $i eq '-sf') { $force = $soft = 1; }
- else { last }
- }
+ my ($force, $soft) = getopts(\@_, qw(fs));
+ @_ >= 1 or die "usage: ln [-s] [-f] <source> [<dest>]\n";
- my $source = $i or die "usage: ln [-s] [-f] <source> [<dest>]\n";
- my $dest = shift || basename($source);
+ my ($source, $dest) = @_;
+ $dest ||= basename($source);
$force and unlink $dest;
-
($soft ? symlink($source, $dest) : link($source, $dest)) or die "ln failed: $!\n";
}
-sub rm {
- my $rec; $_[0] eq '-r' and $rec = shift;
-
+sub rm {
+ my ($rec, undef) = getopts(\@_, qw(rf));
+
my $rm; $rm = sub {
foreach (@_) {
- if (-d $_) {
+ if (!-l $_ && -d $_) {
$rec or die "$_ is a directory\n";
&$rm(glob_($_));
rmdir $_ or die "can't remove directory $_: $!\n";
@@ -126,7 +144,7 @@ sub rm {
&$rm(@_);
}
-sub chmod_ {
+sub chmod_ {
@_ >= 2 or die "usage: chmod <mode> <files>\n";
my $mode = shift;
@@ -136,7 +154,7 @@ sub chmod_ {
}
sub chown_ {
- my $rec; $_[0] eq '-r' and $rec = shift;
+ my ($rec, undef) = getopts(\@_, qw(r));
local $_ = shift or die "usage: chown [-r] name[.group] <files>\n";
my ($name, $group) = (split('\.'), $_);
@@ -154,20 +172,18 @@ sub chown_ {
sub mkswap {
@_ == 1 or die "mkswap <device>\n";
-
- require 'swap.pm';
+ require swap;
swap::enable($_[0], 0);
}
sub swapon {
@_ == 1 or die "swapon <file>\n";
-
- require 'swap.pm';
+ require swap;
swap::swapon($_[0]);
}
sub swapoff {
@_ == 1 or die "swapoff <file>\n";
- require 'swap.pm';
+ require swap;
swap::swapoff($_[0]);
}
@@ -192,25 +208,29 @@ sub rights {
$types[$_[0] >> 12 & 0xf] . $r;
}
+sub displaySize {
+ my $m = $_[0] >> 12;
+ $m == 4 || $m == 8 || $m == 10;
+}
+
sub ls {
my ($l , $h) = getopts(\@_, qw(lh));
$h and die "usage: ls [-l] <files...>\n";
@_ or @_ = '.';
@_ == 1 && -d $_[0] and @_ = glob_($_[0]);
- foreach (sort @_) {
+ foreach (sort @_) {
if ($l) {
my @s = lstat or warn("can't stat file $_\n"), next;
formline(
"@<<<<<<<<< @<<<<<<< @<<<<<<< @>>>>>>>> @>>>>>>>>>>>>>>> @*\n",
rights($s[2]), getpwuid $s[4] || $s[4], getgrgid $s[5] || $s[5],
- $s[6] ? join ", ", unmakedev($s[6]) : $s[7],
- scalar localtime $s[9], -l $_ ? "$_ -> " . readlink $_ : $_);
+ displaySize($s[2]) ? $s[7] : join(", ", unmakedev($s[6])),
+ scalar localtime $s[9], -l $_ ? "$_ -> " . readlink $_ : $_);
print $^A; $^A = '';
} else { print "$_\n"; }
}
}
-
sub cp {
my ($force) = getopts(\@_, qw(f));
@_ >= 2 or die "usage: cp [-f] <sources> <dest>\n(this cp does -Rl by default)\n";
@@ -233,12 +253,16 @@ sub cp {
-d $dest or mkdir $dest, mode($src) or die "mkdir: can't create directory $dest: $!\n";
&$cp(glob_($src), $dest);
} elsif (-l $src) {
- symlink((readlink($src) || die "readlink failed: $!"), $dest) or die "symlink: can't create symlink $dest: $!\n";
+ unless (symlink((readlink($src) || die "readlink failed: $!"), $dest)) {
+ my $msg = "symlink: can't create symlink $dest: $!\n";
+ $force ? warn $msg : die $msg;
+ }
} else {
local (*F, *G);
open F, $src or die "can't open $src for reading: $!\n";
open G, "> $dest" or $force or die "can't create $dest : $!\n";
- foreach (<F>) { print G $_ }
+ local $_;
+ while (<F>) { print G $_ }
chmod mode($src), $dest;
}
}
@@ -248,29 +272,37 @@ sub cp {
sub ps {
@_ and die "usage: ps\n";
- my ($pid, $cmd);
+ my ($pid, $rss, $cpu, $cmd);
+ my ($uptime) = split ' ', first(cat_("/proc/uptime"));
+ my $hertz = 100;
- local (*STDOUT_TOP, *STDOUT);
- format STDOUT_TOP =
- PID CMD
+ require c;
+ my $page = c::getpagesize() / 1024;
+
+ open PS, ">&STDOUT";
+ format PS_TOP =
+ PID RSS %CPU CMD
.
- format =
-@>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$pid, $cmd
+ format PS =
+@>>>> @>>>> @>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+$pid, $rss, $cpu, $cmd
.
-
foreach $pid (sort {$a <=> $b} grep { /\d+/ } all('/proc')) {
- (($cmd) = cat_("/proc/$pid/cmdline")) =~ s/\0/ /g;
- $cmd ||= (split ' ', (cat_("/proc/$pid/stat"))[0])[1];
- write STDOUT
+ my @l = split(' ', cat_("/proc/$pid/stat"));
+ $cpu = sprintf "%2.1f", max(0, min(99, ($l[13] + $l[14]) * 100 / $hertz / ($uptime - $l[21] / $hertz)));
+ $rss = (split ' ', cat_("/proc/$pid/stat"))[23] * $page;
+ (($cmd) = cat_("/proc/$pid/cmdline")) =~ s/\0/ /g;
+ $cmd ||= (split ' ', (cat_("/proc/$pid/stat"))[0])[1];
+ write PS;
}
}
sub dd {
- my $u = "usage: dd [-h] [if=<file>] [of=<file>] [bs=<number>] [count=<number>]\n";
- (getopts(\@_, qw(h)))[0] and die $u;
- my %h = (if => \*STDIN, of => \*STDOUT, bs => 512, count => undef);
+ my $u = "usage: dd [-h] [-p] [if=<file>] [of=<file>] [bs=<number>] [count=<number>]\n";
+ my ($help, $percent) = getopts(\@_, qw(hp));
+ die $u if $help;
+ my %h = (if => *STDIN, of => *STDOUT, bs => 512, count => undef);
foreach (@_) {
/(.*?)=(.*)/ && exists $h{$1} or die $u;
$h{$1} = $2;
@@ -279,29 +311,29 @@ sub dd {
ref $h{if} eq 'GLOB' ? *IF = $h{if} : sysopen(IF, $h{if}, 0 ) || die "error: can't open file $h{if}\n";
ref $h{of} eq 'GLOB' ? *OF = $h{of} : sysopen(OF, $h{of}, 0x41) || die "error: can't open file $h{of}\n";
- $h{bs} =~ /(\d+)k$/ and $h{bs} = $1 * 1024;
- $h{bs} =~ /(\d+)M$/ and $h{bs} = $1 * 1024 * 1024;
- $h{bs} =~ /(\d+)G$/ and $h{bs} = $1 * 1024 * 1024 * 1024;
+ $h{bs} = removeXiBSuffix($h{bs});
for ($nb = 0; !$h{count} || $nb < $h{count}; $nb++) {
+ printf "\r%02.1d%%", 100 * $nb / $h{count} if $h{count} && $percent;
$read = sysread(IF, $tmp, $h{bs}) or $h{count} ? die "error: can't read block $nb\n" : last;
syswrite(OF, $tmp) or die "error: can't write block $nb\n";
$read < $h{bs} and $read = 1, last;
}
- print STDERR "$nb+$read records in\n";
- print STDERR "$nb+$read records out\n";
+ print STDERR "\r$nb+$read records in\n";
+ print STDERR "$nb+$read records out\n";
}
sub head_tail {
my ($h, $n) = getopts(\@_, qw(hn));
$h || @_ > 1 + bool($n) and die "usage: $0 [-h] [-n lines] [<file>]\n";
$n = $n ? shift : 10;
- local *F; @_ ? open(F, $_[0]) || die "error: can't open file $_[0]\n" : (*F = \*STDIN);
+ local *F; @_ ? open(F, $_[0]) || die "error: can't open file $_[0]\n" : (*F = *STDIN);
+ local $_;
if ($0 eq 'head') {
- foreach (<F>) { $n-- or return; print }
+ while (<F>) { $n-- or return; print }
} else {
- @_ = (); foreach (<F>) { push @_, $_; @_ > $n and shift; }
+ @_ = (); while (<F>) { push @_, $_; @_ > $n and shift; }
print @_;
}
}
@@ -313,7 +345,7 @@ sub strings {
$h and die "usage: strings [-o] [-n min-length] [<files>]\n";
$n = $n ? shift : 4;
$/ = "\0"; @ARGV = @_; my $l = 0; while (<>) {
- while (/[$printable_chars]\{$n,}/og) {
+ while (/[$printable_chars]{$n,}/og) {
printf "%07d ", ($l + length $') if $o;
print "$&\n" ;
}
@@ -324,20 +356,20 @@ sub strings {
sub hexdump {
my $i = 0; $/ = \16; @ARGV = @_; while (<>) {
printf "%08lX ", $i; $i += 16;
- print join(" ", map({ sprintf "%02X", $_ } unpack("C*", $_)),
- ($_ =~ s/[^$printable_chars]/./og, $_)[1]), "\n";
+ print join(" ", (map { sprintf "%02X", $_ } unpack("C*", $_)),
+ ($_ =~ s/[^$printable_chars]/./og, $_)[1]), "\n";
}
}
-sub more {
+sub more {
@ARGV = @_;
- require 'devices.pm';
+ require devices;
my $tty = devices::make('tty');
- local *IN; open IN, "<$tty" or die "can't open $tty\n";
- my $n = 0; while (<>) {
- ++$n == 25 and $n = <IN>, $n = 0;
- print
- }
+ local *IN; open IN, "<$tty" or die "can't open $tty\n";
+ my $n = 0; while (<>) {
+ ++$n == 25 and $n = <IN>, $n = 0;
+ print
+ }
}
sub pack_ {
@@ -351,7 +383,7 @@ sub pack_ {
local *F;
open F, $_ or die "can't read file $_: $!\n";
- while (read F, $t, $BUFFER_SIZE) { print $t; }
+ while (read F, $t, $BUFFER_SIZE) { print $t; }
}
}
}
@@ -370,7 +402,7 @@ sub unpack_ {
print "$filename\n";
my $dir = dirname($filename);
-d $dir or mkdir_('-p', $dir);
-
+
local *G;
open G, "> $filename" or die "can't write file $filename: $!\n";
while ($size) {
@@ -379,3 +411,192 @@ sub unpack_ {
}
}
}
+
+sub insmod {
+ my ($h) = getopts(\@_, qw(h));
+ $h || @_ == 0 and die "usage: insmod <module> [options]\n";
+ my $f = local $_ = shift;
+
+ require run_program;
+
+ #- try to install the module if it exist else extract it from archive.
+ #- needed for cardmgr.
+ unless (-r $f) {
+ $_ = $1 if m@.*/([^/]*)\.o@;
+ unless (-r ($f = "/lib/modules/$_.o")) {
+ $f = "/tmp/$_.o";
+ my $cz = "/lib/modules" . (arch() eq 'sparc64' && "64") . ".cz"; -e $cz or $cz .= "2";
+ if (-e $cz) {
+ run_program::run("packdrake -x $cz /tmp $_.o");
+ } elsif (-e "/lib/modules.cpio.bz2") {
+ run_program::run("cd /tmp ; bzip2 -cd /lib/modules.cpio.bz2 | cpio -i $_.o");
+ } else {
+ die "unable to find an archive for modules";
+ }
+ }
+ }
+ -r $f or die "can't find module $_";
+ run_program::run(["insmod_", "insmod"], "-f", $f, @_) or die("insmod $_ failed");
+ unlink $f;
+}
+
+sub modprobe {
+ my ($h) = getopts(\@_, qw(h));
+ $h || @_ == 0 and die "usage: modprobe <module> [options]\n";
+ my $name = shift;
+ require modules;
+ modules::load_deps("/modules/modules.dep");
+ modules::load($name, '', @_);
+}
+
+sub route {
+ @_ == 0 or die "usage: route\nsorry, no modification handled\n";
+ my ($titles, @l) = cat_("/proc/net/route");
+ my @titles = split ' ', $titles;
+ my %l;
+ open ROUTE, ">&STDOUT";
+ format ROUTE_TOP =
+Destination Gateway Mask Iface
+.
+ format ROUTE =
+@<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<
+$l{Destination}, $l{Gateway}, $l{Mask}, $l{Iface}
+.
+ foreach (@l) {
+ /^\s*$/ and next;
+ @l{@titles} = split;
+ $_ = join ".", reverse map { hex } unpack "a2a2a2a2", $_ foreach @l{qw(Destination Gateway Mask)};
+ $l{Destination} = 'default' if $l{Destination} eq "0.0.0.0";
+ $l{Gateway} = '*' if $l{Gateway} eq "0.0.0.0";
+ write ROUTE;
+ }
+}
+
+sub df {
+ my ($h) = getopts(\@_, qw(h));
+ my ($dev, $size, $free, $used, $use, $mntpoint);
+ open DF, ">&STDOUT";
+ format DF_TOP =
+Filesystem Size Used Avail Use Mounted on
+.
+ format DF =
+@<<<<<<<<<<<<<<<< @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>% @<<<<<<<<<<<<<<<<<<<<<<<<<
+$dev, $size, $used, $free, $use, $mntpoint
+.
+ my %h;
+ foreach (cat_("/proc/mounts"), cat_("/etc/mtab")) {
+ ($dev, $mntpoint) = split;
+ $h{$dev} = $mntpoint;
+ }
+ foreach $dev (sort keys %h) {
+ ($size, $free) = common::df($mntpoint = $h{$dev});
+ $size or next;
+
+ $use = int (100 * ($size - $free) / $size);
+ $used = $size - $free;
+ if ($h) {
+ $used = int ($used / 1024) . "M";
+ $size = int ($size / 1024) . "M";
+ $free = int ($free / 1024) . "M";
+ }
+ write DF if $size;
+ }
+}
+
+sub kill {
+ my $signal = 15;
+ @_ or die "usage: kill [-<signal>] pids\n";
+ $signal = (shift, $1)[1] if $_[0] =~ /^-(.*)/;
+ kill $signal, @_ or die "kill failed: $!\n";
+}
+
+sub lspci {
+ require detect_devices;
+ print join "\n", detect_devices::stringlist(), '';
+}
+*lssbus = *lspci;
+
+sub dmesg { print cat_("/tmp/syslog"); }
+
+sub sort {
+ my ($n, $h) = getopts(\@_, qw(nh));
+ $h and die "usage: sort [-n] [<file>]\n";
+ local *F; @_ ? open(F, $_[0]) || die "error: can't open file $_[0]\n" : (*F = *STDIN);
+ if ($n) {
+ print sort { $a <=> $b } <F>;
+ } else {
+ print sort <F>;
+ }
+}
+
+sub du {
+ my ($s, $h) = getopts(\@_, qw(sh));
+ $h || !$s and die "usage: du -s [<directories>]\n";
+
+ my $f; $f = sub {
+ my ($e) = @_;
+ my $s = (lstat($e))[12];
+ $s += sum map { &$f($_) } glob_("$e/*") if !-l $e && -d $e;
+ $s;
+ };
+ print &$f($_) >> 1, "\t$_\n" foreach @_ ? @_ : glob_("*");
+}
+
+sub install_cpio($$;@) {
+ my ($dir, $name, @more) = @_;
+
+ return "$dir/$name" if -e "$dir/$name";
+
+ my $cpio = "$dir.cpio.bz2";
+ -e $cpio or return;
+
+ eval { rm("-r", $dir) };
+ mkdir $dir, 0755;
+ require run_program;
+
+ my $more = join " ", map { $_ && "$_ $_/*" } @more;
+ run_program::run("cd $dir ; bzip2 -cd $cpio | cpio -id $name $name/* $more");
+
+ "$dir/$name";
+}
+
+sub bug {
+ my ($h) = getopts(\@_, "h");
+ $h and die "usage: bug\nput file report.bug on fat formatted floppy\n";
+
+ require detect_devices;
+ mount devices::make(detect_devices::floppy()), "/fd0";
+
+ sub header { "
+********************************************************************************
+* $_[0]
+********************************************************************************";
+ }
+
+ local $\ = "\n";
+ output "/fd0/report.bug", map { chomp; $_ }
+ header("lspci"), detect_devices::stringlist(),
+ header("pci_devices"), cat_("/proc/bus/pci/devices"),
+ header("fdisk"), `fdisk -l`,
+ header("scsi"), cat_("/proc/scsi/scsi"),
+ header("lsmod"), cat_("/proc/modules"),
+ header("cmdline"), cat_("/proc/cmdline"),
+ header("pcmcia: stab"), cat_("/var/run/stab"),
+ header("usb"), cat_("/proc/bus/usb/devices"),
+ header("partitions"), cat_("/proc/partitions"),
+ header("cpuinfo"), cat_("/proc/cpuinfo"),
+ header("syslog"), cat_("/tmp/syslog"),
+ header("ddcxinfos"), `ddcxinfos`,
+ header("ddebug.log"), cat_("/tmp/ddebug.log"),
+ header("install.log"), cat_("/mnt/root/install.log"),
+ ;
+ umount "/fd0";
+ sync;
+}
+
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1; #
+
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 6c12961ef..2b85f8032 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -1,58 +1,298 @@
-package common;
+package common; # $Id$
use diagnostics;
use strict;
-use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int $error $cancel $SECTORSIZE);
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int $cancel $SECTORSIZE %compat_arch);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- common => [ qw(min max bool member divide error cancel is_empty_array_ref round_up round_down first top) ],
- file => [ qw(dirname basename all glob_ cat_ chop_ mode) ],
- system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_) ],
- constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE) ],
+ common => [ qw(__ even odd arch better_arch compat_arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref next_val_in_array) ],
+ functional => [ qw(fold_left compose mapgrep map_index grep_index find_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ],
+ file => [ qw(dirname basename touch all glob_ cat_ cat__ output symlinkf chop_ mode typeFromMagic expand_symlinks) ],
+ system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInShMode setVarsInCsh substInFile availableMemory availableRamMB removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual) ],
+ constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE %compat_arch) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
+
+#-#####################################################################################
+#- Globals
+#-#####################################################################################
$printable_chars = "\x20-\x7E";
-$sizeof_int = psizeof("i");
-$bitof_int = $sizeof_int * 8;
-$error = 0;
-$cancel = 0;
-$SECTORSIZE = 512;
+$sizeof_int = psizeof("i");
+$bitof_int = $sizeof_int * 8;
+$SECTORSIZE = 512;
+%compat_arch = ( #- compatibilty arch mapping.
+ 'noarch' => undef,
+ 'i386' => 'noarch',
+ 'i486' => 'i386',
+ 'i586' => 'i486',
+ 'i686' => 'i586',
+ 'i786' => 'i686',
+ 'k6' => 'i586',
+ 'k7' => 'k6',
+ 'k8' => 'k7',
+ 'ppc' => 'noarch',
+ 'alpha' => 'noarch',
+ 'sparc' => 'noarch',
+ 'sparc32' => 'sparc',
+ 'sparc64' => 'sparc32',
+ );
+
+#-#####################################################################################
+#- Functions
+#-#####################################################################################
-1;
+sub fold_left(&@) {
+ my $f = shift;
+ local $a = shift;
+ foreach $b (@_) { $a = &$f() }
+ $a
+}
-sub min { my $min = shift; grep { $_ < $min and $min = $_; } @_; $min }
-sub max { my $max = shift; grep { $_ > $max and $max = $_; } @_; $max }
+sub _ {
+ my $s = shift @_; my $t = translate($s);
+ $t && ref $t or return sprintf $t, @_;
+ my ($T, @p) = @$t;
+ sprintf $T, @_[@p];
+}
+#-delete $main::{'_'};
+sub __ { $_[0] }
+sub even($) { $_[0] % 2 == 0 }
+sub odd($) { $_[0] % 2 == 1 }
+sub min { fold_left { $a < $b ? $a : $b } @_ }
+sub max { fold_left { $a > $b ? $a : $b } @_ }
+sub sum { fold_left { $a + $b } @_ }
+sub and_{ fold_left { $a && $b } @_ }
+sub or_ { fold_left { $a || $b } @_ }
+sub sqr { $_[0] * $_[0] }
+sub sign { $_[0] <=> 0 }
+sub product { fold_left { $a * $b } @_ }
sub first { $_[0] }
-sub top { $_[$#_] }
+sub second { $_[1] }
+sub top { $_[-1] }
+sub uniq { my %l; @l{@_} = (); keys %l }
+sub to_int { $_[0] =~ /(\d*)/; $1 }
+sub to_float { $_[0] =~ /(\d*(\.\d*)?)/; $1 }
+sub ikeys { my %l = @_; sort { $a <=> $b } keys %l }
+sub add2hash($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } $a }
+sub add2hash_($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } $a }
sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }
sub dirname { @_ == 1 or die "usage: dirname <name>\n"; local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' }
sub basename { @_ == 1 or die "usage: basename <name>\n"; local $_ = shift; s|/*\s*$||; s|.*/||; $_ }
-sub error { $error = 1; 0 }
-sub cancel { $cancel = 1; 0 }
-sub bool { $_[0] ? 1 : 0 }
+sub bool($) { $_[0] ? 1 : 0 }
+sub invbool { my $a = shift; $$a = !$$a; $$a }
+sub listlength { scalar @_ }
+sub bool2text { $_[0] ? "true" : "false" }
+sub bool2yesno { $_[0] ? "yes" : "no" }
+sub text2bool { my $t = lc($_[0]); $t eq "true" || $t eq "yes" ? 1 : 0 }
sub strcpy { substr($_[0], $_[2] || 0, length $_[1]) = $_[1] }
-sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; @l }
+sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l }
+sub cat__ { my ($f) = @_; my @l = <$f>; wantarray ? @l : join '', @l }
+sub output { my $f = shift; local *F; open F, ">$f" or die "output in file $f failed: $!\n"; print F foreach @_; }
+sub deref { ref $_[0] eq "ARRAY" ? @{$_[0]} : ref $_[0] eq "HASH" ? %{$_[0]} : $_[0] }
+sub linkf { unlink $_[1]; link $_[0], $_[1] }
+sub symlinkf { unlink $_[1]; symlink $_[0], $_[1] }
sub chop_ { map { my $l = $_; chomp $l; $l } @_ }
sub divide { my $d = int $_[0] / $_[1]; wantarray ? ($d, $_[0] % $_[1]) : $d }
-sub round_up { my ($i, $r) = @_; $i += $r - ($i + $r - 1) % $r - 1; }
-sub round_down { my ($i, $r) = @_; $i -= $i % $r; }
+sub round { int ($_[0] + 0.5) }
+sub round_up { my ($i, $r) = @_; $i = int $i; $i += $r - ($i + $r - 1) % $r - 1; }
+sub round_down { my ($i, $r) = @_; $i = int $i; $i -= $i % $r; }
sub is_empty_array_ref { my $a = shift; !defined $a || @$a == 0 }
+sub is_empty_hash_ref { my $a = shift; !defined $a || keys(%$a) == 0 }
+sub difference2 { my %l; @l{@{$_[1]}} = (); grep { !exists $l{$_} } @{$_[0]} }
+sub intersection { my (%l, @m); @l{@{shift @_}} = (); foreach (@_) { @m = grep { exists $l{$_} } @$_; %l = (); @l{@m} = (); } keys %l }
+
+sub set_new(@) { my %l; @l{@_} = undef; { list => [ @_ ], hash => \%l } }
+sub set_add($@) { my $o = shift; foreach (@_) { exists $o->{hash}{$_} and next; push @{$o->{list}}, $_; $o->{hash}{$_} = undef } }
sub sync { syscall_('sync') }
-sub gettimeofday { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die "gettimeofday: $!\n"; unpack("LL", $t) }
+sub gettimeofday { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die "gettimeofday failed: $!\n"; unpack("LL", $t) }
+sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ }
sub remove_spaces { local $_ = shift; s/^ +//; s/ +$//; $_ }
sub mode { my @l = stat $_[0] or die "unable to get mode of file $_[0]: $!\n"; $l[2] }
sub psizeof { length pack $_[0] }
+sub concat_symlink {
+ my ($f, $l) = @_;
+ $l =~ m|^\.\./(/.*)| and return $1;
+
+ $f =~ s|/$||;
+ while ($l =~ s|^\.\./||) {
+ $f =~ s|/[^/]+$|| or die "concat_symlink: $f $l\n";
+ }
+ "$f/$l";
+}
+
+sub expand_symlinks {
+ my ($first, @l) = split '/', $_[0];
+ $first eq '' or die "expand_symlinks: $_[0] is relative\n";
+ my ($f, $l);
+ foreach (@l) {
+ $f .= "/$_";
+ $f = concat_symlink($f, "../$l") while $l = readlink $f;
+ }
+ $f;
+}
+
+sub arch() {
+ require c;
+ c::kernel_arch();
+}
+sub better_arch {
+ my ($new, $old) = @_;
+ while ($new && $new ne $old) { $new = $compat_arch{$new} }
+ $new;
+}
+sub compat_arch { better_arch(arch(), $_[0]) }
+
+sub touch {
+ my ($f) = @_;
+ unless (-e $f) {
+ local *F;
+ open F, ">$f";
+ }
+ my $now = time;
+ utime $now, $now, $f;
+}
+
+sub mapgrep(&@) {
+ my $f = shift;
+ my @l;
+ foreach (@_) {
+ my ($b, $v) = $f->($_);
+ push @l, $v if $b;
+ }
+ @l;
+}
+
+sub map_index(&@) {
+ my $f = shift;
+ my @v; local $::i = 0;
+ map { @v = &$f($::i); $::i++; @v } @_;
+}
+sub grep_index(&@) {
+ my $f = shift;
+ my $v; local $::i = 0;
+ grep { $v = &$f($::i); $::i++; $v } @_;
+}
+sub find_index(&@) {
+ my $f = shift;
+ local $_;
+ for (my $i = 0; $i < @_; $i++) {
+ $_ = $_[$i];
+ &$f and return $i;
+ }
+ die "find_index failed in @_";
+}
+
+sub map_each(&%) {
+ my ($f, %h) = @_;
+ my @l;
+ local ($::a, $::b);
+ while (($::a, $::b) = each %h) { push @l, &$f($::a, $::b) }
+ @l;
+}
+sub grep_each(&%) {
+ my ($f, %h) = @_;
+ my %l;
+ local ($::a, $::b);
+ while (($::a, $::b) = each %h) { $l{$::a} = $::b if &$f($::a, $::b) }
+ %l;
+}
+sub list2kv(@) { [ grep_index { even($::i) } @_ ], [ grep_index { odd($::i) } @_ ] }
+
+sub combine {
+ my $nb = shift;
+ my @l; while (my @m = splice(@_, 0, $nb)) { push @l, \@m }
+ @l;
+}
+
+#- pseudo-array-hash :)
+sub map_tab_hash(&$@) {
+ my ($f, $fields, @tab_hash) = @_;
+ my %hash;
+ my $key = { map_index {($_, $::i + 1)} @{$fields} };
+
+ for (my $i = 0; $i < @tab_hash; $i += 2) {
+ my $h = [$key, @{$tab_hash[$i + 1]}];
+ &$f($i, $h) if $f;
+ $hash{ $tab_hash[$i] } = $h;
+ }
+ %hash;
+}
+
+sub smapn {
+ my $f = shift;
+ my $n = shift;
+ my @r = ();
+ for (my $i = 0; $i < $n; $i++) { push @r, &$f(map { $_->[$i] } @_); }
+ @r
+}
+sub mapn(&@) {
+ my $f = shift;
+ smapn($f, min(map { scalar @$_ } @_), @_);
+}
+sub mapn_(&@) {
+ my $f = shift;
+ smapn($f, max(map { scalar @$_ } @_), @_);
+}
+
+
+sub add_f4before_leaving {
+ my ($f, $b, $name) = @_;
+
+ unless ($common::before_leaving::{$name}) {
+ no strict 'refs';
+ ${"common::before_leaving::$name"} = 1;
+ ${"common::before_leaving::list"} = 1;
+ }
+ local *N = *{$common::before_leaving::{$name}};
+ my $list = *common::before_leaving::list;
+ $list->{$b}{$name} = $f;
+ *N = sub {
+ my $f = $list->{$_[0]}{$name} or die '';
+ $name eq 'DESTROY' and delete $list->{$_[0]};
+ goto $f;
+ } unless defined &{*N};
+
+}
+
+#- ! the functions are not called in the order wanted, in case of multiple before_leaving :(
+sub before_leaving(&) {
+ my ($f) = @_;
+ my $b = bless {}, 'common::before_leaving';
+ add_f4before_leaving($f, $b, 'DESTROY');
+ $b;
+}
+
+sub catch_cdie(&&) {
+ my ($f, $catch) = @_;
+
+ local @common::cdie_catches;
+ unshift @common::cdie_catches, $catch;
+ &$f();
+}
+
+sub cdie($;&) {
+ my ($err, $f) = @_;
+ foreach (@common::cdie_catches) {
+ $@ = $err;
+ &{$_}(\$err) and return;
+ }
+ die $err;
+}
+
sub all {
my $d = shift;
local *F;
- opendir F, $d or die "all: can't opendir $d: $!\n";
- grep { $_ ne '.' && $_ ne '..' } readdir F;
+ opendir F, $d or return;
+ my @l = grep { $_ ne '.' && $_ ne '..' } readdir F;
+ closedir F;
+
+ @l;
}
sub glob_ {
@@ -62,7 +302,7 @@ sub glob_ {
($f = quotemeta $f) =~ s/\\\*/.*/g;
$d =~ m|/$| or $d .= '/';
- map { $d eq './' ? $_ : "$d$_" } grep { /$f/ } all($d);
+ map { $d eq './' ? $_ : "$d$_" } grep { /^$f$/ } all($d);
}
@@ -73,12 +313,330 @@ sub syscall_ {
syscall(&{$common::{"SYS_$f"}}, @_) == 0;
}
-
-sub crypt_ {
- local $_ = (gettimeofday())[1] % 0x40;
+sub salt($) {
+ my ($nb) = @_;
+ require 'devices.pm';
+ open F, devices::make("random") or die "missing random";
+ my $s; read F, $s, $nb;
+ local $_ = pack "b8" x $nb, unpack "b6" x $nb, $s;
tr [\0-\x3f] [0-9a-zA-Z./];
- crypt($_[0], $_)
+ $_;
}
sub makedev { ($_[0] << 8) | $_[1] }
sub unmakedev { $_[0] >> 8, $_[0] & 0xff }
+
+sub list_passwd() {
+ my (@l, @e);
+ setpwent();
+ while (@e = getpwent()) { push @l, [ @e ] }
+ endpwent();
+ @l;
+}
+sub list_home() {
+ map { $_->[7] } grep { $_->[2] >= 500 } list_passwd();
+}
+sub list_skels {
+ my ($prefix, $suffix) = @_;
+ grep { -d $_ && -w $_ } map { "$prefix$_/$suffix" } '/etc/skel', '/root', list_home() }
+
+sub translate {
+ my ($s) = @_;
+ my ($lang) = $ENV{LANGUAGE} || $ENV{LC_MESSAGES} || $ENV{LC_ALL} || $ENV{LANG} || 'en';
+
+ require lang;
+ foreach (split ':', $lang) {
+ lang::load_po($_) unless defined $po::I18N::{$_};
+ if (%{$po::I18N::{$_}}) {
+ return if $s eq '_I18N_';
+ return ${$po::I18N::{$_}}{$s} || $s
+ }
+ }
+ $s;
+}
+
+sub untranslate($@) {
+ my $s = shift || return;
+ foreach (@_) { translate($_) eq $s and return $_ }
+ die "untranslate failed";
+}
+
+sub warp_text($;$) {
+ my ($text, $width) = @_;
+ $width ||= 80;
+
+ my @l;
+ foreach (split "\n", $text) {
+ my $t = '';
+ foreach (split /\s+/, $_) {
+ if (length "$t $_" > $width) {
+ push @l, $t;
+ $t = $_;
+ } else {
+ $t = "$t $_";
+ }
+ }
+ push @l, $t;
+ }
+ @l;
+}
+
+sub formatAlaTeX($) {
+ my ($t, $tmp);
+ foreach (split "\n", $_[0]) {
+ if (/^$/) {
+ $t .= ($t && "\n") . $tmp;
+ $tmp = '';
+ } else {
+ $tmp = ($tmp && "$tmp ") . first(/^\s*(.*?)\s*$/);
+ }
+ }
+ $t . ($t && $tmp && "\n") . $tmp;
+}
+
+sub formatLines($) {
+ my ($t, $tmp);
+ foreach (split "\n", $_[0]) {
+ if (/^\s/) {
+ $t .= "$tmp\n";
+ $tmp = $_;
+ } else {
+ $tmp = ($tmp ? "$tmp " : ($t && "\n") . $tmp) . $_;
+ }
+ }
+ "$t$tmp\n";
+}
+
+sub getVarsFromSh($) {
+ my %l;
+ local *F; open F, $_[0] or return;
+ local $_;
+ while (<F>) {
+ my ($v, $val, $val2) =
+ /^\s* # leading space
+ (\w+) = # variable
+ (
+ "([^"]*)" # double-quoted text
+ | '([^']*)' # single-quoted text
+ | [^'"\s]+ # normal text
+ )
+ \s*$ # end of line
+ /x or next;
+ $l{$v} = $val2 || $val;
+ }
+ %l;
+}
+
+sub setVarsInSh {
+ my ($file, $l, @fields) = @_;
+ setVarsInShMode($file, 0777 ^ umask(), $l, @fields);
+}
+
+sub setVarsInShMode {
+ my ($file, $mod, $l, @fields) = @_;
+ @fields = keys %$l unless @fields;
+
+ local *F;
+ open F, "> $file" or die "cannot create config file $file";
+ chmod $mod, $file;
+ $l->{$_} and print F "$_=$l->{$_}\n" foreach @fields;
+}
+
+sub setVarsInCsh {
+ my ($file, $l, @fields) = @_;
+ @fields = keys %$l unless @fields;
+
+ local *F;
+ open F, "> $_[0]" or die "cannot create config file $file";
+ $l->{$_} and print F "setenv $_ $l->{$_}\n" foreach @fields;
+}
+
+sub template2file {
+ my ($in, $out, %toreplace) = @_;
+ output $out, map { s/@@@(.*?)@@@/$toreplace{$1}/g; $_ } cat_($in);
+}
+sub template2userfile {
+ my ($prefix, $in, $out_rel, $force, %toreplace) = @_;
+
+ foreach (list_skels($prefix, $out_rel)) {
+ -d dirname($_) or !-e $_ or $force or next;
+
+ template2file($in, $_, %toreplace);
+ m|/home/(.+?)/| and chown(getpwnam($1), getgrnam($1), $_);
+ }
+}
+sub update_userkderc {
+ my ($file, $category, %subst) = @_;
+
+ output $file,
+ (map {
+ my $l = $_;
+ s/^\s*//;
+ if (my $i = /^\[$category\]/i ... /^\[/) {
+ if ($i =~ /E/) { #- for last line of category
+ $l = join('', map_each { "$::a=$::b\n" } %subst) . $l;
+ %subst = ();
+ } elsif (/^(\w*?)=/) {
+ if (my $e = delete $subst{lc($1)}) {
+ $l = "$1=$e\n";
+ }
+ }
+ }
+ $l;
+ } cat_($file)),
+ (%subst && "[$category]\n", map_each { "$::a=$::b\n" } %subst); #- if category has not been found above.
+}
+
+sub substInFile(&@) {
+ my $f = shift;
+ foreach my $file (@_) {
+ if (-e $file) {
+ local @ARGV = $file;
+ local ($^I, $_) = '';
+ while (<>) { &$f($_); print }
+ } else {
+ local *F; my $old = select F; # that way eof return true
+ local $_ = '';
+ &$f($_);
+ select $old;
+ eval { output($file, $_) };
+ }
+ }
+}
+
+sub best_match {
+ my ($str, @lis) = @_;
+ my @words = split /\W+/, $str;
+ my ($max, $res) = 0;
+
+ foreach (@lis) {
+ my $count = 0;
+ foreach my $i (@words) {
+ $count++ if /$i/i;
+ }
+ $max = $count, $res = $_ if $count >= $max;
+ }
+ $res;
+}
+
+sub bestMatchSentence {
+
+ my $best = -1;
+ my $bestSentence;
+ my @s = split /\W+/, shift;
+ foreach (@_) {
+ my $count = 0;
+ foreach my $e (@s) {
+ $count++ if /$e/i;
+ }
+ $best = $count, $bestSentence = $_ if $count > $best;
+ }
+ $bestSentence;
+}
+
+# count the number of character that match
+sub bestMatchSentence2 {
+
+ my $best = -1;
+ my $bestSentence;
+ my @s = split /\W+/, shift;
+ foreach (@_) {
+ my $count = 0;
+ foreach my $e (@s) {
+ $count+= length ($e) if /$e/i;
+ }
+ $best = $count, $bestSentence = $_ if $count > $best;
+ }
+ $bestSentence;
+}
+
+sub typeFromMagic($@) {
+ my $f = shift;
+ local *F; sysopen F, $f, 0 or return;
+
+ my $tmp;
+ M: foreach (@_) {
+ my ($name, @l) = @$_;
+ while (@l) {
+ my ($offset, $signature) = splice(@l, 0, 2);
+ sysseek(F, $offset, 0) or next M;
+ sysread(F, $tmp, length $signature);
+ $tmp eq $signature or next M;
+ }
+ return $name;
+ }
+ undef;
+}
+
+sub availableMemory() { sum map { /(\d+)/ } grep { /^(MemTotal|SwapTotal):/ } cat_("/proc/meminfo"); }
+sub availableRamMB() {
+ my $s = 4 * int ((stat("/proc/kcore"))[7] / 1024 / 1024 / 4 + 0.5);
+ #- HACK HACK: if i810 and memsize
+ require detect_devices;
+ return $s - 1 if $s == 128 && grep { $_->{driver} =~ /i810/ } detect_devices::probeall();
+ $s;
+}
+
+sub setVirtual($) {
+ my $vt = '';
+ local *C;
+ sysopen C, "/dev/console", 2 or die "failed to open /dev/console: $!";
+ ioctl(C, c::VT_GETSTATE(), $vt) or die "ioctl VT_GETSTATE failed";
+ ioctl(C, c::VT_ACTIVATE(), $_[0]) or die "ioctl VT_ACTIVATE failed";
+ ioctl(C, c::VT_WAITACTIVE(), $_[0]) or die "ioctl VT_WAITACTIVE failed";
+ unpack "S", $vt;
+}
+
+
+sub removeXiBSuffix($) {
+ local $_ = shift;
+
+ /(\d+)k$/i and return $1 * 1024;
+ /(\d+)M$/i and return $1 * 1024 * 1024;
+ /(\d+)G$/i and return $1 * 1024 * 1024 * 1024;
+ $_;
+}
+
+sub truncate_list {
+ my $nb = shift;
+ @_ <= $nb ? @_ : (@_[0..$nb-1], '...');
+}
+
+sub formatTime {
+ my ($s, $m, $h) = gmtime($_[0]);
+ if ($h) {
+ sprintf "%02d:%02d", $h, $m;
+ } elsif ($m > 1) {
+ _("%d minutes", $m);
+ } elsif ($m == 1) {
+ _("1 minute");
+ } else {
+ _("%d seconds", $s);
+ }
+}
+sub formatTimeRaw {
+ my ($s, $m, $h) = gmtime($_[0]);
+ sprintf "%d:%02d:%02d", $h, $m, $s;
+}
+
+#- return the size of the partition and its free space in KiB
+sub df {
+ my ($mntpoint) = @_;
+ my ($blocksize, $size, $free);
+ my $buf = ' ' x 20000;
+ syscall_('statfs', $mntpoint, $buf) or return;
+ (undef, $blocksize, $size, $free, undef, undef) = unpack "L6", $buf;
+ map { $_ * ($blocksize / 1024) } $size, $free;
+}
+
+sub next_val_in_array {
+ my ($v, $l) = @_;
+ my %l = mapn { @_ } $l, [ @$l[1..$#$l], $l->[0] ];
+ $l{$v};
+}
+
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1; #
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index b9c7046dd..780539cc9 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -1,4 +1,4 @@
-package crypto;
+package crypto; # $Id$
use diagnostics;
use strict;
@@ -8,13 +8,16 @@ use log;
use ftp;
my %mirrors = (
+ "ftp.ucr.ac.cr" => [ "Costa Rica", "/pub/Unix/linux/mandrake/Mandrake" ],
"ftp.nectec.or.th" => [ "Thailand", "/pub/mirrors/Mandrake-crypto" ],
"ftp.tvd.be" => [ "Belgium", "/packages/mandrake-crypto" ],
"sunsite.mff.cuni.cz" => [ "Czech Republic", "/OS/Linux/Dist/Mandrake-crypto" ],
"ftp.uni-kl.de" => [ "Germany", "/pub/linux/mandrake/Mandrake-crypto" ],
+ "ftp.duth.gr" => [ "Grece", "/pub/mandrake-crypto" ],
"ftp.leo.org" => [ "Germany", "/pub/comp/os/unix/linux/Mandrake/Mandrake-crypto" ],
"sunsite.uio.no" => [ "Norway", "/pub/unix/Linux/Mandrake-crypto" ],
"ftp.sunet.se" => [ "Sweden", "/pub/Linux/distributions/mandrake-crypto" ],
+#- "ackbar" => [ "Ackbar", "/crypto", "a", "a" ],
);
my %deps = (
@@ -25,11 +28,38 @@ my %deps = (
sub require2package { $deps{$_[0]} || $_[0] }
sub mirror2text($) { $mirrors{$_[0]} && "$mirrors{$_[0]}[0] ($_[0])" }
-sub mirrorstext() { map { mirror2text($_) } keys %mirrors }
-sub text2mirror($) { first($_[0] =~ /\((.*)\)$/) }
-sub ftp($) { ftp::new($_[0], "$mirrors{$_[0]}[1]/RPMS") }
+sub mirrors() { keys %mirrors }
+sub dir { $mirrors{$_[0]}[1] . '/' . (arch() !~ /i.86/ && ((arch() =~ /sparc/ ? "sparc" : arch()). '/')) . $::VERSION }
+sub ftp($) { ftp::new($_[0], dir($_[0])) }
-sub packages($) { ftp($_[0])->ls }
+sub getFile($$) {
+ my ($file, $host) = @_;
+ $host ||= $crypto::host;
+ log::l("getting crypto file $file on directory " . dir($host) . " with login $mirrors{$host}[2]");
+ my ($ftp, $retr) = ftp::new($host, dir($host),
+ $mirrors{$host}[2] ? $mirrors{$host}[2] : (),
+ $mirrors{$host}[3] ? $mirrors{$host}[3] : ()
+ );
+ $$retr->close if $$retr;
+ $$retr = $ftp->retr($file) or ftp::rewindGetFile();
+ $$retr ||= $ftp->retr($file);
+}
+
+sub getDepslist { getFile("depslist-crypto", $_[0]) or die "unable to get depslist-crypto" }
+
+sub getPackages {
+ my ($prefix, $packages, $mirror) = @_;
+
+ $crypto::host = $mirror;
+
+ #- extract hdlist of crypto, then depslist.
+ require pkgs;
+ pkgs::psUsingHdlist($prefix, '', $packages, "hdlist-crypto.cz2", "crypto.cz2", "Crypto", "Cryptographic site", 1, getFile("hdlist-crypto.cz2", $mirror)) and
+ pkgs::getOtherDeps($packages, getDepslist($mirror));
+
+ #- produce an output suitable for visualization.
+ map { pkgs::packageName($_) } pkgs::packagesOfMedium($packages, "Crypto");
+}
sub get {
my ($mirror, $dir, @files) = @_;
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 8f1fac97d..79bfedb71 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -1,25 +1,33 @@
-package detect_devices;
+package detect_devices; # $Id$
use diagnostics;
use strict;
+#-######################################################################################
+#- misc imports
+#-######################################################################################
use log;
-use common qw(:common :file);
+use common qw(:common :file :functional);
+use devices;
use c;
+#-#####################################################################################
+#- Globals
+#-#####################################################################################
+my @netdevices = map { my $l = $_; map { "$l$_" } (0..3) } qw(eth tr fddi plip);
+my %serialprobe = ();
+my $usb_interface = undef;
-my $scsiDeviceAvailable;
-my $CSADeviceAvailable;
-
-1;
-
+#-######################################################################################
+#- Functions
+#-######################################################################################
sub get {
- # Detect the default BIOS boot harddrive is kind of tricky. We may have IDE,
- # SCSI and RAID devices on the same machine. From what I see so far, the default
- # BIOS boot harddrive will be
- # 1. The first IDE device if IDE exists. Or
- # 2. The first SCSI device if SCSI exists. Or
- # 3. The first RAID device if RAID exists.
+ #- Detect the default BIOS boot harddrive is kind of tricky. We may have IDE,
+ #- SCSI and RAID devices on the same machine. From what I see so far, the default
+ #- BIOS boot harddrive will be
+ #- 1. The first IDE device if IDE exists. Or
+ #- 2. The first SCSI device if SCSI exists. Or
+ #- 3. The first RAID device if RAID exists.
map { &{$_->[0]}() ? &{$_->[1]}() : () }
[ \&hasIDE, \&getIDE ],
@@ -27,52 +35,88 @@ sub get {
[ \&hasDAC960, \&getDAC960 ],
[ \&hasCompaqSmartArray, \&getCompaqSmartArray ];
}
-sub hds() { grep { $_->{type} eq 'hd' } get(); }
-sub cdroms() { grep { $_->{type} eq 'cdrom' } get(); }
+sub hds() { grep { $_->{type} eq 'hd' && ($::isStandalone || !isRemovableDrive($_)) } get(); }
+sub zips() { grep { $_->{type} =~ /.d/ && isZipDrive($_) } get(); }
+sub ide_zips() { grep { $_->{type} =~ /.d/ && isZipDrive($_) } getIDE(); }
+#-sub jazzs() { grep { $_->{type} =~ /.d/ && isJazDrive($_) } get(); }
+sub ls120s() { grep { $_->{type} =~ /.d/ && isLS120Drive($_) } get(); }
+sub usbfdus() { grep { $_->{type} =~ /.d/ && isUSBFDUDrive($_) } get(); }
+sub cdroms() {
+ my @l = grep { $_->{type} eq 'cdrom' } get();
+ if (my @l2 = IDEburners()) {
+ require modules;
+ modules::add_alias('scsi_hostadapter', 'ide-scsi');
+ my $nb = 1 + max(-1, map { $_->{device} =~ /scd (\d+)/x } @l);
+ foreach my $i (@l2) {
+ log::l("IDEBurner: $i->{device}");
+ my ($e) = grep { $_->{device} eq $i->{device} } @l;
+ $e->{device} = "scd" . $nb++;
+ }
+ }
+ @l;
+}
+sub burners { grep { isBurner($_->{device}) } cdroms() }
+sub IDEburners { grep { $_->{type} eq 'cdrom' && isBurner($_->{device}) } getIDE() }
+
+sub floppies() {
+ require modules;
+ my @ide = map { $_->{device} } ls120s() and modules::load("ide-floppy");
+ my @scsi = map { $_->{device} } usbfdus();
+ (@ide, @scsi, grep { tryOpen($_) } qw(fd0 fd1));
+}
+sub floppy { first(floppies()) }
+#- example ls120, model = "LS-120 SLIM 02 UHD Floppy"
+
+sub isBurner { my $f = tryOpen($_[0]); $f && c::isBurner(fileno($f)) }
+sub isZipDrive { $_[0]->{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive.
+#-sub isJazzDrive { $_[0]->{info} =~ /JAZZ?\s+/ } #- untested.
+sub isLS120Drive { $_[0]->{info} =~ /LS-?120|144MB/ }
+sub isUSBFDUDrive { $_[0]->{info} =~ /USB-?FDU/ }
+sub isRemovableDrive { &isZipDrive || &isLS120Drive || &isUSBFDUDrive } #-or &isJazzDrive }
sub hasSCSI() {
- defined $scsiDeviceAvailable and return $scsiDeviceAvailable;
- local *F;
- open F, "/proc/scsi/scsi" or log::l("failed to open /proc/scsi/scsi: $!"), return 0;
- foreach (<F>) {
- /devices: none/ and log::l("no scsi devices are available"), return $scsiDeviceAvailable = 0;
+ local *F; open F, "/proc/scsi/scsi" or return 0;
+ local $_;
+ while (<F>) {
+ /devices: none/ and log::l("no scsi devices are available"), return 0;
}
- log::l("scsi devices are available");
- $scsiDeviceAvailable = 1;
+#- log::l("scsi devices are available");
+ 1;
}
-sub hasIDE() { 1 }
+sub hasIDE() { -e "/proc/ide" }
sub hasDAC960() { 1 }
+sub hasCompaqSmartArray() { -r "/proc/array/ida0" }
-sub hasCompaqSmartArray() {
- defined $CSADeviceAvailable and return $CSADeviceAvailable;
- -r "/proc/array/ida0" or log::l("failed to open /proc/array/ida0: $!"), return $CSADeviceAvailable = 0;
- log::l("Compaq Smart Array controllers available");
- $CSADeviceAvailable = 1;
+sub isFloppyOrHD {
+ my ($dev) = @_;
+ require partition_table_raw;
+ my $geom = partition_table_raw::get_geometry(devices::make($dev));
+ $geom->{totalsectors} < 10 << 11 ? 'floppy' : 'hd';
}
sub getSCSI() {
my @drives;
my ($driveNum, $cdromNum, $tapeNum) = qw(0 0 0);
- my $err = sub { chop; log::l("unexpected line in /proc/scsi/scsi: $_"); error() };
+ my $err = sub { chop; die "unexpected line in /proc/scsi/scsi: $_"; };
local $_;
local *F;
- open F, "/proc/scsi/scsi" or return &$err();
- $_ = <F>; /^Attached devices:/ or return &$err();
+ open F, "/proc/scsi/scsi" or die "failed to open /proc/scsi/scsi";
+ local $_ = <F>; /^Attached devices:/ or return &$err();
while ($_ = <F>) {
my ($id) = /^Host:.*?Id: (\d+)/ or return &$err();
$_ = <F>; my ($vendor, $model) = /^\s*Vendor:\s*(.*?)\s+Model:\s*(.*?)\s+Rev:/ or return &$err();
$_ = <F>; my ($type) = /^\s*Type:\s*(.*)/ or &$err();
my $device;
- if ($type =~ /Direct-Access/) {
- $type = 'hd';
+ if ($type =~ /Direct-Access/) { #- what about LS-120 floppy drive, assuming there are Direct-Access...
$device = "sd" . chr($driveNum++ + ord('a'));
+ $type = isFloppyOrHD($device);
} elsif ($type =~ /Sequential-Access/) {
- $type = 'tape';
$device = "st" . $tapeNum++;
+ $type = 'tape';
} elsif ($type =~ /CD-ROM/) {
- $type = 'cdrom';
$device = "scd" . $cdromNum++;
+ $type = 'cdrom';
}
$device and push @drives, { device => $device, type => $type, info => "$vendor $model", id => $id, bus => 0 };
}
@@ -82,10 +126,11 @@ sub getSCSI() {
sub getIDE() {
my @idi;
- -r "/proc/ide" or die "sorry, /proc/ide not available, seems like you have a pre-2.2 kernel\n => not handled yet :(";
+ #- what about a system with absolutely no IDE on it, like some sparc machine.
+ hasIDE() or return ();
- # Great. 2.2 kernel, things are much easier and less error prone.
- foreach my $d (glob_('/proc/ide/hd*')) {
+ #- Great. 2.2 kernel, things are much easier and less error prone.
+ foreach my $d (sort @{[glob_('/proc/ide/hd*')]}) {
my ($t) = chop_(cat_("$d/media"));
my $type = $ {{disk => 'hd', cdrom => 'cdrom', tape => 'tape', floppy => 'fd'}}{$t} or next;
my ($info) = chop_(cat_("$d/model")); $info ||= "(none)";
@@ -96,56 +141,195 @@ sub getIDE() {
@idi;
}
-
sub getCompaqSmartArray() {
my @idi;
my $f;
for (my $i = 0; -r ($f = "/proc/array/ida$i"); $i++) {
- local *F;
- open F, $f or die;
- local $_ = <F>;
- my ($name) = m|ida/(.*?):| or next;
- push @idi, { device => $name, info => "Compaq RAID logical disk", type => 'hd' };
+ foreach (cat_($f)) {
+ if (m|^(ida/.*?):|) {
+ push @idi, { device => $1, info => "Compaq RAID logical disk", type => 'hd' };
+ last;
+ }
+ }
}
@idi;
}
sub getDAC960() {
- my @idi;
- my $file = "/var/log/dmesg";
- -r $file or $file = "/tmp/syslog";
+ my %idi;
+
+ #- We are looking for lines of this format:DAC960#0:
+ #- /dev/rd/c0d0: RAID-7, Online, 17928192 blocks, Write Thru0123456790123456789012
+ foreach (syslog()) {
+ my ($device, $info) = m|/dev/(rd/.*?): (.*?),| or next;
+ $idi{$device} = { info => $info, type => 'hd', device => $device };
+ log::l("DAC960: $device ($info)");
+ }
+ values %idi;
+}
+
+sub getNet() {
+ grep { !($::isStandalone && /plip/) && c::hasNetDevice($_) } @netdevices;
+}
+
+# pci_probing::main::probe with $probe_type is unsafe for pci! (bug in kernel&hardware)
+# get_pcmcia_devices provides field "device", used in network.pm
+# => probeall with $probe_type is unsafe
+sub probeall {
+ my ($probe_type) = @_;
+ require pci_probing::main;
+ require sbus_probing::main;
+ require modules;
+ pci_probing::main::probe($probe_type), sbus_probing::main::probe(), modules::get_pcmcia_devices();
+}
+sub matching_desc {
+ my ($regexp) = @_;
+ grep { $_->{description} =~ /$regexp/i } probeall();
+}
+sub stringlist {
+ map { " $_->{description} ($_->{type} $_->{driver})" . ($_->{subid} ? sprintf(" SubVendor=0x%04x SubDevice=0x%04x", $_->{subvendor}, $_->{subid}) : '') } probeall(1);
+}
+sub check {
+ my ($l) = @_;
+ my $ok = $l->{driver} !~ /(unknown|ignore)/;
+ $ok or log::l("skipping $l->{description}, no module available (if you know one, please mail bugs\@linux-mandrake.com)");
+ $ok
+}
+
+
+sub tryOpen($) {
+ local *F;
+ sysopen F, devices::make($_[0]), c::O_NONBLOCK() and *F;
+}
+sub tryWrite($) {
local *F;
- open F, $file or die "Failed to open $file: $!";
-
- # We are looking for lines of this format:DAC960#0:
- # /dev/rd/c0d0: RAID-7, Online, 17928192 blocks, Write Thru0123456790123456789012
- foreach (<F>) {
- my ($devicename, $info) = m|/dev/rd/(.*?): (.*?),| or next;
- push @idi, { info => $info, type => 'hd', devicename => $devicename };
- log::l("DAC960: $devicename: $info");
+ sysopen F, devices::make($_[0]), 1 | c::O_NONBLOCK() and *F;
+}
+
+sub syslog {
+ -r "/tmp/syslog" and return map { /<\d+>(.*)/ } cat_("/tmp/syslog");
+ `dmesg`;
+}
+
+sub hasUsb {
+ my ($class, $prot) = @_;
+ foreach (cat_("/proc/bus/usb/devices")) {
+ if (/^P/ .. /^I/) {
+ my ($c, $p) = /Cls=(\d+).*Prot=(\d+)/;
+ $c == $class && ($prot < 0 || $prot == $p) and log::l("found usb $c $p"), return 1;
+ }
}
- @idi;
+ 0;
}
+sub hasUsbKeyboard { hasUsb(3, 1) }
+sub hasUsbMouse { hasUsb(3, 2) }
+sub hasUsbZip { hasUsb(8, -1) }
+sub hasSMP { c::detectSMP() }
-sub getNet() {
- # I should probably ask which device to use if multiple ones are available -- oh well :-(
- foreach (qw(eth0 tr0 plip0 plip1 plip2 fddi0)) {
- hasNetDevice($_) and log::l("$_ is available -- using it for networking"), return $_;
+sub hasUltra66 {
+ #- keep it BUT DO NOT USE IT as now included in kernel.
+ cat_("/proc/cmdline") =~ /(ide2=(\S+)(\s+ide3=(\S+))?)/ and return $1;
+
+ my @l = map { $_->{verbatim} } matching_desc('HPT|Ultra66') or return;
+
+ my $ide = sprintf "ide2=0x%x,0x%x ide3=0x%x,0x%x",
+ @l == 2 ?
+ (map_index { hex($_) + (odd($::i) ? 1 : -1) } map { (split ' ')[3..4] } @l) :
+ (map_index { hex($_) + (odd($::i) ? 1 : -1) } map { (split ' ')[3..6] } @l);
+
+ log::l("HPT|Ultra66: found $ide");
+ $ide;
+}
+
+sub whatParport() {
+ my @res =();
+ foreach (0..3) {
+ my $elem = {};
+ local *F; open F, "/proc/parport/$_/autoprobe" or next;
+ local $_;
+ while (<F>) { $elem->{$1} = $2 if /(.*):(.*);/ }
+ push @res, { port => "/dev/lp$_", val => $elem};
+ }
+ @res;
+}
+
+sub whatUsbport() {
+ my ($i, $elem, @res) = (0, {});
+ local *F; open F, "/proc/bus/usb/devices" or return;
+ local $_;
+ while (<F>) {
+ $elem->{$1} = $2 if /S:\s+(.*)=(.*\S)/;
+ if (/I:.*Driver=(printer|usblp)/ && $elem->{Manufacturer} && $elem->{Product}) {
+ my $MF = ${{ 'Hewlett-Packard' => 'HP' }}{$elem->{Manufacturer}} || $elem->{Manufacturer};
+ push @res, { port => "/dev/usb/lp$i", val => { CLASS => 'PRINTER',
+ MODEL => $elem->{Product},
+ MANUFACTURER => $elem->{Manufacturer},
+ DESCRIPTION => "$MF $elem->{Product}",
+ }};
+ $i++; $elem = {}; #- try next one, but blank what has been probed.
+ }
}
- undef;
+ @res;
}
-sub getPlip() {
- foreach (0..2) {
- hasNetDevice("plip$_") and log::l("plip$_ will be used for PLIP"), return "plip$_";
+
+#-CLASS:PRINTER;
+#-MODEL:HP LaserJet 1100;
+#-MANUFACTURER:Hewlett-Packard;
+#-DESCRIPTION:HP LaserJet 1100 Printer;
+#-COMMAND SET:MLC,PCL,PJL;
+sub whatPrinter() {
+ my @res = (whatParport(), whatUsbport());
+ grep { $_->{val}{CLASS} eq "PRINTER"} @res;
+}
+
+sub whatPrinterPort() {
+ grep { tryWrite($_)} qw(/dev/lp0 /dev/lp1 /dev/lp2 /dev/usb/lp0);
+}
+
+sub probeSerialDevices {
+ #- make sure the device are created before probing.
+ foreach (0..3) { devices::make("/dev/ttyS$_") }
+
+ #- for device already probed, we can safely (assuming device are
+ #- not moved during install :-)
+ #- include /dev/mouse device if using an X server.
+ -d "/var/lock" or mkdir "/var/lock", 0755;
+ -l "/dev/mouse" and $serialprobe{"/dev/" . readlink "/dev/mouse"} = undef;
+ foreach (keys %serialprobe) { m|^/dev/(.*)| and touch "/var/lock/LCK..$1" }
+
+ print STDERR "Please wait while probing serial ports...\n";
+ #- start probing all serial ports... really faster than before ...
+ #- ... but still take some time :-)
+ local *F; open F, "serial_probe 2>/dev/null |";
+ local $_;
+ my %current = (); while (<F>) {
+ $serialprobe{$current{DEVICE}} = { %current } and %current = () if /^\s*$/ && $current{DEVICE};
+ $current{$1} = $2 if /^([^=]+)=(.*?)\s*$/;
}
- undef;
+ close F;
+
+ foreach (values %serialprobe) {
+ $_->{DESCRIPTION} =~ /modem/i and $_->{CLASS} = 'MODEM'; #- hack to make sure a modem is detected.
+ $_->{DESCRIPTION} =~ /olitec/i and $_->{CLASS} = 'MODEM'; #- hack to make sure such modem gets detected.
+ log::l("probed $_->{DESCRIPTION} of class $_->{CLASS} on device $_->{DEVICE}");
+ }
+}
+
+sub probeSerial($) { $serialprobe{$_[0]} }
+
+sub hasModem($) {
+ $serialprobe{$_[0]} and $serialprobe{$_[0]}{CLASS} eq 'MODEM' and $serialprobe{$_[0]}{DESCRIPTION};
+}
+
+sub hasMousePS2 {
+ my $t; sysread(tryOpen($_[0]) || return, $t, 256) != 1 || $t ne "\xFE";
}
-sub hasNet() { goto &getNet }
-sub hasPlip() { goto &getPlip }
-sub hasEthernet() { hasNetDevice("eth0"); }
-sub hasTokenRing() { hasNetDevice("tr0"); }
-sub hasNetDevice($) { c::hasNetDevice($_[0]) }
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1; #
+
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 704b3d40d..a91e60ae9 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -1,4 +1,4 @@
-package devices;
+package devices; # $Id$
use diagnostics;
use strict;
@@ -17,15 +17,15 @@ sub size($) {
my $valid_offset = sub { sysseek(F, $_[0], 0) && sysread(F, my $a, 1) };
- # first try getting the size nicely
+ #- first try getting the size nicely
my $size = 0;
ioctl(F, c::BLKGETSIZE(), $size) and return unpack("i", $size) * $common::SECTORSIZE;
- # sad it didn't work, well searching the size using the dichotomy algorithm!
+ #- sad it didn't work, well searching the size using the dichotomy algorithm!
my $low = 0;
my ($high, $mid);
- # first find n where 2^n < size <= 2^n+1
+ #- first find n where 2^n < size <= 2^n+1
for ($high = 1; $high > 0 && &$valid_offset($high); $high *= 2) { $low = $high; }
while ($low < $high - 1) {
@@ -35,73 +35,107 @@ sub size($) {
$low + 1;
}
-sub make($) {
- local $_ = my $file = $_[0];
- my ($type, $major, $minor);
+sub set_loop {
+ my ($file) = @_;
- unless (s,^/(dev|tmp)/,,) {
- $file = -e "/dev/$file" ? "/dev/$file" : "/tmp/$file";
+ foreach (0..7) {
+ local *F;
+ my $dev = make("loop$_");
+ sysopen F, $dev, 2 or next;
+ !ioctl(F, c::LOOP_GET_STATUS(), my $tmp) && $! == 6 or next; #- 6 == ENXIO
+ log::l("trying with loop $dev");
+ return c::set_loop(fileno F, $file) && $dev;
}
+}
- -e $file and return $file; # assume nobody takes fun at creating files named as device
+sub entry {
+ my ($type, $major, $minor);
+ local ($_) = @_;
- if (/^sd(.)(\d\d)/) {
+ if (/^sd(.)(\d{0,2})/) {
$type = c::S_IFBLK();
$major = 8;
- $minor = ord($1) - ord('a') + $2;
+ $minor = 16 * (ord($1) - ord('a')) + ($2 || 0);
} elsif (/^hd(.)(\d{0,2})/) {
$type = c::S_IFBLK();
- ($major, $minor) =
+ ($major, $minor) =
@{ $ {{'a' => [3, 0], 'b' => [3, 64],
'c' => [22,0], 'd' => [22,64],
'e' => [33,0], 'f' => [33,64],
'g' => [34,0], 'h' => [34,64],
}}{$1} or die "unknown device $_" };
$minor += $2 || 0;
- } elsif (/^ram(.)/) {
+ } elsif (/^ram(.*)/) {
$type = c::S_IFBLK();
$major = 1;
$minor = $1 eq '' ? 1 : $1;
} elsif (m|^rd/c(\d+)d(\d+)(p(\d+))?|) {
- # dac 960 "/rd/cXdXXpX"
+ # dac 960 "rd/cXdXXpX"
$type = c::S_IFBLK();
$major = 48 + $1;
$minor = 8 * $2 + $4;
- } elsif (m|ida/c(\d+)d(\d+)(p(\d+))|) {
+ } elsif (m|ida/c(\d+)d(\d+)(p(\d+))?|) {
# Compaq Smart Array "ida/c0d0{p1}"
$type = c::S_IFBLK();
$major = 72 + $1;
- $minor = 16 * $2 + $4;
- } else {
- ($type, $major, $minor) =
- @{ $ {{"aztcd" => [ c::S_IFBLK(), 29, 0 ],
+ $minor = 16 * $2 + ($4 || 0);
+ } elsif (/(.*)(\d+)$/) {
+ ($type, $major, $minor) =
+ @{ ${{"fd" => [ c::S_IFBLK(), 2, 0 ],
+ "hidbp-mse-" => [ c::S_IFCHR(), 10, 32 ],
+ "lp" => [ c::S_IFCHR(), 6, 0 ],
+ "usb/lp" => [ c::S_IFCHR(), 180, 0 ],
+ "loop" => [ c::S_IFBLK(), 7, 0 ],
+ "md" => [ c::S_IFBLK(), 9, 0 ],
+ "nst" => [ c::S_IFCHR(), 9, 128],
+ "scd" => [ c::S_IFBLK(), 11, 0 ],
+ "ttyS" => [ c::S_IFCHR(), 4, 64 ],
+ }}{$1}};
+ $minor += $2;
+ }
+ unless ($type) {
+ ($type, $major, $minor) =
+ @{ ${{"aztcd" => [ c::S_IFBLK(), 29, 0 ],
"bpcd" => [ c::S_IFBLK(), 41, 0 ],
"cdu31a" => [ c::S_IFBLK(), 15, 0 ],
"cdu535" => [ c::S_IFBLK(), 24, 0 ],
"cm206cd" => [ c::S_IFBLK(), 32, 0 ],
- "tty" => [ c::S_IFCHR(), 5, 0 ],
- "fd0" => [ c::S_IFBLK(), 2, 0 ],
- "fd1" => [ c::S_IFBLK(), 2, 1 ],
"gscd" => [ c::S_IFBLK(), 16, 0 ],
- "lp0" => [ c::S_IFCHR(), 6, 0 ],
- "lp1" => [ c::S_IFCHR(), 6, 1 ],
- "lp2" => [ c::S_IFCHR(), 6, 2 ],
"mcd" => [ c::S_IFBLK(), 23, 0 ],
"mcdx" => [ c::S_IFBLK(), 20, 0 ],
- "nst0" => [ c::S_IFCHR(), 9, 128 ],
+ "mem" => [ c::S_IFCHR(), 1, 1 ],
"optcd" => [ c::S_IFBLK(), 17, 0 ],
+ "kbd" => [ c::S_IFCHR(), 11, 0 ],
+ "psaux" => [ c::S_IFCHR(), 10, 1 ],
+ "random" => [ c::S_IFCHR(), 1, 8 ],
"sbpcd" => [ c::S_IFBLK(), 25, 0 ],
- "scd0" => [ c::S_IFBLK(), 11, 0 ],
- "scd1" => [ c::S_IFBLK(), 11, 1 ],
"sjcd" => [ c::S_IFBLK(), 18, 0 ],
- }}{$_} or die "unknown device $type" };
+ "tty" => [ c::S_IFCHR(), 5, 0 ],
+ "usbmouse"=> [ c::S_IFCHR(), 13, 63], #- aka /dev/input/mice
+ "zero" => [ c::S_IFCHR(), 1, 5 ],
+ }}{$_} or die "unknown device $_ (caller is " . join(":", caller()) . ")" };
}
-
- # make a directory for this inode if needed.
- mkdir dirname($file), 0755;
-
- syscall_('mknod', $file, $type | 0600, makedev($major, $minor)) or die "mknod failed (dev:$_): $!";
+ ($type, $major, $minor);
+}
+
+
+sub make($) {
+ local $_ = my $file = $_[0];
+
+ if (m,^(.*/(?:dev|tmp))/(.*),) {
+ $_ = $2;
+ } else {
+ -e $file or $file = "/tmp/$_";
+ -e $file or $file = "/dev/$_";
+ }
+ -e $file and return $file; #- assume nobody takes fun at creating files named as device
+
+ my ($type, $major, $minor) = entry($_);
+
+ #- make a directory for this inode if needed.
+ mkdir dirname($file), 0755;
+
+ syscall_('mknod', $file, $type | 0600, makedev($major, $minor)) or die "mknod failed (dev $_): $!";
$file;
}
-
diff --git a/perl-install/do_resize_fat b/perl-install/do_resize_fat
index 0668ecb19..41ebf1b83 100755
--- a/perl-install/do_resize_fat
+++ b/perl-install/do_resize_fat
@@ -3,13 +3,13 @@
use diagnostics;
use strict;
-use lib qw(.);
+use lib qw(/usr/lib/libDrakX);
use common;
use resize_fat::main;
local *log::l = sub { print join(' ', @_), "\n" };
-@ARGV = qw(/tmp/eee +0);
+@ARGV = qw(/mnt/iso/w +0);
@ARGV == 2 or die "usage: fatresize <device> <size>\n <size> = 100 means `resize to 100Mb'\n <size> = +10 means `keep 10Mb of free space'\n";
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index cf29fe014..ee35ceb8d 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -1,35 +1,50 @@
-package fs;
+package fs; # $Id$
use diagnostics;
use strict;
-use common qw(:common :file :system);
+use common qw(:common :file :system :functional);
use log;
use devices;
use partition_table qw(:types);
use run_program;
-use nfs;
use swap;
use detect_devices;
use commands;
+use modules;
+use fsedit;
+use loopback;
1;
+sub add_options(\$@) {
+ my ($option, @options) = @_;
+ my %l; @l{split(',', $$option), @options} = (); delete $l{defaults};
+ $$option = join(',', keys %l) || "defaults";
+}
sub read_fstab($) {
my ($file) = @_;
local *F;
open F, $file or return;
-
+
map {
- my ($dev, $mntpoint, @l) = split ' ';
+ my ($dev, @l) = split;
$dev =~ s,/(tmp|dev)/,,;
- while (@l > 4) { $mntpoint .= " " . shift @l; }
- { device => $dev, mntpoint => $mntpoint, type => $l[0], options => $l[1] }
+ { device => $dev, mntpoint => $l[0], type => $l[1], options => $l[2] }
} <F>;
}
+sub up_mount_point {
+ my ($mntpoint, $fstab) = @_;
+ while (1) {
+ $mntpoint = dirname($mntpoint);
+ $mntpoint ne "." or return;
+ $_->{mntpoint} eq $mntpoint and return $_ foreach @$fstab;
+ }
+}
+
sub check_mounted($) {
my ($fstab) = @_;
@@ -39,107 +54,211 @@ sub check_mounted($) {
open H, "/proc/swaps";
foreach (<F>, <G>, <H>) {
foreach my $p (@$fstab) {
- /$p->{device}\s/ and $p->{isMounted} = 1;
+ /$p->{device}\s+([^\s]*)\s+/ and $p->{mntpoint} = $1, $p->{isMounted} = $p->{isFormatted} = 1;
}
}
}
-sub get_mntpoints_from_fstab($) {
- my ($fstab) = @_;
+sub get_mntpoints_from_fstab {
+ my ($fstab, $prefix, $uniq) = @_;
+
+ log::l("reading fstab");
+ foreach (read_fstab("$prefix/etc/fstab")) {
+ next if $uniq && fsedit::mntpoint2part($_->{mntpoint}, $fstab);
- foreach (read_fstab('/etc/fstab')) {
foreach my $p (@$fstab) {
$p->{device} eq $_->{device} or next;
- $p->{mntpoint} ||= $_->{mntpoint};
- $p->{options} ||= $_->{options};
- $_->{type} ne 'auto' && $_->{type} ne type2fs($p->{type}) and
- log::l("err, fstab and partition table do not agree for $_->{device} type: " . (type2fs($p->{type}) || type2name($p->{type})) . " vs $_->{type}");
+ $_->{type} ne 'auto' && $_->{type} ne type2fs($p->{type}) and
+ log::l("err, fstab and partition table do not agree for $_->{device} type: " . (type2fs($p->{type}) || type2name($p->{type})) . " vs $_->{type}"), next;
+ delete $p->{unsafeMntpoint} || !$p->{mntpoint} or next;
+ $p->{mntpoint} = $_->{mntpoint};
+ $p->{options} = $_->{options};
}
}
}
-sub format_ext2($;$) {
- my ($dev, $bad_blocks) = @_;
- my @options;
+#- mke2fs -b (1024|2048|4096) -c -i(1024 > 262144) -N (1 > 100000000) -m (0-100%) -L volume-label
+#- tune2fs
+sub format_ext2($@) {
+ my ($dev, @options) = @_;
+
+ $dev =~ m,(rd|ida)/, and push @options, qw(-b 4096 -R stride=16); #- For RAID only.
+ push @options, qw(-b 1024 -O none) if arch() =~ /alpha/;
+
+ run_program::run("mke2fs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "ext2", $dev);
+}
+
+sub format_reiserfs($@) {
+ my ($dev, @options) = @_;
+
+ #TODO add -h tea
+ run_program::run("mkreiserfs", "-f", @options, devices::make($dev)) or die _("%s formatting of %s failed", "reiserfs", $dev);
+}
- $dev =~ m,(rd|ida)/, and push @options, qw(-b 4096 -R stride=16); # For RAID only.
- $bad_blocks and push @options, "-c";
+sub format_dos($@) {
+ my ($dev, @options) = @_;
- run_program::run("mke2fs", devices::make($dev), @options) or die "ext2 formatting of $dev failed";
+ run_program::run("mkdosfs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "dos", $dev);
}
-sub format_dos($;$) {
- my ($dev, $bad_blocks) = @_;
+sub format_hfs($@) {
+ my ($dev, @options) = @_;
- run_program::run("mkdosfs", devices::make($dev), $bad_blocks ? "-c" : ()) or die "dos formatting of $dev failed";
+ run_program::run("hformat", @options, devices::make($dev)) or die _("%s formatting of %s failed", "HFS", $dev);
}
-sub format_part($;$) {
- my ($part, $bad_blocks) = @_;
+sub real_format_part {
+ my ($part) = @_;
$part->{isFormatted} and return;
+ my @options = $part->{toFormatCheck} ? "-c" : ();
+ log::l("formatting device $part->{device} (type ", type2name($part->{type}), ")");
+
if (isExt2($part)) {
- format_ext2($part->{device}, $bad_blocks);
+ push @options, "-F" if isLoopback($part);
+ format_ext2($part->{device}, @options);
+ } elsif (isReiserfs($part)) {
+ format_reiserfs($part->{device}, @options);
} elsif (isDos($part)) {
- format_dos($part->{device}, $bad_blocks);
+ format_dos($part->{device}, @options);
+ } elsif (isWin($part)) {
+ format_dos($part->{device}, @options, '-F', 32);
+ } elsif (isHFS($part)) {
+ format_hfs($part->{device}, @options, '-l', "Untitled");
} elsif (isSwap($part)) {
- swap::make($part->{device}, $bad_blocks);
+ my $check_blocks = grep { /^-c$/ } @options;
+ swap::make($part->{device}, $check_blocks);
} else {
- die "don't know how to format $_->{device} in type " . type2name($_->{type});
+ die _("I don't know how to format %s in type %s", $_->{device}, type2name($_->{type}));
}
$part->{isFormatted} = 1;
}
+sub format_part {
+ my ($raid, $part, $prefix) = @_;
+ if (isMDRAID($part)) {
+ require raid;
+ raid::format_part($raid, $part);
+ } elsif (isLoopback($part)) {
+ loopback::format_part($part, $prefix);
+ } else {
+ real_format_part($part);
+ }
+}
+
+sub formatMount_part {
+ my ($part, $raid, $fstab, $prefix, $callback) = @_;
+
+ if (isLoopback($part)) {
+ formatMount_part($part->{device}, $raid, $fstab, $prefix, $callback);
+ }
+ if (my $p = up_mount_point($part->{mntpoint}, $fstab)) {
+ formatMount_part($p, $raid, $fstab, $prefix, $callback) unless loopback::carryRootLoopback($part);
+ }
+
+ if ($part->{toFormat}) {
+ $callback->($part) if $callback;
+ format_part($raid, $part, $prefix);
+ }
+ mount_part($part, $prefix);
+}
+
+sub formatMount_all {
+ my ($raid, $fstab, $prefix, $callback) = @_;
+ formatMount_part($_, $raid, $fstab, $prefix, $callback)
+ foreach sort { isLoopback($a) ? 1 : isSwap($a) ? -1 : 0 } grep { $_->{mntpoint} } @$fstab;
+
+ #- ensure the link is there
+ loopback::carryRootCreateSymlink($_, $prefix) foreach @$fstab;
+
+ #- for fun :)
+ #- that way, when install exits via ctrl-c, it gives hand to partition
+ eval {
+ local $SIG{__DIE__} = 'ignore';
+ my ($type, $major, $minor) = devices::entry(fsedit::get_root($fstab)->{device});
+ output "/proc/sys/kernel/real-root-dev", makedev($major, $minor);
+ };
+}
sub mount($$$;$) {
- my ($dev, $where, $fs, $rdonly) = @_;
+ my ($dev, $where, $fs, $rdonly) = @_;
log::l("mounting $dev on $where as type $fs");
-
- $::testing and return;
-
+
-d $where or commands::mkdir_('-p', $where);
-
+
if ($fs eq 'nfs') {
log::l("calling nfs::mount($dev, $where)");
- nfs::mount($dev, $where) or die "nfs mount failed";
+# nfs::mount($dev, $where) or die _("nfs mount failed");
} elsif ($fs eq 'smb') {
die "no smb yet...";
- }
- $dev = devices::make($dev);
-
- my $flag = 0;#c::MS_MGC_VAL();
- $flag |= c::MS_RDONLY() if $rdonly;
- my $mount_opt = $fs eq 'vfat' ? "check=relaxed" : "";
-
- log::l("calling mount($dev, $where, $fs, $flag, $mount_opt)");
- syscall_('mount', $dev, $where, $fs, $flag, $mount_opt) or die "mount failed: $!";
+ } else {
+ $dev = devices::make($dev) if $fs ne 'proc' && $fs ne 'usbdevfs';
+
+ my $flag = c::MS_MGC_VAL();
+ $flag |= c::MS_RDONLY() if $rdonly;
+ my $mount_opt = "";
+
+ if ($fs eq 'vfat') {
+ $mount_opt = 'check=relaxed';
+ eval { modules::load('vfat') }; #- try using vfat
+ eval { modules::load('msdos') } if $@; #- otherwise msdos...
+ } elsif ($fs eq 'ufs') {
+ eval { modules::load('ufs') };
+ } elsif ($fs eq 'reiserfs') {
+ #- could be better if we knew if there is a /boot or not
+ #- without knowing it, / is forced to be mounted with notail
+ $mount_opt = 'notail' if $where =~ m|/(boot)?$|;
+ eval { modules::load('reiserfs') };
+ } elsif ($fs eq 'romfs') {
+ eval { modules::load('romfs') };
+ }
+ $where =~ s|/$||;
+ log::l("calling mount($dev, $where, $fs, $flag, $mount_opt)");
+ syscall_('mount', $dev, $where, $fs, $flag, $mount_opt) or die _("mount failed: ") . "$!";
+ }
local *F;
- open F, ">>/etc/mtab" or return; # fail silently, must be read-only /etc
+ open F, ">>/etc/mtab" or return; #- fail silently, must be read-only /etc
print F "$dev $where $fs defaults 0 0\n";
}
-# takes the mount point to umount (can also be the device)
-sub umount($) {
+#- takes the mount point to umount (can also be the device)
+sub umount($) {
my ($mntpoint) = @_;
- syscall_('umount', $mntpoint) or die "error unmounting $mntpoint: $!";;
+ $mntpoint =~ s|/$||;
+ log::l("calling umount($mntpoint)");
+ syscall_('umount', $mntpoint) or die _("error unmounting %s: %s", $mntpoint, "$!");
- my @mtab = cat_('/etc/mtab'); # don't care about error, if we can't read, we won't manage to write... (and mess mtab)
- local *F;
- open F, ">/etc/mtab" or return;
- foreach (@mtab) { print F $_ unless /(^|\s)$mntpoint\s/; }
+ substInFile { $_ = '' if /(^|\s)$mntpoint\s/ } '/etc/mtab'; #- don't care about error, if we can't read, we won't manage to write... (and mess mtab)
}
-sub mount_part($;$) {
- my ($part, $prefix) = @_;
-
- $part->{isMounted} and return;
- $part->{mntpoint} or die "missing mount point";
-
- isSwap($part) ?
- swap::swapon($part->{device}) :
- mount(devices::make($part->{device}), ($prefix || '') . $part->{mntpoint}, type2fs($part->{type}), 0);
- $part->{isMounted} = 1;
+sub mount_part($;$$) {
+ my ($part, $prefix, $rdonly) = @_;
+
+ #- root carrier's link can't be mounted
+ loopback::carryRootCreateSymlink($part, $prefix);
+
+ return if $part->{isMounted};
+
+ unless ($::testing) {
+ if (isSwap($part)) {
+ swap::swapon(isLoopback($part) ? $prefix . loopback::file($part) : $part->{device});
+ } else {
+ $part->{mntpoint} or die "missing mount point";
+
+ my $dev = $part->{device};
+ my $mntpoint = ($prefix || '') . $part->{mntpoint};
+ if (isLoopback($part)) {
+ eval { modules::load('loop') };
+ $dev = $part->{real_device} = devices::set_loop($prefix . loopback::file($part)) || die;
+ } elsif (loopback::carryRootLoopback($part)) {
+ $mntpoint = "/initrd/loopfs";
+ }
+ mount(devices::make($dev), $mntpoint, type2fs($part->{type}), $rdonly);
+ rmdir "$mntpoint/lost+found";
+ }
+ }
+ $part->{isMounted} = $part->{isFormatted} = 1; #- assume that if mount works, partition is formatted
}
sub umount_part($;$) {
@@ -147,20 +266,28 @@ sub umount_part($;$) {
$part->{isMounted} or return;
- isSwap($part) ?
- swap::swapoff($part->{device}) :
- umount(($prefix || '') . ($part->{mntpoint} || "/dev/$part->{device}"));
+ unless ($::testing) {
+ if (isSwap($part)) {
+ swap::swapoff($part->{device});
+ } elsif (loopback::carryRootLoopback($part)) {
+ umount("/initrd/loopfs");
+ } else {
+ umount(($prefix || '') . $part->{mntpoint} || devices::make($part->{device}));
+ c::del_loop(delete $part->{real_device}) if isLoopback($part);
+ }
+ }
$part->{isMounted} = 0;
}
-sub mount_all($;$) {
+sub mount_all($;$$) {
my ($fstab, $prefix) = @_;
+ #- TODO fsck, create check_mount_all ?
log::l("mounting all filesystems");
- # order mount by alphabetical ordre, that way / < /home < /home/httpd...
- foreach (sort { $a->{mntpoint} cmp $b->{mntpoint} } @$fstab) {
- $_->{mntpoint} and mount_part($_, $prefix);
+ #- order mount by alphabetical ordre, that way / < /home < /home/httpd...
+ foreach (sort { $a->{mntpoint} cmp $b->{mntpoint} } grep { isSwap($_) || $_->{mntpoint} && isTrueFS($_) } @$fstab) {
+ mount_part($_, $prefix);
}
}
@@ -174,72 +301,149 @@ sub umount_all($;$) {
}
}
-# do some stuff before calling write_fstab
-sub write($$) {
- my ($prefix, $fstab) = @_;
- my @cd_drives = detect_devices::cdroms();
+sub df {
+ my ($part, $prefix) = @_;
+ my $dir = "/tmp/tmp_fs_df";
+
+ return $part->{free} if exists $part->{free};
- log::l("scanning /proc/mounts for iso9660 filesystems");
- unshift @cd_drives, grep { $_->{type} eq 'iso9660' } read_fstab("/proc/mounts");
- log::l("found cdrom drive(s) " . join(', ', map { $_->{device} } @cd_drives));
+ if ($part->{isMounted}) {
+ $dir = ($prefix || '') . $part->{mntpoint};
+ } elsif ($part->{notFormatted} && !$part->{isFormatted}) {
+ return; #- won't even try!
+ } else {
+ mkdir $dir;
+ eval { mount($part->{device}, $dir, type2fs($part->{type}), 'readonly') };
+ if ($@) {
+ $part->{notFormatted} = 1;
+ $part->{isFormatted} = 0;
+ unlink $dir;
+ return;
+ }
+ }
+ my (undef, $free) = common::df($dir);
- # cd-rom rooted installs have the cdrom mounted on /dev/root which
- # is not what we want to symlink to /dev/cdrom.
- my $cddev = first(grep { $_ ne 'root' } map { $_->{device} } @cd_drives);
+ if (!$part->{isMounted}) {
+ umount($dir);
+ unlink($dir)
+ }
- $::testing and return 1;
+ $part->{free} = 2 * $free if defined $free;
+ $part->{free};
+}
- log::l("resetting /etc/mtab");
- local *F;
- open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab";
+#- do some stuff before calling write_fstab
+sub write($$$$) {
+ my ($prefix, $fstab, $manualFstab, $useSupermount) = @_;
+ $fstab = [ @{$fstab||[]}, @{$manualFstab||[]} ];
- if ($cddev) {
- mkdir "$prefix/mnt/cdrom", 0755 or log::l("failed to mkdir $prefix/mnt/cdrom: $!");
- symlink $cddev, "$prefix/dev/cdrom" or log::l("failed to symlink $prefix/dev/cdrom: $!");
+ unless ($::live) {
+ log::l("resetting /etc/mtab");
+ local *F;
+ open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab";
}
- write_fstab($fstab, $prefix, $cddev);
-}
+ my $floppy = detect_devices::floppy();
+
+ my @to_add = (
+ $useSupermount ?
+ [ split ' ', "/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/$floppy 0 0" ] :
+ [ split ' ', "/dev/$floppy /mnt/floppy auto sync,user,noauto,nosuid,nodev 0 0" ],
+ [ split ' ', 'none /proc proc defaults 0 0' ],
+ [ split ' ', 'none /dev/pts devpts mode=0620 0 0' ],
+ (map_index {
+ my $i = $::i ? $::i + 1 : '';
+ mkdir "$prefix/mnt/cdrom$i", 0755;#- or log::l("failed to mkdir $prefix/mnt/cdrom$i: $!");
+ symlinkf $_->{device}, "$prefix/dev/cdrom$i" or log::l("failed to symlink $prefix/dev/cdrom$i: $!");
+ chown 0, 22, "$prefix/dev/$_->{device}";
+ $useSupermount ?
+ [ "/mnt/cdrom$i", "/mnt/cdrom$i", "supermount", "fs=iso9660,dev=/dev/cdrom$i", 0, 0 ] :
+ [ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ];
+ } detect_devices::cdroms()),
+ (map_index { #- for zip drives, the right partition is the 4th by default.
+ my $i = $::i ? $::i + 1 : '';
+ mkdir "$prefix/mnt/zip$i", 0755 or log::l("failed to mkdir $prefix/mnt/zip$i: $!");
+ symlinkf "$_->{device}4", "$prefix/dev/zip$i" or log::l("failed to symlink $prefix/dev/zip$i: $!");
+ $useSupermount ?
+ [ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ] :
+ [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
+ } detect_devices::zips()));
+ write_fstab($fstab, $prefix, @to_add);
+}
sub write_fstab($;$$) {
- my ($fstab, $prefix, $cddev) = @_;
+ my ($fstab, $prefix, @to_add) = @_;
$prefix ||= '';
- my @to_add =
- map {
+ #- get the list of devices and mntpoint to remove existing entries
+ #- and @to_add take precedence over $fstab to handle removable device
+ #- if they are mounted OR NOT during install.
+ my @new = grep { $_ ne 'none' } map { @$_[0,1] } @to_add;
+ my %new; @new{@new} = undef;
+
+ unshift @to_add,
+ grep {
+ my $b = !exists $new{$_->[0]} && !exists $new{$_->[1]};
+ #- keep in mind the new line for fstab.
+ @new{@$_[0,1]} = undef;
+ $b
+ } map {
my ($dir, $options, $freq, $passno) = qw(/dev/ defaults 0 0);
- $options ||= $_->{options};
+ $options = $_->{options} || $options;
- isExt2($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2);
- isNfs($_) and ($dir, $options) = ('', 'ro');
-
- [ "$dir$_->{device}", $_->{mntpoint}, type2fs($_->{type}), $options, $freq, $passno ];
+ isTrueFS($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2);
+ isNfs($_) and $dir = '', $options = $_->{options} || 'ro,nosuid,rsize=8192,wsize=8192';
+ isFat($_) and $options = $_->{options} || "user,exec,umask=0";
- } grep { $_->{mntpoint} && type2fs($_->{type}) } @$fstab;
+ isReiserfs($_) && $_ == fsedit::get_root($fstab, 'boot') and add_options($options, "notail");
- {
- push @to_add, [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ];
- push @to_add, [ split ' ', '/dev/cdrom /mnt/cdrom auto user,noauto,nosuid,exec,nodev,ro 0 0' ] if $cddev;
- push @to_add, [ split ' ', 'none /proc proc defaults 0 0' ];
- push @to_add, [ split ' ', 'none /dev/pts devpts mode=0620 0 0' ];
- }
+ my $dev = isLoopback($_) ?
+ ($_->{mntpoint} eq '/' ? "/initrd/loopfs$_->{loopback_file}" : loopback::file($_)) :
+ ($_->{device} =~ /^\// ? $_->{device} : "$dir$_->{device}");
+
+ local $_->{mntpoint} = do {
+ $passno = 0;
+ "/initrd/loopfs";
+ } if loopback::carryRootLoopback($_);
- # get the list of devices and mntpoint
- my @new = grep { $_ ne 'none' } map { @$_[0,1] } @to_add;
- my %new; @new{@new} = undef;
+ add_options($options, "loop") if isLoopback($_) && !isSwap($_); #- no need for loop option for swap files
+
+ eval { devices::make("$prefix/$dev") } if $dir && !isLoopback($_);
+ mkdir "$prefix/$_->{mntpoint}", 0755 if $_->{mntpoint} && !isSwap($_);
- my @current = cat_("$prefix/etc/fstab");
+ [ $dev, $_->{mntpoint}, type2fs($_->{type}), $options, $freq, $passno ];
+
+ } grep { $_->{mntpoint} && type2fs($_->{type}) } @$fstab;
+
+ push @to_add,
+ grep { !exists $new{$_->[0]} && !exists $new{$_->[1]} }
+ map { [ split ] } cat_("$prefix/etc/fstab");
log::l("writing $prefix/etc/fstab");
local *F;
open F, "> $prefix/etc/fstab" or die "error writing $prefix/etc/fstab";
- foreach (@current) {
- my ($a, $b) = split;
- # if we find one line of fstab containing either the same device or mntpoint, do not write it
- exists $new{$a} || exists $new{$b} and next;
- print F $_;
- }
- foreach (@to_add) {
- print F join(" ", @$_), "\n";
- }
+ print F join(" ", @$_), "\n" foreach sort { $a->[1] cmp $b->[1] } @to_add;
+}
+
+sub merge_fstabs {
+ my ($fstab, $manualFstab) = @_;
+ my %l; $l{$_->{device}} = $_ foreach @$manualFstab;
+ %$_ = (%$_, %{$l{$_->{device}} || next}) foreach @$fstab;
}
+
+#sub check_mount_all_fstab($;$) {
+# my ($fstab, $prefix) = @_;
+# $prefix ||= '';
+#
+# foreach (sort { ($a->{mntpoint} || '') cmp ($b->{mntpoint} || '') } @$fstab) {
+# #- avoid unwanted mount in fstab.
+# next if ($_->{device} =~ /none/ || $_->{type} =~ /nfs|smbfs|ncpfs|proc/ || $_->{options} =~ /noauto|ro/);
+#
+# #- TODO fsck
+#
+# eval { mount(devices::make($_->{device}), $prefix . $_->{mntpoint}, $_->{type}, 0); };
+# if ($@) {
+# log::l("unable to mount partition $_->{device} on $prefix/$_->{mntpoint}");
+# }
+# }
+#}
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index fb2703e8f..6e16f0810 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -1,31 +1,53 @@
-package fsedit;
+package fsedit; # $Id$
use diagnostics;
use strict;
-use common qw(:common);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :constant :functional :file);
use partition_table qw(:types);
use partition_table_raw;
+use detect_devices;
+use Data::Dumper;
+use fsedit;
use devices;
+use loopback;
use log;
+use fs;
-1;
-
+#-#####################################################################################
+#- Globals
+#-#####################################################################################
my @suggestions = (
- { mntpoint => "/boot", minsize => 10 << 11, size => 16 << 11, type => 0x83 },
- { mntpoint => "/", minsize => 50 << 11, size => 100 << 11, type => 0x83 },
- { mntpoint => "swap", minsize => 30 << 11, size => 60 << 11, type => 0x82 },
- { mntpoint => "/usr", minsize => 200 << 11, size => 500 << 11, type => 0x83 },
- { mntpoint => "/home", minsize => 50 << 11, size => 200 << 11, type => 0x83 },
- { mntpoint => "/var", minsize => 200 << 11, size => 250 << 11, type => 0x83 },
- { mntpoint => "/tmp", minsize => 50 << 11, size => 100 << 11, type => 0x83 },
- { mntpoint => "/mnt/iso", minsize => 700 << 11, size => 800 << 11, type => 0x83 },
+ { mntpoint => "/boot", size => 16 << 11, type => 0x83, ratio => 1, maxsize => 30 << 11 },
+ { mntpoint => "/", size => 50 << 11, type => 0x83, ratio => 1, maxsize => 300 << 11 },
+ { mntpoint => "swap", size => 30 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/usr", size => 200 << 11, type => 0x83, ratio => 6, maxsize =>3000 << 11 },
+ { mntpoint => "/home", size => 50 << 11, type => 0x83, ratio => 3 },
+ { mntpoint => "/var", size => 200 << 11, type => 0x83, ratio => 1, maxsize =>1000 << 11 },
+ { mntpoint => "/tmp", size => 50 << 11, type => 0x83, ratio => 3, maxsize => 500 << 11 },
);
+my @suggestions_mntpoints = ( "/root/", arch() =~ /sparc/ ? "/mnt/sunos" : "/mnt/windows" );
+my @partitions_signatures = (
+ [ 0x83, 0x438, "\x53\xEF" ],
+ [ 0x183, 0x10034, "ReIsErFs" ],
+ [ 0x82, 4086, "SWAP-SPACE" ],
+ [ 0x7, 0x1FE, "\x55\xAA", 0x3, "NTFS" ],
+ [ 0xc, 0x1FE, "\x55\xAA", 0x52, "FAT32" ],
+arch() !~ /^sparc/ ? (
+ [ 0x6, 0x1FE, "\x55\xAA", 0x36, "FAT" ],
+) : (),
+);
-1;
+sub typeOfPart { typeFromMagic(devices::make($_[0]), @partitions_signatures) }
-sub hds($$) {
+#-######################################################################################
+#- Functions
+#-######################################################################################
+sub hds {
my ($drives, $flags) = @_;
my @hds;
my $rc;
@@ -33,155 +55,385 @@ sub hds($$) {
foreach (@$drives) {
my $file = devices::make($_->{device});
- my $hd = partition_table_raw::get_geometry($file) or die "An error occurred while getting the geometry of block device $file: $!";
+ my $hd = partition_table_raw::get_geometry($file) or log::l("An error occurred while getting the geometry of block device $file: $!"), next;
+ $hd = { (%$_, %$hd) };
$hd->{file} = $file;
- $hd->{prefix} = $hd->{device} = $_->{device};
- # for RAID arrays of format c0d0p1
+ $hd->{prefix} = $hd->{device};
+ # for RAID arrays of format c0d0p1
$hd->{prefix} .= "p" if $hd->{prefix} =~ m,(rd|ida)/,;
- eval { $rc = partition_table::read($hd, $flags->{clearall}) };
+ eval { partition_table::read($hd, $flags->{clearall} || member($_->{device}, @{$flags->{clear} || []})) };
if ($@) {
- $@ =~ /bad magic number/ or die;
- $flags->{forcezero} && !$::testing ? partition_table_raw::zero_MBR($hd) : die;
+ partition_table_raw::zero_MBR($hd);
+ }
+ member($_->{device}, @{$flags->{clear} || []}) and partition_table::remove($hd, $_)
+ foreach partition_table::get_normal_parts($hd);
+
+ #- special case for type overloading (eg: reiserfs is 0x183)
+ foreach (grep { isExt2($_) } partition_table::get_normal_parts($hd)) {
+ my $type = typeOfPart($_->{device});
+ $_->{type} = $type if $type > 0x100;
}
- $rc ? push @hds, $hd : log::l("An error occurred reading the partition table for the block device $_->{device}");
+ push @hds, $hd;
}
[ @hds ];
}
-sub get_fstab(@) {
- map { partition_table::get_normal_parts($_) } @_;
+sub readProcPartitions {
+ my ($hds) = @_;
+ my @parts;
+ foreach (cat_("/proc/partitions")) {
+ my (undef, undef, $size, $device) = split;
+ next if $size eq "1"; #- extended partitions
+ foreach (@$hds) {
+ push @parts, { start => 0, size => $size * 2, device => $device,
+ type => typeOfPart($device), rootDevice => $_->{device}
+ } if $device =~ /^$_->{device}./;
+ }
+ }
+ @parts;
+}
+
+#- get all normal partition including special ones as found on sparc.
+sub get_fstab {
+ loopback::loopbacks(@_), map { partition_table::get_normal_parts($_) } @_
+}
+
+#- get normal partition that should be visible for working on.
+sub get_visible_fstab {
+ grep { $_ && !partition_table::isWholedisk($_) && !partition_table::isHiddenMacPart($_) } map { partition_table::get_normal_parts($_) } @_;
+}
+
+sub free_space {
+ sum map { $_->{size} } map { partition_table::get_holes($_) } @_;
+}
+
+sub is_one_big_fat {
+ my ($hds) = @_;
+ @$hds == 1 or return;
+
+ my @l = get_fstab(@$hds);
+ @l == 1 && isFat($l[0]) && free_space(@$hds) < 10 << 11;
+}
+
+
+sub computeSize {
+ my ($part, $best, $hds, $suggestions) = @_;
+ my $max = $part->{maxsize} || $part->{size};
+ return min($max, $best->{size}) unless $best->{ratio};
+
+ my $free_space = free_space(@$hds);
+ my @l = my @L = grep {
+ if (!has_mntpoint($_->{mntpoint}, $hds) && $free_space >= $_->{size}) {
+ $free_space -= $_->{size};
+ 1;
+ } else { 0 } } @$suggestions;
+
+ my $tot_ratios = 0;
+ while (1) {
+ my $old_free_space = $free_space;
+ my $old_tot_ratios = $tot_ratios;
+
+ $tot_ratios = sum(map { $_->{ratio} } @l);
+ last if $tot_ratios == $old_tot_ratios;
+
+ @l = grep {
+ if ($_->{ratio} && $_->{maxsize} && $tot_ratios &&
+ $_->{size} + $_->{ratio} / $tot_ratios * $old_free_space >= $_->{maxsize}) {
+ return min($max, $best->{maxsize}) if $best->{mntpoint} eq $_->{mntpoint};
+ $free_space -= $_->{maxsize} - $_->{size};
+ 0;
+ } else {
+ $_->{ratio};
+ }
+ } @l;
+ }
+ my $size = int min($max, $best->{size} + $free_space * ($tot_ratios && $best->{ratio} / $tot_ratios));
+ #- verify other entry can fill the hole
+ if (grep { $_->{size} < $max - $size } @L) { $size } else { $max }
}
-sub suggest_part($$$;$) {
- my ($hd, $part, $hds, $suggestions) = @_;
+sub suggest_part {
+ my ($part, $hds, $suggestions) = @_;
$suggestions ||= \@suggestions;
- foreach (@$suggestions) { $_->{minsize} ||= $_->{size} }
- my $has_swap;
- my @mntpoints = map { $has_swap ||= isSwap($_); $_->{mntpoint} } get_fstab(@$hds);
- my %mntpoints; @mntpoints{@mntpoints} = undef;
- my ($best, $second) =
- grep { $part->{size} >= $_->{minsize} }
- grep { !exists $mntpoints{$_->{mntpoint}} || isSwap($_) && !$has_swap }
+ my $has_swap = grep { isSwap($_) } get_fstab(@$hds);
+
+ my ($best, $second) =
+ grep { !$_->{maxsize} || $part->{size} <= $_->{maxsize} }
+ grep { $_->{size} <= ($part->{maxsize} || $part->{size}) }
+ grep { !has_mntpoint($_->{mntpoint}, $hds) || isSwap($_) && !$has_swap }
+ grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} }
+ grep { !$part->{type} || $part->{type} == $_->{type} || isTrueFS($part) && isTrueFS($_) }
@$suggestions or return;
- $best = $second if
- $best->{mntpoint} eq '/boot' &&
- $part->{start} + $best->{minsize} > 1024 * partition_table::cylinder_size($hd); # if the empty slot is beyond the 1024th cylinder, no use having /boot
+#- if (arch() =~ /i.86/) {
+#- $best = $second if
+#- $best->{mntpoint} eq '/boot' &&
+#- $part->{start} + $best->{size} > 1024 * $hd->cylinder_size(); #- if the empty slot is beyond the 1024th cylinder, no use having /boot
+#- }
- defined $best or return; # sorry no suggestion :(
+ defined $best or return; #- sorry no suggestion :(
$part->{mntpoint} = $best->{mntpoint};
$part->{type} = $best->{type};
- $part->{size} = min($part->{size}, $best->{size});
+ $part->{size} = computeSize($part, $best, $hds, $suggestions);
1;
}
+sub suggestions_mntpoint {
+ my ($hds) = @_;
+ sort grep { !/swap/ && !has_mntpoint($_, $hds) }
+ (@suggestions_mntpoints, map { $_->{mntpoint} } @suggestions);
+}
-#sub partitionDrives {
-#
-# my $cmd = "/sbin/fdisk";
-# -x $cmd or $cmd = "/usr/bin/fdisk";
-#
-# my $drives = findDrivesPresent() or die "You don't have any hard drives available! You probably forgot to configure a SCSI controller.";
-#
-# foreach (@$drives) {
-# my $text = "/dev/" . $_->{device};
-# $text .= " - SCSI ID " . $_->{id} if $_->{device} =~ /^sd/;
-# $text .= " - Model " . $_->{info};
-# $text .= " array" if $_->{device} =~ /^c.d/;
-#
-# # truncate at 50 columns for now
-# $text = substr $text, 0, 50;
-# }
-# #TODO TODO
-#}
-
-
-
-sub checkMountPoint($$) {
-# my $type = shift;
-# local $_ = shift;
-#
-# m|^/| or die "The mount point $_ is illegal.\nMount points must begin with a leading /";
-# m|(.)/$| and die "The mount point $_ is illegal.\nMount points may not end with a /";
-# c::isprint($_) or die "The mount point $_ is illegal.\nMount points must be made of printable characters (no accents...)";
-#
-# foreach my $dev (qw(/dev /bin /sbin /etc /lib)) {
-# /^$dev/ and die "The $_ directory must be on the root filesystem.",
-# }
-#
-# if ($type eq 'linux_native') {
-# $_ eq '/'; and return 1;
-# foreach my $r (qw(/var /tmp /boot /root)) {
-# /^$r/ and return 1;
-# }
-# die "The mount point $_ is illegal.\nSystem partitions must be on Linux Native partitions";
-# }
-# 1;
-}
-
-sub removeFromList($$$) {
- my ($start, $end, $list) = @_;
- my $err = "error in removeFromList: removing an non-free block";
-
- for (my $i = 0; $i < @$list; $i += 2) {
- $start < $list->[$i] and die $err;
- $start > $list->[$i + 1] and next;
-
- if ($start == $list->[$i]) {
- $end > $list->[$i + 1] and die $err;
- if ($end == $list->[$i + 1]) {
- # the free block is just the same size, removing it
- splice(@$list, 0, 2);
- } else {
- # the free block now start just after this block
- $list->[$i] = $end;
- }
- } else {
- $end <= $list->[$i + 1] or die $err;
- if ($end < $list->[$i + 1]) {
- splice(@$list, $i + 2, 0, $end, $list->[$i + 1]);
- }
- $list->[$i + 1] = $start; # shorten the free block
+#-sub partitionDrives {
+#-
+#- my $cmd = "/sbin/fdisk";
+#- -x $cmd or $cmd = "/usr/bin/fdisk";
+#-
+#- my $drives = findDrivesPresent() or die "You don't have any hard drives available! You probably forgot to configure a SCSI controller.";
+#-
+#- foreach (@$drives) {
+#- my $text = "/dev/" . $_->{device};
+#- $text .= " - SCSI ID " . $_->{id} if $_->{device} =~ /^sd/;
+#- $text .= " - Model " . $_->{info};
+#- $text .= " array" if $_->{device} =~ /^c.d/;
+#-
+#- #- truncate at 50 columns for now
+#- $text = substr $text, 0, 50;
+#- }
+#- #-TODO TODO
+#-}
+
+
+sub mntpoint2part {
+ my ($mntpoint, $fstab) = @_;
+ first(grep { $mntpoint eq $_->{mntpoint} } @$fstab);
+}
+sub has_mntpoint {
+ my ($mntpoint, $hds) = @_;
+ mntpoint2part($mntpoint, [ get_fstab(@$hds) ]);
+}
+sub get_root_ {
+ my ($fstab, $boot) = @_;
+ $boot && mntpoint2part("/boot", $fstab) || mntpoint2part("/", $fstab);
+}
+sub get_root { &get_root_ || {} }
+
+#- do this before modifying $part->{mntpoint}
+#- $part->{mntpoint} should not be used here, use $mntpoint instead
+sub check_mntpoint {
+ my ($mntpoint, $hd, $part, $hds, $loopbackDevice) = @_;
+
+ ref $loopbackDevice or undef $loopbackDevice;
+
+ $mntpoint eq '' || isSwap($part) || isRAID($part) and return;
+
+ local $_ = $mntpoint;
+ m|^/| or die _("Mount points must begin with a leading /");
+#- m|(.)/$| and die "The mount point $_ is illegal.\nMount points may not end with a /";
+
+ has_mntpoint($mntpoint, $hds) and die _("There is already a partition with mount point %s\n", $mntpoint);
+
+ my $fake_part = { mntpoint => $mntpoint, device => $loopbackDevice };
+ $fake_part->{loopback_file} = 1 if $loopbackDevice;
+ my $fstab = [ get_fstab(@$hds), $fake_part ];
+ my $check; $check = sub {
+ my ($p, @seen) = @_;
+ push @seen, $p->{mntpoint} || return;
+ @seen > 1 && $p->{mntpoint} eq $mntpoint and die _("Circular mounts %s\n", join(", ", @seen));
+ if (my $part = fs::up_mount_point($p->{mntpoint}, $fstab)) {
+ #- '/' carrier is a special case, it will be mounted first
+ $check->($part, @seen) unless loopback::carryRootLoopback($p);
}
- return;
- }
+ if (isLoopback($p)) {
+ $check->($p->{device}, @seen);
+ }
+ };
+ $check->($fake_part) unless $mntpoint eq '/' && $loopbackDevice; #- '/' is a special case, no loop check
+
+ die "raid / with no /boot" if $mntpoint eq "/" && isMDRAID($part) && !has_mntpoint("/boot", $hds);
+ die _("This directory should remain within the root filesystem") if member($mntpoint, qw(/bin /dev /etc /lib /sbin));
+ die _("You need a true filesystem (ext2, reiserfs) for this mount point\n") if !isTrueFS($part) && member($mntpoint, qw(/ /home /tmp /usr /var));
+#- if ($part->{start} + $part->{size} > 1024 * $hd->cylinder_size() && arch() =~ /i.86/) {
+#- die "/boot ending on cylinder > 1024" if $mntpoint eq "/boot";
+#- die "/ ending on cylinder > 1024" if $mntpoint eq "/" && !has_mntpoint("/boot", $hds);
+#- }
}
+sub add($$$;$) {
+ my ($hd, $part, $hds, $options) = @_;
+
+ isSwap($part) ?
+ ($part->{mntpoint} = 'swap') :
+ $options->{force} || check_mntpoint($part->{mntpoint}, $hd, $part, $hds);
+
+ delete $part->{maxsize};
+ partition_table::add($hd, $part, $options->{primaryOrExtended});
+}
sub allocatePartitions($$) {
my ($hds, $to_add) = @_;
- my %free_sectors = map { $_->{device} => [1, $_->{totalsectors} ] } @$hds; # first sector is always occupied by the MBR
- my $remove = sub { removeFromList($_->{start}, $_->{start} + $_->{size}, $free_sectors{$_->{rootDevice}}) };
- my $success = 0;
-
- foreach (get_fstab(@$hds)) { &$remove(); }
- FSTAB: foreach (@$to_add) {
- foreach my $hd (@$hds) {
- my $v = $free_sectors{$hd->{device}};
- for (my $i = 0; $i < @$v; $i += 2) {
- my $size = $v->[$i + 1] - $v->[$i];
- $_->{size} > $size and next;
- $_->{start} = $v->[$i];
- $_->{rootDevice} = $hd->{device};
- partition_table::adjustStartAndEnd($hd, $_);
- &$remove();
- partition_table::add($hd, $_);
- $success++;
- next FSTAB;
+ foreach my $hd (@$hds) {
+ foreach (partition_table::get_holes($hd)) {
+ my ($start, $size) = @$_{"start", "size"};
+ my $part;
+ while (suggest_part($part = { start => $start, size => 0, maxsize => $size, rootDevice => $hd->{device} },
+ $hds, $to_add)) {
+ add($hd, $part, $hds);
+ $size -= $part->{size} + $part->{start} - $start;
+ $start = $part->{start} + $part->{size};
}
}
- log::ld("can't allocate partition $_->{mntpoint} of size $_->{size}, not enough room");
}
- $success;
}
sub auto_allocate($;$) {
- my ($hds, $suggestions) = @_;
+ my ($hds, $suggestions) = @_;
allocatePartitions($hds, $suggestions || \@suggestions);
map { partition_table::assign_device_numbers($_) } @$hds;
}
+
+sub undo_prepare($) {
+ my ($hds) = @_;
+ $Data::Dumper::Purity = 1;
+ foreach (@$hds) {
+ my @h = @{$_}{@partition_table::fields2save};
+ push @{$_->{undo}}, Data::Dumper->Dump([\@h], ['$h']);
+ }
+}
+sub undo($) {
+ my ($hds) = @_;
+ foreach (@$hds) {
+ my $h; eval pop @{$_->{undo}} || next;
+ @{$_}{@partition_table::fields2save} = @$h;
+
+ $_->{isDirty} = $_->{needKernelReread} = 1 if $_->{hasBeenDirty};
+ }
+}
+
+sub move {
+ my ($hd, $part, $hd2, $sector2) = @_;
+
+ my $part1 = { %$part };
+ my $part2 = { %$part };
+ $part2->{start} = $sector2;
+ $part2->{size} += $hd2->cylinder_size() - 1;
+ partition_table::remove($hd, $part);
+ {
+ local ($part2->{notFormatted}, $part2->{isFormatted}); #- do not allow partition::add to change this
+ partition_table::add($hd2, $part2);
+ }
+
+ return if $part2->{notFormatted} && !$part2->{isFormatted} || $::testing;
+
+ local (*F, *G);
+ sysopen F, $hd->{file}, 0 or die '';
+ sysopen G, $hd2->{file}, 2 or die _("Error opening %s for writing: %s", $hd2->{file}, "$!");
+
+ my $base = $part1->{start};
+ my $base2 = $part2->{start};
+ my $step = 10;
+ if ($hd eq $hd2) {
+ $base == $base2 and return;
+ $step = min($step, abs($base2 - $base));
+
+ if ($base < $base2) {
+ $base += $part1->{size} - $step;
+ $base2 += $part1->{size} - $step;
+ $step = -$step;
+ }
+ }
+
+ my $f = sub {
+ $base < 0 and $base2 += -$base, $base = 0;
+ $base2 < 0 and $base += -$base2, $base2 = 0;
+ c::lseek_sector(fileno(F), $base, 0) or die "seeking to sector $base failed on drive $hd->{device}";
+ c::lseek_sector(fileno(G), $base2, 0) or die "seeking to sector $base2 failed on drive $hd2->{device}";
+
+ my $buf;
+ sysread F, $buf, $SECTORSIZE * abs($_[0]) or die '';
+ syswrite G, $buf;
+ };
+
+ for (my $i = 0; $i < $part1->{size} / abs($step); $i++, $base += $step, $base2 += $step) {
+ print "$base $base2\n";
+ &$f($step);
+ }
+ if (my $v = ($part1->{size} % abs($step)) * sign($step)) {
+ $base += $v;
+ $base2 += $v;
+ &$f($v);
+ }
+}
+
+sub change_type($$$) {
+ my ($hd, $part, $type) = @_;
+ $type != $part->{type} or return;
+ $hd->{isDirty} = 1;
+ $part->{mntpoint} = '' if isSwap($part) && $part->{mntpoint} eq "swap";
+ $part->{type} = $type;
+ $part->{notFormatted} = 1;
+ $part->{isFormatted} = 0;
+}
+
+sub rescuept($) {
+ my ($hd) = @_;
+ my ($ext, @hd);
+
+ my $dev = devices::make($hd->{device});
+ local *F; open F, "rescuept $dev|";
+ local $_;
+ while (<F>) {
+ my ($st, $si, $id) = /start=\s*(\d+),\s*size=\s*(\d+),\s*Id=\s*(\d+)/ or next;
+ my $part = { start => $st, size => $si, type => hex($id) };
+ if (isExtended($part)) {
+ $ext = $part;
+ } else {
+ push @hd, $part;
+ }
+ }
+ close F or die "rescuept failed";
+
+ partition_table_raw::zero_MBR($hd);
+ foreach (@hd) {
+ my $b = partition_table::verifyInside($_, $ext);
+ if ($b) {
+ $_->{start}--;
+ $_->{size}++;
+ }
+ local $_->{notFormatted};
+
+ partition_table::add($hd, $_, ($b ? 'Extended' : 'Primary'), 1);
+ }
+}
+
+sub verifyHds {
+ my ($hds, $readonly, $ok) = @_;
+
+ if (is_empty_array_ref($hds)) { #- no way
+ die _("An error has occurred - no valid devices were found on which to create new filesystems. Please check your hardware for the cause of this problem");
+ }
+
+ my @parts = readProcPartitions($hds);
+ $ok &&= @parts == listlength(get_fstab(@$hds)) unless arch() eq "ppc";
+
+ if ($readonly && !$ok) {
+ log::l("using /proc/partitions as diskdrake failed :(");
+ foreach my $hd (@$hds) {
+ partition_table_raw::zero_MBR($hd);
+ $hd->{primary} = { normal => [ grep { $hd->{device} eq $_->{rootDevice} } @parts ] };
+ }
+ $ok = 1;
+ }
+ $readonly && get_fstab(@$hds) == 0 and die _("You don't have any partitions!");
+ $ok;
+}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1; #
diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm
index e6c27e68c..a82729c6e 100644
--- a/perl-install/ftp.pm
+++ b/perl-install/ftp.pm
@@ -1,19 +1,18 @@
-package ftp;
+package ftp; # $Id$
use Net::FTP;
use install_any;
+use network;
use log;
-# non-rentrant!!
+my %hosts;
-my %options = (Passive => 1);
-$options{Firewall} = $ENV{PROXY} if $ENV{PROXY};
-$options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT};
-my @l;
-unless ($ENV{HOST}) {
- # must be in kickstart, using URLPREFIX to find out information
- ($ENV{LOGIN}, $ENV{PASSWORD}, $ENV{HOST}, $ENV{PREFIX}) = @l =
+1;
+
+sub fromEnv() {
+ # using URLPREFIX to find out information if kickstart
+ ($ENV{LOGIN}, $ENV{PASSWORD}, $ENV{HOST}, $ENV{PREFIX}) =
$ENV{URLPREFIX} =~ m|
://
(?: ([^:]*) # login
@@ -21,29 +20,60 @@ unless ($ENV{HOST}) {
@)?
([^/]*) # host
/?(.*) # prefix
- |x;
-}
-unless ($ENV{LOGIN}) {
- $ENV{LOGIN} = 'anonymous';
- $ENV{PASSWORD} = 'mdkinst@test';
+ |x unless $ENV{HOST};
+
+ @ENV{qw(HOST PREFIX LOGIN PASSWORD)};
}
-my $host = $ENV{HOST};
-if ($host !~ /^[.\d]+$/) {
- $host = join ".", unpack "C4", (gethostbyname $host)[4];
- print ">>>>> $host <<<<<<\n";
-}
+sub new {
+ my ($host, $prefix, $login, $password) = @_;
+ my @l = do { if ($hosts{"$host$prefix"}) {
+ @{$hosts{"$host$prefix"}};
+ } else {
+ my %options = (Passive => 1, Timeout => 60, Port => 21);
+ $options{Firewall} = $ENV{PROXY} if $ENV{PROXY};
+ $options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT};
+ unless ($login) {
+ $login = 'anonymous';
+ $password = '-drakx@';
+ }
-my $ftp = Net::FTP->new($host, %options) or die;
-$ftp->login($ENV{LOGIN}, $ENV{PASSWORD}) or die;
-$ftp->binary;
+ my $ftp = Net::FTP->new(network::resolv($host), %options) or die '';
+ $ftp->login($login, $password) or die '';
+ $ftp->binary;
+ $ftp->cwd($prefix);
-my $retr;
+ my @l = ($ftp, \ (my $retr = undef));
+ $hosts{"$host$prefix"} = \@l;
+ @l;
+ }};
+ wantarray ? @l : $l[0];
+}
-1;
+sub getFile {
+ my $f = shift;
+ my ($ftp, $retr) = new(@_ ? @_ : fromEnv);
+ $$retr->close if $$retr;
+ $$retr = $ftp->retr($f) or rewindGetFile();
+ $$retr ||= $ftp->retr($f);
+}
+
+#-sub closeFiles() {
+#- #- close any existing connections
+#- foreach (values %hosts) {
+#- my $retr = $_->[1] if ref $_;
+#- $$retr->close if $$retr;
+#- undef $$retr;
+#- }
+#-}
+sub rewindGetFile() {
+ #- close any existing connection.
+ foreach (values %hosts) {
+ my ($ftp) = @{$_ || []};
+ $ftp->close() if $ftp;
+ }
-sub getFile($) {
- $retr->close if $retr;
- $retr = $ftp->retr($ENV{PREFIX} . "/" . install_any::relGetFile($_[0]));
+ #- make sure to reconnect to server.
+ %hosts = ();
}
diff --git a/perl-install/g_auto_install b/perl-install/g_auto_install
index 41a5d3303..871a15945 100755
--- a/perl-install/g_auto_install
+++ b/perl-install/g_auto_install
@@ -1,13 +1,12 @@
#!../perl
-@ARGV == 0 or die "usage: $0\n";
-
my $dir = `pwd`;
chomp $dir;
$dir .= "/../../..";
$ENV{PERL5LIB} = join ":", map { "$dir/$_" } @INC;
-$ENV{LD_LIBRARY_PATH} = "$dir/usr/lib";
-$ENV{PATH} = join ":", map { "$dir/$_" } split ":", "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin";
+$ENV{LD_LIBRARY_PATH} = "$dir/lib:$dir/usr/lib";
+$ENV{PATH} = join(":", map { "$dir/$_" } split ":", "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin") . ":$ENV{PATH}";
+$ENV{SHARE_PATH} = "$dir/usr/share";
-exec "../perl", "./install2", "--g_auto_install" or die;
+exec "../../../lib/ld-linux.so.2", "../perl", "./install2", "--g_auto_install", @ARGV or die;
diff --git a/perl-install/help.pm b/perl-install/help.pm
index 1967f35b5..3bedeae13 100644
--- a/perl-install/help.pm
+++ b/perl-install/help.pm
@@ -1,332 +1,998 @@
-package help;
+package help; # $Id$
use common qw(:common);
%steps = (
-selectLanguage =>
- __("Choose preferred language for install and system usage."),
+empty => '',
+
+selectLanguage =>
+ __("Please choose your preferred language for installation and system usage."),
+
+license =>
+ __("You need to accept the terms of the above license to continue installation.
+
+
+Please click on \"Accept\" if you agree with its terms.
+
+
+Please click on \"Refuse\" if you disagree with its terms. Installation will end without modifying your current
+configuration."),
selectKeyboard =>
- __("Choose on the list of keyboards, the one corresponding to yours"),
+ __("Choose the layout corresponding to your keyboard from the list above"),
+
+selectLangs =>
+ __("If you wish other languages (than the one you choose at
+beginning of installation) will be available after installation, please chose
+them in list above. If you want select all, you just need to select \"All\"."),
+
+selectInstallClass =>
+ __("Please choose \"Install\" if there are no previous version of Linux-Mandrake
+installed or if you wish to use several operating systems.
-selectPath =>
- __("Choose \"Installation\" if there are no previous versions of Linux
-installed, or if you wish use to multiple distributions or versions.
-Choose \"Update\" if you wish to update a previous version of Mandrake
-Linux: 5.1 (Venice), 5.2 (Leeloo), 5.3 (Festen) or 6.0 (Venus)."),
+Please choose \"Update\" if you wish to update an already installed version of Linux-Mandrake.
-selectInstallClass =>
+
+Depend of your knowledge in GNU/Linux, you can choose one of the following levels to install or update your
+Linux-Mandrake operating system:
+
+ * Recommanded: if you have never installed a GNU/Linux operating system choose this. Installation will be
+ be very easy and you will be asked only on few questions.
+
+
+ * Customized: if you are familiar enough with GNU/Linux, you may choose the primary usage (workstation, server,
+ development) of your sytem. You will need to answer to more questions than in \"Recommanded\" installation
+ class, so you need to know how GNU/Linux works to choose this installation class.
+
+
+ * Expert: if you have a good knowledge in GNU/Linux, you can choose this installation class. As in \"Customized\"
+ installation class, you will be able to choose the primary usage (workstation, server, development). Be very
+ careful before choose this installation class. You will be able to perform a higly customized installation.
+ Answer to some questions can be very difficult if you haven't a good knowledge in GNU/Linux. So, don't choose
+ this installation class unless you know what you are doing."),
+
+selectInstallClassCorpo =>
__("Select:
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
-customized installation, this Install Class is for you."),
+
+ - Customized: If you are familiar enough with GNU/Linux, you may then choose
+ the primary usage for your machine. See below for details.
+
+
+ - Expert: This supposes that you are fluent with GNU/Linux and want to
+ perform a highly customized installation. As for a \"Customized\"
+ installation class, you will be able to select the usage for your system.
+ But please, please, DO NOT CHOOSE THIS UNLESS YOU KNOW WHAT YOU ARE DOING!"),
+
+selectInstallClass2 =>
+ __("You must now define your machine usage. Choices are:
+
+ * Workstation: this the ideal choice if you intend to use your machine primarily for everyday use, at office or
+ at home.
+
+
+ * Development: if you intend to use your machine primarily for software development, it is the good choice. You
+ will then have a complete collection of software installed in order to compile, debug and format source code,
+ or create software packages.
+
+
+ * Server: if you intend to use this machine as a server, it is the good choice. Either a file server (NFS or
+ SMB), a print server (Unix style or Microsoft Windows style), an authentication server (NIS), a database
+ server and so on. As such, do not expect any gimmicks (KDE, GNOME, etc.) to be installed."),
setupSCSI =>
- __("The system did not detect a SCSI card. If you have one (or several)
-click on \"Yes\" and choose the module(s) to be tested. Otherwise,
-select \"No\".
-
-If you don't know if your computer has SCSI interfaces, consult the
-original documentation delivered with the computer, or if you use
-Microsoft Windows 95/98, inspect the information available via the \"Control
-panel\", \"System's icon, \"Device Manager\" tab."),
-
-partitionDisks =>
- __("At this point, hard drive partitions must be defined. (Unless you
-are overwriting a previous install of Linux and have already defined
-your hard drives partitions as desired.) This operation consists of
-logically dividing the computer's hard drive capacity into separate
-areas for use. Two common partition are: \"root\" which is the point at
-which the filesystem's directory structure starts, and \"boot\", which
-contains those files necessary to start the operating system when the
-computer is first turned on. Because the effects of this process are
-usually irreversible, partitioning can be intimidating and stressful to
-the inexperienced. DiskDrake simplifies the process so that it need not
-be. Consult the documentation and take your time before proceeding."),
+ __("DrakX will attempt to look for PCI SCSI adapter(s). If DrakX
+finds an SCSI adapter and knows which driver to use, it will be automatically
+installed.
-formatPartitions =>
- __("Any partitions that have been newly defined must be formatted for
-use. At this time, you may wish to re-format some pre-existing
-partitions to erase the data they contain. Note: it is not necessary to
-re-format pre-existing partitions, particularly if they contain files or
-data you wish to keep. Typically retained are: /home and /usr/local."),
-choosePackages =>
- __("You may now select the packages you wish to install.
+If you have no SCSI adapter, an ISA SCSI adapter or a PCI SCSI adapter that
+DrakX doesn't recognize, you will be asked if a SCSI adapter is present in your
+system. If there is no adapter present, you can click on \"No\". If you click on
+\"Yes\", a list of drivers will be presented from which you can select your
+specific adapter.
-Please note that some packages require the installation of others. These
-are referred to as package dependencies. The packages you select, and
-the packages they require will automatically be added to the
-installation configuration. It is impossible to install a package
-without installing all of its dependencies.
-Information on each category and specific package is available in the
-area titled \"Info\". This is located above the buttons: [confirmation]
-[selection] [unselection]."),
+If you have to manually specify your adapter, DrakX will ask if you want to
+specify options for it. You should allow DrakX to probe the hardware for the
+options. This usually works well.
-doInstallStep =>
- __("The packages selected are now being installed. This operation
-should only take a few minutes."),
-configureMouse =>
- __("Help"),
+If not, you will need to provide options to the driver. Please review the User
+Guide (chapter 3, section \"Collective informations on your hardware) for hints
+on retrieving this information from hardware documentation, from the
+manufacturer's Web site (if you have Internet access) or from Microsoft Windows
+(if you have it on your system)."),
-configureNetwork =>
- __("Help"),
+doPartitionDisks =>
+ __("At this point, you need to choose where to install your
+Linux-Mandrake operating system on your hard drive. If it is empty or if an
+existing operating system uses all the space available on it, you need to
+partition it. Basically, partitioning a hard drive consists of logically
+dividing it to create space to install your new Linux-Mandrake system.
-configureTimezone =>
- __("Help"),
-configureServices =>
- __("Help"),
+Because the effects of the partitioning process are usually irreversible,
+partitioning can be intimidating and stressful if you are an inexperienced user.
+This wizard simplifies this process. Before beginning, please consult the manual
+and take your time.
-configurePrinter =>
- __("Help"),
-setRootPassword =>
- __("An administrator password for your Linux system must now be
-assigned. The password must be entered twice to verify that both
-password entries are identical.
-
-Choose this password carefully. Only persons with access to an
-administrator account can maintain and administer the system.
-Alternatively, unauthorized use of an administrator account can be
-extremely dangerous to the integrity of the system, the data upon it,
-and other systems with which it is interfaced. The password should be a
-mixture of alphanumeric characters and a least 8 characters long. It
-should never be written down. Do not make the password too long or
-complicated that it will be difficult to remember.
-
-When you login as Administrator, at \"login\" type \"root\" and at
-\"password\", type the password that was created here."),
+You need at least two partitions. One is for the operating system itself and the
+other is for the virtual memory (also called Swap).
-addUser =>
- __("You can now authorize one or more people to use your Linux
-system. Each user account will have their own customizable environment.
-It is very important that you create a regular user account, even if
-there will only be one principle user of the system. The administrative
-\"root\" account should not be used for day to day operation of the
-computer. It is a security risk. The use of a regular user account
-protects you and the system from yourself. The root account should only
-be used for administrative and maintenance tasks that can not be
-accomplished from a regular user account."),
+If partitions have been already defined (from a previous installation or from
+another partitioning tool), you just need choose those to use to install your
+Linux system.
-createBootdisk =>
- __("Help"),
-setupBootloader =>
- __("You need to indicate where you wish
-to place the information required to boot to Linux.
+If partitions haven't been already defined, you need to create them.
+To do that, use the wizard available above. Depending of your hard drive
+configuration, several solutions can be available:
-Unless you know exactly what you are doing, choose \"First sector of
-drive\"."),
+ * Use existing partition: the wizard has detected one or more existing Linux partitions on your hard drive. If
+ you want to keep them, choose this option.
-configureX =>
- __("It is now time to configure the video card and monitor
-configuration for the X Window Graphic User Interface (GUI). First
-select your monitor. Next, you may test the configuration and change
-your selections if necessary."),
-exitInstall =>
- __("Help"),
-);
-#- ################################################################################
-%steps_long = (
-selectLanguage =>
- __("Choose preferred language for install and system usage."),
+ * Erase entire disk: if you want delete all data and all partitions present on your hard drive and replace them by
+ your new Linux-Mandrake system, you can choose this option. Be careful with this solution, you will not be
+ able to revert your choice after confirmation.
-selectKeyboard =>
- __("Choose on the list of keyboards, the one corresponding to yours"),
-
-selectPath =>
- __("Choose \"Installation\" if there are no previous versions of Linux
-installed, or if you wish use to multiple distributions or versions.
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
-
-Choose \"Update\" if you wish to update a previous version of Mandrake
-Linux: 5.1 (Venice), 5.2 (Leeloo), 5.3 (Festen) or 6.0 (Venus)."),
-
-selectInstallClass =>
- __("Select:
- - Beginner: If you have not installed Linux before, or wish to install
-the distribution elected \"Product of the year\" for 1999, click here.
- - Developer: If you are familiar with Linux and will be using the
-computer primarily for software development, you will find happiness
-here.
- - Server: If you wish to install a general purpose server, or the
-Linux distribution elected \"Distribution/Server\" for 1999, select
-this.
- - Expert: If you know GNU/Linux and want to perform a highly
-customized installation, this Install Class is for you."),
-setupSCSI =>
- __("The system did not detect a SCSI card. If you have one (or several)
-click on \"Yes\" and choose the module(s) to be tested. Otherwise,
-select \"No\".
-
-If you don't know if your computer has SCSI interfaces, consult the
-original documentation delivered with the computer, or if you use
-Microsoft Windows 95/98, inspect the information available via the \"Control
-panel\", \"System's icon, \"Device Manager\" tab."),
-
-partitionDisks =>
- __("At this point, hard drive partitions must be defined. (Unless you
-are overwriting a previous install of Linux and have already defined
-your hard drives partitions as desired.) This operation consists of
-logically dividing the computer's hard drive capacity into separate
-areas for use. Two common partition are: \"root\" which is the point at
-which the filesystem's directory structure starts, and \"boot\", which
-contains those files necessary to start the operating system when the
-computer is first turned on. Because the effects of this process are
-usually irreversible, partitioning can be intimidating and stressful to
-the inexperienced. DiskDrake simplifies the process so that it need not
-be. Consult the documentation and take your time before proceeding."),
+ * Use the free space on the Windows partition: if Microsoft Windows is installed on your hard drive and takes
+ all space available on it, you have to create free space for Linux data. To do that you can delete your
+ Microsoft Windows partition and data (see \"Erase entire disk\" or \"Expert mode\" solutions) or resize your
+ Microsoft Windows partition. Resizing can be performed without loss of any data. This solution is
+ recommended if you want use both Linux-Mandrake and Microsoft Windows on same computer.
+
+
+ Before choosing this solution, please understand that the size of your Microsoft
+ Windows partition will be smaller than at present time. It means that you will have less free space under
+ Microsoft Windows to store your data or install new software.
+
+
+ * Expert mode: if you want to partition manually your hard drive, you can choose this option. Be careful before
+ choosing this solution. It is powerful but it is very dangerous. You can lose all your data very easily. So,
+ don't choose this solution unless you know what you are doing."),
+
+partition_with_diskdrake =>
+ __("At this point, you need to choose what
+partition(s) to use to install your new Linux-Mandrake system. If partitions
+have been already defined (from a previous installation of GNU/Linux or from
+another partitioning tool), you can use existing partitions. In other cases,
+hard drive partitions must be defined.
+
+
+To create partitions, you must first select a hard drive. You can select the
+disk for partitioning by clicking on \"hda\" for the first IDE drive, \"hdb\" for
+the second or \"sda\" for the first SCSI drive and so on.
+
+
+To partition the selected hard drive, you can use these options:
+
+ * Clear all: this option deletes all partitions available on the selected hard drive.
+
+
+ * Auto allocate:: this option allows you to automatically create Ext2 and swap partitions in free space of your
+ hard drive.
+
+
+ * Rescue partition table: if your partition table is damaged, you can try to recover it using this option. Please
+ be careful and remember that it can fail.
+
+
+ * Undo: you can use this option to cancel your changes.
+
+
+ * Reload: you can use this option if you wish to undo all changes and load your initial partitions table
+
+
+ * Wizard: If you wish to use a wizard to partition your hard drive, you can use this option. It is recommended if
+ you do not have a good knowledge in partitioning.
+
+
+ * Restore from floppy: if you have saved your partition table on a floppy during a previous installation, you can
+ recover it using this option.
+
+
+ * Save on floppy: if you wish to save your partition table on a floppy to be able to recover it, you can use this
+ option. It is strongly recommended to use this option
+
+
+ * Done: when you have finished partitioning your hard drive, use this option to save your changes.
+
+
+For information, you can reach any option using the keyboard: navigate trough the partitions using Tab and Up/Down arrows.
+
+
+When a partition is selected, you can use:
+
+ * Ctrl-c to create a new partition (when a empty partition is selected)
+
+ * Ctrl-d to delete a partition
+
+ * Ctrl-m to set the mount point"),
+
+ask_mntpoint_s =>
+ __("Above are listed the existing Linux partitions detected on
+your hard drive. You can keep choices make by the wizard, they are good for a
+common usage. If you change these choices, you must at least define a root
+partition (\"/\"). Don't choose a too little partition or you will not be able
+to install enough software. If you want store your data on a separate partition,
+you need also to choose a \"/home\" (only possible if you have more than one
+Linux partition available).
+
+
+For information, each partition is listed as follows: \"Name\", \"Capacity\".
+
+
+\"Name\" is coded as follow: \"hard drive type\", \"hard drive number\",
+\"partition number\" (for example, \"hda1\").
+
+
+\"Hard drive type\" is \"hd\" if your hard drive is an IDE hard drive and \"sd\"
+if it is an SCSI hard drive.
+
+
+\"Hard drive number\" is always a letter after \"hd\" or \"sd\". With IDE hard drives:
+
+ * \"a\" means \"master hard drive on the primary IDE controller\",
+
+ * \"b\" means \"slave hard drive on the primary IDE controller\",
+
+ * \"c\" means \"master hard drive on the secondary IDE controller\",
+
+ * \"d\" means \"slave hard drive on the secondary IDE controller\".
+
+
+With SCSI hard drives, a \"a\" means \"primary hard drive\", a \"b\" means \"secondary hard drive\", etc..."),
+
+takeOverHdChoose =>
+ __("Choose the hard drive you want to erase to install your
+new Linux-Mandrake partition. Be careful, all data present on it will be lost
+and will not be recoverable."),
+
+takeOverHdConfirm =>
+ __("Click on \"OK\" if you want to delete all data and
+partitions present on this hard drive. Be careful, after clicking on \"OK\", you
+will not be able to recover any data and partitions present on this hard drive,
+including any Windows data.
+
+
+Click on \"Cancel\" to cancel this operation without losing any data and
+partitions present on this hard drive."),
+
+resizeFATChoose =>
+ __("More than one Microsoft Windows partition have been
+detected on your hard drive. Please choose the one you want resize to install
+your new Linux-Mandrake operating system.
+
+
+For information, each partition is listed as follow; \"Linux name\", \"Windows
+name\" \"Capacity\".
+
+\"Linux name\" is coded as follow: \"hard drive type\", \"hard drive number\",
+\"partition number\" (for example, \"hda1\").
+
+
+\"Hard drive type\" is \"hd\" if your hard dive is an IDE hard drive and \"sd\"
+if it is an SCSI hard drive.
+
+
+\"Hard drive number\" is always a letter putted after \"hd\" or \"sd\". With IDE hard drives:
+
+ * \"a\" means \"master hard drive on the primary IDE controller\",
+
+ * \"b\" means \"slave hard drive on the primary IDE controller\",
+
+ * \"c\" means \"master hard drive on the secondary IDE controller\",
+
+ * \"d\" means \"slave hard drive on the secondary IDE controller\".
+
+With SCSI hard drives, a \"a\" means \"primary hard drive\", a \"b\" means \"secondary hard drive\", etc.
+
+
+\"Windows name\" is the letter of your hard drive under Windows (the first disk
+or partition is called \"C:\")."),
+
+resizeFATWait =>
+ __("Please be patient. This operation can take several minutes."),
formatPartitions =>
- __("Any partitions that have been newly defined must be formatted for
-use. At this time, you may wish to re-format some pre-existing
-partitions to erase the data they contain. Note: it is not necessary to
-re-format pre-existing partitions, particularly if they contain files or
-data you wish to keep. Typically retained are: /home and /usr/local."),
+ __("Any partitions that have been newly defined must be
+formatted for use (formatting meaning creating a filesystem).
+
+
+At this time, you may wish to reformat some already existing partitions to erase
+the data they contain. If you wish do that, please also select the partitions
+you want to format.
+
+
+Please note that it is not necessary to reformat all pre-existing partitions.
+You must reformat the partitions containing the operating system (such as \"/\",
+\"/usr\" or \"/var\") but do you no have to reformat partitions containing data
+that you wish to keep (typically /home).
+
+
+Please be careful selecting partitions, after formatting, all data will be
+deleted and you will not be able to recover any of them.
+
+
+Click on \"OK\" when you are ready to format partitions.
+
+
+Click on \"Cancel\" if you want to choose other partitions to install your new
+Linux-Mandrake operating system."),
choosePackages =>
- __("You may now select the packages you wish to install.
+ __("You may now select the group of packages you wish to
+install or upgrade.
+
+
+DrakX will then check whether you have enough room to install them all. If not,
+it will warn you about it. If you want to go on anyway, it will proceed onto the
+installation of all selected groups but will drop some packages of lesser
+interest. At the bottom of the list you can select the option
+\"Individual package selection\"; in this case you will have to browse through
+more than 1000 packages..."),
+
+choosePackagesTree =>
+ __("You can now choose individually all the packages you
+wish to install.
+
+
+You can expand or collapse the tree by clicking on options in the left corner of
+the packages window.
+
+
+If you prefer to see packages sorted in alphabetic order, click on the icon
+\"Toggle flat and group sorted\".
-Please note that some packages require the installation of others. These
-are referred to as package dependencies. The packages you select, and
-the packages they require will automatically be added to the
-installation configuration. It is impossible to install a package
-without installing all of its dependencies.
-Information on each category and specific package is available in the
-area titled \"Info\". This is located above the buttons: [confirmation]
-[selection] [unselection]."),
+If you want not to be warned on dependencies, click on \"Automatic
+dependencies\". If you do this, note that unselecting one package may silently
+unselect several other packages which depend on it."),
-doInstallStep =>
- __("The packages selected are now being installed. This operation
-should only take a few minutes."),
+chooseCD =>
+ __("If you have all the CDs in the list above, click Ok. If you have
+none of those CDs, click Cancel. If only some CDs are missing, unselect them,
+then click Ok."),
-configureMouse =>
- __("Help"),
+installPackages =>
+ __("Your new Linux-Mandrake operating system is currently being
+installed. This operation should take a few minutes (it depends on size you
+choose to install and the speed of your computer).
-configureNetwork =>
- __("Help"),
+
+Please be patient."),
+
+selectMouse =>
+ __( "You can now test your mouse. Use buttons and wheel to verify
+if settings are good. If not, you can click on \"Cancel\" to choose another
+driver."),
+
+selectSerialPort =>
+ __("Please select the correct port. For example, the COM1
+port under MS Windows is named ttyS0 under GNU/Linux."),
+
+configureNetwork =>
+ __("If you wish to connect your computer to the Internet or
+to a local network please choose the correct option. Please turn on your device
+before choosing the correct option to let DrakX detect it automatically.
+
+
+If you do not have any connection to the Internet or a local network, choose
+\"Disable networking\".
+
+
+If you wish to configure the network later after installation or if you have
+finished to configure your network connection, choose \"Done\"."),
+
+configureNetworkNoModemFound =>
+ __("No modem has been detected. Please select the serial port on which it is plugged.
+
+
+For information, the first serial port (called \"COM1\" under Microsoft
+Windows) is called \"ttyS0\" under Linux."),
+
+configureNetworkDNS =>
+ __("You may now enter dialup options. If you don't know
+or are not sure what to enter, the correct informations can be obtained from
+your Internet Service Provider. If you do not enter the DNS (name server)
+information here, this information will be obtained from your Internet Service
+Provider at connection time."),
+
+configureNetworkISDN =>
+ __("If your modem is an external modem, please turn on it now to let DrakX detect it automatically."),
+
+configureNetworkADSL =>
+ __("Please turn on your modem and choose the correct one."),
+
+configureNetworkADSL2 =>
+ __("If you are not sure if informations above are
+correct or if you don't know or are not sure what to enter, the correct
+informations can be obtained from your Internet Service Provider. If you do not
+enter the DNS (name server) information here, this information will be obtained
+from your Internet Service Provider at connection time."),
+
+configureNetworkCable =>
+ __("You may now enter your host name if needed. If you
+don't know or are not sure what to enter, the correct informations can be
+obtained from your Internet Service Provider."),
+
+configureNetworkIP =>
+ __("You may now configure your network device.
+
+ * IP address: if you don't know or are not sure what to enter, ask your network administrator.
+ You should not enter an IP address if you select the option \"Automatic IP\" below.
+
+ * Netmask: \"255.255.255.0\" is generally a good choice. If you don't know or are not sure what to enter,
+ ask your network administrator.
+
+ * Automatic IP: if your network uses BOOTP or DHCP protocol, select this option. If selected, no value is needed in
+ \"IP address\". If you don't know or are not sure if you need to select this option, ask your network administrator."),
+
+configureNetworkHost =>
+ __("You may now enter your host name if needed. If you
+don't know or are not sure what to enter, ask your network administrator."),
+
+configureNetworkHostDHCP =>
+ __("You may now enter your host name if needed. If you
+don't know or are not sure what to enter, leave blank."),
+
+configureNetworkISP =>
+ __("You may now enter dialup options. If you're not sure what to enter, the
+correct information can be obtained from your ISP."),
+
+configureNetworkProxy =>
+ __("If you will use proxies, please configure them now. If you don't know if
+you should use proxies, ask your network administrator or your ISP."),
+
+installCrypto =>
+ __("You can install cryptographic package if your internet connection has been
+set up correctly. First choose a mirror where you wish to download packages and
+after that select the packages to install.
+
+
+Note you have to select mirror and cryptographic packages according
+to your legislation."),
configureTimezone =>
- __("Help"),
+ __("You can now select your timezone according to where you live."),
+
+configureTimezoneGMT =>
+ __("GNU/Linux manages time in GMT (Greenwich Manage
+Time) and translates it in local time according to the time zone you have
+selected.
+
+
+If you use Microsoft Windows on this computer, choose \"No\"."),
configureServices =>
- __("Help"),
+ __("You may now choose which services you want to start at boot time.
+
+
+When your mouse comes over an item, a small balloon help will popup which
+describes the role of the service.
+
+
+Be very careful in this step if you intend to use your machine as a server: you
+will probably want not to start any services that you don't need. Please
+remember that several services can be dangerous if they are enable on a server.
+In general, select only the services that you really need."),
+
+configurePrinter =>
+ __("You can configure a local printer (connected to your computer) or remote
+printer (accessible via a Unix, Netware or Microsoft Windows network)."),
+
+configurePrinterSystem =>
+ __("If you wish to be able to print, please choose one printing system between
+CUPS and LPR.
+
+
+CUPS is a new, powerful and flexible printing system for Unix systems (CUPS
+means \"Common Unix Printing System\"). It is the default printing system in
+Linux-Mandrake.
+
+
+LPR is the old printing system used in previous Linux-Mandrake distributions.
+
+
+If you don't have printer, click on \"None\"."),
+
+configurePrinterConnected =>
+ __("GNU/Linux can deal with many types of printer. Each of these types requires
+a different setup.
+
+
+If your printer is physically connected to your computer, select \"Local
+printer\".
+
+
+If you want to access a printer located on a remote Unix machine, select
+\"Remote printer\".
+
+
+If you want to access a printer located on a remote Microsoft Windows machine
+(or on Unix machine using SMB protocol), select \"SMB/Windows 95/98/NT\"."),
+
+configurePrinterLocal =>
+ __("Please turn on your printer before continuing to let DrakX detect it.
+
+You have to enter some informations here.
+
+
+ * Name of printer: the print spooler uses \"lp\" as default printer name. So, you must have a printer named \"lp\".
+ If you have only one printer, you can use several names for it. You just need to separate them by a pipe
+ character (a \"|\"). So, if you prefer a more meaningful name, you have to put it first, eg: \"My printer|lp\".
+ The printer having \"lp\" in its name(s) will be the default printer.
+
+
+ * Description: this is optional but can be useful if several printers are connected to your computer or if you allow
+ other computers to access to this printer.
+
+
+ * Location: if you want to put some information on your
+ printer location, put it here (you are free to write what
+ you want, for example \"2nd floor\").
+"),
+
+configurePrinterLPR =>
+__("You need to enter some informations here.
+
+
+ * Name of queue: the print spooler uses \"lp\" as default printer name. So, you need have a printer named \"lp\".
+ If you have only one printer, you can use several names for it. You just need to separate them by a pipe
+ character (a \"|\"). So, if you prefer to have a more meaningful name, you have to put it first, eg: \"My printer|lp\".
+ The printer having \"lp\" in its name(s) will be the default printer.
+
+
+ * Spool directory: it is in this directory that printing jobs are stored. Keep the default choice
+ if you don't know what to use
+
-configurePrinter =>
- __("Help"),
+ * Printer Connection: If your printer is physically connected to your computer, select \"Local printer\".
+ If you want to access a printer located on a remote Unix machine, select \"Remote lpd printer\".
+
+
+ If you want to access a printer located on a remote Microsoft Windows machine (or on Unix machine using SMB
+ protocol), select \"SMB/Windows 95/98/NT\".
+
+
+ If you want to acces a printer located on NetWare network, select \"NetWare\".
+"),
+
+configurePrinterDev =>
+ __("Your printer has not been detected. Please enter the name of the device on
+which it is connected.
+
+
+For information, most printers are connected on the first parallel port. This
+one is called \"/dev/lp0\" under GNU/Linux and \"LPT1\" under Microsoft Windows."),
+
+configurePrinterType =>
+ __("You must now select your printer in the above list."),
+
+configurePrinterOptions =>
+__("Please select the right options according to your printer.
+Please see its documentation if you don't know what choose here.
+
+
+You will be able to test your configuration in next step and you will be able to modify it if it doesn't work as you want."),
setRootPassword =>
- __("An administrator password for your Linux system must now be
-assigned. The password must be entered twice to verify that both
-password entries are identical.
-
-Choose this password carefully. Only persons with access to an
-administrator account can maintain and administer the system.
-Alternatively, unauthorized use of an administrator account can be
-extremely dangerous to the integrity of the system, the data upon it,
-and other systems with which it is interfaced. The password should be a
-mixture of alphanumeric characters and a least 8 characters long. It
-should never be written down. Do not make the password too long or
-complicated that it will be difficult to remember.
-
-When you login as Administrator, at \"login\" type \"root\" and at
-\"password\", type the password that was created here."),
+ __("You can now enter the root password for your Linux-Mandrake system.
+The password must be entered twice to verify that both password entries are identical.
+
+
+Root is the system's administrator and is the only user allowed to modify the
+system configuration. Therefore, choose this password carefully.
+Unauthorized use of the root account can be extemely dangerous to the integrity
+of the system, its data and other system connected to it.
+
+
+The password should be a mixture of alphanumeric characters and at least 8
+characters long. It should never be written down.
+
+
+Do not make the password too long or complicated, though: you must be able to
+remember it without too much effort."),
+
+setRootPasswordMd5 =>
+ __("To enable a more secure system, you should select \"Use shadow file\" and
+\"Use MD5 passwords\"."),
+
+setRootPasswordNIS =>
+ __("If your network uses NIS, select \"Use NIS\". If you don't know, ask your
+network administrator."),
addUser =>
- __("You can now authorize one or more people to use your Linux
-system. Each user account will have their own customizable environment.
+ __("You may now create one or more \"regular\" user account(s), as
+opposed to the \"privileged\" user account, root. You can create
+one or more account(s) for each person you want to allow to use
+the computer. Note that each user account will have its own
+preferences (graphical environment, program settings, etc.)
+and its own \"home directory\", in which these preferences are
+stored.
-It is very important that you create a regular user account, even if
-there will only be one principle user of the system. The administrative
-\"root\" account should not be used for day to day operation of the
-computer. It is a security risk. The use of a regular user account
-protects you and the system from yourself. The root account should only
-be used for administrative and maintenance tasks that can not be
-accomplished from a regular user account."),
-createBootdisk =>
- __("Help"),
+First of all, create an account for yourself! Even if you will be the only user
+of the machine, you may NOT connect as root for daily use of the system: it's a
+very high security risk. Making the system unusable is very often a typo away.
-setupBootloader =>
+
+Therefore, you should connect to the system using the user account
+you will have created here, and login as root only for administration
+and maintenance purposes."),
+
+createBootdisk =>
+ __("Creating a boot disk is strongly recommended. If you can't
+boot your computer, it's the only way to rescue your system without
+reinstalling it."),
+
+setupBootloaderBeginner =>
__("You need to indicate where you wish
-to place the information required to boot to Linux.
+to place the information required to boot to GNU/Linux.
+
Unless you know exactly what you are doing, choose \"First sector of
-drive\"."),
+drive (MBR)\"."),
+
+setupBootloader =>
+ __("Unless you know specifically otherwise, the usual choice is \"/dev/hda\"
+ (primary master IDE disk) or \"/dev/sda\" (first SCSI disk)."),
+
+setupBootloaderAddEntry =>
+ __("LILO (the LInux LOader) and Grub are bootloaders: they are able to boot
+either GNU/Linux or any other operating system present on your computer.
+Normally, these other operating systems are correctly detected and
+installed. If this is not the case, you can add an entry by hand in this
+screen. Be careful as to choose the correct parameters.
+
+
+You may also want not to give access to these other operating systems to
+anyone, in which case you can delete the corresponding entries. But
+in this case, you will need a boot disk in order to boot them!"),
+
+setupBootloaderGeneral =>
+ __("LILO and grub main options are:
+ - Boot device: Sets the name of the device (e.g. a hard disk
+partition) that contains the boot sector. Unless you know specifically
+otherwise, choose \"/dev/hda\".
+
+
+ - Delay before booting default image: Specifies the number in tenths
+of a second the boot loader should wait before booting the first image.
+This is useful on systems that immediately boot from the hard disk after
+enabling the keyboard. The boot loader doesn't wait if \"delay\" is
+omitted or is set to zero.
+
+
+ - Video mode: This specifies the VGA text mode that should be selected
+when booting. The following values are available:
+
+ * normal: select normal 80x25 text mode.
+
+ * <number>: use the corresponding text mode."),
+
+setupSILOAddEntry =>
+ __("SILO is a bootloader for SPARC: it is able to boot
+either GNU/Linux or any other operating system present on your computer.
+Normally, these other operating systems are correctly detected and
+installed. If this is not the case, you can add an entry by hand in this
+screen. Be careful as to choose the correct parameters.
+
+
+You may also want not to give access to these other operating systems to
+anyone, in which case you can delete the corresponding entries. But
+in this case, you will need a boot disk in order to boot them!"),
+
+setupSILOGeneral =>
+ __("SILO main options are:
+ - Bootloader installation: Indicate where you want to place the
+information required to boot to GNU/Linux. Unless you know exactly
+what you are doing, choose \"First sector of drive (MBR)\".
+
+
+ - Delay before booting default image: Specifies the number in tenths
+of a second the boot loader should wait before booting the first image.
+This is useful on systems that immediately boot from the hard disk after
+enabling the keyboard. The boot loader doesn't wait if \"delay\" is
+omitted or is set to zero."),
+
+configureX =>
+ __("Now it's time to configure the X Window System, which is the
+core of the GNU/Linux GUI (Graphical User Interface). For this purpose,
+you must configure your video card and monitor. Most of these
+steps are automated, though, therefore your work may only consist
+of verifying what has been done and accept the settings :)
+
+
+When the configuration is over, X will be started (unless you
+ask DrakX not to) so that you can check and see if the
+settings suit you. If they don't, you can come back and
+change them, as many times as necessary."),
+
+configureXmain =>
+ __("If something is wrong in X configuration, use these options to correctly
+configure the X Window System."),
+
+configureXxdm =>
+ __("If you prefer to use a graphical login, select \"Yes\". Otherwise, select
+\"No\"."),
+
+miscellaneous =>
+ __("You can now select some miscellaneous options for your system.
+
+* Use hard drive optimizations: this option can improve hard disk performance but is only for advanced users. Some buggy
+ chipsets can ruin your data, so beware. Note that the kernel has a builtin blacklist of drives and chipsets, but if
+ you want to avoid bad surprises, leave this option unset.
+
+
+* Choose security level: you can choose a security level for your system. Please refer to the manual for complete
+ information. Basically, if you don't know what to choose, keep the default option.
+
+
+* Precise RAM if needed: unfortunately, there is no standard method to ask the BIOS about the amount of RAM present in
+ your computer. As consequence, Linux may fail to detect your amount of RAM correctly. If this is the case, you can
+ specify the correct amount or RAM here. Please note that a difference of 2 or 4 MB between detected memory and memory
+ present in your system is normal.
+
+
+* Removable media automounting: if you would prefer not to manually mount removable media (CD-Rom, floppy, Zip, etc.) by
+ typing \"mount\" and \"umount\", select this option.
+
+
+* Clean \"/tmp\" at each boot: if you want delete all files and directories stored in \"/tmp\" when you boot your system,
+ select this option.
+
+
+* Enable num lock at startup: if you want NumLock key enabled after booting, select this option. Please note that you
+ should not enable this option on laptops and that NumLock may or may not work under X."),
-configureX =>
- __("It is now time to configure the video card and monitor
-configuration for the X Window Graphic User Interface (GUI). First
-select your monitor. Next, you may test the configuration and change
-your selections if necessary."),
exitInstall =>
- __("Help"),
+ __("Your system is going to reboot.
+
+After rebooting, your new Linux Mandrake system will load automatically.
+If you want to boot into another existing operating system, please read
+the additional instructions."),
);
+
+#-#- ################################################################################
+#-#- NO LONGER UP-TO-DATE...
+#-%steps_long = (
+#-selectLanguage =>
+#- __("Choose preferred language for install and system usage."),
+#-
+#-selectKeyboard =>
+#- __("Choose the layout corresponding to your keyboard from the list above"),
+#-
+#-selectPath =>
+#- __("Choose \"Installation\" if there are no previous versions of GNU/Linux
+#-installed, or if you wish to use multiple distributions or versions.
+#-
+#-
+#-Choose \"Update\" if you wish to update a previous version of Mandrake
+#-Linux: 5.1 (Venice), 5.2 (Leeloo), 5.3 (Festen) or 6.0 (Venus)."),
+#-
+#-selectInstallClass =>
+#- __("Select:
+#-
+#- - Beginner: If you have never installed GNU/Linux before, and wish to
+#-install the distribution elected \"Product of the year\" for 1999,
+#-click here.
+#-
+#- - Developer: If you are familiar with GNU/Linux and will be using the
+#-computer primarily for software development, you will find happiness
+#-here.
+#-
+#- - Server: If you wish to install a general purpose server, or the
+#-GNU/Linux distribution elected \"Distribution/Server\" for 1999, select
+#-this.
+#-
+#- - Expert: If you are fluent with GNU/Linux and want to perform
+#-a highly customized installation, this Install Class is for you."),
+#-
+#-setupSCSI =>
+#- __("DrakX will attempt at first to look for one or more PCI
+#-SCSI adapter(s). If it finds it (or them) and knows which driver(s)
+#-to use, it will insert it (them) automatically.
+#-
+#-If your SCSI adapter is ISA, or is PCI but DrakX doesn't know
+#-which driver to use for this card, or if you have no SCSI adapters
+#-at all, you will then be prompted on whether you have one or not.
+#-If you have none, answer \"No\". If you have one or more, answer
+#-\"Yes\". A list of drivers will then pop up, from which you will
+#-have to select one.
+#-
+#-After you have selected the driver, DrakX will ask if you
+#-want to specify options for it. First, try and let the driver
+#-probe for the hardware: it usually works fine.
+#-
+#-If not, do not forget the information on your hardware that you
+#-could get from you documentation or from Windows (if you have
+#-it on your system), as suggested by the installation guide.
+#-These are the options you will need to provide to the driver."),
+#-
+#-partitionDisks =>
+#- __("In this stage, you may choose what partition(s) use to install your
+#-Linux-Mandrake system."),
+#-
+#-#At this point, hard drive partitions must be defined. (Unless you
+#-#are overwriting a previous install of GNU/Linux and have already defined
+#-#your hard drive partitions as desired.) This operation consists of
+#-#logically dividing the computer's hard drive capacity into separate
+#-#areas for use.
+#-#
+#-#
+#-#Two common partition are: the root partition (/), which is the starting
+#-#point of the filesystem's directory hierarchy, and /boot, which contains
+#-#all files necessary to start the operating system when the
+#-#computer is first turned on.
+#-#
+#-#
+#-#Because the effects of this process are usually irreversible, partitioning
+#-#can be intimidating and stressful to the unexperienced. DiskDrake
+#-#simplifies the process so that it need not be. Consult the documentation
+#-#and take your time before proceeding."),
+#-
+#-formatPartitions =>
+#- __("Any partitions that have been newly defined must be formatted for
+#-use (formatting meaning creating a filesystem). At this time, you may
+#-wish to re-format some already existing partitions to erase the data
+#-they contain. Note: it is not necessary to re-format pre-existing
+#-partitions, particularly if they contain files or data you wish to keep.
+#-Typically retained are /home and /usr/local."),
+#-
+#-choosePackages =>
+#- __("You may now select the packages you wish to install.
+#-
+#-
+#-Please note that some packages require the installation of others.
+#-These are referred to as package dependencies. The packages you select,
+#-and the packages they require will be automatically selected for
+#-install. It is impossible to install a package without installing all
+#-of its dependencies.
+#-
+#-
+#-Information on each category and specific package is available in the
+#-area titled \"Info\", located between list of packages and the five
+#-buttons \"Install\", \"Select more/less\" and \"Show more/less\"."),
+#-
+#-doInstallStep =>
+#- __("The packages selected are now being installed.
+#-
+#-
+#-This operation should take a few minutes."),
+#-
+#-selectMouse =>
+#- __("If DrakX failed to find your mouse, or if you want to
+#-check what it has done, you will be presented the list of mice
+#-above.
+#-
+#-
+#-If you agree with DrakX' settings, just jump to the section
+#-you want by clicking on it in the menu on the left. Otherwise,
+#-choose a mouse type in the menu which you think is the closest
+#-match for your mouse.
+#-
+#-In case of a serial mouse, you will also have to tell DrakX
+#-which serial port it is connected to."),
+#-
+#-configureNetwork =>
+#- __("This section is dedicated to configuring a local area network,
+#-or LAN. If you answer \"Yes\" here, DrakX will try to find an
+#-Ethernet adapter on your machine. PCI adapters should be found and
+#-initialized automatically. However, if your peripheral is ISA,
+#-autodetection will not work, and you will have to choose a driver
+#-from the list that will appear then.
+#-
+#-
+#-As for SCSI adapters, you can let the driver probe for the adapter
+#-in the first time, otherwise you will have to specify the options
+#-to the driver that you will have fetched from Windows' control
+#-panel.
+#-
+#-
+#-If you install a Linux-Mandrake system on a machine which is part
+#-of an already existing network, the network administrator will
+#-have given you all necessary information (IP address, network
+#-submask or netmask for short, and hostname). If you're setting
+#-up a private network at home for example, you should choose
+#-addresses "),
+#-
+#-configureTimezone =>
+#- __("Help"),
+#-
+#-configureServices =>
+#- __("Help"),
+#-
+#-configurePrinter =>
+#- __("GNU/Linux can deal with many types of printer. Each of these
+#-types require a different setup.
+#-
+#-
+#-If your printer is directly connected to your computer, select
+#-\"Local printer\". You will then have to tell which port your
+#-printer is connected to, and select the appropriate filter.
+#-
+#-
+#-If you want to access a printer located on a remote Unix machine,
+#-you will have to select \"Remote lpd queue\". In order to make
+#-it work, no username or password is required, but you will need
+#-to know the name of the printing queue on this server.
+#-
+#-
+#-If you want to access a SMB printer (which means, a printer located
+#-on a remote Windows 9x/NT machine), you will have to specify its
+#-SMB name (which is not its TCP/IP name), and possibly its IP address,
+#-plus the username, workgroup and password required in order to
+#-access the printer, and of course the name of the printer.The same goes
+#-for a NetWare printer, except that you need no workgroup information."),
+#-
+#-setRootPassword =>
+#- __("You must now enter the root password for your Linux-Mandrake
+#-system. The password must be entered twice to verify that both
+#-password entries are identical.
+#-
+#-
+#-Root is the administrator of the system, and is the only user
+#-allowed to modify the system configuration. Therefore, choose
+#-this password carefully! Unauthorized use of the root account can
+#-be extremely dangerous to the integrity of the system and its data,
+#-and other systems connected to it. The password should be a
+#-mixture of alphanumeric characters and a least 8 characters long. It
+#-should *never* be written down. Do not make the password too long or
+#-complicated, though: you must be able to remember without too much
+#-effort."),
+#-
+#-addUser =>
+#- __("You may now create one or more \"regular\" user account(s), as
+#-opposed to the \"privileged\" user account, root. You can create
+#-one or more account(s) for each person you want to allow to use
+#-the computer. Note that each user account will have its own
+#-preferences (graphical environment, program settings, etc.)
+#-and its own \"home directory\", in which these preferences are
+#-stored.
+#-
+#-
+#-First of all, create an account for yourself! Even if you will be the only user
+#-of the machine, you may NOT connect as root for daily use of the system: it's a
+#-very high security risk. Making the system unusable is very often a typo away.
+#-
+#-
+#-Therefore, you should connect to the system using the user account
+#-you will have created here, and login as root only for administration
+#-and maintenance purposes."),
+#-
+#-createBootdisk =>
+#- __("Please, please, answer \"Yes\" here! Just for example, when you
+#-reinstall Windows, it will overwrite the boot sector. Unless you have
+#-made the bootdisk as suggested, you won't be able to boot into GNU/Linux
+#-any more!"),
+#-
+#-setupBootloader =>
+#- __("You need to indicate where you wish
+#-to place the information required to boot to GNU/Linux.
+#-
+#-
+#-Unless you know exactly what you are doing, choose \"First sector of
+#-drive (MBR)\"."),
+#-
+#-configureX =>
+#- __("Now it's time to configure the X Window System, which is the
+#-core of the GNU/Linux GUI (Graphical User Interface). For this purpose,
+#-you must configure your video card and monitor. Most of these
+#-steps are automated, though, therefore your work may only consist
+#-of verifying what has been done and accept the settings :)
+#-
+#-
+#-When the configuration is over, X will be started (unless you
+#-ask DrakX not to) so that you can check and see if the
+#-settings suit you. If they don't, you can come back and
+#-change them, as many times as necessary."),
+#-
+#-exitInstall =>
+#- __("Help"),
+#-);
diff --git a/perl-install/http.pm b/perl-install/http.pm
index fbf6c001c..eb8ca0a09 100644
--- a/perl-install/http.pm
+++ b/perl-install/http.pm
@@ -1,17 +1,19 @@
-package http;
+package http; # $Id$
use IO::Socket;
use install_any;
+use network;
my $sock;
-sub getFile($) {
+sub getFile {
local($^W) = 0;
my ($host, $port, $path) = $ENV{URLPREFIX} =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,;
- $path .= "/" . install_any::relGetFile($_[0]);
+ $host = network::resolv($host);
+ $path .= "/$_[0]";
$sock->close if $sock;
$sock = IO::Socket::INET->new(PeerAddr => $host,
@@ -24,6 +26,17 @@ sub getFile($) {
"Host: $host" . ($port && ":$port"),
"User-Agent: DrakX/vivelinuxabaszindozs",
"", "");
+
+ #- skip until empty line
+ local $_;
+ my ($now, $last) = 0;
+ do {
+ $last = $now;
+ sysread($sock, $_, 1) || die;
+ sysread($sock, $_, 1) || die if /\015/;
+ $now = /\012/;
+ } until ($now && $last);
+
$sock;
}
diff --git a/perl-install/install2 b/perl-install/install2
index c8ae2ce9b..426b8ce21 100755
--- a/perl-install/install2
+++ b/perl-install/install2
@@ -1,9 +1,31 @@
#!/usr/bin/perl
+#- Mandrake Graphic Install $Id$
+#- Copyright (C) 1999/2000 MandrakeSoft (pixel@linux-mandrake.com)
+#-
+#- This program is free software; you can redistribute it and/or modify
+#- it under the terms of the GNU General Public License as published by
+#- the Free Software Foundation; either version 2, or (at your option)
+#- any later version.
+#-
+#- This program is distributed in the hope that it will be useful,
+#- but WITHOUT ANY WARRANTY; without even the implied warranty of
+#- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#- GNU General Public License for more details.
+#-
+#- You should have received a copy of the GNU General Public License
+#- along with this program; if not, write to the Free Software
+#- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
use diagnostics;
use strict;
-use lib qw(. c c/blib/arch);
+use lib qw(/usr/bin/perl-install .);
use install2;
+$::testing = $ENV{PERL_INSTALL_TEST};
+$::isStandalone = 0;
+
install2::main(@ARGV);
+
+c::_exit(0);
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 5d2bd900b..a0b3f06c7 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -1,469 +1,719 @@
-#!/usr/bin/perl
-# $o->{hints}->{component} *was* 'Workstation' or 'Server' or NULL
+package install2; # $Id$
use diagnostics;
use strict;
-use vars qw($testing $error $cancel $INSTALL_VERSION);
+use Data::Dumper;
-use lib qw(/usr/bin/perl-install . c/blib/arch);
-use c;
-use common qw(:common :file :system);
-use devices;
-use log;
-use net;
+use vars qw($o $version);
+
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :file :system :functional);
+use install_any qw(:all);
+use install_steps;
+use commands;
+use lang;
use keyboard;
-use pkgs;
-use smp;
-use fs;
-use setup;
+use mouse;
use fsedit;
-use install_methods;
-use lilo;
-use swap;
-use install_steps_graphical;
-use modules;
+use devices;
use partition_table qw(:types);
+use modules;
use detect_devices;
-use commands;
-
-$error = 0;
-$cancel = 0;
-$testing = $ENV{PERL_INSTALL_TEST};
-$INSTALL_VERSION = 0;
-
-my @installStepsFields = qw(text skipOnCancel skipOnLocal prev next);
-my @installSteps = (
- selectPath => [ "Select installation path", 0, 0, 'none' ],
- selectInstallClass => [ "Select installation class", 0, 0 ],
- setupSCSI => [ "Setup SCSI", 0, 1 ],
- partitionDisks => [ "Setup filesystems", 0, 1 ],
- findInstallFiles => [ "Find installation files", 1, 0 ],
- choosePackages => [ "Choose packages to install", 0, 0 ],
- doInstallStep => [ "Install system", 0, 0 ],
-# configureMouse => [ "Configure mouse", 0, 0 ],
- finishNetworking => [ "Configure networking", 0, 0 ],
-# configureTimezone => [ "Configure timezone", 0, 0 ],
-# configureServices => [ "Configure services", 0, 0 ],
-# configurePrinter => [ "Configure printer", 0, 0 ],
- setRootPassword => [ "Set root password", 0, 0 ],
- addUser => [ "Add a user", 0, 0 ],
- configureAuth => [ "Configure authentication", 0, 0 ],
- createBootdisk => [ "Create bootdisk", 0, 1 ],
- setupBootloader => [ "Install bootloader", 0, 1 ],
-# configureX => [ "Configure X", 0, 0 ],
- exitInstall => [ "Exit install", 0, 0, undef, 'done' ],
-);
+use run_program;
+use log;
+use fs;
-# this table is translated at run time
-my %upgradeSteps = (
- selectPath => [ "Select installation path", 0, 0 , 'none' ],
- setupSCSI => [ "Setup SCSI", 0, 0 ],
- upgrFindInstall => [ "Find current installation", 0, 0 ],
- findInstallFiles => [ "Find installation files", 1, 0 ],
- upgrChoosePackages => [ "Choose packages to upgrade", 0, 0 ],
- doInstallStep => [ "Upgrade system", 0, 0 ],
- createBootdisk => [ "Create bootdisk", 0, 0 , 'none' ],
- setupBootloader => [ "Install bootloader", 0, 0 ],
- exitInstall => [ "Exit install", 0, 0 , undef, 'done' ],
+$::VERSION = "7.1";
+#-$::corporate=1;
+
+#-######################################################################################
+#- Steps table
+#-######################################################################################
+my (%installSteps, @orderedInstallSteps);
+{
+ my @installStepsFields = qw(text redoable onError hidden needs);
+ #entered reachable toBeDone next done;
+ my @installSteps = (
+ selectLanguage => [ __("Choose your language"), 1, 1, '' ],
+ selectInstallClass => [ __("Select installation class"), 1, 1, '' ],
+ setupSCSI => [ __("Hard drive detection"), 1, 0, '' ],
+ selectMouse => [ __("Configure mouse"), 1, 1, '', "selectInstallClass" ],
+ selectKeyboard => [ __("Choose your keyboard"), 1, 1, '', "selectInstallClass" ],
+ miscellaneous => [ __("Miscellaneous"), 1, 1, '$::beginner' ],
+ doPartitionDisks => [ __("Setup filesystems"), 1, 0, '', "selectInstallClass" ],
+ formatPartitions => [ __("Format partitions"), 1, -1, '', "doPartitionDisks" ],
+ choosePackages => [ __("Choose packages to install"), 1, -2, '$::beginner', "formatPartitions" ],
+ installPackages => [ __("Install system"), 1, -1, '', ["formatPartitions", "selectInstallClass"] ],
+ configureNetwork => [ __("Configure networking"), 1, 1, '', "formatPartitions" ],
+#- installCrypto => [ __("Cryptographic"), 1, 1, '!$::expert', "configureNetwork" ],
+ configureTimezone => [ __("Configure timezone"), 1, 1, '', "installPackages" ],
+ configureServices => [ __("Configure services"), 1, 1, '!$::expert', "installPackages" ],
+ configurePrinter => [ __("Configure printer"), 1, 0, '', "installPackages" ],
+ setRootPassword => [ __("Set root password"), 1, 1, '', "installPackages" ],
+ addUser => [ __("Add a user"), 1, 1, '', "installPackages" ],
+arch() !~ /alpha/ ? (
+ createBootdisk => [ __("Create a bootdisk"), 1, 0, '', "installPackages" ],
+) : (),
+ setupBootloader => [ __("Install bootloader"), 1, 1, '', "installPackages" ],
+ configureX => [ __("Configure X"), 1, 1, '', ["formatPartitions", "setupBootloader"] ],
+arch() !~ /alpha/ ? (
+ generateAutoInstFloppy => [ __("Auto install floppy"), 1, 1, '!$::expert || $o->{lnx4win}', "installPackages" ],
+) : (),
+ exitInstall => [ __("Exit install"), 0, 0, '$::beginner && !$::live' ],
);
-
-for (my $i = 0; $i < @installSteps; $i += 2) {
- my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
- $h{prev} ||= $installSteps[$i - 2];
- $h{next} ||= $installSteps[$i + 2];
- $installSteps{ $installSteps[$i] } = \%h;
-}
-$installSteps{first} = $installSteps[0];
-for (my $i = 0; $i < @upgradeSteps; $i += 2) {
- my %h; @h{@installStepsFields} = @{ $upgradeSteps[$i + 1] };
- $h{prev} ||= $upgradeSteps[$i - 2];
- $h{next} ||= $upgradeSteps[$i + 2];
- $upgradeSteps{ $upgradeSteps[$i] } = \%h;
+ for (my $i = 0; $i < @installSteps; $i += 2) {
+ my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
+ $h{next} = $installSteps[$i + 2];
+ $h{entered} = 0;
+ $h{onError} = $installSteps[$i + 2 * $h{onError}];
+ $h{reachable} = !$h{needs};
+ $installSteps{ $installSteps[$i] } = \%h;
+ push @orderedInstallSteps, $installSteps[$i];
+ }
+ $installSteps{first} = $installSteps[0];
}
-$upgradeSteps{first} = $upgradeSteps[0];
-
-
-# partition layout for a server
-my @serverPartitioning = (
- { mntpoint => "/boot", size => 16 << 11, type => 0x83 },
- { mntpoint => "/", size => 256 << 11, type => 0x83 },
- { mntpoint => "/usr", size => 512 << 11, type => 0x83, growable => 1 },
- { mntpoint => "/var", size => 256 << 11, type => 0x83 },
- { mntpoint => "/home", size => 512 << 11, type => 0x83, growable => 1 },
- { mntpoint => "swap", size => 64 << 11, type => 0x82 }
+#-#####################################################################################
+#-INTERNAL CONSTANT
+#-#####################################################################################
+
+my @install_classes = qw(normal developer server);
+
+#-#####################################################################################
+#-Default value
+#-#####################################################################################
+#- partition layout
+my %suggestedPartitions = (
+arch() =~ /^sparc/ ? (
+ normal => [
+ { mntpoint => "/", size => 150 << 11, type => 0x83, ratio => 1, maxsize =>1000 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 4, maxsize =>3000 << 11 },
+ { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 3 },
+ ],
+) : (
+ normal => [
+ { mntpoint => "/", size => 300 << 11, type => 0x83, ratio => 5, maxsize =>3500 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 3 },
+ ],
+),
+ developer => [
+ { mntpoint => "/", size => 150 << 11, type => 0x83, ratio => 1, maxsize => 500 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 4, maxsize =>3000 << 11 },
+ { mntpoint => "/home", size => 100 << 11, type => 0x83, ratio => 5 },
+ ],
+ server => [
+ { mntpoint => "/", size => 150 << 11, type => 0x83, ratio => 1, maxsize => 250 << 11 },
+ { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 2, maxsize => 400 << 11 },
+ { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 3, maxsize =>3000 << 11 },
+ { mntpoint => "/var", size => 100 << 11, type => 0x83, ratio => 4 },
+ { mntpoint => "/home", size => 100 << 11, type => 0x83, ratio => 5 },
+ ],
);
+$suggestedPartitions{corporate} = $suggestedPartitions{server};
+
+#-#######################################################################################
+#-$O
+#-the big struct which contain, well everything (globals + the interactive methods ...)
+#-if you want to do a kickstart file, you just have to add all the required fields (see for example
+#-the variable $default)
+#-#######################################################################################
+$o = $::o = {
+# bootloader => { linear => 0, lba32 => 1, message => 1, timeout => 5, restricted => 0 },
+ autoSCSI => 0,
+ mkbootdisk => 1, #- no mkbootdisk if 0 or undef, find a floppy with 1, or fd1
+#- packages => [ qw() ],
+ partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0 }, #-, readonly => 0 },
+#- security => 2,
+#arch() =~ /^sparc/ ? (
+# partitions => [
+# { mntpoint => "/", size => 600 << 11, type => 0x83, ratio => 5, maxsize =>1000 << 11 },
+# { mntpoint => "swap", size => 128 << 11, type => 0x82, ratio => 1, maxsize => 400 << 11 },
+# { mntpoint => "/usr", size => 300 << 11, type => 0x83, ratio => 3, maxsize =>1500 << 11 },
+# { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 5 },
+# ],
+#) : (
+# partitions => [
+# { mntpoint => "/boot", size => 10 << 11, type => 0x83, maxsize => 30 << 11 },
+# { mntpoint => "/", size => 300 << 11, type => 0x83, ratio => 5, maxsize => 1500 << 11 },
+# { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
+# { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 5 },
+# ],
+#),
+#- partitions => [
+#- { mntpoint => "/boot", size => 16 << 11, type => 0x83 },
+#- { mntpoint => "/", size => 256 << 11, type => 0x83 },
+#- { mntpoint => "/usr", size => 512 << 11, type => 0x83, growable => 1 },
+#- { mntpoint => "/var", size => 256 << 11, type => 0x83 },
+#- { mntpoint => "/home", size => 512 << 11, type => 0x83, growable => 1 },
+#- { mntpoint => "swap", size => 64 << 11, type => 0x82 }
+#- { mntpoint => "/boot", size => 16 << 11, type => 0x83 },
+#- { mntpoint => "/", size => 300 << 11, type => 0x83 },
+#- { mntpoint => "swap", size => 64 << 11, type => 0x82 },
+#- { mntpoint => "/usr", size => 400 << 11, type => 0x83, growable => 1 },
+#- ],
+ authentication => { md5 => 1, shadow => 1 },
+ lang => 'en_US',
+ isUpgrade => 0,
+ toRemove => [],
+ toSave => [],
+#- simple_themes => 1,
+#- installClass => "normal",
+
+ timezone => {
+#- timezone => "Europe/Paris",
+#- UTC => 1,
+ },
+#- superuser => { password => 'a', shell => '/bin/bash', realname => 'God' },
+#- user => { name => 'foo', password => 'bar', home => '/home/foo', shell => '/bin/bash', realname => 'really, it is foo' },
+
+#- keyboard => 'de',
+#- display => "192.168.1.19:1",
+ steps => \%installSteps,
+ orderedSteps => \@orderedInstallSteps,
+
+#- for the list of fields available for user and superuser, see @etc_pass_fields in install_steps.pm
+#- intf => { eth0 => { DEVICE => "eth0", IPADDR => '1.2.3.4', NETMASK => '255.255.255.128' } },
+
+#-step : the current one
+#-prefix
+#-mouse
+#-keyboard
+#-netc
+#-autoSCSI drives hds fstab
+#-methods
+#-packages compss
+#-printer haveone entry(cf printer.pm)
-my $o = {};
-my $default = {
- display => "129.104.42.9:0",
- user => { name => 'foo', password => 'foo', shell => '/bin/bash', realname => 'really, it is foo' },
- rootPassword => 'toto',
- keyboard => 'us',
- isUpgrade => 0,
- installClass => 'Server',
- bootloader => { onmbr => 1,
- linear => 1,
- },
- mkbootdisk => 0,
- comps => [ qw() ],
- packages => [ qw() ],
- partitions => [
- { mntpoint => "/boot", size => 16 << 11, type => 0x83 },
- { mntpoint => "/", size => 300 << 11, type => 0x83 },
- { mntpoint => "/usr", size => 400 << 11, type => 0x83, growable => 1 },
- { mntpoint => "swap", size => 64 << 11, type => 0x82 }
- ],
};
+#-######################################################################################
+#- Steps Functions
+#- each step function are called with two arguments : clicked(because if you are a
+#- beginner you can force the the step) and the entered number
+#-######################################################################################
+#------------------------------------------------------------------------------
+sub selectLanguage {
+ $o->selectLanguage($_[1] == 1);
-sub selectPath {
- $o->{steps} = $o->{isUpgrade} ? \%upgradeSteps : \%installSteps;
+ addToBeDone {
+ lang::write($o->{prefix});
+ keyboard::write($o->{prefix}, $o->{keyboard}, lang::lang2charset($o->{lang}));
+ } 'installPackages' unless $::g_auto_install;
}
-sub selectInstallClass {
-# my @choices = qw(Workstation Server Custom);
-
- $o->{installClass} eq 'Custom' and return;
+#------------------------------------------------------------------------------
+sub selectMouse {
+ require pkgs;
+ my ($first_time) = $_[1] == 1;
- $o->{bootloader}->{onmbr} = 1;
- $o->{bootloader}->{uselinear} = 1;
+ add2hash($o->{mouse} ||= {}, mouse::read($o->{prefix})) if $o->{isUpgrade} && $first_time;
- foreach (qw(skipntsysv autoformat nologmessage auth autoswap skipbootloader forceddruid)) {
- $o->{hints}->{flags}->{$_} = 1;
- }
- $o->{hints}->{auth}->{shadow} = 1;
- $o->{hints}->{auth}->{md5} = 1;
-
- if ($o->{installClass} eq 'Server') {
- $o->{hints}->{flags}->{skipprinter} = 1;
- $o->{hints}->{flags}->{skipresize} = 1;
- $o->{hints}->{partitioning}->{flags}->{clearall} = 1;
- $o->{hints}->{partitioning}->{attempts} = 'serverPartitioning';
- } else { # workstation
- $o->{hints}->{flags}->{autoscsi} = 1;
- $o->{hints}->{partitioning}->{flags}->{clearlinux} = 1;
- }
+ $o->selectMouse(!$first_time);
+ addToBeDone { mouse::write($o->{prefix}, $o->{mouse}) } 'installPackages';
}
+#------------------------------------------------------------------------------
sub setupSCSI {
- $o->{direction} < 0 && detect_devices::hasSCSI() and return cancel();
+ my ($clicked) = @_;
+ $o->{autoSCSI} ||= $::beginner;
- # If we have any scsi adapters configured from earlier, then don't bother asking again
- while (my ($k, $v) = each %modules::loaded) {
- $v->{type} eq 'scsi' and return;
- }
- #setupSCSIInterfaces(0, \%modules::loaded, $o->{hints}->{flags}->{autoscsi}, $o->{direction});
+ $o->setupSCSI($o->{autoSCSI} && !$clicked, $clicked);
}
-sub partitionDisks {
- $o->{drives} = [ detect_devices::hds() ];
- $o->{hds} = fsedit::hds($o->{drives}, $o->{hints}->{partitioning}->{flags});
- @{$o->{hds}} > 0 or die "An error has occurred - no valid devices were found on which to create new filesystems. Please check your hardware for the cause of this problem";
+#------------------------------------------------------------------------------
+sub selectKeyboard {
+ my ($clicked) = @_;
- unless ($o->{isUpgrade}) {
- $o->{install}->doPartitionDisks($o->{hds}, $o->{fstab_wanted});
+ return if !$o->{isUpgrade} && $::beginner && !$clicked;
- # Write partitions to disk
- foreach (@{$o->{hds}}) { partition_table::write($_); }
- }
-
- $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}) ];
+ $o->{keyboard} = keyboard::read($o->{prefix}) if $o->{isUpgrade} && !$clicked && $o->{keyboard_unsafe};
+ $o->selectKeyboard;
- my $root_fs; map { $_->{mntpoint} eq '/' and $root_fs = $_ } @{$o->{fstab}};
- $root_fs or die "partitionning failed: no root filesystem";
+ #- if we go back to the selectKeyboard, you must rewrite
+ addToBeDone {
+ lang::write($o->{prefix});
+ keyboard::write($o->{prefix}, $o->{keyboard}, lang::lang2charset($o->{lang}));
+ } 'installPackages' unless $::g_auto_install;
+}
- if ($o->{hints}->{flags}->{autoformat}) {
- log::l("formatting all filesystems");
+#------------------------------------------------------------------------------
+sub selectInstallClass {
+ $o->selectInstallClass(@install_classes);
+
+ $o->{partitions} ||= $suggestedPartitions{$o->{installClass}};
- foreach (@{$o->{fstab}}) {
- fs::format_part($_) if $_->{mntpoint} && isExt2($_) || isSwap($_);
+ if ($o->{steps}{choosePackages}{entered} >= 1 && !$o->{steps}{installPackages}{done}) {
+ $o->setPackages(\@install_classes);
+ $o->selectPackagesToUpgrade if $o->{isUpgrade};
+ }
+ if ($o->{isUpgrade}) {
+ @{$o->{orderedSteps}} = map { /setupSCSI/ ? ($_, "doPartitionDisks") : $_ }
+ grep { !/doPartitionDisks/ } @{$o->{orderedSteps}};
+ my $s; foreach (@{$o->{orderedSteps}}) {
+ $s->{next} = $_ if $s;
+ $s = $o->{steps}{$_};
}
}
- fs::mount_all($o->{fstab}, '/mnt');
}
-sub findInstallFiles {
- $o->{packages} = $o->{method}->getPackageSet() and
- $o->{comps} = $o->{method}->getComponentSet($o->{packages});
+#------------------------------------------------------------------------------
+sub doPartitionDisks {
+ $o->{steps}{formatPartitions}{done} = 0;
+ $o->doPartitionDisksBefore;
+ $o->doPartitionDisks;
+ $o->doPartitionDisksAfter;
}
-
-sub choosePackages {
-# $o->{hints}->{component} && $o->{direction} < 0 and return cancel();
- $o->{install}->choosePackages($o->{packages}, $o->{comps}, $o->{isUpgrade});
-}
+sub formatPartitions {
+ $o->{steps}{choosePackages}{done} = 0;
+ $o->choosePartitionsToFormat($o->{fstab}) unless $o->{isUpgrade};
+ $o->formatMountPartitions($o->{fstab}) unless $::testing;
-sub doInstallStep {
- $testing and return 0;
+ mkdir "$o->{prefix}/$_", 0755 foreach
+ qw(dev etc etc/profile.d etc/sysconfig etc/sysconfig/console etc/sysconfig/network-scripts
+ home mnt tmp var var/tmp var/lib var/lib/rpm var/lib/urpmi);
+ mkdir "$o->{prefix}/$_", 0700 foreach qw(root root/tmp);
- $o->{install}->beforeInstallPackages($o->{method}, $o->{fstab});
- $o->{install}->installPackages($o->{rootPath}, $o->{method}, $o->{packages}, $o->{isUpgrade});
- $o->{install}->afterInstallPackages($o->{rootPath}, $o->{keyboard}, $o->{isUpgrade});
-}
+ require raid;
+ raid::prepare_prefixed($o->{raid}, $o->{prefix});
+
+ my $d = "/initrd/loopfs/lnx4win";
+ if (-d $d) {
+#- install_any::useMedium(0);
+ install_any::getAndSaveFile("lnx4win/$_", "$d/$_") foreach qw(ctl3d32.dll loadlin.exe linux.pif lnx4win.exe lnx4win.ico rm.exe uninstall.bat uninstall.pif);
+ }
-sub configureMouse { setup::mouseConfig($o->{rootPath}); }
-
-sub finishNetworking {
-#
-# rc = checkNetConfig(&$o->{intf}, &$o->{netc}, &$o->{intfFinal},
-# &$o->{netcFinal}, &$o->{driversLoaded}, $o->{direction});
-#
-# if (rc) return rc;
-#
-# sprintf(path, "%s/etc/sysconfig", $o->{rootPath});
-# writeNetConfig(path, &$o->{netcFinal},
-# &$o->{intfFinal}, 0);
-# strcat(path, "/network-scripts");
-# writeNetInterfaceConfig(path, &$o->{intfFinal});
-# sprintf(path, "%s/etc", $o->{rootPath});
-# writeResolvConf(path, &$o->{netcFinal});
-#
-# # this is a bit of a hack
-# writeHosts(path, &$o->{netcFinal},
-# &$o->{intfFinal}, !$o->{isUpgrade});
-#
-# return 0;
+#- chdir "$o->{prefix}"; was for core dumps
+
+ #-noatime option for ext2 fs on laptops (do not wake up the hd)
+ #- Do not update inode access times on this
+ #- file system (e.g, for faster access on the
+ #- news spool to speed up news servers).
+ $o->{pcmcia} and $_->{options} = "noatime" foreach grep { isTrueFS($_) } @{$o->{fstab}};
}
-sub configureTimezone { setup::timeConfig($o->{rootPath}) }
-sub configureServices { setup::servicesConfig($o->{rootPath}) }
+#------------------------------------------------------------------------------
+sub choosePackages {
+ require pkgs;
-sub setRootPassword {
- $testing and return 0;
+ #- always setPackages as it may have to copy hdlist files and depslist file.
+ $o->setPackages;
- $o->{install}->setRootPassword($o->{rootPath});
-}
+ #- for the first time, select package to upgrade.
+ #- TOCHECK this may not be the best place for that as package are selected at some other point.
+ if ($_[1] == 1) {
+ $o->selectPackagesToUpgrade if $o->{isUpgrade};
-sub addUser {
- $o->{install}->addUser($o->{rootPath});
+ $o->{compssUsersChoice}{$_} = 1 foreach @{$o->{compssUsersSorted}}, 'Miscellaneous';
+ # $o->{compssUsersChoice}{KDE} = 0 if $o->{lang} =~ /ja|el|ko|th|vi|zh/; #- gnome handles much this fonts much better
+ }
+
+ $o->choosePackages($o->{packages}, $o->{compss}, $o->{compssUsers}, $_[1] == 1);
+
+ #- check pre-condition where base backage has to be selected.
+ pkgs::packageFlagSelected(pkgs::packageByName($o->{packages}, 'basesystem')) or die "basesystem package not selected";
+
+ #- check if there are package that need installation.
+ $o->{steps}{installPackages}{done} = 0 if $o->{steps}{installPackages}{done} && pkgs::packagesToInstall($o->{packages}) > 0;
}
-sub createBootdisk {
- $o->{isUpgrade} or fs::write('mnt', $o->{fstab});
- modules::write_conf("/mnt/etc/conf.modules", 'append');
+#------------------------------------------------------------------------------
+sub installPackages {
+ $o->readBootloaderConfigBeforeInstall if $_[1] == 1;
- $o->{mkbootdisk} and lilo::mkbootdisk("/mnt", versionString());
+ $o->beforeInstallPackages;
+ $o->installPackages;
+ $o->afterInstallPackages;
+}
+#------------------------------------------------------------------------------
+sub miscellaneous {
+ $o->miscellaneousBefore($_[0]);
+ $o->miscellaneous($_[0]);
+
+ addToBeDone {
+ setVarsInSh("$o->{prefix}/etc/sysconfig/system", {
+ CLEAN_TMP => $o->{miscellaneous}{CLEAN_TMP},
+ CLASS => $::expert && "expert" || $::beginner && "beginner" || "medium",
+ TYPE => $o->{installClass},
+ SECURITY => $o->{security},
+ META_CLASS => $o->{meta_class} || 'PowerPack',
+ });
+
+ my $f = "$o->{prefix}/etc/sysconfig/usb";
+ output $f,
+"USB=yes
+MOUSE=" . bool2yesno(detect_devices::hasUsbMouse()) . "
+KEYBOARD=" . bool2yesno(detect_devices::hasUsbKeyboard()) . "
+STORAGE=" . bool2yesno(detect_devices::hasUsbZip()) . "
+VISOR=no
+" if modules::get_alias("usb-interface") && ! -e $f;
+
+ install_any::fsck_option($o);
+ } 'installPackages';
}
-sub setupBootloader {
- my $versionString = versionString();
- log::l("installed kernel version $versionString");
-
- $o->{isUpgrade} or modules::read_conf("/mnt/etc/conf.modules");
-
- lilo::install("/mnt", $o->{hds}, $o->{fstab}, $versionString, $o->{bootloader});
+#------------------------------------------------------------------------------
+sub configureNetwork {
+ #- get current configuration of network device.
+ require network;
+ eval { network::read_all_conf($o->{prefix}, $o->{netc} ||= {}, $o->{intf} ||= {}) };
+ $o->configureNetwork($_[1] == 1);
}
+#------------------------------------------------------------------------------
+sub installCrypto { $o->installCrypto }
+#------------------------------------------------------------------------------
+sub configureTimezone {
+ my ($clicked) = @_;
+ my $f = "$o->{prefix}/etc/sysconfig/clock";
+
+ require timezone;
+ if ($o->{isUpgrade} && -r $f && -s $f > 0) {
+ return if $_[1] == 1 && !$clicked;
+ #- can't be done in install cuz' timeconfig %post creates funny things
+ add2hash($o->{timezone}, { timezone::read($f) });
+ }
+ $o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang}));
+ $o->{timezone}{UTC} = !$::beginner && !grep { isFat($_) || isNT($_) } @{$o->{fstab}} unless exists $o->{timezone}{UTC};
+ $o->configureTimezone($f, $clicked);
+}
+#------------------------------------------------------------------------------
+sub configureServices { $::expert and $o->configureServices }
+#------------------------------------------------------------------------------
+sub configurePrinter { $o->configurePrinter($_[0]) }
+#------------------------------------------------------------------------------
+sub setRootPassword {
+ return if $o->{isUpgrade};
-sub configureX { $o->{install}->setupXfree($o->{method}, $o->{rootPath}, $o->{packages}); }
-
-sub exitInstall { 1 }
-
-sub upgrFindInstall {
-# int rc;
-#
-# if (!$o->{table}.parts) {
-# rc = findAllPartitions(NULL, &$o->{table});
-# if (rc) return rc;
-# }
-#
-# umountFilesystems(&$o->{fstab});
-#
-# # rootpath upgrade support
-# if (strcmp($o->{rootPath} ,"/mnt"))
-# return INST_OKAY;
-#
-# # this also turns on swap for us
-# rc = readMountTable($o->{table}, &$o->{fstab});
-# if (rc) return rc;
-#
-# if (!testing) {
-# mountFilesystems(&$o->{fstab});
-#
-# if ($o->{method}->prepareMedia) {
-# rc = $o->{method}->prepareMedia($o->{method}, &$o->{fstab});
-# if (rc) {
-# umountFilesystems(&$o->{fstab});
-# return rc;
-# }
-# }
-# }
-#
-# return 0;
+ $o->setRootPassword($_[0]);
+ addToBeDone { install_any::setAuthentication($o) } 'installPackages';
}
+#------------------------------------------------------------------------------
+sub addUser {
+ return if $o->{isUpgrade} && !$_[0];
-sub upgrChoosePackages {
-# static int firstTime = 1;
-# char * rpmconvertbin;
-# int rc;
-# char * path;
-# char * argv[] = { NULL, NULL };
-# char buf[128];
-#
-# if (testing)
-# path = "/";
-# else
-# path = $o->{rootPath};
-#
-# if (firstTime) {
-# snprintf(buf, sizeof(buf), "%s%s", $o->{rootPath},
-# "/var/lib/rpm/packages.rpm");
-# if (access(buf, R_OK)) {
-# snprintf(buf, sizeof(buf), "%s%s", $o->{rootPath},
-# "/var/lib/rpm/packages");
-# if (access(buf, R_OK)) {
-# errorWindow("No RPM database exists!");
-# return INST_ERROR;
-# }
-#
-# if ($o->{method}->getFile($o->{method}, "rpmconvert",
-# &rpmconvertbin)) {
-# return INST_ERROR;
-# }
-#
-# symlink("/mnt/var", "/var");
-# winStatus(35, 3, _("Upgrade"), _("Converting RPM database..."));
-# chmod(rpmconvertbin, 0755);
-# argv[0] = rpmconvertbin;
-# rc = runProgram(RUN_LOG, rpmconvertbin, argv);
-# if ($o->{method}->rmFiles)
-# unlink(rpmconvertbin);
-#
-# newtPopWindow();
-# if (rc) return INST_ERROR;
-# }
-# winStatus(35, 3, "Upgrade", _("Finding packages to upgrade..."));
-# rc = ugFindUpgradePackages(&$o->{packages}, path);
-# newtPopWindow();
-# if (rc) return rc;
-# firstTime = 0;
-# psVerifyDependencies(&$o->{packages}, 1);
-# }
-#
-# return psSelectPackages(&$o->{packages}, &$o->{comps}, NULL, 0, 1);
+ $o->addUser($_[0]);
+ install_any::setAuthentication($o);
}
+#------------------------------------------------------------------------------
+sub createBootdisk {
+ modules::write_conf($o->{prefix});
+ $o->createBootdisk($_[1] == 1);
+}
+
+#------------------------------------------------------------------------------
+sub setupBootloader {
+ return if $::g_auto_install;
+
+ modules::write_conf($o->{prefix});
-sub versionString {
- my $kernel = $o->{packages}->{kernel} or die "I couldn't find the kernel package!";
+ $o->setupBootloaderBefore if $_[1] == 1;
+ $o->setupBootloader($_[1] - 1);
- c::headerGetEntry($kernel->{header}, 'version') . "-" .
- c::headerGetEntry($kernel->{header}, 'release');
+ local $ENV{DRAKX_PASSWORD} = $o->{bootloader}{password};
+ run_program::rooted($o->{prefix}, "/usr/sbin/msec", $o->{security});
}
+#------------------------------------------------------------------------------
+sub configureX {
+ my ($clicked) = @_;
-sub getNextStep {
- my ($lastStep) = @_;
+ #- done here and also at the end of install2.pm, just in case...
+ fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
+ modules::write_conf($o->{prefix});
- $error and die "an error occured in step $lastStep";
- $cancel and die "cancel called in step $lastStep";
+ $o->configureX($clicked) if pkgs::packageFlagInstalled(pkgs::packageByName($o->{packages}, 'XFree86')) && !$o->{X}{disabled} || $clicked;
+}
+#------------------------------------------------------------------------------
+sub generateAutoInstFloppy { $o->generateAutoInstFloppy }
- $o->{direction} = 1;
+#------------------------------------------------------------------------------
+sub exitInstall { $o->exitInstall(getNextStep() eq "exitInstall") }
- return $o->{lastChoice} = $o->{steps}->{$lastStep}->{next};
-}
-sub doSuspend {
- $o->{exitOnSuspend} and exit(1);
-
- if (my $pid = fork) {
- waitpid $pid, 0;
- } else {
- print "\n\nType <exit> to return to the install program.\n\n";
- exec {"/bin/sh"} "-/bin/sh";
- warn "error execing /bin/sh";
- sleep 5;
- exit 1;
+#-######################################################################################
+#- MAIN
+#-######################################################################################
+sub main {
+ $SIG{__DIE__} = sub { chomp(my $err = $_[0]); log::l("warning: $err") };
+ $SIG{SEGV} = sub { my $msg = "segmentation fault: seems like memory is missing as the install crashes"; print "$msg\n"; log::l($msg);
+ $o->ask_warn('', $msg);
+ setVirtual(1);
+ require install_steps_auto_install;
+ install_steps_auto_install::errorInStep();
+ };
+ $ENV{SHARE_PATH} ||= "/usr/share";
+ $ENV{PERL_BADLANG} = 1;
+
+ $::isInstall = 1;
+ $::beginner = $::expert = $::g_auto_install = 0;
+
+#- c::unlimit_core() unless $::testing;
+
+ my ($cfg, $patch, @auto);
+ my %cmdline; map {
+ my ($n, $v) = split '=';
+ $cmdline{$n} = $v || 1;
+ } split ' ', cat_("/proc/cmdline");
+
+ my $opt; foreach (@_) {
+ if (/^--?(.*)/) {
+ $cmdline{$opt} = 1 if $opt;
+ $opt = $1;
+ } else {
+ $cmdline{$opt} = $_ if $opt;
+ $opt = '';
+ }
+ } $cmdline{$opt} = 1 if $opt;
+
+ $::beginner = 1;
+
+ map_each {
+ my ($n, $v) = @_;
+ my $f = ${{
+ oem => sub { $::oem = $v },
+ lang => sub { $o->{lang} = $v },
+ flang => sub { $o->{lang} = $v ; push @auto, 'selectLanguage' },
+ method => sub { $o->{method} = $v },
+ pcmcia => sub { $o->{pcmcia} = $v },
+ vga16 => sub { $o->{vga16} = $v },
+ vga => sub { $o->{vga} = $v },
+ step => sub { $o->{steps}{first} = $v },
+ expert => sub { $::expert = 1; $::beginner = 0 },
+ beginner => sub { $::beginner = $v },
+ class => sub { $o->{installClass} = $v },
+ fclass => sub { $o->{installClass} = $v; push @auto, 'selectInstallClass' },
+ desktop => sub { $o->{meta_class} = 'desktop' },
+ lnx4win => sub { $o->{lnx4win} = 1 },
+ readonly => sub { $o->{partitioning}{readonly} = $v ne "0" },
+ display => sub { $o->{display} = $v },
+ security => sub { $o->{security} = $v },
+ live => sub { $::live = 1 },
+ noauto => sub { $::noauto = 1 },
+ test => sub { $::testing = 1 },
+ nopci => sub { $::nopci = 1 },
+ patch => sub { $patch = 1 },
+ defcfg => sub { $cfg = $v },
+ newt => sub { $o->{interactive} = "newt" },
+ text => sub { $o->{interactive} = "newt" },
+ stdio => sub { $o->{interactive} = "stdio"},
+ corporate => sub { $::corporate = 1 },
+ kickstart => sub { $::auto_install = $v },
+ auto_install => sub { $::auto_install = $v },
+ simple_themes => sub { $o->{simple_themes} = 1 },
+ useless_thing_accepted => sub { $o->{useless_thing_accepted} = 1 },
+ alawindows => sub { $o->{security} = 0; $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 },
+ fdisk => sub { $o->{partitioning}{fdisk} = 1 },
+ g_auto_install => sub { $::testing = $::g_auto_install = 1; $o->{partitioning}{auto_allocate} = 1 },
+ nomouseprobe => sub { $o->{nomouseprobe} = $v },
+ }}{lc $n}; &$f if $f;
+ } %cmdline;
+
+ undef $::auto_install if $cfg;
+ if ($::g_auto_install) {
+ (my $root = `/bin/pwd`) =~ s|(/[^/]*){5}$||;
+ symlinkf $root, "/tmp/rhimage" or die "unable to create link /tmp/rhimage";
+ $o->{method} ||= "cdrom";
+ $o->{mkbootdisk} = 0;
+ }
+ unless ($::testing || $::live) {
+ unlink $_ foreach ( $o->{pcmcia} ? () : ("/sbin/install"), #- #- install include cardmgr!
+ "/modules/modules.cgz",
+ "/sbin/insmod", "/sbin/rmmod",
+ "/modules/pcmcia_core.o", #- always use module from archive.
+ "/modules/i82365.o",
+ "/modules/tcic.o",
+ "/modules/ds.o",
+ );
}
-}
-
-sub spawnShell {
- $testing and return;
+ print STDERR "in second stage install\n";
+ log::openLog(($::testing || $o->{localInstall}) && 'debug.log');
+ log::l("second stage install running");
+ log::ld("extra log messages are enabled");
- -x "/bin/sh" or log::l("cannot open shell - /usr/bin/sh doesn't exist"), return;
+ eval { spawnShell() };
- fork and return;
+ $o->{prefix} = $::testing ? "/tmp/test-perl-install" : $::live ? "" : "/mnt";
+ $o->{root} = $::testing ? "/tmp/root-perl-install" : "/";
+ if ($::live) {
+ $o->{isUpgrade} = 1;
+ #$::beginner = 0; #- use custom by default.
+ }
+ mkdir $o->{prefix}, 0755;
+ mkdir $o->{root}, 0755;
- local *F;
- sysopen F, "/dev/tty2", 2 or log::l("cannot open /dev/tty2 -- no shell will be provided"), return;
+ #- make sure we don't pick up any gunk from the outside world
+ my $remote_path = "$o->{prefix}/sbin:$o->{prefix}/bin:$o->{prefix}/usr/sbin:$o->{prefix}/usr/bin:$o->{prefix}/usr/X11R6/bin";
+ $ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin:$remote_path" unless $::g_auto_install;
- open STDIN, "<&F" or die;
- open STDOUT, ">&F" or die;
- open STDERR, ">&F" or die;
- close F;
+ $o->{interactive} ||= 'gtk';
+ if ($o->{interactive} eq "gtk" && availableMemory < 22 * 1024) {
+ log::l("switching to newt install cuz not enough memory");
+ $o->{interactive} = "newt";
+ }
- c::setsid();
+ if ($::auto_install) {
+ require install_steps_auto_install;
+ eval { $o = $::o = install_any::loadO($o, $::auto_install) };
+ if ($@) {
+ log::l("error using auto_install, continuing");
+ undef $::auto_install;
+ } else {
+ log::l("auto install config file loaded successfully");
+ }
+ }
+ unless ($::auto_install) {
+ $o->{interactive} ||= 'gtk';
+ require"install_steps_$o->{interactive}.pm";
+ }
+ eval { $o = $::o = install_any::loadO($o, "patch") } if $patch;
+ eval { $o = $::o = install_any::loadO($o, $cfg) } if $cfg;
- ioctl(STDIN, c::TIOCSCTTY(), 0) or warn "could not set new controlling tty: $!";
+ $o->{prefix} = $::testing ? "/tmp/test-perl-install" : $::live ? "" : "/mnt";
+ mkdir $o->{prefix}, 0755;
- exec {"/bin/sh"} "-/bin/sh" or log::l("exec of /bin/sh failed: $!");
-}
+ modules::unload($_) foreach qw(vfat msdos fat);
+ modules::load_deps(($::testing ? ".." : "") . "/modules/modules.dep");
+ modules::read_stage1_conf("/tmp/conf.modules");
+ modules::read_already_loaded();
-sub main {
+ eval { modules::load("af_packet") };
- # if this fails, it's okay -- it might help with free space though
- unlink "/sbin/install";
+ map_index {
+ modules::add_alias("sound-slot-$::i", $_->{driver});
+ } modules::get_that_type('sound');
- print STDERR "in second stage install\n";
+ #- needed very early for install_steps_gtk
+ modules::load_thiskind("usb");
+ eval { ($o->{mouse}, $o->{wacom}) = mouse::detect() } unless $o->{nomouseprobe} || $o->{mouse};
- $o->{rootPath} = "/mnt";
+ lang::set($o->{lang}); #- mainly for defcfg
- $o->{method} = install_methods->new('cdrom');
- $o->{install} = install_steps_graphical->new($o);
+ $o->{allowFB} = listlength(cat_("/proc/fb"));
- unless ($testing || $o->{localInstall}) {
- if (fork == 0) {
- while (1) { sleep(30); sync(); }
- }
+ my $VERSION = cat__(install_any::getFile("VERSION"));
+ $o->{lnx4win} = 1 if $VERSION =~ /lnx4win/i;
+ $o->{meta_class} = 'desktop' if $VERSION =~ /desktop/i;
+ if ($o->{meta_class} eq 'desktop') {
+ $o->{installClass} = 'normal';
+ }
+ if ($::oem) {
+ $o->{partitioning}{use_existing_root} = 1;
+ $o->{partitioning}{auto_allocate} = 1;
+ $o->{compssListLevel} = 50;
+ push @auto, 'selectInstallClass', 'selectMouse', 'doPartitionDisks', 'choosePackages', 'configureTimezone', 'configureX', 'exitInstall';
}
- $o->{exitOnSuspend} = $o->{localInstall} || $testing;
-
- log::openLog(($testing || $o->{localInstall}) && 'debug.log');
- log::l("second stage install running (version $INSTALL_VERSION)");
+ foreach (@auto) {
+ eval "undef *" . (!/::/ && "install_steps_interactive::") . $_;
+ my $s = $o->{steps}{/::(.*)/ ? $1 : $_} or next;
+ $s->{hidden} = 1;
+ }
- log::ld("extra log messages are enabled");
+ my $o_;
+ while (1) {
+ require"install_steps_$o->{interactive}.pm";
+ $o_ = $::auto_install ?
+ install_steps_auto_install->new($o) :
+ $o->{interactive} eq "stdio" ?
+ install_steps_stdio->new($o) :
+ $o->{interactive} eq "newt" ?
+ install_steps_newt->new($o) :
+ $o->{interactive} eq "gtk" ?
+ install_steps_gtk->new($o) :
+ die "unknown install type";
+ $o_ and last;
+
+ $o->{interactive} = "newt";
+ require install_steps_newt;
+ }
+ $::o = $o = $o_;
+
+ if (-e "/tmp/network") {
+ require network;
+ #- get stage1 network configuration if any.
+ $o->{netc} ||= network::read_conf("/tmp/network");
+ if (my ($file) = glob_('/tmp/ifcfg-*')) {
+ log::l("found network config file $file");
+ my $l = network::read_interface_conf($file);
+ add2hash(network::findIntf($o->{intf} ||= {}, $l->{DEVICE}), $l);
+ }
+ }
- $o->{rootPath} eq '/mnt' and spawnShell();
+ #-the main cycle
+ my $clicked = 0;
+ MAIN: for ($o->{step} = $o->{steps}{first};; $o->{step} = getNextStep()) {
+ $o->{steps}{$o->{step}}{entered}++;
+ $o->enteringStep($o->{step});
+ eval {
+ &{$install2::{$o->{step}}}($clicked, $o->{steps}{$o->{step}}{entered});
+ };
+ $o->kill_action;
+ $clicked = 0;
+ while ($@) {
+ local $_ = $@;
+ $o->kill_action;
+ if (/^setstep (.*)/) {
+ $o->{step} = $1;
+ $o->{steps}{$1}{done} = 0;
+ $clicked = 1;
+ redo MAIN;
+ }
+ /^theme_changed$/ and redo MAIN;
+ unless (/^already displayed/ || /^ask_from_list cancel/) {
+ eval { $o->errorInStep($_) };
+ $@ and next;
+ }
+ $o->{step} = $o->{steps}{$o->{step}}{onError};
+ next MAIN unless $o->{steps}{$o->{step}}{reachable}; #- sanity check: avoid a step not reachable on error.
+ redo MAIN;
+ }
+ $o->{steps}{$o->{step}}{done} = 1;
+ $o->leavingStep($o->{step});
-# chooseLanguage('fr');
+ last if $o->{step} eq 'exitInstall';
+ }
+ install_any::clean_postinstall_rpms();
+ install_any::log_sizes($o);
+ install_any::ejectCdrom();
- $o->{netc} = net::readNetConfig("/tmp");
+ $::live or fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
+ modules::write_conf($o->{prefix});
- if (my ($file) = glob_('/tmp/ifcfg-*')) {
- log::l("found network config file $file");
- $o->{intf} = net::readNetInterfaceConfig($file);
+ #- to ensure linuxconf doesn't cry against those files being in the future
+ foreach ('/etc/modules.conf', '/etc/crontab', '/etc/sysconfig/mouse', '/etc/sysconfig/network', '/etc/X11/fs/config') {
+ my $now = time - 24 * 60 * 60;
+ utime $now, $now, "$o->{prefix}/$_";
}
+ $::live or install_any::killCardServices();
- log::l("reading /usr/lib/rpm/rpmrc");
- c::rpmReadConfigFiles_();
- log::l("\tdone");
+ #- make sure failed upgrade will not hurt too much.
+ install_steps::cleanIfFailedUpgrade($o);
- modules::load_deps("/modules/modules.dep");
- modules::read_conf("/tmp/conf.modules");
+ -e "$o->{prefix}/usr/bin/urpmi" or eval { commands::rm("-rf", "$o->{prefix}/var/lib/urpmi") };
- # make sure we don't pick up any gunk from the outside world
- $ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin";
- $ENV{LD_LIBRARY_PATH} = "";
+ #- mainly for auto_install's
+ run_program::rooted($o->{prefix}, "sh", "-c", $o->{postInstall}) if $o->{postInstall};
+ do { local $ENV{PATH} = $remote_path;
+ run_program::run("bash", "-c", $o->{postInstallNonRooted}) } if $o->{postInstallNonRooted};
- $o->{keyboard} = keyboard::read("/tmp/keyboard") || $default->{keyboard};
+ #- have the really bleeding edge ddebug.log
+ eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") };
- for (my $step = $o->{steps}->{first}; $step ne 'done'; $step = getNextStep($step)) {
- log::l("entering step $step");
- &{$main::{$step}}() and $o->{steps}->{completed} = 1;
- log::l("step $step finished");
- }
- killCardServices();
+ #- ala pixel? :-) [fpons]
+ sync(); sync();
log::l("installation complete, leaving");
-
- <STDIN> unless $testing;
-}
-
-sub killCardServices {
- my $pid = cat_("/tmp/cardmgr.pid");
- $pid and kill(15, chop_($pid)); # send SIGTERM
+ print "\n" x 80;
}
-main(@ARGV);
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 514b940e7..bf337d8be 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1,55 +1,216 @@
-package install_any;
+package install_any; # $Id$
use diagnostics;
use strict;
-use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);
+
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @needToCopy @needToCopyIfRequiresSatisfied $boot_medium);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- all => [ qw(versionString getNextStep doSuspend spawnSync spawnShell) ],
+ all => [ qw(getNextStep spawnShell addToBeDone) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
-use common qw(:system);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :system :functional :file);
+use run_program;
+use partition_table qw(:types);
+use partition_table_raw;
+use devices;
+use fsedit;
+use modules;
+use detect_devices;
+use lang;
+use any;
use log;
+use fs;
-1;
+#- package that have to be copied for proper installation (just to avoid changing cdrom)
+#- here XFree86 is copied entirey if not already installed, maybe better to copy only server.
+@needToCopy = qw(
+XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
+XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
+XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs XFree86-FBDev XFree86-server
+XFree86 XFree86-glide-module Device3Dfx Glide_V3-DRI Glide_V5 Mesa
+dhcpcd pump dhcpxd dhcp-client isdn4net isdn4k-utils dev pptp-adsl-fr rp-pppoe ppp ypbind
+rhs-printfilters lpr cups cups-drivers samba ncpfs ghostscript-utils
+);
+#- package that have to be copied only if all their requires are satisfied.
+@needToCopyIfRequiresSatisfied = qw(
+xpp kups kisdn
+);
-sub versionString {
- my $kernel = $::o->{packages}->{kernel} or die "I couldn't find the kernel package!";
-
- c::headerGetEntry($kernel->{header}, 'version') . "-" .
- c::headerGetEntry($kernel->{header}, 'release');
+#- boot medium (the first medium to take into account).
+$boot_medium = 1;
+
+#-######################################################################################
+#- Media change variables&functions
+#-######################################################################################
+my $postinstall_rpms = '';
+my $current_medium = $boot_medium;
+my $asked_medium = $boot_medium;
+my $cdrom = undef;
+sub useMedium($) {
+ #- before ejecting the first CD, there are some files to copy!
+ #- does nothing if the function has already been called.
+ $_[0] > 1 and $::o->{method} eq 'cdrom' and setup_postinstall_rpms($::o->{prefix}, $::o->{packages});
+
+ $asked_medium eq $_[0] or log::l("selecting new medium '$_[0]'");
+ $asked_medium = $_[0];
+}
+sub changeMedium($$) {
+ my ($method, $medium) = @_;
+ log::l("change to medium $medium for method $method (refused by default)");
+ 0;
+}
+sub relGetFile($) {
+ local $_ = $_[0];
+ m|\.rpm$| ? "$::o->{packages}[2]{$asked_medium}{rpmsdir}/$_" : $_;
+}
+sub askChangeMedium($$) {
+ my ($method, $medium) = @_;
+ my $allow;
+ do {
+ eval { $allow = changeMedium($method, $medium) };
+ } while ($@); #- really it is not allowed to die in changeMedium!!! or install will cores with rpmlib!!!
+ $allow;
}
+sub errorOpeningFile($) {
+ my ($file) = @_;
+ $file eq 'XXX' and return; #- special case to force closing file after rpmlib transaction.
+ $current_medium eq $asked_medium and log::l("errorOpeningFile $file"), return; #- nothing to do in such case.
+ $::o->{packages}[2]{$asked_medium}{selected} or return; #- not selected means no need for worying about.
+ my $max = 32; #- always refuse after $max tries.
+ if ($::o->{method} eq "cdrom") {
+ cat_("/proc/mounts") =~ m|(/tmp/\S+)\s+/tmp/rhimage| and $cdrom = $1;
+ return unless $cdrom;
+ ejectCdrom($cdrom);
+ while ($max > 0 && askChangeMedium($::o->{method}, $asked_medium)) {
+ $current_medium = $asked_medium;
+ eval { fs::mount($cdrom, "/tmp/rhimage", "iso9660", 'readonly') };
+ my $getFile = getFile($file); $getFile and return $getFile;
+ $current_medium = 'unknown'; #- don't know what CD is inserted now.
+ ejectCdrom($cdrom);
+ --$max;
+ }
+ } else {
+ while ($max > 0 && askChangeMedium($::o->{method}, $asked_medium)) {
+ $current_medium = $asked_medium;
+ my $getFile = getFile($file); $getFile and return $getFile;
+ $current_medium = 'unknown'; #- don't know what CD image has been copied.
+ --$max;
+ }
+ }
-sub getNextStep {
- my ($lastStep) = @_;
+ #- keep in mind the asked medium has been refused on this way.
+ #- this means it is no more selected.
+ $::o->{packages}[2]{$asked_medium}{selected} = undef;
- $::o->{direction} = 1;
+ #- on cancel, we can expect the current medium to be undefined too,
+ #- this enable remounting if selecting a package back.
+ $current_medium = 'unknown';
- return $::o->{lastChoice} = $::o->{steps}->{$lastStep}->{next};
+ return;
+}
+sub getFile {
+ my ($f, $method) = @_;
+ my $rel = relGetFile($f);
+ log::l("getFile $f ($method) relGetFile $rel");
+ do {
+ if ($method =~ /crypto/i) {
+ require crypto;
+ log::l("crypto::getFile $f");
+ crypto::getFile($f);
+ } elsif ($::o->{method} eq "ftp") {
+ require ftp;
+ ftp::getFile($rel);
+ } elsif ($::o->{method} eq "http") {
+ require http;
+ log::l("http getFile $f");
+ http::getFile($rel);
+ } else {
+ #- try to open the file, but examine if it is present in the repository, this allow
+ #- handling changing a media when some of the file on the first CD has been copied
+ #- to other to avoid media change...
+ my $f2 = "$postinstall_rpms/$f";
+ $f2 = "/tmp/rhimage/$rel" unless $postinstall_rpms && -e $f2;
+ log::l("local getFile $f2");
+ open GETFILE, $f2 and *GETFILE;
+ }
+ } || errorOpeningFile($f);
+}
+sub getAndSaveFile {
+ my ($file, $local) = @_;
+ log::l("getAndSaveFile $file $local");
+ local *F; open F, ">$local" or return;
+ local $/ = \ (16 * 1024);
+ my $f = ref($file) ? $file : getFile($file) or return;
+ local $_;
+ while (<$f>) { syswrite F, $_ }
+ 1;
}
-sub doSuspend {
- exit 1 if $::o->{localInstall} || $::testing;
- if (my $pid = fork) {
- waitpid $pid, 0;
- } else {
- print "\n\nType <exit> to return to the install program.\n\n";
- exec {"/bin/sh"} "-/bin/sh";
- warn "error execing /bin/sh";
- sleep 5;
- exit 1;
+#-######################################################################################
+#- Post installation RPMS from cdrom only, functions
+#-######################################################################################
+sub setup_postinstall_rpms($$) {
+ my ($prefix, $packages) = @_;
+
+ $postinstall_rpms and return;
+ $postinstall_rpms = "$prefix/usr/postinstall-rpm";
+
+ require pkgs;
+ require commands;
+
+ log::l("postinstall rpms directory set to $postinstall_rpms");
+ clean_postinstall_rpms(); #- make sure in case of previous upgrade problem.
+ commands::mkdir_('-p', $postinstall_rpms);
+
+ #- compute closure of unselected package that may be copied,
+ #- don't complain if package does not exists as it may happen
+ #- for the various architecture taken into account (X servers).
+ my %toCopy;
+ foreach (@needToCopy) {
+ my $pkg = pkgs::packageByName($packages, $_);
+ pkgs::selectPackage($packages, $pkg, 0, \%toCopy) if $pkg;
}
+ @toCopy{@needToCopyIfRequiresSatisfied} = ();
+
+ my @toCopy = map { pkgs::packageByName($packages, $_) } keys %toCopy;
+
+ #- extract headers of package, this is necessary for getting
+ #- the complete filename of each package.
+ #- copy the package files in the postinstall RPMS directory.
+ #- last arg is default medium '' known as the CD#1.
+ pkgs::extractHeaders($prefix, \@toCopy, $packages->[2]{1});
+ commands::cp((map { "/tmp/rhimage/" . relGetFile(pkgs::packageFile($_)) } @toCopy), $postinstall_rpms);
+}
+sub clean_postinstall_rpms() {
+ require commands;
+ $postinstall_rpms and -d $postinstall_rpms and commands::rm('-rf', $postinstall_rpms);
}
-sub spawnSync {
- return if $::o->{localInstall} || $::testing;
+#-######################################################################################
+#- Functions
+#-######################################################################################
+sub kernelVersion {
+ my ($o) = @_;
+ local $_ = readlink("$::o->{prefix}/boot/vmlinuz") and return first(/vmlinuz-(.*)/);
- fork and return;
- while (1) { sleep(30); sync(); }
+ require pkgs;
+ my $p = pkgs::packageByName($o->{packages}, "kernel") or die "I couldn't find the kernel package!";
+ pkgs::packageVersion($p) . "-" . pkgs::packageRelease($p);
+}
+
+
+sub getNextStep {
+ my ($s) = $::o->{steps}{first};
+ $s = $::o->{steps}{$s}{next} while $::o->{steps}{$s}{done} || !$::o->{steps}{$s}{reachable};
+ $s;
}
sub spawnShell {
@@ -62,9 +223,9 @@ sub spawnShell {
local *F;
sysopen F, "/dev/tty2", 2 or die "cannot open /dev/tty2 -- no shell will be provided";
- open STDIN, "<&F" or die;
- open STDOUT, ">&F" or die;
- open STDERR, ">&F" or die;
+ open STDIN, "<&F" or die '';
+ open STDOUT, ">&F" or die '';
+ open STDERR, ">&F" or die '';
close F;
c::setsid();
@@ -74,88 +235,497 @@ sub spawnShell {
exec {"/bin/sh"} "-/bin/sh" or log::l("exec of /bin/sh failed: $!");
}
+sub fsck_option {
+ my ($o) = @_;
+ my $y = $o->{security} < 3 && $::beginner ? "-y " : "";
+ substInFile { s/^(\s*fsckoptions="?)(-y )?/$1$y/ } "$o->{prefix}/etc/rc.d/rc.sysinit";
+}
+
+sub getAvailableSpace {
+ my ($o) = @_;
+
+ #- make sure of this place to be available for installation, this could help a lot.
+ #- currently doing a very small install use 36Mb of postinstall-rpm, but installing
+ #- these packages may eat up to 90Mb (of course not all the server may be installed!).
+ #- 65mb may be a good choice to avoid almost all problem of insuficient space left...
+ my $minAvailableSize = 65 * sqr(1024);
+
+ my $n = !$::testing && getAvailableSpace_mounted($o->{prefix}) ||
+ getAvailableSpace_raw($o->{fstab}) * 512 / 1.07;
+ $n - max(0.1 * $n, $minAvailableSize);
+}
+
+sub getAvailableSpace_mounted {
+ my ($prefix) = @_;
+ my $dir = -d "$prefix/usr" ? "$prefix/usr" : "$prefix";
+ my (undef, $free) = common::df($dir) or return;
+ log::l("getAvailableSpace_mounted $free KB");
+ $free * 1024 || 1;
+}
+sub getAvailableSpace_raw {
+ my ($fstab) = @_;
+
+ do { $_->{mntpoint} eq '/usr' and return $_->{size} } foreach @$fstab;
+ do { $_->{mntpoint} eq '/' and return $_->{size} } foreach @$fstab;
+
+ if ($::testing) {
+ my $nb = 450;
+ log::l("taking ${nb}MB for testing");
+ return $nb << 11;
+ }
+ die "missing root partition";
+}
+
+sub setPackages($) {
+ my ($o) = @_;
+
+ require pkgs;
+ if (!$o->{packages} || is_empty_hash_ref($o->{packages}[0])) {
+ $o->{packages} = pkgs::psUsingHdlists($o->{prefix}, $o->{method});
+
+ push @{$o->{default_packages}}, "nfs-utils-clients" if $o->{method} eq "nfs";
+ push @{$o->{default_packages}}, "numlock" if $o->{miscellaneous}{numlock};
+ push @{$o->{default_packages}}, "kernel-secure" if $o->{security} > 3;
+ push @{$o->{default_packages}}, "kernel-smp" if $o->{security} <= 3 && detect_devices::hasSMP(); #- no need for kernel-smp if we have kernel-secure which is smp
+ push @{$o->{default_packages}}, "kernel-pcmcia-cs" if $o->{pcmcia};
+ push @{$o->{default_packages}}, "apmd" if $o->{pcmcia};
+ push @{$o->{default_packages}}, "raidtools" if $o->{raid} && !is_empty_array_ref($o->{raid}{raid});
+ push @{$o->{default_packages}}, "reiserfs-utils" if grep { isReiserfs($_) } @{$o->{fstab}};
+ push @{$o->{default_packages}}, "cdrecord" if detect_devices::burners();
+ push @{$o->{default_packages}}, "alsa", "alsa-utils" if modules::get_alias("snd-slot-0") =~ /^snd-card-/;
+
+ pkgs::getDeps($o->{prefix}, $o->{packages});
+ pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'basesystem') || die("missing basesystem package"), 1);
+
+ #- some program that may be crazy on some conditions (hack waiting for Aurora to work if no fb).
+ $o->{allowFB} && (!detect_devices::matching_desc('Rage LT') &&
+ !detect_devices::matching_desc('SiS') &&
+ !detect_devices::matching_desc('Rage Mobility'))
+ or push @pkgs::skip_list, 'Aurora';
+
+ #- must be done after selecting base packages (to save memory)
+ pkgs::getProvides($o->{packages});
+
+ $o->{compss} = pkgs::readCompss($o->{prefix}, $o->{packages});
+ #- must be done after getProvides
+ $o->{compssListLevels} = pkgs::readCompssList($o->{packages}, lang::get_langs());
+ ($o->{compssUsers}, $o->{compssUsersSorted}, $o->{compssUsersIcons}, $o->{compssUsersDescr}) =
+ pkgs::readCompssUsers($o->{packages}, $o->{compss}, $o->{meta_class});
+
+ my @l = ();
+ push @l, 'xawtv', 'kwintv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall();
+ push @l, "drakprofile", "draksync", "irda-utils" if $o->{pcmcia};
+ push @l, "Glide_V5" if detect_devices::matching_desc('Voodoo 5');
+ push @l, "Glide_V3-DRI" if detect_devices::matching_desc('Voodoo (3|Banshee)');
+ push @l, "Device3Dfx", "XFree86-glide-module" if detect_devices::matching_desc('Voodoo');
+ $_->{values} = [ map { $_ + 50 } @{$_->{values}} ] foreach grep {$_} map { pkgs::packageByName($o->{packages}, $_) } @l;
+
+ #- add OpenGL games that are only usefull if a 3D accelerated card is installed.
+ my @gl = ();
+ if (detect_devices::matching_desc('Matrox.* G[24]00') ||
+ detect_devices::matching_desc('Riva.*128') ||
+ detect_devices::matching_desc('Rage X[CL]') ||
+ detect_devices::matching_desc('Rage Mobility (?:P\/M|L) ') ||
+ detect_devices::matching_desc('3D Rage (?:LT|Pro)') ||
+ detect_devices::matching_desc('Voodoo [35]') ||
+ detect_devices::matching_desc('Voodoo Banshee') ||
+ detect_devices::matching_desc('8281[05].* CGC') ||
+ detect_devices::matching_desc('Rage 128')) {
+ push @gl, "xscreensaver-gl", "Mesa-demos", "xmms-mesa";
+ push @gl, "bzflag" if (!detect_devices::matching_desc('Riva.*128') &&
+ !detect_devices::matching_desc('Rage X[CL]') &&
+ !detect_devices::matching_desc('Rage Mobility (?:P\/M|L) ') &&
+ !detect_devices::matching_desc('3D Rage (?:LT|Pro)'));
+ push @gl, "csmash", "gltron" if (!detect_devices::matching_desc('Rage 128')); #- does not work well on transparancy.
+ push @gl, "spacecup", "chromium", "tuxracer";
+ }
+ $_->{values} = [ map { $_ + 60 } @{$_->{values}} ] foreach grep {$_} map { pkgs::packageByName($o->{packages}, $_) } @gl;
+ } else {
+ #- this has to be done to make sure necessary files for urpmi are
+ #- present.
+ pkgs::psUpdateHdlistsDeps($o->{prefix}, $o->{method});
+
+ #- remove upgrade flag with selection one. TOCHECK
+ #pkgs::unselectAllPackagesIncludingUpgradable($o->{packages});
+ }
+}
+
+sub addToBeDone(&$) {
+ my ($f, $step) = @_;
+
+ return &$f() if $::o->{steps}{$step}{done};
+
+ push @{$::o->{steps}{$step}{toBeDone}}, $f;
+}
+
+sub setAuthentication {
+ my ($o) = @_;
+ my ($shadow, $md5, $nis) = @{$o->{authentication} || {}}{qw(shadow md5 NIS)};
+ my $p = $o->{prefix};
+ any::enableMD5Shadow($p, $shadow, $md5);
+ any::enableShadow($p) if $shadow;
+ if ($nis) {
+ $o->pkg_install("ypbind");
+ my $domain = $o->{netc}{NISDOMAIN};
+ $domain || $nis ne "broadcast" or die _("Can't use broadcast with no NIS domain");
+ my $t = $domain ? "domain $domain" . ($nis ne "broadcast" && " server")
+ : "ypserver";
+ substInFile {
+ $_ = "#~$_" unless /^#/;
+ $_ .= "$t $nis\n" if eof;
+ } "$p/etc/yp.conf";
+ require network;
+ network::write_conf("$p/etc/sysconfig/network", $o->{netc});
+ }
+}
+
+sub killCardServices {
+ my $pid = chop_(cat_("/tmp/cardmgr.pid"));
+ $pid and kill(15, $pid); #- send SIGTERM
+}
+
+sub hdInstallPath() {
+ cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage| or return;
+ my ($part) = grep { $_->{device} eq $1 } @{$::o->{fstab}};
+ $part->{mntpoint} or grep { $_->{mntpoint} eq "/mnt/hd" } @{$::o->{fstab}} and return;
+ $part->{mntpoint} ||= "/mnt/hd";
+ $part->{mntpoint} . first(readlink("/tmp/rhimage") =~ m|^/tmp/hdimage/(.*)|);
+}
+
+sub unlockCdrom(;$) {
+ my ($cdrom) = @_;
+ $cdrom or cat_("/proc/mounts") =~ m|(/tmp/\S+)\s+/tmp/rhimage| and $cdrom = $1;
+ $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom | and $cdrom = $1;
+ eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 };
+}
+sub ejectCdrom(;$) {
+ my ($cdrom) = @_;
+ $cdrom or cat_("/proc/mounts") =~ m|(/tmp/\S+)\s+/tmp/rhimage| and $cdrom = $1;
+ $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom | and $cdrom = $1;
+ my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return;
+ getFile("XXX"); #- close still opened filehandle
+ eval { fs::umount("/tmp/rhimage") };
+ ioctl $f, c::CDROMEJECT(), 1;
+}
+
+sub setupFB {
+ my ($o, $vga) = @_;
+
+ $vga ||= 785; #- assume at least 640x480x16.
+
+ require bootloader;
+ #- update bootloader entries with vga, all kernel are now framebuffer.
+ foreach (qw(vmlinuz vmlinuz-secure vmlinuz-smp vmlinuz-hack)) {
+ if (my $e = bootloader::get("/boot/$_", $o->{bootloader})) {
+ $e->{vga} = $vga;
+ }
+ }
+ bootloader::install($o->{prefix}, $o->{bootloader}, $o->{fstab}, $o->{hds});
+ 1;
+}
+
+sub install_urpmi {
+ my ($prefix, $method, $mediums) = @_;
+
+ my @cfg = map_index {
+ my $name = $_->{fakemedium};
+
+ local *LIST;
+ open LIST, ">$prefix/var/lib/urpmi/list.$name" or log::l("failed to write list.$name"), return;
+
+ my $dir = ${{ nfs => "file://mnt/nfs",
+ hd => "file:/" . hdInstallPath(),
+ ftp => $ENV{URLPREFIX},
+ http => $ENV{URLPREFIX},
+ cdrom => "removable_cdrom_$::i://mnt/cdrom" }}{$method} . "/$_->{rpmsdir}";
+
+ local *FILES; open FILES, "packdrake -c /tmp/$_->{hdlist} | parsehdlist - |";
+ chop, print LIST "$dir/$_\n" foreach <FILES>;
+ close FILES or log::l("parsehdlist failed"), return;
+ close LIST;
+
+ $dir .= " with ../base/$_->{hdlist}" if $method =~ /ftp|http/;
+ "$name $dir\n";
+ } values %$mediums;
+ eval { output "$prefix/etc/urpmi/urpmi.cfg", @cfg };
+}
+
+
+#-###############################################################################
+#- kde stuff
+#-###############################################################################
+sub kderc_largedisplay {
+ my ($prefix) = @_;
+
+ update_userkderc($_, 'KDE',
+ Contrast => 7,
+ kfmIconStyle => "Large",
+ kpanelIconStyle => "Normal", #- to change to Large when icons looks better
+ KDEIconStyle => "Large") foreach list_skels($prefix, '.kderc');
+
+ substInFile {
+ s/^(GridWidth)=85/$1=100/;
+ s/^(GridHeight)=70/$1=75/;
+ } $_ foreach list_skels($prefix, '.kde/share/config/kfmrc');
+}
+
+sub kdeicons_postinstall {
+ my ($prefix) = @_;
+
+ #- parse etc/fstab file to search for dos/win, floppy, zip, cdroms icons.
+ #- handle both supermount and fsdev usage.
+ my %l = (
+ 'cdrom' => [ 'cdrom', 'Cd-Rom' ],
+ 'zip' => [ 'zip', 'Zip' ],
+ 'floppy-ls' => [ 'floppy', 'LS-120' ],
+ 'floppy' => [ 'floppy', 'Floppy' ],
+ );
+ foreach (fs::read_fstab("$prefix/etc/fstab")) {
+
+ my ($name_, $nb) = $_->{mntpoint} =~ m|.*/(\S+?)(\d*)$/|;
+ my ($name, $text) = @{$l{$name_} || []};
+
+ my $f = ${{
+ supermount => sub { $name .= '.fsdev' if $name },
+ vfat => sub { $name = 'Dos_'; $text = $name_ },
+ }}{$_->{type}};
+ &$f if $f;
+
+ template2userfile($prefix,
+ "$ENV{SHARE_PATH}/$name.kdelnk.in",
+ "Desktop/$text" . ($nb && " $nb"). ".kdelnk",
+ 1, %$_) if $name;
+ }
+
+ # rename the .kdelnk to the name found in the .kdelnk as kde doesn't use it
+ # for displaying
+ foreach my $dir (grep { -d $_ } list_skels($prefix, 'Desktop')) {
+ foreach (grep { /\.kdelnk$/ } all($dir)) {
+ cat_("$dir/$_") =~ /^Name\[\Q$ENV{LANG}\E\]=(.{2,14})$/m
+ and rename "$dir/$_", "$dir/$1.kdelnk";
+ }
+ }
+}
+
+sub kdemove_desktop_file {
+ my ($prefix) = @_;
+ my @toMove = qw(doc.kdelnk news.kdelnk updates.kdelnk home.kdelnk printer.kdelnk floppy.kdelnk cdrom.kdelnk FLOPPY.kdelnk CDROM.kdelnk);
+
+ #- remove any existing save in Trash of each user and
+ #- move appropriate file there after an upgrade.
+ foreach my $dir (grep { -d $_ } list_skels($prefix, 'Desktop')) {
+ unlink("$dir/Trash/$_") && rename("$dir/$_", "$dir/Trash/$_")
+ foreach grep { -e "$dir/$_" } @toMove, grep { /\.rpmorig$/ } all($dir)
+ }
+}
+
+
+#-###############################################################################
+#- auto_install stuff
+#-###############################################################################
+sub auto_inst_file() { ($::g_auto_install ? "/tmp" : "$::o->{prefix}/root") . "/auto_inst.cfg.pl" }
+
+sub g_auto_install(;$) {
+ my ($f) = @_; $f ||= auto_inst_file;
+ my $o = {};
+
+ require pkgs;
+ $o->{default_packages} = [ map { pkgs::packageName($_) } grep { pkgs::packageFlagSelected($_) && !pkgs::packageFlagBase($_) } values %{$::o->{packages}[0]} ];
+
+ my @fields = qw(mntpoint type size);
+ $o->{partitions} = [ map { my %l; @l{@fields} = @$_{@fields}; \%l } grep { $_->{mntpoint} } @{$::o->{fstab}} ];
+
+ exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentication printer mouse wacom netc timezone superuser intf keyboard mkbootdisk users installClass partitioning isUpgrade manualFstab nomouseprobe crypto security netcnx useSupermount autoExitInstall); #- TODO modules bootloader
+
+ if (my $card = $::o->{X}{card}) {
+ $o->{X}{$_} = $::o->{X}{$_} foreach qw(default_depth resolution_wanted);
+ if ($o->{X}{default_depth} and my $depth = $card->{depth}{$o->{X}{default_depth}}) {
+ $depth ||= [];
+ $o->{X}{resolution_wanted} ||= join "x", @{$depth->[0]} unless is_empty_array_ref($depth->[0]);
+ $o->{X}{monitor} = $::o->{X}{monitor} if $::o->{X}{monitor}{manual};
+ }
+ }
+
+ local $o->{partitioning}{auto_allocate} = 1;
+ local $o->{autoExitInstall} = 1;
+
+ $_ = { %{$_ || {}} }, delete @$_{qw(oldu oldg password password2)} foreach $o->{superuser}, @{$o->{users} || []};
+
+ output($f,
+ "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing\n",
+ Data::Dumper->Dump([$o], ['$o']), "\0");
+}
+
+sub loadO {
+ my ($O, $f) = @_; $f ||= auto_inst_file;
+ my $o;
+ if ($f =~ /^(floppy|patch)$/) {
+ my $f = $f eq "floppy" ? 'auto_inst.cfg' : "patch";
+ unless ($::testing) {
+ fs::mount(devices::make(detect_devices::floppy()), "/mnt", (arch() =~ /sparc/ ? "romfs" : "vfat"), 'readonly');
+ $f = "/mnt/$f";
+ }
+ -e $f or $f .= '.pl';
+
+ my $b = before_leaving {
+ fs::umount("/mnt") unless $::testing;
+ modules::unload($_) foreach qw(vfat fat);
+ };
+ $o = loadO($O, $f);
+ } else {
+ -e "$f.pl" and $f .= ".pl" unless -e $f;
+
+ my $fh = -e $f ? do { local *F; open F, $f; *F } : getFile($f) or die _("Error reading file $f");
+ {
+ local $/ = "\0";
+ no strict;
+ eval <$fh>;
+ close $fh;
+ $@ and log::l("Bad kickstart file $f (failed $@)");
+ }
+ add2hash_($o ||= {}, $O);
+ }
+ bless $o, ref $O;
+}
+
+sub generate_ks_cfg {
+ my ($o) = @_;
+
+ return if $o->{method} =~ /hd|cdrom/;
+
+ my $ks;
+ if ($o->{method} =~ /ftp|http/) {
+ $ks .= "url --url $ENV{URLPREFIX}\n";
+ } elsif ($o->{method} =~ /nfs/) {
+ cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/rhimage nfs| or die;
+ $ks .= "nfs --server $1 --dir $2\n";
+ }
+ my ($intf) = values %{$o->{intf}};
+ if ($intf->{BOOTPROTO} =~ /^(dhcp|bootp)$/) {
+ $ks .= "network --bootproto $intf->{BOOTPROTO}\n";
+ } else {
+ require network;
+ my %l = (ip => $intf->{IPADDR}, netmask => $intf->{NETMASK}, gateway => $o->{netc}{GATEWAY});
+ $ks .= "network " . join(" ", map_each { $::b && "--$::a $::b" } %l);
+ $ks .= " --nameserver $_" foreach network::dnsServers($o->{netc});
+ $ks .= "\n";
+ }
+ $ks;
+}
+
+sub guess_mount_point {
+ my ($part, $prefix, $user) = @_;
+
+ my %l = (
+ '/' => 'etc/fstab',
+ '/boot' => 'vmlinuz',
+ '/tmp' => '.X11-unix',
+ '/usr' => 'X11R6',
+ '/var' => 'catman',
+ );
+
+ my $handle = any::inspect($part, $prefix) or return;
+ my $d = $handle->{dir};
+ my ($mnt) = grep { -e "$d/$l{$_}" } keys %l;
+ $mnt ||= (stat("$d/.bashrc"))[4] ? '/root' : '/home/user' . ++$$user if -e "$d/.bashrc";
+ $mnt ||= (grep { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_("$d")) ? '/home' : '';
+ ($mnt, $handle);
+}
+
+sub suggest_mount_points {
+ my ($hds, $prefix, $uniq) = @_;
+ my @fstab = fsedit::get_fstab(@$hds);
+
+ my $user;
+ foreach my $part (grep { isTrueFS($_) } @fstab) {
+ $part->{mntpoint} && !$part->{unsafeMntpoint} and next; #- if already found via an fstab
+
+ my ($mnt, $handle) = guess_mount_point($part, $prefix, \$user) or next;
+
+ next if $uniq && fsedit::mntpoint2part($mnt, \@fstab);
+ $part->{mntpoint} = $mnt; delete $part->{unsafeMntpoint};
+
+ #- try to find other mount points via fstab
+ fs::get_mntpoints_from_fstab([ fsedit::get_fstab(@$hds) ], $handle->{dir}, $uniq) if $mnt eq '/';
+ }
+ $_->{mntpoint} and log::l("suggest_mount_points: $_->{device} -> $_->{mntpoint}") foreach @fstab;
+}
+
+#- mainly for finding the root partitions for upgrade
+sub find_root_parts {
+ my ($hds, $prefix) = @_;
+ log::l("find_root_parts");
+ my $user;
+ grep {
+ my ($mnt) = guess_mount_point($_, $prefix, \$user);
+ $mnt eq '/';
+ } fsedit::get_fstab(@$hds);
+}
+sub use_root_part {
+ my ($fstab, $part, $prefix) = @_;
+ {
+ my $handle = any::inspect($part, $prefix) or die;
+ fs::get_mntpoints_from_fstab($fstab, $handle->{dir}, 'uniq');
+ }
+ map { $_->{mntpoint} = 'swap' } grep { isSwap($_) } @$fstab; #- use all available swap.
+}
+
+sub getHds {
+ my ($o, $f_err) = @_;
+ my $ok = 1;
+ my $flags = $o->{partitioning};
+
+ my @drives = detect_devices::hds();
+# add2hash_($o->{partitioning}, { readonly => 1 }) if partition_table_raw::typeOfMBR($drives[0]{device}) eq 'system_commander';
+
+ getHds:
+ $o->{hds} = catch_cdie { fsedit::hds(\@drives, $flags) }
+ sub {
+ $ok = 0;
+ my $err = $@; $err =~ s/ at (.*?)$//;
+ log::l("error reading partition table: $err");
+ !$flags->{readonly} && $f_err and $f_err->($err);
+ };
+
+ if (is_empty_array_ref($o->{hds}) && $o->{autoSCSI}) {
+ $o->setupSCSI; #- ask for an unautodetected scsi card
+ goto getHds;
+ }
+
+ $ok = fsedit::verifyHds($o->{hds}, $flags->{readonly}, $ok)
+ unless $flags->{clearall} || $flags->{clear};
+ $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}) ];
+ fs::check_mounted($o->{fstab});
+ fs::merge_fstabs($o->{fstab}, $o->{manualFstab});
-sub upgrFindInstall {
-# int rc;
-#
-# if (!$::o->{table}.parts) {
-# rc = findAllPartitions(NULL, &$::o->{table});
-# if (rc) return rc;
-# }
-#
-# umountFilesystems(&$::o->{fstab});
-#
-# # rootpath upgrade support
-# if (strcmp($::o->{rootPath} ,"/mnt"))
-# return INST_OKAY;
-#
-# # this also turns on swap for us
-# rc = readMountTable($::o->{table}, &$::o->{fstab});
-# if (rc) return rc;
-#
-# if (!testing) {
-# mountFilesystems(&$::o->{fstab});
-#
-# if ($::o->{method}->prepareMedia) {
-# rc = $::o->{method}->prepareMedia($::o->{method}, &$::o->{fstab});
-# if (rc) {
-# umountFilesystems(&$::o->{fstab});
-# return rc;
-# }
-# }
-# }
-#
-# return 0;
-}
-
-sub upgrChoosePackages {
-# static int firstTime = 1;
-# char * rpmconvertbin;
-# int rc;
-# char * path;
-# char * argv[] = { NULL, NULL };
-# char buf[128];
-#
-# if (testing)
-# path = "/";
-# else
-# path = $::o->{rootPath};
-#
-# if (firstTime) {
-# snprintf(buf, sizeof(buf), "%s%s", $::o->{rootPath},
-# "/var/lib/rpm/packages.rpm");
-# if (access(buf, R_OK)) {
-# snprintf(buf, sizeof(buf), "%s%s", $::o->{rootPath},
-# "/var/lib/rpm/packages");
-# if (access(buf, R_OK)) {
-# errorWindow("No RPM database exists!");
-# return INST_ERROR;
-# }
-#
-# if ($::o->{method}->getFile($::o->{method}, "rpmconvert",
-# &rpmconvertbin)) {
-# return INST_ERROR;
-# }
-#
-# symlink("/mnt/var", "/var");
-# winStatus(35, 3, _("Upgrade"), _("Converting RPM database..."));
-# chmod(rpmconvertbin, 0755);
-# argv[0] = rpmconvertbin;
-# rc = runProgram(RUN_LOG, rpmconvertbin, argv);
-# if ($::o->{method}->rmFiles)
-# unlink(rpmconvertbin);
-#
-# newtPopWindow();
-# if (rc) return INST_ERROR;
-# }
-# winStatus(35, 3, "Upgrade", _("Finding packages to upgrade..."));
-# rc = ugFindUpgradePackages(&$::o->{packages}, path);
-# newtPopWindow();
-# if (rc) return rc;
-# firstTime = 0;
-# psVerifyDependencies(&$::o->{packages}, 1);
-# }
-#
-# return psSelectPackages(&$::o->{packages}, &$::o->{comps}, NULL, 0, 1);
+ my @win = grep { isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}};
+ log::l("win parts: ", join ",", map { $_->{device} } @win) if @win;
+ if (@win == 1) {
+ $win[0]{mntpoint} = "/mnt/windows";
+ } else {
+ my %w; foreach (@win) {
+ my $v = $w{$_->{device_windobe}}++;
+ $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou
+ }
+ }
+
+ my @sunos = grep { isSunOS($_) && type2name($_->{type}) =~ /root/i } @{$o->{fstab}}; #- take only into account root partitions.
+ if (@sunos) {
+ my $v = '';
+ map { $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos;
+ }
+ #- a good job is to mount SunOS root partition, and to use mount point described here in /etc/vfstab.
+
+ $ok;
}
+
+sub log_sizes {
+ my ($o) = @_;
+ my @df = common::df($o->{prefix});
+ log::l(sprintf "Installed: %dMB(df), %dMB(rpm)",
+ ($df[0] - $df[1]) / 1024,
+ sum(`rpm --root $o->{prefix}/ -qa --queryformat "%{size}\n"`) / sqr(1024)) if -x "$o->{prefix}/bin/rpm";
+}
+
+1;
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 9e38b3038..2840166dc 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -1,4 +1,4 @@
-package install_gtk;
+package install_gtk; # $Id$
use diagnostics;
use strict;
@@ -12,6 +12,7 @@ use devices;
#-INTERN CONSTANT
#-#####################################################################################
my @themes_vga16 = qw(blue blackwhite savane);
+my @themes_desktop = qw(mdk-Desktop DarkMarble marble3d blueHeart);
my @themes = qw(mdk DarkMarble marble3d blueHeart);
my (@background1, @background2);
@@ -34,6 +35,7 @@ sub load_rc {
sub default_theme {
my ($o) = @_;
+ @themes = @themes_desktop if $o->{meta_class} eq 'desktop';
@themes = @themes_vga16 if $o->{simple_themes} || $o->{vga16};
install_theme($o, $o->{theme} || $themes[0]);
}
@@ -41,7 +43,6 @@ sub default_theme {
#------------------------------------------------------------------------------
sub install_theme {
my ($o, $theme) = @_;
- $::live and return;
$o->{theme} = $theme || $o->{theme};
@@ -63,7 +64,8 @@ widget "*Steps*" style "small-font"
));
}
- gtkset_background(@background1);# unless $::testing;
+
+ gtkset_background(@background1) unless $::live; #- || testing;
create_logo_window($o);
create_help_window($o);
@@ -71,12 +73,12 @@ widget "*Steps*" style "small-font"
#------------------------------------------------------------------------------
sub create_big_help {
+ my ($o) = @_;
my $w = my_gtk->new('', grab => 1, force_position => [ $::stepswidth, $::logoheight ]);
$w->{rwindow}->set_usize($::logowidth, $::rootheight - $::logoheight);
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
- 1, createScrolledWindow(gtktext_insert(new Gtk::Text,
- formatAlaTeX(_ deref($help::steps{$::o->{step}})))),
+ 1, createScrolledWindow(gtktext_insert(new Gtk::Text, $o->{current_help})),
0, gtksignal_connect(my $ok = new Gtk::Button(_("Ok")), "clicked" => sub { Gtk->main_quit }),
));
$ok->grab_focus;
@@ -87,7 +89,6 @@ sub create_big_help {
#------------------------------------------------------------------------------
sub create_help_window {
my ($o) = @_;
- $::live and return;
my $w;
if ($w = $o->{help_window}) {
@@ -102,11 +103,10 @@ sub create_help_window {
my $pixmap = new Gtk::Pixmap(gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/help.xpm"));
gtkadd($w->{window},
gtkpack_(new Gtk::HBox(0,-2),
- 0, gtkadd(gtksignal_connect(new Gtk::Button, clicked => \&create_big_help), $pixmap),
+ 0, gtkadd(gtksignal_connect(new Gtk::Button, clicked => sub { create_big_help($o) }), $pixmap),
1, createScrolledWindow($o->{help_window_text} = new Gtk::Text),
));
- gtktext_insert($o->{help_window_text}, $o->{step} ? formatAlaTeX(_ deref($help::steps{$o->{step}})) : '');
-
+ $o->set_help($o->{step}) if $o->{step};
$w->show;
$o->{help_window} = $w;
}
@@ -114,7 +114,6 @@ sub create_help_window {
#------------------------------------------------------------------------------
sub create_steps_window {
my ($o) = @_;
- $::live and return;
my $PIX_H = my $PIX_W = 21;
@@ -126,7 +125,7 @@ sub create_steps_window {
$w->{rwindow}->set_usize($::stepswidth, $::stepsheight);
$w->{rwindow}->set_name('Steps');
$w->{rwindow}->set_events('button_press_mask');
- $w->show;
+ #$w->show;
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
@@ -181,7 +180,6 @@ sub create_steps_window {
#------------------------------------------------------------------------------
sub create_logo_window {
my ($o) = @_;
- $::live and return;
gtkdestroy($o->{logo_window});
my $w = bless {}, 'my_gtk';
@@ -190,7 +188,7 @@ sub create_logo_window {
$w->{rwindow}->set_usize($::logowidth, $::logoheight);
$w->{rwindow}->set_name("logo");
$w->show;
- my $file = "logo-mandrake.xpm";
+ my $file = $o->{meta_class} eq 'desktop' ? "logo-mandrake-Desktop.xpm" : "logo-mandrake.xpm";
-r $file or $file = "$ENV{SHARE_PATH}/$file";
if (-r $file) {
my $ww = $w->{window};
@@ -202,10 +200,8 @@ sub create_logo_window {
#------------------------------------------------------------------------------
sub init_sizes() {
-# my $maxheight = arch() eq "ppc" ? 1024 : 600;
-# my $maxwidth = arch() eq "ppc" ? 1280 : 800;
- ($::rootheight, $::rootwidth) = (480, 640);
($::rootheight, $::rootwidth) = my_gtk::gtkroot()->get_size;
+ $::live and $::rootheight -= 80;
#- ($::rootheight, $::rootwidth) = (min(768, $::rootheight), min(1024, $::rootwidth));
($::stepswidth, $::stepsheight) = (145, $::rootheight);
($::logowidth, $::logoheight) = ($::rootwidth - $::stepswidth, 40);
@@ -364,4 +360,79 @@ END
#- ModeLine "640x480" 28 640 672 768 800 480 490 492 525
+sub test_mouse {
+ my ($mouse) = @_;
+
+ my $w = my_gtk->new;
+ my ($width, $height, $offset) = (210, round_up($::windowheight - 150, 6), 25);
+ my ($bw, $bh) = ($width / 3, $height / 3);
+
+ gtkadd($w->{window},
+ gtkpack(new Gtk::VBox(0,0),
+ my $darea = gtkset_usize(new Gtk::DrawingArea, $width+1, $height+1),
+ '',
+ create_okcancel($w, '', '', "edge"),
+ ),
+ );
+
+ my $draw_rect; $draw_rect = sub {
+ my ($black, $fill, $rect) = @_;
+ $draw_rect->(0, 1, $rect) if !$fill; #- blank it first
+ $darea->window->draw_rectangle($black ? $darea->style->fg_gc('normal') : $darea->style->bg_gc('normal'), $fill, @$rect);
+ $darea->draw($rect);
+ };
+ my $paintWheel = sub {
+ my ($x, $y, $w, $h) = ($width / 2 - $bw / 6, $bh / 4, $bw / 3, $bh / 2);
+ $mouse->{nbuttons} = max($mouse->{nbuttons}, 5); #- it means, the mouse has more than 3 buttons...
+ $draw_rect->(1, 0, [ $x, $y, $w, $h ]);
+
+ my $offset = 0 if 0;
+ $offset += $_[0] if $_[0];
+ my $step = 10;
+ for (my $i = $offset % $step; $i < $h; $i += $step) {
+ $draw_rect->(1, 1, [ $x, $y + $i, $w, min(2, $h - $i) ]);
+ }
+ };
+ my $paintButton = sub {
+ my ($nb, $pressed) = @_;
+ my $rect = [ $bw * $nb, 0, $bw, $bh ];
+ $draw_rect->(1, $pressed, $rect);
+ $paintWheel->(0) if $nb == 1 && $mouse->{nbuttons} > 3;
+ };
+ my $draw_text = sub {
+ my ($t, $y) = @_;
+ my $font = $darea->style->font;
+ my $w = $font->string_width($t);
+ $darea->window->draw_string($font, $darea->style->fg_gc('normal'), ($width - $w) / 2, $y, $t);
+ };
+ my $default_time = 10;
+ my $time = $default_time;
+ $darea->signal_connect(button_press_event => sub {
+ my $b = $_[1]{button};
+ $time = $default_time;
+ $b >= 4 ?
+ $paintWheel->($b == 4 ? -1 : 1) :
+ $paintButton->($b - 1, 1);
+ });
+ $darea->signal_connect(button_release_event => sub {
+ my $b = $_[1]{button};
+ $paintButton->($b - 1, 0) if $b < 4;
+ });
+ $darea->size($width, $height);
+ $darea->set_events([ 'button_press_mask', 'button_release_mask' ]);
+
+ $w->sync; # HACK
+ $draw_rect->(1, 0, [ 0, 0, $width, $height]);
+ $draw_text->(_("Please test the mouse"), 2 * $bh - 20);
+ $draw_text->(_("To activate the mouse,"), 2 * $bh + 10) if $mouse->{XMOUSETYPE} eq 'IMPS/2';
+ $draw_text->(_("MOVE YOUR WHEEL!"), 2 * $bh + 30) if $mouse->{XMOUSETYPE} eq 'IMPS/2';
+
+ $paintButton->($_, 0) foreach 0..2;
+ $w->{cancel}->grab_focus;
+# my $timeout = Gtk->timeout_add(1000, sub { if ($time-- == 0) { log::l("timeout test_mouse"); undef $w->{retval}; Gtk->main_quit } 1 });
+# my $b = before_leaving { log::l("removing timeout"); Gtk->timeout_remove($timeout) };
+ $w->main;
+}
+
+
1;
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index d6eeae823..bb61e6392 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -1,4 +1,4 @@
-package install_interactive;
+package install_interactive; # $Id$
use diagnostics;
use strict;
@@ -6,164 +6,92 @@ use strict;
use vars;
use common qw(:common :functional);
-use fs;
-use fsedit;
-use log;
use partition_table qw(:types);
use partition_table_raw;
use detect_devices;
+use install_steps;
use devices;
+use fsedit;
+use log;
+use fs;
-sub getHds {
+sub tellAboutProprietaryModules {
my ($o) = @_;
- my ($ok, $ok2) = (1, 1);
- my $flags = $o->{partitioning};
-
- my @drives = detect_devices::hds();
-# add2hash_($o->{partitioning}, { readonly => 1 }) if partition_table_raw::typeOfMBR($drives[0]{device}) eq 'system_commander';
-
- getHds:
- $o->{hds} = catch_cdie { fsedit::hds(\@drives, $flags) }
- sub {
- log::l("error reading partition table: $@");
- my ($err) = $@ =~ /(.*) at /;
- $@ =~ /overlapping/ and $o->ask_warn('', $@), return 1;
- $o->ask_okcancel(_("Error"),
-[_("I can't read your partition table, it's too corrupted for me :(
-I'll try to go on blanking bad partitions"), $err]) unless $flags->{readonly};
- $ok = 0; 1
- };
-
- if (is_empty_array_ref($o->{hds}) && $o->{autoSCSI}) {
- $o->setupSCSI; #- ask for an unautodetected scsi card
- goto getHds;
- }
-
- $ok2 = fsedit::verifyHds($o->{hds}, $flags->{readonly}, $ok)
- unless $flags->{clearall} || $flags->{clear};
-
- $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}) ];
- fs::check_mounted($o->{fstab});
- fs::merge_fstabs($o->{fstab}, $o->{manualFstab});
-
+ my @l = grep {$_} map { $_->{driver} =~ /^Bad:(.*)/ && $1 } detect_devices::probeall();
$o->ask_warn('',
-_("DiskDrake failed to read correctly the partition table.
-Continue at your own risk!")) if !$ok2 && $ok && !$flags->{readonly};
-
- my @win = grep { isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }) } @{$o->{fstab}};
- log::l("win parts: ", join ",", map { $_->{device} } @win) if @win;
- if (@win == 1) {
- $win[0]{mntpoint} = "/mnt/windows";
- } else {
- my %w; foreach (@win) {
- my $v = $w{$_->{device_windobe}}++;
- $_->{mntpoint} = "/mnt/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou
- }
- }
-
- my @sunos = grep { isSunOS($_) && type2name($_->{type}) =~ /root/i } @{$o->{fstab}}; #- take only into account root partitions.
- if (@sunos) {
- my $v = '';
- map { $_->{mntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos;
- }
- #- a good job is to mount SunOS root partition, and to use mount point described here in /etc/vfstab.
-
- $ok2;
+_("Some hardware on your computer needs ``proprietary'' drivers to work.
+You can find some information about them at: %s", join(", ", @l))) if @l;
}
+sub partition_with_diskdrake {
+ my ($o, $hds, $nowizard) = @_;
+ my $ok;
-sub searchAndMount4Upgrade {
- my ($o) = @_;
- my ($root, $found);
-
- my $w = !$::expert && $o->wait_message('', _("Searching root partition."));
-
- #- try to find the partition where the system is installed if beginner
- #- else ask the user the right partition, and test it after.
- getHds($o);
-
- #- get all ext2 partition that may be root partition.
- my %Parts = my %parts = map { $_->{device} => $_ } grep { isTrueFS($_) } @{$o->{fstab}};
- while (keys(%parts) > 0) {
- $root = $::beginner ? first(%parts) : $o->selectRootPartition(keys %parts);
- $root = delete $parts{$root};
-
- my $r; unless ($r = $root->{realMntpoint}) {
- $r = $o->{prefix};
- $root->{mntpoint} = "/";
- log::l("trying to mount partition $root->{device}");
- eval { fs::mount_part($root, $o->{prefix}, 'readonly') };
- $r = "/*ERROR*" if $@;
+ $o->set_help('partition_with_diskdrake');
+ do {
+ $ok = 1;
+ require diskdrake;
+ diskdrake::main($hds, $o->{raid}, interactive_gtk->new, $o->{partitions}, $nowizard);
+ delete $o->{wizard} and return partitionWizard($o, 'nodiskdrake');
+ my @fstab = fsedit::get_fstab(@$hds, $o->{raid});
+
+ unless (fsedit::get_root_(\@fstab)) {
+ $ok = 0;
+ $o->ask_okcancel('', _("You must have a root partition.
+For this, create a partition (or click on an existing one).
+Then choose action ``Mount point'' and set it to `/'"), 1) or return;
}
- $found = -d "$r/etc/sysconfig" && [ fs::read_fstab("$r/etc/fstab") ];
-
- unless ($root->{realMntpoint}) {
- log::l("umounting partition $root->{device}");
- eval { fs::umount_part($root, $o->{prefix}) };
+ if (!grep { isSwap($_) } @fstab) {
+ $o->ask_warn('', _("You must have a swap partition")), $ok=0 if $::beginner;
+ $ok &&= $::expert || $o->ask_okcancel('', _("You don't have a swap partition\n\nContinue anyway?"));
}
-
- last if !is_empty_array_ref($found);
-
- delete $root->{mntpoint};
- $o->ask_warn(_("Information"),
- _("%s: This is not a root partition, please select another one.", $root->{device})) unless $::beginner;
- }
- is_empty_array_ref($found) and die _("No root partition found");
-
- log::l("found root partition : $root->{device}");
-
- #- test if the partition has to be fsck'ed and remounted rw.
- if ($root->{realMntpoint}) {
- ($o->{prefix}, $root->{mntpoint}) = ($root->{realMntpoint}, '/');
- } else {
- delete $root->{mntpoint};
- ($Parts{$_->{device}} || {})->{mntpoint} = $_->{mntpoint} foreach @$found;
- map { $_->{mntpoint} = 'swap_upgrade' } grep { isSwap($_) } @{$o->{fstab}}; #- use all available swap.
-
- #- TODO fsck, create check_mount_all ?
- fs::mount_all([ grep { isTrueFS($_) || isSwap($_) } @{$o->{fstab}} ], $o->{prefix});
- }
+ } until $ok;
+ 1;
}
-sub partitionWizard {
+sub partitionWizardSolutions {
my ($o, $hds, $fstab, $readonly) = @_;
my @wizlog;
my (@solutions, %solutions);
- my $min_linux = 500 << 11;
- my $max_linux = 2500 << 11;
+ my $min_linux = 400 << 11;
+ my $max_linux = 3000 << 11;
my $min_swap = 50 << 11;
my $max_swap = 300 << 11;
my $min_freewin = 100 << 11;
# each solution is a [ score, text, function ], where the function retunrs true if succeeded
- if (fsedit::free_space(@$hds) > $min_linux and !$readonly) {
+ my @good_hds = grep { partition_table::can_raw_add($_) } @$hds;
+ if (fsedit::free_space(@good_hds) > $min_linux and !$readonly) {
$solutions{free_space} = [ 20, _("Use free space"), sub { fsedit::auto_allocate($hds, $o->{partitions}); 1 } ]
} else {
- push @wizlog, _("Not enough free space to allocate new partitions");
+ push @wizlog, _("Not enough free space to allocate new partitions") . ": " .
+ (@good_hds ?
+ fsedit::free_space(@good_hds) . " < $min_linux" :
+ "no harddrive on which partitions can be added") if !$readonly;
}
- if (@$fstab) {
- my $truefs = grep { isTrueFS($_) } @$fstab;
+ if (my @truefs = grep { isTrueFS($_) } @$fstab) {
#- value twice the ext2 partitions
- $solutions{existing_part} = [ 6 + $truefs + @$fstab, _("Use existing partition"), sub { $o->ask_mntpoint_s($fstab) } ]
+ $solutions{existing_part} = [ 6 + @truefs + @$fstab, _("Use existing partition"), sub { $o->ask_mntpoint_s($fstab) } ]
} else {
push @wizlog, _("There is no existing partition to use");
}
my @fats = grep { isFat($_) } @$fstab;
fs::df($_) foreach @fats;
- if (my @ok_forloopback = sort { $b->{free} <=> $a->{free} } grep { $_->{free} > $min_linux + $min_freewin } @fats) {
+ if (my @ok_forloopback = sort { $b->{free} <=> $a->{free} } grep { $_->{free} > $min_linux + $min_swap + $min_freewin } @fats) {
$solutions{loopback} =
- [ 5 - @fats, _("Use the FAT partition for loopback"),
+ [ -10 - @fats, _("Use the Windows partition for loopback"),
sub {
my ($s_root, $s_swap);
- my $part = $o->ask_from_listf('', _("Which partition do you want to use to put Linux4Win?"), \&partition_table_raw::description, \@ok_forloopback) or return;
+ my $part = $o->ask_from_listf('', _("Which partition do you want to use for Linux4Win?"), \&partition_table_raw::description, \@ok_forloopback) or return;
+ $max_swap = $min_swap + 1 if $part->{free} - $max_swap < $min_linux;
$o->ask_from_entries_refH('', _("Choose the sizes"), [
- _("Root partition size in MB: ") => { val => \$s_root, min => 1 + ($min_linux >> 11), max => min($part->{free} - 2 * $max_swap - $min_freewin, $max_linux) >> 11, type => 'range' },
- _("Swap partition size in MB: ") => { val => \$s_swap, min => 1 + ($min_swap >> 11), max => 2 * $max_swap >> 11, type => 'range' },
+ _("Root partition size in MB: ") => { val => \$s_root, min => $min_linux >> 11, max => min($part->{free} - $max_swap, $max_linux) >> 11, type => 'range' },
+ _("Swap partition size in MB: ") => { val => \$s_swap, min => $min_swap >> 11, max => $max_swap >> 11, type => 'range' },
]) or return;
push @{$part->{loopback}},
{ type => 0x83, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => $s_root << 11, device => $part, notFormatted => 1 },
@@ -171,15 +99,18 @@ sub partitionWizard {
1;
} ];
$solutions{resize_fat} =
- [ 6 - @fats, _("Use the free space on the FAT partition"),
+ [ 6 - @fats, _("Use the free space on the Windows partition"),
sub {
+ $o->set_help('resizeFATChoose');
my $part = $o->ask_from_listf('', _("Which partition do you want to resize?"), \&partition_table_raw::description, \@ok_forloopback) or return;
- my $w = $o->wait_message(_("Resizing"), _("Computing FAT filesystem bounds"));
+ $o->set_help('resizeFATWait');
+ my $w = $o->wait_message(_("Resizing"), _("Computing Windows filesystem bounds"));
+ require resize_fat::main;
my $resize_fat = eval { resize_fat::main->new($part->{device}, devices::make($part->{device})) };
$@ and die _("The FAT resizer is unable to handle your partition,
the following error occured: %s", $@);
my $min_win = $resize_fat->min_size;
- $part->{size} > $min_linux + $min_freewin + $min_win or die _("Your windows partition is too fragmented, please run ``defrag'' first");
+ $part->{size} > $min_linux + $min_swap + $min_freewin + $min_win or die _("Your Windows partition is too fragmented, please run ``defrag'' first");
$o->ask_okcancel('', _("WARNING!
DrakX will now resize your Windows partition. Be careful: this operation is
@@ -190,7 +121,7 @@ When sure, press Ok.")) or return;
my $size = $part->{size};
$o->ask_from_entries_refH('', _("Which size do you want to keep for windows on"), [
- _("partition %s", partition_table_raw::description($part)) => { val => \$size, min => 1 + ($min_win >> 11), max => ($part->{size} - $min_linux) >> 11, type => 'range' },
+ _("partition %s", partition_table_raw::description($part)) => { val => \$size, min => $min_win >> 11, max => ($part->{size} - $min_linux - $min_swap) >> 11, type => 'range' },
]) or return;
$size <<= 11;
@@ -211,17 +142,19 @@ When sure, press Ok.")) or return;
1;
} ] if !$readonly;
} else {
- push @wizlog, _("There is no FAT partitions to resize or to use as loopback (or not enough space left)");
+ push @wizlog, _("There is no FAT partitions to resize or to use as loopback (or not enough space left)") .
+ @fats ? "\nFAT partitions:" . join('', map { "\n $_->{device} $_->{free} (" . ($min_linux + $min_swap + $min_freewin) . ")" } @fats) : '';
}
if (@$fstab && !$readonly) {
- require diskdrake;
$solutions{wipe_drive} =
- [ 10, fsedit::is_one_big_fat($hds) ? _("Remove Windows(TM)") : _("Take over the hard drive"),
+ [ 10, fsedit::is_one_big_fat($hds) ? _("Remove Windows(TM)") : _("Erase entire disk"),
sub {
+ $o->set_help('takeOverHdChoose');
my $hd = $o->ask_from_listf('', _("You have more than one hard drive, which one do you install linux on?"),
\&partition_table_raw::description, $hds) or return;
- $o->ask_okcancel('', _("All existing partitions and their data will be lost on drive %s", $hd->{device})) or return;
+ $o->set_help('takeOverHdConfirm');
+ $o->ask_okcancel('', _("ALL existing partitions and their data will be lost on drive %s", partition_table_raw::description($hd))) or return;
partition_table_raw::zero_MBR($hd);
fsedit::auto_allocate($hds, $o->{partitions});
1;
@@ -229,45 +162,84 @@ When sure, press Ok.")) or return;
}
if (!$readonly && ref($o) =~ /gtk/) { #- diskdrake only available in gtk for now
- $solutions{diskdrake} =
- [ 0, _("Use diskdrake"), sub {
- my $ok = 1;
- do {
- diskdrake::main($hds, $o->{raid}, interactive_gtk->new, $o->{partitions});
- my @fstab = fsedit::get_fstab(@$hds);
-
- unless (fsedit::get_root(\@fstab)) {
- $ok = 0;
- $o->ask_okcancel('', _("You must have a root partition.
-For this, create a partition (or click on an existing one).
-Then choose action ``Mount point'' and set it to `/'"), 1) or return;
- }
- if (!grep { isSwap($_) } @fstab) {
- $o->ask_warn('', _("You must have a swap partition")), $ok=0 if $::beginner;
- $ok &&= $::expert || $o->ask_okcancel('', _("You don't have a swap partition\n\nContinue anyway?"));
- }
- } until $ok;
- 1;
- } ];
+ $solutions{diskdrake} = [ 0, ($::beginner ? _("Expert mode") : _("Use diskdrake")), sub { partition_with_diskdrake($o, $hds, 'nowizard') } ];
}
- if (!$readonly) { #- diskdrake only available in gtk for now
- $solutions{fdisk} =
- [ -10, _("Use fdisk"), sub {
- $o->suspend;
- foreach (@$hds) {
- print "\n" x 10, _("You can now partition %s.
+ $solutions{fdisk} =
+ [ -10, _("Use fdisk"), sub {
+ $o->enter_console;
+ foreach (@$hds) {
+ print "\n" x 10, _("You can now partition %s.
When you are done, don't forget to save using `w'", partition_table_raw::description($_));
- print "\n\n";
- my $pid = fork or exec "fdisk", devices::make($_->{device});
- waitpid($pid, 0);
- }
- $o->resume;
- 0;
- } ];
- }
+ print "\n\n";
+ my $pid = fork or exec "fdisk", devices::make($_->{device});
+ waitpid($pid, 0);
+ }
+ $o->leave_console;
+ 0;
+ } ] if $o->{partitioning}{fdisk};
+
log::l("partitioning wizard log:\n", (map { ">>wizlog>>$_\n" } @wizlog));
%solutions;
}
+sub partitionWizard {
+ my ($o, $nodiskdrake) = @_;
+
+ $o->set_help('doPartitionDisks');
+
+ my %solutions = partitionWizardSolutions($o, $o->{hds}, $o->{fstab}, $o->{partitioning}{readonly});
+ if ($o->{lnx4win}) {
+ if ($solutions{loopback}) {
+ %solutions = (loopback => $solutions{loopback});
+ } else {
+ $o->ask_warn('', _("You don't have enough free space on your Windows partition")) if grep { isFat($_) } @{$o->{fstab}}
+ }
+ }
+
+ delete $solutions{diskdrake} if $nodiskdrake;
+
+ my @solutions = sort { $b->[0] <=> $a->[0] } values %solutions;
+
+ my $level = $::beginner ? 0 : $::expert ? -9999 : -10;
+ my @sol = grep { $_->[0] >= $level } @solutions;
+
+ log::l("solutions found: " . join('', map {$_->[1]} @sol) . " (all solutions found: " . join('', map {$_->[1]} @solutions) . ")");
+
+ @solutions = @sol if @sol > 1;
+ log::l("solutions: ", int @solutions);
+ @solutions or $o->ask_warn('', _("I can't find any room for installing")), die 'already displayed';
+
+ my $ok; while (!$ok) {
+ my $sol = $o->ask_from_listf('', _("The DrakX Partitioning wizard found the following solutions:"), sub { $_->[1] }, \@solutions) or redo;
+ log::l("partitionWizard calling solution $sol->[1]");
+ eval { $ok = $sol->[2]->() };
+ die if $@ =~ /setstep/;
+ $ok &&= !$@;
+ $@ and $o->ask_warn('', _("Partitioning failed: %s", $@));
+ }
+}
+
+#--------------------------------------------------------------------------------
+#- wait_load_module moved to any.pm
+#- load_module moved to any.pm
+#------------------------------------------------------------------------------
+#-load_thiskind moved to any.pm
+#------------------------------------------------------------------------------
+#-setup_thiskind moved to any.pm
+#------------------------------------------------------------------------------
+
+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);
+}
+
+
+
1;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 123507929..b07443235 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -1,220 +1,931 @@
-package install_steps;
+package install_steps; # $Id$
use diagnostics;
use strict;
-
+use vars qw(@filesToSaveForUpgrade);
+
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:file :system :common :functional);
+use install_any qw(:all);
+use install_interactive;
+use partition_table qw(:types);
+use detect_devices;
+use modules;
+use run_program;
use lang;
use keyboard;
-use pkgs;
-use cpio;
-use log;
use fsedit;
+use loopback;
+#use commands;
+use any;
+use log;
+use fs;
+@filesToSaveForUpgrade = qw(
+/etc/ld.so.conf /etc/fstab /etc/hosts /etc/conf.modules /etc/modules.conf
+);
-1;
+#-######################################################################################
+#- OO Stuff
+#-######################################################################################
+sub new($$) {
+ my ($type, $o) = @_;
+
+ bless $o, ref $type || $type;
+ return $o;
+}
+
+#-######################################################################################
+#- In/Out Steps Functions
+#-######################################################################################
+sub enteringStep {
+ my ($o, $step) = @_;
+ log::l("starting step `$step'");
+}
+sub leavingStep {
+ my ($o, $step) = @_;
+ log::l("step `$step' finished");
+
+ if (-d "$o->{prefix}/root") {
+ eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") };
+ install_any::g_auto_install();
+ }
+
+ for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) {
+ #- the reachability property must be recomputed each time to take
+ #- into account failed step.
+ next if $o->{steps}{$s}{done} && !$o->{steps}{$s}{redoable};
+
+ my $reachable = 1;
+ if (my $needs = $o->{steps}{$s}{needs}) {
+ my @l = ref $needs ? @$needs : $needs;
+ $reachable = min(map { $o->{steps}{$_}{done} || 0 } @l);
+ }
+ $o->{steps}{$s}{reachable} = 1 if $reachable;
+ }
+ $o->{steps}{$step}{reachable} = $o->{steps}{$step}{redoable};
+
+ while (my $f = shift @{$o->{steps}{$step}{toBeDone} || []}) {
+ eval { &$f() };
+ $o->ask_warn(_("Error"), [
+_("An error occurred, but I don't know how to handle it nicely.
+Continue at your own risk."), $@ ]) if $@;
+ }
+}
+
+sub errorInStep($$) { print "error :(\n"; c::_exit(1) }
+sub kill_action {}
+sub set_help { 1 }
+
+#-######################################################################################
+#- Steps Functions
+#-######################################################################################
+#------------------------------------------------------------------------------
+sub selectLanguage {
+ my ($o) = @_;
+ lang::set($o->{lang});
+
+ if ($o->{keyboard_unsafe} || !$o->{keyboard}) {
+ $o->{keyboard_unsafe} = 1;
+ $o->{keyboard} = keyboard::lang2keyboard($o->{lang});
+ selectKeyboard($o) unless $::live;
+ }
+}
+#------------------------------------------------------------------------------
+sub selectKeyboard {
+ my ($o) = @_;
+ keyboard::setup($o->{keyboard});
+ lang::set_langs($o->{langs} || [ $o->{lang} ]);
+}
+#------------------------------------------------------------------------------
+sub selectPath {}
+#------------------------------------------------------------------------------
+sub selectInstallClass($@) {
+ my ($o) = @_;
+ $o->{installClass} ||= $::corporate ? "corporate" : "normal";
+ $o->{security} ||= ${{
+ normal => 2,
+ developer => 3,
+ corporate => 3,
+ server => 4,
+ }}{$o->{installClass}};
+}
+#------------------------------------------------------------------------------
+sub setupSCSI {
+ my ($o) = @_;
+ modules::configure_pcmcia($o->{pcmcia});
+ modules::load_ide();
+ modules::load_thiskind('scsi|disk');
+}
+
+#------------------------------------------------------------------------------
+sub doPartitionDisksBefore {
+ my ($o) = @_;
+
+ if (cat_("/proc/mounts") =~ m|/\w+/(\S+)\s+/tmp/hdimage\s+(\S+)| && !$o->{partitioning}{readonly}) {
+ $o->{stage1_hd} = { device => $1, type => $2 };
+ install_any::getFile("XXX"); #- close still opened filehandle
+ eval { fs::umount("/tmp/hdimage") };
+ }
+ eval {
+ close *pkgs::LOG;
+ eval { fs::umount("$o->{prefix}/proc") };
+ eval { fs::umount_all($o->{fstab}, $o->{prefix}) };
+ eval { sleep 1; fs::umount_all($o->{fstab}, $o->{prefix}) } if $@; #- HACK
+ } if $o->{fstab} && !$::testing && !$::live;
+
+ $o->{raid} ||= {};
+}
+
+#------------------------------------------------------------------------------
+sub doPartitionDisksAfter {
+ my ($o) = @_;
+ unless ($::testing) {
+ partition_table::write($_) foreach @{$o->{hds}};
+ $_->{rebootNeeded} and $o->rebootNeeded foreach @{$o->{hds}};
+ }
+
+ $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}, $o->{raid}) ];
+ fsedit::get_root_($o->{fstab}) or die "Oops, no root partition";
+
+ if ($o->{partitioning}{use_existing_root}) {
+ #- ensure those partitions are mounted so that they are not proposed in choosePartitionsToFormat
+ fs::mount_part($_, $o->{prefix}) foreach grep { $_->{mntpoint} && !$_->{notFormatted} } @{$o->{fstab}};
+ }
+
+ if (my $s = delete $o->{stage1_hd}) {
+ my ($part) = grep { $_->{device} eq $s->{device} } @{$o->{fstab}};
+ $part->{isMounted} ?
+ do { rmdir "/tmp/hdimage" ; symlinkf("$o->{prefix}$part->{mntpoint}", "/tmp/hdimage") } :
+ eval {
+ fs::mount($s->{device}, "/tmp/hdimage", $s->{type});
+ $part->{isMounted} = 1;
+ };
+ }
+
+ cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/rhimage nfs| &&
+ !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{manualFstab} || []} and
+ push @{$o->{manualFstab}}, { type => "nfs", mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,rsize=8192,wsize=8192" };
+}
+
+#------------------------------------------------------------------------------
+sub doPartitionDisks {
+ my ($o) = @_;
+
+ install_any::getHds($o);
+
+ if ($o->{partitioning}{use_existing_root} || $o->{isUpgrade}) {
+ # either one root is defined (and all is ok), or we take the first one we find
+ my $p = fsedit::get_root_($o->{fstab}) || first(install_any::find_root_parts($o->{hds}, $o->{prefix})) or die;
+ install_any::use_root_part($o->{fstab}, $p, $o->{prefix});
+ }
+ if ($o->{partitioning}{auto_allocate}) {
+ fsedit::auto_allocate($o->{hds}, $o->{partitions});
+ }
+}
+
+#------------------------------------------------------------------------------
+
+sub ask_mntpoint_s {
+ my ($o, $fstab) = @_;
+
+ #- TODO: set the mntpoints
+ my %m; foreach (@$fstab) {
+ my $m = $_->{mntpoint};
-sub new($) {
- my ($type, $I) = @_;
+ next unless $m && $m ne 'swap'; #- there may be a lot of swap.
- bless $I, ref $type || $type;
+ $m{$m} and die _("Duplicate mount point %s", $m);
+ $m{$m} = 1;
+
+ #- in case the type does not correspond, force it to ext2
+ $_->{type} = 0x83 if $m =~ m|^/| && !isFat($_) && !isTrueFS($_);
+ }
+ 1;
}
-sub doPartitionDisks($$$) {
- my ($I, $hds) = @_;
- fsedit::auto_allocate($hds, $I->{partitions});
+sub rebootNeeded($) {
+ my ($o) = @_;
+ log::l("Rebooting...");
+ c::_exit(0);
+}
+
+sub choosePartitionsToFormat($$) {
+ my ($o, $fstab) = @_;
+
+ foreach (@$fstab) {
+ $_->{mntpoint} = "swap" if isSwap($_);
+ $_->{mntpoint} or next;
+
+ add2hash_($_, { toFormat => $_->{notFormatted} });
+ if (!$_->{toFormat}) {
+ my $t = isLoopback($_) ?
+ eval { fsedit::typeOfPart($o->{prefix} . loopback::file($_)) } :
+ fsedit::typeOfPart($_->{device});
+ $_->{toFormatUnsure} = $_->{mntpoint} eq "/" ||
+ #- if detected dos/win, it's not precise enough to just compare the types (too many of them)
+ (!$t || isOtherAvailableFS({ type => $t }) ? !isOtherAvailableFS($_) : $t != $_->{type});
+ }
+ }
+}
+
+sub formatMountPartitions {
+ my ($o) = @_;
+ fs::formatMount_all($o->{raid}, $o->{fstab}, $o->{prefix});
+}
+
+#------------------------------------------------------------------------------
+sub setPackages {
+ my ($o) = @_;
+ install_any::setPackages($o);
+ pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix})
+ if -r "$o->{prefix}/var/lib/rpm/packages.rpm" && !$o->{isUpgrade};
+}
+sub selectPackagesToUpgrade {
+ my ($o) = @_;
+ pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix}, $o->{base}, $o->{toRemove}, $o->{toSave});
}
-sub choosePackages($$$$) {
- my ($I, $packages, $comps, $isUpgrade) = @_;
+sub choosePackages {
+ my ($o, $packages, $compss, $compssUsers, $first_time) = @_;
- foreach ('base', @{$I->{comps}}) {
- $comps->{$_}->{selected} = 1;
- foreach (@{$_->{packages}}) { $_->{selected} = 1; }
+ #- now for upgrade, package that must be upgraded are
+ #- selected first, after is used the same scheme as install.
+
+ #- make sure we kept some space left for available else the system may
+ #- not be able to start (xfs at least).
+ my $available = install_any::getAvailableSpace($o);
+ my $availableCorrected = pkgs::invCorrectSize($available / sqr(1024)) * sqr(1024);
+ log::l(sprintf "available size %dMB (corrected %dMB)", $available / sqr(1024), $availableCorrected / sqr(1024));
+
+ foreach (values %{$packages->[0]}) {
+ pkgs::packageSetFlagSkip($_, 0);
+ }
+
+ #- avoid destroying user selection of packages. TOCHECK
+ if ($first_time) {
+ pkgs::unselectAllPackages($packages);
+ pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || next) foreach @{$o->{default_packages}};
+
+ add2hash_($o, { compssListLevel => $::expert ? 90 : 80 }) unless $::auto_install;
+ pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $o->{compssListLevel}, $availableCorrected, $o->{installClass}) if exists $o->{compssListLevel};
}
- foreach (@{$I->{packages}}) { $_->{selected} = 1; }
- smp::detect() and $packages->{"kernel-smp"}->{selected} = 1;
+ $availableCorrected;
}
-sub beforeInstallPackages($$$) {
- my ($I, $method, $fstab, $isUpgrade) = @_;
+sub beforeInstallPackages {
+ my ($o) = @_;
+
+ log::l("before install packages");
+ #- save these files in case of upgrade failure.
+ if ($o->{isUpgrade}) {
+ foreach (@filesToSaveForUpgrade) {
+ unlink "$o->{prefix}/$_.mdkgisave";
+ if (-e "$o->{prefix}/$_") {
+ eval { commands::cp("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave") };
+ }
+ }
+ }
+
+ log::l("before install packages, after copy");
+ #- some packages need such files for proper installation.
+ any::writeandclean_ldsoconf($o->{prefix});
+ log::l("before install packages, after writing ld.so.conf");
+ $::live or fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
- $method->prepareMedia($fstab);
+ log::l("before install packages, after adding localhost in hosts");
+ require network;
+ network::add2hosts("$o->{prefix}/etc/hosts", "localhost.localdomain", "127.0.0.1");
- foreach (qw(dev etc home mnt tmp var var/tmp var/lib var/lib/rpm)) {
- mkdir "$prefix/$_", 0755;
+ log::l("before openning database");
+ require pkgs;
+ pkgs::init_db($o->{prefix}, $o->{isUpgrade});
+ log::l("initialized database");
+}
+
+sub pkg_install {
+ my ($o, @l) = @_;
+ log::l("selecting packages");
+ require pkgs;
+ pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found") foreach @l;
+ my @toInstall = pkgs::packagesToInstall($o->{packages});
+ if (@toInstall) {
+ log::l("installing packages");
+ $o->installPackages;
+ } else {
+ log::l("all packages selected are already installed, nothing to do")
}
+}
- unless ($isUpgrade) {
- local *F;
- open F, "> $prefix/etc/hosts" or die "Failed to create etc/hosts: $!";
- print F "127.0.0.1 localhost localhost.localdomain\n";
+sub pkg_install_if_requires_satisfied {
+ my ($o, @l) = @_;
+ require pkgs;
+ foreach (@l) {
+ my %newSelection;
+ my $pkg = pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found";
+ pkgs::selectPackage($o->{packages}, $pkg, 0, \%newSelection);
+ scalar(keys %newSelection) == 1 and pkgs::selectPackage($o->{packages}, $pkg);
}
+ $o->installPackages;
}
-sub installPackages($$$$$) {
- my ($I, $prefix, $method, $packages, $isUpgrade) = @_;
+sub installPackages($$) { #- complete REWORK, TODO and TOCHECK!
+ my ($o) = @_;
+ my $packages = $o->{packages};
+
+ if (@{$o->{toRemove} || []}) {
+ #- hack to ensure proper upgrade of packages from other distribution,
+ #- as release number are not mandrake based. this causes save of
+ #- important files and restore them after.
+ foreach (@{$o->{toSave} || []}) {
+ if (-e "$o->{prefix}/$_") {
+ unlink "$o->{prefix}/$_.mdkgisave";
+ eval { commands::cp("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave") };
+ }
+ }
+ pkgs::remove($o->{prefix}, $o->{toRemove});
+ foreach (@{$o->{toSave} || []}) {
+ if (-e "$o->{prefix}/$_.mdkgisave") {
+ unlink "$o->{prefix}/$_";
+ rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_";
+ }
+ }
+ $o->{toSave} = [];
+
+ #- hack for compat-glibc to upgrade properly :-(
+ if (pkgs::packageFlagSelected(pkgs::packageByName($packages, 'compat-glibc')) &&
+ !pkgs::packageFlagInstalled(pkgs::packageByName($packages, 'compat-glibc'))) {
+ rename "$o->{prefix}/usr/i386-glibc20-linux", "$o->{prefix}/usr/i386-glibc20-linux.mdkgisave";
+ }
+ }
+
+ #- small transaction will be built based on this selection and depslist.
+ my @toInstall = pkgs::packagesToInstall($packages);
- pkgs::install($prefix, $method, $packages, $isUpgrade, 0);
+ my $time = time;
+ $ENV{DURING_INSTALL} = 1;
+ pkgs::install($o->{prefix}, $o->{isUpgrade}, \@toInstall, $packages->[1], $packages->[2]);
+ delete $ENV{DURING_INSTALL};
+ run_program::rooted($o->{prefix}, 'ldconfig') or die "ldconfig failed!" unless $::g_auto_install;
+ log::l("Install took: ", formatTimeRaw(time - $time));
+ install_any::log_sizes($o);
}
-sub afterInstallPackages($$$$) {
- my ($prefix, $keymap, $isUpgrade) = @_;
+sub afterInstallPackages($) {
+ my ($o) = @_;
- unless ($isUpgrade) {
- keyboard::write($prefix, $keymap);
- lang::write($prefix);
+ return if $::g_auto_install;
+
+ die _("Some important packages didn't get installed properly.
+Either your cdrom drive or your cdrom is defective.
+Check the cdrom on an installed computer using \"rpm -qpl Mandrake/RPMS/*.rpm\"
+") if grep { m|read failed: Input/output error| } cat_("$o->{prefix}/root/install.log");
+
+ if (arch() !~ /^sparc/) { #- TODO restore it as may be needed for sparc
+ -x "$o->{prefix}/usr/bin/dumpkeys" or $::testing or die
+"Some important packages didn't get installed properly.
+
+Please switch to console 2 (using ctrl-alt-f2)
+and look at the log file /tmp/ddebug.log
+
+Consoles 1,3,4,7 may also contain interesting information";
}
- # why not?
+
+ pkgs::done_db();
+
+ #- why not? cuz weather is nice today :-) [pixel]
sync(); sync();
-# configPCMCIA($o->{rootPath}, $o->{pcmcia});
+ #- configure PCMCIA services if needed.
+ modules::write_pcmcia($o->{prefix}, $o->{pcmcia});
+
+ #- for mandrake_firstime
+ touch "$o->{prefix}/var/lock/TMP_1ST";
+
+ #- remove the nasty acon...
+ run_program::rooted($o->{prefix}, "chkconfig", "--del", "acon") unless $ENV{LANGUAGE} =~ /ar/;
+
+ #- make the mdk fonts last in available fonts for buggy kde
+ run_program::rooted($o->{prefix}, "chkfontpath", "--remove", "/usr/X11R6/lib/X11/fonts/mdk");
+ run_program::rooted($o->{prefix}, "chkfontpath", "--add", "/usr/X11R6/lib/X11/fonts/mdk");
+
+ #- call update-menus at the end of package installation
+ run_program::rooted($o->{prefix}, "update-menus");
+
+ #- create /etc/sysconfig/desktop file according to user choice and presence of /usr/bin/kdm or /usr/bin/gdm.
+ my $f = "$o->{prefix}/etc/sysconfig/desktop";
+ if ($o->{compssUsersChoice}{KDE} && -x "$o->{prefix}/usr/bin/kdm") {
+ log::l("setting desktop to KDE");
+ output($f, "KDE\n");
+ } elsif ($o->{compssUsersChoice}{Gnome} && -x "$o->{prefix}/usr/bin/gdm") {
+ log::l("setting desktop to GNOME");
+ output($f, "GNOME\n");
+ }
+
+ if ($o->{pcmcia}) {
+ substInFile { s/.*(TaskBarShowAPMStatus).*/$1=1/ } "$o->{prefix}/usr/lib/X11/icewm/preferences";
+ eval { commands::cp("$o->{prefix}/usr/share/applnk/System/kapm.kdelnk",
+ "$o->{prefix}/etc/skel/Desktop/Autostart/kapm.kdelnk") };
+ }
+
+ my $msec = "$o->{prefix}/etc/security/msec";
+ substInFile { s/^xgrp\n//; $_ .= "xgrp\n" if eof } "$msec/group.conf" if -d $msec;
+ substInFile { s/^audio\n//; $_ .= "audio\n" if eof } "$msec/group.conf" if -d $msec;
+ substInFile { s/^cdrom\n//; $_ .= "cdrom\n" if eof } "$msec/group.conf" if -d $msec;
+ substInFile { s/^cdwriter\n//; $_ .= "cdwriter\n" if eof } "$msec/group.conf" if -d $msec;
+
+ my $pkg = pkgs::packageByName($o->{packages}, 'urpmi');
+ if ($pkg && pkgs::packageSelectedOrInstalled($pkg)) {
+ install_any::install_urpmi($o->{prefix},
+ $::oem ? 'cdrom' : $o->{method}, #- HACK
+ $o->{packages}[2]);
+ }
+ if (my $charset = lang::charset($o->{lang}, $o->{prefix})) {
+ eval { update_userkderc("$o->{prefix}/usr/share/config/kdeglobals", 'Locale', Charset => $charset) };
+ }
+
+# #- update language and icons for KDE.
+# update_userkderc($_, 'Locale', Language => "") foreach list_skels($o->{prefix}, '.kderc');
+# log::l("updating kde icons according to available devices");
+# install_any::kdeicons_postinstall($o->{prefix});
+
+ my $welcome = _("Welcome to %s", "HOSTNAME");
+ substInFile { s/^(GreetString)=.*/$1=$welcome/ } "$o->{prefix}/usr/share/config/kdmrc";
+ substInFile { s/^(UserView)=true/$1=false/ } "$o->{prefix}/usr/share/config/kdmrc" if $o->{security} >= 3;
+ run_program::rooted($o->{prefix}, "kdeDesktopCleanup");
+
+ #- konsole and gnome-terminal are lamers in exotic languages, link them to something better
+ if ($o->{lang} =~ /ja|ko|zh/) {
+ foreach ("konsole", "gnome-terminal") {
+ my $f = "$o->{prefix}/usr/bin/$_";
+ symlinkf("X11/rxvt.sh", $f) if -e $f;
+ }
+ }
+
+#- my $hasttf;
+#- my $dest = "/usr/X11R6/lib/X11/fonts/drakfont";
+#- foreach my $d (map { $_->{mntpoint} } grep { isFat($_) } @{$o->{fstab}}) {
+#- foreach my $D (map { "$d/$_" } grep { m|^win|i } all("$o->{prefix}$d")) {
+#- $D .= "/fonts";
+#- -d "$o->{prefix}$D" or next;
+#- log::l("found win font dir $D");
+#- if (!$hasttf) {
+#- $hasttf = $o->ask_okcancel('',
+#-_("Some true type fonts from windows have been found on your computer.
+#-Do you want to use them? Be sure you have the right to use them under Linux."), 1) or goto nottf;
+#- mkdir "$o->{prefix}$dest", 0755;
+#- }
+#- /(.*)\.ttf/i and symlink "$D/$_", "$o->{prefix}$dest/$1.ttf" foreach grep { /\.ttf/i } all("$o->{prefix}$D");
+#- }
+#- }
+#- nottf:
+#- if ($hasttf) {
+#- run_program::rooted($o->{prefix}, "ttmkfdir", "-d", $dest, "-o", "$dest/fonts.dir");
+#- run_program::rooted($o->{prefix}, "chkfontpath", "--add", $dest);
+#- }
+
+ foreach (list_skels($o->{prefix}, '.kde/share/config/kfmrc')) {
+ my $found;
+ substInFile {
+ $found ||= /KFM Misc Defaults/;
+ $_ .=
+"[KFM Misc Defaults]
+GridWidth=85
+GridHeight=70
+" if eof && !$found;
+ } $_
+ }
+
+ #- move some file after an upgrade that may be seriously annoying.
+ #- and rename saved files to .mdkgiorig.
+ if ($o->{isUpgrade}) {
+ log::l("moving previous desktop files that have been updated to Trash of each user");
+ install_any::kdemove_desktop_file($o->{prefix});
+
+ foreach (@filesToSaveForUpgrade) {
+ if (-e "$o->{prefix}$_.mdkgisave") {
+ unlink "$o->{prefix}$_.mdkgiorig"; rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_.mdkgiorig";
+ }
+ }
+ }
}
-sub addUser($$) {
- my ($I, $prefix) = @_;
+#------------------------------------------------------------------------------
+sub selectMouse($) {
+ my ($o) = @_;
+}
- my $new_uid;
- #my @uids = map { (split)[2] } cat__("$prefix/etc/passwd");
- #for ($new_uid = 500; member($new_uid, @uids); $new_uid++) {}
- for ($new_uid = 500; getpwuid($new_uid); $new_uid++) {}
+#------------------------------------------------------------------------------
+sub configureNetwork {
+ my ($o) = @_;
+ require network;
+ network::configureNetwork2($o->{prefix}, $o->{netc}, $o->{intf}, sub { $o->pkg_install(@_) });
+}
- my $new_gid;
- #my @gids = map { (split)[2] } cat__("$prefix/etc/group");
- #for ($new_gid = 500; member($new_gid, @gids); $new_gid++) {}
- for ($new_gid = 500; getgrgid($new_gid); $new_gid++) {}
+#------------------------------------------------------------------------------
+sub installCrypto {
+ my ($o) = @_;
+ my $u = $o->{crypto} or return; $u->{mirror} && $u->{packages} or return;
- my $homedir = "$prefix/home/$default->{user}->{name}";
+ upNetwork($o);
+ require crypto;
+ my @crypto_packages = crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror});
+ $o->pkg_install(@{$u->{packages}});
+}
- my $pw = crypt_($default->{user}->{password});
+#------------------------------------------------------------------------------
+sub configureTimezone {
+ my ($o, $f) = @_;
+ require timezone;
+ timezone::write($o->{prefix}, $o->{timezone}, $f);
+}
- unless ($testing) {
- {
- local *F;
- open F, ">> $prefix/etc/passwd" or die "can't append to passwd file: $!";
- print F "$default->{user}->{name}:$pw:$new_uid:$new_gid:$default->{user}->{realname}:/home/$default->{user}->{name}:$default->{user}->{shell}\n";
-
- open F, ">> $prefix/etc/group" or die "can't append to group file: $!";
- print F "$default->{user}->{name}::$new_gid:\n";
+#------------------------------------------------------------------------------
+sub configureServices {
+ my ($o) = @_;
+ require services;
+ services::doit($o, $o->{services}, $o->{prefix}) if $o->{services};
+}
+#------------------------------------------------------------------------------
+sub configurePrinter {
+ my($o) = @_;
+ my ($use_cups, $use_lpr) = (0, 0);
+ foreach (values %{$o->{printer}{configured} || {}}) {
+ for ($_->{mode}) {
+ /CUPS/ and $use_cups++;
+ /lpr/ and $use_lpr++;
+ }
+ }
+ #- if at least one queue is configured, configure it.
+ if ($use_cups || $use_lpr) {
+ $o->pkg_install(($use_cups ? ('cups-drivers') : ()), ($use_lpr ? ('rhs-printfilters') : ()));
+
+ require printer;
+ eval { add2hash($o->{printer}, printer::getinfo($o->{prefix})) }; #- get existing configuration.
+ $use_cups and printer::poll_ppd_base();
+ $use_lpr and printer::read_printer_db();
+ foreach (keys %{$o->{printer}{configured} || {}}) {
+ log::l("configuring printer queue $_->{queue} for $_->{mode}");
+ printer::copy_printer_params($_, $o->{printer});
+ #- setup all configured queues, which is not the case interactively where
+ #- only the working queue is setup on configuration.
+ printer::configure_queue($o->{printer});
}
- eval { commands::cp("-f", "$prefix/etc/skel", $homedir) }; $@ and log::l("copying of skel failed: $@"), mkdir($homedir, 0750);
- commands::chown_("-r", "$new_uid.$new_gid", $homedir);
}
}
-sub setRootPassword($$) {
- my ($I, $prefix) = @_;
+#------------------------------------------------------------------------------
+my @etc_pass_fields = qw(name pw uid gid realname home shell);
+sub setRootPassword($) {
+ my ($o) = @_;
+ my $p = $o->{prefix};
+ my $u = $o->{superuser} ||= {};
- my $pw = $default->{rootPassword};
- $pw = crypt_($pw);
+ $u->{pw} ||= $u->{password} && any::crypt($u->{password}, $o->{authentication}{md5});
+
+ my @lines = cat_(my $f = "$p/etc/passwd") or log::l("missing passwd file"), return;
- my @lines = cat_("$prefix/etc/passwd", 'die');
local *F;
- open F, "> $prefix/etc/passwd" or die "can't write in passwd: $!\n";
+ open F, "> $f" or die "failed to write file $f: $!\n";
foreach (@lines) {
- s/^root:.*?:/root:$pw:/;
+ if (/^root:/) {
+ chomp;
+ my %l; @l{@etc_pass_fields} = split ':';
+ add2hash($u, \%l);
+ $_ = join(':', @$u{@etc_pass_fields}) . "\n";
+ }
print F $_;
}
}
+#------------------------------------------------------------------------------
+
+sub addUser($) {
+ my ($o) = @_;
+ my $p = $o->{prefix};
+
+ my (%uids, %gids);
+ foreach (glob_("$p/home")) { my ($u, $g) = (stat($_))[4,5]; $uids{$u} = 1; $gids{$g} = 1; }
+
+ my %done;
+ my @l = grep {
+ if (!$_->{name} || getpwnam($_->{name}) || $done{$_->{name}}) {
+ 0;
+ } else {
+ $_->{home} ||= "/home/$_->{name}";
+
+ my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]);
+ my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]);
+ #- search for available uid above 501 else initscripts may fail to change language for KDE.
+ if (!$u || getpwuid($u)) { for ($u = 501; getpwuid($u) || $uids{$u}; $u++) {} }
+ if (!$g || getgrgid($g)) { for ($g = 501; getgrgid($g) || $gids{$g}; $g++) {} }
+
+ $_->{uid} = $u; $uids{$u} = 1;
+ $_->{gid} = $g; $gids{$g} = 1;
+ $_->{pw} ||= $_->{password} && any::crypt($_->{password}, $o->{authentication}{md5});
+ $_->{shell} ||= "/bin/bash";
+ $done{$_->{name}} = 1;
+ }
+ } @{$o->{users} || []};
+ my @passwd = cat_("$p/etc/passwd");;
+
+ local *F;
+ open F, ">> $p/etc/passwd" or die "can't append to passwd file: $!";
+ print F join(':', @$_{@etc_pass_fields}), "\n" foreach @l;
+
+ open F, ">> $p/etc/group" or die "can't append to group file: $!";
+ print F "$_->{name}:x:$_->{gid}:\n" foreach @l;
+
+ foreach my $u (@l) {
+ if (! -d "$p$u->{home}") {
+ my $mode = $o->{security} < 2 ? 0755 : 0750;
+ eval { commands::cp("-f", "$p/etc/skel", "$p$u->{home}") };
+ if ($@) {
+ log::l("copying of skel failed: $@"); mkdir("$p$u->{home}", $mode);
+ } else {
+ chmod $mode, "$p$u->{home}";
+ }
+ }
+ require commands;
+ eval { commands::chown_("-r", "$u->{uid}.$u->{gid}", "$p$u->{home}") }
+ if $u->{uid} != $u->{oldu} || $u->{gid} != $u->{oldg};
+ }
+ require any;
+ any::addUsers($o->{prefix}, @l);
+}
+
+#------------------------------------------------------------------------------
+sub createBootdisk($) {
+ my ($o) = @_;
+ my $dev = $o->{mkbootdisk} or return;
+
+ my @l = detect_devices::floppies();
+
+ $dev = shift @l || die _("No floppy drive available")
+ if $dev eq "1"; #- special case meaning autochoose
+
+ return if $::testing;
+
+ require bootloader;
+ bootloader::mkbootdisk($o->{prefix}, install_any::kernelVersion($o), $dev, $o->{bootloader}{perImageAppend});
+ $o->{mkbootdisk} = $dev;
+}
+
+#------------------------------------------------------------------------------
+sub readBootloaderConfigBeforeInstall {
+ my ($o) = @_;
+ my ($image, $v);
+
+ require bootloader;
+ add2hash($o->{bootloader} ||= {}, bootloader::read($o->{prefix}, arch() =~ /sparc/ ? "/etc/silo.conf" : "/etc/lilo.conf"));
+
+ #- since kernel or kernel-smp may not be upgraded, it should be checked
+ #- if there is a need to update existing lilo.conf entries by following
+ #- symlinks before kernel or other packages get installed.
+ #- update everything that could be a filename (for following symlink).
+ foreach my $e (@{$o->{bootloader}{entries}}) {
+ while (my $v = readlink "$o->{prefix}/$e->{kernel_or_dev}") {
+ $v = "/boot/$v" if $v !~ m|^/|; -e "$o->{prefix}$v" or last;
+ log::l("renaming /boot/$e->{kernel_or_dev} entry by $v");
+ $e->{kernel_or_dev} = $v;
+ }
+ while (my $v = readlink "$o->{prefix}/$e->{initrd}") {
+ $v = "/boot/$v" if $v !~ m|^/|; -e "$o->{prefix}$v" or last;
+ log::l("renaming /boot/$e->{initrd} entry by $v");
+ $e->{initrd} = $v;
+ }
+ }
+}
+
+sub setupBootloaderBefore {
+ my ($o) = @_;
+ if (arch() =~ /alpha/) {
+ if (my $dev = fsedit::get_root($o->{fstab})) {
+ $o->{bootloader}{boot} ||= "/dev/$dev->{rootDevice}";
+ $o->{bootloader}{root} ||= "/dev/$dev->{device}";
+ $o->{bootloader}{part_nb} ||= first($dev->{device} =~ /(\d+)/);
+ }
+ } else {
+ require bootloader;
+ #- propose the default fb mode for kernel fb, if aurora is installed too.
+ bootloader::suggest($o->{prefix}, $o->{bootloader}, $o->{hds}, $o->{fstab}, install_any::kernelVersion($o),
+ pkgs::packageFlagInstalled(pkgs::packageByName($o->{packages}, 'Aurora') || {}) && ($o->{vga} || 785));
+ if ($o->{miscellaneous}{profiles}) {
+ my $e = bootloader::get_label("linux", $o->{bootloader});
+ push @{$o->{bootloader}{entries}}, { %$e, label => "office", append => "$e->{append} prof=Office" };
+ $e->{append} .= " prof=Home";
+ }
+ bootloader::suggest_floppy($o->{bootloader}) if $o->{security} <= 3;
+ $o->{bootloader}{keytable} ||= keyboard::keyboard2kmap($o->{keyboard});
+ }
+}
+
+sub setupBootloader($) {
+ my ($o) = @_;
+ return if $::g_auto_install;
+
+ if (arch() =~ /alpha/) {
+ return if $::testing;
+ my $b = $o->{bootloader};
+ $b->{boot} or $o->ask_warn('', "Can't install aboot, not a bsd disklabel"), return;
+
+ run_program::rooted($o->{prefix}, "swriteboot", $b->{boot}, "/boot/bootlx") or do {
+ cdie "swriteboot failed";
+ run_program::rooted($o->{prefix}, "swriteboot", "-f1", $b->{boot}, "/boot/bootlx");
+ };
+ run_program::rooted($o->{prefix}, "abootconf", $b->{boot}, $b->{part_nb});
+
+ modules::load('loop');
+ output "$o->{prefix}/etc/aboot.conf",
+ map_index { -e "$o->{prefix}/boot/initrd-$_->[1]" ?
+ "$::i:$b->{part_nb}$_->[0] root=$b->{root} initrd=/boot/initrd-$_->[1] $b->{perImageAppend}\n" :
+ "$::i:$b->{part_nb}$_->[0] root=$b->{root} $b->{perImageAppend}\n" }
+ map { run_program::rooted($o->{prefix}, "mkinitrd", "-f", "/boot/initrd-$_->[1]", "--ifneeded", $_->[1]) ;#or
+ #unlink "$o->{prefix}/boot/initrd-$_->[1]";$_ } grep { $_->[0] && $_->[1] }
+ $_ } grep { $_->[0] && $_->[1] }
+ map { [ m|$o->{prefix}(/boot/vmlinux-(.*))| ] } glob_("$o->{prefix}/boot/vmlinux-*");
+# output "$o->{prefix}/etc/aboot.conf",
+# map_index { "$::i:$b->{part_nb}$_ root=$b->{root} $b->{perImageAppend}\n" }
+# map { /$o->{prefix}(.*)/ } eval { glob_("$o->{prefix}/boot/vmlinux*") };
+ } else {
+ require bootloader;
+ bootloader::install($o->{prefix}, $o->{bootloader}, $o->{fstab}, $o->{hds});
+ }
+}
+
+#------------------------------------------------------------------------------
+sub configureXBefore {
+ my ($o) = @_;
+ my $xkb = $o->{X}{keyboard}{xkb_keymap} || keyboard::keyboard2xkb($o->{keyboard});
+ if (!-e "$o->{prefix}/usr/X11R6/lib/X11/xkb/symbols/$xkb" && (my $f = keyboard::xmodmap_file($o->{keyboard}))) {
+ require commands;
+ commands::cp("-f", $f, "$o->{prefix}/etc/X11/xinit/Xmodmap");
+ $xkb = '';
+ }
+ $o->{X}{keyboard}{xkb_keymap} = $xkb;
+ $o->{X}{mouse} = $o->{mouse};
+ $o->{X}{wacom} = $o->{wacom};
+
+ require Xconfig;
+ Xconfig::getinfoFromDDC($o->{X});
+
+ #- keep this here if the package has to be updated.
+ $o->pkg_install("XFree86");
+}
+sub configureX {
+ my ($o) = @_;
+ $o->configureXBefore;
+
+ require Xconfigurator;
+ require class_discard;
+ { local $::testing = 0; #- unset testing
+ local $::auto = 1;
+ $o->{X}{skiptest} = 1;
+ Xconfigurator::main($o->{prefix}, $o->{X}, class_discard->new, $o->{allowFB}, bool($o->{pcmcia}), sub {
+ my ($server, @l) = @_;
+ $o->pkg_install("XFree86-$server", @l);
+ });
+ }
+ $o->configureXAfter;
+}
+sub configureXAfter {
+ my ($o) = @_;
+ if ($o->{X}{card}{server} eq 'FBDev') {
+ unless (install_any::setupFB($o, Xconfigurator::getVGAMode($o->{X}))) {
+ log::l("disabling automatic start-up of X11 if any as setup framebuffer failed");
+ Xconfigurator::rewriteInittab(3) unless $::testing; #- disable automatic start-up of X11 on error.
+ }
+ }
+ if ($o->{X}{default_depth} >= 16 && $o->{X}{card}{default_wres} >= 1024) {
+ log::l("setting large icon style for kde");
+ install_any::kderc_largedisplay($o->{prefix});
+ }
+}
+
+#------------------------------------------------------------------------------
+sub miscellaneousBefore {
+ my ($o) = @_;
+
+ my %s = getVarsFromSh("$o->{prefix}/etc/sysconfig/system");
+ $o->{miscellaneous}{HDPARM} ||= $s{HDPARM} if exists $s{HDPARM};
+ $o->{miscellaneous}{CLEAN_TMP} ||= $s{CLEAN_TMP} if exists $s{CLEAN_TMP};
+ $o->{security} ||= $s{SECURITY} if exists $s{SECURITY};
+
+ $ENV{SECURE_LEVEL} = $o->{security};
+ add2hash_ $o, { useSupermount => $o->{security} < 4 && arch() !~ /sparc/ && $o->{installClass} !~ /corporate|server/ };
+
+ cat_("/proc/cmdline") =~ /.mem=(\S+)/; #- if /^mem/, it means that's the value grub gave
+ add2hash_($o->{miscellaneous} ||= {}, { numlock => !$o->{pcmcia}, $1 ? (memsize => $1) : () });
+}
+sub miscellaneous {
+ my ($o) = @_;
+
+ local $_ = $o->{bootloader}{perImageAppend};
+
+ $o->{miscellaneous}{memsize} ||= availableRamMB() . 'M' if $o->{lnx4win};
+ if (my $ramsize = $o->{miscellaneous}{memsize} and !/mem=/) {
+ $_ .= " mem=$ramsize";
+ }
+ if (my @l = detect_devices::IDEburners() and !/ide-scsi/) {
+ $_ .= " " . join(" ", (map { "$_->{device}=ide-scsi" } @l),
+ #- in that case, also add ide-floppy otherwise ide-scsi will be used!
+ map { "$_->{device}=ide-floppy" } detect_devices::ide_zips());
+ }
+ if ($o->{miscellaneous}{HDPARM}) {
+ $_ .= join('', map { " $_=autotune" } grep { /ide.*/ } all("/proc/ide")) if !/ide.=autotune/;
+ }
+ if (my $m = detect_devices::hasUltra66()) {
+ #$_ .= " $m" if !/ide.=0x/; #- add it back to support Ultra66 on ide modules.
+ }
+
+ #- keep some given parameters
+ #-TODO
+
+ log::l("perImageAppend: $_");
+ $o->{bootloader}{perImageAppend} = $_;
+}
+
+#------------------------------------------------------------------------------
+sub generateAutoInstFloppy($) {
+ my ($o) = @_;
+}
+
+#------------------------------------------------------------------------------
+sub exitInstall {
+ my ($o) = @_;
+ install_any::unlockCdrom;
+ install_any::log_sizes($o);
+}
+
+#------------------------------------------------------------------------------
+sub hasNetwork {
+ my ($o) = @_;
+
+ $o->{intf} && $o->{netc}{NETWORKING} ne 'no' || $o->{netcnx}{modem};
+}
+
+#------------------------------------------------------------------------------
+sub upNetwork {
+ my ($o, $pppAvoided) = @_;
-sub setupXfree {
-# my ($method, $prefix, $psp) = @_;
-# int fd, i;
-# char buf[200], * chptr;
-# char server[50];
-# int rc;
-# char * path;
-# char * procPath;
-# rpmdb db;
-# rpmTransactionSet trans;
-# struct callbackInfo cbi;
-# rpmProblemSet probs;
-#
-# if (rpmdbOpen(prefix, &db, O_RDWR | O_CREAT, 0644)) {
-# errorWindow(_("Fatal error reopening RPM database"));
-# return INST_ERROR;
-# }
-# log::l("reopened rpm database");
-#
-# path = alloca(strlen(prefix) + 200);
-# procPath = alloca(strlen(prefix) + 50);
-# sprintf(path, "%s/usr/X11R6/bin/Xconfigurator", prefix);
-#
-# # This is a cheap trick to see if our X component was installed
-# if (access(path, X_OK)) {
-# log::l("%s cannot be run", path);
-# return INST_OKAY;
-# }
-#
-# # need proc to do pci probing
-# sprintf(procPath, "%s/proc", prefix);
-# umount(procPath);
-# if ((rc = doMount("/proc", procPath, "proc", 0, 0))) {
-# return INST_ERROR;
-# }
-#
-# # this handles kickstart and normal/expert modes
-# if ((rc=xfree86Config(prefix, "--pick")))
-# return INST_ERROR;
-#
-# sprintf(path, "%s/tmp/SERVER", prefix);
-# if ((fd = open(path, O_RDONLY)) < 0) {
-# log::l("failed to open %s: %s", path, strerror(errno));
-# return INST_ERROR;
-# }
-#
-# buf[0] = '\0';
-# read(fd, buf, sizeof(buf));
-# close(fd);
-# chptr = buf;
-# while (chptr < (buf + sizeof(buf) - 1) && *chptr && *chptr != ' ')
-# chptr++;
-#
-# if (chptr >= (buf + sizeof(buf) - 1) || *chptr != ' ') {
-# log::l("couldn't find ' ' in %s", path);
-# return INST_ERROR;
-# }
-#
-# *chptr = '\0';
-# strcpy(server, "XFree86-");
-# strcat(server, buf);
-#
-# log::l("I will install the %s package", server);
-#
-# for (i = 0; i < psp->numPackages; i++) {
-# if (!strcmp(psp->packages[i]->name, server)) {
-# log::l("\tfound package: %s", psp->packages[i]->name);
-# swOpen(1, psp->packages[i]->size);
-# trans = rpmtransCreateSet(db, prefix);
-# rpmtransAddPackage(trans, psp->packages[i]->h, NULL,
-# psp->packages[i], 0, NULL);
-#
-# cbi.method = method;
-# cbi.upgrade = 0;
-#
-# rpmRunTransactions(trans, swCallback, &cbi, NULL, &probs, 0,
-# 0xffffffff);
-#
-# swClose();
-# break;
-# }
-# }
-#
-# # this handles kickstart and normal/expert modes
-# if ((rc=xfree86Config(prefix, "--continue")))
-# return INST_ERROR;
-#
-# # done with proc now
-# umount(procPath);
-#
-# rpmdbClose(db);
-#
-# log::l("rpm database closed");
-#
-# return INST_OKAY;
+ foreach (qw(resolv.conf protocols services)) {
+ symlinkf("$o->{prefix}/etc/$_", "/etc/$_");
+ }
+
+ modules::write_conf($o->{prefix});
+ if ($o->{intf} && $o->{netc}{NETWORKING} ne 'no') {
+ network::up_it($o->{prefix}, $o->{intf});
+ } elsif (!$pppAvoided && $o->{netcnx}{modem} && !$o->{netcnx}{modem}{isUp}) {
+ eval { modules::load_multi(qw(serial ppp bsd_comp ppp_deflate)) };
+ run_program::rooted($o->{prefix}, "/etc/rc.d/init.d/syslog", "start");
+ run_program::rooted($o->{prefix}, "ifup", "ppp0");
+ $o->{netcnx}{modem}{isUp} = 1;
+ } else {
+ $::testing or return;
+ }
+ 1;
+}
+
+#------------------------------------------------------------------------------
+sub downNetwork {
+ my ($o, $pppOnly) = @_;
+
+ modules::write_conf($o->{prefix});
+ if (!$pppOnly && $o->{intf} && $o->{netc}{NETWORKING} ne 'no') {
+ network::down_it($o->{prefix}, $o->{intf});
+ } elsif ($o->{netcnx}{modem} && $o->{netcnx}{modem}{isUp}) {
+ run_program::rooted($o->{prefix}, "ifdown", "ppp0");
+ run_program::rooted($o->{prefix}, "/etc/rc.d/init.d/syslog", "stop");
+ eval { modules::unload($_) foreach qw(ppp_deflate bsd_comp ppp serial) };
+ $o->{netcnx}{modem}{isUp} = 0;
+ } else {
+ $::testing or return;
+ }
+ 1;
}
+#------------------------------------------------------------------------------
+sub cleanIfFailedUpgrade($) {
+ my ($o) = @_;
+
+ #- if an upgrade has failed, there should be .mdkgisave files around.
+ if ($o->{isUpgrade}) {
+ foreach (@filesToSaveForUpgrade) {
+ if (-e "$o->{prefix}/$_" && -e "$o->{prefix}/$_.mdkgisave") {
+ rename "$o->{prefix}/$_", "$o->{prefix}/$_.mdkginew"; #- keep new files around in case !
+ rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_";
+ }
+ }
+ }
+}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm
index 254f092ff..2005d4fe2 100644
--- a/perl-install/install_steps_auto_install.pm
+++ b/perl-install/install_steps_auto_install.pm
@@ -1,34 +1,91 @@
-package install_steps_auto_install;
+package install_steps_auto_install; # $Id$
use diagnostics;
use strict;
+use lang;
use vars qw(@ISA);
@ISA = qw(install_steps);
+use modules;
+
+
#-######################################################################################
#- misc imports
#-######################################################################################
-use common qw(:common);
+use common qw(:common :functional);
use install_steps;
use log;
+my $graphical = 0;
+
+sub new {
+ my ($type, $o) = @_;
+
+ if ($graphical) {
+ require install_steps_gtk;
+ undef *enteringStep; *enteringStep = \&install_steps_gtk::enteringStep;
+ undef *installPackages; *installPackages = \&install_steps_gtk::installPackages;
+ goto &install_steps_gtk::new;
+ } else {
+ (bless {}, ref $type || $type)->SUPER::new($o);
+ }
+}
+
+sub configureNetwork {
+ my ($o) = @_;
+ modules::load_thiskind('net');
+ goto &install_steps::configureNetwork;
+}
+
sub enteringStep($$$) {
my ($o, $step) = @_;
- print _("Entering step `%s'\n", $o->{steps}{$step}{text});
+ print _("Entering step `%s'\n", translate($o->{steps}{$step}{text}));
$o->SUPER::enteringStep($step);
}
sub ask_warn {
log::l(ref $_[1] ? join " ", @{$_[1]} : $_[1]);
}
+sub wait_message {}
-sub errorInStep {
+sub errorInStep {
print "error :(\n";
print "switch to console f2 for a shell\n";
- print "press to return to reboot\n";
+ print "Press <Enter> to reboot\n";
<STDIN>;
- exec "true";
+ c::_exit(0);
+}
+
+
+#-######################################################################################
+#- Steps Functions
+#-######################################################################################
+sub selectLanguage {
+ my ($o) = @_;
+ $o->SUPER::selectLanguage;
+ lang::load_console_font($o->{lang});
+}
+
+sub installPackages {
+ my ($o, $packages) = @_;
+ catch_cdie { $o->install_steps::installPackages($packages) } sub { print "$@\n"; 1 }
+}
+
+sub exitInstall {
+ my ($o, $alldone) = @_;
+ return if $o->{autoExitInstall};
+
+ if ($graphical) {
+ my $O = bless $o, "install_steps_gtk";
+ $O->exitInstall($alldone);
+ } else {
+ install_steps::exitInstall($o);
+ print "\a";
+ print "Auto installation complete (the postInstall is done yet though)\n";
+ print "Press <Enter> to reboot\n";
+ <STDIN>;
+ }
}
1;
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 150ff183f..a3ca086a4 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -1,4 +1,4 @@
-package install_steps_gtk;
+package install_steps_gtk; # $Id$
use diagnostics;
use strict;
@@ -9,162 +9,18 @@ use vars qw(@ISA);
#-######################################################################################
#- misc imports
#-######################################################################################
+use install_steps_interactive;
+use interactive_gtk;
use common qw(:common :file :functional :system);
-use partition_table qw(:types);
use my_gtk qw(:helpers :wrappers);
use Gtk;
-use Gtk::XmHTML;
use devices;
-use fsedit;
-use keyboard;
-use network;
use modules;
-use printer;
-use install_steps;
-use run_program;
-use install_steps_interactive;
-use Xconfigurator;
-use Xconfig;
-use interactive_gtk;
+use install_gtk;
use install_any;
-use diskdrake;
-use pkgs;
-use log;
+use mouse;
use help;
-use lang;
-
-#-#####################################################################################
-#-INTERN CONSTANT
-#-#####################################################################################
-my $w_help;
-my $itemsNB = 1;
-my (@background1, @background2);
-my ($width, $height) = (640, 480);
-my ($stepswidth, $stepsheight) = (140, $height);
-my ($logowidth, $logoheight) = ($width - $stepswidth, 40);
-my ($helpwidth, $helpheight) = ($width - $stepswidth, 100);
-my ($windowwidth, $windowheight) = ($width - $stepswidth, $height - $helpheight - $logoheight);
-
-my @themes_vga16 = qw(blue blackwhite savane);
-my @themes = qw(DarkMarble marble3d blueHeart);
-
-my @circle_head = (
- "19 17 4 1"
-);
-
-my @circle_body = (
-" c None",
-"+ c #FFFFFF",
-" ===== ",
-" ========= ",
-" =+++======= ",
-" =++========== ",
-" ==+============ ",
-" +++============ ",
-" ================o",
-" ================o",
-" ================o",
-" ===============oo",
-" ===============oo",
-" =============oo ",
-" ============ooo ",
-" o=========ooo ",
-" oo=====oooo ",
-" ooooooooo ",
-" ooooo ",
-);
-
-#-my @questionmark_head = (
-#-"39 97 6 1",
-#-" c None",
-#-". c #000000",
-#-"+ c #FFFFFF",
-#-"o c #AAAAAA",
-#-);
-#-my @questionmark_body = (
-#-("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO") x 10,
-#-"OOOOOOOOOOOOO.......OOOOOOOOOOOOOOOOOOO",
-#-"OOOOOOOOOOOO..OOOOOOO.OOOOOOOOOOOOOOOOO",
-#-"OOOOOOOOOO..OOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOOOOOOO..OOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOOOOO..OOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOOOOO..OOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOOOO..OOOOOOOOOOOOOOOOOOXOOOOOOOOOOO",
-#-"OOOOOOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOOO.OOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOO",
-#-"OOOOO..OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOOO.OOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOO",
-#-"OOOO..OOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOO",
-#-"OOOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOOO.OOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOO",
-#-"OOO..OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-#-"OOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO",
-#-"OO..OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO",
-#-"OOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO",
-#-"OO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"OO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"O..OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"OO.OOOOOOOOOOOoo+++++ooOOOOOOOOOOXOOOOO",
-#-"O.OOOOOOOOOOo+++o+++++++oOOOOOOOOOXOOOO",
-#-"O.OOOOOOOOO+++OOOOo+++++++OOOOOOOOXOOOO",
-#-"O.OOOOOOOOo++oOOOOOo++++++oOOOOOOOXOOOO",
-#-"O.OOOOOOOo+++oOOOOOO+++++++OOOOOOOXOOOO",
-#-"..OOOOOOOo++++OOOOOOo++++++oOOOOOOXOOOO",
-#-"O.OOOOOOO+++++oOOOOOo+++++++OOOOOOXOOOO",
-#-".OOOOOOOO++++++OOOOOo+++++++OOOOOOOXOOO",
-#-".OOOOOOOO++++++OOOOOo+++++++OOOOOOXOOOO",
-#-".OOOOOOOOo++++oOOOOOo++++++oOOOOOOOXOOO",
-#-".OOOOOOOOOo++oOOOOOOo++++++oOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOOO+++++++OOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOOO++++++OOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOOo+++++oOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOO+++++OOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOo+++oOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOO+++oOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOo++OOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOO++OOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOO+oOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOO+OOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOO+OOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOO",
-#-"O.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOO",
-#-"OOOOOOOOOOOOOOOOoooOOOOOOOOOOOOOOOOXOOO",
-#-".OOOOOOOOOOOOOO+++++OOOOOOOOOOOOOOXOOOO",
-#-"O.OOOOOOOOOOOO++++++oOOOOOOOOOOOOOXXOOO",
-#-"O.OOOOOOOOOOOo+++++++OOOOOOOOOOOOOXOOOO",
-#-"O.OOOOOOOOOOOo+++++++OOOOOOOOOOOOOXOOOO",
-#-"O.OOOOOOOOOOOo+++++++OOOOOOOOOOOOOXOOOO",
-#-"OOOOOOOOOOOOOO++++++oOOOOOOOOOOOOOXOOOO",
-#-"O.OOOOOOOOOOOOO+++++OOOOOOOOOOOOOXXOOOO",
-#-"OO.OOOOOOOOOOOOOoooOOOOOOOOOOOOOOOXOOOO",
-#-"OO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"OO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOO",
-#-"OOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO",
-#-"OOO.OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO",
-#-"OOOO.OOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOO",
-#-"OOOOO.OOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOO",
-#-"OOOOOO.OOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOXXXOOOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOO",
-#-"OOOOOOOOOOOOXOOOOOOOOOOXXXOOOOOOOOOOOOO",
-#-"OOOOOOOOOOOOOOXOOOOOOXXXOOOOOOOOOOOOOOO",
-#-"OOOOOOOOOOOOOOOXXXXXXXOOOOOOOOOOOOOOOOO",
-#-("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO") x 10);
-
-my @red_circle = (@circle_head, "= c #FF0000", "o c #AA5500", @circle_body);
-my @orange_circle = (@circle_head, "= c #FFAA00", "o c #AA5500", @circle_body);
-my @green_circle = (@circle_head, "= c #00FF00", "o c #00AA00", @circle_body);
+use log;
#-######################################################################################
#- In/Out Steps Functions
@@ -175,51 +31,79 @@ sub new($$) {
my $old = $SIG{__DIE__};
$SIG{__DIE__} = sub { $_[0] !~ /my_gtk\.pm/ and goto $old };
- $ENV{DISPLAY} = $o->{display} || ":0";
+ $ENV{DISPLAY} ||= $o->{display} || ":0";
unless ($::testing) {
$my_gtk::force_focus = $ENV{DISPLAY} eq ":0";
- my $f = "/tmp/Xconf";
- createXconf($f, @{$o->{mouse}}{"XMOUSETYPE", "device"});
+ if ($ENV{DISPLAY} eq ":0" && !$::live) {
+ my $f = "/tmp/Xconf";
+ install_gtk::createXconf($f, @{$o->{mouse}}{"XMOUSETYPE", "device"}, $o->{wacom});
+ devices::make("/dev/kbd");
+
+ local (*T1, *T2);
+ open T1, ">/dev/tty5";
+ open T2, ">/dev/tty6";
- if ($ENV{DISPLAY} eq ":0") {
my $launchX = sub {
my $ok = 1;
- local $SIG{CHLD} = sub { $ok = 0 };
+ local $SIG{CHLD} = sub { $ok = 0 if waitpid(-1, c::WNOHANG()) > 0 };
unless (fork) {
- exec $_[0], "-kb", "-dpms","-s" ,"240", "-allowMouseOpenFail", "-xf86config", $f or exit 1;
+ exec $_[0], (arch() =~ /^sparc/ || arch() eq "ppc" ? () : ("-kb")), "-dpms","-s" ,"240",
+ ($_[0] =~ /Xsun/ || $_[0] =~ /Xpmac/ ? ("-fp", "/usr/X11R6/lib/X11/fonts:unscaled") :
+ ("-allowMouseOpenFail", "-xf86config", $f)) or exit 1;
}
- foreach (1..10) {
+ foreach (1..60) {
sleep 1;
- return 0 if !$ok;
+ log::l("Server died"), return 0 if !$ok;
return 1 if c::Xtest($ENV{DISPLAY});
}
+ log::l("Timeout!!");
0;
};
-
- if (listlength(cat_("/proc/fb"))) {
- &$launchX("XF86_FBDev");
- $o->{allowFB} = 1; #- keep in mind FB is used.
- } else {
+ my @servers = qw(FBDev VGA16); #-)
+ if (arch() eq "alpha") {
+ require Xconfigurator;
+ my $card = Xconfigurator::cardConfigurationAuto();
+ Xconfigurator::updateCardAccordingName($card, $card->{type}) if $card && $card->{type};
+ @servers = $card->{server} || "TGA";
+ #-@servers = qw(SVGA 3DLabs TGA)
+ } elsif (arch() =~ /^sparc/) {
+ local $_ = cat_("/proc/fb");
+ if (/Mach64/) { @servers = qw(Mach64) }
+ elsif (/Permedia2/) { @servers = qw(3DLabs) }
+ else { @servers = qw(Xsun24) }
+ } elsif (arch() eq "ppc") {
+ @servers = qw(Xpmac);
+ }
+
+ foreach (@servers) {
+ log::l("Trying with server $_");
my $dir = "/usr/X11R6/bin";
- unless (-x "$dir/XF86_VGA16") {
- unlink "$dir/XF86_FBDev";
- local *F; open F, ">$dir/XF86_VGA16" or die '';
- local $/ = \ (16 * 1024);
- my $f = install_any::getFile("$dir/XF86_VGA16") or die '';
- syswrite F, $_ foreach <$f>;
- chmod 0755, "$dir/XF86_VGA16";
+ my $prog = /Xsun|Xpmac/ ? $_ : "XF86_$_";
+ unless (-x "$dir/$prog") {
+ unlink $_ foreach glob_("$dir/X*");
+ install_any::getAndSaveFile("Mandrake/mdkinst$dir/$prog", "$dir/$prog") or die "failed to get server $prog: $!";
+ chmod 0755, "$dir/$prog";
+ }
+ if (/FB/) {
+ !$o->{vga16} && $o->{allowFB} or next;
+
+ $o->{allowFB} = &$launchX($prog) #- keep in mind FB is used.
+ and goto OK;
+ } else {
+ $o->{vga16} = 1 if /VGA16/;
+ &$launchX($prog) and goto OK;
}
- &$launchX("XF86_VGA16");
}
+ return undef;
}
}
- @themes = @themes_vga16 if $o->{simple_themes} || !$o->{display} && !($o->{allowFB} ||= $::testing);
+ OK:
+ install_gtk::init_sizes();
+ install_gtk::default_theme($o);
+ install_gtk::create_logo_window($o);
- install_theme($o);
- create_logo_window($o);
-
- $my_gtk::force_center = [ $width - $windowwidth, $logoheight, $windowwidth, $windowheight ];
+ $my_gtk::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ];
(bless {}, ref $type || $type)->SUPER::new($o);
}
@@ -227,9 +111,10 @@ sub new($$) {
sub enteringStep {
my ($o, $step) = @_;
+ printf "Entering step `%s'\n", $o->{steps}{$step}{text};
$o->SUPER::enteringStep($step);
- create_steps_window($o);
- create_help_window($o);
+ install_gtk::create_steps_window($o);
+ install_gtk::create_help_window($o);
}
sub leavingStep {
my ($o, $step) = @_;
@@ -242,244 +127,333 @@ sub leavingStep {
#- Steps Functions
#-######################################################################################
sub selectLanguage {
- my ($o) = @_;
+ my ($o, $first_time) = @_;
$o->SUPER::selectLanguage;
Gtk->set_locale;
- install_theme($o);
+ install_gtk::install_theme($o);
+
+ $o->ask_warn('',
+_("Your system is low on resource. You may have some problem installing
+Linux-Mandrake. If that occurs, you can try a text install instead. For this,
+press `F1' when booting on CDROM, then enter `text'.")) if $first_time && availableRamMB() < 60; # 60MB
+
}
#------------------------------------------------------------------------------
-sub doPartitionDisks($$) {
- my ($o, $hds, $raid) = @_;
+sub selectInstallClass1 {
+ my ($o, $verif, $l, $def, $l2, $def2) = @_;
+ $::live || @$l == 1 and return $o->SUPER::selectInstallClass1($verif, $l, $def, $l2, $def2);
- while (1) {
- diskdrake::main($hds, $raid, interactive_gtk->new, $o->{partitions});
- if (!grep { isSwap($_) } fsedit::get_fstab(@{$o->{hds}})) {
- if ($::beginner) {
- $o->ask_warn('', _("You must have a swap partition"));
- } elsif (!$::expert) {
- $o->ask_okcancel('', _("You don't have a swap partition\n\nContinue anyway?")) and last;
- } else { last }
- } else { last }
- }
+ my $w = my_gtk->new('');
+ my ($radio, $focused);
+ gtkadd($w->{window},
+ gtkpack($o->create_box_with_title(_("Please, choose one of the following classes of installation:")),
+ (my @radios = map { $radio = new Gtk::RadioButton($_, $radio ? $radio : ());
+ $radio->set_active($_ eq $def); $radio } @$l),
+ gtkadd(create_hbox(),
+ map { my $v = $_;
+ my $b = new Gtk::Button(translate($_));
+ $focused = $b if $_ eq $def2;
+ gtksignal_connect($b, "clicked" => sub { $w->{retval} = $v; Gtk->main_quit });
+ } @$l2)
+ ));
+ $focused->grab_focus if $focused;
+ $w->main;
+
+ mapn { $verif->($_[1]) if $_[0]->active } \@radios, $l;
+ install_gtk::create_steps_window($o);
+
+ $w->{retval};
}
#------------------------------------------------------------------------------
-sub choosePackages {
- my ($o, $packages, $compss, $compssUsers, $first_time) = @_;
+sub selectMouse {
+ my ($o, $force) = @_;
+ my %old = %{$o->{mouse}};
+ $o->SUPER::selectMouse($force);
+ my $mouse = $o->{mouse};
+ $mouse->{type} eq 'none' ||
+ $old{type} eq $mouse->{type} &&
+ $old{name} eq $mouse->{name} &&
+ $old{device} eq $mouse->{device} && !$force and return;
+
+ local $my_gtk::grab = 1; #- unsure a crazy mouse don't go wild clicking everywhere
- return if $::beginner;
- chooseSizeToInstall(@_);
- install_steps_interactive::choosePackages(@_);
- choosePackagesTree(@_) if $::expert;
+ while (1) {
+ log::l("telling X server to use another mouse");
+ eval { modules::load('serial') } if $mouse->{device} =~ /ttyS/;
+
+ if (!$::testing) {
+ symlinkf($mouse->{device}, "/dev/mouse");
+ c::setMouseLive($ENV{DISPLAY}, mouse::xmouse2xId($mouse->{XMOUSETYPE}), $mouse->{nbuttons} < 3);
+ }
+ install_gtk::test_mouse($mouse) and return;
+ $o->SUPER::selectMouse(1);
+ $mouse = $o->{mouse};
+ }
}
+
+#------------------------------------------------------------------------------
sub chooseSizeToInstall {
- my ($o, $packages, $compss, $compssUsers, $first_time) = @_;
- my $availableSpace = int(install_any::getAvailableSpace($o) / sqr(1024));
- my $default = pkgs::correctSize((sum map { $_->{size} } grep { $_->{selected} } values %$packages) / sqr(1024) || $availableSpace * 0.7);
+ my ($o, $packages, $min_size, $max_size_, $availableC, $individual) = @_;
+ my $max_size = min($max_size_, $availableC);
+ my $enough = $max_size == $max_size_;
+ my $percentage = int 100 * $max_size / $max_size_;
+
+ #- don't ask anything if the difference between min and max is too small
+ return $max_size if $min_size && $max_size / $min_size < 1.05;
+
+ log::l("choosing size to install between $min_size and $max_size");
my $w = my_gtk->new('');
- my $adj = create_adjustment($default, 100, $availableSpace);
- my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 100, 0);
+ my $adj = create_adjustment($percentage, $min_size * 100 / $max_size_, $percentage);
+ my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 20, 0);
+ my $val;
+ require pkgs;
gtkadd($w->{window},
gtkpack(new Gtk::VBox(0,20),
- create_packtable({ col_spacings => 10 },
- [ _("Choose the size you want to install"), $spin, _("MB"), ],
+ _("The total size for the groups you have selected is approximately %d MB.\n", pkgs::correctSize($max_size_ / sqr(1024))) .
+ ($enough ?
+_("If you wish to install less than this size,
+select the percentage of packages that you want to install.
+
+A low percentage will install only the most important packages;
+a percentage of 100%% will install all selected packages.") :
+_("You have space on your disk for only %d%% of these packages.
+
+If you wish to install less than this,
+select the percentage of packages that you want to install.
+A low percentage will install only the most important packages;
+a percentage of %d%% will install as many packages as possible.", $percentage, $percentage))
+. ($individual ? "\n\n" . _("You will be able to choose them more specifically in the next step.") : ''),
+ create_packtable({},
+ [ _("Percentage of packages to install") . ' ', $spin, "%", my $mb = new Gtk::Label ],
[ undef, new Gtk::HScrollbar($adj) ],
),
create_okcancel($w)
)
);
+ $spin->signal_connect(changed => my $changed = sub {
+ $val = $spin->get_value_as_int / 100 * $max_size_;
+ $mb->set(sprintf("(%dMB)", pkgs::correctSize($val / sqr(1024))));
+ }); &$changed();
$spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit });
$spin->grab_focus();
- $w->main or return;
-
- $_->{selected} = 0 foreach values %$packages;
- pkgs::setSelectedFromCompssList($o->{compssListLevels}, $o->{packages}, pkgs::invCorrectSize($spin->get_value_as_int) * sqr(1024), $o->{installClass}, $o->{lang}, $o->{isUpgrade});
+ $w->main and $val + 1; #- add a single byte (hack?) to make selection of 0 bytes ok.
}
sub choosePackagesTree {
- my ($o, $packages, $compss, $compssUsers) = @_;
- my $availableSpace = int(install_any::getAvailableSpace($o) / sqr(1024));
- my $w = my_gtk->new('');
- add2hash_($o->{packages_}, { show_level => 0 }); #- keep show more or less 80 });
+ my ($o, $packages, $compss) = @_;
- my ($current, $ignore, $showall, $selectall, $w_size, $info_widget, $showall_button, $selectall_button, $go, %items) = 0, 0, 0, 0;
+ $o->set_help('choosePackagesTree');
+ my ($curr, $parent, $info_widget, $w_size, $go, $idle, $flat, $auto_deps);
+ my (%wtree, %ptree);
+
+ my $w = my_gtk->new('');
my $details = new Gtk::VBox(0,0);
- $compss->{tree} = new Gtk::Tree();
- $compss->{tree}->set_selection_mode('multiple');
-
- my $clean; $clean = sub {
- my ($p) = @_;
- foreach (values %{$p->{childs}}) {
- &$clean($_) if $_->{childs};
- delete $_->{itemNB};
- delete $_->{tree};
- delete $_->{packages_item};
- }
- }; &$clean($compss);
-
- my $update = sub {
- my $size = 0;
- $ignore = 1;
- foreach (grep { $_->[0] } values %items) {
- $compss->{tree}->unselect_child($_->[0]);
- $compss->{tree}->select_child($_->[0]) if $_->[1]{selected};
+ my $tree = Gtk::CTree->new(3, 0);
+ $tree->set_selection_mode('browse');
+ $tree->set_column_width(0, 200);
+ $tree->set_column_auto_resize($_, 1) foreach 1..2;
+
+ gtkadd($w->{window},
+ gtkpack_(new Gtk::VBox(0,5),
+ 0, _("Choose the packages you want to install"),
+ 1, gtkpack(new Gtk::HBox(0,0),
+ createScrolledWindow($tree),
+ gtkadd(gtkset_usize(new Gtk::Frame(_("Info")), $::windowwidth - 490, 0),
+ createScrolledWindow($info_widget = new Gtk::Text),
+ )),
+ 0, my $l = new Gtk::HBox(0,15),
+ 0, gtkpack(new Gtk::HBox(0,10),
+ $go = gtksignal_connect(new Gtk::Button(_("Install")), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }),
+ )
+ ));
+ gtkpack__($l, my $toolbar = new Gtk::Toolbar('horizontal', 'icons'));
+ gtkpack__($l, gtksignal_connect(new Gtk::CheckButton(_("Automatic dependencies")), clicked => sub { invbool \$auto_deps }));
+ $l->pack_end($w_size = new Gtk::Label(''), 0, 1, 20);
+
+ $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $::windowwidth, $::windowheight);
+ $go->grab_focus;
+ $w->{rwindow}->show_all;
+
+ my $pix_base = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-base.xpm") ];
+ my $pix_selected = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-selected.xpm") ];
+ my $pix_unselect = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-unselected.xpm") ];
+ my $pix_semisele = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-semiselected.xpm") ];
+ my $pix_installed= [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-installed.xpm") ];
+
+ my $add_parent; $add_parent = sub {
+ $_[0] or return undef;
+ if (my $w = $wtree{$_[0]}) { return $w }
+ my $s; foreach (split '/', $_[0]) {
+ my $s2 = $s ? "$s/$_" : $_;
+ $wtree{$s2} ||= do {
+ my $n = $tree->insert_node($s ? $add_parent->($s) : undef, undef, [$_, '', ''], 5, (undef) x 4, 0, 0);
+ $n;
+ };
+ $s = $s2;
}
- $ignore = 0;
-
- foreach (values %$packages) {
- $size += $_->{size} - ($_->{installedCumulSize} || 0) if $_->{selected}; #- on upgrade, installed packages will be removed.
+ $tree->node_set_pixmap($wtree{$s}, 1, $pix_semisele->[0], $pix_semisele->[1]);
+ $wtree{$s};
+ };
+ my $add_node = sub {
+ my ($leaf, $root) = @_;
+ my $p = $packages->[0]{$leaf} or return;
+ $p->{medium}{selected} or return;
+ my $node = $tree->insert_node($add_parent->($root),
+ undef, [$leaf, '', ''], 5, (undef) x 4, 1, 0);
+ my $pix = pkgs::packageFlagBase($p) ? $pix_base : pkgs::packageFlagSelected($p) ? $pix_selected : pkgs::packageFlagInstalled($p) ? $pix_installed : $pix_unselect;
+ $tree->node_set_pixmap($node, 1, $pix->[0], $pix->[1]);
+ push @{$ptree{$leaf}}, $node;
+ };
+ my $add_nodes = sub {
+ %ptree = %wtree = ();
+
+ $tree->freeze;
+ while (1) { $tree->remove_node($tree->node_nth(0) || last) }
+
+ my ($root, $leaf);
+ if ($flat = $_[0]) {
+ $add_node->($_, undef) foreach sort grep { my $pkg = pkgs::packageByName($packages, $_);
+ $pkg->{medium}{selected} } keys %{$packages->[0]};
+ } else {
+ foreach (sort @$compss) {
+ ($root, $leaf) = m|(.*)/(.+)|o or ($root, $leaf) = ('', $_);
+ my $pkg = pkgs::packageByName($packages, $leaf);
+ $add_node->($leaf, $root) if $pkg->{medium}{selected};
+ }
}
-
- $w_size->set(_("Total size: ") . int (pkgs::correctSize($size / sqr(1024))) . " / $availableSpace " . _("MB") );
+ $tree->thaw;
};
- my $new_item = sub {
- my ($p, $name, $parent) = @_;
- my $w = create_treeitem($name);
- $items{++$itemsNB} = [ $w, $p ];
- $parent->{packages_item}{$itemsNB} = undef if $parent;
- $w->show;
- $w->set_sensitive(!$p->{base} && !$p->{installed});
- $w->signal_connect(focus_in_event => sub {
- my $p = pkgs::getHeader($p);
- gtktext_insert($info_widget,
- _("Version: %s\n", c::headerGetEntry($p, 'version') . '-' . c::headerGetEntry($p, 'release')) .
- _("Size: %d KB\n", c::headerGetEntry($p, 'size') / 1024) .
-
- formatLines(c::headerGetEntry($p, 'description')));
- }) unless $p->{childs};
- $itemsNB;
+ $add_nodes->($flat);
+
+ my %toolbar = my @toolbar =
+ (
+ ftout => [ _("Expand Tree") , sub { $tree->expand_recursive(undef) } ],
+ ftin => [ _("Collapse Tree") , sub { $tree->collapse_recursive(undef) } ],
+ reload=> [ _("Toggle between flat and group sorted"), sub { $add_nodes->(!$flat) } ],
+ );
+ $toolbar->set_button_relief("none");
+ foreach (grep_index { $::i % 2 == 0 } @toolbar) {
+ gtksignal_connect($toolbar->append_item(undef, $toolbar{$_}[0], undef, gtkxpm($tree, "$ENV{SHARE_PATH}/$_.xpm")),
+ clicked => $toolbar{$_}[1]);
+ }
+ $toolbar->set_style("icons");
+
+ my $display_info = sub {
+ my $p = $packages->[0]{$curr} or return gtktext_insert($info_widget, '');
+ pkgs::extractHeaders($o->{prefix}, [$p], $p->{medium});
+ $p->{header} or die;
+
+ my $ind = $o->{compssListLevels}{$o->{installClass}};
+ my $imp = translate($pkgs::compssListDesc{pkgs::packageFlagBase($p) ? 100 : round_down($p->{values}[$ind], 10)});
+
+ gtktext_insert($info_widget, $@ ? _("Bad package") :
+ _("Name: %s\n", pkgs::packageName($p)) .
+ _("Version: %s\n", pkgs::packageVersion($p) . '-' . pkgs::packageRelease($p)) .
+ _("Size: %d KB\n", pkgs::packageSize($p) / 1024) .
+ ($imp && _("Importance: %s\n", $imp)) . "\n" .
+ formatLines(c::headerGetEntry($p->{header}, 'description')));
+ c::headerFree(delete $p->{header});
+ 0;
};
- $compss->{tree}->signal_connect(selection_changed => sub {
- $ignore and return;
-
- my %s; @s{$_[0]->selection} = ();
- my @changed;
- #- needs to find @changed first, _then_ change the selected, otherwise
- #- we won't be able to find the changed
- foreach (values %items) {
- push @changed, $_->[1] if ($_->[1]{selected} xor exists $s{$_->[0]});
+ my $update_size = sub {
+ my $size = pkgs::selectedSize($packages);
+ $w_size->set(_("Total size: %d / %d MB",
+ pkgs::correctSize($size / sqr(1024)),
+ install_any::getAvailableSpace($o) / sqr(1024)));
+ };
+ my $select = sub {
+ my %l;
+ my $isSelection = !pkgs::packageFlagSelected($_[0]);
+ foreach (@_) {
+ pkgs::togglePackageSelection($packages, $_, my $l = {});
+ @l{grep {$l->{$_}} keys %$l} = ();
}
- #- works before @changed is (or must be!) one element
- foreach (@changed) {
- if ($_->{childs}) {
- my $s = invbool \$_->{selected};
- my $f; $f = sub {
- my ($p) = @_;
- $p->{itemNB} or return;
- if ($p->{packages}) {
- foreach (keys %{$p->{packages_item} || {}}) {
- my ($a, $b) = @{$items{$_}};
- $a and pkgs::set($packages, $b, $s);
- }
- } else {
- foreach (values %{$p->{childs}}) {
- $_->{selected} = $s;
- &$f($_);
- }
- }
- }; &$f($_);
-#- } elsif ($_->{base}) {
-#- $o->ask_warn('', _("Sorry, i won't unselect this package. The system needs it"));
-#- } elsif ($_->{installed}) {
-#- $o->ask_warn('', _("Sorry, i won't select this package. A more recent version is already installed"));
- } else {
- pkgs::toggle($packages, $_);
+ if (my @l = keys %l) {
+ #- check for size before trying to select.
+ my $size = pkgs::selectedSize($packages);
+ foreach (@l) {
+ my $p = $packages->[0]{$_};
+ pkgs::packageFlagSelected($p) or $size += pkgs::packageSize($p);
+ }
+ if (pkgs::correctSize($size / sqr(1024)) > install_any::getAvailableSpace($o) / sqr(1024)) {
+ return $o->ask_warn('', _("You can't select this package as there is not enough space left to install it"));
}
- }
- &$update();
- });
-
- my $select_add = sub {
- my ($ind, $level) = @{$o->{packages_}}{"ind", "select_level"};
- $level = max(0, min(100, ($level + $_[0])));
- $o->{packages_}{select_level} = $level;
- pkgs::unselect_all($packages);
- foreach (pkgs::allpackages($packages)) {
- pkgs::select($packages, $_) if $_->{values}[$ind] >= $level;
+ @l > @_ && !$auto_deps and $o->ask_okcancel('', [ $isSelection ?
+ _("The following packages are going to be installed") :
+ _("The following packages are going to be removed"),
+ join(", ", common::truncate_list(20, sort @l)) ], 1) || return;
+ $isSelection ? pkgs::selectPackage($packages, $_) : pkgs::unselectPackage($packages, $_) foreach @_;
+ foreach (@l) {
+ my $p = $packages->[0]{$_};
+ my $pix = pkgs::packageFlagSelected($p) ? $pix_selected : $pix_unselect;
+ $tree->node_set_pixmap($_, 1, $pix->[0], $pix->[1]) foreach @{$ptree{$_}};
+ }
+ &$update_size;
+ } else {
+ $o->ask_warn('', _("You can't select/unselect this package"));
}
- &$update;
};
-
- my $show_add = sub {
- my ($ind, $level) = @{$o->{packages_}}{"ind", "show_level"};
- $level = max(0, min(90, ($level + $_[0])));
- $o->{packages_}{show_level} = $level;
-
- my $update_tree = sub {
- my $P = shift;
- my $i = 0; foreach (@_) {
- my ($flag, $itemNB, $q) = @$_;
- my $item = $items{$flag || $itemNB}[0] if $flag || $itemNB;
- if ($flag) {
- $P->{tree}->insert($item, $i) if $flag ne "1";
- $item->set_subtree($q->{tree}) if $flag ne "1" && $q->{tree};
- $i++;
- } elsif ($itemNB) {
- delete $items{$itemNB};
- delete $P->{packages_item}{$itemNB};
- $P->{tree}->remove_item($item) if $P->{tree};
- }
- }
- };
- my $f; $f = sub {
- my ($p) = @_;
- if ($p->{packages}) {
- my %l; $l{$items{$_}[1]} = $_ foreach keys %{$p->{packages_item}};
- map {
- [ $_->{values}[$ind] >= $level ?
- ($l{$_} ? 1 : &$new_item($_, $_->{name}, $p)) : '', $l{$_}, $_ ];
- } sort {
- $a->{name} cmp $b->{name} } @{$p->{packages}};
+ my $children = sub { map { $packages->[0]{($tree->node_get_pixtext($_, 0))[0]} } gtkctree_children($_[0]) };
+ my $toggle = sub {
+ if (ref $curr && ! $_[0]) {
+ $tree->toggle_expansion($curr);
+ } else {
+ if (ref $curr) {
+ my @l = grep { !pkgs::packageFlagBase($_) } $children->($curr) or return;
+ my @unsel = grep { !pkgs::packageFlagSelected($_) } @l;
+ my @p = @unsel ?
+ @unsel : # not all is selected, select all
+ @l;
+ $select->(@p);
+ $parent = $curr;
} else {
- map {
- my $P = $p->{childs}{$_};
- my @L; @L = &$f($P) if !$P->{values} || $P->{values}[$ind] > ($::expert ? -1 : 0);
- if (grep { $_->[0] } @L) {
- my $r = $P->{tree} ? 1 : do {
- my $t = $P->{tree} = new Gtk::Tree(); $t->show;
- $P->{itemNB} = &$new_item($P, $_);
- };
- &$update_tree($P, @L);
- [ $r, $P->{itemNB}, $P ];
+ my $p = $packages->[0]{$curr} or return;
+ if (pkgs::packageFlagBase($p)) {
+ return $o->ask_warn('', _("This is a mandatory package, it can't be unselected"));
+ } elsif (pkgs::packageFlagInstalled($p)) {
+ return $o->ask_warn('', _("You can't unselect this package. It is already installed"));
+ } elsif (pkgs::packageFlagUpgrade($p)) {
+ if ($::expert) {
+ if (pkgs::packageFlagSelected($p)) {
+ $o->ask_yesorno('', _("This package must be upgraded\nAre you sure you want to deselect it?")) or return;
+ }
} else {
- &$update_tree($P, @L);
- delete $P->{tree};
- [ '', delete $P->{itemNB}, $P ];
+ return $o->ask_warn('', _("You can't unselect this package. It must be upgraded"));
}
- } sort keys %{$p->{childs} || {}};
+ }
+ $select->($p);
}
- };
- $ignore = 1;
- &$update_tree($compss, &$f($compss));
- &$update;
- $ignore = 0;
+ if (my @l = $children->($parent)) {
+ my $nb = grep { pkgs::packageFlagSelected($_) } @l;
+ my $pix = $nb==0 ? $pix_unselect : $nb<@l ? $pix_semisele : $pix_selected;
+ $tree->node_set_pixmap($parent, 1, $pix->[0], $pix->[1]);
+ }
+ }
};
- gtkadd($w->{window}, gtkpack_(new Gtk::VBox(0,5),
- 0, _("Choose the packages you want to install"),
- 1, gtkpack(new Gtk::HBox(0,0),
- createScrolledWindow($compss->{tree}),
- gtkadd(gtkset_usize(new Gtk::Frame(_("Info")), 150, 0),
- createScrolledWindow($info_widget = new Gtk::Text),
- ),
- ),
- 0, gtkpack_(new Gtk::HBox(0,0), 0, $w_size = new Gtk::Label('')),
- 0, gtkpack(new Gtk::HBox(0,10),
- map { $go ||= $_; $_ }
- map { gtksignal_connect(new Gtk::Button($_->[0]), "clicked" => $_->[1]) }
- [ _("Install") => sub { $w->{retval} = 1; Gtk->main_quit } ],
- #- keep show more or less [ _("Show less") => sub { &$show_add(+10) } ],
- #- keep show more or less [ _("Show more") => sub { &$show_add(-10) } ],
- )
- ));
- $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $windowwidth, $windowheight);
- $w->show;
- &$show_add(0);
- &$update();
- $go->grab_focus;
+ $tree->signal_connect(key_press_event => sub {
+ my ($w, $e) = @_;
+ my $c = chr($e->{keyval} & 0xff);
+ $toggle->(0) if $e->{keyval} >= 0x100 ? $c eq "\r" || $c eq "\x8d" : $c eq ' ';
+ 1;
+ });
+ $tree->signal_connect(tree_select_row => sub {
+ Gtk->timeout_remove($idle) if $idle;
+
+ if ($_[1]->row->is_leaf) {
+ ($curr) = $tree->node_get_pixtext($_[1], 0);
+ $parent = $_[1]->row->parent;
+ $idle = Gtk->timeout_add(100, $display_info);
+ } else {
+ $curr = $_[1];
+ }
+ $toggle->(1) if $_[2] == 1;
+ });
+ &$update_size;
$w->main;
}
@@ -487,15 +461,14 @@ sub choosePackagesTree {
sub installPackages {
my ($o, $packages) = @_;
- my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime);
+ my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime, $trans_progress_total);
- my $w = my_gtk->new(_("Installing"), grab => 1);
- $w->{window}->set_usize($windowwidth * 0.8, $windowheight * 0.5);
+ my $w = my_gtk->new(_("Installing"));
+ $w->{window}->set_usize($::windowwidth * 0.8, 260);
my $text = new Gtk::Label;
- my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label } (1..3);
+ my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label($_) } '', (_("Estimating")) x 2;
my ($progress, $progress_total) = map { new Gtk::ProgressBar } (1..2);
- gtkadd($w->{window}, gtkadd(new Gtk::EventBox,
- gtkpack(new Gtk::VBox(0,10),
+ gtkadd($w->{window}, gtkpack(new Gtk::VBox(0,10),
_("Please wait, "), $msg, $progress,
create_packtable({},
[_("Time remaining "), $msg_time_remaining],
@@ -503,42 +476,91 @@ sub installPackages {
),
$text,
$progress_total,
- )));
- $msg->set(_("Preparing installation"));
+ '',
+ gtkadd(create_hbox(),
+ my $cancel = new Gtk::Button(_("Cancel"))),
+ ));
$w->sync;
+ $msg->set(_("Preparing installation"));
+ gtkset_mousecursor_normal($cancel->window);
+ $cancel->signal_connect(clicked => sub { $pkgs::cancel_install = 1 });
- my $old = \&log::ld;
- local *log::ld = sub {
+ my $oldInstallCallback = \&pkgs::installCallback;
+ local *pkgs::installCallback = sub {
my $m = shift;
- if ($m =~ /^starting installation:/) {
+ if ($m =~ /^Starting installation/) {
$nb = $_[0];
- $total_size = $_[2]; $current_total_size = 0;
+ $total_size = $_[1]; $current_total_size = 0;
$start_time = time();
- $msg->set(join '', @_);
+ $msg->set(_("%d packages", $nb));
$w->flush;
- } elsif ($m =~ /^starting installing/) {
+ } elsif ($m =~ /^Starting installing package/) {
$progress->update(0);
my $name = $_[0];
$msg->set(_("Installing package %s", $name));
$current_total_size += $last_size;
- $last_size = c::headerGetEntry($o->{packages}{$name}{header}, 'size');
- $text->set((split /\n/, c::headerGetEntry($o->{packages}{$name}{header}, 'summary'))[0] || '');
+ $last_size = c::headerGetEntry($o->{packages}[0]{$name}{header}, 'size');
+ $text->set((split /\n/, c::headerGetEntry($o->{packages}[0]{$name}{header}, 'summary'))[0] || '');
$w->flush;
- } elsif ($m =~ /^progressing installation/) {
- $progress->update($_[2] ? $_[0] / $_[2] : 0);
+ } elsif ($m =~ /^Progressing installing package/) {
+ $progress->update($_[2] ? $_[1] / $_[2] : 0);
my $dtime = time() - $start_time;
- my $ratio = $total_size ? ($_[0] + $current_total_size) / $total_size : 0;
+ my $ratio = $total_size ? ($_[1] + $current_total_size) / $total_size : 0;
my $total_time = $ratio ? $dtime / $ratio : time();
$progress_total->update($ratio);
- if ($dtime != $last_dtime) {
- $msg_time_total->set(formatTime($total_time));
- $msg_time_remaining->set(formatTime(max($total_time - $dtime, 0)));
+ if ($dtime != $last_dtime && $current_total_size > 10 * 1024 * 1024) {
+ $msg_time_total->set(formatTime(10 * round($total_time / 10) + 10));
+ $msg_time_remaining->set(formatTime(10 * round(max($total_time - $dtime, 0) / 10) + 10));
$last_dtime = $dtime;
}
$w->flush;
- } else { goto $old }
+ } else { unshift @_, $m; goto $oldInstallCallback }
+ };
+ #- the modification is not local as the box should be living for other package installation.
+ undef *install_any::changeMedium;
+ *install_any::changeMedium = sub {
+ my ($method, $medium) = @_;
+
+ #- if not using a cdrom medium, always abort.
+ $method eq 'cdrom' and do {
+ local $my_gtk::grab = 1;
+ my $name = pkgs::mediumDescr($o->{packages}, $medium);
+ print "\a";
+ $name !~ /Application/ || ($o->{useless_thing_accepted2} ||= $o->ask_from_list_('', formatAlaTeX(_("
+Warning
+
+Please read carefully the terms below. If you disagree with any
+portion, you are not allowed to install the next CD media. Press 'Refuse'
+to continue the installation without using these media.
+
+
+Some components contained in the next CD media are not governed
+by the GPL License or similar agreements. Each such component is then
+governed by the terms and conditions of its own specific license.
+Please read carefully and comply with such specific licenses before
+you use or redistribute the said components.
+Such licenses will in general prevent the transfer, duplication
+(except for backup purposes), redistribution, reverse engineering,
+de-assembly, de-compilation or modification of the component.
+Any breach of agreement will immediately terminate your rights under
+the specific license. Unless the specific license terms grant you such
+rights, you usually cannot install the programs on more than one
+system, or adapt it to be used on a network. In doubt, please contact
+directly the distributor or editor of the component.
+Transfer to third parties or copying of such components including the
+documentation is usually forbidden.
+
+
+All rights to the components of the next CD media belong to their
+respective authors and are protected by intellectual property and
+copyright laws applicable to software programs.
+")), [ __("Accept"), __("Refuse") ], "Accept") eq "Accept") and $o->ask_okcancel('', _("Change your Cd-Rom!
+
+Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.
+If you don't have it, press Cancel to avoid installation from this Cd-Rom.", $name));
+ };
};
catch_cdie { $o->install_steps::installPackages($packages); }
sub {
@@ -546,265 +568,28 @@ sub installPackages {
$o->ask_yesorno('', [
_("There was an error ordering packages:"), $1, _("Go on anyway?") ], 1) and return 1;
${$_[0]} = "already displayed";
+ } elsif ($@ =~ /^error installing package list: (.*)/) {
+ $o->ask_yesorno('', [
+_("There was an error installing packages:"), $1, _("Go on anyway?") ], 1) and return 1;
+ ${$_[0]} = "already displayed";
}
0;
};
- $w->destroy;
-}
-
-
-
-
-#------------------------------------------------------------------------------
-sub load_rc($) {
- if (my ($f) = grep { -r $_ } map { "$_/$_[0].rc" } (".", "/usr/share", dirname(__FILE__))) {
- Gtk::Rc->parse($f);
- foreach (cat_($f)) {
- if (/style\s+"background"/ .. /^\s*$/) {
- @background1 = map { $_ * 256 * 256 } split ',', $1 if /NORMAL.*\{(.*)\}/;
- @background2 = map { $_ * 256 * 256 } split ',', $1 if /PRELIGHT.*\{(.*)\}/;
- }
- }
+ if ($pkgs::cancel_install) {
+ $pkgs::cancel_install = 0;
+ die "setstep choosePackages\n";
}
+ $w->destroy;
}
-sub install_theme {
- my ($o, $theme) = @_;
- $o->{theme} = $theme || $o->{theme} || $themes[0];
-
- gtkset_mousecursor(68);
-
- load_rc($_) foreach "themes-$o->{theme}", "install", "themes";
-
- if (my ($font, $font2) = lang::get_x_fontset($o->{lang})) {
- $font2 ||= $font;
- Gtk::Rc->parse_string(qq(
-style "default-font"
-{
- fontset = "$font"
-}
-style "steps"
-{
- fontset = "$font2"
-}
-widget "*" style "default-font"
-widget "*Steps*" style "steps"
-
-));
- }
- gtkset_background(@background1);# unless $::testing;
-
- create_logo_window($o);
- create_help_window($o);
-}
-
-#------------------------------------------------------------------------------
-sub create_help_window {
- my ($o) = @_;
-
-# $o->{help_window}->destroy if $o->{help_window};
-
- my $w;
- if ($w = $o->{help_window}) {
- $_->destroy foreach $w->{window}->children;
- } else {
- $w = bless {}, 'my_gtk';
- $w->{rwindow} = $w->{window} = new Gtk::Window;
- $w->{rwindow}->set_uposition($width - $helpwidth, $height - $helpheight);
- $w->{rwindow}->set_usize($helpwidth, $helpheight);
- $w->sync;
- }
-
-#- my $b = new Gtk::Button;
-#- $b->signal_connect(clicked => sub {
-#- my $w = my_gtk->new('', grab => 1, force_position => [ $stepswidth, $logoheight ]);
-#- $w->{rwindow}->set_usize($logowidth, $height - $logoheight);
-#- gtkadd($w->{window},
-#- gtkpack_(new Gtk::VBox(0,0),
-#- 1, createScrolledWindow(gtktext_insert(new Gtk::Text,
-#- formatAlaTeX(translate($help::steps_long{$o->{step}})))),
-#- 0, gtksignal_connect(new Gtk::Button(_("Ok")), "clicked" => sub { Gtk->main_quit }),
-#- ));
-#- $w->main;
-#- });
-#- my @l = (@questionmark_head,
-#- join('', "X c #", map { sprintf "%02X", $_ / 256 } @background1),
-#- join('', "O c #", map { sprintf "%02X", $_ / 256 } @background2),
-#- @questionmark_body);
-#- my @pixmap = Gtk::Gdk::Pixmap->create_from_xpm_d($w->{window}->window, undef, @l);
-#- gtkadd($b, new Gtk::Pixmap(@pixmap));
-
- Gtk::XmHTML->init;
- gtkadd($w->{window},
- gtkpack_(new Gtk::HBox(0,-2),
-#- 0, $b,
- 1, createScrolledWindow($w_help = new Gtk::XmHTML)));
-#- 1, createScrolledWindow($w_help = new Gtk::Text)));
- $w_help->source($o->{step} ? translate($o->{steps}{$o->{step}}{help}) : '');
-#- gtktext_insert($w_help, $o->{step} ? formatAlaTeX(translate($o->{steps}{$o->{step}}{help})) : '');
-
- $w->show;
- $o->{help_window} = $w;
-}
-
-#------------------------------------------------------------------------------
-sub create_steps_window {
- my ($o) = @_;
-
- $o->{steps_window}->destroy if $o->{steps_window};
- my %reachableSteps if 0;
- %reachableSteps = ();
-
- my $w = bless {}, 'my_gtk';
- $w->{rwindow} = $w->{window} = new Gtk::Window;
- $w->{rwindow}->set_uposition(0, 0);
- $w->{rwindow}->set_usize($stepswidth, $stepsheight);
- $w->{rwindow}->set_name("Steps");
- $w->{rwindow}->set_events('button_press_mask');
- $w->{rwindow}->signal_connect(button_press_event => sub {
- $::setstep or return;
- my $Y = $_[1]{'y'};
- map_each {
- my (undef, $y, undef, $height) = @{$::b->allocation};
- $y <= $Y && $Y < $y + $height and die "setstep $::a\n";
- } %reachableSteps;
- });
- $w->show;
+sub set_help {
+ my ($o, @l) = @_;
- gtkadd($w->{window},
- gtkpack_(new Gtk::VBox(0,0),
- (map { 1, $_ } map {
- my $step = $o->{steps}{$_};
- my $circle =
- $step->{done} && \@green_circle ||
- $step->{entered} && \@orange_circle ||
- \@red_circle;
- my @pixmap = Gtk::Gdk::Pixmap->create_from_xpm_d($w->{window}->window, undef, @$circle);
-
- my $w = new Gtk::Label(translate($step->{text}));
-
- $w->set_name("Steps" . ($step->{reachable} && "Reachable"));
- my $b = new Gtk::HBox(0,5);
- gtkpack_($b, 0, new Gtk::Pixmap(@pixmap), 0, $w);
-
- $reachableSteps{$_} = $b if $step->{reachable};
- $b;
- } grep { !(($::beginner || !$o->{installClass}) && $o->{steps}{$_}{beginnerHidden}) } @{$o->{orderedSteps}}),
- 0, gtkpack(new Gtk::HBox(0,0), map {
- my $t = $_;
- my $w = new Gtk::Button('');
- $w->set_name($t);
- $w->set_usize(0, 7);
- gtksignal_connect($w, clicked => sub { install_theme($o, $t); die "theme_changed\n" });
- } @themes)));
- $w->show;
- $o->{steps_window} = $w;
+ $o->{current_help} = formatAlaTeX(join "\n", map { _ deref($help::steps{$_}) } @l);
+ gtktext_insert($o->{help_window_text}, $o->{current_help});
+ 1;
}
-#------------------------------------------------------------------------------
-sub create_logo_window() {
- my ($o) = @_;
- gtkdestroy($o->{logo_window});
- my $w = bless {}, 'my_gtk';
- $w->{rwindow} = $w->{window} = new Gtk::Window;
- $w->{rwindow}->set_uposition($stepswidth, 0);
- $w->{rwindow}->set_usize($logowidth, $logoheight);
- $w->{rwindow}->set_name("background");
- $w->show;
- my $file = "logo-mandrake.xpm";
- -r $file or $file = "/usr/share/$file";
- if (-r $file) {
- my $ww = $w->{window};
- my @logo = Gtk::Gdk::Pixmap->create_from_xpm($ww->window, $ww->style->bg('normal'), $file);
- gtkadd($ww, new Gtk::Pixmap(@logo));
- }
- $o->{logo_window} = $w;
-}
-
-#------------------------------------------------------------------------------
-sub createXconf($$$) {
- my ($file, $mouse_type, $mouse_dev) = @_;
- $mouse_type ||= "Microsoft";
- $mouse_dev = devices::make($mouse_dev || "ttyS0");
-
- local *F;
- open F, ">$file" or die "can't create X configuration file $file";
- print F <<END;
-Section "Files"
- FontPath "/usr/X11R6/lib/X11/fonts"
-EndSection
-
-Section "Keyboard"
- Protocol "Standard"
- AutoRepeat 500 5
-
- LeftAlt Meta
- RightAlt Meta
- ScrollLock Compose
- RightCtl Control
-EndSection
-
-Section "Pointer"
- Protocol "$mouse_type"
- Device "$mouse_dev"
- Emulate3Buttons
- Emulate3Timeout 50
-EndSection
-
-
-Section "Monitor"
- Identifier "My Monitor"
- VendorName "Unknown"
- ModelName "Unknown"
- HorizSync 31.5-35.5
- VertRefresh 50-70
- Modeline "640x480" 25.175 640 664 760 800 480 491 493 525
- Modeline "640x480" 28.3 640 664 760 800 480 491 493 525
-EndSection
-
-
-Section "Device"
- Identifier "Generic VGA"
- VendorName "Unknown"
- BoardName "Unknown"
- Chipset "generic"
-EndSection
-
-
-Section "Screen"
- Driver "svga"
- Device "Generic VGA"
- Monitor "My Monitor"
- Subsection "Display"
- Modes "640x480"
- ViewPort 0 0
- EndSubsection
-EndSection
-
-Section "Screen"
- Driver "vga16"
- Device "Generic VGA"
- Monitor "My Monitor"
- Subsection "Display"
- Modes "640x480"
- ViewPort 0 0
- EndSubsection
-EndSection
-
-Section "Screen"
- Driver "fbdev"
- Device "Generic VGA"
- Monitor "My Monitor"
- Subsection "Display"
- Depth 16
- Modes "default"
- ViewPort 0 0
- EndSubsection
-EndSection
-END
-
-}
-#- ModeLine "640x480" 28 640 672 768 800 480 490 492 525
#-######################################################################################
#- Wonderful perl :(
#-######################################################################################
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index f3fabc985..e74789c8c 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -1,23 +1,4 @@
-package install_steps_interactive;
-
-# heritate from this class and you'll get all made interactivity for same steps.
-# for this you need to provide
-# - ask_from_listW(o, title, messages, arrayref, default) returns one string of arrayref
-# - ask_many_from_listW(o, title, messages, arrayref, arrayref2) returns one string of arrayref
-#
-# where
-# - o is the object
-# - title is a string
-# - messages is an refarray of strings
-# - default is an optional string (default is in arrayref)
-# - arrayref is an arrayref of strings
-# - arrayref2 contains booleans telling the default state,
-#
-# ask_from_list and ask_from_list_ are wrappers around ask_from_biglist and ask_from_smalllist
-#
-# ask_from_list_ just translate arrayref before calling ask_from_list and untranslate the result
-#
-# ask_from_listW should handle differently small lists and big ones.
+package install_steps_interactive; # $Id$
use diagnostics;
@@ -26,103 +7,1125 @@ use vars qw(@ISA);
@ISA = qw(install_steps);
-use common qw(:common);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :file :functional :system);
use partition_table qw(:types);
+use partition_table_raw;
use install_steps;
+use install_interactive;
+use install_any;
+use detect_devices;
+use run_program;
+use devices;
+use fsedit;
+use loopback;
+use mouse;
+use modules;
use lang;
+use keyboard;
+use any;
+use fs;
use log;
-1;
-
+#-######################################################################################
+#- In/Out Steps Functions
+#-######################################################################################
sub errorInStep($$) {
my ($o, $err) = @_;
- $o->ask_warn(_("Error"), [ _("An error occured"), $err ]);
+ $err =~ s/ at .*?$/\./ unless $::testing; #- avoid error message.
+ $o->ask_warn(_("Error"), [ _("An error occurred"), $err ]);
}
-=cut
-sub chooseLanguage($) {
+sub kill_action {
my ($o) = @_;
- lang::text2lang($o->ask_from_list("Language",
- __("Which language do you want?"), # the translation may be used for the help
- [ lang::list() ]));
+ $o->kill;
}
-sub selectInstallOrUpgrade($) {
+#-######################################################################################
+#- Steps Functions
+#-######################################################################################
+#------------------------------------------------------------------------------
+sub selectLanguage($) {
my ($o) = @_;
- $o->ask_from_list_(_("Install/Upgrade"),
- _("Is it an install or an updgrade?"),
- [ __("Install"), __("Upgrade") ],
- "Install") eq "Upgrade";
+
+ $o->{lang} = $o->ask_from_listf("Language",
+ _("Please, choose a language to use."),
+ \&lang::lang2text,
+ [ lang::list() ],
+ $o->{lang});
+ install_steps::selectLanguage($o);
+
+ $o->ask_warn('',
+"If you see this message it is because you choose 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->{lang} !~ /^en/ && translate("_I18N_");
+
+ unless ($o->{useless_thing_accepted}) {
+ $o->set_help('license');
+ $o->{useless_thing_accepted} = $o->ask_from_list_(_("License agreement"), formatAlaTeX(
+_("Introduction
+
+The operating system and the different components available in the Linux-Mandrake distribution
+shall be called the \"Software Products\" hereafter. The Software Products include, but are not
+restricted to, the set of programs, methods, rules and documentation related to the operating
+system and the different components of the Linux-Mandrake distribution.
+
+
+1. License Agreement
+
+Please read carefully this document. This document is a license agreement between you and
+MandrakeSoft S.A. which applies to the Software Products.
+By installing, duplicating or using the Software Products in any manner, you explicitly
+accept and fully agree to conform to the terms and conditions of this License.
+If you disagree with any portion of the License, you are not allowed to install, duplicate or use
+the Software Products.
+Any attempt to install, duplicate or use the Software Products in a manner which does not comply
+with the terms and conditions of this License is void and will terminate your rights under this
+License. Upon termination of the License, you must immediately destroy all copies of the
+Software Products.
+
+
+2. Limited Warranty
+
+The Software Products and attached documentation are provided \"as is\", with no warranty, to the
+extent permitted by law.
+MandrakeSoft S.A. will, in no circumstances and to the extent permitted by law, be liable for any special,
+incidental, direct or indirect damages whatsoever (including without limitation damages for loss of
+business, interruption of business, financial loss, legal fees and penalties resulting from a court
+judgment, or any other consequential loss) arising out of the use or inability to use the Software
+Products, even if MandrakeSoft S.A. has been advised of the possibility or occurance of such
+damages.
+
+LIMITED LIABILITY LINKED TO POSSESSING OR USING PROHIBITED SOFTWARE IN SOME COUNTRIES
+
+To the extent permitted by law, MandrakeSoft S.A. or its distributors will, in no circumstances, be
+liable for any special, incidental, direct or indirect damages whatsoever (including without
+limitation damages for loss of business, interruption of business, financial loss, legal fees
+and penalties resulting from a court judgment, or any other consequential loss) arising out
+of the possession and use of software components or arising out of downloading software components
+from one of Linux-Mandrake sites which are prohibited or restricted in some countries by local laws.
+This limited liability applies to, but is not restricted to, the strong cryptography components
+included in the Software Products.
+
+
+3. The GPL License and Related Licenses
+
+The Software Products consist of components created by different persons or entities. Most
+of these components are governed under the terms and conditions of the GNU General Public
+Licence, hereafter called \"GPL\", or of similar licenses. Most of these licenses allow you to use,
+duplicate, adapt or redistribute the components which they cover. Please read carefully the terms
+and conditions of the license agreement for each component before using any component. Any question
+on a component license should be addressed to the component author and not to MandrakeSoft.
+The programs developed by MandrakeSoft S.A. are governed by the GPL License. Documentation written
+by MandrakeSoft S.A. is governed by a specific license. Please refer to the documentation for
+further details.
+
+
+4. Intellectual Property Rights
+
+All rights to the components of the Software Products belong to their respective authors and are
+protected by intellectual property and copyright laws applicable to software programs.
+MandrakeSoft S.A. reserves its rights to modify or adapt the Software Products, as a whole or in
+parts, by all means and for all purposes.
+\"Mandrake\", \"Linux-Mandrake\" and associated logos are trademarks of MandrakeSoft S.A.
+
+
+5. Governing Laws
+
+If any portion of this agreement is held void, illegal or inapplicable by a court judgment, this
+portion is excluded from this contract. You remain bound by the other applicable sections of the
+agreement.
+The terms and conditions of this License are governed by the Laws of France.
+All disputes on the terms of this license will preferably be settled out of court. As a last
+resort, the dispute will be referred to the appropriate Courts of Law of Paris - France.
+For any question on this document, please contact MandrakeSoft S.A.
+")), [ __("Accept"), __("Refuse") ], "Accept") eq "Accept" or $o->exit;
+ }
+}
+#------------------------------------------------------------------------------
+sub selectKeyboard($) {
+ my ($o, $clicked) = @_;
+
+ $o->{keyboard} = $o->ask_from_listf_(_("Keyboard"),
+ _("Please, choose your keyboard layout."),
+ \&keyboard::keyboard2text,
+ [ keyboard::xmodmaps() ],
+ $o->{keyboard});
+ delete $o->{keyboard_unsafe};
+
+ if ($::expert && ref($o) !~ /newt/) { #- newt is buggy with big windows :-(
+ $o->set_help('selectLangs');
+ $o->{langs} ||= [ $o->{lang} ];
+ my $all = $o->{langs}[0] eq 'all';
+ $o->{langs} = $o->ask_many_from_list('',
+ _("You can choose other languages that will be available after install"),
+ {
+ list => [ lang::list() ],
+ label => sub { lang::lang2text($_) },
+ values => $o->{langs},
+ sort => 1,
+ },
+ { list => ['all'], label => sub { _("All") }, ref => sub { \$all }, shadow => 0 }) or goto &selectKeyboard;
+ $o->{langs} = [ 'all' ] if $all;
+ }
+ install_steps::selectKeyboard($o);
}
+#------------------------------------------------------------------------------
+sub selectInstallClass1 {
+ my ($o, $verif, $l, $def, $l2, $def2) = @_;
+ $verif->($o->ask_from_list(_("Install Class"), _("Which installation class do you want?"), $l, $def));
+ $::live ? 'Update' : $o->ask_from_list_(_("Install/Update"), _("Is this an install or an update?"), $l2, $def2);
+}
+
+#------------------------------------------------------------------------------
sub selectInstallClass($@) {
my ($o, @classes) = @_;
- $o->ask_from_list_(_("Install Class"),
- _("What type of user will you have?"),
- [ @classes ]);
+
+ my %c = my @c = (
+ $::corporate ? () : (
+ _("Recommended") => "beginner",
+ ),
+ $o->{meta_class} eq 'desktop' ? () : (
+ _("Customized") => "specific",
+ _("Expert") => "expert",
+ ),
+ );
+
+ $o->set_help('selectInstallClassCorpo') if $::corporate;
+
+ my $verifInstallClass = sub {
+ $::beginner = $c{$_[0]} eq "beginner";
+ $::expert = $c{$_[0]} eq "expert" &&
+ $o->ask_from_list_('',
+_("Are you sure you are an expert?
+You will be allowed to make powerful but dangerous things here.
+
+You will be asked questions such as: ``Use shadow file for passwords?'',
+are you ready to answer that kind of questions?"),
+ [ _("Customized"), _("Expert") ]) ne "Customized";
+ };
+
+ $o->{isUpgrade} = $o->selectInstallClass1($verifInstallClass,
+ first(list2kv(@c)), ${{reverse %c}}{$::beginner ? "beginner" : $::expert ? "expert" : "specific"},
+ [ __("Install"), __("Update") ], $o->{isUpgrade} ? "Update" : "Install") eq "Update";
+
+ if ($::corporate || $::beginner) {
+ delete $o->{installClass};
+ } else {
+ my %c = (
+ normal => _("Workstation"),
+ developer => _("Development"),
+ server => _("Server"),
+ );
+ $o->set_help('selectInstallClass2');
+ $o->{installClass} = $o->ask_from_listf(_("Install Class"),
+ _("What is your system used for?"),
+ sub { $c{$_[0]} },
+ [ keys %c ],
+ $o->{installClass});
+ }
+ install_steps::selectInstallClass($o);
+}
+
+#------------------------------------------------------------------------------
+sub selectMouse {
+ my ($o, $force) = @_;
+
+ $force ||= $o->{mouse}{unsafe} || $::expert;
+
+ my $prev = $o->{mouse}{type} . '|' . $o->{mouse}{name};
+ $o->{mouse} = mouse::fullname2mouse(
+ $o->ask_from_treelistf('', _("Please, choose the type of your mouse."), '|',
+ sub { join '|', map { translate($_) } split '\|', $_[0] },
+ [ mouse::fullnames ], $prev)) if $force;
+
+ if ($force && $o->{mouse}{type} eq 'serial') {
+ $o->set_help('selectSerialPort');
+ $o->{mouse}{device} =
+ $o->ask_from_listf(_("Mouse Port"),
+ _("Please choose on which serial port your mouse is connected to."),
+ \&mouse::serial_port2text,
+ [ mouse::serial_ports ]);
+ }
+
+ any::setup_thiskind($o, 'usb', !$::expert, 0, $o->{pcmcia}) if $o->{mouse}{device} eq "usbmouse";
+ eval {
+ devices::make("usbmouse");
+ modules::load("usbmouse");
+ modules::load("mousedev");
+ } if $o->{mouse}{device} eq "usbmouse";
+
+ $o->SUPER::selectMouse;
+}
+#------------------------------------------------------------------------------
+sub setupSCSI {
+ my ($o) = @_;
+
+ if ($o->{pcmcia} && !$::noauto) {
+ my $w = $o->wait_message(_("PCMCIA"), _("Configuring PCMCIA cards..."));
+ modules::configure_pcmcia($o->{pcmcia});
+ }
+ {
+ my $w = $o->wait_message(_("IDE"), _("Configuring IDE"));
+ modules::load_ide();
+ }
+ any::setup_thiskind($o, 'scsi|disk', $_[1], $_[2], $o->{pcmcia});
+}
+
+sub ask_mntpoint_s {
+ my ($o, $fstab) = @_;
+ $o->set_help('ask_mntpoint_s');
+
+ my @fstab = grep { isTrueFS($_) } @$fstab;
+ @fstab = grep { isSwap($_) } @$fstab if @fstab == 0;
+ @fstab = @$fstab if @fstab == 0;
+ die _("no available partitions") if @fstab == 0;
+
+ {
+ my $w = $o->wait_message('', _("Scanning partitions to find mount points"));
+ install_any::suggest_mount_points($o->{hds}, $o->{prefix}, 'uniq');
+ log::l("default mntpoint $_->{mntpoint} $_->{device}") foreach @fstab;
+ }
+ if (@fstab == 1) {
+ $fstab[0]{mntpoint} = '/';
+ } else {
+ $o->ask_from_entries_refH('',
+ _("Choose the mount points"),
+ [ map { partition_table_raw::description($_) =>
+ { val => \$_->{mntpoint}, not_edit => 0, list => [ '', fsedit::suggestions_mntpoint([]) ] }
+ } @fstab ]) or return;
+ }
+ $o->SUPER::ask_mntpoint_s($fstab);
+}
+
+#------------------------------------------------------------------------------
+sub doPartitionDisks {
+ my ($o) = @_;
+
+ my $warned;
+ install_any::getHds($o, sub {
+ my ($err) = @_;
+ $warned = 1;
+ if ($o->ask_yesorno(_("Error"),
+_("I can't read your partition table, it's too corrupted for me :(
+I can try to go on blanking bad partitions (ALL DATA will be lost!).
+The other solution is to disallow DrakX to modify the partition table.
+(the error is %s)
+
+Do you agree to loose all the partitions?
+", $err))) {
+ 0;
+ } else {
+ $o->{partitioning}{readonly} = 1;
+ 1;
+ }
+ }) or $warned or $o->ask_warn('',
+_("DiskDrake failed to read correctly the partition table.
+Continue at your own risk!"));
+
+
+ if ($o->{isUpgrade}) {
+ # either one root is defined (and all is ok), or we take the first one we find
+ my $p =
+ fsedit::get_root_($o->{fstab}) ||
+ $o->ask_from_listf(_("Root Partition"),
+ _("What is the root partition (/) of your system?"),
+ \&partition_table_raw::description,
+ [ install_any::find_root_parts($o->{hds}, $o->{prefix}) ]) or die "setstep exitInstall\n";
+ install_any::use_root_part($o->{fstab}, $p, $o->{prefix});
+ } elsif ($::expert && ref($o) =~ /gtk/) {
+ install_interactive::partition_with_diskdrake($o, $o->{hds});
+ } else {
+ install_interactive::partitionWizard($o);
+ }
}
+#------------------------------------------------------------------------------
sub rebootNeeded($) {
my ($o) = @_;
$o->ask_warn('', _("You need to reboot for the partition table modifications to take place"));
- $o->SUPER::rebootNeeded;
+
+ install_steps::rebootNeeded($o);
}
+#------------------------------------------------------------------------------
sub choosePartitionsToFormat($$) {
my ($o, $fstab) = @_;
- my @l = grep { $_->{mntpoint} && (isExt2($_) || isSwap($_)) } @$fstab;
- my @r = $o->ask_many_from_list('', _("Choose the partitions you want to format"),
- [ map { $_->{mntpoint} } @l ],
- [ map { $_->{notFormatted} } @l ]);
- for (my $i = 0; $i < @l; $i++) {
- $l[$i]->{toFormat} = $r[$i];
+
+ $o->SUPER::choosePartitionsToFormat($fstab);
+
+ my @l = grep { !$_->{isMounted} && !$_->{isFormatted} && $_->{mntpoint} && !($::beginner && isSwap($_)) &&
+ (!isOtherAvailableFS($_) || $::expert || $_->{toFormat})
+ } @$fstab;
+ $_->{toFormat} = 1 foreach grep { $::beginner && isSwap($_) } @$fstab;
+
+ return if @l == 0 || $::beginner && 0 == grep { ! $_->{toFormat} } @l;
+
+ my $name2label = sub {
+ sprintf("%s %s", isSwap($_) ? type2name($_->{type}) : $_->{mntpoint},
+ isLoopback($_) ? $::expert && loopback::file($_) : partition_table_raw::description($_));
+ };
+
+ #- keep it temporary until the guy has accepted
+ my $toFormat = $o->ask_many_from_list('', _("Choose the partitions you want to format"),
+ {
+ list => \@l,
+ label => $name2label,
+ value => sub { $_->{toFormat} || $_->{toFormatUnsure} },
+ }) or die "already displayed";
+ #- ok now we can really set toFormat
+ $_->{toFormat} = 1 foreach @$toFormat;
+
+ my @m = grep { $_->{toFormat} && !isLoopback($_) && !isReiserfs($_) } @l;
+ !@m || $o->ask_many_from_list('', _("Check bad blocks?"),
+ {
+ list => \@m,
+ label => $name2label,
+ ref => sub { \$_->{toFormatCheck} },
+ }) 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, $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 (%d > %d)", $min_size, $availableC);
+
+ my $min_mark = $::beginner ? 25 : $::expert ? 0 : 1;
+
+ my $b = pkgs::saveSelected($packages);
+ my ($ind, $level) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, 0, $o->{installClass});
+ my $max_size = pkgs::selectedSize($packages) + 1; #- avoid division by zero.
+ pkgs::restoreSelected($b);
+
+ $o->chooseGroups($packages, $compssUsers, $min_mark, $ind, \$individual, $max_size) unless $::beginner || $::corporate;
+
+ my $size2install = min($availableC, do {
+ my $max = round_up(min($max_size, $availableC) / sqr(1024), 100);
+
+ if ($::beginner) {
+ my (@l);
+ my @text = (__("Minimum (%dMB)"), __("Recommended (%dMB)"), __("Complete (%dMB)"));
+ if ($o->{meta_class} eq 'desktop') {
+ @l = (300, 500, 800, 0);
+ $max > $l[2] or splice(@l, 2, 1);
+ $max > $l[1] or splice(@l, 1, 1);
+ $max > $l[0] or @l = $max;
+ $text[$#l] = __("Custom");
+ } else {
+ @l = (300, 700, $max);
+ $l[2] > $l[1] + 200 or splice(@l, 1, 1); #- not worth proposing too alike stuff
+ $l[1] > $l[0] + 100 or splice(@l, 0, 1);
+ }
+ $o->set_help('empty');
+ $o->ask_from_listf('', _("Select the size you want to install"), sub { _ ($text[$_[1]], $_[0]) }, \@l, $l[1]) * sqr(1024);
+ } else {
+ $o->chooseSizeToInstall($packages, $min_size, $max_size, $availableC, $individual) || goto &choosePackages;
+ }
+ });
+ if (!$size2install) { #- special case for desktop
+ $o->chooseGroups($packages, $compssUsers, $min_mark, $ind) or goto &choosePackages;
+ $size2install = $availableC;
+ }
+ ($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, $min_level, $ind, $individual, $max_size) = @_;
+
+ my %size;
+ my $base = pkgs::selectedSize($packages);
+ foreach (@{$o->{compssUsersSorted}}) {
+ my $b = pkgs::saveSelected($packages);
+ $_->{values}[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
+ $size{$_} = pkgs::selectedSize($packages) - $base;
+ pkgs::restoreSelected($b);
+ }
+
+ my @groups = @{$o->{compssUsersSorted}};
+ if ($o->{meta_class} ne 'desktop') {
+ push @groups, __("Miscellaneous");
+
+ my $b = pkgs::saveSelected($packages);
+ foreach (@{$o->{compssUsersSorted}}) {
+ $_->{values}[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
+ }
+ $size{Miscellaneous} = $max_size - pkgs::selectedSize($packages);
+ pkgs::restoreSelected($b);
+ }
+ @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level)
+ my $all;
+ $o->ask_many_from_list('', _("Package Group Selection"),
+ { list => \@groups,
+ help => sub { translate($o->{compssUsersDescr}{$_}) },
+ ref => sub { \$o->{compssUsersChoice}{$_} },
+ icon2f => sub {
+ my $f = "/usr/share/icons/" . ($o->{compssUsersIcons}{$_} || 'default');
+ -e "$f.xpm" or $f .= "_section";
+ -e "$f.xpm" or $f = '/usr/share/icons/default_section';
+ "$f.xpm";
+ },
+ label => sub { translate($_) . ($size{$_} ? sprintf " (%d%s)", $size{$_}, _("MB") : '') },
+ },
+ $o->{meta_class} eq 'desktop' ? { list => [ _("All") ], ref => sub { \$all }, shadow => 0 } : (),
+ $individual ? { list => [ _("Individual package selection") ], ref => sub { $individual } } : (),
+ ) or return;
+ if ($all) {
+ $o->{compssUsersChoice}{$_} = 1 foreach @{$o->{compssUsersSorted}}, "Miscellaneous";
+ }
+ unless ($o->{compssUsersChoice}{Miscellaneous}) {
+ my %l;
+ $l{@{$compssUsers->{$_}}} = () foreach @{$o->{compssUsersSorted}};
+ exists $l{$_} or pkgs::packageSetFlagSkip($_, 1) foreach values %{$packages->[0]};
+ }
+ foreach (@{$o->{compssUsersSorted}}) {
+ $o->{compssUsersChoice}{$_} or pkgs::skipSetWithProvides($packages, @{$compssUsers->{$_}});
+ }
+ foreach (@{$o->{compssUsersSorted}}) {
+ $o->{compssUsersChoice}{$_} or next;
+ foreach (@{$compssUsers->{$_}}) {
+ pkgs::packageSetFlagSkip($_, 0);
+ }
+ }
+ 1;
+}
+
+sub chooseCD {
+ my ($o, $packages) = @_;
+ my @mediums = grep { $_ != $install_any::boot_medium } pkgs::allMediums($packages);
+ my @mediumsDescr = ();
+ my %mediumsDescr = ();
+
+ unless (grep { /ram3/ } cat_("/proc/mounts")) {
+ #- mono-cd in case of no ramdisk
+ undef $packages->[2]{$_}{selected} foreach @mediums;
+ log::l("low memory install, using single CD installation (as it is not ejectable)");
+ return;
+ }
+
+ #- 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('',
+_("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."),
+ {
+ list => \@mediumsDescr,
+ label => sub { _("Cd-Rom labeled \"%s\"", $_) },
+ ref => sub { \$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 = shift;
+ my ($o, $packages) = @_;
+ my ($current, $total) = 0;
- my $old = \&log::ld;
- local *log::ld = sub {
+ my $w = $o->wait_message(_("Installing"), _("Preparing installation"));
+
+ my $old = \&pkgs::installCallback;
+ local *pkgs::installCallback = sub {
my $m = shift;
- if ($m =~ /^starting installing/) {
- my $name = first($_[0] =~ m|([^/]*)-.+?-|);
- print("installing package $name");
- } else { goto $old }
- };
- $o->SUPER::installPackages(@_);
+ 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) = @_;
+ require netconnect;
+ netconnect::main($o->{prefix}, $o->{netcnx} ||= {}, $o->{netc}, $o->{mouse}, $o, $o->{pcmcia}, $o->{intf},
+ sub { $o->pkg_install(@_) }, $first_time, $o->{lang} eq "fr_FR" && $o->{keyboard} eq "fr");
}
-sub createBootdisk($) {
+#-configureNetworkIntf moved to network
+
+#-configureNetworkNet moved to network
+#------------------------------------------------------------------------------
+#-pppConfig moved to any.pm
+#------------------------------------------------------------------------------
+sub installCrypto {
my ($o) = @_;
+ my $u = $o->{crypto} ||= {};
- $o->SUPER::createBootdisk if
- $o->{default}->{mkbootdisk} = $o->ask_yesorno('',
- _("A custom bootdisk provides a way of booting into your Linux system without
+ $::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} = $o->ask_from_listf('',
+ _("Choose a mirror from which to get the packages"),
+ \&crypto::mirror2text,
+ [ crypto::mirrors() ],
+ $u->{mirror});
+ };
+ return if $@;
+
+ #- bring all interface up for installing crypto packages.
+ install_interactive::upNetwork($o);
+
+ 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
+ };
+ $u->{packages} = $o->ask_many_from_list('', _("Please choose the packages you want to install."), { list => \@packages, values => $u->{packages} }) or return;
+ $o->pkg_install(@{$u->{packages}});
+
+ #- stop interface using ppp only.
+ install_interactive::downNetwork($o, 'pppOnly');
+}
+
+#------------------------------------------------------------------------------
+sub configureTimezone {
+ 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});
+ $o->set_help('configureTimezoneGMT');
+ $o->{timezone}{UTC} = $o->ask_yesorno('', _("Is your hardware clock set to GMT?"), $o->{timezone}{UTC}) if $::expert || $clicked;
+ install_steps::configureTimezone($o, $f);
+}
+
+#------------------------------------------------------------------------------
+sub configureServices {
+ my ($o) = @_;
+ require services;
+ $o->{services} = services::ask($o, $o->{prefix});
+ install_steps::configureServices($o);
+}
+
+#------------------------------------------------------------------------------
+sub configurePrinter {
+ my ($o, $clicked) = @_;
+
+ $::corporate and return;
+
+ 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...
+ #install_interactive::upNetwork($o, 'pppAvoided');
+
+ #- take default configuration, this include choosing the right system
+ #- currently used by the system.
+ eval { add2hash($o->{printer} ||= {}, printer::getinfo($o->{prefix})) };
+
+ #- figure out what printing system to use, currently are suported cups and lpr,
+ #- in case this has not be detected above.
+ $::expert or $o->{printer}{mode} ||= 'CUPS';
+ if ($::expert || !$o->{printer}{mode}) {
+ $o->set_help('configurePrinterSystem');
+ $o->{printer}{mode} = $o->ask_from_list_([''], _("Which printing system do you want to use?"),
+ [ 'CUPS', 'lpr', __("None") ],
+ );
+ $o->{printer}{want} = $o->{printer}{mode} ne 'None';
+ $o->{printer}{want} or $o->{printer}{mode} = undef, return;
+ $o->set_help('configurePrinter');
+ }
+
+ $o->{printer}{PAPERSIZE} = $o->{lang} eq 'en' ? 'letter' : 'a4';
+ printerdrake::main($o->{printer}, $o, sub { $o->pkg_install(@_) }, sub { install_interactive::upNetwork($o, 'pppAvoided') });
+
+ $o->pkg_install_if_requires_satisfied('xpp', 'kups');
+}
+
+#------------------------------------------------------------------------------
+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 = map { chomp; $_ } cat_("$o->{prefix}/etc/shells");
+
+ 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 => [ any::shells($o->{prefix}) ], not_edit => !$::expert}
+ ), $o->{security} > 3 ? () : (
+ _("Icon") => {val => \$u->{icon}, list => [ any::facesnames($o->{prefix}) ], icon2f => sub { any::face2xpm($_[0], $o->{prefix}) } },
+ ),
+ ],
+ 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);
+ 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;
+
+ 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
-lilo on your system, or another operating system removes lilo, or lilo doesn't
+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. Would you like to create a bootdisk for your 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"),
+ );
+
+ if ($first_time || @l == 1) {
+ $o->ask_yesorno('', formatAlaTeX(
+ _("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} = $o->ask_from_listf('',
+ _("Choose the floppy drive you want to use to make the bootdisk"),
+ sub { $l{$_[0]} || $_[0] },
+ [ @l, "Skip" ],
+ $o->{mkbootdisk});
+ return $o->{mkbootdisk} = '' if $o->{mkbootdisk} eq 'Skip';
+ }
+ $o->ask_warn('', _("Insert a floppy in drive %s", $l{$o->{mkbootdisk}} || $o->{mkbootdisk}));
+ }
+
+ my $w = $o->wait_message('', _("Creating bootdisk"));
+ install_steps::createBootdisk($o);
}
-sub setupBootloader($) {
+#------------------------------------------------------------------------------
+sub setupBootloaderBefore {
my ($o) = @_;
+ my $w = $o->wait_message('', _("Preparing bootloader"));
+ $o->set_help('empty');
+ $o->SUPER::setupBootloaderBefore($o);
+}
- my $where = $o->ask_from_list(_("Lilo Installation"), _("Where do you want to install the bootloader?"), [ _("First sector of drive"), _("First sector of boot partition") ]);
- $o->{default}->{bootloader}->{onmbr} = $where eq _("First sector of drive");
-
- $o->SUPER::setupBootloader;
+#------------------------------------------------------------------------------
+sub setupBootloader {
+ my ($o, $more) = @_;
+ 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?"));
+ };
+ } else {
+ 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 bootloader failed. The following error occured:"),
+ grep { !/^Warning:/ } cat_("$o->{prefix}/tmp/.error") ]);
+ unlink "$o->{prefix}/tmp/.error";
+ die "already displayed";
+ }
+ }
+}
+
+#------------------------------------------------------------------------------
+#- miscellaneousNetwork moved to network.pm
+#------------------------------------------------------------------------------
+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;
+
+ my $u = $o->{miscellaneous} ||= {};
+ exists $u->{LAPTOP} or $u->{LAPTOP} = 1;
+ my $s = $o->{security};
+
+ install_interactive::tellAboutProprietaryModules($o) unless $clicked;
+
+ 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 ] },
+_("Precise RAM size if needed (found %d MB)", availableRamMB()) => \$u->{memsize},
+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;
+ $u->{numlock} && $o->{pcmcia} and $o->ask_okcancel('',
+_("Be carefull, having numlock enabled causes a lot of keystrokes to
+give digits instead of normal letters (eg: pressing `p' gives `6')")) || return;
+ 0; }
+ ) || return;
+
+ install_steps::miscellaneous($o);
+}
+
+#------------------------------------------------------------------------------
+sub configureX {
+ my ($o, $clicked) = @_;
+ $o->configureXBefore;
+
+ 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});
+ }
+ }
+
+ #- 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 $::live || $xfs_started;
+ $xfs_started = 1;
+
+ { local $::testing = 0; #- unset testing
+ local $::auto = $::beginner && !$clicked;
+
+ Xconfigurator::main($o->{prefix}, $o->{X}, $o, $o->{allowFB}, bool($o->{pcmcia}), sub {
+ my ($server, @l) = @_;
+ $o->pkg_install("XFree86-$server", @l);
+ });
+ }
+ $o->configureXAfter;
}
-=cut
-sub exitInstall {
+
+#------------------------------------------------------------------------------
+sub generateAutoInstFloppy($) {
my ($o) = @_;
+ $::expert || $::g_auto_install or return;
+
+ my $floppy = detect_devices::floppy();
+ $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));
+
+ require commands;
+ 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("images/$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"; #" for po
+ 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,
+ including any Windows partitions !!
+", "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("images/$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_steps::exitInstall($o);
+
+ $o->exit unless $alldone;
+
$o->ask_warn('',
-_"Congratulations, installation is complete.
+_("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,
+
+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.");
+install chapter of the Official Linux-Mandrake User's Guide.")) if $alldone && !$::g_auto_install;
}
+
+#-######################################################################################
+#- Misc Steps Functions
+#-######################################################################################
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/install_steps_newt.pm b/perl-install/install_steps_newt.pm
index 1383ad372..7fd1cab1f 100644
--- a/perl-install/install_steps_newt.pm
+++ b/perl-install/install_steps_newt.pm
@@ -1,4 +1,4 @@
-package install_steps_newt;
+package install_steps_newt; # $Id$
use diagnostics;
use strict;
@@ -11,6 +11,50 @@ use vars qw(@ISA);
#-######################################################################################
use install_steps_interactive;
use interactive_newt;
+use install_any;
+use devices;
+use lang;
+use common qw(:common);
+
+my $banner = __();
+
+sub banner {
+ my $banner = translate(__("Linux-Mandrake Installation %s"));
+ my $l = first(Newt::GetScreenSize) - length($banner) - length($_[0]) + 1;
+ Newt::DrawRootText(0, 0, sprintf($banner, ' ' x $l . $_[0]));
+}
+
+sub new($$) {
+ my ($type, $o) = @_;
+
+ interactive_newt->new;
+
+ banner('');
+ Newt::PushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen "));
+
+ (bless {}, ref $type || $type)->SUPER::new($o);
+}
+
+sub enteringStep {
+ my ($o, $step) = @_;
+ $o->SUPER::enteringStep($step);
+ banner(translate($o->{steps}{$step}{text}));
+}
+
+sub exitInstall {
+ &install_steps_interactive::exitInstall;
+ interactive_newt::end;
+}
+
+#-######################################################################################
+#- Steps Functions
+#-######################################################################################
+sub selectLanguage {
+ my ($o) = @_;
+ $o->SUPER::selectLanguage;
+ lang::load_console_font($o->{lang});
+}
+
1;
diff --git a/perl-install/install_steps_stdio.pm b/perl-install/install_steps_stdio.pm
index c752e62df..1ef8b83fa 100644
--- a/perl-install/install_steps_stdio.pm
+++ b/perl-install/install_steps_stdio.pm
@@ -1,196 +1,41 @@
-package install_steps_stdio;
+package install_steps_stdio; # $Id$
use diagnostics;
use strict;
use vars qw(@ISA);
-@ISA = qw(install_steps);
+@ISA = qw(install_steps_interactive interactive_stdio);
use common qw(:common);
-use partition_table qw(:types);
-use devices;
-use run_program;
-use install_steps;
-use install_any;
-use diskdrake;
+use interactive_stdio;
+use install_steps_interactive;
use lang;
-use log;
-1;
-
-sub chooseLanguage($) {
- my $lang = ask_from_list('Language', 'Which language do you want?', [ lang::list() ]);
- run_program::run('xmodmap', "/usr/bin/$lang.map");
- $lang;
-}
-
-sub selectInstallOrUpgrade($) {
- ask_yesorno('Install/Upgrade', 'Do you want to upgrade an already installed Mandrake?');
-}
-
-sub rebootNeeded($) {
- my ($o) = @_;
- ask_warn('', "You need to reboot for the partition table modifications to take place");
- $o->SUPER::rebootNeeded;
-}
-
-sub choosePartitionsToFormat($$) {
- my ($o, $fstab) = @_;
- my @l = grep { $_->{mntpoint} && (isExt2($_) || isSwap($_)) } @$fstab;
- my @r = ask_many_from_list('', "Choose the partitions you want to format",
- [ map { $_->{mntpoint} } @l ],
- [ map { $_->{notFormatted} } @l ]);
- for (my $i = 0; $i < @l; $i++) {
- $l[$i]->{toFormat} = $r[$i];
- }
-}
+sub new($$) {
+ my ($type, $o) = @_;
-sub choosePackages($$$) {
- my ($o, $packages, $comps) = @_;
- my @comps = values %$comps;
- my @r = ask_many_from_list('',
- "Choose the packages you want to install",
- [ map { $_->{name} } @comps ],
- [ map { $_->{selected} } @comps ]);
-
- for (my $i = 0; $i < @comps; $i++) {
- $comps[$i]->{selected} = $r[$i];
- }
+ $o->{partitioning}{readonly} = 1; #- needed til diskdrake is graphic only...
+ (bless {}, ref $type || $type)->SUPER::new($o);
}
-sub installPackages {
- my $o = shift;
-
- $::testing and exit 0;
-
- my $old = \&log::ld;
- local *log::ld = sub {
- my $m = shift;
- if ($m =~ /^starting installing/) {
- my $name = first($_[0] =~ m|([^/]*)-.+?-|);
- print("installing package $name");
- } else { goto $old }
- };
- $o->SUPER::installPackages(@_);
+sub enteringStep {
+ my ($o, $step) = @_;
+ print _("Entering step `%s'\n", translate($o->{steps}{$step}{text}));
+ $o->SUPER::enteringStep($step);
}
-
-
-sub setRootPassword($) {
- my ($o) = @_;
-
- my (%w);
- do {
- $w{password} and print "You must enter the same password, please try again\n";
- print "Password: "; $w{password} = readln();
- print "Password (again for confirmation): ";
- } until ($w{password} eq readln());
-
- $o->{default}->{rootPassword} = $w{password};
- $o->SUPER::setRootPassword;
-}
-
-sub addUser($) {
- my ($o) = @_;
- my %w;
- print "\nCreating a normal user account:\n";
- print "Name: "; $w{name} = readln() or return;
- do {
- $w{password} and print "You must enter the same password, please try again\n";
- print "Password: "; $w{password} = readln();
- print "Password (again for confirmation): ";
- } until ($w{password} eq readln());
- print "Real name: "; $w{realname} = readln();
-
- $w{shell} = ask_from_list('', 'Shell', $o->{default}->{shells});
-
- $o->{default}->{user} = { map { $_ => $w{$_}->get_text } qw(name password realname shell) };
- $o->SUPER::addUser;
-}
-
-sub createBootdisk($) {
- my ($o) = @_;
-
- $o->SUPER::createBootdisk if
- $o->{default}->{mkbootdisk} = 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 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?");
+sub leavingStep {
+ my ($o, $step) = @_;
+ $o->SUPER::leavingStep($step);
+ print "--------\n";
}
-sub exitInstall {
- 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.");
-}
-
-
-
-sub readln {
- my $l = <STDIN>;
- chomp $l;
- $l;
-}
-
-sub ask_warn {
- my ($title, @msgs) = @_;
- print "----------\n", map { "$_\n" } @_;
- print "Press enter"; readln();
-}
-
-sub ask_yesorno {
- my ($title, @msgs) = @_;
- print "----------\n", join("\n", @_);
- print " (yes/No) "; readln() =~ /y/i;
-
-}
-
-sub check_it {
- my ($i, $n) = @_;
- $i =~ /^\s*\d+\s*$/ && 1 <= $i && $i <= $n
-}
-
-sub ask_from_list {
- my ($title, @msgs) = @_;
- my $list = pop @msgs;
- print "----------\n", map { "$_\n" } @msgs;
- my $n = 0; foreach (@$list) { $n++; print "$n: $_\n"; }
- my $i;
- do {
- defined $i and print "Bad choice, try again\n";
- print "Your choice? (1/$n) ";
- $i = readln();
- } until (check_it($i, $n));
- $list->[$i - 1];
-}
-
-sub ask_many_from_list {
- my ($title, @msgs) = @_;
- my $default = pop @msgs;
- my $list = pop @msgs;
- my @defaults;
- print "----------\n", map { "$_\n" } @msgs;
- my $n = 0; foreach (@$list) {
- $n++;
- print "$n: $_\n";
- push @defaults, $n if $default->[$n - 1];
- }
- my $i;
- TRY_AGAIN:
- defined $i and print "Bad choice, try again\n";
- print "Your choice? (default ", join(',', @defaults), " enter `none' for none) ";
- $i = readln();
- my @t = split ',', $i;
- foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
-
- my @rr = (0) x @$list;
- foreach (@t) { $rr[$_ - 1] = 1; }
- @rr;
+#-######################################################################################
+#- Steps Functions
+#-######################################################################################
+sub selectLanguage {
+ my ($o, $first_time) = @_;
+ $o->SUPER::selectLanguage($first_time);
+ lang::load_console_font($o->{lang});
}
+1;
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 977adea5a..1de89e42a 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -1,53 +1,287 @@
-package interactive;
+package interactive; # $Id$
use diagnostics;
use strict;
-use common qw(:common);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :functional);
+
+#- heritate from this class and you'll get all made interactivity for same steps.
+#- for this you need to provide
+#- - ask_from_listW(o, title, messages, arrayref, default) returns one string of arrayref
+#- - ask_many_from_listW(o, title, messages, arrayref, arrayref2) returns many strings of arrayref
+#-
+#- where
+#- - o is the object
+#- - title is a string
+#- - messages is an refarray of strings
+#- - default is an optional string (default is in arrayref)
+#- - arrayref is an arrayref of strings
+#- - arrayref2 contains booleans telling the default state,
+#-
+#- ask_from_list and ask_from_list_ are wrappers around ask_from_biglist and ask_from_smalllist
+#-
+#- ask_from_list_ just translate arrayref before calling ask_from_list and untranslate the result
+#-
+#- ask_from_listW should handle differently small lists and big ones.
-1;
-sub new($$) {
+
+#-######################################################################################
+#- OO Stuff
+#-######################################################################################
+sub new($) {
my ($type) = @_;
bless {}, ref $type || $type;
}
+sub vnew {
+ my ($type, $su) = @_;
+ $su = $su eq "su";
+ require c;
+ if ($ENV{DISPLAY} && c::Xtest($ENV{DISPLAY})) {
+ if ($su) {
+ $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
+ $> and exec "kdesu", "-c", "$0 @ARGV";
+ }
+ require interactive_gtk;
+ interactive_gtk->new;
+ } else {
+ if ($su && $>) {
+ die "you must be root to run this program";
+ }
+ require 'log.pm';
+ undef *log::l;
+ *log::l = sub {}; # otherwise, it will bother us :(
+ require interactive_newt;
+ interactive_newt->new;
+ }
+}
+
+sub enter_console {}
+sub leave_console {}
+sub suspend {}
+sub resume {}
+sub end {}
+sub exit { exit($_[0]) }
+#-######################################################################################
+#- Interactive functions
+#-######################################################################################
sub ask_warn($$$) {
my ($o, $title, $message) = @_;
- ask_from_list($o, $title, $message, [ _("Ok") ]);
+ ask_from_list2($o, $title, $message, [ _("Ok") ]);
}
-sub ask_yesorno($$$) {
- my ($o, $title, $message) = @_;
- ask_from_list_($o, $title, $message, [ __("Yes"), __("No") ]) eq "Yes";
+
+sub ask_yesorno($$$;$) {
+ my ($o, $title, $message, $def) = @_;
+ ask_from_list_($o, $title, $message, [ __("Yes"), __("No") ], $def ? "Yes" : "No") eq "Yes";
}
-sub ask_okcancel($$$) {
- my ($o, $title, $message) = @_;
- ask_from_list_($o, $title, $message, [ __("Ok"), __("Cancel") ]) eq "Ok";
+
+sub ask_okcancel($$$;$) {
+ my ($o, $title, $message, $def) = @_;
+ ask_from_list_($o, $title, $message, [ __("Ok"), __("Cancel") ], $def ? "Ok" : "Cancel") eq "Ok";
+}
+
+sub ask_from_list_ {
+ my ($o, $title, $message, $l, $def) = @_;
+ ask_from_listf($o, $title, $message, sub { translate($_[0]) }, $l, $def);
+}
+
+sub ask_from_listf_ {
+ my ($o, $title, $message, $f, $l, $def) = @_;
+ ask_from_listf($o, $title, $message, sub { translate($f->(@_)) }, $l, $def);
+}
+sub ask_from_listf {
+ my ($o, $title, $message, $f, $l, $def) = @_;
+ my $def2;
+ my (@l,%l); my $i = 0; foreach (@$l) {
+ my $v = $f->($_, $i++);
+ push @l, $v;
+ $l{$v} = $_;
+ $def2 = $v if $def && $_ eq $def;
+ }
+ $def2 ||= $f->($def) if $def;
+ my $r = ask_from_list($o, $title, $message, \@l, $def2) or return;
+ $l{$r};
}
-sub ask_from_list_($$$$;$) {
+
+sub ask_from_list {
+ my ($o, $title, $message, $l, $def) = @_;
+ @$l == 0 and die 'ask_from_list: empty list';
+ @$l == 1 and return $l->[0];
+ goto &ask_from_list2;
+}
+
+sub ask_from_list2($$$$;$) {
my ($o, $title, $message, $l, $def) = @_;
+
+ @$l > 10 and $l = [ sort @$l ];
+
+ $o->ask_from_listW($title, [ deref($message) ], $l, $def || $l->[0]);
+}
+
+sub ask_from_list_with_help_ {
+ my ($o, $title, $message, $l, $help, $def) = @_;
+ @$l == 0 and die '';
+ @$l == 1 and return $l->[0];
+ goto &ask_from_list2_with_help_;
+}
+
+sub ask_from_list_with_help {
+ my ($o, $title, $message, $l, $help, $def) = @_;
+ @$l == 0 and die '';
+ @$l == 1 and return $l->[0];
+ goto &ask_from_list2_with_help;
+}
+
+#- defaults to simple ask_from_list
+sub ask_from_list_with_helpW {
+ my ($o, $title, $messages, $l, $help, $def) = @_;
+ $o->ask_from_listW($o, $title, $messages, $l, $def);
+}
+
+sub ask_from_list2_with_help_($$$$$;$) {
+ my ($o, $title, $message, $l, $help, $def) = @_;
untranslate(
- ask_from_list($o, $title, $message, [ map { translate($_) } @$l ], translate($def)),
+ ask_from_list_with_help($o, $title, $message, [ map { translate($_) } @$l ], $help, translate($def)),
@$l);
}
-sub ask_from_list($$$$;$) {
- my ($o, $title, $message, $l, $def) = @_;
- $message = ref $message ? $message : [ $message ];
+sub ask_from_list2_with_help($$$$$;$) {
+ my ($o, $title, $message, $l, $help, $def) = @_;
@$l > 10 and $l = [ sort @$l ];
- $o->ask_from_listW($title, $message, $l, $def || $l->[0]);
+ $o->ask_from_list_with_helpW($title, [ deref($message) ], $l, $help, $def || $l->[0]);
+}
+
+sub ask_from_treelistf {
+ my ($o, $title, $message, $separator, $f, $l, $def) = @_;
+ my (@l,%l); my $i = 0; foreach (@$l) {
+ my $v = $f->($_, $i++);
+ push @l, $v;
+ $l{$v} = $_;
+ }
+ my $r = ask_from_treelist($o, $title, $message, $separator, \@l, defined $def ? $f->($def) : $def) or return;
+ $l{$r};
+}
+
+sub ask_from_treelist {
+ my ($o, $title, $message, $separator, $l, $def) = @_;
+ $o->ask_from_treelistW($title, [ deref($message) ], $separator, [ sort @$l ], $def || $l->[0]);
+}
+#- defaults to simple ask_from_list
+sub ask_from_treelistW($$$$;$) {
+ my ($o, $title, $message, $separator, $l, $def) = @_;
+ $o->ask_from_listW($title, [ deref($message) ], $l, $def);
+}
+
+
+sub ask_many_from_list {
+ my ($o, $title, $message, @l) = @_;
+ @l = grep { @{$_->{list}} } @l or return '';
+ foreach my $h (@l) {
+ $h->{labels} ||= [ map { $h->{label} ? $h->{label}->($_) : $_ } @{$h->{list}} ];
+
+ if ($h->{sort}) {
+ my @places = sort { $h->{labels}[$a] cmp $h->{labels}[$b] } 0 .. $#{$h->{labels}};
+ $h->{labels} = [ map { $h->{labels}[$_] } @places ];
+ $h->{list} = [ map { $h->{list}[$_] } @places ];
+ }
+ $h->{ref} = [ map {
+ $h->{ref} ? $h->{ref}->($_) : do {
+ my $i =
+ $h->{value} ? $h->{value}->($_) :
+ $h->{values} ? member($_, @{$h->{values}}) : 0;
+ \$i;
+ };
+ } @{$h->{list}} ];
+
+ $h->{help} = $h->{help} ? [ map { $h->{help}->($_) } @{$h->{list}} ] : [];
+ $h->{icons} = $h->{icon2f} ? [ map { $h->{icon2f}->($_) } @{$h->{list}} ] : [];
+ }
+ $o->ask_many_from_listW($title, [ deref($message) ], @l) or return;
+
+ @l = map {
+ my $h = $_;
+ [ grep_index { ${$h->{ref}[$::i]} } @{$h->{list}} ];
+ } @l;
+ wantarray ? @l : $l[0];
+}
+
+sub ask_from_entry {
+ my ($o, $title, $message, $label, $def, %callback) = @_;
+
+ first ($o->ask_from_entries($title, [ deref($message) ], [ $label ], [ $def ], %callback));
+}
+
+sub ask_from_entries($$$$;$%) {
+ my ($o, $title, $message, $l, $def, %callback) = @_;
+
+ my $val = [ map { my $i = $_; \$i } @{$def || [('') x @$l]} ];
+
+ $o->ask_from_entries_ref($title, $message, $l, $val, %callback) ?
+ map { $$_ } @$val :
+ undef;
}
-sub ask_many_from_list($$$$;$) {
- my ($o, $title, $message, $l, $def) = @_;
- $message = ref $message ? $message : [ $message ];
+sub ask_from_entries_refH($$$;$%) {
+ my ($o, $title, $message, $h, %callback) = @_;
- $o->ask_many_from_listW($title, $message, $l, $def);
+ ask_from_entries_ref($o, $title, $message,
+ list2kv(@$h),
+ %callback);
}
+#- can get a hash of callback: focus_out changed and complete
+#- moreove if you pass a hash with a field list -> combo
+#- if you pass a hash with a field hidden -> emulate stty -echo
+sub ask_from_entries_ref($$$$;$%) {
+ my ($o, $title, $message, $l, $val, %callback) = @_;
+
+ return unless @$l;
+
+ $title = [ deref($title) ];
+ $title->[2] ||= _("Cancel") unless $title->[1];
+ $title->[1] ||= _("Ok");
+
+ my $val_hash = [ map {
+ if ((ref $_) eq "SCALAR") {
+ { val => $_ }
+ } else {
+ if (@{$_->{list} || []} > 1) {
+ add2hash_($_, { not_edit => 1, type => 'list' });
+ ${$_->{val}} = $_->{list}[0] if $_->{not_edit} && !member(${$_->{val}}, @{$_->{list}});
+ } elsif ($_->{type} eq 'range') {
+ $_->{min} <= $_->{max} or die "bad range min $_->{min} > max $_->{max} (called from " . join(':', caller()) . ")";
+ ${$_->{val}} = max($_->{min}, min(${$_->{val}}, $_->{max}));
+ }
+ $_;
+ }
+ } @$val ];
+ $o->ask_from_entries_refW($title, [ deref($message) ], $l, $val_hash, %callback)
+}
+sub wait_message($$$;$) {
+ my ($o, $title, $message, $temp) = @_;
+
+ my $w = $o->wait_messageW($title, [ _("Please wait"), deref($message) ]);
+ push @tempory::objects, $w if $temp;
+ my $b = before_leaving { $o->wait_message_endW($w) };
+
+ #- enable access through set
+ common::add_f4before_leaving(sub { $o->wait_message_nextW([ deref($_[1]) ], $w) }, $b, 'set');
+ $b;
+}
+
+sub kill {}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 935766470..f4209c073 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -1,4 +1,4 @@
-package interactive_gtk;
+package interactive_gtk; # $Id$
use diagnostics;
use strict;
@@ -7,31 +7,391 @@ use vars qw(@ISA);
@ISA = qw(interactive);
use interactive;
-use common qw(:common);
+use common qw(:common :functional);
use my_gtk qw(:helpers :wrappers);
1;
+sub new {
+ $::windowheight ||= 400 if $::isStandalone;
+ goto &interactive::new;
+}
+sub enter_console { my ($o) = @_; $o->{suspended} = common::setVirtual(1) }
+sub leave_console { my ($o) = @_; common::setVirtual(delete $o->{suspended}) }
+
+sub suspend {}
+sub resume {}
+
+sub exit {
+ gtkset_mousecursor_normal(); #- for restoring a normal in any case on standalone
+ my_gtk::flush();
+ c::_exit($_[0]) #- workaround
+}
+
sub ask_from_listW {
my ($o, $title, $messages, $l, $def) = @_;
+ ask_from_list_with_helpW($o, $title, $messages, $l, undef, $def);
+}
+
+sub ask_from_list_with_helpW {
+ my ($o, $title, $messages, $l, $help, $def) = @_;
+ my $r;
- if (@$l < 5 && sum(map { length $_ } @$l) < 70) {
- my $w = my_gtk->new($title);
+ my $w = my_gtk->new(first(deref($title)), %$o);
+#gtkset_usize(createScrolledWindow($tree), 300, min(350, $::windowheight - 60)),
+ $w->{retval} = $def || $l->[0]; #- nearly especially for the X test case (see timeout in Xconfigurator.pm)
+ $w->{rwindow}->set_policy(0, 0, 1) if $::isWizard;
+ if (@$l < 5 or $::isWizard) {
+ my $defW;
+ my $tips = new Gtk::Tooltips;
+ my $g = sub { $w->{retval} = $_[1]; };
my $f = sub { $w->{retval} = $_[1]; Gtk->main_quit };
+ my $b;
+ $w->sync;
+ $::isWizard and my $pixmap = new Gtk::Pixmap( gtkcreate_xpm($w->{window}, $::wizard_xpm)) || die "pixmap $! not found.";
+ if ($::isWizard) {
+ gtkset_usize($w->{rwindow}, 500, 400);
+ }
gtkadd($w->{window},
- gtkpack(create_box_with_title($o, @$messages),
- gtkadd(create_hbox(),
- map {
- my $b = new Gtk::Button($_);
- $b->signal_connect(clicked => [ $f, $_ ]);
- $_ eq $def and $def = $b;
- $b;
- } @$l),
- ),
- );
- $def->grab_focus if $def;
- $w->main;
+ gtkpack2_(create_box_with_title($w, @$messages),
+ 1,
+ gtkpack3( $::isWizard,
+ new Gtk::HBox(0,0),
+ $::isWizard ? ($pixmap, gtkset_usize(new Gtk::VBox(0,0),30, 0)) : (),
+ gtkpack2__( $::isWizard ? new Gtk::VBox(0,0): ( @$l < 3 && sum(map { length $_ } @$l) < 60 ? create_hbox() : create_vbox()),
+ $::isWizard ? gtkset_usize(new Gtk::VBox(0,0), 0, 30) : (),
+ map {
+ $::isWizard ? $b = new Gtk::RadioButton($b ? ($_, $b) : $_) : ($b = new Gtk::Button($_));
+ $tips->set_tip($b, $help->{$_}) if $help && $help->{$_};
+ $_ eq $def and $defW = $b;
+ $b->signal_connect(clicked => [ $::isWizard ? $g : $f, $_ ]);
+ $b;
+ } @$l, )),
+ 0, new Gtk::HSeparator,
+ $::isWizard ? (0, $w->create_okcancel()) : (),
+ ),
+ );
+
+ $defW->grab_focus if $defW;
+ $r = $w->main;
} else {
- my_gtk::ask_from_list($title, $messages, $l, $def);
+ #- use ask_from_list_with_help only when needed, as key bindings are
+ #- dropped by List (CList does not seems to accepts Tooltips).
+ $help ? $w->_ask_from_list_with_help($title, $messages, $l, $help, $def) :
+ $w->_ask_from_list($title, $messages, $l, $def);
+ $r = $w->main;
+ }
+ $r or $::isWizard ? 0 : die "ask_from_list cancel";
+}
+
+sub ask_from_treelistW {
+ my ($o, $title, $messages, $separator, $l, $def) = @_;
+ my $sep = quotemeta $separator;
+ my $w = my_gtk->new($title);
+ my $tree = Gtk::CTree->new(1, 0);
+
+ my %wtree;
+ my $parent; $parent = sub {
+ if (my $w = $wtree{"$_[0]$separator"}) { return $w }
+ my $s;
+ foreach (split $sep, $_[0]) {
+ $wtree{"$s$_$separator"} ||=
+ $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, 0);
+ $s .= "$_$separator";
+ }
+ $wtree{$s};
+ };
+ my ($root, $leaf, $wdef, $ndef);
+ foreach (@$l) {
+ ($root, $leaf) = /(.*)$sep(.+)/ or ($root, $leaf) = ('', $_);
+ my $node = $tree->insert_node($parent->($root), undef, [$leaf], 5, (undef) x 4, 1, 0);
+
+ if ($def eq $_) {
+ $wdef = $node;
+ my $s; $tree->expand($wtree{$s .= "$_$separator"}) foreach split $sep, $root;
+ foreach my $nb (1 .. @$l) {
+ if ($tree->node_nth($nb) == $node) {
+ $tree->set_focus_row($ndef = $nb);
+ last;
+ }
+ }
+ }
+ }
+ undef %wtree;
+
+ my $curr;
+ my $leave = sub {
+ $curr->row->is_leaf or return;
+ my @l; for (; $curr; $curr = $curr->row->parent) {
+ unshift @l, first $tree->node_get_pixtext($curr, 0);
+ }
+ $w->{retval} = join $separator, @l;
+ Gtk->main_quit;
+ };
+ $w->{ok_clicked} = $leave;
+ $w->{cancel_clicked} = sub { $w->destroy; die "ask_from_list cancel" }; #- make sure windows doesn't live any more.
+ gtkadd($w->{window},
+ gtkpack($w->create_box_with_title(@$messages),
+ gtkpack_(new Gtk::VBox(0,7),
+ 1, gtkset_usize(createScrolledWindow($tree), 300, min(350, $::windowheight - 60)),
+ 0, $w->create_okcancel)));
+ $tree->set_column_auto_resize(0, 1);
+ $tree->set_selection_mode('browse');
+ $tree->signal_connect(tree_select_row => sub { $curr = $_[1]; });
+ $tree->signal_connect(button_press_event => sub { &$leave if $_[1]{type} =~ /^2/ });
+ $tree->signal_connect(key_press_event => sub {
+ my ($w, $e) = @_;
+ my $c = chr($e->{keyval} & 0xff);
+ $curr or return;
+ if ($e->{keyval} >= 0x100 ? $c eq "\r" || $c eq "\x8d" : $c eq ' ') {
+ if ($curr->row->is_leaf) { &$leave }
+ else { $tree->toggle_expansion($curr) }
+ }
+ 1;
+ });
+
+ $tree->grab_focus;
+ $tree->set_row_height($tree->style->font->ascent + $tree->style->font->descent + 1);
+ $w->{rwindow}->show;
+
+ if ($wdef) {
+ $tree->select($wdef);
+ $tree->node_moveto($wdef, 0, 0.5, 0);
+ }
+
+
+ $w->main or die "ask_from_list cancel";
+}
+
+sub ask_many_from_listW {
+ my ($o, $title, $messages, @l) = @_;
+ my $w = my_gtk->new('', %$o);
+ $w->sync; # for XPM's creation
+
+ my $tips = new Gtk::Tooltips;
+ my @boxes; @boxes = map {
+ my $l = $_;
+ my $box = gtkpack(new Gtk::VBox(0, @{$l->{icons}} ? 10 : 0),
+ map_index {
+ my $i = $::i;
+
+ my $o = Gtk::CheckButton->new($_);
+ $tips->set_tip($o, $l->{help}[$i]) if $l->{help}[$i];
+ $o->set_active(${$l->{ref}[$i]});
+ $o->signal_connect(clicked => sub {
+ my $v = invbool($l->{ref}[$i]);
+ $boxes[$l->{shadow}]->set_sensitive(!$v) if exists $l->{shadow};
+ });
+
+ my $f = $l->{icons}[$i];
+ -e $f ? gtkpack_(new Gtk::HBox(0,10), 0, new Gtk::Pixmap(gtkcreate_xpm($w->{window}, $f)), 1, $o) : $o;
+ } @{$l->{labels}});
+ @{$l->{labels}} > (@{$l->{icons}} ? 5 : 11) ? gtkset_usize(createScrolledWindow($box), @{$l->{icons}} ? 350 : 0, $::windowheight - 200) : $box;
+ } @l;
+ gtkadd($w->{window},
+ gtkpack_(create_box_with_title($w, @$messages),
+ (map {; 1, $_, 0, '' } @boxes),
+ 0, $w->create_okcancel,
+ )
+ );
+ $w->{ok}->grab_focus;
+ $w->main;
+}
+
+sub ask_from_entries_refW {
+ my ($o, $title, $messages, $l, $val, %hcallback) = @_;
+ my ($title_, @okcancel) = deref($title);
+ my $ignore = 0; #-to handle recursivity
+
+ my $w = my_gtk->new($title_, %$o);
+ $w->sync; # for XPM's creation
+
+ my $set_icon = sub {
+ my ($i, $button) = @_;
+ gtkdestroy($i->{icon});
+ my $f = $i->{icon2f}->(${$i->{val}});
+ $i->{icon} = -e $f ?
+ new Gtk::Pixmap(gtkcreate_xpm($w->{window}, $f)) :
+ new Gtk::Label(translate(${$i->{val}}));
+ $button->add($i->{icon});
+ $i->{icon}->show;
+ };
+
+ #-the widgets
+ my @widgets = map {
+ my $i = $_;
+
+ $i->{type} = "iconlist" if $i->{type} eq "list" && $i->{not_edit} && $i->{icon2f};
+
+ if ($i->{type} eq "list") {
+ my $w = new Gtk::Combo;
+ $w->set_use_arrows_always(1);
+ $w->entry->set_editable(!$i->{not_edit});
+ $w->set_popdown_strings(@{$i->{list}});
+ $w->disable_activate;
+ $w;
+ } elsif ($i->{type} eq "iconlist") {
+ my $w = new Gtk::Button;
+ $w->signal_connect(clicked => sub {
+ ${$i->{val}} = next_val_in_array(${$i->{val}}, $i->{list});
+ $set_icon->($i, $w);
+ });
+ $set_icon->($i, $w);
+ gtkpack_(new Gtk::HBox(0,10), 1, new Gtk::HBox(0,0), 0, $w, 1, new Gtk::HBox(0,0), );
+ } elsif ($i->{type} eq "bool") {
+ my $w = Gtk::CheckButton->new($i->{text});
+ $w->set_active(${$i->{val}});
+ $w->signal_connect(clicked => sub { $ignore or invbool \${$i->{val}} });
+ $w;
+ } elsif ($i->{type} eq "range") {
+ my $adj = create_adjustment(${$i->{val}}, $i->{min}, $i->{max});
+ $adj->signal_connect(value_changed => sub { ${$i->{val}} = $adj->get_value });
+ my $w = new Gtk::HScale($adj);
+ $w->set_digits(0);
+ $w;
+ } else {
+ new Gtk::Entry;
+ }
+ } @{$val};
+ my $ok = $w->create_okcancel(@okcancel);
+
+ sub widget {
+ my ($w, $ref) = @_;
+ ($ref->{type} eq "list" && @{$ref->{list}}) ? $w->entry : $w
+ }
+ my @updates = mapn {
+ my ($w, $ref) = @_;
+ sub {
+ $ref->{type} =~ /bool|range|iconlist/ and return;
+ ${$ref->{val}} = widget($w, $ref)->get_text;
+ };
+ } \@widgets, $val;
+
+ my @updates_inv = mapn {
+ my ($w, $ref) = @_;
+ sub {
+ $ref->{type} =~ /iconlist/ and return;
+ $ref->{type} eq "bool" ?
+ $w->set_active(${$ref->{val}}) :
+ widget($w, $ref)->set_text(${$ref->{val}})
+ };
+ } \@widgets, $val;
+
+
+ for (my $i = 0; $i < @$l; $i++) {
+ my $ind = $i; #-cos lexical bindings pb !!
+ my $widget = widget($widgets[$i], $val->[$i]);
+ my $changed_callback = sub {
+ return if $ignore; #-handle recursive deadlock
+ &{$updates[$ind]};
+ if ($hcallback{changed}) {
+ &{$hcallback{changed}}($ind);
+ #update all the value
+ $ignore = 1;
+ &$_ foreach @updates_inv;
+ $ignore = 0;
+ };
+ };
+ my $may_go_to_next = sub {
+ my ($W, $e) = @_;
+ if (($e->{keyval} & 0x7f) == 0xd) {
+ $W->signal_emit_stop("key_press_event");
+ if ($ind == $#$l) {
+ @$l == 1 ? $w->{ok}->clicked : $w->{ok}->grab_focus;
+ } else {
+ widget($widgets[$ind+1],$val->[$ind+1])->grab_focus;
+ }
+ }
+ };
+
+ if ($hcallback{focus_out}) {
+ my $focusout_callback = sub {
+ return if $ignore;
+ &{$hcallback{focus_out}}($ind);
+ #update all the value
+ $ignore = 1;
+ &$_ foreach @updates_inv;
+ $ignore = 0;
+ };
+ $widget->signal_connect(focus_out_event => $focusout_callback);
+ }
+ if (ref $widget eq "Gtk::HScale") {
+ $widget->signal_connect(key_press_event => $may_go_to_next);
+ }
+ if (ref $widget eq "Gtk::Entry") {
+ $widget->signal_connect(changed => $changed_callback);
+ $widget->signal_connect(key_press_event => $may_go_to_next);
+ $widget->set_text(${$val->[$i]{val}});
+ $widget->set_visibility(0) if $val->[$i]{hidden};
+ }
+ &{$updates[$i]};
+ }
+
+ my @entry_list = mapn { [($_[0], $_[1])]} $l, \@widgets;
+
+ gtkadd($w->{window},
+ gtkpack(
+ create_box_with_title($w, @$messages),
+ create_packtable({}, @entry_list),
+ $ok
+ ));
+ widget($widgets[0],$val->[0])->grab_focus();
+ if ($hcallback{complete}) {
+ my $callback = sub {
+ my ($error, $focus) = &{$hcallback{complete}};
+ #-update all the value
+ $ignore = 1;
+ foreach (@updates_inv) { &{$_};}
+ $ignore = 0;
+ if ($error) {
+ $focus ||= 0;
+ widget($widgets[$focus], $val->[$focus])->grab_focus();
+ } else {
+ return 1;
+ }
+ };
+ $w->main($callback);
+ } else {
+ $w->main();
+ }
+}
+
+
+sub wait_messageW($$$) {
+ my ($o, $title, $messages) = @_;
+
+ my $w = my_gtk->new($title, %$o, grab => 1);
+ gtkadd($w->{window}, my $hbox = new Gtk::HBox(0,0));
+ $hbox->pack_start(my $box = new Gtk::VBox(0,0), 1, 1, 10);
+ $box->pack_start($_, 1, 1, 4) foreach my @l = map { new Gtk::Label($_) } @$messages;
+
+ ($w->{wait_messageW} = $l[$#l])->signal_connect(expose_event => sub { $w->{displayed} = 1 });
+ $w->{rwindow}->set_position('center') if $::isStandalone;
+ $w->{window}->show_all;
+ $w->sync until $w->{displayed};
+ $w;
+}
+sub wait_message_nextW {
+ my ($o, $messages, $w) = @_;
+ my $msg = join "\n", @$messages;
+ return if $msg eq $w->{wait_messageW}->get; #- needed otherwise no expose_event :(
+ $w->{displayed} = 0;
+ $w->{wait_messageW}->set($msg);
+ $w->flush until $w->{displayed};
+}
+sub wait_message_endW {
+ my ($o, $w) = @_;
+ $w->destroy;
+}
+
+sub kill {
+ my ($o) = @_;
+ $o->{before_killing} ||= 0;
+
+ while (my $e = shift @tempory::objects) { $e->destroy }
+ while (@interactive::objects > $o->{before_killing}) {
+ my $w = pop @interactive::objects;
+ $w->destroy;
}
+ $o->{before_killing} = @interactive::objects;
}
diff --git a/perl-install/interactive_newt.pm b/perl-install/interactive_newt.pm
index b6d5823a3..4c4c0e65e 100644
--- a/perl-install/interactive_newt.pm
+++ b/perl-install/interactive_newt.pm
@@ -1,4 +1,4 @@
-package interactive_newt;
+package interactive_newt; # $Id$
use diagnostics;
use strict;
@@ -8,221 +8,253 @@ use vars qw(@ISA);
use interactive;
use common qw(:common :functional);
-use Term::Newt;
-
-my $n = Term::Newt->new;
-$n->init;
-$n->cls;
-
-#sub ask_from_entryW {
-# my ($o, $title, $messages, $def) = @_;
-# my $w = my_gtk->new($title, %$o);
-# $w->_ask_from_entry(@$messages);
-# $w->main;
-#}
+use log;
+use Newt::Newt; #- !! provides Newt and not Newt::Newt
+
+my $width = 80;
+my $height = 25;
+my @wait_messages;
+
+sub new() {
+ Newt::Init;
+ Newt::Cls;
+ Newt::SetSuspendCallback;
+ open STDERR,">/dev/null" if $::isStandalone;
+ bless {}, $_[0];
+}
+
+sub enter_console { Newt::Suspend }
+sub leave_console { Newt::Resume }
+sub suspend { Newt::Suspend }
+sub resume { Newt::Resume }
+sub end() { Newt::Finished }
+sub exit() { end; exit($_[0]) }
+END { end() }
+
+sub myTextbox {
+ my @l = map { split "\n" } @_;
+ my $mess = Newt::Component::Textbox(1, 0, my $w = max(map { length } @l) + 1, my $h = @l, 1 << 6);
+ $mess->TextboxSetText(join("\n", @_));
+ $mess, $w + 1, $h;
+}
+
+sub separator($$) {
+ my $blank = Newt::Component::Form(\undef, '', 0);
+ $blank->FormSetWidth ($_[0]);
+ $blank->FormSetHeight($_[1]);
+ $blank;
+}
+sub checkval($) { $_[0] && $_[0] ne ' ' ? '*' : ' ' }
+
sub ask_from_listW {
my ($o, $title_, $messages, $l, $def) = @_;
my ($title, @okcancel) = ref $title_ ? @$title_ : ($title_, _("Ok"), _("Cancel"));
+
my $mesg = join("\n", @$messages);
+ my $len = 0; $len += length($_) foreach @$l;
if (@$l == 1) {
- $n->win_message($title, @$l, $mesg);
+ Newt::WinMessage($title, @$l, $mesg);
$l->[0];
- } elsif (@$l == 2) {
- $l->[$n->win_choice($title, @$l, $mesg) - 1];
- } elsif (@$l == 3) {
- $l->[$n->win_ternary($title, @$l, $mesg) - 1];
+#- because newt will not try to remove window if bigger than screen !
+ } elsif (@$l == 2 && $len < 64) {
+ $l->[Newt::WinChoice($title, @$l, $mesg) - 1];
+#- because newt will not try to remove window if bigger than screen !
+ } elsif (@$l == 3 && $len < 64) {
+ $l->[Newt::WinTernary($title, @$l, $mesg) - 1];
} else {
+ my $special = !@okcancel;
+ if ($special) {
+ $l = [ @$l ];
+ @okcancel = pop @$l;
+ }
my $i; map_index { $i = $::i if $def eq $_ } @$l;
- print STDERR "($i)\n";
- my ($r, $e) = $n->newtWinMenu($title, $mesg, 40, 5, 5, 8, $l, $i, @okcancel);
- return if $r > 1;
- $l->[$e];
+ my ($r, $e) = Newt::WinMenu($title, $mesg, 40, 5, 5, 8, $l, $i, @okcancel);
+ $r > 1 and die "ask_from_list cancel";
+ if ($special) {
+ $r ? $okcancel[0] : $l->[$e];
+ } else {
+ $l->[$e];
+ }
}
}
-#sub ask_many_from_list_refW($$$$$) {
-# my ($o, $title, $messages, $list, $val) = @_;
-# my $n = 0;
-# my $w = my_gtk->new('', %$o);
-# my $box = gtkpack(new Gtk::VBox(0,0),
-# map {
-# my $nn = $n++;
-# my $o = Gtk::CheckButton->new($_);
-# $o->set_active(${$val->[$nn]});
-# $o->signal_connect(clicked => sub { invbool \${$val->[$nn]} });
-# $o;
-# } @$list);
-# gtkadd($w->{window},
-# gtkpack_(create_box_with_title($w, @$messages),
-# 1, @$list > 11 ? gtkset_usize(createScrolledWindow($box), 0, 250) : $box,
-# 0, $w->create_okcancel,
-# )
-# );
-# $w->{ok}->grab_focus;
-# $w->main && $val;
-#}
-#
-#
-#sub ask_from_entries_refW {
-# my ($o, $title, $messages, $l, $val, %hcallback) = @_;
-# my ($title_, @okcancel) = ref $title ? @$title : $title;
-# my $num_fields = @{$l};
-# my $ignore = 0; #-to handle recursivity
-#
-# my $w = my_gtk->new($title_, %$o);
-# #-the widgets
-# my @widgets = map {
-# if ($_->{type} eq "list") {
-# my $w = new Gtk::Combo;
-# $w->set_use_arrows_always(1);
-# $w->entry->set_editable(!$_->{not_edit});
-# $w->set_popdown_strings(@{$_->{list}});
-# $w->disable_activate;
-# $_->{val} ||= $_->{list}[0];
-# $w;
-# } elsif ($_->{type} eq "bool") {
-# my $w = Gtk::CheckButton->new($_->{text});
-# $w->set_active(${$_->{val}});
-# my $i = $_; $w->signal_connect(clicked => sub { $ignore or invbool \${$i->{val}} });
-# $w;
-# } else {
-# new Gtk::Entry;
-# }
-# } @{$val};
-# my $ok = $w->create_okcancel(@okcancel);
-#
-# sub widget {
-# my ($w, $ref) = @_;
-# ($ref->{type} eq "list" && @{$ref->{list}}) ? $w->entry : $w
-# }
-# my @updates = mapn {
-# my ($w, $ref) = @_;
-# sub {
-# $ref->{type} eq "bool" and return;
-# ${$ref->{val}} = widget($w, $ref)->get_text;
-# };
-# } \@widgets, $val;
-#
-# my @updates_inv = mapn {
-# my ($w, $ref) = @_;
-# sub {
-# $ref->{type} eq "bool" ?
-# $w->set_active(${$ref->{val}}) :
-# widget($w, $ref)->set_text(${$ref->{val}})
-# };
-# } \@widgets, $val;
-#
-#
-# for (my $i = 0; $i < $num_fields; $i++) {
-# my $ind = $i; #-cos lexical bindings pb !!
-# my $widget = widget($widgets[$i], $val->[$i]);
-# my $changed_callback = sub {
-# return if $ignore; #-handle recursive deadlock
-# &{$updates[$ind]};
-# if ($hcallback{changed}) {
-# &{$hcallback{changed}}($ind);
-# #update all the value
-# $ignore = 1;
-# &$_ foreach @updates_inv;
-# $ignore = 0;
-# };
-# };
-# if ($hcallback{focus_out}) {
-# my $focusout_callback = sub {
-# return if $ignore;
-# &{$hcallback{focus_out}}($ind);
-# #update all the value
-# $ignore = 1;
-# &$_ foreach @updates_inv;
-# $ignore = 0;
-# };
-# $widget->signal_connect(focus_out_event => $focusout_callback);
-# }
-# if (ref $widget eq "Gtk::Entry") {
-# $widget->signal_connect(changed => $changed_callback);
-# my $go_to_next = sub {
-# if ($ind == ($num_fields -1)) {
-# $w->{ok}->grab_focus();
-# } else {
-# widget($widgets[$ind+1],$val->[$ind+1])->grab_focus();
-# }
-# };
-# $widget->signal_connect(activate => $go_to_next);
-# $widget->signal_connect(key_press_event => sub {
-# my ($w, $e) = @_;
-# #-don't know why it works, i believe that
-# #-i must say before &$go_to_next, but with it doen't work HACK!
-# $w->signal_emit_stop("key_press_event") if chr($e->{keyval}) eq "\x8d";
-# });
-# $widget->set_text(${$val->[$i]{val}}) if ${$val->[$i]{val}};
-# $widget->set_visibility(0) if $val->[$i]{hidden};
-# }
-# &{$updates[$i]};
-# }
-#
-# my @entry_list = mapn { [($_[0], $_[1])]} $l, \@widgets;
-#
-# gtkadd($w->{window},
-# gtkpack(
-# create_box_with_title($w, @$messages),
-# create_packtable({}, @entry_list),
-# $ok
-# ));
-# widget($widgets[0],$val->[0])->grab_focus();
-# if ($hcallback{complete}) {
-# my $callback = sub {
-# my ($error, $focus) = &{$hcallback{complete}};
-# #-update all the value
-# $ignore = 1;
-# foreach (@updates_inv) { &{$_};}
-# $ignore = 0;
-# if ($error) {
-# $focus ||= 0;
-# widget($widgets[$focus], $val->[$focus])->grab_focus();
-# } else {
-# return 1;
-# }
-# };
-# #$w->{ok}->signal_connect(clicked => $callback)
-# $w->main($callback);
-# } else {
-# $w->main();
-# }
-#}
-#
-#
-#sub wait_messageW($$$) {
-# my ($o, $title, $message) = @_;
-#
-# my $w = my_gtk->new($title, %$o, grab => 1);
-# my $W = pop @$message;
-# gtkadd($w->{window},
-# gtkpack(new Gtk::VBox(0,0),
-# @$message,
-# $w->{wait_messageW} = new Gtk::Label($W)));
-# $w->sync;
-# $w;
-#}
-#sub wait_message_nextW {
-# my ($o, $message, $w) = @_;
-# $w->{wait_messageW}->set($message);
-# $w->sync;
-#}
-#sub wait_message_endW {
-# my ($o, $w) = @_;
-# $w->destroy;
-#}
-#
-#sub kill {
-# my ($o) = @_;
-# $o->{before_killing} ||= 0;
-# while (@interactive::objects > $o->{before_killing}) {
-# my $w = pop @interactive::objects;
-# $w->destroy;
-# }
-# @my_gtk::grabbed = ();
-# $o->{before_killing} = @interactive::objects;
-#}
+sub ask_many_from_listW {
+ my ($o, $title, $messages, $l) = @_;
+ my ($list, $val) = ($l->{labels}, $l->{ref});
+ my $height = min(int @$list, 18);
+
+ my $sb = Newt::Component::VerticalScrollbar(-1, -1, $height, 9, 10);
+ my $checklist = $sb->Form('', 0);
+ $checklist->FormSetHeight($height);
+ $checklist->FormSetBackground(9);
+
+ my @l = map_index {
+ Newt::Component::Checkbox(1, $::i + 1, $_, checkval(${$val->[$::i]} ||= ''), " *");
+ } @$list;
+ $checklist->FormAddComponent($_) foreach @l;
+
+ my $listg = Newt::Grid::HCloseStacked($checklist, $height < @$list ? (separator(1, $height), $sb) : ());
+
+ my ($buttons, $ok, $cancel) = Newt::Grid::ButtonBar(_("Ok"), _("Cancel"));
+
+ my $form = Newt::Component::Form(\undef, '', 0);
+ my $window = Newt::Grid::GridBasicWindow(first(myTextbox(@$messages)), $listg, $buttons);
+ $window->GridWrappedWindow($title);
+ $window->GridAddComponentsToForm($form, 1);
+ my $r = $form->RunForm;
+
+ $form->FormDestroy;
+ Newt::PopWindow;
+
+ $$r == $$cancel and return;
+
+ mapn {
+ my ($a, $b) = @_;
+ $$a = $b->CheckboxGetValue == ord '*';
+ } $val, \@l;
+
+ 1;
+}
+
+
+sub ask_from_entries_refW {
+ my ($o, $title, $messages, $l, $val, %hcallback) = @_;
+ my ($title_, @okcancel) = deref($title);
+ my $ignore; #-to handle recursivity
+ my $old_focus = -2;
+
+ #-the widgets
+ my @widgets = map {
+#- $_->{type} = "entry" if $_->{type} eq "list" && !$_->{not_edit};
+ ${$_->{val}} ||= '';
+ if ($_->{type} eq "list") {
+ my $w = Newt::Component::Listbox(-1, -1, 1, 0);
+ $w->ListboxSetWidth(20);
+ $w->ListboxAddEntry($_) foreach @{$_->{list}};
+ $w;
+ } elsif ($_->{type} eq "bool") {
+ Newt::Component::Checkbox(-1, -1, $_->{text} || '', checkval(${$_->{val}}), " *");
+ } else {
+ Newt::Component::Entry(-1, -1, '', 20, ($_->{hidden} && 1 << 1) | 1 << 2);
+ }
+ } @$val;
+
+ my @updates = mapn {
+ my ($w, $ref) = @_;
+ sub {
+ ${$ref->{val}} =
+ $ref->{type} eq "bool" ?
+ $w->CheckboxGetValue == ord '*' :
+ $ref->{type} eq "list" ?
+ $w->ListboxGetCurrent :
+ $w->EntryGetValue;
+ };
+ } \@widgets, $val;
+
+ my @updates_inv = mapn {
+ my ($w, $ref) = @_;
+ sub {
+ my $val = ${$ref->{val}};
+ $ignore = 1;
+ if ($ref->{type} eq "bool") {
+ $w->CheckboxSetValue(checkval($val));
+ } elsif ($ref->{type} eq "list") {
+ map_index {
+ $w->ListboxSetCurrent($::i) if $val eq $_;
+ } @{$ref->{list}};
+ } else {
+ $w->EntrySet($val, 1);
+ }
+ $ignore = 0;
+ };
+ } \@widgets, $val;
+
+ &$_ foreach @updates_inv;
+
+ #- !! callbacks must be kept in a list otherwise perl will free them !!
+ #- (better handling of addCallback needed)
+ my @callbacks = map_index {
+ my $ind = $::i;
+ sub {
+ return if $ignore; #-handle recursive deadlock
+ return $old_focus++ if $old_focus == -2; #- handle special first case
+
+ &$_ foreach @updates;
+
+ #- TODO: this is very rough :(
+ if ($old_focus == $ind) {
+ $hcallback{changed}->($ind) if $hcallback{changed};
+ } else {
+ $hcallback{focus_out}->($ind) if $hcallback{focus_out};
+ }
+ &$_ foreach @updates_inv;
+ $old_focus = $ind;
+ };
+ } @widgets;
+ map_index { $_->addCallback($callbacks[$::i]) } @widgets;
+
+ my $grid = Newt::Grid::CreateGrid(3, int @$l);
+ map_index {
+ $grid->GridSetField(0, $::i, 1, ${Newt::Component::Label(-1, -1, $_)}, 0, 0, 1, 0, 1, 0);
+ $grid->GridSetField(1, $::i, 1, ${$widgets[$::i]}, 0, 0, 0, 0, 1, 0);
+ } @$l;
+
+ my ($buttons, $ok, $cancel) = Newt::Grid::ButtonBar(@okcancel);
+
+ my $form = Newt::Component::Form(\undef, '', 0) or die;
+ my $window = Newt::Grid::GridBasicWindow(first(myTextbox(@$messages)), $grid, $buttons);
+ $window->GridWrappedWindow($title_);
+ $window->GridAddComponentsToForm($form, 1);
+
+ run:
+ my $r = $form->RunForm;
+ &$_ foreach @updates;
+
+ if ($$r != $$cancel && $hcallback{complete}) {
+ my ($error, $focus) = $hcallback{complete}->();
+ #-update all the value
+ &$_ foreach @updates_inv;
+ goto run if $error;
+ }
+ $form->FormDestroy;
+ Newt::PopWindow;
+ $$r != $$cancel;
+}
+
+
+sub waitbox($$) {
+ my ($title, $messages) = @_;
+ my ($t, $w, $h) = myTextbox(@$messages);
+ my $f = Newt::Component::Form(\undef, '', 0);
+ Newt::CenteredWindow($w, $h, $title);
+ $f->FormAddComponent($t);
+ $f->DrawForm;
+ Newt::Refresh;
+ $f->FormDestroy;
+ push @wait_messages, $f;
+ $f;
+}
+
+
+sub wait_messageW($$$) {
+ my ($o, $title, $messages) = @_;
+ { form => waitbox($title, $messages), title => $title };
+}
+
+sub wait_message_nextW {
+ my ($o, $messages, $w) = @_;
+ $o->wait_message_endW($w);
+ $o->wait_messageW($w->{title}, $messages);
+}
+sub wait_message_endW {
+ my ($o, $w) = @_;
+ log::l("interactive_newt does not handle none stacked wait-messages") if $w->{form} != pop @wait_messages;
+ Newt::PopWindow;
+}
+
+sub kill {
+}
+
1;
diff --git a/perl-install/interactive_stdio.pm b/perl-install/interactive_stdio.pm
index 40dcdbb7c..284194a11 100644
--- a/perl-install/interactive_stdio.pm
+++ b/perl-install/interactive_stdio.pm
@@ -1,4 +1,4 @@
-package interactive_stdio;
+package interactive_stdio; # $Id$
use diagnostics;
use strict;
@@ -9,7 +9,7 @@ use vars qw(@ISA);
use interactive;
use common qw(:common);
-1;
+$| = 1;
sub readln {
my $l = <STDIN>;
@@ -19,19 +19,20 @@ sub readln {
sub check_it {
my ($i, $n) = @_;
- $i =~ /^\s*\d+\s*$/ && 1 <= $i && $i <= $n
+ $i =~ /^\s*\d+\s*$/ && 1 <= $i && $i <= $n
}
sub ask_from_listW {
- my ($o, $title, $messages, $list, $def) = @_;
- my $i;
+ my ($o, $title_, $messages, $list, $def) = @_;
+ my ($title, @okcancel) = ref $title_ ? @$title_ : ($title_, _("Ok"), _("Cancel"));
print map { "$_\n" } @$messages;
+ my $i;
if (@$list < 10 && sum(map { length $_ } @$list) < 50) {
my @l;
do {
if (defined $i) {
- @l ? print _("Ambiguity (%s) be more precise\n", join(", ", @l)) :
+ @l ? print _("Ambiguity (%s), be more precise\n", join(", ", @l)) :
print _("Bad choice, try again\n");
}
@$list == 1 ? print @$list :
@@ -41,10 +42,10 @@ sub ask_from_listW {
} until (@l == 1);
$l[0];
} else {
- my $n = 0; foreach (@$list) {
+ my $n = 0; foreach (@$list) {
$n++;
$def eq $_ and $def = $n;
- print "$n: $_\n";
+ print "$n: $_\n";
}
do {
defined $i and print _("Bad choice, try again\n");
@@ -56,13 +57,14 @@ sub ask_from_listW {
}
sub ask_many_from_listW {
- my ($o, $title, $messages, $list, $default) = @_;
+ my ($o, $title, $messages, $l) = @_;
+ my ($list, $val) = ($l->{labels}, $l->{ref});
my @defaults;
print map { "$_\n" } @$messages;
- my $n = 0; foreach (@$list) {
- $n++;
- print "$n: $_\n";
- push @defaults, $n if $default->[$n - 1];
+ my $n = 0; foreach (@$list) {
+ $n++;
+ print "$n: $_\n";
+ push @defaults, $n if ${$val->[$n - 1]};
}
my $i;
TRY_AGAIN:
@@ -70,11 +72,26 @@ sub ask_many_from_listW {
print _("Your choice? (default %s enter `none' for none) ", join(',', @defaults));
$i = readln();
my @t = split ',', $i;
- foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
+ if ($i =~ /^none$/i) {
+ @t = ();
+ } else {
+ foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
+ }
- my @rr = (0) x @$list;
- $rr[$_ - 1] = 1 foreach @t;
- @rr;
+ $$_ = 0 foreach @$val;
+ ${$val->[$_ - 1]} = 1 foreach @t;
+ $val;
}
+sub wait_messageW {
+ my ($o, $title, $message) = @_;
+ print join "\n", @$message;
+}
+sub wait_message_nextW {
+ my $m = join "\n", @{$_[1]};
+ print "\r$m", ' ' x (60 - length $m);
+}
+sub wait_message_endW { print "\nDone\n" }
+
+1;
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 233aafda1..8f8fef04e 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -1,34 +1,235 @@
-package keyboard;
+
+package keyboard; # $Id$
use diagnostics;
use strict;
-use vars qw($KMAP_MAGIC %defaultKeyboards %loadKeymap);
-use common qw(:system :file);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :system :file);
+use run_program;
+use commands;
use log;
+use c;
-$KMAP_MAGIC = 0x8B39C07F;
+#-######################################################################################
+#- Globals
+#-######################################################################################
+my $KMAP_MAGIC = 0x8B39C07F;
-%defaultKeyboards = (
- "de" => "de-latin1",
- "fi" => "fi-latin1",
- "se" => "se-latin1",
- "no" => "no-latin1",
- "cs" => "cz-lat2",
- "tr" => "trq",
+#- a best guess of the keyboard layout, based on the choosen locale
+my %lang2keyboard =
+(
+ 'af' => 'us_intl',
+ 'az' => 'az',
+ 'be' => 'by',
+ 'be_BY.CP1251' => 'by',
+ 'bg' => 'bg',
+'bg_BG'=> 'bg',
+ 'br' => 'fr',
+ 'ca' => 'es',
+ 'cs' => 'cz_qwerty',
+ 'cy' => 'uk',
+ 'da' => 'dk',
+ 'de' => 'de',
+'de_AT'=> 'de',
+'de_CH'=> 'ch_de',
+'de_DE'=> 'de',
+ 'el' => 'gr',
+ 'en' => 'us',
+'en_US'=> 'us',
+'en_GB'=> 'uk',
+ 'eo' => 'us_intl',
+ 'es' => 'es',
+ 'es@tradicional' => 'es',
+'es_AR'=> 'la',
+'es_ES'=> 'es',
+'es_MX'=> 'la',
+ 'et' => 'ee',
+ 'eu' => 'es',
+ 'fa' => 'ir',
+ 'fi' => 'fi',
+ 'fr' => 'fr',
+'fr_BE'=> 'be',
+'fr_CA'=> 'qc',
+'fr_CH'=> 'ch_fr',
+'fr_FR'=> 'fr',
+ 'ga' => 'uk',
+ 'gl' => 'es',
+ 'he' => 'il',
+ 'hr' => 'hr',
+ 'hu' => 'hu',
+ 'hy' => 'am',
+ 'is' => 'is',
+ 'it' => 'it',
+ 'ja' => 'jp',
+ 'ka' => 'ge_la',
+ 'lt' => 'lt',
+ 'mk' => 'mk',
+ 'nb' => 'no',
+ 'nl' => 'nl',
+'nl_BE'=> 'be',
+'nl_NL'=> 'nl',
+ 'no' => 'no',
+ 'no@nynorsk' => 'no',
+ 'ny' => 'no',
+ 'oc' => 'fr',
+ 'pl' => 'pl',
+ 'pt' => 'pt',
+'pt_BR'=> 'br',
+'pt_PT'=> 'pt',
+ 'ru' => 'ru',
+ 'ru_RU.KOI8-R' => 'ru',
+ 'sk' => 'sk_qwerty',
+ 'sl' => 'si',
+ 'sr' => 'yu',
+ 'sv' => 'se',
+ 'sv@ny' => 'se',
+ 'sv@traditionell' => 'se',
+ 'th' => 'th',
+ 'tr' => 'tr_q',
+ 'uk' => 'ua',
+'uk_UA' => 'ua',
+ 'vi' => 'vn',
+'vi_VN.tcvn' => 'vn',
+'vi_VN.viscii' => 'vn',
+ 'wa' => 'be',
);
-1;
+#- key = extension for Xmodmap file, [0] = description of the keyboard,
+#- [1] = name for loadkeys, [2] = name for XKB
+my %keyboards = (
+arch() =~ /^sparc/ ? (
+ "cs" => [ __("Czech (QWERTZ)"), "sunt5-cz-us", "czsk(cz_us_qwertz)" ],
+ "de" => [ __("German"), "sunt5-de-latin1", "de" ],
+ "dvorak" => [ __("Dvorak"), "sundvorak", "dvorak" ],
+ "es" => [ __("Spanish"), "sunt5-es", "es" ],
+ "fi" => [ __("Finnish"), "sunt5-fi-latin1", "fi" ],
+ "fr" => [ __("French"), "sunt5-fr-latin1", "fr" ],
+ "no" => [ __("Norwegian"), "sunt4-no-latin1", "no" ],
+ "pl" => [ __("Polish"), "sun-pl-altgraph", "pl" ],
+ "ru" => [ __("Russian"), "sunt5-ru", "ru" ],
+ "uk" => [ __("UK keyboard"), "sunt5-uk", "gb" ],
+ "us" => [ __("US keyboard"), "sunkeymap", "us" ],
+) : (
+arch() eq "ppc" ? (
+ "us" => [ __("US keyboard"), "mac-us-ext", "us" ],
+ "de_nodeadkeys" => [ __("German"), "mac-de-latin1-nodeadkeys", "de(nodeadkeys)" ],
+ "fr" => [ __("French"), "mac-fr2-ext", "fr" ],
+) : (
+ "am_old" => [ __("Armenian (old)"), "am_old", "am(old)" ],
+ "am" => [ __("Armenian (typewriter)"), "am-armscii8", "am" ],
+ "am_phonetic" => [ __("Armenian (phonetic)"), "am_phonetic", "am(phonetic)" ],
+#- only xmodmap is currently available
+#-"ar" => [ __("Arabic"), "ar-8859_6", "ar" ],
+ "az" => [ __("Azerbaidjani (latin)"), "az", "az" ],
+ "a3" => [ __("Azerbaidjani (cyrillic)"), "az-koi8c","az(cyrillic)" ],
+ "be" => [ __("Belgian"), "be-latin1", "be" ],
+ "bg" => [ __("Bulgarian"), "bg", "bg" ],
+ "br" => [ __("Brazilian (ABNT-2)"), "br-abnt2", "br" ],
+ "by" => [ __("Belarusian"), "by-cp1251", "byru" ],
+ "ch_de" => [ __("Swiss (German layout)"), "sg-latin1", "de_CH" ],
+ "ch_fr" => [ __("Swiss (French layout)"), "fr_CH-latin1", "fr_CH" ],
+ "cz" => [ __("Czech (QWERTZ)"), "cz-latin2", "czsk(cz_us_qwertz)" ],
+ "cz_qwerty" => [ __("Czech (QWERTY)"), "cz-lat2", "czsk(cz_us_qwerty)" ],
+ "cz_prog" => [ __("Czech (Programmers)"), "cz-lat2-prog", "czsk(us_cz_prog)" ],
+ "de" => [ __("German"), "de-latin1", "de" ],
+ "de_nodeadkeys" => [ __("German (no dead keys)"), "de-latin1-nodeadkeys", "de(nodeadkeys)" ],
+ "dk" => [ __("Danish"), "dk-latin1", "dk" ],
+ "dvorak" => [ __("Dvorak (US)"), "pc-dvorak-latin1", "dvorak" ],
+ "dvorak_no" => [ __("Dvorak (Norwegian)"), "no-dvorak", "dvorak(no)" ],
+ "ee" => [ __("Estonian"), "ee-latin9", "ee" ],
+ "es" => [ __("Spanish"), "es-latin1", "es" ],
+ "fi" => [ __("Finnish"), "fi-latin1", "fi" ],
+ "fr" => [ __("French"), "fr-latin1", "fr" ],
+ "ge_ru"=>[__("Georgian (\"Russian\" layout)"),"ge_ru-georgian_academy","ge_ru"],
+ "ge_la"=>[__("Georgian (\"Latin\" layout)"),"ge_la-georgian_academy","ge_la"],
+ "gr" => [ __("Greek"), "gr-8859_7", "gr" ],
+ "hu" => [ __("Hungarian"), "hu-latin2", "hu" ],
+ "hr" => [ __("Croatian"), "croat", "yu" ],
+ "il" => [ __("Israeli"), "il-8859_8", "il" ],
+ "il_phonetic" => [ __("Israeli (Phonetic)"),"hebrew", "il_phonetic" ],
+ "ir" => [ __("Iranian"), "ir-isiri3342","ir" ],
+ "is" => [ __("Icelandic"), "is-latin1", "is" ],
+ "it" => [ __("Italian"), "it-latin1", "it" ],
+ "jp" => [ __("Japanese 106 keys"), "jp106", "jp" ],
+ "la" => [ __("Latin American"), "la-latin1", "la" ],
+#-"mk" => [ __("Macedonian"), "mk", "mk" ],
+ "nl" => [ __("Dutch"), "nl-latin1", "nl" ],
+ "lt" => [ __("Lithuanian AZERTY (old)"), "lt-latin7","lt" ],
+#- TODO: write a console kbd map for lt_new
+ "lt_new" => [ __("Lithuanian AZERTY (new)"), "lt-latin7","lt_new" ],
+ "lt_b" => [ __("Lithuanian \"number row\" QWERTY"), "ltb-latin7", "lt_b" ],
+ "lt_p" => [ __("Lithuanian \"phonetic\" QWERTY"), "ltp-latin7", "lt_p" ],
+ "no" => [ __("Norwegian"), "no-latin1", "no" ],
+ "pl" => [ __("Polish (qwerty layout)"), "pl", "pl" ],
+ "pl2" => [ __("Polish (qwertz layout)"), "pl-latin2", "pl2" ],
+ "pt" => [ __("Portuguese"), "pt-latin1", "pt" ],
+ "qc" => [ __("Canadian (Quebec)"), "qc-latin1","ca_enhanced" ],
+ "ru" => [ __("Russian"), "ru4", "ru(winkeys)" ],
+ "ru_yawerty" => [ __("Russian (Yawerty)"),"ru-yawerty","ru_yawerty" ],
+ "se" => [ __("Swedish"), "se-latin1", "se" ],
+ "si" => [ __("Slovenian"), "slovene", "si" ],
+ "sk" => [ __("Slovakian (QWERTZ)"), "sk-qwertz", "czsk(sk_us_qwertz)" ],
+ "sk_qwerty" => [ __("Slovakian (QWERTY)"), "sk-qwerty", "czsk(sk_us_qwerty)" ],
+ "sk_prog" => [ __("Slovakian (Programmers)"), "sk-prog", "czsk(us_sk_prog" ],
+ "th" => [ __("Thai keyboard"), "th", "th" ],
+ "tr_f" => [ __("Turkish (traditional \"F\" model)"), "trf", "tr_f" ],
+ "tr_q" => [ __("Turkish (modern \"Q\" model)"), "tr_q-latin5", "tr_q" ],
+ "ua" => [ __("Ukrainian"), "ua", "ua" ],
+ "uk" => [ __("UK keyboard"), "uk", "gb" ],
+ "us" => [ __("US keyboard"), "us", "us" ],
+ "us_intl" => [ __("US keyboard (international)"), "us-latin1", "us_intl" ],
+ "vn" => [ __("Vietnamese \"numeric row\" QWERTY"),"vn-tcvn", "vn" ],
+ "yu" => [ __("Yugoslavian (latin layout)"), "sr", "yu" ],
+)),
+);
+
+
+#-######################################################################################
+#- Functions
+#-######################################################################################
+sub xmodmaps { keys %keyboards }
+sub keyboard2text { $keyboards{$_[0]} && $keyboards{$_[0]}[0] }
+sub keyboard2kmap { $keyboards{$_[0]} && $keyboards{$_[0]}[1] }
+sub keyboard2xkb { $keyboards{$_[0]} && $keyboards{$_[0]}[2] }
+
+sub loadkeys_files {
+ my $archkbd = arch() =~ /^sparc/ ? "sun" : arch() =~ /i.86/ ? "i386" : arch();
+ my $p = "/usr/lib/kbd/keymaps/$archkbd";
+ my $post = ".kmap.gz";
+ my %trans = ("cz-latin2" => "cz-lat2");
+ my (@l, %l);
+ foreach (values %keyboards) {
+ local $_ = $trans{$_->[1]} || $_->[1];
+ my ($l) = grep { -e $_ } ("$p/$_$post");
+ $l or /(..)/ and ($l) = grep { -e $_ } ("$p/$1$post");
+ print STDERR "unknown $_\n" if $_[0] && !$l; $l or next;
+ push @l, $l;
+ foreach (`zgrep include $l | grep "^include"`) {
+ /include\s+"(.*)"/ or die "bad line $_";
+ @l{grep { -e $_ } ("$p/$1.inc.gz")} = ();
+ }
+ }
+ @l, keys %l, grep { -e $_ } map { "$p/$_.inc.gz" } qw(compose euro windowkeys linux-keys-bare);
+}
+sub lang2keyboard {
+ my ($l) = @_;
+ my $kb = $lang2keyboard{$l} || $keyboards{$l} && $l || "us";
+ $keyboards{$kb} ? $kb : "us"; #- handle incorrect keyboad mapping to us.
+}
-sub load($) {
- my ($keymap_raw) = @_;
+sub load {
+ my ($keymap) = @_;
+ return if $::testing;
- my ($magic, @keymaps) = unpack "i i" . c::MAX_NR_KEYMAPS() . "a*", $keymap_raw;
- $keymap_raw = pop @keymaps;
+ my ($magic, @keymaps) = unpack "I i" . c::MAX_NR_KEYMAPS() . "a*", $keymap;
+ $keymap = pop @keymaps;
- $magic != $KMAP_MAGIC and die "failed to read kmap magic: $!";
+ $magic != $KMAP_MAGIC and die "failed to read kmap magic";
local *F;
sysopen F, "/dev/console", 2 or die "failed to open /dev/console: $!";
@@ -37,92 +238,66 @@ sub load($) {
foreach (0 .. c::MAX_NR_KEYMAPS() - 1) {
$keymaps[$_] or next;
- my @keymap = unpack "s" . c::NR_KEYS() . "a*", $keymap_raw;
- $keymap_raw = pop @keymap;
+ my @keymap = unpack "s" . c::NR_KEYS() . "a*", $keymap;
+ $keymap = pop @keymap;
- my $key = 0;
+ my $key = -1;
foreach my $value (@keymap) {
- c::KTYP($value) != c::KT_SPEC() or next;
- ioctl(F, c::KDSKBENT(), pack("CCS", $_, $key++, $value)) or log::l("keymap ioctl failed: $!");
$key++;
+ c::KTYP($value) != c::KT_SPEC() or next;
+ ioctl(F, c::KDSKBENT(), pack("CCS", $_, $key, $value)) or die "keymap ioctl failed ($_ $key $value): $!";
}
$count++;
}
- log::l("loaded $count keymap tables");
- 1;
+ #- log::l("loaded $count keymap tables");
}
-sub setup($) {
- my ($defkbd) = @_;
- my $t;
-
- #$::testing and return 1;
-
- $defkbd ||= $defaultKeyboards{$ENV{LANG}} || "us";
-
- local *F;
- open F, "/etc/keymaps" or die "cannot open /etc/keymaps: $!";
-
- my $format = "i2";
- read F, $t, psizeof($format) or die "failed to read keymaps header: $!";
- my ($magic, $numEntries) = unpack $format, $t;
-
- log::l("%d keymaps are available", $numEntries);
-
- my @infoTable;
- my $format2 = "i Z40";
- foreach (1..$numEntries) {
- read F, $t, psizeof($format2) or die "failed to read keymap information: $!";
- push @infoTable, [ unpack $format2, $t ];
+sub xmodmap_file {
+ my ($keyboard) = @_;
+ my $f = "$ENV{SHARE_PATH}/xmodmap/xmodmap.$keyboard";
+ if (! -e $f) {
+ run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/xmodmap.cz2", '/tmp', "xmodmap.$keyboard");
+ $f = "/tmp/xmodmap.$keyboard";
}
+ -e $f && $f;
+}
- foreach (@infoTable) {
- read F, $t, $_->[0] or log::l("error reading $_->[0] bytes from file: $!"), return;
+sub setup {
+ return if arch() =~ /^sparc/;
+ my ($keyboard) = @_;
+ my $o = $keyboards{$keyboard} or return;
- if ($defkbd eq $_->[1]) {
- log::l("using keymap $_->[1]");
- load($t) or return;
- &write("/tmp", $_->[1]) or log::l("write keyboard config failed");
- return $_->[1];
- }
+ log::l("loading keymap $o->[1]");
+ if (-e (my $f = "$ENV{SHARE_PATH}/keymaps/$o->[1].bkmap")) {
+ load(scalar cat_($f));
+ } else {
+ local *F;
+ open F, "packdrake -x $ENV{SHARE_PATH}/keymaps.cz2 '' $o->[1].bkmap |";
+ local $/ = undef;
+ eval { load(join('', <F>)) };
}
- undef;
+ my $f = xmodmap_file($keyboard);
+ eval { run_program::run('xmodmap', $f) } unless $::testing || !$f;
}
-sub write($$) {
- my ($prefix, $keymap) = @_;
-
- $keymap or return 1;
- $::testing and return 1;
+sub write {
+ my ($prefix, $keyboard, $charset, $isNotDelete) = @_;
- local *F;
- open F, ">$prefix/etc/sysconfig/keyboard" or die "failed to create keyboard configuration: $!";
- print F "KEYTABLE=$keymap\n" or die "failed to write keyboard configuration: $!";
-
- # write default keymap
- if (fork) {
- wait;
- $? == 0 or log::l('dumpkeys failed');
- } else {
- chroot $prefix;
- CORE::system("/usr/bin/dumpkeys > /etc/sysconfig/console/default.kmap 2>/dev/null");
- exit($?);
- }
+ setVarsInSh("$prefix/etc/sysconfig/keyboard", { KEYTABLE => keyboard2kmap($keyboard),
+ KBCHARSET => $charset,
+ BACKSPACE => $isNotDelete ? "BackSpace" : "Delete" });
+ run_program::rooted($prefix, "dumpkeys > /etc/sysconfig/console/default.kmap") or log::l("dumpkeys failed");
}
-sub read($) {
- my ($file) = @_;
-
- local *F;
- open F, "$file" or # fail silently -- old bootdisks won't create this
- log::l("failed to read keyboard configuration (probably ok)"), return;
-
- foreach (<F>) {
- ($_) = /^KEYTABLE=(.*)/ or die "unrecognized entry in keyboard configuration file";
- s/\"//g;
- s/\.[^.]*//; # remove extension
- return basename($_);
- }
- log::l("empty keyboard configuration file");
- undef;
+sub read {
+ my ($prefix) = @_;
+ my %keyf = getVarsFromSh("$prefix/etc/sysconfig/keyboard");
+ my $keytable = $keyf{KEYTABLE};
+ keyboard2kmap($_) eq $keytable and return $_ foreach keys %keyboards;
+ $keyboards{$keytable} ? $keytable : 'us_intl';
}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 708a6b5da..78c8b954e 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -1,72 +1,454 @@
-package lang;
+package lang; # $Id$
use diagnostics;
use strict;
-use common qw(:file);
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :file :system);
use commands;
-use cpio;
use log;
+#-######################################################################################
+#- Globals
+#-######################################################################################
+#- key (to be used in $LC_ALL), [0] = english name, [1] = charset encoding,
+#- [2] = value for $LANG, [3] = value for LANGUAGE (a list of possible
+#- languages, carefully choosen)
my %languages = (
- "en" => [ "English", undef, undef, "en_US" ],
- "fr" => [ "French", "lat0-sun16", "iso15", "fr_FR" ],
- "de" => [ "German", "lat0-sun16", "iso15", "de_DE" ],
- "hu" => [ "Hungarian", "lat2-sun16", "iso02", "hu_HU" ],
- "is" => [ "Icelandic", "lat0-sun16", "iso15", "is_IS" ],
- "it" => [ "Italian", "lat0-sun16", "iso15", "it_IT" ],
- "no" => [ "Norwegian", "lat0-sun16", "iso15", "no_NO" ],
- "ro" => [ "Romanian", "lat2-sun16", "iso02", "ro_RO" ],
- "sk" => [ "Slovak", "lat2-sun16", "iso02", "sk_SK" ],
- "ru" => [ "Russian", "Cyr_a8x16", "koi2alt", "ru_SU" ],
-"uk_UA"=> [ "Ukrainian", "RUSCII_8x16", "koi2alt", "uk_UA" ],
+'en_US' => [ 'English (US)', 'iso-8859-1', 'en', 'en_US:en' ],
+'en_GB' => [ 'English (UK)', 'iso-8859-1', 'en', 'en_GB:en' ],
+ 'af' => [ 'Afrikaans', 'iso-8859-1', 'af', 'af:en_ZA' ],
+ 'ar' => [ 'Arabic', 'iso-8859-6', 'ar', 'ar' ],
+ 'az' => [ 'Azeri (latin)', 'iso-8859-9e','az', 'az:tr' ],
+ 'a3' => [ 'Azeri (cyrillic)', 'koi8-c', 'a3', 'a3' ],
+'be_BY.CP1251' => [ 'Belarussian', 'cp1251', 'be', 'be:be_BY.CP1251:ru_RU.CP1251' ],
+#- provide aliases for some not very standard names used in po files...
+'bg_BG' => [ 'Bulgarian', 'cp1251', 'bg', 'bg:bg.CP1251:bg_BG.CP1251' ],
+ 'br' => [ 'Brezhoneg', 'iso-8859-1', 'br', 'br:fr_FR:fr' ],
+#-'bs' => [ 'Bosnian', 'iso-8859-2', 'bs', 'bs:hr:sr' ],
+ 'ca' => [ 'Catalan', 'iso-8859-1', 'ca', 'ca:es_ES:es:fr_FR:fr' ],
+ 'cs' => [ 'Czech', 'iso-8859-2', 'cs', 'cs' ],
+ 'cy' => [ 'Cymraeg (Welsh)', 'iso-8859-14','cy', 'cy:en_GB:en' ],
+ 'da' => [ 'Danish', 'iso-8859-1', 'da', 'da' ],
+'de_AT' => [ 'German (Austria)', 'iso-8859-1', 'de', 'de_AT:de' ],
+'de_DE' => [ 'German (Germany)', 'iso-8859-1', 'de', 'de_DE:de' ],
+ 'el' => [ 'Greek', 'iso-8859-7', 'el', 'el' ],
+ 'eo' => [ 'Esperanto', 'iso-8859-3', 'eo', 'eo' ],
+'es_AR' => [ 'Spanish (Argentina)', 'iso-8859-1', 'es', 'es_AR:es_UY:es:es_ES' ],
+'es_ES' => [ 'Spanish (Spain, modern sorting)', 'iso-8859-1', 'es', 'es_ES:es' ],
+'es@tradicional' => [ 'Spanish (Spain, traditional sorting)', 'iso-8859-1', 'es', 'es' ],
+'es_MX' => [ 'Spanish (Mexico)', 'iso-8859-1', 'es', 'es_MX:es:es_ES' ],
+ 'et' => [ 'Estonian', 'iso-8859-15','et', 'et' ],
+ 'eu' => [ 'Euskara (Basque)', 'iso-8859-1', 'eu', 'eu:es_ES:fr_FR:es:fr' ],
+ 'fa' => [ 'Farsi (Iranian)', 'isiri-3342', 'fa', 'fa' ],
+ 'fi' => [ 'Suomi (Finnish)', 'iso-8859-15', 'fi', 'fi' ],
+#-'fo' => [ 'Faroese', 'iso-8859-1', 'fo', 'fo:??:??' ],
+'fr_CA' => [ 'French (Canada)', 'iso-8859-1', 'fr', 'fr_CA:fr' ],
+'fr_FR' => [ 'French (France)', 'iso-8859-1', 'fr', 'fr_FR:fr' ],
+ 'ga' => [ 'Gaeilge (Irish)', 'iso-8859-14','ga', 'ga:en_IE:en' ],
+#-'gd' => [ 'Scottish gaelic', 'iso-8859-14','gd', 'gd:en_GB:en' ],
+ 'gl' => [ 'Galego (Galician)', 'iso-8859-1', 'gl', 'gl:es_ES:pt_PT:pt_BR:es:pt' ],
+#-'gv' => [ 'Manx gaelic', 'iso-8859-14','gv', 'gv:en_GB:en' ],
+#- 'iw' was the old code for hebrew language
+ 'he' => [ 'Hebrew', 'iso-8859-8', 'he', 'he:iw_IL' ],
+ 'hr' => [ 'Croatian', 'iso-8859-2', 'hr', 'hr' ],
+ 'hu' => [ 'Hungarian', 'iso-8859-2', 'hu', 'hu' ],
+ 'hy' => [ 'Armenian', 'armscii-8', 'hy', 'hy' ],
+#- 'in' was the old code for indonesian language; by putting LANGUAGE=id:in_ID
+#- we catch the few catalog files still using the wrong code
+ 'id' => [ 'Indonesian', 'iso-8859-1', 'id', 'id:in_ID' ],
+ 'is' => [ 'Icelandic', 'iso-8859-1', 'is', 'is' ],
+ 'it' => [ 'Italian', 'iso-8859-1', 'it', 'it_IT:it' ],
+ 'ja' => [ 'Japanese', 'jisx0208', 'ja', 'ja_JP.ujis:ja' ],
+ 'ka' => [ 'Georgian', 'georgian-academy', 'ka', 'ka' ],
+ 'kl' => [ 'Greenlandic (inuit)', 'iso-8859-1', 'kl', 'kl' ],
+ 'ko' => [ 'Korean', 'ksc5601', 'ko', 'ko' ],
+#-'kw' => [ 'Cornish gaelic', 'iso-8859-14','kw', 'kw:en_GB:en' ],
+#-'lo' => [ 'Laotian', 'mulelao-1', 'lo', 'lo' ],
+ 'lt' => [ 'Lithuanian', 'iso-8859-13','lt', 'lt' ],
+ 'lv' => [ 'Latvian', 'iso-8859-13','lv', 'lv' ],
+ 'mi' => [ 'Maori', 'iso-8859-13','mi', 'mi' ],
+ 'mk' => [ 'Macedonian (Cyrillic)', 'iso-8859-5', 'mk', 'mk:sp:sr' ],
+#-'ms' => [ 'Malay', 'iso-8859-1', 'ms', 'ms' ],
+ 'nl' => [ 'Dutch (Netherlands)', 'iso-8859-1', 'nl', 'nl_NL:nl' ],
+# 'nb' is the new locale name in glibc 2.2
+ 'no' => [ 'Norwegian (Bokmaal)', 'iso-8859-1', 'no', 'no:nb:no@nynorsk:no_NY' ],
+# no_NY is used by KDE (but not standard); 'ny' is the new locale in glibc 2.2
+'no@nynorsk' => [ 'Norwegian (Nynorsk)','iso-8859-1', 'no', 'no@nynorsk:ny:no_NY:no' ],
+#-'oc' => [ 'Occitan', 'iso-8859-1', 'oc', 'oc:fr_FR' ],
+#-'pd' => [ 'Plauttdietsch', 'iso-8859-1', 'pd', 'pd' ],
+#-'ph' => [ 'Pilipino', 'iso-8859-1', 'ph', 'ph:tl' ],
+ 'pl' => [ 'Polish', 'iso-8859-2', 'pl', 'pl' ],
+#-'pp' => [ 'Papiamento', 'iso-8859-1', 'pp', 'pp' ],
+'pt_BR' => [ 'Portuguese (Brazil)', 'iso-8859-1', 'pt_BR', 'pt_BR:pt_PT:pt' ],
+'pt_PT' => [ 'Portuguese (Portugal)', 'iso-8859-1', 'pt', 'pt_PT:pt:pt_BR' ],
+ 'ro' => [ 'Romanian', 'iso-8859-2', 'ro', 'ro' ],
+'ru_RU.KOI8-R' => [ 'Russian', 'koi8-r', 'ru', 'ru_RU.KOI8-R:ru' ],
+ 'sk' => [ 'Slovak', 'iso-8859-2', 'sk', 'sk' ],
+ 'sl' => [ 'Slovenian', 'iso-8859-2', 'sl', 'sl' ],
+ 'sp' => [ 'Serbian (Cyrillic)', 'iso-8859-5', 'sp', 'sp:sr' ],
+ 'sr' => [ 'Serbian (Latin)', 'iso-8859-2', 'sr', 'sr' ],
+'sv@traditionell' => [ 'Swedish (traditional sorting [V = W])','iso-8859-1', 'sv', 'sv' ],
+'sv@ny' => [ 'Swedish (new sorting [V != W])','iso-8859-1', 'sv', 'sv' ],
+#-'ta' => [ 'Tamil', 'tscii-0', 'ta', 'ta' ],
+ 'tg' => [ 'Tajik', 'koi8-c', 'tg', 'tg' ],
+ 'th' => [ 'Thai', 'tis620', 'th', 'th' ],
+ 'tr' => [ 'Turkish', 'iso-8859-9', 'tr', 'tr' ],
+ 'tt' => [ 'Tatar', 'tatar-cyr', 'tg', 'tg' ],
+#-'ur' => [ 'Urdu', 'cp1256', 'ur', 'ur' ],
+'uk_UA' => [ 'Ukrainian', 'koi8-u', 'uk', 'uk_UA:uk' ],
+ 'vi' => [ 'Vietnamese (TCVN)', 'tcvn', 'vi',
+ 'vi_VN.tcvn:vi_VN.tcvn-5712:vi' ],
+'vi_VN.viscii' => [ 'Vietnamese (VISCII)','viscii', 'vi',
+ 'vi_VN.viscii:vi_VN.tcvn-viscii1.1-1:vi' ],
+ 'wa' => [ 'Walon', 'iso-8859-1', 'wa', 'wa:fr_BE:fr' ],
+#-'yi' => [ 'Yiddish', 'cp1255', 'yi', 'yi' ],
+'zh_TW.Big5' => [ 'Chinese (Big5)', 'Big5', 'zh_TW.Big5', 'zh_TW.Big5:zh_TW.big5:zh' ],
+'zh_CN' => [ 'Chinese (GuoBiao)', 'gb2312', 'zh_CN.GB2312', 'zh_CN.GB2312:zh_CN.gb2312:zh_CN:zh' ],
);
-1;
+my %xim = (
+ 'zh_TW.Big5' => {
+ ENC => 'big5',
+ XIM => 'xcin',
+ XIM_PROGRAM => 'xcin',
+ XMODIFIERS => '"@im=xcin"',
+ CONSOLE_NOT_LOCALIZED => 'yes',
+ },
+ 'zh_CN.GB2312' => {
+ ENC => 'gb',
+ XIM => 'xcin-zh_CN.GB2312',
+ XIM_PROGRAM => 'xcin',
+ XMODIFIERS => '"@im=xcin-zh_CN.GB2312"',
+ CONSOLE_NOT_LOCALIZED => 'yes',
+ },
+ 'ko' => {
+ ENC => 'kr',
+ XIM => 'Ami',
+ XIM_PROGRAM => 'ami',
+ XMODIFIERS => '"@im=Ami"',
+ CONSOLE_NOT_LOCALIZED => 'yes',
+ },
+ 'ja' => {
+ ENC => 'eucj',
+ XIM => 'kinput2',
+ XIM_PROGRAM => 'kinput2',
+ XMODIFIERS => '"@im=kinput2"',
+ },
+ # right to left languages only work properly on console
+ 'ar' => {
+ X11_NOT_LOCALIZED => "yes",
+ },
+ 'fa' => {
+ X11_NOT_LOCALIZED => "yes",
+ },
+ 'he' => {
+ X11_NOT_LOCALIZED => "yes",
+ },
+ 'ur' => {
+ X11_NOT_LOCALIZED => "yes",
+ },
+ 'yi' => {
+ X11_NOT_LOCALIZED => "yes",
+ },
+);
+
+sub std2 { "-*-*-medium-r-normal-*-$_[1]-*-*-*-*-*-$_[0]" }
+sub std_ { std2($_[0], 10), std2($_[0], 10) }
+sub std { std2($_[0], $_[1] || 10), std2($_[0], 8) }
+
+#- [0]: console font name; [1]: unicode map for console font
+#- [2]: acm file for console font; [3]: X11 fontset
+my %charsets = (
+ "armscii-8" => [ "arm8", "armscii8.uni", "trivial.trans",
+ std_("armscii-8") ],
+#- chinese needs special console driver for text mode
+ "Big5" => [ undef, undef, undef,
+ "-*-*-*-*-*-*-*-*-*-*-*-*-big5-0" ],
+ "gb2312" => [ undef, undef, undef,
+ "-*-*-*-*-*-*-*-*-*-*-*-*-gb2312.1980-0" ],
+ "georgian-academy" => [ "t_geors", "geors.uni", "trivial.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-georgian-academy" ],
+ "georgian-ps" => [ "t_geors", "geors.uni", "geors_to_geops.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-georgian-academy" ],
+ "iso-8859-1" => [ "lat0-sun16", undef, "iso15",
+ sub { std("iso8859-1", @_) } ],
+ "iso-8859-2" => [ "lat2-sun16", undef, "iso02",
+ sub { std("iso8859-2", @_) } ],
+ "iso-8859-3" => [ "iso03.f16", undef, "iso03",
+ std_("iso8859-3") ],
+ "iso-8859-4" => [ "lat4u-16", undef, "iso04",
+ std_("iso8859-4") ],
+ "iso-8859-5" => [ "iso05.f16", "iso05", "trivial.trans",
+ std2("iso8859-5", 10), std2("iso8859-5", 8) ],
+#- arabic needs special console driver for text mode [acon]
+#- (and gtk support isn't done yet)
+ "iso-8859-6" => [ "iso06.f16", "iso06", "trivial.trans",
+ std_("iso8859-6") ],
+ "iso-8859-7" => [ "iso07.f16", "iso07", "trivial.trans",
+ std_("iso8859-7") ],
+#- hebrew needs special console driver for text mode [acon]
+#- (and gtk support isn't done yet)
+ "iso-8859-8" => [ "iso08.f16", "iso08", "trivial.trans",
+ std_("iso8859-8") ],
+ "iso-8859-9" => [ "iso09.f16", "iso09", "trivial.trans",
+ sub { std("iso8859-9", @_) } ],
+ "iso-8859-13" => [ "tlat7", "iso01", "trivial.trans",
+ std_("iso8859-13") ],
+ "iso-8859-14" => [ "tlat8", "iso01", "trivial.trans",
+ std_("iso8859-14") ],
+ "iso-8859-15" => [ "lat0-sun16", undef, "iso15",
+ std("iso8859-15") ],
+ "iso-8859-9e" => [ "tiso09e", "iso09", "trivial.trans",
+ std("iso8859-9e") ],
+#- japanese needs special console driver for text mode [kon2]
+ "jisx0208" => [ undef, undef, "trivial.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-jisx*.*-0" ],
+ "koi8-r" => [ "UniCyr_8x16", undef, "koi8-r",
+ std("koi8-r") ],
+ "koi8-u" => [ "UniCyr_8x16", undef, "koi8-u",
+ std("koi8-u") ],
+ "koi8-c" => [ "koi8-c", "iso01", "trivial.trans",
+ std("koi8-c") ],
+ "tatar-cyr" => [ "tatar-cyr", undef, "cp1251",
+ std("tatar-cyr") ],
+ "cp1251" => [ "UniCyr_8x16", undef, "cp1251",
+ std("microsoft-cp1251") ],
+#- Yiddish needs special console driver for text mode [acon]
+#- (and gtk support isn't done yet)
+ "cp1255" => [ "iso08.f16", "iso08", "trivial.trans",
+ std_("microsoft-cp1255") ],
+#- Urdu needs special console driver for text mode [acon]
+#- (and gtk support isn't done yet)
+ "cp1256" => [ undef, undef, "trivial.trans",
+ std_("microsoft-cp1255") ],
+#- korean needs special console driver for text mode
+ "ksc5601" => [ undef, undef, undef,
+ "-*-*-*-*-*-*-*-*-*-*-*-*-ksc5601.1987-*" ],
+#- I have no console font for Thai...
+ "tis620" => [ undef, undef, "trivial.trans",
+ std2("tis620.2533-1",12) ],
+ "tcvn" => [ "tcvn8x16", "tcvn", "trivial.trans",
+ std2("tcvn-5712", 13), std2("tcvn-5712", 10) ],
+ "viscii" => [ "viscii10-8x16", "viscii.uni", "viscii1.0_to_viscii1.1.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-viscii1.1-1" ],
+#- Farsi (iranian) needs special console driver for text mode [acon]
+#- (and gtk support isn't done yet)
+ "isiri-3342" => [ undef, undef, "trivial.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-isiri-3342" ],
+ "tscii-0" => [ "tamil", undef, "trivial.trans",
+ "-*-*-*-*-*-*-*-*-*-*-*-*-tscii-0" ],
+);
-sub set {
- my $lang = shift;
+#-######################################################################################
+#- Functions
+#-######################################################################################
- if ($lang) {
- $ENV{LANG} = $ENV{LINGUAS} = $lang;
- $ENV{LC_ALL} = $languages{$lang}->[3];
- my $f = $languages{$lang}->[1]; $f and load_font($f);
+sub list { keys %languages }
+sub lang2text { $languages{$_[0]} && $languages{$_[0]}[0] }
+sub lang2charset { $languages{$_[0]} && $languages{$_[0]}[1] }
+
+sub set {
+ my ($lang) = @_;
+
+ if ($lang && $languages{$lang}) {
+ #- use "packdrake -x" that follow symlinks and expand directory.
+ #- it is necessary as there is a lot of symlinks inside locale.cz2,
+ #- using a compressed cpio archive is nighmare to extract all files.
+ #- reset locale environment variable to avoid any warnings by perl,
+ #- so installation of new locale is done with empty locale ...
+ unless (-e "$ENV{SHARE_PATH}/locale/$languages{$lang}[2]") {
+ @ENV{qw(LANG LC_ALL LANGUAGE LINGUAS)} = ();
+
+ eval { commands::rm("-r", "$ENV{SHARE_PATH}/locale") };
+ require 'run_program.pm';
+ run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/locale.cz2", "$ENV{SHARE_PATH}/locale", $languages{$lang}[2]);
+ }
+
+ $ENV{LC_ALL} = $lang;
+ $ENV{LANG} = $languages{$lang}[2];
+ $ENV{LANGUAGE} = $languages{$lang}[3];
} else {
# stick with the default (English) */
delete $ENV{LANG};
delete $ENV{LC_ALL};
+ delete $ENV{LINGUAGE};
delete $ENV{LINGUAS};
+ delete $ENV{RPM_INSTALL_LANG};
}
}
-sub write {
+sub set_langs {
+ my ($l) = @_;
+ $l or return;
+ $ENV{RPM_INSTALL_LANG} = member('all', @$l) ? 'all' :
+ join ':', uniq(map { substr($languages{$_}[2], 0, 2) } @$l);
+ log::l("RPM_INSTALL_LANG: $ENV{RPM_INSTALL_LANG}");
+}
+
+sub get_langs {
+ [
+ $ENV{RPM_INSTALL_LANG} eq 'all' ?
+ map { substr($_->[2], 0, 2) } values %languages :
+ split(':', $ENV{RPM_INSTALL_LANG})
+ ];
+}
+
+sub write {
my ($prefix) = @_;
- my $lang = $ENV{LANG};
+ my $lang = $ENV{LC_ALL};
- $::testing || !$lang and return 0;
- local *F;
- open F, "> $prefix/etc/sysconfig/i18n";
+ $lang or return;
- my $f = sub { $_[1] and print F "$_[0]=$_[1]\n"; };
- &$f("LANG", $lang);
- &$f("LINGUAS", $lang);
+ my $h = { RPM_INSTALL_LANG => $ENV{RPM_INSTALL_LANG} };
+ $h->{$_} = $lang foreach qw(LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_MONETARY LC_TIME);
if (my $l = $languages{$lang}) {
- &$f("LC_ALL", $l->{lc_all});
- &$f("SYSFONT", $l->{font});
- &$f("SYSFONTACM", $l->{map});
-
- my $p = "$prefix/usr/lib/kbd";
- commands::cp("-f",
- "$p/consolefonts/$l->{font}.psf.gz",
- glob_("$p/consoletrans/$l->{map}*"),
- "$prefix/etc/sysconfig/console");
+ add2hash $h, { LANG => $l->[2], LANGUAGE => $l->[3], RPM_INSTALL_LANG => $l->[3] };
+
+ my $c = $charsets{$l->[1] || ''};
+ if ($c) {
+ my $p = "$prefix/usr/lib/kbd";
+ if ($c->[0]) {
+ add2hash $h, { SYSFONT => $c->[0] };
+ eval {
+ commands::cp("-f",
+ "$p/consolefonts/$c->[0].psf.gz",
+ "$prefix/etc/sysconfig/console");
+ };
+ $@ and log::l("missing console font $c->[0]");
+ }
+ if ($c->[1]) {
+ add2hash $h, { UNIMAP => $c->[1] };
+ eval {
+ commands::cp("-f",
+ glob_("$p/consoletrans/$c->[1]*"),
+ "$prefix/etc/sysconfig/console");
+ };
+ $@ and log::l("missing console unimap file $c->[1]");
+ }
+ if ($c->[2]) {
+ add2hash $h, { SYSFONTACM => $c->[2] };
+ eval {
+ commands::cp("-f",
+ glob_("$p/consoletrans/$c->[2]*"),
+ "$prefix/etc/sysconfig/console");
+ };
+ $@ and log::l("missing console acm file $c->[2]");
+ }
+
+ }
+ add2hash $h, $xim{$lang};
+ }
+ setVarsInSh("$prefix/etc/sysconfig/i18n", $h);
+}
+
+sub load_po($) {
+ my ($lang) = @_;
+ my ($s, $from, $to, $state, $fuzzy);
+
+ $s .= "package po::I18N;\n";
+ $s .= "no strict;\n";
+ $s .= "\%{'$lang'} = (";
+
+ my $f; -e ($f = "$_/po/$lang.po") and last foreach @INC;
+
+ local *F;
+ unless ($f && -e $f) {
+ -e ($f = "$_/po/$lang.po.bz2") and last foreach @INC;
+ if (-e $f) {
+ open F, "bzip2 -dc $f 2>/dev/null |";
+ } else {
+ -e ($f = "$_/po.cz2") and last foreach @INC;
+ log::l("trying to load $lang.po from $f");
+ open F, "packdrake -x $f '' $lang.po 2>/dev/null |";
+ }
+ } else {
+ open F, $f; #- not returning here help avoiding reading the same multiple times.
+ }
+ local $_;
+ while (<F>) {
+ /^msgstr/ and $state = 1;
+ /^msgid/ && !$fuzzy and $state = 2;
+ s/@/\\@/g;
+
+ if (/^(#|$)/ && $state != 3) {
+ $state = 3;
+ if (my @l = $to =~ /%(\d+)\$/g) {
+ $to =~ s/%(\d+)\$/%/g;
+ $to = qq([ "$to", ) . join(",", map { $_ - 1 } @l) . " ],";
+ } else {
+ $to = qq("$to");
+ }
+ $s .= qq("$from" => $to,\n) if $from;
+ $from = $to = '';
+ }
+ $to .= (/"(.*)"/)[0] if $state == 1;
+ $from .= (/"(.*)"/)[0] if $state == 2;
+
+ $fuzzy = /^#, fuzzy/;
}
- 1;
+ $s .= ");";
+ no strict "vars";
+ eval $s;
+ !$@;
+}
+
+
+sub console_font_files {
+ map { -e $_ ? $_ : "$_.gz" }
+ (map { "/usr/lib/kbd/consolefonts/$_.psf" } uniq grep {$_} map { $_->[0] } values %charsets),
+ (map { -e $_ ? $_ : "$_.sfm" } map { "/usr/lib/kbd/consoletrans/$_" } uniq grep {$_} map { $_->[1] } values %charsets),
+ (map { -e $_ ? $_ : "$_.acm" } map { "/usr/lib/kbd/consoletrans/$_" } uniq grep {$_} map { $_->[2] } values %charsets),
}
-sub load_font {
- my ($fontFile) = @_;
- cpio::installCpioFile("/etc/fonts.cgz", $fontFile, "/tmp/font", 1) or die "error extracting $fontFile from /etc/fonts.cfz";
- c::loadFont('/tmp/font') or log::l("error in loadFont: one of PIO_FONT PIO_UNIMAPCLR PIO_UNIMAP PIO_UNISCRNMAP failed: $!");
- print STDERR "\033(K";
+sub load_console_font {
+ my ($lang) = @_;
+ my ($charset) = $languages{$lang} && $languages{$lang}[1] ;
+ my ($f, $u, $m) = @{$charsets{$charset} || []};
+
+ run_program::run('consolechars', '-v',
+ ('-f', $f || 'lat0-sun16'),
+ $u ? ('-u', $u) : (),
+ $m ? ('-m', $m) : ());
+}
+
+#-sub load_font {
+#- my ($charset) = @_;
+#- my $fontFile = "lat0-sun16";
+#-
+#- if (my $c = $charsets{$charset}) {
+#- log::l("loading $charset font");
+#- $fontFile = $c->[0];
+#- }
+#-
+#- # text mode font
+#- log::l("loading font $ENV{SHARE_PATH}/consolefonts/$fontFile");
+#- #c::loadFont("/tmp/$fontFile") or log::l("error in loadFont: one of PIO_FONT PIO_UNIMAPCLR PIO_UNIMAP PIO_UNISCRNMAP failed: $!");
+#- #print STDERR "\033(K";
+#-
+#-}
+
+sub get_x_fontset {
+ my ($lang, $size) = @_;
+
+ my $l = $languages{$lang} or return;
+ my $c = $charsets{$l->[1]} or return;
+ my ($big, $small) = @$c[3..4];
+ ($big, $small) = $big->($size) if ref $big;
+ ($big, $small);
}
+
+sub charset {
+ my ($lang, $prefix) = @_;
+ my $l = $languages{$lang} && $languages{$lang}[2];
+ foreach (cat_("$prefix/usr/X11R6/lib/X11/locale/locale.alias")) {
+ /$l:\s+.*\.(\S+)/ and return $1;
+ }
+}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/live_install b/perl-install/live_install
index 4f519f0fc..de92f054f 100755
--- a/perl-install/live_install
+++ b/perl-install/live_install
@@ -1,28 +1,65 @@
-#!../perl
-
-my $dir = `pwd`;
-chomp $dir;
-$dir .= "/../../..";
-
-#- update /tmp/rhimage which points to top dir of Mandrake CD.
-system "/bin/rm", "-rf", "/tmp/rhimage";
-mkdir "/tmp/rhimage", 0700 or die "cannot create directory /tmp/rhimage";
-system "/bin/rm", "-rf", "/tmp/drakx";
-mkdir "/tmp/drakx", 0700 or die "cannot create directory /tmp/drakx\n";
-
-#- copy whole set of mdkinst tree and symlink to the CD.
-foreach (qw(Mandrake RPMS misc boot images)) {
- symlink "$dir/../../$_", "/tmp/rhimage/$_";
-}
-system "/bin/cp", "-a", "$dir/../../Mandrake/mdkinst", "/tmp/drakx";
-
-#- start the true live_install.
-if (-x "/tmp/drakx/mdkinst/usr/bin/perl-install/live_install2") {
- chdir "/tmp/drakx/mdkinst/usr/bin/perl-install2";
- system "/tmp/drakx/mdkinst/usr/bin/perl-install/live_install2";
-} else {
- print STDERR "unable to get a working live system to start, check your working directory";
-}
-
-system "/bin/rm", "-rf", "/tmp/drakx";
-system "/bin/rm", "-rf", "/tmp/rhimage";
+#!/bin/sh
+
+if [ "$UID" -ne 0 ]; then
+ echo >&2 "you need to be root to start live install"
+ exit 3
+fi
+
+if [ -x ./Mandrake/mdkinst/usr/bin/perl-install/live_install2 ]; then
+ dir=`pwd`/Mandrake/mdkinst
+elif [ -x ../../../../../Mandrake/mdkinst/usr/bin/perl-install/live_install2 ]; then
+ dir=`pwd`/../../..
+else
+ echo >&2 "unable to get a working live system to start, check your working directory"
+ exit 2
+fi
+
+/bin/rm -rf /tmp/rhimage
+/bin/mkdir -m 0700 /tmp/rhimage || exit 1
+/bin/rm -rf /tmp/drakx
+/bin/mkdir -m 0700 /tmp/drakx || exit 2
+
+for i in Mandrake RPMS misc boot images VERSION
+do
+ /bin/ln -sf "$dir/../../$i" "/tmp/rhimage/$i"
+done
+
+/bin/cp -a "$dir/../../Mandrake/mdkinst" "/tmp/drakx"
+
+if [ -x "/tmp/drakx/mdkinst/usr/bin/perl-install/live_install2" ]; then
+ perlcoredir=/usr/lib/perl5/5.6.0/i386-linux/CORE
+ cd /tmp/drakx/mdkinst/usr/bin/perl-install
+ if [ -x $perlcoredir/libperl.so ]; then
+ /bin/mv $perlcoredir/libperl.so /tmp/drakx/mdkinst
+ fi
+ /bin/mkdir -p $perlcoredir
+ /bin/cp -a /tmp/drakx/mdkinst/$perlcoredir/libperl.so $perlcoredir/libperl.so
+
+ if [ -x /usr/bin/packdrake ]; then
+ /bin/mv /usr/bin/packdrake /tmp/drakx/mdkinst
+ fi
+ /bin/cp -a /tmp/drakx/mdkinst/usr/bin/packdrake /usr/bin/packdrake
+
+ for i in MonitorsDB CardsNames Cards+
+ do
+ if [ -e /usr/X11R6/lib/X11/$i ]; then
+ /bin/mv /usr/X11R6/lib/X11/$i /tmp/drakx/mdkinst
+ fi
+ /bin/cp -a /tmp/drakx/mdkinst/usr/X11R6/lib/X11/$i /usr/X11R6/lib/X11/$i
+ done
+
+ # gtk ressource for live.
+ export GTK_DATA_PREFIX=/tmp/drakx/mdkinst/usr
+
+ # get correct fonts for DrakX.
+ if [ -n "$DISPLAY" ]; then
+ xset +fp /tmp/drakx/mdkinst/usr/X11R6/lib/X11/fonts/
+ xset fp rehash
+ fi
+
+ # start DrakX, do not keep shell script in background else the CD is locked by it!!!
+ exec ../../../lib/ld-linux.so.2 ../perl ./live_install2
+fi
+
+echo >&2 "unable to get a working live system to start, check your working directory"
+exit 2
diff --git a/perl-install/live_install2 b/perl-install/live_install2
index 0773636ea..6745b12b1 100755
--- a/perl-install/live_install2
+++ b/perl-install/live_install2
@@ -9,4 +9,18 @@ $ENV{LD_LIBRARY_PATH} = "$dir/lib:$dir/usr/lib";
$ENV{PATH} = join(":", map { "$dir/$_" } split ":", "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin") . ":$ENV{PATH}";
$ENV{SHARE_PATH} = "$dir/usr/share";
-exec "../../../lib/ld-linux.so.2", "../perl", "./install2", "--live", @ARGV or die;
+system "../../../lib/ld-linux.so.2", "../perl", "./install2", "--live", @ARGV;
+
+$ENV{DISPLAY} and system "xset", "-fp", "/tmp/drakx/mdkinst/usr/X11R6/lib/X11/fonts/";
+foreach (qw(misc PEX Speedo Type1 mdk 75dpi 100dpi cyrillic)) {
+ -d "/usr/X11R6/lib/X11/fonts/$_" or next;
+ -e "/usr/X11R6/lib/X11/fonts/$_/fonts.dir" and next;
+ chdir "/usr/X11R6/lib/X11/fonts/$_";
+ system "mkfontdir";
+}
+$ENV{DISPLAY} and system "xset", "fp", "rehash";
+
+system "/bin/rm", "-rf", "/tmp/drakx";
+system "/bin/rm", "-rf", "/tmp/rhimage";
+
+exec "/bin/sync";
diff --git a/perl-install/log.pm b/perl-install/log.pm
index 0fe696f07..b049f5d49 100644
--- a/perl-install/log.pm
+++ b/perl-install/log.pm
@@ -1,34 +1,60 @@
+package log; # $Id$
+
use diagnostics;
use strict;
+use c;
-package log;
+#-#####################################################################################
+#- Globals
+#-#####################################################################################
my $logOpen = 0;
my $logDebugMessages = 0;
-1;
-sub fd() { fileno LOG }
+#-######################################################################################
+#- Functions
+#-######################################################################################
+sub F() { *LOG }
-sub l {
+sub l {
$logOpen or openLog();
- print LOG "* ", @_, "\n";
- print LOG2 "* ", @_, "\n";
+ if ($::isStandalone) {
+ c::syslog(join "", @_);
+ } elsif ($::isInstall) {
+ print LOG "* ", @_, "\n";
+ print LOG2 "* ", @_, "\n";
+ } else {
+ print STDERR @_, "\n";
+ }
}
sub ld { $logDebugMessages and &l }
sub w { &l }
sub openLog(;$) {
- if ($_[0]) { # useLocal
- open LOG, "> $_[0]" or die "no log possible :(";
- } else {
- open LOG, "> /dev/tty3" or open LOG, ">> /tmp/install.log" or die "no log possible :(";
- }
- open LOG2, ">> /tmp/ddebug.log" or die "no log possible :(";
- select((select(LOG), $| = 1)[0]);
- select((select(LOG2), $| = 1)[0]);
+ if ($::isStandalone) {
+ c::openlog("DrakX");
+ } elsif ($::isInstall) {
+ if ($_[0]) { #- useLocal
+ open LOG, "> $_[0]";# or die "no log possible :(";
+ } else {
+ open LOG, "> /dev/tty3" or open LOG, ">> /tmp/install.log";# or die "no log possible :(";
+ }
+ open LOG2, ">> /tmp/ddebug.log";# or die "no log possible :(";
+ select((select(LOG), $| = 1)[0]);
+ select((select(LOG2), $| = 1)[0]);
+ }
exists $ENV{DEBUG} and $logDebugMessages = 1;
$logOpen = 1;
}
-sub closeLog() { close LOG; close LOG2; }
+sub closeLog() {
+ if ($::isStandalone) {
+ c::closelog();
+ } else { close LOG; close LOG2; }
+}
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm
index d992f4dec..955019748 100644
--- a/perl-install/loopback.pm
+++ b/perl-install/loopback.pm
@@ -1,4 +1,4 @@
-package loopback;
+package loopback; # $Id$
use diagnostics;
use strict;
@@ -6,7 +6,7 @@ use strict;
#-######################################################################################
#- misc imports
#-######################################################################################
-use common qw(:common :system :file);
+use common qw(:common :system :file :functional);
use partition_table qw(:types);
use commands;
use fs;
@@ -19,65 +19,98 @@ sub file {
$part->{loopback_file};
}
-sub ffile { "$_[0]{device}{mntpoint}$_[0]{loopback_file}" }
-
sub loopbacks {
map { map { @{$_->{loopback} || []} } partition_table::get_normal_parts($_) } @_;
}
-sub format_part {
+sub carryRootLoopback {
my ($part) = @_;
- my $prefix = $::isStandalone ? '' : $::o->{prefix};
+ $_->{mntpoint} eq '/' and return 1 foreach @{$part->{loopback} || []};
+ 0;
+}
+
+sub carryRootCreateSymlink {
+ my ($part, $prefix) = @_;
+
+ carryRootLoopback($part) or return;
+
+ my $mntpoint = "$prefix$part->{mntpoint}";
+ unless (-e $mntpoint) {
+ eval { commands::mkdir_("-p", dirname($mntpoint)) };
+ #- do non-relative link for install, should be changed to relative link before rebooting
+ symlink "/initrd/loopfs", $mntpoint;
+
+ commands::mkdir_("-p", "/initrd/loopfs/lnx4win/boot");
+ symlink "/initrd/loopfs/lnx4win/boot", "$prefix/boot";
+ }
+ #- indicate kernel to keep initrd
+ mkdir "$prefix/initrd", 0755;
+}
+
+
+sub format_part {
+ my ($part, $prefix) = @_;
fs::mount_part($part->{device}, $prefix);
- my $f = create($part);
+ my $f = create($part, $prefix);
local $part->{device} = $f;
fs::real_format_part($part);
}
sub create {
- my ($part) = @_;
- my $f = "$part->{device}{mntpoint}$part->{loopback_file}";
+ my ($part, $prefix) = @_;
+ my $f = "$prefix$part->{device}{mntpoint}$part->{loopback_file}";
return $f if -e $f;
eval { commands::mkdir_("-p", dirname($f)) };
-
+
+ log::l("creating loopback file $f ($part->{size} sectors)");
+
local *F;
- open F, ">$f" or die "failed to create loopback file";
- for (my $nb = $part->{size}; $nb >= 0; $nb -= 8) { #- 8 * 512 = 4096 :)
- print F "\0" x 4096;
- }
+ sysopen F, $f, 2 | c::O_CREAT() or die "failed to create loopback file";
+ sysseek F, ($part->{size} << 9) - 1, 0 or die "failed to create loopback file";
+ syswrite F, "\0" or die "failed to create loopback file";
$f;
}
sub getFree {
- my ($part, $prefix) = @_;
+ my ($dir, $part) = @_;
+ my $freespace = $dir ?
+ 2 * (common::df($dir))[1] : #- df in KiB
+ $part->{size};
- unless ($part->{freespace}) {
- $part->{isFormatted} || !$part->{notFormatted} or return;
- isMountableRW($part) or return;
-
- my $dir = "/tmp/loopback_tmp";
- if ($part->{isMounted}) {
- $dir = ($prefix || '') . $part->{mntpoint};
- } else {
- mkdir $dir, 0700;
- fs::mount($part->{device}, $dir, type2fs($part->{type}), 'rdonly');
- }
- my $buf = ' ' x 20000;
- syscall_('statfs', $dir, $buf) or return;
- my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf;
- $_ *= $blocksize / 512 foreach $size, $free;
-
-
- unless ($part->{isMounted}) {
- fs::umount($dir);
- unlink $dir;
- }
-
- $part->{freespace} = $free;
- }
- $part->{freespace} - sum map { $_->{size} } @{$part->{loopback} || []};
+ $freespace - sum map { $_->{size} } @{$part->{loopback} || []};
+}
+
+#- returns the size of the loopback file if it already exists
+#- returns -1 is the loopback file can't be used
+sub verifFile {
+ my ($dir, $file, $part) = @_;
+ -e "$dir$file" and return -s "$dir$file";
+
+ $_->{loopback_file} eq $file and return -1 foreach @{$part->{loopback} || []};
+
+ undef;
+}
+
+sub prepare_boot {
+ my ($prefix) = @_;
+ my $r = readlink "$prefix/boot";
+ unlink "$prefix/boot";
+ mkdir "$prefix/boot", 0755;
+ [$r, $prefix];
+}
+
+sub save_boot {
+ my ($loop_boot, $prefix) = @{$_[0]};
+
+ $loop_boot or return;
+
+ my @files = glob_("$prefix/boot/*");
+ commands::cp("-f", @files, $loop_boot) if @files;
+ commands::rm("-rf", "$prefix/boot");
+ symlink $loop_boot, "$prefix/boot";
}
+
1;
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm
index a630cdd5c..b6aee8905 100644
--- a/perl-install/modparm.pm
+++ b/perl-install/modparm.pm
@@ -1,14 +1,26 @@
-package modparm;
+package modparm; # $Id$
+use diagnostics;
+use strict;
+
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:common :functional);
use log;
-my %modparm_hash;
-sub read_modparm_file($) {
- my ($file) = @_;
+
+#-######################################################################################
+#- Functions
+#-######################################################################################
+sub read_modparm_file {
+ my $file = -e "modparm.lst" ? "modparm.lst" : "$ENV{SHARE_PATH}/modparm.lst";
my @line;
- open F, $file;
+ my %modparm_hash;
+ local *F; open F, $file or log::l("missing $file: $!"), return;
+ local $_;
while (<F>) {
chomp;
@line = split ':';
@@ -19,62 +31,30 @@ sub read_modparm_file($) {
desc => $line [4],
};
}
- close F;
+ \%modparm_hash;
}
-sub get_options_result($;$) {
- my ($module,$value) = @_;
- my @names = keys %{$modparm_hash{$module}};
- my $options;
- my $result;
- my $i;
-
- for $i (0..$#$value) {
- $result = $ {$value->[$i]};
-
- if ($result != "") {
- $options .= "$names[$i]=$result ";
- }
- }
+sub get_options_result($@) {
+ my ($module, @value) = @_;
+ my $modparm_hash = modparm::read_modparm_file;
- return $options;
+ mapn {
+ my ($a, $b) = @_;
+ $a ? "$b=$a" : ()
+ } \@value, [ keys %{$modparm_hash->{$module}} ];
}
sub get_options_name($) {
my ($module) = @_;
- my @names = keys %{$modparm_hash{$module}};
- my @result;
- my $opttype;
- my $default;
-
- foreach (@names) {
- $opttype = $modparm_hash{$module}{$_}{type};
- $default = $modparm_hash{$module}{$_}{default};
+ my @names;
+ my $modparm_hash = modparm::read_modparm_file;
- if (defined($default)) {
- push @result, _("$_ ($opttype)[$default]");
- } else {
- push @result, _("$_ ($opttype)");
- }
+ while (my ($k, $v) = each %{$modparm_hash->{$module} || {}}) {
+ my $opttype = $v->{type};
+ my $default = $v->{default};
+ push @names, "$k ($v->{type})" . (defined($v->{default}) && "[$v->{default}]");
}
-
- return \@result;
+ @names;
}
-sub get_options_value($) {
- my ($module) = @_;
- my @names = keys %{$modparm_hash{$module}};
- my @result;
-
- for $i (0..$#names) {
- my $value = "";
-
- $result[$i] = \$value;
- }
-
- return \@result;
-}
-
-read_modparm_file("/tmp/modparm.txt");
-
1;
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index b6e2ebd9b..4494e366c 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -1,116 +1,57 @@
-package modules;
+package modules; # $Id$
-use diagnostics;
use strict;
-use vars qw(%loaded);
+use vars qw(%drivers);
-use common qw(:file);
-use log;
+use common qw(:common :file :system :functional);
use detect_devices;
use run_program;
-use pci;
+use log;
-%loaded = ();
+my %conf;
+my $scsi = 0;
my %deps = ();
-
-my @neOptions = (
- [ "io=", "Base IO port:", "0x300:0x280:0x320:0x340:0x360" ],
- [ "irq=", "IRQ level:", "" ],
-);
-
-my @de4x5Options = (
- [ "io=", "Base IO port:", "0x0b" ],
-);
-
-my @cdu31aOptions = (
- [ "cdu31a_port=", "Base IO port:", "" ],
- [ "cdu31a_irq=", "IRQ level:", "" ],
-);
-
-my @cm206Options = (
- [ "cm206=", "IO base, IRQ:", "" ],
-);
-
-my @mcdOptions = (
- [ "mcd=", "Base IO port:", "" ],
-);
-
-my @optcdOptions = (
- [ "optcd=", "Base IO port:", "" ],
-);
-
-my @fdomainOptions = (
- [ "setup_called=", "Use other options", "1" ],
- [ "port_base=", "Base IO port:", "0xd800" ],
- [ "interrupt_level=", "Interrupt level (IRQ):", "10" ],
-);
-
-my @sbpcdOptions = (
- [ "sbpcd=", "IO base, IRQ, label:", "" ],
-);
-
-my @parportPcOptions = (
- [ "io=", "Base IO port:", "0x378" ],
- [ "irq=", "IRQ level:", "7" ],
-);
-
-my %modules = (
- "8390" => [ 1, undef, 0, '' ],
- "cdu31a" => [ 0, \@cdu31aOptions, 0, '' ],
- "cm206" => [ 0, \@cm206Options, 0, '' ],
- "de4x5" => [ 1, \@de4x5Options, 'AUTOPROBE', "io=0" ],
- "ds" => [ 1, undef, 0, '' ],
- "fdomain" => [ 1, \@fdomainOptions, 0, '' ],
- "i82365" => [ 1, undef, 0, '' ],
- "isofs" => [ 1, undef, 0, '' ],
- "loop" => [ 1, undef, 0, '' ],
- "lp" => [ 1, undef, 0, '' ],
- "parport" => [ 1, undef, 0, '' ],
- "parport_pc" => [ 1, \@parportPcOptions, 0, "irq=7" ],
- "mcd" => [ 0, \@mcdOptions, 0, '' ],
- "ne" => [ 0, \@neOptions, 'FAKEAUTOPROBE', "io=0x300" ],
- "nfs" => [ 1, undef, 0, '' ],
- "optcd" => [ 0, \@optcdOptions, 0, '' ],
- "pcmcia_core" => [ 1, undef, 0, '' ],
- "sbpcd" => [ 1, \@sbpcdOptions, 0, '' ],
- "smbfs" => [ 1, undef, 0, '' ],
- "tcic" => [ 1, undef, 0, '' ],
- "vfat" => [ 1, undef, 0, '' ],
-);
-
my @drivers_by_category = (
-[ 0, \&detect_devices::hasEthernet, 'net', 'ethernet', {
+[ 'net', {
+arch() =~ /^sparc/ ? (
+ "myri_sbus" => "MyriCOM Gigabit Ethernet",
+ "sunbmac" => "Sun BigMac Ethernet",
+ "sunhme" => "Sun Happy Meal Ethernet",
+ "sunqe" => "Sun Quad Ethernet",
+) : arch =~ /alpha/ ? () : (
"3c509" => "3com 3c509",
"3c501" => "3com 3c501",
"3c503" => "3com 3c503",
"3c505" => "3com 3c505",
"3c507" => "3com 3c507",
"3c515" => "3com 3c515",
- "3c59x" => "3com 3c59x (Vortex)",
- "3c59x" => "3com 3c90x (Boomerang)",
+ "3c90x" => "3Com 3c90x (Cyclone/Hurricane/Tornado)",
"at1700" => "Allied Telesis AT1700",
"ac3200" => "Ansel Communication AC3200",
+ "acenic" => "AceNIC Gigabit Ethernet",
"pcnet32" => "AMD PC/Net 32",
- "apricot" => "Apricot 82596",
- "atp" => "ATP",
+ "82596" => "Apricot 82596",
+# "atp" => "ATP", # builtin the kernel
"e2100" => "Cabletron E2100",
- "tlan" => "Compaq Netelligent",
- "de4x5" => "Digital 425,434,435,450,500",
- "depca" => "Digital DEPCA and EtherWORKS",
- "ewrk3" => "Digital EtherWORKS 3",
- "tulip" => "Digital 21040 (Tulip)",
+# "tlan" => "Compaq Netelligent",
+ "cs89x0" => "CS89x0",
"de600" => "D-Link DE-600 pocket adapter",
"de620" => "D-Link DE-620 pocket adapter",
+ "dgrs" => "Digi International RightSwitch",
+ "depca" => "Digital DEPCA and EtherWORKS",
+ "ewrk3" => "Digital EtherWORKS 3",
+ "old_tulip" => "Digital 21040/21041/21140 (old Tulip driver)",
+ "tulip" => "Digital 21040/21041/21140 (Tulip)",
+ "eth16i" => "ICL EtherTeam 16i",
"epic100" => "EPIC 100",
+ "eexpress" => "Intel EtherExpress",
+ "eepro" => "Intel EtherExpress Pro",
+ "eepro100" => "Intel EtherExpress Pro 100", #- should run on sparc but no memory on floppy
"hp100" => "HP10/100VG any LAN ",
"hp" => "HP LAN/AnyLan",
"hp-plus" => "HP PCLAN/plus",
- "eth16i" => "ICL EtherTeam 16i",
- "eexpress" => "Intel EtherExpress",
- "eepro" => "Intel EtherExpress Pro",
- "eepro100" => "Intel EtherExpress Pro 100",
"lance" => "Lance",
"lne390" => "Mylex LNE390",
"ne" => "NE2000 and compatible",
@@ -119,212 +60,633 @@ my @drivers_by_category = (
"ni5010" => "NI 5010",
"ni52" => "NI 5210",
"ni65" => "NI 6510",
- "rtl8139" => "RealTek RTL8129/8139",
"es3210" => "Racal-Interlan ES3210",
- "rcpci45" => "RedCreek PCI45 LAN",
+ "rcpci" => "Red Creek Hardware VPN",
"epic100" => "SMC 83c170 EPIC/100",
+# "sktr" => "Syskonnect Token ring adaptor",
"smc9194" => "SMC 9000 series",
"smc-ultra" => "SMC Ultra",
"smc-ultra32" => "SMC Ultra 32",
+# "yellowfin" => "Symbios Yellowfin G-NIC",
"via-rhine" => "VIA Rhine",
+# "wavelan" => "AT&T WaveLAN & DEC RoamAbout DS", # TODO is a "AT&T GIS WaveLAN ISA" ?
"wd" => "WD8003, WD8013 and compatible",
+# "z85230" => "Z85x30",
+
+ "dmfe" => "dmfe",
+# "fmv18x" => "fmv18x",
+ "ibmtr" => "Token Ring Tropic",
+ "olympic" => "olympic",
+ "plip" => "PLIP (parallel port)",
+# "rl100a" => "rl100a",
+# "sb1000" => "sb1000",
+# "sbni" => "sbni",
+# "sis900" => "sis900",
+# "sk98lin" => "Syskonnect (Schneider & Koch)|Gigabit Ethernet",
+),
+ "3c59x" => "3com 3c59x (Vortex)",
+ "de4x5" => "Digital 425,434,435,450,500",
+ "rtl8139" => "RealTek RTL8129/8139",
+ "8139too" => "Realtek RTL-8139",
+}],
+[ 'net_raw', {
+ "8390" => "8390",
+ "af_packet" => "packet socket",
+ "nfs" => "Network File System (nfs)",
+ "lockd" => "lockd",
+ "parport" => "parport",
+ "parport_pc" => "parport_pc",
+ "sunrpc" => "sunrpc",
+}],
+[ 'isdn', {
+ "hisax" => "hisax",
+ "b1pci" => "b1pci",
}],
-[ 0, \&detect_devices::hasSCSI, 'scsi', undef, {
+[ 'scsi', {
+arch() =~ /^sparc/ ? (
+ "qlogicpti" => "Performance Technologies ISP",
+) : arch() =~ /alpha/ ? () : (
"aha152x" => "Adaptec 152x",
"aha1542" => "Adaptec 1542",
"aha1740" => "Adaptec 1740",
- "aic7xxx" => "Adaptec 2740, 2840, 2940",
"advansys" => "AdvanSys Adapters",
"in2000" => "Always IN2000",
"AM53C974" => "AMD SCSI",
- "megaraid" => "AMI MegaRAID",
"BusLogic" => "BusLogic Adapters",
"dtc" => "DTC 3180/3280",
- "eata_dma" => "EATA DMA Adapters",
- "eata_pio" => "EATA PIO Adapters",
"seagate" => "Future Domain TMC-885, TMC-950",
"fdomain" => "Future Domain TMC-16x0",
- "gdth" => "ICP Disk Array Controller",
- "ppa" => "Iomega PPA3 (parallel port Zip)",
+ "initio" => "Initio",
"g_NCR5380" => "NCR 5380",
"NCR53c406a" => "NCR 53c406a",
"53c7,8xx" => "NCR 53c7xx",
- "ncr53c8xx" => "NCR 53C8xx PCI",
- "pci2000" => "Perceptive Solutions PCI-2000",
- "pas16" => "Pro Audio Spectrum/Studio 16",
"qlogicfas" => "Qlogic FAS",
- "qlogicisp" => "Qlogic ISP",
"seagate" => "Seagate ST01/02",
- "t128" => "Trantor T128/T128F/T228",
- "u14-34f" => "UltraStor 14F/34F",
- "ultrastor" => "UltraStor 14F/24F/34F",
- "wd7000" => "Western Digital wd7000",
+# "t128" => "Trantor T128/T128F/T228",
+# "u14-34f" => "UltraStor 14F/34F",
+# "ultrastor" => "UltraStor 14F/24F/34F",
+# "wd7000" => "Western Digital wd7000",
+
+# "a100u2w" => "a100u2w",
+# "atp870u" => "atp870u (Acard/Artop)",
+# "dc395x_trm" => "dc395x_trm",
+# "psi240i" => "psi240i",
+# "qlogicfc" => "qlogicfc",
+# "sim710" => "sim710",
+ "sym53c416" => "sym53c416",
+# "tmscsim" => "tmscsim",
+),
+ "aic7xxx" => "Adaptec 2740, 2840, 2940",
+ "ncr53c8xx" => "NCR 53C8xx PCI",
+# "pci2000" => "Perceptive Solutions PCI-2000", # TODO
+ "qlogicisp" => "Qlogic ISP",
+ "sym53c8xx" => "Symbios 53c8xx",
}],
-[ 0, undef, 'cdrom', 'none', {
+[ 'scsi_raw', {
+ "scsi_mod" => "scsi_mod",
+ "sd_mod" => "sd_mod",
+#- "ide-mod" => "ide-mod",
+#- "ide-probe" => "ide-probe",
+#- "ide-probe-mod" => "ide-probe-mod",
+}],
+[ 'disk', {
+arch() =~ /^sparc/ ? (
+ "pluto" => "Sun SparcSTORAGE Array SCSI", #- name it "fc4:soc:pluto" ?
+) : arch() =~ /alpha/ ? () : (
+# "DAC960" => "Mylex DAC960",
+# "dpt_i2o" => "Distributed Tech SmartCache/Raid I-V Controller",
+ "megaraid" => "AMI MegaRAID",
+ "aacraid" => "AACxxx Raid Controller",
+# "cpqarray" => "Compaq Smart-2/P RAID Controller",
+# "gdth" => "ICP Disk Array Controller",
+# "ips" => "IBM ServeRAID controller",
+ "eata" => "EATA SCSI PM2x24/PM3224",
+ "eata_pio" => "EATA PIO Adapters",
+ "eata_dma" => "EATA DMA Adapters",
+ "ppa" => "Iomega PPA3 (parallel port Zip)",
+ "imm" => "Iomega Zip (new driver)",
+),
+}],
+[ 'disk_raw', {
+#- "ide-disk" => "IDE disk",
+}],
+[ 'cdrom', {
+arch() !~ /^sparc|alpha/ ? (
"sbpcd" => "SoundBlaster/Panasonic",
- "aztcd" => "Aztech CD",
- "bpcd" => "Backpack CDROM",
- "gscd" => "Goldstar R420",
- "mcd" => "Mitsumi",
- "mcdx" => "Mitsumi (alternate)",
+# "aztcd" => "Aztech CD",
+# "gscd" => "Goldstar R420",
+# "isp16" => "ISP16/MAD16/Mozart",
+# "mcd" => "Mitsumi", #- removed for space
+# "mcdx" => "Mitsumi (alternate)",
"optcd" => "Optics Storage 8000",
"cm206" => "Phillips CM206/CM260",
"sjcd" => "Sanyo",
"cdu31a" => "Sony CDU-31A",
"sonycd535" => "Sony CDU-5xx",
-}]
+) : (),
+}],
+[ 'cdrom_raw', {
+ "isofs" => "iso9660",
+ "ide-cd" => "ide-cd",
+ "sr_mod" => "SCSI CDROM support",
+ "cdrom" => "cdrom",
+}],
+[ 'sound', {
+arch() !~ /^sparc/ ? (
+ "cmpci" => "C-Media Electronics CMI8338A CMI8338B CMI8738",
+ "es1370" => "Ensoniq ES1370 [AudioPCI]",
+ "es1371" => "Ensoniq ES1371 [AudioPCI-97]",
+ "esssolo1" => "ESS Technology ES1969 Solo-1 Audiodrive",
+ "maestro" => "Maestro",
+ "nm256" => "Neomagic MagicMedia 256AV",
+ "pas16" => "Pro Audio Spectrum/Studio 16",
+ "via82cxxx" => "VIA VT82C686_5",
+ "sonicvibes" => "S3 SonicVibes",
+ "snd-card-ice1712" => "IC Ensemble Inc|ICE1712 [Envy24]",
+ "emu10k1" => "Creative Labs|SB Live! (audio)",
+# "au8820" => "Aureal Semiconductor|Vortex 1",
+# "au8830" => "Aureal Semiconductor|Vortex 2",
+ "snd-card-cs461x" => "Cirrus Logic|CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]",
+ "snd-card-ens1371" => "Ensoniq/Creative Labs ES1371",
+ "snd-card-es1938" => "ESS Technology|ES1969 Solo-1 Audiodrive",
+ "snd-card-fm801" => "Fortemedia, Inc|Xwave QS3000A [FM801]<>Fortemedia, Inc|FM801 PCI Audio",
+ "snd-card-intel8x0" => "Intel Corporation|82440MX AC'97 Audio Controller<>Intel Corporation",
+ "snd-card-rme96" => "Xilinx, Inc.|RME Digi96<>Xilinx, Inc.",
+ "snd-card-trident" => "Silicon Integrated Systems [SiS]|7018 PCI Audio",
+ "snd-card-via686a" => "VIA Technologies|VT82C686 [Apollo Super AC97/Audio]",
+ "snd-card-ymfpci" => "Yamaha Corporation|YMF-740",
+) : (),
+}],
+[ 'pcmcia', {
+arch() !~ /^sparc/ ? (
+ "ide_cs" => "ide_cs",
+ "fmvj18x_cs" => "fmvj18x_cs",
+ "fdomain_cs" => "fdomain_cs",
+ "netwave_cs" => "netwave_cs",
+# "serial_cs" => "serial_cs",
+ "wavelan_cs" => "wavelan_cs",
+ "pcnet_cs" => "pcnet_cs",
+# "aha152x_cs" => "aha152x_cs",
+ "xirc2ps_cs" => "xirc2ps_cs",
+ "3c574_cs" => "3c574_cs",
+ "qlogic_cs" => "qlogic_cs",
+ "nmclan_cs" => "nmclan_cs",
+ "ibmtr_cs" => "ibmtr_cs",
+# "dummy_cs" => "dummy_cs",
+# "memory_cs" => "memory_cs",
+ "ftl_cs" => "ftl_cs",
+ "smc91c92_cs" => "smc91c92_cs",
+ "3c589_cs" => "3c589_cs",
+# "parport_cs" => "parport_cs",
+ "3c575_cb" => "3c575_cb",
+ "apa1480_cb" => "apa1480_cb",
+ "cb_enabler" => "cb_enabler",
+ "epic_cb" => "epic_cb",
+# "iflash2+_mtd" => "iflash2+_mtd",
+# "iflash2_mtd" => "iflash2_mtd",
+# "memory_cb" => "memory_cb",
+# "serial_cb" => "serial_cb",
+# "sram_mtd" => "sram_mtd",
+ "tulip_cb" => "tulip_cb",
+
+) : (),
+}],
+[ 'pcmcia_everywhere', {
+arch() !~ /^sparc/ ? (
+ "pcmcia_core" => "PCMCIA core support",
+ "tcic" => "PCMCIA tcic controller",
+ "ds" => "PCMCIA card support",
+ "i82365" => "PCMCIA i82365 controller",
+) : (),
+}],
+[ 'paride', {
+arch() !~ /^sparc/ ? (
+ "aten" => "ATEN EH-100",
+ "bpck" => "Microsolutions backpack",
+ "comm" => "DataStor (older type) commuter adapter",
+ "dstr" => "DataStor EP-2000",
+ "epat" => "Shuttle EPAT",
+ "epia" => "Shuttle EPIA",
+ "fit2" => "Fidelity Intl. (older type)",
+ "fit3" => "Fidelity Intl. TD-3000",
+ "frpw" => "Freecom Power",
+ "friq" => "Freecom IQ (ASIC-2)",
+ "kbic" => "KingByte KBIC-951A and KBIC-971A",
+ "ktti" => "KT Tech. PHd",
+ "on20" => "OnSpec 90c20",
+ "on26" => "OnSpec 90c26",
+ "pd" => "Parallel port IDE disks",
+ "pcd" => "Parallel port CD-ROM",
+ "pf" => "Parallel port ATAPI disk",
+ "paride" => "Main parallel port module",
+) : (),
+}],
+[ 'raid', {
+ "linear" => "linear",
+ "raid0" => "raid0",
+ "raid1" => "raid1",
+ "raid5" => "raid5",
+}],
+[ 'mouse', {
+arch() !~ /^sparc/ ? (
+ "busmouse" => "busmouse",
+ "msbusmouse" => "msbusmouse",
+ "serial" => "serial",
+ "qpmouse" => "qpmouse",
+ "atixlmouse" => "atixlmouse",
+) : (),
+}],
+[ 'usb', {
+ "usb-uhci" => "USB (uhci)",
+ "usb-ohci" => "USB (ohci)",
+ "usb-ohci-hcd" => "USB (ohci-hcd)",
+}],
+[ 'fs', {
+ "smbfs" => "Windows SMB",
+ "fat" => "fat",
+ "msdos" => "msdos",
+ "romfs" => "romfs",
+ "vfat" => "vfat",
+}],
+[ 'other', {
+ "st" => "st",
+ "sg" => "sg",
+ "ide-scsi" => "ide-scsi",
+ "loop" => "Loopback device",
+ "lp" => "Parallel Printer",
+ "ide-floppy" => "ide-floppy",
+ "ide-tape" => "ide-tape",
+ "nbd" => "nbd",
+ "bttv" => "Brooktree Corporation|Bt8xx Video Capture",
+ "buz" => "Zoran Corporation|ZR36057PQC Video cutting chipset",
+ "rrunner" => "Essential Communications|Roadrunner serial HIPPI",
+ "defxx" => "DEC|DEFPA"
+#- "ide-probe-mod" => "ide-probe-mod",
+}],
);
-my %drivers = (
- "plip" => [ "PLIP (parallel port)", 0, \&detect_devices::hasPlip, 'net', 'plip' ],
- "ibmtr" => [ "Token Ring", 0, \&detect_devices::hasTokenRing, 'net', 'tr' ],
- "DAC960" => [ "Mylex DAC960", 0, undef, 'scsi', undef ],
- "pcmcia_core" => [ "PCMCIA core support", 0, undef, 'pcmcia', undef ],
- "ds" => [ "PCMCIA card support", 0, undef, 'pcmcia', undef ],
- "i82365" => [ "PCMCIA i82365 controller", 0, undef, 'pcmcia', undef ],
- "tcic" => [ "PCMCIA tcic controller", 0, undef, 'pcmcia', undef ],
- "isofs" => [ "iso9660", 0, undef, 'fs', undef ],
- "nfs" => [ "Network File System (nfs)", 0, undef, 'fs', undef ],
- "smbfs" => [ "Windows SMB", 0, undef, 'fs', undef ],
- "loop" => [ "Loopback device", 0, undef, 'other', undef ],
- "lp" => [ "Parallel Printer", 0, undef, 'other', undef ],
+my %type_aliases = (
+ scsi => 'disk',
);
+
+#my @skip_big_modules_on_stage1 =
+#qw(
+#acenic sk98lin
+#BusLogic seagate fdomain g_NCR5380 tmscsim
+#dpt_i2o gdth eata eata_pio eata_dma
+#aztcd gscd isp16 mcd mcdx optcd cm206 sjcd cdu31a
+#);
+my @skip_big_modules_on_stage1 =
+qw(
+acenic sk98lin
+BusLogic seagate fdomain g_NCR5380
+dpt_i2o eata eata_pio eata_dma
+optcd cm206 sjcd cdu31a
+);
+
+my @skip_modules_on_stage1 = (
+ arch() =~ /alpha/ ? qw(sb1000) : (),
+ "apa1480_cb",
+);
+
+
+my @drivers_fields = qw(text type);
+%drivers = ();
+
foreach (@drivers_by_category) {
- my @l = @$_;
- my $l = pop @l;
- foreach (keys %$l) { $drivers{$_} = [ $l->{$_}, @l ]; }
+ my ($type, $l) = @$_;
+ foreach (keys %$l) { $drivers{$_} = [ $l->{$_}, $type ]; }
+}
+while (my ($k, $v) = each %drivers) {
+ my %l; @l{@drivers_fields} = @$v;
+ $drivers{$k} = \%l;
+}
+
+sub module_of_type__4update_kernel {
+ my ($type) = @_;
+ $type = join "|", map { $_, $_ . "_raw" } split ' ', $type;
+ my %skip;
+ @skip{@skip_modules_on_stage1} = ();
+ @skip{@skip_big_modules_on_stage1} = () if $type !~ /big/;
+ "big" =~ /^($type)$/ ? @skip_big_modules_on_stage1 : (),
+ grep { !exists $skip{$_} } grep { $drivers{$_}{type} =~ /^($type)$/ } keys %drivers;
}
+sub module_of_type {
+ my ($type) = @_;
+ my $alias = $type_aliases{$type};
+ grep { $drivers{$_}{type} =~ /^(($type)|$alias)$/ } keys %drivers;
+}
+sub module2text { $drivers{$_[0]}{text} }
+sub get_alias {
+ my ($alias) = @_;
+ $conf{$alias}{alias};
+}
+sub get_options {
+ my ($name) = @_;
+ $conf{$name}{options};
+}
-1;
+sub add_alias {
+ my ($alias, $name) = @_;
+ $name =~ /ignore/ and return;
+ /\Q$alias/ && $conf{$_}{alias} && $conf{$_}{alias} eq $name and return $_ foreach keys %conf;
+ $alias .= $scsi++ || '' if $alias eq 'scsi_hostadapter';
+ log::l("adding alias $alias to $name");
+ $conf{$alias}{alias} ||= $name;
+ if ($name =~ /^snd-card-/) {
+ $conf{$name}{"post-install"} = "modprobe snd-pcm-oss";
+ }
+ if ($alias eq 'scsi_hostadapter') {
+ add_alias('block-major-11', $alias);
+ }
+ $alias;
+}
+sub remove_alias($) {
+ my ($name) = @_;
+ foreach (keys %conf) {
+ $conf{$_}{alias} && $conf{$_}{alias} eq $name or next;
+ delete $conf{$_}{alias};
+ return 1;
+ }
+ 0;
+}
-sub load($;$$) {
- my ($name, $type, $minor) = @_;
+sub when_load {
+ my ($name, $type, @options) = @_;
+ if ($type =~ /\bscsi\b/ || $type eq $type_aliases{scsi}) {
+ add_alias('scsi_hostadapter', $name), eval { load('sd_mod') };
+ }
+ $conf{$name}{options} = join " ", @options if @options;
+}
- $loaded{$name} and return;
+sub load {
+ my ($name, $type, @options) = @_;
- $type or ($type, $minor) = @{$drivers{$name}}[3,4];
+ my @netdev = detect_devices::getNet() if $type eq 'net';
+
+ if ($::testing) {
+ log::l("i try to install $name module (@options)");
+ } elsif ($::isStandalone || $::live) {
+ run_program::run("modprobe", $name, @options);
+ } else {
+ $conf{$name}{loaded} and return;
+
+ eval { load($_, 'prereq') } foreach @{$deps{$name}};
+ load_raw([ $name, @options ]);
+ }
+ sleep 2 if $name =~ /usb-storage|mousedev/;
+
+ if ($type eq 'net') {
+ add_alias($_, $name) foreach difference2([ detect_devices::getNet() ], \@netdev);
+ }
- foreach (@{$deps{$name}}) { load($_, 'prereq', $minor) }
- load_raw($name, $type, $minor);
+ when_load($name, $type, @options);
}
+sub load_multi {
+ my $f; $f = sub { map { $f->(@{$deps{$_}}), $_ } @_ };
+ my %l; my @l =
+ grep { !$conf{$_}{loaded} }
+ grep { my $o = $l{$_}; $l{$_} = 1; !$o }
+ $f->(@_);
-sub unload($) { run_program::run("/bin/rmmod", $_[0]); }
+ $::testing and log::l("i would install modules @l"), return;
-sub load_raw($$$@) {
- my ($name, $type, $minor, @options) = @_;
+ load_raw(map { [ $_ ] } @l);
+}
-# @options or @options = guiGetModuleOptions($name);
+sub unload {
+ my ($m) = @_;
+ if ($::testing) {
+ log::l("rmmod $m");
+ } else {
+ if (run_program::run("rmmod", $m)) {
+ delete $conf{$m}{loaded};
+ }
+ }
+}
- run_program::run("/usr/bin/insmod", "/modules/$name.o", @options) or die("insmod module $name");
+sub load_raw {
+ my @l = map { my ($i, @i) = @$_; [ $i, \@i ] } grep { $_->[0] !~ /ignore/ } @_;
+ my $cz = "/lib/modules" . (arch() eq 'sparc64' && "64") . ".cz"; -e $cz or $cz .= "2";
+ run_program::run("packdrake", "-x", $cz, "/tmp", map { "$_->[0].o" } @l);
+ my @failed = grep {
+ my $m = "/tmp/$_->[0].o";
+ if (-e $m && run_program::run(["insmod_", "insmod"], '2>', '/dev/tty5', '-f', $m, @{$_->[1]})) {
+ unlink $m;
+ $conf{$_->[0]}{loaded} = 1;
+ '';
+ } else {
+ log::l("missing module $_->[0]") unless -e $m;
+ -e $m;
+ }
+ } @l;
- # this is a hack to make plip go
- if ($name eq "parport_pc") {
- foreach (@options) {
- /^irq=(\d+)/ or next;
- log::l("writing to /proc/parport/0/irq");
- local *F;
- open F, "> /proc/parport/0/irq" or last;
- print F $1;
+ die "insmod'ing module " . join(", ", map { $_->[0] } @failed) . " failed" if @failed;
+
+ foreach (@l) {
+ if ($_->[0] eq "parport_pc") {
+ #- this is a hack to make plip go
+ foreach (@{$_->[1]}) {
+ /^irq=(\d+)/ and eval { output "/proc/parport/0/irq", $1 };
+ }
+ } elsif ($_->[0] =~ /usb-[uo]hci/) {
+ add_alias('usb-interface', $_->[0]);
+ eval {
+ require fs; fs::mount('/proc/bus/usb', '/proc/bus/usb', 'usbdevfs');
+ #- ensure keyboard is working, the kernel must do the job the BIOS was doing
+ sleep 2;
+ load_multi("usbkbd", "keybdev") if detect_devices::hasUsbKeyboard();
+ }
}
}
- $loaded{$name} = { type => $type, minor => $minor, options => \@options };
+}
+
+sub read_already_loaded() {
+ foreach (cat_("/proc/modules")) {
+ my ($name) = split;
+ $conf{$name}{loaded} = 1;
+ when_load($name, $drivers{$name}{type});
+ }
}
sub load_deps($) {
my ($file) = @_;
- local *F;
- open F, $file or log::l("error opening $file: $!"), return 0;
- foreach (<F>) {
+ local *F; open F, $file or log::l("error opening $file: $!"), return 0;
+ local $_;
+ while (<F>) {
my ($f, $deps) = split ':';
push @{$deps{$f}}, split ' ', $deps;
}
- 1;
}
-sub read_conf {
- my ($file) = @_;
+sub read_conf($;$) {
+ my ($file, $scsi) = @_;
+ my %c;
- local *F;
- open F, $file or log::l("failed to open $file for module information"), return 0;
-
- foreach (<F>) {
- /^alias\s+eth0\s+(\S+)/ and $loaded{$1} = { type => 'net', minor => 'ethernet' };
- /^alias\s+scsi_hostadapter\s+(\S+)/ and $loaded{$1} = { type => 'scsi' };
- /^option\s+(\S+)\s+(.*)/ and $loaded{$1} = { type => 'other', options => [ split ' ', $2 ] };
+ foreach (cat_($file)) {
+ do {
+ $c{$2}{$1} = $3;
+ $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter (\d*)/x && $scsi; #- space added to make perl2fcalls happy!
+ } if /^\s*(\S+)\s+(\S+)\s+(.*?)\s*$/;
+ }
+ #- cheating here: not handling aliases of aliases
+ while (my ($k, $v) = each %c) {
+ if (my $a = $v->{alias}) {
+ local $c{$a}{alias};
+ add2hash($c{$a}, $v);
+ }
}
- 1;
+ \%c;
+}
+
+sub mergein_conf {
+ my ($file) = @_;
+ my $modconfref = read_conf ($file, \$scsi);
+ map { my ($key, $value) = $_; $conf{$key}{alias} ||= $value->{alias} } %$modconfref;
}
sub write_conf {
- my ($file, $append) = @_;
- my ($tr, $eth, $scsi) = (0, 0, 0);
+ my ($prefix) = @_;
+
+ my $file = "$prefix/etc/modules.conf";
+ rename "$prefix/etc/conf.modules", $file; #- make the switch to new name if needed
- $::testing and return 1;
+ #- remove the post-install supermount stuff. We now do it in /etc/modules
+ # Substitute new aliases in modules.conf (if config has changed)
+ substInFile {
+ $_ = '' if /^post-install supermount/;
+ my ($type,$alias,$module) = split /\s+/, $_;
+ $_ = "$type $alias $conf{$alias}{alias} \n" if ($type ne "loaded" && $conf{$alias}{alias} && $conf{$alias}{alias} !~ /$module/);
+ } $file;
- $append or rename($file, "$file.orig"), log::l("backing up old conf.modules");
+ my $written = read_conf($file);
local *F;
- open F, ($append ? ">" : "") . "> $file" or die("cannot write module config file $file: $!\n");
-
- while (my ($k, $v) = each %loaded) {
- unless ($append && $v->{persistFlags}->{alias}) {
- if ($v->{type} eq 'net') {
- $v->{minor} eq 'tr' and print F "alias tr", $tr++, " $k\n";
- $v->{minor} eq 'ethernet' and print F "alias eth", $eth++, " $k\n";
- } elsif ($v->{type} eq 'scsi') {
- print F "alias scsi_hostadapter", $scsi++, " $k\n";
- }
- }
- unless ($append && $v->{persistFlags}->{options} || !$v->{options}) {
- print F "options $k ", join(' ', @{$v->{options}}), "\n";
+ open F, ">> $file" or die("cannot write module config file $file: $!\n");
+ while (my ($mod, $h) = each %conf) {
+ while (my ($type, $v2) = each %$h) {
+ print F "$type $mod $v2\n" if $v2 && $type ne "loaded" && !$written->{$mod}{$type};
}
}
+ my @l = map { "scsi_hostadapter$_" } '', 1..$scsi-1 if $scsi;
+ push @l, 'ide-floppy' if detect_devices::ide_zips();
+ push @l, 'bttv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall();
+ my $l = join '|', @l;
+ log::l("to put in modules @l");
+
+ substInFile {
+ $_ = '' if /$l/;
+ $_ = join '', map { "$_\n" } @l if eof;
+ } "$prefix/etc/modules";
+}
+
+sub read_stage1_conf {
+ mergein_conf($_[0]);
- print F "alias parport_lowlevel parport_pc\n";
- print F "pre-install pcmcia_core /etc/rc.d/init.d/pcmcia start\n";
- 1;
+ if (arch() =~ /sparc/) {
+ $conf{parport_lowlevel}{alias} ||= "parport_ax";
+ $conf{plip}{"pre-install"} ||= "modprobe parport_ax ; echo 7 > /proc/parport/0/irq"; #- TOCHECK
+ } else {
+ $conf{parport_lowlevel}{alias} ||= "parport_pc";
+ $conf{pcmcia_core}{"pre-install"} ||= "CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start";
+ $conf{plip}{"pre-install"} ||= "modprobe parport_pc ; echo 7 > /proc/parport/0/irq";
+ }
}
+sub load_thiskind {
+ my ($type, $f) = @_;
+
+ #- get_that_type returns the PCMCIA cards. It doesn't know they are already
+ #- loaded, so:
+ read_already_loaded();
+ grep {
+ $f->($_->{description}, $_->{driver}) if $f;
+ eval { load($_->{driver}, $type) };
+ $_->{error} = $@;
-sub load_thiskind($) {
+ !($@ && $_->{try});
+ } get_that_type($type),
+ $type =~ /scsi/ && arch() !~ /sparc/ ?
+ (map { +{ driver => $_, description => $_, try => 1 } }
+ detect_devices::hasUsbZip() ? "usb-storage" : (), "imm", "ppa") : ();
+}
+
+sub get_that_type {
my ($type) = @_;
- my @devs;
- my $found;
- log::l("in load_thiskind, type = $type");
+ grep {
+ my $l = $drivers{$_->{driver}};
+ ($_->{type} =~ /$type/ || $l && $l->{type} =~ /$type/) && detect_devices::check($_);
+ } detect_devices::probeall('');
+}
- unless ($type eq 'scsi' || $type eq 'net') {
- log::l("pci probing for $type devices");
- @devs = pci::probe($type);
- log::l("pci probe found " . scalar @devs . "$type devices");
+sub load_ide {
+ if (1) { #- add it back to support Ultra66 on ide modules.
+ load("ide-cd");
+ } else {
+ eval {
+ load("ide-mod", 'prereq', 'options="' . detect_devices::hasUltra66() . '"');
+ delete $conf{"ide-mod"}{options};
+ load_multi(qw(ide-probe ide-probe-mod ide-disk ide-cd));
+ }
}
+}
+
+sub configure_pcmcia {
+ my ($pcic) = @_;
+
+ #- try to setup pcmcia if cardmgr is not running.
+ -s "/var/run/stab" and return;
+
+ log::l("i try to configure pcmcia services");
+
+ symlink("/tmp/stage2/etc/pcmcia", "/etc/pcmcia") unless -e "/etc/pcmcia";
+ symlink("/sbin/install", "/sbin/cardmgr") unless -x "/sbin/cardmgr";
- my %devs;
- foreach (@devs) {
- my $m = $_->{module};
- $devs{$m}++ and log::l("multiple $m devices found"), next;
- $drivers{$m} or log::l("module $m not in install table"), next;
- log::l("found driver for $m");
- load($m);
- $found = 1;
+ eval {
+ load("pcmcia_core");
+ load($pcic);
+ load("ds");
+ };
+
+ #- run cardmgr in foreground while it is configuring the card.
+ run_program::run("cardmgr", "-f", "-m" ,"/modules");
+ sleep(3);
+
+ #- make sure to be aware of loaded module by cardmgr.
+ read_already_loaded();
+}
+
+sub get_pcmcia_devices {
+ my (@devs, $desc);
+
+ foreach (cat_("/var/run/stab")) {
+ if (/^Socket\s+\d+:\s+(.*)/) {
+ $desc = $1;
+ } else {
+ my (undef, $type, $module, undef, $device) = split;
+ push @devs, { description => $desc, driver => $module, type => $type, device => $device };
+ }
}
- pci::free(@devs);
- $found;
+ @devs;
}
-# This assumes only one of each driver type is loaded
-sub removeDeviceDriver {
-# my ($type) = @_;
-#
-# my @m = grep { $loaded{$_}->{type} eq $type } keys %loaded;
-# @m or return 0;
-# @m > 1 and log::l("removeDeviceDriver assume only one of each driver type is loaded, which is not the case (" . join(' ', @m) . ")");
-# removeModule($m[0]);
-# 1;
+sub write_pcmcia {
+ my ($prefix, $pcmcia) = @_;
+
+ #- should be set after installing the package above otherwise the file will be renamed.
+ setVarsInSh("$prefix/etc/sysconfig/pcmcia", {
+ PCMCIA => bool2yesno($pcmcia),
+ PCIC => $pcmcia,
+ PCIC_OPTS => "",
+ CORE_OPTS => "",
+ });
}
+
+1;
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index 3386654db..e6c6f3cc8 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -1,4 +1,4 @@
-package mouse;
+package mouse; # $Id$
use diagnostics;
use strict;
@@ -6,74 +6,280 @@ use strict;
#-######################################################################################
#- misc imports
#-######################################################################################
-use common qw(:common :system :functional);
+use common qw(:common :system :functional :file);
+use modules;
+use detect_devices;
+use run_program;
+use devices;
+use commands;
+use modules;
use log;
-my @mouses_fields = qw(nbuttons device MOUSETYPE XMOUSETYPE FULLNAME);
-my @mouses = (
- [ 0, "none", "none", "Microsoft", __("No Mouse") ],
- [ 2, "ttyS", "pnp", "Auto", __("Microsoft Rev 2.1A or higher (serial)") ],
- [ 3, "ttyS", "logim", "MouseMan", __("Logitech CC Series (serial)") ],
- [ 5, "ttyS", "pnp", "IntelliMouse", __("Logitech MouseMan+/FirstMouse+ (serial)") ],
- [ 5, "ttyS", "ms3", "IntelliMouse", __("ASCII MieMouse (serial)") ],
- [ 5, "ttyS", "ms3", "IntelliMouse", __("Genius NetMouse (serial)") ],
- [ 5, "ttyS", "ms3", "IntelliMouse", __("Microsoft IntelliMouse (serial)") ],
- [ 2, "ttyS", "MMSeries", "MMSeries", __("MM Series (serial)") ],
- [ 2, "ttyS", "MMHitTab", "MMHittab", __("MM HitTablet (serial)") ],
- [ 3, "ttyS", "Logitech", "Logitech", __("Logitech Mouse (serial, old C7 type)") ],
- [ 3, "ttyS", "MouseMan", "MouseMan", __("Logitech MouseMan/FirstMouse (serial)") ],
- [ 2, "ttyS", "Microsoft", "Microsoft", __("Generic Mouse (serial)") ],
- [ 2, "ttyS", "Microsoft", "Microsoft", __("Microsoft compatible (serial)") ],
- [ 3, "ttyS", "Microsoft", "Microsoft", __("Generic 3 Button Mouse (serial)") ],
- [ 2, "ttyS", "MouseSystems", "MouseSystems", __("Mouse Systems (serial)") ],
- [ 2, "psaux", "ps/2", "PS/2", __("Generic Mouse (PS/2)") ],
- [ 3, "psaux", "ps/2", "PS/2", __("Logitech MouseMan/FirstMouse (ps/2)") ],
- [ 3, "psaux", "ps/2", "PS/2", __("Generic 3 Button Mouse (PS/2)") ],
- [ 2, "psaux", "ps/2", "GlidePointPS/2", __("ALPS GlidePoint (PS/2)") ],
- [ 5, "psaux", "ps/2", "MouseManPlusPS/2", __("Logitech MouseMan+/FirstMouse+ (PS/2)") ],
- [ 5, "psaux", "ps/2", "ThinkingMousePS/2", __("Kensington Thinking Mouse (PS/2)") ],
- [ 5, "psaux", "ps/2", "NetMousePS/2", __("ASCII MieMouse (PS/2)") ],
- [ 5, "psaux", "netmouse", "NetMousePS/2", __("Genius NetMouse (PS/2)") ],
- [ 5, "psaux", "netmouse", "NetMousePS/2", __("Genius NetMouse Pro (PS/2)") ],
- [ 5, "psaux", "netmouse", "NetScrollPS/2", __("Genius NetScroll (PS/2)") ],
- [ 5, "psaux", "imps2", "IMPS/2", __("Microsoft IntelliMouse (PS/2)") ],
- [ 2, "atibm", "Busmouse", "BusMouse", __("ATI Bus Mouse") ],
- [ 2, "inportbm", "Busmouse", "BusMouse", __("Microsoft Bus Mouse") ],
- [ 3, "logibm", "Busmouse", "BusMouse", __("Logitech Bus Mouse") ],
+my @mouses_fields = qw(nbuttons MOUSETYPE XMOUSETYPE name);
+
+my %mice =
+ arch() =~ /^sparc/ ?
+(
+ 'sunmouse' =>
+ [ [ 'sunmouse' ],
+ [ [ 3, 'sun', 'sun', __("Sun - Mouse") ]
+ ]]
+) :
+(
+ 'PS/2' =>
+ [ [ 'psaux' ],
+ [ [ 2, 'ps/2', 'PS/2', __("Standard") ],
+ [ 5, 'ps/2', 'MouseManPlusPS/2', __("Logitech MouseMan+") ],
+ [ 5, 'imps2', 'IMPS/2', __("Generic PS2 Wheel Mouse") ],
+ [ 5, 'ps/2', 'GlidePointPS/2', __("GlidePoint") ],
+ '',
+ [ 5, 'ps/2', 'ThinkingMousePS/2', __("Kensington Thinking Mouse") ],
+ [ 5, 'netmouse', 'NetMousePS/2', __("Genius NetMouse") ],
+ [ 5, 'netmouse', 'NetScrollPS/2', __("Genius NetScroll") ],
+ ]],
+
+ 'USB' =>
+ [ [ 'usbmouse' ],
+ [ [ 2, 'ps/2', 'PS/2', __("Generic") ],
+ [ 5, 'ps/2', 'IMPS/2', __("Wheel") ],
+ ]],
+
+ __("serial") =>
+ [ [ map { "ttyS$_" } 0..3 ],
+ [ [ 2, 'Microsoft', 'Microsoft', __("Generic 2 Button Mouse") ],
+ [ 3, 'Microsoft', 'Microsoft', __("Generic 3 Button Mouse") ],
+ [ 5, 'ms3', 'IntelliMouse', __("Microsoft IntelliMouse") ],
+ [ 3, 'MouseMan', 'MouseMan', __("Logitech MouseMan") ],
+ [ 2, 'MouseSystems', 'MouseSystems', __("Mouse Systems") ],
+ '',
+ [ 3, 'logim', 'MouseMan', __("Logitech CC Series") ],
+ [ 5, 'pnp', 'IntelliMouse', __("Logitech MouseMan+/FirstMouse+") ],
+ [ 5, 'ms3', 'IntelliMouse', __("Genius NetMouse") ],
+ [ 2, 'MMSeries', 'MMSeries', __("MM Series") ],
+ [ 2, 'MMHitTab', 'MMHittab', __("MM HitTablet") ],
+ [ 3, 'Logitech', 'Logitech', __("Logitech Mouse (serial, old C7 type)") ],
+ [ 3, 'Microsoft', 'ThinkingMouse', __("Kensington Thinking Mouse") ],
+ ]],
+
+ __("busmouse") =>
+ [ [ arch() eq 'ppc' ? 'adbmouse' : ('atibm', 'inportbm', 'logibm') ],
+ [ [ 2, 'Busmouse', 'BusMouse', __("2 buttons") ],
+ [ 3, 'Busmouse', 'BusMouse', __("3 buttons") ],
+ ]],
+
+ __("none") =>
+ [ [ 'none' ],
+ [ [ 0, 'none', 'Microsoft', __("No mouse") ],
+ ]],
);
-map_index {
- my %l; @l{@mouses_fields} = @$_;
- $mouses[$::i] = \%l;
-} @mouses;
-sub names { map { $_->{FULLNAME} } @mouses }
-sub name2mouse {
- my ($name) = @_;
- foreach (@mouses) {
- return { %$_ } if $name eq $_->{FULLNAME};
+sub xmouse2xId {
+ #- xmousetypes must be sorted as found in /usr/include/X11/extensions/xf86misc.h
+ #- so that first mean "0", etc
+ my @xmousetypes = (
+ "Microsoft",
+ "MouseSystems",
+ "MMSeries",
+ "Logitech",
+ "BusMouse", #MouseMan,
+ "Logitech",
+ "PS/2",
+ "MMHittab",
+ "GlidePoint",
+ "IntelliMouse",
+ "ThinkingMouse",
+ "IMPS/2",
+ "ThinkingMousePS/2",
+ "MouseManPlusPS/2",
+ "GlidePointPS/2",
+ "NetMousePS/2",
+ "NetScrollPS/2",
+ "SysMouse",
+ "Auto",
+ "AceCad",
+ "WSMouse",
+ "USB",
+ );
+ my ($id) = @_;
+ $id = 'BusMouse' if $id eq 'MouseMan';
+ my $i; map_index { $_ eq $id and $i = $::i } @xmousetypes; $i;
+}
+
+sub raw2mouse {
+ my ($type, $raw) = @_;
+ $raw or return;
+
+ my %l; @l{@mouses_fields} = @$raw;
+ +{ %l, type => $type };
+}
+
+sub fullnames {
+ map_each {
+ my $type = $::a;
+ grep {$_} map {
+ if ($_) {
+ my $l = raw2mouse($type, $_);
+ "$type|$l->{name}";
+ } else {
+ $type .= "|[" . _("Other") . "]";
+ '';
+ }
+ } @{$::b->[1]}
+ } %mice;
+}
+
+sub fullname2mouse {
+ my ($fname, %opts) = @_;
+ my ($type, @l) = split '\|', $fname;
+ my ($name) = pop @l;
+ $opts{device} ||= $mice{$type}[0][0];
+ foreach (@{$mice{$type}[1]}) {
+ my $l = raw2mouse($type, $_);
+ $name eq $l->{name} and return { %$l, %opts };
}
- die "$name not found";
+ die "$fname not found ($type, $name)";
}
-sub serial_ports_names {
- map { "ttyS" . ($_ - 1) . " / COM$_" } 1..4;
+sub serial_ports() { map { "ttyS$_" } 0..7 }
+sub serial_port2text {
+ $_[0] =~ /ttyS (\d+)/x;
+ "$_[0] / COM" . ($1 + 1);
}
-sub serial_ports_names2dev {
- local ($_) = @_;
- /(\w+)/;
+
+sub read {
+ my ($prefix) = @_;
+ my %mouse = getVarsFromSh "$prefix/etc/sysconfig/mouse";
+ eval { add2hash_(\%mouse, fullname2mouse($mouse{FULLNAME})) };
+ $mouse{device} = readlink "$prefix/dev/mouse" or log::l("reading $prefix/dev/mouse symlink failed");
+ $mouse{nbuttons} = $mouse{XEMU3} eq "yes" ? 2 : $mouse{WHEEL} eq "yes" ? 5 : 3;
+ \%mouse;
+}
+
+sub write {
+ my ($prefix, $mouse) = @_;
+ local $mouse->{FULLNAME} = qq("$mouse->{type}|$mouse->{name}");
+ local $mouse->{XEMU3} = bool2yesno($mouse->{nbuttons} < 3);
+ local $mouse->{WHEEL} = bool2yesno($mouse->{nbuttons} > 3);
+ setVarsInSh("$prefix/etc/sysconfig/mouse", $mouse, qw(MOUSETYPE XMOUSETYPE FULLNAME XEMU3 WHEEL device));
+ symlinkf $mouse->{device}, "$prefix/dev/mouse" or log::l("creating $prefix/dev/mouse symlink failed");
}
-sub read($) { getVarsFromSh $_[0]; }
+sub mouseconfig {
+ my ($t, $mouse, $wacom);
-sub write($;$) {
- my ($mouse, $prefix) = @_;
- setVarsInSh("$prefix/etc/sysconfig/mouse", $mouse, qw(MOUSETYPE XMOUSETYPE FULLNAME XEMU3));
- symlink $mouse->{device}, "$prefix/dev/mouse" or log::l("creating $prefix/dev/mouse symlink failed");
+ #- Whouah! probing all devices from ttyS0 to ttyS3 once a time!
+ detect_devices::probeSerialDevices();
+
+ #- check new probing methods keep everything used here intact!
+ foreach (0..3) {
+ $t = detect_devices::probeSerial("/dev/ttyS$_");
+ if ($t->{CLASS} eq 'MOUSE') {
+ $t->{MFG} ||= $t->{MANUFACTURER};
+
+ $mouse = fullname2mouse("serial|Microsoft IntelliMouse") if $t->{MFG} eq 'MSH' && $t->{MODEL} eq '0001';
+ $mouse = fullname2mouse("serial|Logitech MouseMan") if $t->{MFG} eq 'LGI' && $t->{MODEL} =~ /^80/;
+ $mouse = fullname2mouse("serial|Genius NetMouse") if $t->{MFG} eq 'KYE' && $t->{MODEL} eq '0003';
+
+ $mouse ||= fullname2mouse("serial|Generic 2 Button Mouse"); #- generic by default.
+ $mouse->{device} = "ttyS$_";
+ last;
+ } elsif ($t->{CLASS} eq "PEN" || $t->{MANUFACTURER} eq "WAC") {
+ $wacom = "ttyS$_";
+ }
+ }
+ $mouse, $wacom;
}
sub detect() {
- my %l;
- @l{qw(FULLNAME nbuttons MOUSETYPE XMOUSETYPE device)} = split("\n", `mouseconfig --nointeractive 2>/dev/null`) or die "mouseconfig failed";
- \%l;
+ if (arch() =~ /^sparc/) {
+ return fullname2mouse("sunmouse|Sun - Mouse");
+ }
+ if (arch() eq "ppc") {
+ return fullname2mouse(detect_devices::hasMousePS2("usbmouse") ?
+ "USB|Generic" :
+ # No need to search for an ADB mouse. If I did, the PPC kernel would
+ # find one whether or not I had one installed! So.. default to it.
+ "busmouse|2 buttons");
+ }
+
+ if ($::isStandalone) {
+ detect_devices::hasMousePS2("psaux") and return fullname2mouse("PS/2|Standard", unsafe => 1);
+ }
+
+ #- probe serial device to make sure a wacom has been detected.
+ eval { commands::modprobe("serial") };
+ my ($r, $wacom) = mouseconfig(); return ($r, $wacom) if $r;
+
+ if (!$::isStandalone) {
+ detect_devices::hasMousePS2("psaux") and return fullname2mouse("PS/2|Standard", unsafe => 1), $wacom;
+ }
+
+ if (modules::get_alias("usb-interface") && detect_devices::hasUsbMouse()) {
+ eval {
+ modules::load("usbmouse");
+ modules::load("mousedev");
+ };
+ !$@ && detect_devices::tryOpen("usbmouse") and return fullname2mouse("USB|Generic"), $wacom;
+ eval {
+ modules::unload("mousedev");
+ modules::unload("usbmouse");
+ }
+ }
+
+ #- in case only a wacom has been found, assume an inexistant mouse (necessary).
+ $wacom and return { CLASS => 'MOUSE',
+ nbuttons => 2,
+ device => "nothing",
+ MOUSETYPE => "Microsoft",
+ XMOUSETYPE => "Microsoft"}, $wacom;
+
+ #- defaults to generic serial mouse on ttyS0.
+ #- Oops? using return let return a hash ref, if not using it, it return a list directly :-)
+ return fullname2mouse("serial|Generic 2 Button Mouse", unsafe => 1);
+}
+
+#- write_conf : write the mouse infos into the Xconfig files.
+#- input :
+#- $mouse : the hashtable containing the informations
+#- $mouse input
+#- $mouse->{nbuttons} : number of buttons : integer
+#- $mouse->{device} : device of the mouse : string : ex 'psaux'
+#- $mouse->{XMOUSETYPE} : type of the mouse for gpm : string : ex 'PS/2'
+#- $mouse->{type} : type (generic ?) of the mouse : string : ex 'PS/2'
+#- $mouse->{name} : name of the mouse : string : ex 'Standard'
+#- $mouse->{MOUSETYPE} : type of the mouse : string : ex "ps/2"
+#- $mouse->{XEMU3} : emulate 3rd button : string : 'yes' or 'no'
+sub write_conf {
+ my ($mouse) = @_;
+
+ mouse::write('', $mouse);
+ modules::write_conf('') if $mouse->{device} eq "usbmouse" && !$::testing;
+
+ my $f = "/etc/X11/XF86Config";
+ my $g = "/etc/X11/XF86Config-4";
+
+ my @zaxis = (
+ $mouse->{nbuttons} > 3 ? [ "ZAxisMapping", "4 5" ] : (),
+ $mouse->{nbuttons} > 5 ? [ "ZAxisMapping", "6 7" ] : (),
+ $mouse->{nbuttons} < 3 ? ([ "Emulate3Buttons" ], [ "Emulate3Timeout", "50" ]) : ()
+ );
+
+ my $zaxis = join('', map { qq(\n $_->[0]) . ($_->[1] && qq( $_->[1])) } @zaxis);
+ substInFile {
+ if (/^Section\s+"Pointer"/ .. /^EndSection/) {
+ $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line
+ s|^(\s*Protocol\s+).*|$1"$mouse->{XMOUSETYPE}"|;
+ s|^(\s*Device\s+).*|$1"/dev/mouse"$zaxis|;
+ }
+ } $f if -e $f && !$::testing;
+
+ $zaxis = join('', map { qq(\n Option "$_->[0]") . ($_->[1] && qq( "$_->[1]")) } @zaxis);
+ substInFile {
+ if (/Identifier\s+"Mouse1"/ .. /^EndSection/) {
+ $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line
+ s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{XMOUSETYPE}"|;
+ s|^(\s*Option\s+"Device"\s+).*|$1"/dev/mouse"$zaxis|;
+ }
+ } $g if -e $g && !$::testing;
}
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index a6f1101d5..be66c9ca6 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -1,146 +1,305 @@
-package my_gtk;
+#-########################################################################
+#- Pixel's implementation of Perl-GTK :-) [DDX]
+#-########################################################################
+package my_gtk; # $Id$
use diagnostics;
use strict;
-use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);
+use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- all => [ qw(create_window create_yesorno createScrolledWindow create_menu create_notebook create_packtable create_hbox create_adjustment mymain my_signal_connect mypack mypack_ myappend myadd label_align myset_usize myset_justify myshow mysync myflush mydestroy) ],
+ helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ],
+ wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtksetstyle gtkappend gtkadd gtkput gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkcreate_xpm) ],
+ ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ask_file) ],
);
+$EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ];
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
use Gtk;
+use c;
+use log;
+use common qw(:common :functional);
-1;
+my $forgetTime = 1000; #- in milli-seconds
+$border = 5;
+1;
+#-###############################################################################
+#- OO stuff
+#-###############################################################################
sub new {
- my ($type, $title, @opts) = @_;
+ my ($type, $title, %opts) = @_;
Gtk->init;
- parse Gtk::Rc "$ENV{HOME}/etc/any/Gtkrc";
- my $o = bless { @opts }, $type;
- $o->{window} = $o->create_window($title);
+ Gtk->set_locale;
+ my $o = bless { %opts }, $type;
+ $o->_create_window($title);
+ while (my $e = shift @tempory::objects) { $e->destroy }
+ push @interactive::objects, $o unless $opts{no_interactive_objects};
+ $o->{rwindow}->set_position('center_always') if $::isStandalone;
+ $o->{rwindow}->set_modal(1) if $my_gtk::grab || $o->{grab};
$o;
}
-sub destroy($) {
+sub main($;$) {
+ my ($o, $f) = @_;
+ gtkset_mousecursor_normal();
+ my $timeout = Gtk->timeout_add(1000, sub { gtkset_mousecursor_normal(); 1 });
+ my $b = before_leaving { Gtk->timeout_remove($timeout) };
+ $o->show;
+
+ do {
+ local $::setstep = 1;
+ Gtk->main;
+ } while ($o->{retval} && $f && !&$f());
+ $o->destroy;
+ $o->{retval}
+}
+sub show($) {
my ($o) = @_;
- $o->{window}->destroy;
- myflush();
+ $o->{window}->show;
+ $o->{rwindow}->show;
+}
+sub destroy($) {
+ my ($o) = @_;
+ $o->{rwindow}->destroy;
+ gtkset_mousecursor_wait();
+ flush();
+}
+sub DESTROY { goto &destroy }
+sub sync($) {
+ my ($o) = @_;
+ show($o);
+ flush();
+}
+sub flush {
+ Gtk->main_iteration while Gtk->events_pending;
}
-sub ask_from_entry($$@) {
- my ($o, @msgs) = @_;
- my $entry = new Gtk::Entry;
- my $f = sub { $o->{retval} = $entry->get_text; Gtk->main_quit };
+sub gtkshow($) { $_[0]->show; $_[0] }
+sub gtkdestroy($) { $_[0] and $_[0]->destroy }
+sub gtkset_usize($$$) { $_[0]->set_usize($_[1],$_[2]); $_[0] }
+sub gtkset_justify($$) { $_[0]->set_justify($_[1]); $_[0] }
+sub gtkset_active($$) { $_[0]->set_active($_[1]); $_[0] }
- myadd($o->{window},
- mypack($o->create_box_with_title(@msgs),
- my_signal_connect($entry, 'activate' => $f),
- ($o->{hide_buttons} ? () : mypack(new Gtk::HBox(0,0),
- my_signal_connect(new Gtk::Button('Ok'), 'clicked' => $f),
- my_signal_connect(new Gtk::Button('Cancel'), 'clicked' => sub { $o->{retval} = undef; Gtk->main_quit }),
- )),
- ),
- );
- $entry->grab_focus();
- mymain($o);
+sub gtksignal_connect($@) {
+ my $w = shift;
+ $w->signal_connect(@_);
+ $w
+}
+sub gtkpack($@) {
+ my $box = shift;
+ gtkpack_($box, map {; 1, $_ } @_);
+}
+sub gtkpack__($@) {
+ my $box = shift;
+ gtkpack_($box, map {; 0, $_ } @_);
+}
+sub gtkpack_($@) {
+ my $box = shift;
+ for (my $i = 0; $i < @_; $i += 2) {
+ my $l = $_[$i + 1];
+ ref $l or $l = new Gtk::Label($l);
+ $box->pack_start($l, $_[$i], 1, 0);
+ $l->show;
+ }
+ $box
+}
+sub gtkpack2($@) {
+ my $box = shift;
+ gtkpack2_($box, map {; 1, $_ } @_);
+}
+sub gtkpack2__($@) {
+ my $box = shift;
+ gtkpack2_($box, map {; 0, $_ } @_);
+}
+sub gtkpack3 {
+ my $a = shift;
+ $a && goto \&gtkpack2__;
+ goto \&gtkpack2;
+}
+sub gtkpack2_($@) {
+ my $box = shift;
+ for (my $i = 0; $i < @_; $i += 2) {
+ my $l = $_[$i + 1];
+ ref $l or $l = new Gtk::Label($l);
+ $box->pack_start($l, $_[$i], 0, 0);
+ $l->show;
+ }
+ $box
+}
+sub gtksetstyle {
+ my ($w, $s) = @_;
+ $w->set_style($s);
+ $w;
+}
+
+sub gtkappend($@) {
+ my $w = shift;
+ foreach (@_) {
+ my $l = $_;
+ ref $l or $l = new Gtk::Label($l);
+ $w->append($l);
+ $l->show;
+ }
+ $w
+}
+sub gtkadd($@) {
+ my $w = shift;
+ foreach (@_) {
+ my $l = $_;
+ ref $l or $l = new Gtk::Label($l);
+ $w->add($l);
+ $l->show;
+ }
+ $w
+}
+sub gtkput {
+ my ($w, $w2, $x, $y) = @_;
+ $w->put($w2, $x, $y);
+ $w2->show;
+ $w
+}
+
+sub gtktext_insert($$) {
+ my ($w, $t) = @_;
+ $w->freeze;
+ $w->backward_delete($w->get_length);
+ $w->insert(undef, undef, undef, "$t\n"); #- needs \n otherwise in case of one line text the beginning is not shown (even with the vadj->set_value)
+ $w->set_word_wrap(1);
+#- $w->vadj->set_value(0);
+ $w->thaw;
+ $w;
}
+sub gtkroot {
+ Gtk->init;
+ Gtk->set_locale;
+ Gtk::Gdk::Window->new_foreign(Gtk::Gdk->ROOT_WINDOW);
+}
-sub ask_from_list($\@$@) {
- my ($o, $l, @msgs) = @_;
- my $f = sub { $o->{retval} = $_[1]; Gtk->main_quit };
- my @l = map { my_signal_connect(new Gtk::Button($_), "clicked" => $f, $_) } @$l;
+sub gtkcolor($$$) {
+ my ($r, $g, $b) = @_;
-# myadd($o->{window},
-# mypack_(myset_usize(new Gtk::VBox(0,0), 0, 200),
-# 0, $o->create_box_with_title(@msgs),
-# 1, createScrolledWindow(mypack(new Gtk::VBox(0,0), @l))));
- myadd($o->{window},
- mypack($o->create_box_with_title(@msgs), @l));
- $l[0]->grab_focus();
- mymain($o)
+ my $color = bless { red => $r, green => $g, blue => $b }, 'Gtk::Gdk::Color';
+ gtkroot()->get_colormap->color_alloc($color);
}
+sub gtkset_mousecursor {
+ my ($type, $w) = @_;
+ ($w || gtkroot())->set_cursor(Gtk::Gdk::Cursor->new($type));
+}
+sub gtkset_mousecursor_normal { gtkset_mousecursor(68, @_) }
+sub gtkset_mousecursor_wait { gtkset_mousecursor(150, @_) }
-sub ask_warn($@) {
- my ($o, @msgs) = @_;
+sub gtkset_background {
+ my ($r, $g, $b) = @_;
- myadd($o->{window},
- mypack($o->create_box_with_title(@msgs),
- my_signal_connect(my $w = new Gtk::Button("Ok"), "clicked" => sub { Gtk->main_quit }),
- ),
- );
- $w->grab_focus();
- mymain($o)
+ my $root = gtkroot();
+ my $gc = Gtk::Gdk::GC->new($root);
+
+ my $color = gtkcolor($r, $g, $b);
+ $gc->set_foreground($color);
+ $root->set_background($color);
+
+ my ($h, $w) = $root->get_size;
+ $root->draw_rectangle($gc, 1, 0, 0, $w, $h);
}
-sub ask_yesorno($@) {
- my ($o, @msgs) = @_;
+sub gtkset_default_fontset {
+ my ($fontset) = @_;
- myadd($o->{window},
- mypack(create_box_with_title($o, @msgs),
- create_yesorno($o),
- )
- );
- $o->{ok}->grab_focus();
- mymain($o)
+ my $style = Gtk::Widget->get_default_style;
+ my $f = Gtk::Gdk::Font->fontset_load($fontset) or die '';
+ $style->font($f);
+ Gtk::Widget->set_default_style($style);
}
-sub create_window($$) {
- my ($o, $title) = @_;
- $o->{window} = new Gtk::Window;
- $o->{window}->set_title($title);
- $o->{window}->signal_connect("delete_event" => sub { $o->{retval} = undef; Gtk->main_quit });
- $o->{window}
+sub gtkctree_children {
+ my ($node) = @_;
+ my @l;
+ $node or return;
+ for (my $p = $node->row->children; $p; $p = $p->row->sibling) {
+ push @l, $p;
+ }
+ @l;
}
-sub create_yesorno($) {
- my ($w) = @_;
+sub gtkcreate_xpm { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm($w->window, $w->style->bg('normal'), @_) }
+sub xpm_d { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm_d($w->window, undef, @_) }
+sub gtkxpm { new Gtk::Pixmap(gtkcreate_xpm(@_)) }
- myadd(create_hbox(),
- my_signal_connect($w->{ok} = new Gtk::Button("Ok"), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }),
- my_signal_connect(new Gtk::Button("Cancel"), "clicked" => sub { $w->{retval} = 0; Gtk->main_quit }),
- );
+#-###############################################################################
+#- createXXX functions
+
+#- these functions return a widget
+#-###############################################################################
+
+sub create_okcancel {
+ my ($w, $ok, $cancel, $spread) = @_;
+ my $one = ($ok xor $cancel);
+ $spread ||= $::isWizard ? "edge" : "spread";
+ $ok ||= $::isWizard ? _("Next ->") : _("Ok");
+
+ my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), clicked => $w->{ok_clicked} || sub { $::isWizard or $w->{retval} = 1; Gtk->main_quit });
+ my $b2 = !$one && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel || _("Cancel")), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit });
+ my @l = grep { $_ } $::isWizard ? ($b2, $b1) : ($b1, $b2);
+
+ $_->can_default($::isWizard) foreach @l;
+ gtkadd(create_hbox($spread), @l);
}
sub create_box_with_title($@) {
my $o = shift;
- $o->{box} = mypack(new Gtk::VBox(0,0),
- map({ new Gtk::Label(" $_ ") } @_),
- new Gtk::HSeparator,
- )
+
+ my $nb_lines = map { split "\n" } @_;
+ $o->{box} = (@_ <= 2 && $nb_lines > 4) ?
+ gtkpack(new Gtk::VBox(0,0),
+ gtkset_usize(createScrolledWindow(gtktext_insert(new Gtk::Text, join "\n", @_)), 400, min(250, $nb_lines * 20))) :
+ gtkpack_(new Gtk::VBox(0,0),
+ (map {
+ my $w = ref $_ ? $_ : new Gtk::Label($_);
+ $w->set_name("Title");
+ 0, $w;
+ } map { ref $_ ? $_ : warp_text($_) } @_),
+ 0, new Gtk::HSeparator,
+ );
}
sub createScrolledWindow($) {
+ my ($W) = @_;
my $w = new Gtk::ScrolledWindow(undef, undef);
$w->set_policy('automatic', 'automatic');
- $w->add_with_viewport($_[0]);
- $_[0]->show;
+ member(ref $W, qw(Gtk::CList Gtk::CTree Gtk::Text)) ?
+ $w->add($W) :
+ $w->add_with_viewport($W);
+ $W->can("set_focus_vadjustment") and $W->set_focus_vadjustment($w->get_vadjustment);
+ $W->show;
$w
}
sub create_menu($@) {
my $title = shift;
my $w = new Gtk::MenuItem($title);
- $w->set_submenu(myshow(myappend(new Gtk::Menu, @_)));
+ $w->set_submenu(gtkshow(gtkappend(new Gtk::Menu, @_)));
$w
}
+sub add2notebook {
+ my ($n, $title, $book) = @_;
+
+ my ($w1, $w2) = map { new Gtk::Label($_) } $title, $title;
+ $book->{widget_title} = $w1;
+ $n->append_page_menu($book, $w1, $w2);
+ $book->show;
+ $w1->show;
+ $w2->show;
+}
+
sub create_notebook(@) {
my $n = new Gtk::Notebook;
- while (@_) {
- my $title = shift;
- my $book = shift;
-
- my ($w1, $w2) = map { new Gtk::Label($_) } $title, $title;
- $n->append_page_menu($book, $w1, $w2);
- $book->show;
- $w1->show;
- $w2->show;
- }
+ add2notebook($n, splice(@_, 0, 2)) while @_;
$n
}
@@ -152,17 +311,17 @@ sub create_adjustment($$$) {
sub create_packtable($@) {
my $options = shift;
my $w = new Gtk::Table(0, 0, $options->{homogeneous} || 0);
- my $i = 0; foreach (@_) {
- for (my $j = 0; $j < @$_; $j++) {
- if (defined $_->[$j]) {
- my $l = $_->[$j];
- ref $l or $l = new Gtk::Label($l);
- $w->attach_defaults($l, $j, $j + 1, $i, $i + 1);
- $l->show;
+ map_index {
+ my ($i) = @_;
+ map_index {
+ my ($j) = @_;
+ if (defined $_) {
+ ref $_ or $_ = new Gtk::Label($_);
+ $w->attach_defaults($_, $j, $j + 1, $i, $i + 1);
+ $_->show;
}
- }
- $i++;
- }
+ } @$_;
+ } @_;
$w->set_col_spacings($options->{col_spacings} || 0);
$w->set_row_spacings($options->{row_spacings} || 0);
$w
@@ -170,92 +329,370 @@ sub create_packtable($@) {
sub create_hbox {
my $w = new Gtk::HButtonBox;
+ $w->set_layout($_[0] || "spread");
+ $w;
+}
+sub create_vbox {
+ my $w = new Gtk::VButtonBox;
$w->set_layout(-spread);
$w;
}
-sub mymain($) {
- my $o = shift;
- $o->{window}->show;
- Gtk->main;
- $o->{window}->destroy;
- myflush();
- $o->{retval}
-}
+sub _create_window($$) {
+ my ($o, $title) = @_;
+ my $w = new Gtk::Window;
+ my $f = new Gtk::Frame(undef);
+ $w->set_name("Title");
+ gtkadd($w, $f);
+
+ $w->set_title($title);
+
+ $w->signal_connect(expose_event => sub { c::XSetInputFocus($w->window->XWINDOW); }) if $my_gtk::force_focus || $o->{force_focus};
+ $w->signal_connect(delete_event => sub { undef $o->{retval}; Gtk->main_quit });
+ $w->set_uposition(@{$my_gtk::force_position || $o->{force_position}}) if $my_gtk::force_position || $o->{force_position};
+
+ $w->signal_connect(focus => sub { Gtk->idle_add(sub { $w->ensure_focus($_[0]); 0 }, $_[1]) }) if $w->can('ensure_focus');
+
+ if ($::o->{mouse}{unsafe}) {
+ $w->set_events("pointer_motion_mask");
+ my $signal;
+ $signal = $w->signal_connect(motion_notify_event => sub {
+ delete $::o->{mouse}{unsafe};
+ log::l("unsetting unsafe mouse");
+ $w->signal_disconnect($signal);
+ });
+ }
+ $w->signal_connect(key_press_event => sub {
+ my $d = ${{ 65470 => 'help',
+ 65481 => 'next',
+ 65480 => 'previous' }}{$_[1]{keyval}};
+
+ if ($d eq "help") {
+ require install_gtk;
+ install_gtk::create_big_help($::o);
+ } elsif (chr($_[1]{keyval}) eq 'e' && $_[1]{state} & 8) {
+ log::l("Switching to " . ($::beginner ? "expert" : "beginner"));
+ $::expert = $::beginner;
+ $::beginner = !$::expert;
+ } elsif ($d) {
+ #- previous field is created here :(
+ my $s; foreach (reverse @{$::o->{orderedSteps}}) {
+ $s->{previous} = $_ if $s;
+ $s = $::o->{steps}{$_};
+ }
+ $s = $::o->{step};
+ do { $s = $::o->{steps}{$s}{$d} } until !$s || $::o->{steps}{$s}{reachable};
+ $::setstep && $s and die "setstep $s\n";
+ }
+ });# if $::isInstall;
-sub my_signal_connect($@) {
- my $w = shift;
- $w->signal_connect(@_);
- $w
-}
+ $w->signal_connect(size_allocate => sub {
+ my ($wi, $he) = @{$_[1]}[2,3];
+ my ($X, $Y, $Wi, $He) = @{$my_gtk::force_center || $o->{force_center}};
+ $w->set_uposition(max(0, $X + ($Wi - $wi) / 2), max(0, $Y + ($He - $he) / 2));
+ }) if ($my_gtk::force_center || $o->{force_center}) && !($my_gtk::force_position || $o->{force_position}) ;
-sub mypack($@) {
- my $box = shift;
- foreach (@_) {
- my $l = $_;
- ref $l or $l = new Gtk::Label($l);
- $box->pack_start($l, 1, 1, 0);
- $l->show;
- }
- $box
+ $o->{window} = $f;
+ $o->{rwindow} = $w;
}
-sub mypack_($@) {
- my $box = shift;
- for (my $i = 0; $i < @_; $i += 2) {
- my $l = $_[$i + 1];
- ref $l or $l = new Gtk::Label($l);
- $box->pack_start($l, $_[$i], 1, 0);
- $_[$i + 1]->show;
- }
- $box
+my ($next_child, $left, $right, $up, $down);
+{
+ my $next_child = sub {
+ my ($c, $dir) = @_;
+
+ my @childs = $c->parent->children;
+
+ my $i; for ($i = 0; $i < @childs; $i++) {
+ last if $childs[$i] == $c || $childs[$i]->subtree == $c;
+ }
+ $i += $dir;
+ 0 <= $i && $i < @childs ? $childs[$i] : undef;
+ };
+ $left = sub { &$next_child($_[0]->parent, 0); };
+ $right = sub {
+ my ($c) = @_;
+ if ($c->subtree) {
+ $c->expand;
+ ($c->subtree->children)[0];
+ } else {
+ $c;
+ }
+ };
+ $down = sub {
+ my ($c) = @_;
+ return &$right($c) if ref $c eq "Gtk::TreeItem" && $c->subtree && $c->expanded;
+
+ if (my $n = &$next_child($c, 1)) {
+ $n;
+ } else {
+ return if ref $c->parent ne 'Gtk::Tree';
+ &$down($c->parent);
+ }
+ };
+ $up = sub {
+ my ($c) = @_;
+ if (my $n = &$next_child($c, -1)) {
+ $n = ($n->subtree->children)[-1] while ref $n eq "Gtk::TreeItem" && $n->subtree && $n->expanded;
+ $n;
+ } else {
+ return if ref $c->parent ne 'Gtk::Tree';
+ &$left($c);
+ }
+ };
}
-sub myappend($@) {
- my $w = shift;
- foreach (@_) {
- my $l = $_;
- ref $l or $l = new Gtk::Label($l);
- $w->append($l);
- $l->show;
- }
- $w
+sub create_treeitem($) {
+ my ($name) = @_;
+
+ my $w = new Gtk::TreeItem($name);
+ $w->signal_connect(key_press_event => sub {
+ my (undef, $e) = @_;
+ local $_ = chr ($e->{keyval});
+
+ if ($e->{keyval} > 0x100) {
+ my $n;
+ $n = &$left($w) if /[Q´\x96]/;
+ $n = &$right($w) if /[S¶\x98]/;
+ $n = &$up($w) if /[R¸\x97]/;
+ $n = &$down($w) if /[T²\x99]/;
+ if ($n) {
+ $n->focus('up');
+ $w->signal_emit_stop("key_press_event");
+ }
+ $w->expand if /[+«]/;
+ $w->collapse if /[-\xad]/;
+ do {
+ $w->expanded ? $w->collapse : $w->expand;
+ $w->signal_emit_stop("key_press_event");
+ } if /[\r\x8d]/;
+ }
+ 1;
+ });
+ $w;
}
-sub myadd($@) {
- my $w = shift;
- foreach (@_) {
- my $l = $_;
- ref $l or $l = new Gtk::Label($l);
- $w->add($l);
- $l->show;
- }
- $w
+
+
+
+#-###############################################################################
+#- ask_XXX
+
+#- just give a title and some args, and it will return the value given by the user
+#-###############################################################################
+
+sub ask_warn { my $w = my_gtk->new(shift @_); $w->_ask_warn(@_); main($w); }
+sub ask_yesorno { my $w = my_gtk->new(shift @_); $w->_ask_okcancel(@_, _("Yes"), _("No")); main($w); }
+sub ask_okcancel { my $w = my_gtk->new(shift @_); $w->_ask_okcancel(@_, _("Is this correct?"), _("Ok"), _("Cancel")); main($w); }
+sub ask_from_entry { my $w = my_gtk->new(shift @_); $w->_ask_from_entry(@_); main($w); }
+sub ask_from_list { my $w = my_gtk->new($_[0]); $w->_ask_from_list(@_); main($w); }
+sub ask_file { my $w = my_gtk->new(''); $w->_ask_file(@_); main($w); }
+
+sub _ask_from_entry($$@) {
+ my ($o, @msgs) = @_;
+ my $entry = new Gtk::Entry;
+ my $f = sub { $o->{retval} = $entry->get_text; Gtk->main_quit };
+ $o->{ok_clicked} = $f;
+ $o->{cancel_clicked} = sub { undef $o->{retval}; Gtk->main_quit };
+
+ gtkadd($o->{window},
+ gtkpack($o->create_box_with_title(@msgs),
+ gtksignal_connect($entry, 'activate' => $f),
+ ($o->{hide_buttons} ? () : create_okcancel($o))),
+ );
+ $entry->grab_focus;
}
-sub myshow($) { $_[0]->show; $_[0] }
-sub mysync(;$) {
- my ($o) = @_;
- $o and $o->{window}->show;
+sub _ask_from_list {
+ my ($o, $title, $messages, $l, $def) = @_;
+ my (undef, @okcancel) = ref $title ? @$title : $title;
+ my $list = new Gtk::CList(1);
+ my ($first_time, $starting_word, $start_reg) = (1, '', "^");
+ my (@widgets, $timeout, $curr);
+
+ my $leave = sub { $o->{retval} = $l->[$curr]; Gtk->main_quit };
+ my $select = sub {
+ $list->set_focus_row($_[0]);
+ $list->select_row($_[0], 0);
+ $list->moveto($_[0], 0, 0.5, 0);
+ };
+
+ ref $title && !@okcancel ?
+ $list->signal_connect(button_release_event => $leave) :
+ $list->signal_connect(button_press_event => sub { &$leave if $_[1]{type} =~ /^2/ });
+
+ $list->signal_connect(select_row => sub {
+ my ($w, $row, undef, $e) = @_;
+ $curr = $row;
+ });
+ $list->signal_connect(key_press_event => sub {
+ my ($w, $e) = @_;
+ my $c = chr($e->{keyval} & 0xff);
+
+ Gtk->timeout_remove($timeout) if $timeout; $timeout = '';
+
+ if ($e->{keyval} >= 0x100) {
+ &$leave if $c eq "\r" || $c eq "\x8d";
+ $starting_word = '' if $e->{keyval} != 0xffe4; # control
+ } else {
+ if ($e->{state} & 4) {
+ #- control pressed
+ $c eq "s" or return 1;
+ $start_reg and $start_reg = '', return 1;
+ $curr++;
+ } else {
+ &$leave if $c eq ' ';
+
+ $curr++ if $starting_word eq '' || $starting_word eq $c;
+ $starting_word .= $c unless $starting_word eq $c;
+ }
+ my $word = quotemeta $starting_word;
+ my $j; for ($j = 0; $j < @$l; $j++) {
+ $l->[($j + $curr) % @$l] =~ /$start_reg$word/i and last;
+ }
+ $j == @$l ?
+ $starting_word = '' :
+ &$select(($j + $curr) % @$l);
- my $h = Gtk->idle_add(sub { Gtk->main_quit; 1 });
- map { Gtk->main } (1..4);
- Gtk->idle_remove($h);
+ $w->{timeout} = $timeout = Gtk->timeout_add($forgetTime, sub { $timeout = $starting_word = ''; 0 } );
+ }
+ 1;
+ });
+ $list->set_selection_mode('browse');
+ $list->set_column_auto_resize(0, 1);
+
+ $o->{ok_clicked} = $leave;
+ $o->{cancel_clicked} = sub { $o->destroy; die "ask_from_list cancel" }; #- make sure windows doesn't live any more.
+ gtkadd($o->{window},
+ gtkpack($o->create_box_with_title(@$messages),
+ gtkpack_(new Gtk::VBox(0,7),
+ 1, @$l > 15 ? gtkset_usize(createScrolledWindow($list), 200, min(350, $::windowheight - 60)) : $list,
+ @okcancel || !ref $title ? (0, create_okcancel($o, @okcancel)) : ())
+ ));
+ $o->show; #- otherwise the moveto is not done
+ my $toselect; map_index {
+ $list->append($_);
+ $toselect = $::i if $def && $_ eq $def;
+ } @$l;
+ &$select($toselect);
+
+ $list->grab_focus;
}
-sub myflush(;$) {
- Gtk->main_iteration while Gtk::Gdk->events_pending;
+sub _ask_from_list_with_help {
+ my ($o, $title, $messages, $l, $help, $def) = @_;
+ my (undef, @okcancel) = ref $title ? @$title : $title;
+ my $list = new Gtk::List();
+ my ($first_time, $starting_word, $start_reg) = (1, '', "^");
+ my (@widgets, $timeout, $curr);
+
+ my $leave = sub { $o->{retval} = $l->[$curr]; Gtk->main_quit };
+ my $select = sub {
+ $list->select_item($_[0]);
+ };
+
+ ref $title && !@okcancel ?
+ $list->signal_connect(button_release_event => $leave) :
+ $list->signal_connect(button_press_event => sub { &$leave if $_[1]{type} =~ /^2/ });
+
+ $list->signal_connect(select_child => sub {
+ my ($w, $row) = @_;
+ $curr = $list->child_position($row);
+ });
+ $list->signal_connect(key_press_event => sub {
+ my ($w, $e) = @_;
+ my $c = chr($e->{keyval} & 0xff);
+
+ Gtk->timeout_remove($timeout) if $timeout; $timeout = '';
+
+ if ($e->{keyval} >= 0x100) {
+ &$leave if $c eq "\r" || $c eq "\x8d";
+ $starting_word = '' if $e->{keyval} != 0xffe4; # control
+ } else {
+ if ($e->{state} & 4) {
+ #- control pressed
+ $c eq "s" or return 1;
+ $start_reg and $start_reg = '', return 1;
+ $curr++;
+ } else {
+ &$leave if $c eq ' ';
+
+ $curr++ if $starting_word eq '' || $starting_word eq $c;
+ $starting_word .= $c unless $starting_word eq $c;
+ }
+ my $word = quotemeta $starting_word;
+ my $j; for ($j = 0; $j < @$l; $j++) {
+ $l->[($j + $curr) % @$l] =~ /$start_reg$word/i and last;
+ }
+ $j == @$l ?
+ $starting_word = '' :
+ &$select(($j + $curr) % @$l);
+
+ $w->{timeout} = $timeout = Gtk->timeout_add($forgetTime, sub { $timeout = $starting_word = ''; 0 } );
+ }
+ 1;
+ });
+
+ $o->{ok_clicked} = $leave;
+ $o->{cancel_clicked} = sub { $o->destroy; die "ask_from_list cancel" }; #- make sure windows doesn't live any more.
+ gtkadd($o->{window},
+ gtkpack($o->create_box_with_title(@$messages),
+ gtkpack_(new Gtk::VBox(0,7),
+ 1, @$l > 15 ? gtkset_usize(createScrolledWindow($list), 200, min(350, $::windowheight - 60)) : $list,
+ @okcancel || !ref $title ? (0, create_okcancel($o, @okcancel)) : ())
+ ));
+ $o->show; #- otherwise the moveto is not done
+ my $tips = new Gtk::Tooltips;
+ my $toselect; map_index {
+ my $item = new Gtk::ListItem($_);
+ $list->append_items($item);
+ $tips->set_tip($item, $help->{$_}) if $help->{$_};
+ $item->show;
+ $toselect = $::i if $def && $_ eq $def;
+ } @$l;
+ &$select($toselect);
+
+ $list->grab_focus;
}
+sub _ask_warn($@) {
+ my ($o, @msgs) = @_;
+ gtkadd($o->{window},
+ gtkpack($o->create_box_with_title(@msgs),
+ gtksignal_connect(my $w = new Gtk::Button(_("Ok")), "clicked" => sub { Gtk->main_quit }),
+ ),
+ );
+ $w->grab_focus;
+}
+sub _ask_okcancel($@) {
+ my ($o, @msgs) = @_;
+ my ($ok, $cancel) = splice @msgs, -2;
-sub bigsize($) { $_[0]->{window}->set_usize(600,400); }
-sub myset_usize($$$) { $_[0]->set_usize($_[1],$_[2]); $_[0] }
-sub myset_justify($$) { $_[0]->set_justify($_[1]); $_[0] }
-sub mydestroy($) { $_[0] and $_[0]->destroy }
+ gtkadd($o->{window},
+ gtkpack(create_box_with_title($o, @msgs),
+ create_okcancel($o, $ok, $cancel),
+ )
+ );
+ $o->{ok}->grab_focus;
+}
-sub label_align($$) {
- my $w = shift;
- local $_ = shift;
- $w->set_alignment(!/W/i, !/N/i);
- $w
+
+sub _ask_file($$) {
+ my ($o, $title) = @_;
+ my $f = $o->{rwindow} = new Gtk::FileSelection $title;
+ $f->ok_button->signal_connect(clicked => sub { $o->{retval} = $f->get_filename ; Gtk->main_quit });
+ $f->cancel_button->signal_connect(clicked => sub { Gtk->main_quit });
+ $f->hide_fileop_buttons;
}
+
+#-###############################################################################
+#- rubbish
+#-###############################################################################
+
+#-sub label_align($$) {
+#- my $w = shift;
+#- local $_ = shift;
+#- $w->set_alignment(!/W/i, !/N/i);
+#- $w
+#-}
+
diff --git a/perl-install/network.pm b/perl-install/network.pm
index 29edb4ff3..5e687c857 100644
--- a/perl-install/network.pm
+++ b/perl-install/network.pm
@@ -1,21 +1,41 @@
-package network;
+package network; # $Id$
use diagnostics;
use strict;
+#-######################################################################################
+#- misc imports
+#-######################################################################################
use Socket;
-use common qw(:common :file :system);
+use common qw(:common :file :system :functional);
use detect_devices;
-use modules;
+use run_program;
+use any;
use log;
-1;
-
-
+#-######################################################################################
+#- Functions
+#-######################################################################################
sub read_conf {
my ($file) = @_;
my %netc = getVarsFromSh($file);
+ $netc{dnsServer} = delete $netc{NS0};
+ $netc{dnsServer2} = delete $netc{NS1};
+ $netc{dnsServer3} = delete $netc{NS2};
+ \%netc;
+}
+
+sub read_resolv_conf {
+ my ($file) = @_;
+ my @l = qw(dnsServer dnsServer2 dnsServer3);
+ my %netc;
+
+ local *F; open F, $file or die "cannot open $file: $!";
+ local $_;
+ while (<F>) {
+ /^\s*nameserver\s+(\S+)/ and $netc{shift @l} = $1;
+ }
\%netc;
}
@@ -29,31 +49,95 @@ sub read_interface_conf {
\%intf;
}
+sub up_it {
+ my ($prefix, $intfs) = @_;
+ $_->{isUp} and return foreach values %$intfs;
+ my $f = "/etc/resolv.conf"; symlink "$prefix/$f", $f;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/network", "start");
+ $_->{isUp} = 1 foreach values %$intfs;
+}
+sub down_it {
+ my ($prefix, $intfs) = @_;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/network", "stop");
+ $_->{isUp} = 1 foreach values %$intfs;
+}
+
sub write_conf {
my ($file, $netc) = @_;
add2hash($netc, {
- NETWORKING => "yes",
- FORWARD_IPV4 => "false",
+ NETWORKING => "yes",
+ FORWARD_IPV4 => "false",
HOSTNAME => "localhost.localdomain",
- DOMAINNAME => "localdomain",
- });
-
- setVarsInSh($file, $netc, qw(NETWORKING FORWARD_IPV4 HOSTNAME DOMAINNAME GATEWAY GATEWAYDEV));
+ });
+ add2hash($netc, { DOMAINNAME => $netc->{HOSTNAME} =~ /\.(.*)/ });
+
+ setVarsInSh($file, $netc, qw(NETWORKING FORWARD_IPV4 DHCP_HOSTNAME HOSTNAME DOMAINNAME GATEWAY GATEWAYDEV NISDOMAIN));
+}
+
+sub write_resolv_conf {
+ my ($file, $netc) = @_;
+
+ #- get the list of used dns.
+ my %used_dns; @used_dns{$netc->{dnsServer}, $netc->{dnsServer2}, $netc->{dnsServer3}} = (1, 2, 3);
+
+ unless ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2} || keys %used_dns > 0) {
+ unlink($file);
+ log::l("neither domain name nor dns server are configured");
+ return 0;
+ }
+
+ my (%search, %dns, @unknown);
+ local *F; open F, $file;
+ local $_;
+ while (<F>) {
+ /^[#\s]*search\s+(.*?)\s*$/ and $search{$1} = $., next;
+ /^[#\s]*nameserver\s+(.*?)\s*$/ and $dns{$1} = $., next;
+ /^.*# ppp temp entry\s*$/ and next;
+ /^[#\s]*(\S.*?)\s*$/ and push @unknown, $1;
+ }
+
+ close F; open F, ">$file" or die "cannot write $file: $!";
+ print F "# search $_\n" foreach grep { $_ ne "$netc->{DOMAINNAME} $netc->{DOMAINNAME2}" } sort { $search{$a} <=> $search{$b} } keys %search;
+ print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n\n" if ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2});
+ print F "# nameserver $_\n" foreach grep { ! exists $used_dns{$_} } sort { $dns{$a} <=> $dns{$b} } keys %dns;
+ print F "nameserver $_\n" foreach sort { $used_dns{$a} <=> $used_dns{$b} } grep { $_ } keys %used_dns;
+ print F "\n";
+ print F "# $_\n" foreach @unknown;
+ print F "\n";
+ print F "# ppp temp entry\n";
+
+ #-res_init(); # reinit the resolver so DNS changes take affect
+ 1;
+}
+
+sub write_interface_conf {
+ my ($file, $intf) = @_;
+
+ my @ip = split '\.', $intf->{IPADDR};
+ my @mask = split '\.', $intf->{NETMASK};
+ add2hash($intf, {
+ BROADCAST => join('.', mapn { int $_[0] | ~int $_[1] & 255 } \@ip, \@mask),
+ NETWORK => join('.', mapn { int $_[0] & $_[1] } \@ip, \@mask),
+ ONBOOT => bool2yesno(!member($intf->{DEVICE}, map { $_->{device} } detect_devices::probeall())),
+ });
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT));
}
sub add2hosts {
- my ($file, $ip, $hostname) = @_;
- my %l = ($ip => $hostname);
+ my ($file, $hostname, @ips) = @_;
+ my %l;
+ $l{$_} = $hostname foreach @ips;
local *F;
if (-e $file) {
open F, $file or die "cannot open $file: $!";
- /\s*(\S+)(.*)/ and $l{$1} = $2 foreach <F>;
+ /\s*(\S+)(.*)/ and $l{$1} ||= $2 foreach <F>;
}
log::l("writing host information to $file");
open F, ">$file" or die "cannot write $file: $!";
while (my ($ip, $v) = each %l) {
+ $ip or next;
print F "$ip";
if ($v =~ /^\s/) {
print F $v;
@@ -65,65 +149,287 @@ sub add2hosts {
}
}
-sub write_resolv_conf {
- my ($file, $netc) = @_;
+# The interface/gateway needs to be configured before this will work!
+sub guessHostname {
+ my ($prefix, $netc, $intf) = @_;
- # We always write these, even if they were autoconfigured. Otherwise, the reverse name lookup in the install doesn't work.
- unless ($netc->{DOMAINNAME} || $netc->{dnsServers}) {
- unlink($file);
- log::l("neither domain name nor dns server are configured");
- return 0;
- }
- my @l = cat_($file);
+ $intf->{isUp} && dnsServers($netc) or return 0;
+ $netc->{HOSTNAME} && $netc->{DOMAINNAME} and return 1;
- local *F;
- open F, "> $file" or die "cannot write $file: $!";
- print F "search $netc->{DOMAINNAME}\n" if $netc->{DOMAINNAME};
- print F "nameserver $_\n" foreach @{$netc->{dnsServers}};
- print F "#$_" foreach @l;
+ write_resolv_conf("$prefix/etc/resolv.conf", $netc);
- #res_init(); # reinit the resolver so DNS changes take affect
+ my $name = gethostbyaddr(Socket::inet_aton($intf->{IPADDR}), AF_INET) or log::l("reverse name lookup failed"), return 0;
+
+ log::l("reverse name lookup worked");
+
+ add2hash($netc, { HOSTNAME => $name });
1;
}
-sub write_interface_conf {
- my ($file, $intf) = @_;
+sub addDefaultRoute {
+ my ($netc) = @_;
+ c::addDefaultRoute($netc->{GATEWAY}) if $netc->{GATEWAY};
+}
- add2hash($intf, { ONBOOT => "yes" });
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT));
+sub sethostname {
+ my ($netc) = @_;
+ syscall_('sethostname', $netc->{HOSTNAME}, length $netc->{HOSTNAME}) or log::l("sethostname failed: $!");
}
+sub resolv($) {
+ my ($name) = @_;
+ is_ip($name) and return $name;
+ my $a = join(".", unpack "C4", (gethostbyname $name)[4]);
+ #-log::l("resolved $name in $a");
+ $a;
+}
-# The interface/gateway needs to be configured before this will work!
-sub guessHostname {
- my ($prefix, $netc, $intf) = @_;
+sub dnsServers {
+ my ($netc) = @_;
+ my %used_dns; @used_dns{$netc->{dnsServer}, $netc->{dnsServer2}, $netc->{dnsServer3}} = (1, 2, 3);
+ sort { $used_dns{$a} <=> $used_dns{$b} } grep { $_ } keys %used_dns;
+}
- $intf->{isUp} && $netc->{dnsServers} or return 0;
- $netc->{HOSTNAME} && $netc->{DOMAINNAME} and return 1;
+sub findIntf {
+ my ($intf, $device) = @_;
+ $intf->{$device} ||= { DEVICE => $device };
+}
+#PAD \s* a la fin
+my $ip_regexp = qr/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
+sub is_ip {
+ my ($ip) = @_;
+ return 0 unless $ip =~ $ip_regexp;
+ my @fields = ($1, $2, $3, $4);
+ foreach (@fields) {
+ return 0 if $_ < 0 || $_ > 255;
+ }
+ return 1;
+}
- write_resolv_conf("$prefix/etc/resolv.conf", $netc);
+sub netmask {
+ my ($ip) = @_;
+ return "255.255.255.0" unless is_ip($ip);
+ $ip =~ $ip_regexp;
+ if ($1 >= 1 && $1 < 127) {
+ return "255.0.0.0"; #-1.0.0.0 to 127.0.0.0
+ } elsif ($1 >= 128 && $1 <= 191 ){
+ return "255.255.0.0"; #-128.0.0.0 to 191.255.0.0
+ } elsif ($1 >= 192 && $1 <= 223) {
+ return "255.255.255.0";
+ } else {
+ return "255.255.255.255"; #-experimental classes
+ }
+}
-# winStatus(40, 3, _("Hostname"), _("Determining host name and domain..."));
- my $name = gethostbyaddr(Socket::inet_aton($intf->{IPADDR}), AF_INET) or log::l("reverse name lookup failed"), return 0;
+sub masked_ip {
+ my ($ip) = @_;
+ return "" unless is_ip($ip);
+ my @mask = netmask($ip) =~ $ip_regexp;
+ my @ip = $ip =~ $ip_regexp;
+ for (my $i = 0; $i < @ip; $i++) {
+ $ip[$i] &= int $mask[$i];
+ }
+ join(".", @ip);
+}
- log::l("reverse name lookup worked");
+sub dns {
+ my ($ip) = @_;
+ my $mask = masked_ip($ip);
+ my @masked = masked_ip($ip) =~ $ip_regexp;
+ $masked[3] = 2;
+ join (".", @masked);
- add2hash($netc, { HOSTNAME => $name, DOMAINNAME => $name =~ /\.(.*)/ });
- 1;
}
+sub gateway {
+ my ($ip) = @_;
+ my @masked = masked_ip($ip) =~ $ip_regexp;
+ $masked[3] = 1;
+ join (".", @masked);
-sub addDefaultRoute {
- my ($netc) = @_;
- c::addDefaultRoute($netc->{gateway}) if $netc->{gateway} || !$::testing;
}
-sub getAvailableNetDevice {
- my $device = detect_devices::getNet();
+sub configureNetwork {
+ my ($prefix, $netc, $in, $intf, $first_time) = @_;
+ local $_;
+ any::setup_thiskind($in, 'net', !$::expert, 1);
+ my @l = detect_devices::getNet() or die _("no network card found");
+
+ my $last; foreach ($::beginner ? $l[0] : @l) {
+ my $intf2 = findIntf($intf ||= {}, $_);
+ add2hash($intf2, $last);
+ add2hash($intf2, { NETMASK => '255.255.255.0' });
+ configureNetworkIntf($in, $intf2, $netc->{NET_DEVICE}, 0) or last;
+
+ $netc ||= {};
+ $last = $intf2;
+ }
+ #- {
+ #- my $wait = $o->wait_message(_("Hostname"), _("Determining host name and domain..."));
+ #- network::guessHostname($o->{prefix}, $o->{netc}, $o->{intf});
+ #- }
+ $last or return;
+ if ($last->{BOOTPROTO} =~ /^(dhcp|bootp)$/) {
+ $netc->{minus_one} = 1;
+ my $dhcp_hostname = $netc->{HOSTNAME};
+ $::isInstall and $in->set_help('configureNetworkHostDHCP');
+ $in->ask_from_entries_ref(_("Configuring network"),
+_("Please enter your host name if you know it.
+Some DHCP servers require the hostname to work.
+Your host name should be a fully-qualified host name,
+such as ``mybox.mylab.myco.com''."),
+ [_("Host name")], [ \$netc->{HOSTNAME} ]);
+ $netc->{HOSTNAME} ne $dhcp_hostname and $netc->{DHCP_HOSTNAME} = $netc->{HOSTNAME};
+ } else {
+ configureNetworkNet($in, $netc, $last ||= {}, @l);
+ if ( $netc->{GATEWAY} ) {
+ unlink "$prefix/etc/sysconfig/network-scripts/net_cnx_up";
+ unlink "$prefix/etc/sysconfig/network-scripts/net_cnx_down";
+ undef $netc->{NET_DEVICE};
+ }
+ }
+ miscellaneousNetwork($in);
+}
+
- unless ($device) {
- modules::load_thiskind('net') or return;
- $device = detect_devices::getNet();
+sub configureNetworkIntf {
+ my ($in, $intf, $net_device, $skip) = @_;
+ my $text;
+ if ($net_device eq $intf->{DEVICE}) {
+ $skip and return 1;
+ $text = _("WARNING: This device has been previously configured to connect to the Internet.
+Simply press OK to keep this device configured.
+Modifying the fields below will override this configuration.");
+ }
+ else {
+ $text = _("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).");
}
- $device;
+ my $pump = $intf->{BOOTPROTO} =~ /^(dhcp|bootp)$/;
+ delete $intf->{NETWORK};
+ delete $intf->{BROADCAST};
+ my @fields = qw(IPADDR NETMASK);
+ $::isStandalone or $in->set_help('configureNetworkIP');
+ $in->ask_from_entries_ref(_("Configuring network device %s", $intf->{DEVICE}),
+ ($::isStandalone ? '' : _("Configuring network device %s", $intf->{DEVICE}) . "\n\n") .
+ $text,
+ [ _("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 (is_ip($intf->{$fields[$i]})) {
+ $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
+ return (1,$i);
+ }
+ return 0;
+ }
+ },
+ focus_out => sub {
+ $intf->{NETMASK} ||= netmask($intf->{IPADDR}) unless $_[0]
+ }
+ );
+}
+
+sub configureNetworkNet {
+ my ($in, $netc, $intf, @devices) = @_;
+
+ $netc->{dnsServer} ||= dns($intf->{IPADDR});
+ $netc->{GATEWAY} ||= gateway($intf->{IPADDR});
+
+ $::isInstall and $in->set_help('configureNetworkHost');
+ $in->ask_from_entries_refH(_("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") => \$netc->{HOSTNAME},
+ _("DNS server") => \$netc->{dnsServer},
+ _("Gateway") => \$netc->{GATEWAY},
+ $::expert ? (_("Gateway device") => {val => \$netc->{GATEWAYDEV}, list => \@devices }) : (),
+ ],
+ ) or return;
+}
+
+sub miscellaneousNetwork {
+ my ($in, $clicked) = @_;
+ my $u = $::o->{miscellaneous} ||= {};
+ $::isInstall and $in->set_help('configureNetworkProxy');
+ !$::beginner || $clicked and $in->ask_from_entries_ref('',
+ _("Proxies configuration"),
+ [ _("HTTP proxy"),
+ _("FTP proxy"),
+ ],
+ [ \$u->{http_proxy},
+ \$u->{ftp_proxy},
+ ],
+ complete => sub {
+ $u->{http_proxy} =~ m,^($|http://), or $in->ask_warn('', _("Proxy should be http://...")), return 1,0;
+ $u->{ftp_proxy} =~ m,^($|ftp://), or $in->ask_warn('', _("Proxy should be ftp://...")), return 1,1;
+ 0;
+ }
+ ) || return;
}
+sub read_all_conf {
+ my ($prefix, $netc, $intf) = @_;
+ $netc ||= {}; $intf ||= {};
+ add2hash($netc, read_conf("$prefix/etc/sysconfig/network")) if -r "$prefix/etc/sysconfig/network";
+ add2hash($netc, read_resolv_conf("$prefix/etc/resolv.conf")) if -r "$prefix/etc/resolv.conf";
+ foreach (all("$prefix/etc/sysconfig/network-scripts")) {
+ if (/ifcfg-(\w+)/ && $1 ne 'lo' && $1 !~ /ppp/) {
+ my $intf = findIntf($intf, $1);
+ add2hash($intf, { getVarsFromSh("$prefix/etc/sysconfig/network-scripts/$_") });
+ }
+ }
+}
+
+#- configureNetwork2 : configure the network interfaces.
+#- input
+#- $prefix
+#- $netc
+#- $intf
+#- $install : a function that takes a list of package and install them : ex sub { system("urpmi --auto --best-output " . join(' ', @_)); }
+#- $netc input
+#- NETWORKING : networking flag : string : "yes" by default
+#- FORWARD_IPV4 : forward IP flag : string : "false" by default
+#- HOSTNAME : hostname : string : "localhost.localdomain" by default
+#- DOMAINNAME : domainname : string : $netc->{HOSTNAME} =~ /\.(.*)/ by default
+#- DOMAINNAME2 : well it's another domainname : have to look further why we used 2
+#- The following are facultatives
+#- DHCP_HOSTNAME : If you have a dhcp and want to set the hostname
+#- GATEWAY : gateway
+#- GATEWAYDEV : gateway interface
+#- NISDOMAIN : nis domain
+#- $netc->{dnsServer} : dns server 1
+#- $netc->{dnsServer2} : dns server 2
+#- $netc->{dnsServer3} : dns server 3 : note that we uses the dns1 for the LAN, and the 2 others for the internet conx
+#- $intf input: for each $device (for example ethx)
+#- $intf->{$device}{IPADDR} : IP address
+#- $intf->{$device}{NETMASK} : netmask
+#- $intf->{$device}{DEVICE} : DEVICE = $device
+#- $intf->{$device}{BOOTPROTO} : boot prototype : "bootp" or "dhcp" or "pump" or ...
+sub configureNetwork2 {
+ my ($prefix, $netc, $intf, $install) = @_;
+ my $etc = "$prefix/etc";
+
+ write_conf("$etc/sysconfig/network", $netc);
+ write_resolv_conf("$etc/resolv.conf", $netc);
+ write_interface_conf("$etc/sysconfig/network-scripts/ifcfg-$_->{DEVICE}", $_) foreach values %$intf;
+ add2hosts("$etc/hosts", $netc->{HOSTNAME}, map { $_->{IPADDR} } values %$intf);
+ sethostname($netc) unless $::testing;
+ addDefaultRoute($netc) unless $::testing;
+
+ grep { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf and $install && $install->('dhcpcd');
+ grep { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf and $install && $install->('pump');
+ #-res_init(); #- reinit the resolver so DNS changes take affect
+
+ any::miscellaneousNetwork($prefix);
+}
+
+
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index a7d06fb21..c1f90c566 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -1,125 +1,244 @@
-package partition_table;
+package partition_table; # $Id$
-use diagnostics;
-use strict;
-use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types);
+#use diagnostics;
+#use strict;
+#use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @important_types2 @fields2save);
+use Data::Dumper;
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isSwap isDos isWin isPrimary isNfs) ],
+ types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isTrueFS isSwap isDos isWin isFat isSunOS isOtherAvailableFS isPrimary isNfs isSupermount isRAID isMDRAID isHFS isNT isMountableRW isApplePartMap isLoopback) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
-use common qw(:common :system);
+use common qw(:common :system :functional);
use partition_table_raw;
+use log;
-@important_types = ("Linux native", "Linux swap", "DOS FAT16");
+@important_types = ('Linux native', arch() =~ /i.86/ ? 'ReiserFS' : (), 'Linux swap', 'Win98 FAT32');
+@important_types2 = ('Linux RAID');
+
+@fields2save = qw(primary extended totalsectors isDirty needKernelReread);
+
my %types = (
- 0 => "Empty",
- 1 => "DOS 12-bit FAT",
- 2 => "XENIX root",
- 3 => "XENIX usr",
- 4 => "DOS 16-bit <32M",
- 5 => "Extended",
- 6 => "DOS FAT16",
- 7 => "OS/2 HPFS", # or QNX?
- 8 => "AIX",
- 9 => "AIX bootable",
- 10 => "OS/2 Boot Manager",
- 0xb => "Win98 FAT32",
- 0xc => "Win98 FAT32 0xb",
- 0xe => "Win98 FAT32 0xc",
- 0x12 => "Compaq setup",
- 0x40 => "Venix 80286",
- 0x51 => "Novell?",
- 0x52 => "Microport", # or CPM?
- 0x63 => "GNU HURD", # or System V/386?
- 0x64 => "Novell Netware 286",
- 0x65 => "Novell Netware 386",
- 0x75 => "PC/IX",
- 0x80 => "Old MINIX", # Minix 1.4a and earlier
-
- 0x81 => "Linux/MINIX", # Minix 1.4b and later
- 0x82 => "Linux swap",
- 0x83 => "Linux native",
-
- 0x93 => "Amoeba",
- 0x94 => "Amoeba BBT", # (bad block table)
- 0xa5 => "BSD/386",
- 0xb7 => "BSDI fs",
- 0xb8 => "BSDI swap",
- 0xc7 => "Syrinx",
- 0xdb => "CP/M", # or Concurrent DOS?
- 0xe1 => "DOS access",
- 0xe3 => "DOS R/O",
- 0xf2 => "DOS secondary",
- 0xff => "BBT" # (bad track table)
+ 0x0 => 'Empty',
+arch() =~ /^ppc/ ? (
+ 0x401 => 'Apple Partition',
+ 0x402 => 'Apple HFS Partition',
+) : arch() =~ /^i.86/ ? (
+ 0x183 => 'ReiserFS',
+) : arch() =~ /^sparc/ ? (
+ 0x1 => 'SunOS boot',
+ 0x2 => 'SunOS root',
+ 0x3 => 'SunOS swap',
+ 0x4 => 'SunOS usr',
+ 0x5 => 'Whole disk',
+ 0x6 => 'SunOS stand',
+ 0x7 => 'SunOS var',
+ 0x8 => 'SunOS home',
+) : (
+ 0x1 => 'DOS 12-bit FAT',
+ 0x2 => 'XENIX root',
+ 0x3 => 'XENIX /usr',
+ 0x4 => 'DOS 16-bit FAT (up to 32M)',
+ 0x5 => 'DOS 3.3+ Extended Partition',
+ 0x6 => 'DOS FAT16',
+ 0x7 => 'NTFS (or HPFS)',
+ 0x8 => 'OS/2 (v1.0-1.3 only) / AIX boot partition / SplitDrive / Commodore DOS / DELL partition spanning multiple drives / QNX 1.x and 2.x ("qny")',
+),
+ 0x9 => 'AIX data partition / Coherent filesystem / QNX 1.x and 2.x ("qnz")',
+ 0xa => 'OS/2 Boot Manager / Coherent swap partition / OPUS',
+ 0xb => 'Win98 FAT32',
+ 0xc => 'Win98 FAT32, LBA-mapped',
+ 0xe => 'Win95: DOS 16-bit FAT, LBA-mapped',
+ 0xf => 'Win95: Extended partition, LBA-mapped',
+ 0x10 => 'OPUS (?)',
+ 0x11 => 'Hidden DOS 12-bit FAT',
+ 0x12 => 'Compaq config partition',
+ 0x14 => 'Hidden DOS 16-bit FAT <32M',
+ 0x16 => 'Hidden DOS 16-bit FAT >=32M',
+ 0x17 => 'Hidden IFS (e.g., HPFS)',
+ 0x18 => 'AST Windows swapfile',
+ 0x1b => 'Hidden WIN95 OSR2 32-bit FAT',
+ 0x1c => 'Hidden WIN95 OSR2 32-bit FAT, LBA-mapped',
+ 0x1e => 'Hidden FAT95',
+ 0x22 => 'Used for Oxygen Extended Partition Table by ekstazya@sprint.ca.',
+ 0x24 => 'NEC DOS 3.x',
+ 0x38 => 'THEOS ver 3.2 2gb partition',
+ 0x39 => 'THEOS ver 4 spanned partition',
+ 0x3a => 'THEOS ver 4 4gb partition',
+ 0x3b => 'THEOS ver 4 extended partition',
+ 0x3c => 'PartitionMagic recovery partition',
+ 0x40 => 'Venix 80286',
+ 0x41 => 'Linux/MINIX (sharing disk with DRDOS) / Personal RISC Boot / PPC PReP (Power PC Reference Platform) Boot',
+ 0x42 => 'Linux swap (sharing disk with DRDOS) / SFS (Secure Filesystem) / W2K marker',
+ 0x43 => 'Linux native (sharing disk with DRDOS)',
+ 0x45 => 'EUMEL/Elan',
+ 0x46 => 'EUMEL/Elan 0x46',
+ 0x47 => 'EUMEL/Elan 0x47',
+ 0x48 => 'EUMEL/Elan 0x48',
+ 0x4d => 'QNX4.x',
+ 0x4e => 'QNX4.x 2nd part',
+ 0x4f => 'QNX4.x 3rd part / Oberon partition',
+ 0x50 => 'OnTrack Disk Manager (older versions) RO',
+ 0x51 => 'OnTrack Disk Manager RW (DM6 Aux1) / Novell',
+ 0x52 => 'CP/M / Microport SysV/AT',
+ 0x53 => 'Disk Manager 6.0 Aux3',
+ 0x54 => 'Disk Manager 6.0 Dynamic Drive Overlay',
+ 0x55 => 'EZ-Drive',
+ 0x56 => 'Golden Bow VFeature Partitioned Volume. / DM converted to EZ-BIOS',
+ 0x57 => 'DrivePro',
+ 0x5c => 'Priam EDisk',
+ 0x61 => 'SpeedStor',
+ 0x63 => 'Unix System V (SCO, ISC Unix, UnixWare, ...), Mach, GNU Hurd',
+ 0x64 => 'PC-ARMOUR protected partition / Novell Netware 2.xx',
+ 0x65 => 'Novell Netware 3.xx or 4.xx',
+ 0x67 => 'Novell',
+ 0x68 => 'Novell 0x68',
+ 0x69 => 'Novell 0x69',
+ 0x70 => 'DiskSecure Multi-Boot',
+ 0x75 => 'IBM PC/IX',
+ 0x80 => 'MINIX until 1.4a',
+ 0x81 => 'MINIX since 1.4b, early Linux / Mitac disk manager',
+ 0x82 => 'Linux swap',
+ 0x83 => 'Linux native',
+ 0x84 => 'OS/2 hidden C: drive / Hibernation partition',
+ 0x85 => 'Linux extended partition',
+ 0x86 => 'Old Linux RAID partition superblock / NTFS volume set',
+ 0x87 => 'NTFS volume set',
+ 0x8a => 'Linux Kernel Partition (used by AiR-BOOT)',
+ 0x8e => 'Linux Logical Volume Manager partition',
+ 0x93 => 'Amoeba',
+ 0x94 => 'Amoeba bad block table',
+ 0x99 => 'DCE376 logical drive',
+ 0xa0 => 'IBM Thinkpad hibernation partition / Phoenix NoteBIOS Power Management "Save-to-Disk" partition',
+ 0xa5 => 'BSD/386, 386BSD, NetBSD, FreeBSD',
+ 0xa6 => 'OpenBSD',
+ 0xa7 => 'NEXTSTEP',
+ 0xa9 => 'NetBSD',
+ 0xaa => 'Olivetti Fat 12 1.44Mb Service Partition',
+ 0xb7 => 'BSDI filesystem',
+ 0xb8 => 'BSDI swap partition',
+ 0xbe => 'Solaris boot partition',
+ 0xc0 => 'CTOS / REAL/32 secure small partition',
+ 0xc1 => 'DRDOS/secured (FAT-12)',
+ 0xc4 => 'DRDOS/secured (FAT-16, < 32M)',
+ 0xc6 => 'DRDOS/secured (FAT-16, >= 32M) / Windows NT corrupted FAT16 volume/stripe set',
+ 0xc7 => 'Windows NT corrupted NTFS volume/stripe set / Syrinx boot',
+ 0xcb => 'reserved for DRDOS/secured (FAT32)',
+ 0xcc => 'reserved for DRDOS/secured (FAT32, LBA)',
+ 0xcd => 'CTOS Memdump?',
+ 0xce => 'reserved for DRDOS/secured (FAT16, LBA)',
+ 0xd0 => 'REAL/32 secure big partition',
+ 0xd1 => 'Old Multiuser DOS secured FAT12',
+ 0xd4 => 'Old Multiuser DOS secured FAT16 <32M',
+ 0xd5 => 'Old Multiuser DOS secured extended partition',
+ 0xd6 => 'Old Multiuser DOS secured FAT16 >=32M',
+ 0xd8 => 'CP/M-86',
+ 0xdb => 'Digital Research CP/M, Concurrent CP/M, Concurrent DOS / CTOS (Convergent Technologies OS -Unisys) / KDG Telemetry SCPU boot',
+ 0xdd => 'Hidden CTOS Memdump?',
+ 0xe1 => 'DOS access or SpeedStor 12-bit FAT extended partition',
+ 0xe3 => 'DOS R/O or SpeedStor',
+ 0xe4 => 'SpeedStor 16-bit FAT extended partition < 1024 cyl.',
+ 0xeb => 'BeOS',
+ 0xee => 'Indication that this legacy MBR is followed by an EFI header',
+ 0xef => 'Partition that contains an EFI file system',
+ 0xf1 => 'SpeedStor',
+ 0xf2 => 'DOS 3.3+ secondary partition',
+ 0xf4 => 'SpeedStor large partition / Prologue single-volume partition',
+ 0xf5 => 'Prologue multi-volume partition',
+ 0xfd => 'Linux RAID',
+ 0xfe => 'SpeedStor > 1024 cyl. or LANstep / IBM PS/2 IML (Initial Microcode Load) partition, located at the end of the disk. / Windows NT Disk Administrator hidden partition / Linux Logical Volume Manager partition (old)',
+ 0xff => 'Xenix Bad Block Table',
);
my %type2fs = (
+arch() =~ /^ppc/ ? (
+ 0x07 => 'hpfs',
+) : (
+ 0x07 => 'ntfs',
+),
+arch() !~ /sparc/ ? (
0x01 => 'vfat',
0x04 => 'vfat',
0x05 => 'ignore',
0x06 => 'vfat',
- 0x07 => 'hpfs',
+) : (
+ 0x01 => 'ufs',
+ 0x02 => 'ufs',
+ 0x04 => 'ufs',
+ 0x06 => 'ufs',
+ 0x07 => 'ufs',
+ 0x08 => 'ufs',
+),
0x0b => 'vfat',
0x0c => 'vfat',
0x0e => 'vfat',
+ 0x1b => 'vfat',
+ 0x1c => 'vfat',
+ 0x1e => 'vfat',
0x82 => 'swap',
0x83 => 'ext2',
- nfs => 'nfs', # hack
+ 0x183=> 'reiserfs',
+ 0x402 => 'hfs',
+ nfs => 'nfs', #- hack
);
+
my %types_rev = reverse %types;
my %fs2type = reverse %type2fs;
1;
-sub type2name($) { $types{$_[0]} }
+sub important_types {
+ $::expert and return sort values %types;
+ @important_types, $::beginner ? () : @important_types2;
+}
+
+sub type2name($) { $types{$_[0]} || $_[0] }
sub type2fs($) { $type2fs{$_[0]} }
-sub name2type($) { $types_rev{$_[0]} }
sub fs2type($) { $fs2type{$_[0]} }
+sub name2type($) {
+ local ($_) = @_;
+ /0x(.*)/ ? hex $1 : $types_rev{$_} || $_;
+}
-sub isExtended($) { $_[0]->{type} == 5 }
-sub isSwap($) { $type2fs{$_[0]->{type}} eq 'swap' }
-sub isExt2($) { $type2fs{$_[0]->{type}} eq 'ext2' }
-sub isDos($) { $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]->{type}} }
-sub isWin($) { $ {{ 0xb=>1, 0xc=>1, 0xe=>1 }}{$_[0]->{type}} }
-sub isNfs($) { $_[0]->{type} eq 'nfs' } # small hack
+sub isWholedisk($) { arch() =~ /^sparc/ && $_[0]{type} == 5 }
+sub isExtended($) { arch() !~ /^sparc/ && ($_[0]{type} == 5 || $_[0]{type} == 0xf || $_[0]{type} == 0x85) }
+sub isRAID($) { $_[0]{type} == 0xfd }
+sub isMDRAID { $_[0]{device} =~ /^md/ }
+sub isSwap($) { $type2fs{$_[0]{type}} eq 'swap' }
+sub isExt2($) { $type2fs{$_[0]{type}} eq 'ext2' }
+sub isReiserfs($) { $type2fs{$_[0]{type}} eq 'reiserfs' }
+sub isDos($) { arch() !~ /^sparc/ && $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]{type}} }
+sub isWin($) { $ {{ 0xb=>1, 0xc=>1, 0xe=>1, 0x1b=>1, 0x1c=>1, 0x1e=>1 }}{$_[0]{type}} }
+sub isFat($) { isDos($_[0]) || isWin($_[0]) }
+sub isSunOS($) { arch() =~ /sparc/ && $ {{ 0x1=>1, 0x2=>1, 0x4=>1, 0x6=>1, 0x7=>1, 0x8=>1 }}{$_[0]{type}} }
+sub isSolaris($) { 0; } #- hack to search for getting the difference ? TODO
+sub isOtherAvailableFS($) { isFat($_[0]) || isSunOS($_[0]) } #- other OS that linux can access its filesystem
+sub isNfs($) { $_[0]{type} eq 'nfs' } #- small hack
+sub isNT($) { arch() !~ /^sparc/ && $_[0]{type} == 0x7 }
+sub isSupermount($) { $_[0]{type} eq 'supermount' }
+sub isHFS($) { $type2fs{$_[0]{type}} eq 'hfs' }
+sub isHiddenMacPart { defined $_[0]{isMap} }
+sub isLoopback { defined $_[0]{loopback_file} }
+sub isTrueFS { isExt2($_[0]) || isReiserfs($_[0]) }
+sub isMountableRW { isTrueFS($_[0]) || isOtherAvailableFS($_[0]) }
sub isPrimary($$) {
my ($part, $hd) = @_;
- foreach (@{$hd->{primary}->{raw}}) { $part eq $_ and return 1; }
+ foreach (@{$hd->{primary}{raw}}) { $part eq $_ and return 1; }
0;
}
-sub cylinder_size($) {
- my ($hd) = @_;
- $hd->{geom}->{sectors} * $hd->{geom}->{heads};
-}
-
-sub adjustStart($$) {
- my ($hd, $part) = @_;
- my $end = $part->{start} + $part->{size};
-
- $part->{start} = round_up($part->{start},
- $part->{start} % cylinder_size($hd) < 2 * $hd->{geom}->{sectors} ?
- $hd->{geom}->{sectors} : cylinder_size($hd));
- $part->{size} = $end - $part->{start};
-}
-sub adjustEnd($$) {
+sub adjustStartAndEnd($$) {
my ($hd, $part) = @_;
- my $end = $part->{start} + $part->{size};
- $end = round_down($end, cylinder_size($hd));
- $part->{size} = $end - $part->{start};
-}
-sub adjustStartAndEnd($$) {
- &adjustStart;
- &adjustEnd;
+ $hd->adjustStart($part);
+ $hd->adjustEnd($part);
}
sub verifyNotOverlap($$) {
@@ -131,58 +250,171 @@ sub verifyInside($$) {
$b->{start} <= $a->{start} && $a->{start} + $a->{size} <= $b->{start} + $b->{size};
}
+sub verifyParts_ {
+ foreach my $i (@_) {
+ foreach (@_) {
+ next if !$i || !$_ || $i == $_ || isWholedisk($i); #- avoid testing twice on whole disk for simplicity :-)
+ isWholedisk($_) ?
+ verifyInside($i, $_) || cdie sprintf("partitions sector #$i->{start} (%dMB) is not inside whole disk (%dMB)!", $i->{size} >> 11, $_->{size} >> 11) :
+ verifyNotOverlap($i, $_) || cdie sprintf("partitions sector #$i->{start} (%dMB) and sector #$_->{start} (%dMB) are overlapping!", $i->{size} >> 11, $_->{size} >> 11);
+ }
+ }
+}
+sub verifyParts($) {
+ my ($hd) = @_;
+ verifyParts_(get_normal_parts($hd));
+}
+sub verifyPrimary($) {
+ my ($pt) = @_;
+ $_->{start} > 0 || arch() =~ /^sparc/ || die "partition must NOT start at sector 0" foreach @{$pt->{normal}};
+ verifyParts_(@{$pt->{normal}}, $pt->{extended});
+}
+
sub assign_device_numbers($) {
my ($hd) = @_;
- my $i = 1; foreach (@{$hd->{primary}->{raw}}, map { $_->{normal} } @{$hd->{extended}}) {
- $_->{device} = $hd->{prefix} . $i++;
+ my $i = 1;
+ $_->{device} = $hd->{prefix} . $i++ foreach @{$hd->{primary}{raw}},
+ map { $_->{normal} } @{$hd->{extended} || []};
+
+ #- try to figure what the windobe drive letter could be!
+ #
+ #- first verify there's at least one primary dos partition, otherwise it
+ #- means it is a secondary disk and all will be false :(
+ my ($c, @others) = grep { isFat($_) } @{$hd->{primary}{normal}};
+
+ $i = ord 'C';
+ $c->{device_windobe} = chr($i++) if $c;
+ $_->{device_windobe} = chr($i++) foreach grep { isFat($_) } map { $_->{normal} } @{$hd->{extended}};
+ $_->{device_windobe} = chr($i++) foreach @others;
+}
+
+sub remove_empty_extended($) {
+ my ($hd) = @_;
+ my $last = $hd->{primary}{extended} or return;
+ @{$hd->{extended}} = grep {
+ if ($_->{normal}) {
+ $last = $_;
+ } else {
+ %{$last->{extended}} = $_->{extended} ? %{$_->{extended}} : ();
+ }
+ $_->{normal};
+ } @{$hd->{extended}};
+ adjust_main_extended($hd);
+}
+
+sub adjust_main_extended($) {
+ my ($hd) = @_;
+
+ if (!is_empty_array_ref $hd->{extended}) {
+ my ($l, @l) = @{$hd->{extended}};
+
+ # the first is a special case, must recompute its real size
+ my $start = round_down($l->{normal}{start} - 1, $hd->{geom}{sectors});
+ my $end = $l->{normal}{start} + $l->{normal}{size};
+ my $only_linux = 1; my $has_win_lba = 0;
+ foreach (map $_->{normal}, $l, @l) {
+ $start = min($start, $_->{start});
+ $end = max($end, $_->{start} + $_->{size});
+ $only_linux &&= isTrueFS($_) || isSwap($_);
+ $has_win_lba ||= $_->{type} == 0xc || $_->{type} == 0xe;
+ }
+ $l->{start} = $hd->{primary}{extended}{start} = $start;
+ $l->{size} = $hd->{primary}{extended}{size} = $end - $start;
+ $hd->{primary}{extended}{type} = $only_linux ? 0x85 : $has_win_lba ? 0xf : 0x5 if !$::expert;
+ }
+ unless (@{$hd->{extended} || []} || !$hd->{primary}{extended}) {
+ %{$hd->{primary}{extended}} = (); #- modify the raw entry
+ delete $hd->{primary}{extended};
+ }
+ verifyParts($hd); #- verify everything is all right
+}
+
+sub adjust_local_extended($$) {
+ my ($hd, $part) = @_;
+
+ foreach (@{$hd->{extended} || []}) {
+ $_->{normal} == $part or next;
+ $_->{size} = $part->{size} + $part->{start} - $_->{start};
+ last;
}
}
sub get_normal_parts($) {
my ($hd) = @_;
- @{$hd->{primary}->{normal} || []}, map { $_->{normal} } @{$hd->{extended} || []}
+ #- HACK !!
+ $hd->{raid} and return grep {$_} @{$hd->{raid}};
+ $hd->{loopback} and return grep {$_} @{$hd->{loopback}};
+
+ @{$hd->{primary}{normal} || []}, map { $_->{normal} } @{$hd->{extended} || []}
+}
+
+sub get_holes($) {
+ my ($hd) = @_;
+
+ my $start = arch() eq "alpha" ? 2048 : 1;
+
+ map {
+ my $current = $start;
+ $start = $_->{start} + $_->{size};
+ { start => $current, size => $_->{start} - $current }
+ } sort { $a->{start} <=> $b->{start} } grep { !isWholedisk($_) } get_normal_parts($hd), { start => $hd->{totalsectors}, size => 0 };
}
sub read_one($$) {
my ($hd, $sector) = @_;
+ my ($pt, $info);
+
+ #- it can be safely considered that the first sector is used to probe the partition table
+ #- but other sectors (typically for extended partition ones) have to match this type!
+ if (!$sector) {
+ my @parttype = arch() =~ /^sparc/ ? ('sun', 'bsd', 'unknown') : ('dos', 'bsd', 'sun', 'mac', 'unknown');
+ foreach ('empty', @parttype) {
+ /unknown/ and die "unknown partition table format";
+ eval {
+ require("partition_table_$_.pm");
+ bless $hd, "partition_table_$_";
+ ($pt, $info) = $hd->read($sector);
+ log::l("found a $_ partition table on $hd->{file} at sector $sector");
+ };
+ $@ or last;
+ }
+ } else {
+ #- keep current blessed object for that, this means it is neccessary to read sector 0 before.
+ ($pt, $info) = $hd->read($sector);
+ }
- my $pt = partition_table_raw::read($hd, $sector) or return;
-
- my @extended = grep { isExtended($_) } @$pt;
+ my @extended = $hd->hasExtended ? grep { isExtended($_) } @$pt : ();
my @normal = grep { $_->{size} && $_->{type} && !isExtended($_) } @$pt;
@extended > 1 and die "more than one extended partition";
- foreach (@normal, @extended) {
- $_->{rootDevice} = $hd->{device};
- }
- { raw => $pt, extended => $extended[0], normal => \@normal };
+ $_->{rootDevice} = $hd->{device} foreach @normal, @extended;
+ { raw => $pt, extended => $extended[0], normal => \@normal, info => $info };
}
sub read($;$) {
my ($hd, $clearall) = @_;
- my $pt = $clearall ? { raw => [ {}, {}, {}, {} ] } : read_one($hd, 0) || return 0;
-
+ if ($clearall) {
+ partition_table_raw::zero_MBR_and_dirty($hd);
+ return 1;
+ }
+ my $pt = read_one($hd, 0) or return 0;
$hd->{primary} = $pt;
- $hd->{extended} = undef;
- $clearall and return $hd->{isDirty} = 1;
-
- my @l = (@{$pt->{normal}}, $pt->{extended});
- foreach my $i (@l) { foreach (@l) {
- $i != $_ and verifyNotOverlap($i, $_) || die "partitions $i->{device} and $_->{device} are overlapping!";
- }}
-
+ undef $hd->{extended};
+ verifyPrimary($pt);
eval {
$pt->{extended} and read_extended($hd, $pt->{extended}) || return 0;
}; die "extended partition: $@" if $@;
+
assign_device_numbers($hd);
+ remove_empty_extended($hd);
1;
}
-sub read_extended($$) {
+sub read_extended {
my ($hd, $extended) = @_;
my $pt = read_one($hd, $extended->{start}) or return 0;
@@ -192,49 +424,69 @@ sub read_extended($$) {
@{$hd->{extended}} > 100 and die "oops, seems like we're looping here :( (or you have more than 100 extended partitions!)";
@{$pt->{normal}} <= 1 or die "more than one normal partition in extended partition";
- @{$pt->{normal}} >= 1 or die "no normal partition in extended partition";
- $pt->{normal} = $pt->{normal}->[0];
- # in case of extended partitions, the start sector is local to the partition or to the first extended_part!
- $pt->{normal}->{start} += $pt->{start};
-
- verifyInside($pt->{normal}, $extended) or die "partition $pt->{normal}->{device} is not inside its extended partition";
+ @{$pt->{normal}} >= 1 or cdie "no normal partition in extended partition";
+ $pt->{normal} = $pt->{normal}[0];
+ #- in case of extended partitions, the start sector is local to the partition or to the first extended_part!
+ $pt->{normal}{start} += $pt->{start};
+
+ #- the following verification can broke an existing partition table that is
+ #- correctly read by fdisk or cfdisk. maybe the extended partition can be
+ #- recomputed to get correct size.
+ if (!verifyInside($pt->{normal}, $extended)) {
+ $extended->{size} = $pt->{normal}{start} + $pt->{normal}{size};
+ verifyInside($pt->{normal}, $extended) or die "partition $pt->{normal}{device} is not inside its extended partition";
+ }
if ($pt->{extended}) {
- $pt->{extended}->{start} += $hd->{primary}->{extended}->{start};
+ $pt->{extended}{start} += $hd->{primary}{extended}{start};
read_extended($hd, $pt->{extended}) or return 0;
}
1;
}
-# give a hard drive hd, write the partition data
+# write the partition table
sub write($) {
my ($hd) = @_;
+ $hd->{isDirty} or return;
- # set first primary partition active if no primary partitions are marked as active.
- for ($hd->{primary}->{raw}) {
- (grep { $_->{local_start} = $_->{start}; $_->{active} ||= 0 } @$_) or $_->[0]->{active} = 0x80;
+ #- set first primary partition active if no primary partitions are marked as active.
+ for ($hd->{primary}{raw}) {
+ (grep { $_->{local_start} = $_->{start}; $_->{active} ||= 0 } @$_) or $_->[0]{active} = 0x80;
}
- partition_table_raw::write($hd, 0, $hd->{primary}->{raw}) or die "writing of partition table failed";
- foreach (@{$hd->{extended}}) {
- # in case of extended partitions, the start sector must be local to the partition
- $_->{normal}->{local_start} = $_->{normal}->{start} - $_->{start};
- $_->{extended} and $_->{extended}->{local_start} = $_->{extended}->{start} - $hd->{primary}->{extended}->{start};
+ #- last chance for verification, this make sure if an error is detected,
+ #- it will never be writed back on partition table.
+ verifyParts($hd);
- partition_table_raw::write($hd, $_->{start}, $_->{raw}) or die "writing of partition table failed";
+ $hd->write(0, $hd->{primary}{raw}, $hd->{primary}{info}) or die "writing of partition table failed";
+
+ #- should be fixed but a extended exist with no real extended partition, that blanks mbr!
+ if (arch() !~ /^sparc/) {
+ foreach (@{$hd->{extended}}) {
+ # in case of extended partitions, the start sector must be local to the partition
+ $_->{normal}{local_start} = $_->{normal}{start} - $_->{start};
+ $_->{extended} and $_->{extended}{local_start} = $_->{extended}{start} - $hd->{primary}{extended}{start};
+
+ $hd->write($_->{start}, $_->{raw}) or die "writing of partition table failed";
+ }
}
$hd->{isDirty} = 0;
+ $hd->{hasBeenDirty} = 1; #- used in undo (to know if undo should believe isDirty or not)
- # now sync disk and re-read the partition table
- sync();
- partition_table_raw::kernel_read($hd);
+ #- now sync disk and re-read the partition table
+ if ($hd->{needKernelReread}) {
+ sync();
+ $hd->kernel_read;
+ $hd->{needKernelReread} = 0;
+ }
}
sub active($$) {
my ($hd, $part) = @_;
- foreach (@{$hd->{primary}->{normal}}) { $_->{active} = 0; }
- $part->{active} = 0x80;
+ $_->{active} = 0 foreach @{$hd->{primary}{normal}};
+ $part->{active} = 0x80;
+ $hd->{isDirty} = 1;
}
@@ -243,63 +495,120 @@ sub remove($$) {
my ($hd, $part) = @_;
my $i;
- # first search it in the primary partitions
- $i = 0; foreach (@{$hd->{primary}->{normal}}) {
+ #- first search it in the primary partitions
+ $i = 0; foreach (@{$hd->{primary}{normal}}) {
if ($_ eq $part) {
- splice(@{$hd->{primary}->{normal}}, $i, 1);
- %$_ = ();
+ splice(@{$hd->{primary}{normal}}, $i, 1);
+ %$_ = (); #- blank it
- return $hd->{isDirty} = 1;
+ return $hd->{isDirty} = $hd->{needKernelReread} = 1;
}
$i++;
}
- # otherwise search it in extended partitions
- my $last = $hd->{primary}->{extended};
- $i = 0; foreach (@{$hd->{extended}}) {
- if ($_->{normal} eq $part) {
- %{$last->{extended}} = $_->{extended} ? %{$_->{extended}} : ();
- splice(@{$hd->{extended}}, $i, 1);
-
- return $hd->{isDirty} = 1;
- }
- $last = $_;
- $i++;
+
+ my ($first, $second, $third) = map { $_->{normal} } @{$hd->{extended} || []};
+ if ($third && $first eq $part) {
+ die "Can't handle removing hda5 when hda6 is not the second partition" if $second->{start} > $third->{start};
+ }
+
+ #- otherwise search it in extended partitions
+ foreach (@{$hd->{extended} || []}) {
+ $_->{normal} eq $part or next;
+
+ delete $_->{normal}; #- remove it
+ remove_empty_extended($hd);
+
+ return $hd->{isDirty} = $hd->{needKernelReread} = 1;
}
0;
}
# create of partition at starting at `start', of size `size' and of type `type' (nice comment, uh?)
-# !be carefull!, no verification is done (start -> start+size must be free)
-sub add($$) {
+sub add_primary($$) {
my ($hd, $part) = @_;
- $part->{notFormatted} = 1;
- $part->{isFormatted} = 0;
- $part->{rootDevice} = $hd->{device};
- $hd->{isDirty} = 1;
- adjustStartAndEnd($hd, $part);
+ {
+ local $hd->{primary}{normal}; #- save it to fake an addition of $part, that way add_primary do not modify $hd if it fails
+ push @{$hd->{primary}{normal}}, $part;
+ adjust_main_extended($hd); #- verify
+ raw_add($hd->{primary}{raw}, $part);
+ }
+ push @{$hd->{primary}{normal}}, $part; #- really do it
+}
- if (is_empty_array_ref($hd->{primary}->{normal})) {
- raw_add($hd->{primary}->{raw}, $part);
- @{$hd->{primary}->{normal}} = $part;
- } else {
- foreach (@{$hd->{extended}}) {
- $_->{normal} and next;
- raw_add($_->{raw}, $part);
- $_->{normal} = $part;
- return;
+sub add_extended {
+ arch() =~ /^sparc/ and die _("Extended partition not supported on this platform");
+
+ my ($hd, $part, $extended_type) = @_;
+ $extended_type =~ s/Extended_?//;
+
+ my $e = $hd->{primary}{extended};
+
+ if ($e && !verifyInside($part, $e)) {
+ #-die "sorry, can't add outside the main extended partition" unless $::unsafe;
+ my $end = $e->{start} + $e->{size};
+ my $start = min($e->{start}, $part->{start});
+ $end = max($end, $part->{start} + $part->{size}) - $start;
+
+ { #- faking a resizing of the main extended partition to test for problems
+ local $e->{start} = $start;
+ local $e->{size} = $end - $start;
+ eval { verifyPrimary($hd->{primary}) };
+ $@ and die
+_("You have a hole in your partition table but I can't use it.
+The only solution is to move your primary partitions to have the hole next to the extended partitions");
}
+ }
+
+ if ($e && $part->{start} < $e->{start}) {
+ my $l = first (@{$hd->{extended}});
+
+ #- the first is a special case, must recompute its real size
+ $l->{start} = round_down($l->{normal}{start} - 1, $hd->cylinder_size());
+ $l->{size} = $l->{normal}{start} + $l->{normal}{size} - $l->{start};
+ my $ext = { %$l };
+ unshift @{$hd->{extended}}, { type => 5, raw => [ $part, $ext, {}, {} ], normal => $part, extended => $ext };
+ #- size will be autocalculated :)
+ } else {
my ($ext, $ext_size) = is_empty_array_ref($hd->{extended}) ?
- ($hd->{primary}, $hd->{totalsectors} - $part->{start}) :
+ ($hd->{primary}, -1) : #- -1 size will be computed by adjust_main_extended
(top(@{$hd->{extended}}), $part->{size});
- my %ext = ( type => 5, start => $part->{start}, size => $ext_size );
-
+ my %ext = ( type => $extended_type || 5, start => $part->{start}, size => $ext_size );
+
raw_add($ext->{raw}, \%ext);
$ext->{extended} = \%ext;
push @{$hd->{extended}}, { %ext, raw => [ $part, {}, {}, {} ], normal => $part };
+ }
+ $part->{start}++; $part->{size}--; #- let it start after the extended partition sector
+ adjustStartAndEnd($hd, $part);
+
+ adjust_main_extended($hd);
+}
+
+sub add($$;$$) {
+ my ($hd, $part, $primaryOrExtended, $forceNoAdjust) = @_;
- $part->{start}++; $part->{size}--; # let it start after the extended partition sector
- adjustStartAndEnd($hd, $part);
+ get_normal_parts($hd) >= ($hd->{device} =~ /^sd/ ? 15 : 63) and cdie "maximum number of partitions handled by linux reached";
+
+ $part->{notFormatted} = 1;
+ $part->{isFormatted} = 0;
+ $part->{rootDevice} = $hd->{device};
+ $hd->{isDirty} = $hd->{needKernelReread} = 1;
+ $part->{start} ||= 1 if arch() !~ /^sparc/; #- starting at sector 0 is not allowed
+ adjustStartAndEnd($hd, $part) unless $forceNoAdjust;
+
+ my $e = $hd->{primary}{extended};
+
+ if (arch() =~ /^sparc/ ||
+ $primaryOrExtended eq 'Primary' ||
+ $primaryOrExtended !~ /Extended/ && is_empty_array_ref($hd->{primary}{normal})) {
+ eval { add_primary($hd, $part) };
+ return unless $@;
+ }
+ eval { add_extended($hd, $part, $primaryOrExtended) } if $hd->hasExtended; #- try adding extended
+ if ($@ || !$hd->hasExtended) {
+ eval { add_primary($hd, $part) };
+ die $@ if $@; #- send the add extended error which should be better
}
}
@@ -308,7 +617,7 @@ sub next($$) {
my ($hd, $part) = @_;
first(
- sort { $a->{start} <=> $b->{start} }
+ sort { $a->{start} <=> $b->{start} }
grep { $_->{start} >= $part->{start} + $part->{size} }
get_normal_parts($hd)
);
@@ -319,8 +628,12 @@ sub next_start($$) {
$next ? $next->{start} : $hd->{totalsectors};
}
-
-sub raw_add($$) {
+sub can_raw_add {
+ my ($hd) = @_;
+ $_->{size} || $_->{type} or return 1 foreach @{$hd->{primary}{raw}};
+ 0;
+}
+sub raw_add {
my ($raw, $part) = @_;
foreach (@$raw) {
@@ -331,3 +644,39 @@ sub raw_add($$) {
die "raw_add: partition table already full";
}
+sub load($$;$) {
+ my ($hd, $file, $force) = @_;
+
+ local *F;
+ open F, $file or die _("Error reading file %s", $file);
+
+ my $h;
+ {
+ local $/ = "\0";
+ eval <F>;
+ }
+ $@ and die _("Restoring from file %s failed: %s", $file, $@);
+
+ ref $h eq 'ARRAY' or die _("Bad backup file");
+
+ my %h; @h{@fields2save} = @$h;
+
+ $h{totalsectors} == $hd->{totalsectors} or $force or cdie "bad totalsectors";
+
+ #- unsure we don't modify totalsectors
+ local $hd->{totalsectors};
+
+ @{$hd}{@fields2save} = @$h;
+
+ delete @$_{qw(isMounted isFormatted notFormatted toFormat toFormatUnsure)} foreach get_normal_parts($hd);
+ $hd->{isDirty} = $hd->{needKernelReread} = 1;
+}
+
+sub save($$) {
+ my ($hd, $file) = @_;
+ my @h = @{$hd}{@fields2save};
+ local *F;
+ open F, ">$file"
+ and print F Data::Dumper->Dump([\@h], ['$h']), "\0"
+ or die _("Error writing to file %s", $file);
+}
diff --git a/perl-install/partition_table_bsd.pm b/perl-install/partition_table_bsd.pm
index 0b03249c1..c6cd71394 100644
--- a/perl-install/partition_table_bsd.pm
+++ b/perl-install/partition_table_bsd.pm
@@ -1,4 +1,4 @@
-package partition_table_bsd;
+package partition_table_bsd; # $Id$
use diagnostics;
use strict;
@@ -47,6 +47,8 @@ my ($main_format, $main_fields) = list2kv(
S => 'npartitions',
I => 'bbsize',
I => 'sbsize',
+ a128=> 'partitions',
+ a236=> 'blank',
);
$main_format = join '', @$main_format;
@@ -66,12 +68,14 @@ sub read($$) {
sysread F, $tmp, psizeof($main_format) or die "error while reading partition table in sector $sector";
my %info; @info{@$main_fields} = unpack $main_format, $tmp;
+ #- TODO verify checksum
+
+ my $size = psizeof($format);
my @pt = map {
- sysread F, $tmp, psizeof($format) or die "error while reading partition table in sector $sector";
- my %h; @h{@fields} = unpack $format, $tmp;
+ my %h; @h{@fields} = unpack $format, $_;
$h{type} = $typeToDos{$h{type}} || $h{type};
\%h;
- } (1..$nb_primary);
+ } $info{partitions} =~ /(.{$size})/g;
#- check magic number
$info{magic} == $magic or die "bad magic number";
@@ -85,19 +89,27 @@ sub read($$) {
sub write($$$;$) {
my ($hd, $sector, $pt, $info) = @_;
- print "Her\n";
- local *F; partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
- c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ #- handle testing for writing partition table on file only!
+ local *F;
+ if ($::testing) {
+ my $file = "/tmp/partition_table_$hd->{device}";
+ open F, ">$file" or die "error opening test file $file";
+ } else {
+ partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
+ c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ }
- $info->{npartitions} = $nb_primary; #- is it ok?
+ #- TODO compute checksum
- syswrite F, pack($main_format, @$info{@$main_fields}), psizeof($main_format) or return 0;
+ $info->{npartitions} = $nb_primary; #- is it ok?
@$pt == $nb_primary or die "partition table does not have $nb_primary entries";
- foreach (@$pt) {
+ $info->{partitions} = join '', map {
local $_->{type} = $typeFromDos{$_->{type}} || $_->{type};
- syswrite F, pack($format, @$_{@fields}), psizeof($format) or return 0;
- }
+ pack $format, @$_{@fields};
+ } @$pt;
+
+ syswrite F, pack($main_format, @$info{@$main_fields}), psizeof($main_format) or return 0;
1;
}
@@ -112,7 +124,7 @@ sub info {
dtype => $hd->{device} =~ /^sd/ ? $dtype_scsi : $dtype_ST506,
secsize => $common::SECTORSIZE,
ncylinders => $hd->{geom}{cylinders},
- secpercyl => partition_table::cylinder_size($hd),
+ secpercyl => $hd->cylinder_size(),
secprtunit => $hd->{geom}{totalsectors},
rpm => 3600,
interleave => 1,
diff --git a/perl-install/partition_table_dos.pm b/perl-install/partition_table_dos.pm
index 1b25a8f0b..e8ef57851 100644
--- a/perl-install/partition_table_dos.pm
+++ b/perl-install/partition_table_dos.pm
@@ -1,4 +1,4 @@
-package partition_table_dos;
+package partition_table_dos; # $Id$
use diagnostics;
use strict;
@@ -8,6 +8,7 @@ use vars qw(@ISA);
use common qw(:common :system :file);
use partition_table_raw;
+use partition_table;
use c;
my @fields = qw(active start_head start_sec start_cyl type end_head end_sec end_cyl start size);
@@ -67,8 +68,15 @@ sub read($$) {
sub write($$$;$) {
my ($hd, $sector, $pt) = @_;
- local *F; partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
- c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ #- handle testing for writing partition table on file only!
+ local *F;
+ if ($::testing) {
+ my $file = "/tmp/partition_table_$hd->{device}";
+ open F, ">$file" or die "error opening test file $file";
+ } else {
+ partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
+ c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ }
@$pt == $nb_primary or die "partition table does not have $nb_primary entries";
foreach (@$pt) {
diff --git a/perl-install/partition_table_empty.pm b/perl-install/partition_table_empty.pm
index d59cea52b..a33798faf 100644
--- a/perl-install/partition_table_empty.pm
+++ b/perl-install/partition_table_empty.pm
@@ -1,4 +1,4 @@
-package partition_table_empty;
+package partition_table_empty; # $Id$
#- this is a mainly dummy partition table. If we find it's empty, we just call -
#- zero_MBR which will take care of bless'ing us to the partition table type best
@@ -21,7 +21,7 @@ sub read($$) {
my ($hd, $sector) = @_;
my $tmp;
- my $magic = "\0" x 256;
+ my $magic = "\0" x 512;
local *F; partition_table_raw::openit($hd, *F) or die "failed to open device";
c::lseek_sector(fileno(F), $sector, 0) or die "reading of partition in sector $sector failed";
diff --git a/perl-install/partition_table_mac.pm b/perl-install/partition_table_mac.pm
index 61e741f4b..91d7cea01 100644
--- a/perl-install/partition_table_mac.pm
+++ b/perl-install/partition_table_mac.pm
@@ -1,4 +1,4 @@
-package partition_table_mac;
+package partition_table_mac; # $Id$
use diagnostics;
use strict;
@@ -76,7 +76,15 @@ my $pmagic = 0x504D;
sub adjustStart($$) {
my ($hd, $part) = @_;
+ my $end = $part->{start} + $part->{size};
+ my $partmap_end = $hd->{primary}{raw}[0]{size};
+
+ if ($part->{start} <= $partmap_end) {
+ $part->{start} = $partmap_end + 1;
+ $part->{size} = $end - $part->{start};
+ }
}
+
sub adjustEnd($$) {
my ($hd, $part) = @_;
}
@@ -94,7 +102,8 @@ sub read($$) {
foreach $i (0 .. $info{bzDrvrCnt}-1) {
sysread F, $tmp, psizeof($dd_format) or die "error while reading driver data in sector $sector";
- $info{ddMap}[$i] = unpack $dd_format, $tmp;
+ my %dd; @dd{@$dd_fields} = unpack $dd_format, $tmp;
+ push @{$info{ddMap}}, \%dd;
}
#- check magic number
@@ -113,7 +122,7 @@ sub read($$) {
c::lseek_sector(fileno(F), $sector, 512) or die "reading of partition in sector $sector failed";
my @pt;
- for($i=0;$i<$partmapsize;$i++) {
+ for ($i=0;$i<$partmapsize;$i++) {
my $part;
sysread F, $part, psizeof($p_format) or die "error while reading partition info in sector $sector";
@@ -127,7 +136,8 @@ sub read($$) {
if ($h{pType} =~ /^Apple_UNIX_SVR2/i) {
$h{pName} =~ /swap/i ? ($h{type} = 0x82) : ($h{type} = 0x83);
} elsif ($h{pType} =~ /^Apple_Free/i) {
- $h{type} = 0x0;
+ next;
+ #$h{type} = 0x0;
} elsif ($h{pType} =~ /^Apple_HFS/i) {
$h{type} = 0x402;
} elsif ($h{pType} =~ /^Apple_Partition_Map/i) {
@@ -136,6 +146,12 @@ sub read($$) {
} else {
$h{type} = 0x401;
};
+
+ # Let's see if this partition is a driver.
+ foreach (@{$info{ddMap}}) {
+ $_->{ddBlock} == $h{pPBlockStart} and $h{isDriver} = 1;
+ }
+
}
\%h;
} [ $part ];
@@ -165,12 +181,12 @@ sub write($$$;$) {
# Now go thru the partitions, sort and fill gaps.
my $last;
- while($part) {
+ while ($part) {
$last = $part;
$part = &partition_table::next($hd, $part);
$part or last;
- if($last->{start} + $last->{size} < $part->{start}) {
+ if ($last->{start} + $last->{size} < $part->{start}) {
#There is a gap between partitions. Fill it and move on.
push @partstowrite, {
type => 0x0,
@@ -182,7 +198,7 @@ sub write($$$;$) {
};
# now, fill a gap at the end if there is one.
- if($last->{start} + $last->{size} < $hd->{totalsectors}) {
+ if ($last->{start} + $last->{size} < $hd->{totalsectors}) {
push @partstowrite, {
type => 0x0,
start => $last->{start} + $last->{size},
@@ -191,13 +207,16 @@ sub write($$$;$) {
}
# Since we didn't create any new drivers, let's try and match up our driver records with out partitons and see if any are missing.
- my $i;
+ $info->{bzDrvrCnt} = 0;
my @ddstowrite;
- foreach $i ( 0 .. $info->{bzDrvrCnt} - 1) {
- my $ddBlock = $_->{ddBlock};
- my $dd = $_;
- foreach(@partstowrite) {
- $ddBlock == $_->{pPBlockStart} and push @ddstowrite, $dd;
+ my $dd;
+ foreach $dd (@{$info->{ddMap}}) {
+ foreach (@partstowrite) {
+ if ($dd->{ddBlock} == $_->{pPBlockStart}) {
+ push @ddstowrite, $dd;
+ $info->{bzDrvrCnt}++;
+ last;
+ }
}
}
@@ -205,11 +224,11 @@ sub write($$$;$) {
syswrite F, pack($bz_format, @$info{@$bz_fields}), psizeof($bz_format) or return 0;
# ...and now the driver information.
- foreach $i ( 0 .. $info->{bzDrvrCnt} - 1) {
- syswrite F, pack($dd_format, $ddstowrite[$i]{@$dd_fields}), psizeof($dd_format) or return 0;
+ foreach (@ddstowrite) {
+ syswrite F, pack($dd_format, @$_{@$dd_fields}), psizeof($dd_format) or return 0;
}
# zero the rest of the data in the first block.
- foreach $i ( 1 .. (494 - ($info->{bzDrvrCnt} * 8))) {
+ foreach ( 1 .. (494 - ((@ddstowrite) * 8))) {
syswrite F, "\0", 1 or return 0;
}
#c::lseek_sector(fileno(F), $sector, 512) or return 0;
@@ -234,7 +253,7 @@ sub write($$$;$) {
$_->{pBootArgs} = "\0";
$_->{pReserved} = "\0";
- if($_->{type} == 0x402) {
+ if ($_->{type} == 0x402) {
$_->{pType} = "Apple_HFS";
$_->{pName} = "MacOS";
$_->{pFlags} = 0x4000037F;
@@ -285,18 +304,36 @@ sub info {
sub clear_raw {
my ($hd) = @_;
+ my @oldraw = @{$hd->{primary}{raw}};
my $pt = { raw => [ ({}) x 63 ], info => info($hd) };
#- handle special case for partition 1 which is the partition map.
- my $part = {
+ $pt->{raw}[0] = {
type => 0x401,
start => 1,
size => 63,
isMap => 1,
};
+# $pt->{raw}[1] = {
+# type => 0x0,
+# start => 64,
+# size => $hd->{totalsectors} - 64,
+# isMap => 0,
+# };
+ push @{$pt->{normal}}, $pt->{raw}[0];
+# push @{$pt->{normal}}, $pt->{raw}[1];
+
+ #- Recover any Apple Drivers, if any.
+ my $i = 1;
+ foreach (@oldraw) {
+ if (defined $_->{isDriver}) {
+ $pt->{raw}[$i] = $_;
+ push @{$pt->{normal}}, $pt->{raw}[$i];
+ $i++;
+ }
+ };
+ @{$pt->{info}{ddMap}} = @{$hd->{primary}{info}{ddMap}};
- $pt->{raw}[0] = $part;
- push @{$pt->{normal}}, $part;
$pt;
}
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index d85789a50..aae6f843c 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -1,101 +1,136 @@
-package partition_table_raw;
+package partition_table_raw; # $Id$
use diagnostics;
use strict;
-use common qw(:common :system);
+use common qw(:common :system :file);
+use devices;
use c;
-my @fields = qw(active start_head start_sec start_cyl type end_head end_sec end_cyl start size);
-my $format = "C8 I2";
-my $magic = "\x55\xAA";
-my $nb_primary = 4;
-
-my $offset = $common::SECTORSIZE - length($magic) - $nb_primary * common::psizeof($format);
-
-1;
-
-
-sub compute_CHS($$) {
- my ($hd, $e) = @_;
- my @l = qw(cyl head sec);
- @$e{map { "start_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS(sector2CHS($hd, $e->{start})) : (0,0,0);
- @$e{map { "end_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS(sector2CHS($hd, $e->{start} + $e->{size} - 1)) : (0,0,0);
- 1;
+my @MBR_signatures = (
+ [ 'empty', 0, "\0\0\0\0" ],
+ [ 'grub', 0, "\xEBG", 0x17d, "stage1 \0" ],
+ [ 'grub', 0, "\xEBH", 0x17e, "stage1 \0" ],
+ [ 'grub', 0, "\xEBH", 0x18a, "stage1 \0" ],
+ [ 'lilo', 0x2, "LILO" ],
+ [ 'lilo', 0x6, "LILO" ],
+ [ 'osbs', 0x2, "OSBS" ], #- http://www.prz.tu-berlin.de/~wolf/os-bs.html
+ [ 'pqmagic', 0xef, "PQV" ],
+ [ 'BootStar', 0x130, "BootStar:" ],
+ [ 'DocsBoot', 0x148, 'DocsBoot' ],
+ [ 'system_commander', 0x1ad, "SYSCMNDRSYS" ],
+ [ 'Be Os', 0x24, 'Boot Manager' ],
+ [ 'TimO', 0, 'IBM Thinkpad hibernation partition' ],
+ [ 'dos', 0xa0, "\x25\x03\x4E\x02\xCD\x13" ],
+ [ 'dos', 0xa0, "\x00\xB4\x08\xCD\x13\x72" ], #- nt2k's
+ [ 'dos', 0x60, "\xBB\x00\x7C\xB8\x01\x02\x57\xCD\x13\x5F\x73\x0C\x33\xC0\xCD\x13" ], #- nt's
+ [ 'dos', 0x70, "\x0C\x33\xC0\xCD\x13\x4F\x75\xED\xBE\xA3" ],
+ [ 'freebsd', 0xC0, "\x00\x30\xE4\xCD\x16\xCD\x19\xBB\x07\x00\xB4" ],
+ [ 'freebsd', 0x160, "\x6A\x10\x89\xE6\x48\x80\xCC\x40\xCD\x13" ],
+ [ 'dummy', 0xAC, "\x0E\xB3\x07\x56\xCD\x10\x5E\xEB" ], #- caldera?
+ [ 'ranish', 0x100, "\x6A\x10\xB4\x42\x8B\xF4\xCD\x13\x8B\xE5\x73" ],
+ [ 'os2', 0x1c2, "\xA" ],
+);
+
+sub typeOfMBR($) { typeFromMagic(devices::make($_[0]), @MBR_signatures) }
+sub typeOfMBR_($) { typeFromMagic($_[0], @MBR_signatures) }
+
+sub hasExtended { 0 }
+
+sub cylinder_size($) {
+ my ($hd) = @_;
+ $hd->{geom}{sectors} * $hd->{geom}{heads};
}
-sub CHS2rawCHS($$$) {
- my ($c, $h, $s) = @_;
- $c = min($c, 1023); # no way to have a #cylinder >= 1024
- ($c & 0xff, $h, $s | ($c >> 2 & 0xc0));
+#- default method for starting a partition, only head size or twice
+#- is allowed for starting a partition after a cylinder boundarie.
+sub adjustStart($$) {
+ my ($hd, $part) = @_;
+ my $end = $part->{start} + $part->{size};
+
+ $part->{start} = round_up($part->{start},
+ $part->{start} % cylinder_size($hd) < 2 * $hd->{geom}{sectors} ?
+ $hd->{geom}{sectors} : cylinder_size($hd));
+ $part->{size} = $end - $part->{start};
+ $part->{size} > 0 or die "adjustStart get a too small partition to handle correctly";
}
-
-# returns (cylinder, head, sector)
-sub sector2CHS($$) {
- my ($hd, $start) = @_;
- my ($s, $h);
- ($start, $s) = divide($start, $hd->{geom}->{sectors});
- ($start, $h) = divide($start, $hd->{geom}->{heads});
- ($start, $h, $s + 1);
+#- adjusting end to match a cylinder boundary, two methods are used and must
+#- match at the end, else something is wrong and nothing will be done on
+#- partition table.
+#- $end2 is computed by removing 2 (or only 1 if only 2 heads on drive) groups
+#- of sectors, this is necessary to handle extended partition where logical
+#- partition start after 1 (or 2 accepted) groups of sectors (typically 63).
+#- $end is floating (is not on cylinder boudary) so we have to choice a good
+#- candidate, $end1 or $end2 should always be good except $end1 for small
+#- partition size.
+sub adjustEnd($$) {
+ my ($hd, $part) = @_;
+ my $end = $part->{start} + $part->{size};
+ my $end1 = round_down($end, cylinder_size($hd));
+ my $end2 = round_up($end - ($hd->{geom}{heads} > 2 ? 2 : 1) * $hd->{geom}{sectors}, cylinder_size($hd));
+ $end2 <= $hd->{geom}{cylinders} * cylinder_size($hd) or die "adjustEnd go beyond end of device geometry ($end2 > $hd->{totalsectors})";
+ $part->{size} = ($end1 - $part->{start} > cylinder_size($hd) ? $end1 : $end2) - $part->{start};
+ $part->{size} > 0 or die "adjustEnd get a too small partition to handle correctly";
}
sub get_geometry($) {
my ($dev) = @_;
my $g = "";
-
+
local *F; sysopen F, $dev, 0 or return;
ioctl(F, c::HDIO_GETGEO(), $g) or return;
-
my %geom; @geom{qw(heads sectors cylinders start)} = unpack "CCSL", $g;
+ $geom{totalcylinders} = $geom{cylinders};
+
+ #- $geom{cylinders} is no good (only a ushort, that means less than 2^16 => at best 512MB)
+ if (my $total = c::total_sectors(fileno F)) {
+ $geom{cylinders} = int $total / $geom{heads} / $geom{sectors};
+ }
{ geom => \%geom, totalsectors => $geom{heads} * $geom{sectors} * $geom{cylinders} };
}
-sub openit($$;$) { sysopen $_[1], $_[0]->{file}, $_[2] || 0; }
-
-# cause kernel to re-read partition table
-sub kernel_read($) {
+#- works for both hard drives and partitions ;p
+sub description {
my ($hd) = @_;
- local *F; openit($hd, \*F) or return 0;
- ioctl(F, c::BLKRRPART(), 0) or die "kernel_read failed: need to reboot";
-}
-
-sub read($$) {
- my ($hd, $sector) = @_;
- my $tmp;
-
- local *F; openit($hd, \*F) or return;
- c::lseek_sector(fileno(F), $sector, $offset) or die "reading of partition in sector $sector failed";
+ my $win = $hd->{device_windobe};
- my @pt = map {
- sysread F, $tmp, psizeof($format) or return "error while reading partition table in sector $sector";
- my %h; @h{@fields} = unpack $format, $tmp;
- \%h;
- } (1..$nb_primary);
+ sprintf "%s%s (%d%s%s)",
+ $hd->{device},
+ $win && " [$win:]",
+ ($hd->{totalsectors} || $hd->{size}) >> 11, _("MB"),
+ $hd->{info} && ", $hd->{info}";
+}
- # check magic number
- sysread F, $tmp, length $magic or die "error reading magic number";
- $tmp eq $magic or die "bad magic number";
+sub openit($$;$) { sysopen $_[1], $_[0]{file}, $_[2] || 0; }
- [ @pt ];
+# cause kernel to re-read partition table
+sub kernel_read($) {
+ my ($hd) = @_;
+ sync();
+ local *F; openit($hd, *F) or return 0;
+ sync(); sleep(1);
+ $hd->{rebootNeeded} = !ioctl(F, c::BLKRRPART(), 0);
+ sync();
+ close F;
+ sync(); sleep(1);
}
-# write the partition table (and extended ones)
-# for each entry, it uses fields: start, size, type, active
-sub write($$$) {
- my ($hd, $sector, $pt) = @_;
+sub zero_MBR {
+ my ($hd) = @_;
+ #- force the standard partition type for the architecture
+ my $type = arch() eq "alpha" ? "bsd" : arch() =~ /^sparc/ ? "sun" : arch() eq "ppc" ? "mac" : "dos";
+ require("partition_table_$type.pm");
+ bless $hd, "partition_table_$type";
+ $hd->{primary} = $hd->clear_raw();
+ delete $hd->{extended};
+}
- local *F; openit($hd, \*F, 2) or die "error opening device $hd->{device} for writing";
- c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+sub zero_MBR_and_dirty {
+ my ($hd) = @_;
+ zero_MBR($hd);
+ $hd->{isDirty} = $hd->{needKernelReread} = 1;
- @$pt == $nb_primary or die "partition table does not have $nb_primary entries";
- foreach (@$pt) {
- compute_CHS($hd, $_);
- local $_->{start} = $_->{local_start} || 0;
- $_->{active} ||= 0; $_->{type} ||= 0; $_->{size} ||= 0; # for no warning
- syswrite F, pack($format, @$_{@fields}) or return 0;
- }
- syswrite F, $magic or return 0;
- 1;
}
-sub zero_MBR($) { &write($_[0], 0, [ {} x $nb_primary ]); }
+
+1;
diff --git a/perl-install/partition_table_sun.pm b/perl-install/partition_table_sun.pm
index 5c8fc749f..2eec591b3 100644
--- a/perl-install/partition_table_sun.pm
+++ b/perl-install/partition_table_sun.pm
@@ -1,4 +1,4 @@
-package partition_table_sun;
+package partition_table_sun; # $Id$
use diagnostics;
use strict;
@@ -11,12 +11,6 @@ use partition_table_raw;
use partition_table;
use c;
-#- very bad and rough handling :(
-my %typeToDos = (
- 5 => 0,
-);
-my %typeFromDos = reverse %typeToDos;
-
my ($main_format, $main_fields) = list2kv(
a128 => 'info',
a14 => 'spare0',
@@ -39,12 +33,44 @@ my ($main_format, $main_fields) = list2kv(
$main_format = join '', @$main_format;
my ($fields1, $fields2) = ([ qw(type flags) ], [ qw(start_cylinder size) ]);
-my ($format1, $format2) = ("x C x C", "N N");
+my ($format1, $format2) = ("xCxC", "N2");
my ($size1, $size2) = map { psizeof($_) } ($format1, $format2);
my $magic = 0xDABE;
my $nb_primary = 8;
my $offset = 0;
+sub adjustStart($$) {
+ my ($hd, $part) = @_;
+ my $end = $part->{start} + $part->{size};
+
+ #- since partition must always start on cylinders boundaries on sparc,
+ #- note that if start sector is on the first cylinder, it is adjusted
+ #- to 0 and it is valid, cylinder 0 bug is from bad define for sparc
+ #- compilation of mke2fs combined with a blind kernel...
+ $part->{start} = round_down($part->{start}, $hd->cylinder_size());
+ $part->{size} = $end - $part->{start};
+ $part->{size} = $hd->cylinder_size() if $part->{size} <= 0;
+}
+sub adjustEnd($$) {
+ my ($hd, $part) = @_;
+ my $end = $part->{start} + $part->{size};
+ my $end2 = round_up($end, $hd->cylinder_size());
+ $end2 = $hd->{geom}{cylinders} * $hd->cylinder_size() if $end2 > $hd->{geom}{cylinders} * $hd->cylinder_size();
+ $part->{size} = $end2 - $part->{start};
+}
+
+#- compute crc checksum used for Sun Label partition, expect
+#- $tmp to be the 512 bytes buffer to be read/written to MBR.
+sub compute_crc($) {
+ my ($tmp) = @_;
+ my @l2b = unpack "n256", $tmp;
+ my $crc = 0;
+
+ map { $crc ^= $_ } @l2b;
+
+ $crc;
+}
+
sub read($$) {
my ($hd, $sector) = @_;
my $tmp;
@@ -58,18 +84,31 @@ sub read($$) {
#- check magic number
$info{magic} == $magic or die "bad magic number";
- @{$hd->{geom}}{qw(cylinders heads sectors)} = @info{qw(ncyl nsect ntrks)};
-
- #- TODO verify checksum
- my @pt = mapn {
- my %h;
- @h{@$fields1} = unpack $format1, $_[0];
- @h{@$fields2} = unpack $format2, $_[1];
- $h{start} = $sector + $h{start_cylinder} * partition_table::cylinder_size($hd);
- $h{type} = $typeToDos{$h{type}} || $h{type};
- $h{size} or $h{$_} = 0 foreach keys %h;
- \%h;
- } [ $info{infos} =~ /(.{$size1})/g ], [ $info{partitions} =~ /(.{$size2})/g ];
+ #- check crc, csum contains the crc so result should be 0.
+ compute_crc($tmp) == 0 or die "bad checksum";
+
+ @{$hd->{geom}}{qw(cylinders heads sectors)} = @info{qw(ncyl ntrks nsect)};
+
+ my @pt;
+ my @infos_up = unpack $format1 x $nb_primary, $info{infos};
+ my @partitions_up = unpack $format2 x $nb_primary, $info{partitions};
+ for (0..$nb_primary-1) {
+ my $h = { type => $infos_up[2 * $_], flag => $infos_up[1 + 2 * $_],
+ start_cylinder => $partitions_up[2 * $_], size => $partitions_up[1 + 2 * $_] };
+ $h->{start} = $sector + $h->{start_cylinder} * $hd->cylinder_size();
+ $h->{type} && $h->{size} or $h->{$_} = 0 foreach keys %$h;
+ push @pt, $h;
+ }
+
+#- this code is completely broken by null char inside strings, it gets completely crazy :-)
+# my @pt = mapn {
+# my %h;
+# @h{@$fields1} = unpack $format1, $_[0];
+# @h{@$fields2} = unpack $format2, $_[1];
+# $h{start} = $sector + $h{start_cylinder} * $hd->cylinder_size();
+# $h{type} && $h{size} or $h{$_} = 0 foreach keys %h;
+# \%h;
+# } [ grep { $_ } split /(.{$size1})/o, $info{infos} ], [ grep { $_ } split /(.{$size2})/o, $info{partitions} ];
[ @pt ], \%info;
}
@@ -78,51 +117,85 @@ sub read($$) {
# for each entry, it uses fields: start, size, type, active
sub write($$$;$) {
my ($hd, $sector, $pt, $info) = @_;
-
- local *F; partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
- c::lseek_sector(fileno(F), $sector, $offset) or return 0;
-
- #- TODO compute checksum
+# my ($csize, $wdsize) = (0, 0);
+
+ #- handle testing for writing partition table on file only!
+ local *F;
+ if ($::testing) {
+ my $file = "/tmp/partition_table_$hd->{device}";
+ open F, ">$file" or die "error opening test file $file";
+ } else {
+ partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
+ c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ }
($info->{infos}, $info->{partitions}) = map { join '', @$_ } list2kv map {
- $_->{start} % partition_table::cylinder_size($hd) == 0 or die "partition not at beginning of cylinder";
- local $_->{type} = $typeFromDos{$_->{type}} || $_->{type};
- local $_->{start_cylinder} = $_->{start} / partition_table::cylinder_size($hd) - $sector;
+ $_->{start} % $hd->cylinder_size() == 0 or die "partition not at beginning of cylinder";
+# $csize += $_->{size} if $_->{type} != 5;
+# $wdsize += $_->{size} if $_->{type} == 5;
+ $_->{flags} |= 0x10 if $_->{mntpoint} eq '/';
+ $_->{flags} |= 0x01 if partition_table::isSwap($_);
+ local $_->{start_cylinder} = $_->{start} / $hd->cylinder_size() - $sector;
pack($format1, @$_{@$fields1}), pack($format2, @$_{@$fields2});
} @$pt;
+# $csize == $wdsize or die "partitions are not using whole disk space";
+
+ #- compute the checksum by building the buffer to write and call compute_crc.
+ #- set csum to 0 so compute_crc will give the right csum value.
+ $info->{csum} = 0;
+ $info->{csum} = compute_crc(pack($main_format, @$info{@$main_fields}));
syswrite F, pack($main_format, @$info{@$main_fields}), psizeof($main_format) or return 0;
+ sync();
+
1;
}
sub info {
my ($hd) = @_;
- my $dtype_scsi = 4; #- taken from fdisk, removed unused one,
- my $dtype_ST506 = 6; #- see fdisk for more
-
- {
- magic => $magic,
- magic2 => $magic,
- dtype => $hd->{device} =~ /^sd/ ? $dtype_scsi : $dtype_ST506,
- secsize => $common::SECTORSIZE,
- ncylinders => $hd->{geom}{cylinders},
- secpercyl => partition_table::cylinder_size($hd),
- secprtunit => $hd->{geom}{totalsectors},
- rpm => 3600,
- interleave => 1,
- trackskew => 0,
- cylskew => 0,
- headswitch => 0,
- trkseek => 0,
- bbsize => 8192, #- size of boot area, with label
- sbsize => 8192, #- max size of fs superblock
+
+ #- take care of reduction of the number of cylinders, avoid loop of reduction!
+ unless ($hd->{geom}{totalcylinders} > $hd->{geom}{cylinders}) {
+ $hd->{geom}{totalcylinders} = $hd->{geom}{cylinders};
+ $hd->{geom}{cylinders} -= 2;
+
+ #- rebuild some constants according to number of cylinders.
+ $hd->{totalsectors} = $hd->{geom}{heads} * $hd->{geom}{sectors} * $hd->{geom}{cylinders};
+ }
+
+ #- build a default suitable partition table,
+ #- checksum will be built when writing on disk.
+ #- note third partition is ALWAYS of type Whole disk.
+ my $info = {
+ info => "DiskDrake partition table",
+ rspeed => 5400,
+ pcylcount => $hd->{geom}{totalcylinders},
+ sparecyl => 0,
+ ilfact => 1,
+ ncyl => $hd->{geom}{cylinders},
+ nacyl => $hd->{geom}{totalcylinders} - $hd->{geom}{cylinders},
+ ntrks => $hd->{geom}{heads},
+ nsect => $hd->{geom}{sectors},
+ magic => $magic,
};
+
+ $info;
}
sub clear_raw {
my ($hd) = @_;
- { raw => [ ({}) x $nb_primary ], info => info($hd) };
+ my $pt = { raw => [ ({}) x $nb_primary ], info => info($hd) };
+
+ #- handle special case for partition 2 which is whole disk.
+ $pt->{raw}[2] = {
+ type => 5, #- the whole disk type.
+ flags => 0,
+ start_cylinder => 0,
+ size => $hd->{geom}{cylinders} * $hd->cylinder_size(),
+ };
+
+ $pt;
}
1;
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 1f4764d22..e21e12ccd 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -1,211 +1,1365 @@
-package pkgs;
+package pkgs; # $Id$
use diagnostics;
use strict;
+use vars qw(*LOG %compssListDesc @skip_list %by_lang @preferred $limitMinTrans $PKGS_SELECTED $PKGS_FORCE $PKGS_INSTALLED $PKGS_BASE $PKGS_SKIP $PKGS_UPGRADE);
-use common qw(:common :file);
+use common qw(:common :file :functional);
+use install_any;
+use commands;
+use run_program;
use log;
-use smp;
+use pkgs;
use fs;
+use loopback;
+use lang;
+use c;
-my @skipList = qw(XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
- XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
- XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs kernel-boot
- metroess metrotmpl);
+#- lower bound on the left ( aka 90 means [90-100[ )
+%compssListDesc = (
+ 100 => __("mandatory"), #- do not use it, it's for base packages
+ 90 => __("must have"), #- every install have these packages (unless hand de-selected in expert, or not enough room)
+ 80 => __("important"), #- every beginner/custom install have these packages (unless not enough space)
+ #- has minimum X install (XFree86 + icewm)(normal)
+ 70 => __("very nice"), #- KDE(normal)
+ 60 => __("nice"), #- gnome(normal)
+ 50 => __("interesting"),
+ 40 => __("interesting"),
+ 30 => __("maybe"),
+ 20 => __("maybe"),
+ 10 => __("maybe"),#__("useless"),
+ 0 => __("maybe"),#__("garbage"),
+#- if the package requires locales-LANG and LANG is chosen, rating += 90
+#- if the package is in %by_lang and the corresponding LANG is chosen, rating += 90 (see %by_lang below)
+ -10 => __("i18n (important)"), #- every install in the corresponding lang have these packages
+ -20 => __("i18n (very nice)"), #- every beginner/custom install in the corresponding lang have theses packages
+ -30 => __("i18n (nice)"),
+);
+#- HACK: rating += 50 for some packages (like kapm, cf install_any::setPackages)
-1;
+%by_lang = (
+ 'ar' => [ 'acon' ],
+#'be_BE.CP1251' => [ 'fonts-ttf-cyrillic' ],
+#'bg_BG' => [ 'fonts-ttf-cyrillic' ],
+ 'cs' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+# 'cy' => iso8859-14 fonts
+# 'el' => greek fonts
+# 'eo' => iso8859-3 fonts
+ 'fa' => [ 'acon' ],
+ 'he' => [ 'acon' ],
+ 'hr' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+ 'hu' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+ 'hy' => [ 'fonts-ttf-armenian' ],
+ 'ja' => [ 'rxvt-CLE', 'fonts-ttf-japanese', 'kterm' ],
+# 'ka' => georgian fonts
+ 'ko' => [ 'rxvt-CLE', 'fonts-ttf-korean' ],
+ 'lt' => [ 'fonts-type1-baltic' ],
+ 'lv' => [ 'fonts-type1-baltic' ],
+ 'mi' => [ 'fonts-type1-baltic' ],
+# 'mk' => [ 'fonts-ttf-cyrillic' ],
+ 'pl' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+ 'ro' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+# 'ru' => [ 'XFree86-cyrillic-fonts', 'fonts-ttf-cyrillic' ],
+ 'ru' => [ 'XFree86-cyrillic-fonts' ],
+ 'ru_RU.KOI8-R' => [ 'XFree86-cyrillic-fonts' ],
+ 'sk' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+ 'sl' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+# 'sp' => [ 'fonts-ttf-cyrillic' ],
+ 'sr' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ],
+# 'th' => thai fonts
+ 'tr' => [ 'XFree86-ISO8859-9', 'XFree86-ISO8859-9-75dpi-fonts' ],
+#'uk_UA' => [ 'fonts-ttf-cyrillic' ],
+# 'vi' => vietnamese fonts
+ 'yi' => [ 'acon' ],
+ 'zh' => [ 'rxvt-CLE', 'taipeifonts', 'fonts-ttf-big5', 'fonts-ttf-gb2312' ],
+ 'zh_CN.GB2312' => [ 'rxvt-CLE', 'fonts-ttf-gb2312' ],
+ 'zh_TW.Big5' => [ 'rxvt-CLE', 'taipeifonts', 'fonts-ttf-big5' ],
+);
+@skip_list = qw(
+XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
+XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
+XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs
+MySQL MySQL_GPL mod_php3 midgard postfix metroess metrotmpl
+kernel-linus kernel-secure kernel-BOOT
+hackkernel hackkernel-BOOT hackkernel-headers
+hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb
+autoirpm autoirpm-icons numlock
+);
-sub psUsingDirectory {
- my ($dirname) = @_;
- my %packages;
+@preferred = qw(perl-GTK postfix wu-ftpd ghostscript-X vim-minimal kernel ispell-en);
- log::l("scanning $dirname for packages");
- foreach (glob_("$dirname/*.rpm")) {
- my $basename = basename($_);
- local *F;
- open F, $_ or log::l("failed to open package $_: $!");
- my $header = c::rpmReadPackageHeader($_) or log::l("failed to rpmReadPackageHeader $basename: $!");
- my $name = c::headerGetEntry($header, 'name');
-
- $packages{lc $name} = {
- header => $header, selected => 0, manuallySelected => 0, name => $name,
- size => c::headerGetEntry($header, 'size'),
- group => c::headerGetEntry($header, 'group') || "(unknown group)",
- inmenu => skipPackage($name),
- };
+#- constant for small transaction.
+$limitMinTrans = 8;
+
+#- constant for packing flags, see below.
+$PKGS_SELECTED = 0x00ffffff;
+$PKGS_FORCE = 0x01000000;
+$PKGS_INSTALLED = 0x02000000;
+$PKGS_BASE = 0x04000000;
+$PKGS_SKIP = 0x08000000;
+$PKGS_UPGRADE = 0x20000000;
+
+#- package to ignore, typically in Application CD.
+my %ignoreBadPkg = (
+ 'civctp-demo' => 1,
+ 'eus-demo' => 1,
+ 'myth2-demo' => 1,
+ 'heretic2-demo' => 1,
+ 'heroes3-demo' => 1,
+ 'rt2-demo' => 1,
+ );
+
+#- basic methods for extracting informations about packages.
+#- to save memory, (name, version, release) are no more stored, they
+#- are directly generated from (file).
+#- all flags are grouped together into (flags), these includes the
+#- following flags : selected, force, installed, base, skip.
+#- size and deps are grouped to save memory too and make a much
+#- simpler and faster depslist reader, this gets (sizeDeps).
+sub packageHeaderFile { my ($pkg) = @_; $pkg->{file} }
+sub packageName { my ($pkg) = @_; $pkg->{file} =~ /([^\(]*)(?:\([^\)]*\))?-[^-]+-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
+sub packageSpecificArch { my ($pkg) = @_; $pkg->{file} =~ /[^\(]*(?:\(([^\)]*)\))?-[^-]+-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
+sub packageVersion { my ($pkg) = @_; $pkg->{file} =~ /.*-([^-]+)-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
+sub packageRelease { my ($pkg) = @_; $pkg->{file} =~ /.*-[^-]+-([^-]+)/ ? $1 : die "invalid file `$pkg->{file}'" }
+
+sub packageSize { my ($pkg) = @_; to_int($pkg->{sizeDeps}) }
+sub packageDepsId { my ($pkg) = @_; split ' ', ($pkg->{sizeDeps} =~ /^\d*\s*(.*)/)[0] }
+
+sub packageFlagSelected { my ($pkg) = @_; $pkg->{flags} & $PKGS_SELECTED }
+sub packageFlagForce { my ($pkg) = @_; $pkg->{flags} & $PKGS_FORCE }
+sub packageFlagInstalled { my ($pkg) = @_; $pkg->{flags} & $PKGS_INSTALLED }
+sub packageFlagBase { my ($pkg) = @_; $pkg->{flags} & $PKGS_BASE }
+sub packageFlagSkip { my ($pkg) = @_; $pkg->{flags} & $PKGS_SKIP }
+sub packageFlagUpgrade { my ($pkg) = @_; $pkg->{flags} & $PKGS_UPGRADE }
+
+sub packageSetFlagSelected { my ($pkg, $v) = @_; $pkg->{flags} &= ~$PKGS_SELECTED; $pkg->{flags} |= $v & $PKGS_SELECTED; }
+
+sub packageSetFlagForce { my ($pkg, $v) = @_; $v ? ($pkg->{flags} |= $PKGS_FORCE) : ($pkg->{flags} &= ~$PKGS_FORCE); }
+sub packageSetFlagInstalled { my ($pkg, $v) = @_; $v ? ($pkg->{flags} |= $PKGS_INSTALLED) : ($pkg->{flags} &= ~$PKGS_INSTALLED); }
+sub packageSetFlagBase { my ($pkg, $v) = @_; $v ? ($pkg->{flags} |= $PKGS_BASE) : ($pkg->{flags} &= ~$PKGS_BASE); }
+sub packageSetFlagSkip { my ($pkg, $v) = @_; $v ? ($pkg->{flags} |= $PKGS_SKIP) : ($pkg->{flags} &= ~$PKGS_SKIP); }
+sub packageSetFlagUpgrade { my ($pkg, $v) = @_; $v ? ($pkg->{flags} |= $PKGS_UPGRADE) : ($pkg->{flags} &= ~$PKGS_UPGRADE); }
+
+sub packageProvides { my ($pkg) = @_; @{$pkg->{provides} || []} }
+
+sub packageFile {
+ my ($pkg) = @_;
+ $pkg->{header} or die "packageFile: missing header";
+ $pkg->{file} =~ /([^\(]*)(?:\([^\)]*\))?(-[^-]+-[^-]+)/;
+ "$1$2." . c::headerGetEntry($pkg->{header}, 'arch') . ".rpm";
+}
+
+sub packageSelectedOrInstalled { my ($pkg) = @_; packageFlagSelected($pkg) || packageFlagInstalled($pkg) }
+
+sub packageId {
+ my ($packages, $pkg) = @_;
+ my $i = 0;
+ foreach (@{$packages->[1]}) { return $i if $pkg == $packages->[1][$i]; $i++ }
+ return;
+}
+
+sub cleanHeaders {
+ my ($prefix) = @_;
+ commands::rm("-rf", "$prefix/tmp/headers") if -e "$prefix/tmp/headers";
+}
+
+#- get all headers from an hdlist file.
+sub extractHeaders($$$) {
+ my ($prefix, $pkgs, $medium) = @_;
+
+ cleanHeaders($prefix);
+
+ run_program::run("packdrake", "-x",
+ "/tmp/$medium->{hdlist}",
+ "$prefix/tmp/headers",
+ map { packageHeaderFile($_) } @$pkgs);
+
+ foreach (@$pkgs) {
+ my $f = "$prefix/tmp/headers/". packageHeaderFile($_);
+ local *H;
+ open H, $f or log::l("unable to open header file $f: $!"), next;
+ $_->{header} = c::headerRead(fileno H, 1) or log::l("unable to read header of package ". packageHeaderFile($_));
+ }
+ @$pkgs = grep { $_->{header} } @$pkgs;
+}
+
+#- size and correction size functions for packages.
+#- invCorrectSize corrects size in the range 0 to 3Gb approximately, so
+#- it should not be used outside these levels.
+#- but since it is an inverted parabolic curve starting above 0, we can
+#- get a solution where X=Y at approximately 9.3Gb. we use this point as
+#- a limit to change the approximation to use a linear one.
+#- for information above this point, we have the corrected size below the
+#- original size wich is absurd, this point is named D below.
+my $A = -121568/100000000000; # -1.21568e-05; #- because perl does like that on some language (TO BE FIXED QUICKLY)
+my $B = 121561/100000; # 1.21561
+my $C = -239889/10000; # -23.9889 #- doesn't take hdlist's into account as getAvailableSpace will do it.
+my $D = (-sqrt(sqr($B - 1) - 4 * $A * $C) - ($B - 1)) / 2 / $A; #- $A is negative so a positive solution is with - sqrt ...
+sub correctSize {
+ my $csz = ($A * $_[0] + $B) * $_[0] + $C;
+ $csz > $_[0] ? $csz : $_[0]; #- size correction (in MB) should be above input argument (as $A is negative).
+}
+sub invCorrectSize {
+ my $sz = $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0];
+ $sz < $_[0] ? $sz : $_[0];
+}
+
+sub selectedSize {
+ my ($packages) = @_;
+ my $size = 0;
+ foreach (values %{$packages->[0]}) {
+ packageFlagSelected($_) && !packageFlagInstalled($_) and $size += packageSize($_) - ($_->{installedCumulSize} || 0);
+ }
+ $size;
+}
+sub correctedSelectedSize { correctSize(selectedSize($_[0]) / sqr(1024)) }
+
+
+#- searching and grouping methods.
+#- package is a reference to list that contains
+#- a hash to search by name and
+#- a list to search by id.
+sub packageByName {
+ my ($packages, $name) = @_;
+ $packages->[0]{$name} or log::l("unknown package `$name'") && undef;
+}
+sub packageById {
+ my ($packages, $id) = @_;
+ $packages->[1][$id] or log::l("unknown package id $id") && undef;
+}
+sub allPackages {
+ my ($packages) = @_;
+ my %skip_list; @skip_list{@skip_list} = ();
+ grep { !exists $skip_list{packageName($_)} } values %{$packages->[0]};
+}
+sub packagesOfMedium {
+ my ($packages, $mediumName) = @_;
+ my $medium = $packages->[2]{$mediumName};
+ grep { $_->{medium} == $medium } @{$packages->[1]};
+}
+sub packagesToInstall {
+ my ($packages) = @_;
+ grep { $_->{medium}{selected} && packageFlagSelected($_) && !packageFlagInstalled($_) } values %{$packages->[0]};
+}
+
+sub allMediums {
+ my ($packages) = @_;
+ keys %{$packages->[2]};
+}
+sub mediumDescr {
+ my ($packages, $medium) = @_;
+ $packages->[2]{$medium}{descr};
+}
+
+#- selection, unselection of package.
+sub selectPackage { #($$;$$$)
+ my ($packages, $pkg, $base, $otherOnly, $check_recursion) = @_;
+
+ #- check if the same or better version is installed,
+ #- do not select in such case.
+ packageFlagInstalled($pkg) and return;
+
+ #- check for medium selection, if the medium has not been
+ #- selected, the package cannot be selected.
+ $pkg->{medium}{selected} or return;
+
+ #- avoid infinite recursion (mainly against badly generated depslist.ordered).
+ $check_recursion ||= {}; exists $check_recursion->{$pkg->{file}} and return; $check_recursion->{$pkg->{file}} = undef;
+
+ #- make sure base package are set even if already selected.
+ $base and packageSetFlagBase($pkg, 1);
+
+ #- select package and dependancies, otherOnly may be a reference
+ #- to a hash to indicate package that will strictly be selected
+ #- when value is true, may be selected when value is false (this
+ #- is only used for unselection, not selection)
+ unless (packageFlagSelected($pkg)) {
+ foreach (packageDepsId($pkg)) {
+ my $preferred;
+ if (/\|/) {
+ #- choice deps should be reselected recursively as no
+ #- closure on them is computed, this code is exactly the
+ #- same as pixel's one.
+ my %preferred; @preferred{@preferred} = ();
+ foreach (split '\|') {
+ my $dep = packageById($packages, $_) or next;
+ $preferred ||= $dep;
+ packageFlagSelected($dep) and $preferred = $dep, last;
+ exists $preferred{packageName($dep)} and $preferred = $dep;
+ }
+ selectPackage($packages, $preferred, $base, $otherOnly, $check_recursion) if $preferred;
+ } else {
+ #- deps have been closed except for choices, so no need to
+ #- recursively apply selection, expand base on it.
+ my $dep = packageById($packages, $_);
+ $base and packageSetFlagBase($dep, 1);
+ $otherOnly and !packageFlagSelected($dep) and $otherOnly->{packageName($dep)} = 1;
+ $otherOnly or packageSetFlagSelected($dep, 1+packageFlagSelected($dep));
+ }
+ }
+ }
+ $otherOnly and !packageFlagSelected($pkg) and $otherOnly->{packageName($pkg)} = 1;
+ $otherOnly or packageSetFlagSelected($pkg, 1+packageFlagSelected($pkg));
+ 1;
+}
+sub unselectPackage($$;$) {
+ my ($packages, $pkg, $otherOnly) = @_;
+
+ #- base package are not unselectable,
+ #- and already unselected package are no more unselectable.
+ packageFlagBase($pkg) and return;
+ packageFlagSelected($pkg) or return;
+
+ #- dependancies may be used to propose package that may be not
+ #- usefull for the user, since their counter is just one and
+ #- they are not used any more by other packages.
+ #- provides are closed and are taken into account to get possible
+ #- unselection of package (value false on otherOnly) or strict
+ #- unselection (value true on otherOnly).
+ foreach my $provided ($pkg, packageProvides($pkg)) {
+ packageFlagBase($provided) and die "a provided package cannot be a base package";
+ if (packageFlagSelected($provided)) {
+ my $unselect_alone = 0;
+ foreach (packageDepsId($provided)) {
+ if (/\|/) {
+ #- this package use a choice of other package, so we have to check
+ #- if our package is not included in the choice, if this is the
+ #- case, if must be checked one of the other package are selected.
+ foreach (split '\|') {
+ my $dep = packageById($packages, $_);
+ $dep == $pkg and $unselect_alone |= 1;
+ packageFlagBase($dep) || packageFlagSelected($dep) and $unselect_alone |= 2;
+ }
+ }
+ }
+ #- provided will not be unselect here if the two conditions are met.
+ $unselect_alone == 3 and next;
+ #- on the other hand, provided package have to be unselected.
+ $otherOnly or packageSetFlagSelected($provided, 0);
+ $otherOnly and $otherOnly->{packageName($provided)} = 1;
+ }
+ foreach (map { split '\|' } packageDepsId($provided)) {
+ my $dep = packageById($packages, $_);
+ packageFlagBase($dep) and next;
+ packageFlagSelected($dep) or next;
+ for (packageFlagSelected($dep)) {
+ $_ == 1 and do { $otherOnly and $otherOnly->{packageName($dep)} ||= 0; };
+ $_ > 1 and do { $otherOnly or packageSetFlagSelected($dep, $_-1); };
+ last;
+ }
+ }
+ }
+ 1;
+}
+sub togglePackageSelection($$;$) {
+ my ($packages, $pkg, $otherOnly) = @_;
+ packageFlagSelected($pkg) ? unselectPackage($packages, $pkg, $otherOnly) : selectPackage($packages, $pkg, 0, $otherOnly);
+}
+sub setPackageSelection($$$) {
+ my ($packages, $pkg, $value) = @_;
+ $value ? selectPackage($packages, $pkg) : unselectPackage($packages, $pkg);
+}
+
+sub unselectAllPackages($) {
+ my ($packages) = @_;
+ foreach (values %{$packages->[0]}) {
+ unless (packageFlagBase($_) || packageFlagUpgrade($_)) {
+ packageSetFlagSelected($_, 0);
+ }
+ }
+}
+sub unselectAllPackagesIncludingUpgradable($) {
+ my ($packages, $removeUpgradeFlag) = @_;
+ foreach (values %{$packages->[0]}) {
+ unless (packageFlagBase($_)) {
+ packageSetFlagSelected($_, 0);
+ packageSetFlagUpgrade($_, 0);
+ }
}
- \%packages;
}
-sub psReadComponentsFile {
- my ($compsfile, $packages) = @_;
- my (%comps, %current);
+sub skipSetWithProvides {
+ my ($packages, @l) = @_;
+ packageSetFlagSkip($_, 1) foreach grep { $_ } map { $_, packageProvides($_) } @l;
+}
+
+sub psUpdateHdlistsDeps {
+ my ($prefix, $method) = @_;
+ my $listf = install_any::getFile('Mandrake/base/hdlists') or die "no hdlists found";
+
+ #- WARNING: this function should be kept in sync with functions
+ #- psUsingHdlists and psUsingHdlist.
+ #- it purpose it to update hdlist files on system to install.
+
+ #- parse hdlist.list file.
+ my $medium = 1;
+ local $_;
+ while (<$listf>) {
+ chomp;
+ s/\s*#.*$//;
+ /^\s*$/ and next;
+ m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
+ my ($hdlist, $rpmsdir, $descr) = ($1, $2, $3);
+
+ #- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used
+ #- for getting header of package during installation or after by urpmi.
+ my $fakemedium = $method . $medium;
+ my $newf = "$prefix/var/lib/urpmi/hdlist.$fakemedium.cz" . ($hdlist =~ /\.cz2/ && "2");
+ -e $newf and do { unlink $newf or die "cannot remove $newf: $!"; };
+ install_any::getAndSaveFile("Mandrake/base/$hdlist", $newf) or die "no $hdlist found";
+ symlinkf $newf, "/tmp/$hdlist";
+ ++$medium;
+ }
- local *F;
- open F, $compsfile or die "Cannot open components file: $!";
+ #- this is necessary for urpmi.
+ install_any::getAndSaveFile('Mandrake/base/depslist.ordered', "$prefix/var/lib/urpmi/depslist.ordered");
+ install_any::getAndSaveFile('Mandrake/base/provides', "$prefix/var/lib/urpmi/provides");
+ install_any::getAndSaveFile('Mandrake/base/compss', "$prefix/var/lib/urpmi/compss");
+}
- <F> =~ /^0(\.1)?$/ or die "Comps file is not version 0.1 as expected";
+sub psUsingHdlists {
+ my ($prefix, $method) = @_;
+ my $listf = install_any::getFile('Mandrake/base/hdlists') or die "no hdlists found";
+ my @packages = ({}, [], {});
+ my @hdlists;
- my $inComp = 0;
- my $n = 0;
- foreach (<F>) { $n++;
+ #- parse hdlist.list file.
+ my $medium = 1;
+ local $_;
+ while (<$listf>) {
chomp;
- s/^ +//;
- /^#/ and next;
- /^$/ and next;
+ s/\s*#.*$//;
+ /^\s*$/ and next;
+ m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
+ push @hdlists, [ $1, $medium, $2, $3 ];
+ ++$medium;
+ }
+
+ foreach (@hdlists) {
+ my ($hdlist, $medium, $rpmsdir, $descr) = @$_;
+
+ #- make sure the first medium is always selected!
+ #- by default select all image.
+ psUsingHdlist($prefix, $method, \@packages, $hdlist, $medium, $rpmsdir, $descr, 1);
+
+ }
+
+ log::l("psUsingHdlists read " . scalar keys(%{$packages[0]}) . " headers on " . scalar keys(%{$packages[2]}) . " hdlists");
- if ($inComp) { if (/^end$/) {
- $inComp = 0;
- $comps{lc $current{name}} = { %current };
+ \@packages;
+}
+
+sub psUsingHdlist {
+ my ($prefix, $method, $packages, $hdlist, $medium, $rpmsdir, $descr, $selected, $fhdlist) = @_;
+
+ #- if the medium already exist, use it.
+ $packages->[2]{$medium} and return;
+
+ my $fakemedium = $method . $medium;
+ my $m = $packages->[2]{$medium} = { hdlist => $hdlist,
+ medium => $medium,
+ rpmsdir => $rpmsdir, #- where is RPMS directory.
+ descr => $descr,
+ fakemedium => $fakemedium,
+ min => scalar keys %{$packages->[0]},
+ max => -1, #- will be updated after reading current hdlist.
+ selected => $selected, #- default value is only CD1, it is really the minimal.
+ };
+
+ #- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used
+ #- for getting header of package during installation or after by urpmi.
+ my $newf = "$prefix/var/lib/urpmi/hdlist.$fakemedium.cz" . ($hdlist =~ /\.cz2/ && "2");
+ -e $newf and do { unlink $newf or die "cannot remove $newf: $!"; };
+ install_any::getAndSaveFile($fhdlist || "Mandrake/base/$hdlist", $newf) or die "no $hdlist found";
+ symlinkf $newf, "/tmp/$hdlist";
+
+ #- extract filename from archive, this take advantage of verifying
+ #- the archive too.
+ local *F; open F, "packdrake $newf |";
+ local $_;
+ while (<F>) {
+ chomp;
+ /^[dlf]\s+/ or next;
+ if (/^f\s+\d+\s+(.*)/) {
+ my $pkg = { file => $1, #- rebuild filename according to header one
+ flags => 0, #- flags
+ medium => $m,
+ };
+ my $specific_arch = packageSpecificArch($pkg);
+ if (!$specific_arch || compat_arch($specific_arch)) {
+ my $old_pkg = $packages->[0]{packageName($pkg)};
+ if ($old_pkg) {
+ if (packageVersion($pkg) eq packageVersion($old_pkg) && packageRelease($pkg) eq packageRelease($old_pkg)) {
+ if (better_arch($specific_arch, packageSpecificArch($old_pkg))) {
+ log::l("replacing old package with package $1 with better arch: $specific_arch");
+ $packages->[0]{packageName($pkg)} = $pkg;
+ } else {
+ log::l("keeping old package against package $1 with worse arch");
+ }
+ } else {
+ log::l("ignoring package $1 already present in distribution with different version or release");
+ }
+ } else {
+ $packages->[0]{packageName($pkg)} = $pkg;
+ }
} else {
- push @{$current{packages}}, $packages->{lc $_} || log::w "package $_ does not exist (line $n of comps file)";
+ log::l("ignoring package $1 with incompatible arch: $specific_arch");
}
} else {
- my ($selected, $hidden, $name) = /^([01])\s*(--hide)?\s*(.*)/ or die "bad comps file at line $n";
- %current = (selected => $selected, inmenu => !$hidden, name => $name);
- $inComp = 1;
+ die "bad hdlist file: $newf";
}
}
- log::l("read " . (scalar keys %comps) . " comps");
- \%comps;
+ close F or die "unable to parse $newf";
+
+ #- update maximal index.
+ $m->{max} = scalar(keys %{$packages->[0]}) - 1;
+ $m->{max} >= $m->{min} or die "nothing found while parsing $newf";
+ log::l("read " . ($m->{max} - $m->{min} + 1) . " headers in $hdlist");
+ 1;
}
+sub getOtherDeps($$) {
+ my ($packages, $f) = @_;
+ #- this version of getDeps is customized for handling errors more easily and
+ #- convert reference by name to deps id including closure computation.
+ local $_;
+ while (<$f>) {
+ my ($name, $version, $release, $size, $deps) = /^(\S*)-([^-\s]+)-([^-\s]+)\s+(\d+)\s+(.*)/;
+ my $pkg = $packages->[0]{$name};
-sub psVerifyDependencies {
-# my ($packages, $fixup) = @_;
-#
-# -r "/mnt/var/lib/rpm/packages.rpm" or die "can't find packages.rpm";
-#
-# my $db = rpmdbOpenRWCreate("/mnt");
-# my $rpmdeps = rpmtransCreateSet($db, undef);
-#
-# foreach (values %$packages) {
-# $_->{selected} ?
-# c::rpmtransAddPackage($rpmdeps, $_->{header}, undef, $_, 0, undef) :
-# c::rpmtransAvailablePackage($rpmdeps, $_->{header}, $_);
-# }
-# my @conflicts = c::rpmdepCheck($rpmdeps);
-#
-# rpmtransFree($rpmdeps);
-# rpmdbClose($db);
-#
-# if ($fixup) {
-# foreach (@conflicts) {
-# $_->{suggestedPackage}->{selected} = 1;
-# }
-# rpmdepFreeConflicts(@conflicts);
-# }
-#
-# 1;
+ $pkg or log::l("ignoring package $name-$version-$release in depslist is not in hdlist"), next;
+ $version eq packageVersion($pkg) and $release eq packageRelease($pkg)
+ or log::l("warning package $name-$version-$release in depslist mismatch version or release in hdlist ($version ne ",
+ packageVersion($pkg), " or $release ne ", packageRelease($pkg), ")"), next;
+
+ my $index = scalar @{$packages->[1]};
+ $index >= $pkg->{medium}{min} && $index <= $pkg->{medium}{max}
+ or log::l("ignoring package $name-$version-$release in depslist outside of hdlist indexation");
+
+ #- here we have to translate referenced deps by name to id.
+ #- this include a closure on deps too.
+ my %closuredeps;
+ @closuredeps{map { packageId($packages, $_), packageDepsId($_) }
+ grep { $_ }
+ map { packageByName($packages, $_) or do { log::l("unknown package $_ in depslist for closure"); undef } }
+ split /\s+/, $deps} = ();
+
+ $pkg->{sizeDeps} = join " ", $size, keys %closuredeps;
+
+ push @{$packages->[1]}, $pkg;
+ }
+
+ #- check for same number of package in depslist and hdlists, avoid being to hard.
+ scalar(keys %{$packages->[0]}) == scalar(@{$packages->[1]})
+ or log::l("other depslist has not same package as hdlist file");
}
-sub selectComponents {
- my ($csp, $psp, $doIndividual) = @_;
+sub getDeps($) {
+ my ($prefix, $packages) = @_;
+
+ #- this is necessary for urpmi.
+ install_any::getAndSaveFile('Mandrake/base/depslist.ordered', "$prefix/var/lib/urpmi/depslist.ordered");
+ install_any::getAndSaveFile('Mandrake/base/provides', "$prefix/var/lib/urpmi/provides");
+
+ #- beware of heavily mismatching depslist.ordered file against hdlist files.
+ my $mismatch = 0;
- return 0;
+ #- update dependencies list, provides attributes are updated later
+ #- cross reference to be resolved on id (think of loop requires)
+ #- provides should be updated after base flag has been set to save
+ #- memory.
+ local *F; open F, "$prefix/var/lib/urpmi/depslist.ordered" or die "can't find dependancies list";
+ local $_;
+ while (<F>) {
+ my ($name, $version, $release, $sizeDeps) = /^(\S*)-([^-\s]+)-([^-\s]+)\s+(.*)/;
+ my $pkg = $packages->[0]{$name};
+
+ $pkg or
+ log::l("ignoring $name-$version-$release in depslist is not in hdlist"), $mismatch = 1, next;
+ $version eq packageVersion($pkg) and $release eq packageRelease($pkg) or
+ log::l("ignoring $name-$version-$release in depslist mismatch version or release in hdlist ($version ne ", packageVersion($pkg), " or $release ne ", packageRelease($pkg), ")"), $mismatch = 1, next;
+
+ $pkg->{sizeDeps} = $sizeDeps;
+
+ #- check position of package in depslist according to precomputed
+ #- limit by hdlist, very strict :-)
+ #- above warning have chance to raise an exception here, but may help
+ #- for debugging.
+ my $i = scalar @{$packages->[1]};
+ $i >= $pkg->{medium}{min} && $i <= $pkg->{medium}{max} or $mismatch = 1;
+
+ #- package are already sorted in depslist to enable small transaction and multiple medium.
+ push @{$packages->[1]}, $pkg;
+ }
+
+ #- check for mismatching package, it should breaj with above die unless depslist has too many errors!
+ $mismatch and die "depslist.ordered mismatch against hdlist files";
+
+ #- check for same number of package in depslist and hdlists.
+ scalar(keys %{$packages->[0]}) == scalar(@{$packages->[1]}) or die "depslist.ordered has not same package as hdlist files";
}
-sub psFromHeaderListDesc {
- my ($fd, $noSeek) = @_;
- my %packages;
- my $end;
+sub getProvides($) {
+ my ($packages) = @_;
- unless ($noSeek) {
- my $current = sysseek $fd, 0, 1 or die "seek failed";
- $end = sysseek $fd, 0, 2 or die "seek failed";
- sysseek $fd, $current, 0 or die "seek failed";
+ #- update provides according to dependencies, here are stored
+ #- reference to package directly and choice are included, this
+ #- assume only 1 of the choice is selected, else on unselection
+ #- the provided package will be deleted where other package still
+ #- need it.
+ #- base package are not updated because they cannot be unselected,
+ #- this save certainly a lot of memory since most of them may be
+ #- needed by a large number of package.
+
+ foreach my $pkg (@{$packages->[1]}) {
+ packageFlagBase($pkg) and next;
+ map { my $provided = $packages->[1][$_] or die "invalid package index $_";
+ packageFlagBase($provided) or push @{$provided->{provides} ||= []}, $pkg;
+ } map { split '\|' } grep { !/^NOTFOUND_/ } packageDepsId($pkg);
}
+}
+
+sub readCompss {
+ my ($prefix, $packages) = @_;
+ my ($p, @compss);
+
+ #- this is necessary for urpmi.
+ install_any::getAndSaveFile('Mandrake/base/compss', "$prefix/var/lib/urpmi/compss");
- while (1) {
- my $header = c::headerRead(fileno($fd), 1);
- unless ($header) {
- $noSeek and last;
- die "error reading header at offset ", sysseek($fd, 0, 1);
+ local *F; open F, "$prefix/var/lib/urpmi/compss" or die "can't find compss";
+ local $_;
+ while (<F>) {
+ /^\s*$/ || /^#/ and next;
+ s/#.*//;
+
+ if (/^(\S.*)/) {
+ $p = $1;
+ } else {
+ /(\S+)/;
+ $packages->[0]{$1} or log::l("unknown package $1 in compss"), next;
+ push @compss, "$p/$1";
}
-
- my $name = c::headerGetEntry($header, 'name');
+ }
+ \@compss;
+}
- $packages{lc $name} = {
- header => $header, size => c::headerGetEntry($header, 'size'),
- inmenu => skipPackage($name), name => $name,
- group => c::headerGetEntry($header, 'group') || "(unknown group)",
- };
+sub readCompssList {
+ my ($packages, $langs) = @_;
+ my $f = install_any::getFile('Mandrake/base/compssList') or die "can't find compssList";
+ my @levels = split ' ', <$f>;
- $noSeek or $end <= sysseek($fd, 0, 1) and last;
+ local $_;
+ while (<$f>) {
+ /^\s*$/ || /^#/ and next;
+ my ($name, @values) = split;
+ my $p = packageByName($packages, $name) or log::l("unknown entry $name (in compssList)"), next;
+ $p->{values} = \@values;
}
- log::l("psFromHeaderListDesc read " . scalar keys(%packages) . " headers");
-
- \%packages;
+ my %done;
+ foreach (@$langs) {
+ my $p = packageByName($packages, "locales-$_") or next;
+ foreach ($p, @{$p->{provides} || []}, map { packageByName($packages, $_) } @{$by_lang{$_} || []}) {
+ next if !$_ || $done{$_}; $done{$_} = 1;
+ $_->{values} = [ map { $_ + 90 } @{$_->{values} || [ (0) x @levels ]} ];
+ }
+ }
+ my $l = { map_index { $_ => $::i } @levels };
}
-sub psFromHeaderListFile {
- my ($file) = @_;
- local *F;
- sysopen F, $file, 0 or die "error opening header file: $!";
- psFromHeaderListDesc(\*F, 0);
+sub readCompssUsers {
+ my ($packages, $compss, $meta_class) = @_;
+ my (%compssUsers, %compssUsersIcons, , %compssUsersDescr, @sorted, $l);
+ my (%compss);
+ foreach (@$compss) {
+ local ($_, $a) = m|(.*)/(.*)|;
+ do { push @{$compss{$_}}, $a } while s|/[^/]+||;
+ }
+
+ my $map = sub {
+ $l or return;
+ $_ = $packages->[0]{$_} or log::l("unknown package $_ (in compssUsers)") foreach @$l;
+ };
+ my $file = 'Mandrake/base/compssUsers';
+ my $f = $meta_class && install_any::getFile("$file.$meta_class") || install_any::getFile($file) or die "can't find $file";
+ local $_;
+ while (<$f>) {
+ /^\s*$/ || /^#/ and next;
+ s/#.*//;
+
+ if (/^(\S.*)/) {
+ &$map;
+ my ($icon, $descr);
+ /^(.*?)\s*\[icon=(.*?)\](.*)/ and $_ = "$1$3", $icon = $2;
+ /^(.*?)\s*\[descr=(.*?)\](.*)/ and $_ = "$1$3", $descr = $2;
+ $compssUsersIcons{$_} = $icon;
+ $compssUsersDescr{$_} = $descr;
+ push @sorted, $_;
+ $compssUsers{$_} = $l = [];
+ } elsif (/\s+\+(\S+)/) {
+ push @$l, $1;
+ } elsif (/^\s+(.*?)\s*$/) {
+ push @$l, @{$compss{$1} || log::l("unknown category $1 (in compssUsers)") && []};
+ }
+ }
+ &$map;
+ \%compssUsers, \@sorted, \%compssUsersIcons, \%compssUsersDescr;
}
-sub skipPackage { member($_[0], @skipList) }
+sub setSelectedFromCompssList {
+ my ($compssListLevels, $packages, $min_level, $max_size, $install_class) = @_;
+ my $ind = $compssListLevels->{$install_class}; defined $ind or log::l("unknown install class $install_class in compssList"), return;
+ my $nb = selectedSize($packages);
+ my @packages = allPackages($packages);
+ my @places = do {
+ #- special case for /^k/ aka kde stuff
+ my @values = map { $_->{values}[$ind] } @packages;
+ sort { $values[$b] <=> $values[$a] } 0 .. $#packages;
+ };
+ foreach (@places) {
+ my $p = $packages[$_];
+ next if packageFlagSkip($p);
+ last if $p->{values}[$ind] < $min_level;
-sub printSize { }
-sub printGroup { }
-sub printPkg { }
-sub selectPackagesByGroup { }
-sub showPackageInfo { }
-sub queryIndividual { }
+ #- determine the packages that will be selected when
+ #- selecting $p. the packages are not selected.
+ my %newSelection;
+ selectPackage($packages, $p, 0, \%newSelection);
+ #- this enable an incremental total size.
+ my $old_nb = $nb;
+ foreach (grep { $newSelection{$_} } keys %newSelection) {
+ $nb += packageSize($packages->[0]{$_});
+ }
+ if ($max_size && $nb > $max_size) {
+ $nb = $old_nb;
+ $min_level = $p->{values}[$ind];
+ last;
+ }
+
+ #- at this point the package can safely be selected.
+ selectPackage($packages, $p);
+ }
+ log::l("setSelectedFromCompssList: reached size $nb, up to indice $min_level (less than $max_size)");
+ $ind, $min_level;
+}
-sub install {
- my ($rootPath, $method, $packages, $isUpgrade, $force) = @_;
+#- usefull to know the size it would take for a given min_level/max_size
+#- just saves the selected packages, call setSelectedFromCompssList and restores the selected packages
+sub saveSelected {
+ my ($packages) = @_;
+ my @l = values %{$packages->[0]};
+ my @flags = map { pkgs::packageFlagSelected($_) } @l;
+ [ $packages, \@l, \@flags ];
+}
+sub restoreSelected {
+ my ($packages, $l, $flags) = @{$_[0]};
+ mapn { pkgs::packageSetFlagSelected(@_) } $l, $flags;
+}
- my $f = "$rootPath/tmp/" . ($isUpgrade ? "upgrade" : "install") . ".log";
- local *F;
- open(F, "> $f") ? log::l("opened $f") : log::l("Failed to open $f. No upgrade log will be kept.");
- my $fd = fileno(F) || log::fd() || 2;
- c::rpmErrorSetCallback($fd);
-# c::rpmSetVeryVerbose();
-
- # FIXME: we ought to read /mnt/us/lib/rpmrc if we're in the midst of an upgrade, but it's not obvious how to get RPM to do that.
- # if we set netshared path to "" then we get no files installed
- # addMacro(&globalMacroContext, "_netsharedpath", NULL, netSharedPath ? netSharedPath : "" , RMIL_RPMRC);
-
- $isUpgrade ? c::rpmdbRebuild($rootPath) : c::rpmdbInit($rootPath, 0644) or die "creation/rebuilding of rpm database failed: ", c::rpmErrorString();
- my $db = c::rpmdbOpen($rootPath) or die "error opening RPM database: ", c::rpmErrorString();
- log::l("opened rpm database");
+sub init_db {
+ my ($prefix, $isUpgrade) = @_;
- my $trans = c::rpmtransCreateSet($db, $rootPath);
+ my $f = "$prefix/root/install.log";
+ open(LOG, "> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept.");
+ *LOG or *LOG = log::F() or *LOG = *STDERR;
+ CORE::select((CORE::select(LOG), $| = 1)[0]);
+ c::rpmErrorSetCallback(fileno LOG);
+#- c::rpmSetVeryVerbose();
- my ($total, $nb);
+ log::l("reading /usr/lib/rpm/rpmrc");
+ c::rpmReadConfigFiles() or die "can't read rpm config files";
+ log::l("\tdone");
- foreach my $p ($packages->{basesystem},
- grep { $_->{selected} && $_->{name} ne "basesystem" } values %$packages) {
- my $fullname = sprintf "%s-%s-%s.%s.rpm",
- $p->{name},
- map { c::headerGetEntry($p->{header}, $_) } qw(version release arch);
- c::rpmtransAddPackage($trans, $p->{header}, $method->getFile($fullname) , $isUpgrade);
+ if ($isUpgrade) {
+ c::rpmdbRebuild($prefix) or die "rebuilding of rpm database failed: ", c::rpmErrorString();
+ }
+ #- seems no more necessary to rpmdbInit ?
+ #c::rpmdbOpen($prefix) or die "creation of rpm database failed: ", c::rpmErrorString();
+}
+
+sub done_db {
+ log::l("closing install.log file");
+ close LOG;
+}
+
+sub versionCompare($$) {
+ my ($a, $b) = @_;
+ local $_;
+
+ while ($a || $b) {
+ my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D+)// } ($b, $a);
+ $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_;
+ }
+}
+
+sub selectPackagesAlreadyInstalled {
+ my ($packages, $prefix) = @_;
+
+ log::l("reading /usr/lib/rpm/rpmrc");
+ c::rpmReadConfigFiles() or die "can't read rpm config files";
+ log::l("\tdone");
+
+ my $db = c::rpmdbOpenForTraversal($prefix) or die "unable to open $prefix/var/lib/rpm/packages.rpm";
+ log::l("opened rpm database for examining existing packages");
+
+ #- this method has only one objectif, check the presence of packages
+ #- already installed and avoid installing them again. this is to be used
+ #- with oem installation, if the database exists, preselect the packages
+ #- installed WHATEVER their version/release (log if a problem is perceived
+ #- is enough).
+ c::rpmdbTraverse($db, sub {
+ my ($header) = @_;
+ my $p = $packages->[0]{c::headerGetEntry($header, 'name')};
+
+ if ($p) {
+ my $version_cmp = versionCompare(c::headerGetEntry($header, 'version'), packageVersion($p));
+ my $version_rel_test = $version_cmp > 0 || $version_cmp == 0 &&
+ versionCompare(c::headerGetEntry($header, 'release'), packageRelease($p)) >= 0;
+ $version_rel_test or log::l("keeping an older package, avoiding selecting $p->{file}");
+ packageSetFlagInstalled($p, 1);
+ }
+ });
+
+ log::l("before closing db");
+ #- close db, job finished !
+ c::rpmdbClose($db);
+ log::l("done selecting packages to upgrade");
+
+}
+
+sub selectPackagesToUpgrade($$$;$$) {
+ my ($packages, $prefix, $base, $toRemove, $toSave) = @_;
+
+ log::l("reading /usr/lib/rpm/rpmrc");
+ c::rpmReadConfigFiles() or die "can't read rpm config files";
+ log::l("\tdone");
+
+ my $db = c::rpmdbOpenForTraversal($prefix) or die "unable to open $prefix/var/lib/rpm/packages.rpm";
+ log::l("opened rpm database for examining existing packages");
+
+ local $_; #- else perl complains on the map { ... } grep { ... } @...;
+
+ #- used for package that are not correctly updated.
+ #- should only be used when nothing else can be done correctly.
+ my %upgradeNeedRemove = (
+ 'libstdc++' => 1,
+ 'compat-glibc' => 1,
+ 'compat-libs' => 1,
+ );
+
+ #- these package are not named as ours, need to be translated before working.
+ #- a version may follow to setup a constraint 'installed version greater than'.
+ my %otherPackageToRename = (
+ 'qt' => [ 'qt2', '2.0' ],
+ 'qt1x' => [ 'qt' ],
+ );
+ #- generel purpose for forcing upgrade of package whatever version is.
+ my %packageNeedUpgrade = (
+ 'lilo' => 1, #- this package has been misnamed in 7.0.
+ );
+
+ #- help removing package which may have different release numbering
+ my %toRemove; map { $toRemove{$_} = 1 } @{$toRemove || []};
+
+ #- help searching package to upgrade in regard to already installed files.
+ my %installedFilesForUpgrade;
+
+ #- make a subprocess here for reading filelist, this is important
+ #- not to waste a lot of memory for the main program which will fork
+ #- latter for each transaction.
+ local (*INPUT, *OUTPUT_CHILD); pipe INPUT, OUTPUT_CHILD;
+ local (*INPUT_CHILD, *OUTPUT); pipe INPUT_CHILD, OUTPUT;
+ if (my $pid = fork()) {
+ close INPUT_CHILD;
+ close OUTPUT_CHILD;
+ select((select(OUTPUT), $| = 1)[0]);
+
+ #- internal reading from the child.
+ my $ask_child = sub {
+ my @list;
+ print OUTPUT $_[0], "\n";
+
+ local $_;
+ while (<INPUT>) {
+ chomp;
+ /^\s*$/ and last;
+ push @list, $_;
+ }
+
+ \@list;
+ };
+
+ #- mark all files which are not in /etc/rc.d/ for packages which are already installed but which
+ #- are not in the packages list to upgrade.
+ #- the 'installed' property will make a package unable to be selected, look at select.
+ c::rpmdbTraverse($db, sub {
+ my ($header) = @_;
+ my $otherPackage = (c::headerGetEntry($header, 'release') !~ /mdk\w*$/ &&
+ (c::headerGetEntry($header, 'name'). '-' .
+ c::headerGetEntry($header, 'version'). '-' .
+ c::headerGetEntry($header, 'release')));
+ my $renaming = $otherPackage && $otherPackageToRename{c::headerGetEntry($header, 'name')};
+ my $name = $renaming &&
+ (!$renaming->[1] || versionCompare(c::headerGetEntry($header, 'version'), $renaming->[1]) >= 0) &&
+ $renaming->[0];
+ $name and $packageNeedUpgrade{$name} = 1; #- keep in mind to force upgrading this package.
+ my $p = $packages->[0]{$name || c::headerGetEntry($header, 'name')};
+
+ if ($p) {
+ my $version_cmp = versionCompare(c::headerGetEntry($header, 'version'), packageVersion($p));
+ my $version_rel_test = $version_cmp > 0 || $version_cmp == 0 &&
+ versionCompare(c::headerGetEntry($header, 'release'), packageRelease($p)) >= 0;
+ if ($version_rel_test) { #- by default, package selecting are upgrade whatever version is !
+ if ($otherPackage && $version_cmp <= 0) {
+ log::l("force upgrading $otherPackage since it will not be updated otherwise");
+ } else {
+ packageSetFlagInstalled($p, 1);
+ }
+ } elsif ($upgradeNeedRemove{packageName($p)}) {
+ my $otherPackage = (c::headerGetEntry($header, 'name'). '-' .
+ c::headerGetEntry($header, 'version'). '-' .
+ c::headerGetEntry($header, 'release'));
+ log::l("removing $otherPackage since it will not upgrade correctly!");
+ $toRemove{$otherPackage} = 1; #- force removing for theses other packages, select our.
+ }
+ } else {
+ my @files = c::headerGetEntry($header, 'filenames');
+ @installedFilesForUpgrade{grep { ($_ !~ m|^/etc/rc.d/| &&
+ ! -d "$prefix/$_" && ! -l "$prefix/$_") } @files} = ();
+ }
+ });
+
+ #- find new packages to upgrade.
+ foreach (values %{$packages->[0]}) {
+ my $p = $_;
+ my $skipThis = 0;
+ my $count = c::rpmdbNameTraverse($db, packageName($p), sub {
+ my ($header) = @_;
+ $skipThis ||= packageFlagInstalled($p);
+ });
+
+ #- skip if not installed (package not found in current install).
+ $skipThis ||= ($count == 0);
+
+ #- make sure to upgrade package that have to be upgraded.
+ $packageNeedUpgrade{packageName($p)} and $skipThis = 0;
+
+ #- select the package if it is already installed with a lower version or simply not installed.
+ unless ($skipThis) {
+ my $cumulSize;
+
+ selectPackage($packages, $p);
+
+ #- keep in mind installed files which are not being updated. doing this costs in
+ #- execution time but use less memory, else hash all installed files and unhash
+ #- all file for package marked for upgrade.
+ c::rpmdbNameTraverse($db, packageName($p), sub {
+ my ($header) = @_;
+ $cumulSize += c::headerGetEntry($header, 'size'); #- all these will be deleted on upgrade.
+ my @files = c::headerGetEntry($header, 'filenames');
+ @installedFilesForUpgrade{grep { ($_ !~ m|^/etc/rc.d/| &&
+ ! -d "$prefix/$_" && ! -l "$prefix/$_") } @files} = ();
+ });
+
+ my $list = $ask_child->(packageName($p));
+ my @commonparts = map { /^=(.*)/ ? ($1) : () } @$list;
+ map { delete $installedFilesForUpgrade{$_} } grep { $_ !~ m|^/etc/rc.d/| }
+ map { /^(\d)(.*)/ ? ($commonparts[$1] . $2) : /^ (.*)/ ? ($1) : () } @$list;
+
+ #- keep in mind the cumul size of installed package since they will be deleted
+ #- on upgrade.
+ $p->{installedCumulSize} = $cumulSize;
+ }
+ }
+
+ #- unmark all files for all packages marked for upgrade. it may not have been done above
+ #- since some packages may have been selected by depsList.
+ foreach (values %{$packages->[0]}) {
+ my $p = $_;
+
+ if (packageFlagSelected($p)) {
+ my $list = $ask_child->(packageName($p));
+ my @commonparts = map { /^=(.*)/ ? ($1) : () } @$list;
+ map { delete $installedFilesForUpgrade{$_} } grep { $_ !~ m|^/etc/rc.d/| }
+ map { /^(\d)(.*)/ ? ($commonparts[$1] . $2) : /^ (.*)/ ? ($1) : () } @$list;
+ }
+ }
+
+ #- select packages which contains marked files, then unmark on selection.
+ #- a special case can be made here, the selection is done only for packages
+ #- requiring locales if the locales are selected.
+ #- another special case are for devel packages where fixes over the time has
+ #- made some files moving between the normal package and its devel couterpart.
+ #- if only one file is affected, no devel package is selected.
+ foreach (values %{$packages->[0]}) {
+ my $p = $_;
+
+ unless (packageFlagSelected($p)) {
+ my $toSelect = 0;
+ my $list = $ask_child->(packageName($p));
+ my @commonparts = map { /^=(.*)/ ? ($1) : () } @$list;
+ map { if (exists $installedFilesForUpgrade{$_}) {
+ ++$toSelect if ! -d "$prefix/$_" && ! -l "$prefix/$_"; delete $installedFilesForUpgrade{$_} }
+ } grep { $_ !~ m|^/etc/rc.d/| } map { /^(\d)(.*)/ ? ($commonparts[$1] . $2) : /^ (.*)/ ? ($1) : () } @$list;
+ if ($toSelect) {
+ if ($toSelect <= 1 && packageName($p) =~ /-devel/) {
+ log::l("avoid selecting " . packageName($p) . " as not enough files will be updated");
+ } else {
+ #- default case is assumed to allow upgrade.
+ my @deps = map { my $p = $packages->[1][$_];
+ $p && packageName($p) =~ /locales-/ ? ($p) : () } packageDepsId($p);
+ if (@deps == 0 || @deps > 0 && (grep { !packageFlagSelected($_) } @deps) == 0) {
+ log::l("selecting " . packageName($p) . " by selection on files");
+ selectPackage($packages, $p);
+ } else {
+ log::l("avoid selecting " . packageName($p) . " as its locales language is not already selected");
+ }
+ }
+ }
+ }
+ }
+
+ #- clean memory...
+ %installedFilesForUpgrade = ();
+
+ #- select packages which obseletes other package, obselete package are not removed,
+ #- should we remove them ? this could be dangerous !
+ foreach (values %{$packages->[0]}) {
+ my $p = $_;
+
+ my $list = $ask_child->(packageName($p));
+ my @obsoletes = map { /^\*(\S*)/ ? ($1) : () } @$list;
+ foreach (@obsoletes) {
+ if (c::rpmdbNameTraverse($db, $_) > 0) {
+ log::l("selecting " . packageName($p) . " by selection on obsoletes");
+ selectPackage($packages, $p);
+ }
+ }
+ }
+
+ #- no need to still use the child as this point, we can let him to terminate.
+ close OUTPUT;
+ close INPUT;
+ waitpid $pid, 0;
+ } else {
+ local $_;
+
+ #- child process will hashes filelist and answer its parent
+ #- for each specific informations.
+ close INPUT;
+ close OUTPUT;
+ select((select(OUTPUT_CHILD), $| = 1)[0]);
+
+ #- get filelist of package to avoid getting all header into memory.
+ my %filelist;
+ my $current;
+ my $f = install_any::getFile('Mandrake/base/filelist') or log::l("unable to get filelist of packages");
+ while (<$f>) {
+ if (/^#(\S*)/) {
+ $current = $filelist{$1} = [];
+ } else {
+ push @$current, $_;
+ }
+ }
+
+ #- now respond to its parent wanting some data from filelist ...
+ while (<INPUT_CHILD>) {
+ chomp;
+ foreach (@{$filelist{$_}}) {
+ print OUTPUT_CHILD $_;
+ }
+ print OUTPUT_CHILD "\n";
+ }
+
+ #- the parent has broken the pipe associated with INPUT_CHILD,
+ #- exit now and free all that memory...
+ close OUTPUT_CHILD;
+ close INPUT_CHILD;
+ c::_exit(0);
+ }
+
+ #- keep a track of packages that are been selected for being upgraded,
+ #- these packages should not be unselected.
+ foreach (values %{$packages->[0]}) {
+ my $p = $_;
+
+ packageSetFlagUpgrade($p, 1) if packageFlagSelected($p);
+ }
+
+ #- clean false value on toRemove.
+ delete $toRemove{''};
+
+ #- get filenames that should be saved for packages to remove.
+ #- typically config files, but it may broke for packages that
+ #- are very old when compabilty has been broken.
+ #- but new version may saved to .rpmnew so it not so hard !
+ if ($toSave && keys %toRemove) {
+ c::rpmdbTraverse($db, sub {
+ my ($header) = @_;
+ my $otherPackage = (c::headerGetEntry($header, 'name'). '-' .
+ c::headerGetEntry($header, 'version'). '-' .
+ c::headerGetEntry($header, 'release'));
+ if ($toRemove{$otherPackage}) {
+ if (packageFlagBase($packages->[0]{c::headerGetEntry($header, 'name')})) {
+ delete $toRemove{$otherPackage}; #- keep it selected, but force upgrade.
+ } else {
+ my @files = c::headerGetEntry($header, 'filenames');
+ my @flags = c::headerGetEntry($header, 'fileflags');
+ for my $i (0..$#flags) {
+ if ($flags[$i] & c::RPMFILE_CONFIG()) {
+ push @$toSave, $files[$i] unless $files[$i] =~ /kdelnk/; #- avoid doublons for KDE.
+ }
+ }
+ }
+ }
+ });
+ }
+
+ log::l("before closing db");
+ #- close db, job finished !
+ c::rpmdbClose($db);
+ log::l("done selecting packages to upgrade");
+
+ #- update external copy with local one.
+ @{$toRemove || []} = keys %toRemove;
+}
+
+sub allowedToUpgrade { $_[0] !~ /^(kernel|kernel-secure|kernel-smp|kernel-linus|hackkernel)$/ }
+
+sub installCallback {
+ my $msg = shift;
+ log::l($msg .": ". join(',', @_));
+}
+
+sub install($$$;$$) {
+ my ($prefix, $isUpgrade, $toInstall, $depOrder, $media) = @_;
+ my %packages;
+
+ return if $::g_auto_install || !scalar(@$toInstall);
+
+ #- for root loopback'ed /boot
+ my $loop_boot = loopback::prepare_boot($prefix);
+
+ #- first stage to extract some important informations
+ #- about the packages selected. this is used to select
+ #- one or many transaction.
+ my ($total, $nb);
+ foreach my $pkg (@$toInstall) {
+ $packages{packageName($pkg)} = $pkg;
$nb++;
- $total += $p->{size};
+ $total += packageSize($pkg);
+ }
+
+ log::l("pkgs::install $prefix");
+ log::l("pkgs::install the following: ", join(" ", keys %packages));
+ eval { fs::mount("/proc", "$prefix/proc", "proc", 0) } unless -e "$prefix/proc/cpuinfo";
+
+ log::l("reading /usr/lib/rpm/rpmrc");
+ c::rpmReadConfigFiles() or die "can't read rpm config files";
+ log::l("\tdone");
+
+ my $callbackOpen = sub {
+ my $p = $packages{$_[0]};
+ my $f = packageFile($p);
+ print LOG "$f $p->{medium}{descr}\n";
+ my $fd = install_any::getFile($f, $p->{medium}{descr});
+ $fd ? fileno $fd : -1;
+ };
+ my $callbackClose = sub { packageSetFlagInstalled(delete $packages{$_[0]}, 1) };
+
+ #- do not modify/translate the message used with installCallback since
+ #- these are keys during progressing installation, or change in other
+ #- place (install_steps_gtk.pm,...).
+ installCallback("Starting installation", $nb, $total);
+
+ my ($i, $min, $medium) = (0, 0, 1);
+ do {
+ my @transToInstall;
+
+ if (!$depOrder || !$media) {
+ @transToInstall = values %packages;
+ $nb = 0;
+ } else {
+ do {
+ #- change current media if needed.
+ if ($i > $media->{$medium}{max}) {
+ #- search for media that contains the desired package to install.
+ foreach (keys %$media) {
+ $i >= $media->{$_}{min} && $i <= $media->{$_}{max} and $medium = $_, last;
+ }
+ }
+ $i >= $media->{$medium}{min} && $i <= $media->{$medium}{max} or die "unable to find right medium";
+ install_any::useMedium($medium);
+
+ while ($i <= $media->{$medium}{max} && ($i < $min || scalar @transToInstall < $limitMinTrans)) {
+ my $dep = $packages{packageName($depOrder->[$i++])} or next;
+ if ($dep->{medium}{selected}) {
+ push @transToInstall, $dep;
+ foreach (map { split '\|' } packageDepsId($dep)) {
+ $min < $_ and $min = $_;
+ }
+ } else {
+ log::l("ignoring package $dep->{file} as its medium is not selected");
+ }
+ --$nb; #- make sure the package is not taken into account as its medium is not selected.
+ }
+ } while ($nb > 0 && scalar(@transToInstall) == 0); #- avoid null transaction, it a nop that cost a bit.
+ }
+
+ #- added to exit typically after last media unselected.
+ if ($nb == 0 && scalar(@transToInstall) == 0) {
+ cleanHeaders($prefix);
+
+ loopback::save_boot($loop_boot);
+ return;
+ }
+
+ #- extract headers for parent as they are used by callback.
+ extractHeaders($prefix, \@transToInstall, $media->{$medium});
+
+ #- reset file descriptor open for main process but
+ #- make sure error trying to change from hdlist are
+ #- trown from main process too.
+ install_any::getFile(packageFile($transToInstall[0]), $transToInstall[0]{medium}{descr});
+ #- and make sure there are no staling open file descriptor too!
+ install_any::getFile('XXX');
+
+ #- reset ftp handlers before forking, otherwise well ;-(
+ #require ftp;
+ #ftp::rewindGetFile();
+
+ local (*INPUT, *OUTPUT); pipe INPUT, OUTPUT;
+ if (my $pid = fork()) {
+ close OUTPUT;
+ my $error_msg = '';
+ local $_;
+ while (<INPUT>) {
+ if (/^die:(.*)/) {
+ $error_msg = $1;
+ last;
+ } else {
+ chomp;
+ my @params = split ":";
+ if ($params[0] eq 'close') {
+ &$callbackClose($params[1]);
+ } else {
+ installCallback(@params);
+ }
+ }
+ }
+ $error_msg and $error_msg .= join('', <INPUT>);
+ waitpid $pid, 0;
+ close INPUT;
+ $error_msg and die $error_msg;
+ } else {
+ #- child process will run each transaction.
+ $SIG{SEGV} = sub { log::l("segmentation fault on transactions"); c::_exit(0) };
+ my $db;
+ eval {
+ close INPUT;
+ select((select(OUTPUT), $| = 1)[0]);
+ $db = c::rpmdbOpen($prefix) or die "error opening RPM database: ", c::rpmErrorString();
+ my $trans = c::rpmtransCreateSet($db, $prefix);
+ log::l("opened rpm database for transaction of ". scalar @transToInstall ." new packages, still $nb after that to do");
+
+ c::rpmtransAddPackage($trans, $_->{header}, packageName($_), $isUpgrade && allowedToUpgrade(packageName($_)))
+ foreach @transToInstall;
+
+ c::rpmdepOrder($trans) or
+ die "error ordering package list: " . c::rpmErrorString(),
+ sub { c::rpmdbClose($db) };
+ c::rpmtransSetScriptFd($trans, fileno LOG);
+
+ log::l("rpmRunTransactions start");
+ my @probs = c::rpmRunTransactions($trans, $callbackOpen,
+ sub { #- callbackClose
+ print OUTPUT "close:$_[0]\n"; },
+ sub { #- installCallback
+ print OUTPUT join(":", @_), "\n"; },
+ 1);
+ log::l("rpmRunTransactions done");
+
+ if (@probs) {
+ my %parts;
+ @probs = reverse grep {
+ if (s/(installing package) .* (needs (?:.*) on the (.*) filesystem)/$1 $2/) {
+ $parts{$3} ? 0 : ($parts{$3} = 1);
+ } else { 1; }
+ } reverse map { s|/mnt||; $_ } @probs;
+
+ c::rpmdbClose($db);
+ die "installation of rpms failed:\n ", join("\n ", @probs);
+ }
+ }; $@ and print OUTPUT "die:$@\n";
+
+ c::rpmdbClose($db);
+ log::l("rpm database closed");
+
+ close OUTPUT;
+ c::_exit(0);
+ }
+ c::headerFree(delete $_->{header}) foreach @transToInstall;
+ cleanHeaders($prefix);
+
+ if (my @badpkgs = grep { !packageFlagInstalled($_) && $_->{medium}{selected} && !exists($ignoreBadPkg{packageName($_)}) } @transToInstall) {
+ foreach (@badpkgs) {
+ log::l("bad package $_->{file}");
+ packageSetFlagSelected($_, 0);
+ }
+ cdie ("error installing package list: " . join(", ", map { $_->{file} } @badpkgs));
+ }
+ } while ($nb > 0 && !$pkgs::cancel_install);
+
+ cleanHeaders($prefix);
+
+ loopback::save_boot($loop_boot);
+}
+
+sub remove($$) {
+ my ($prefix, $toRemove) = @_;
+
+ return if $::g_auto_install || !@{$toRemove || []};
+
+ log::l("reading /usr/lib/rpm/rpmrc");
+ c::rpmReadConfigFiles() or die "can't read rpm config files";
+ log::l("\tdone");
+
+ my $db = c::rpmdbOpen($prefix) or die "error opening RPM database: ", c::rpmErrorString();
+ log::l("opened rpm database for removing old packages");
+
+ my $trans = c::rpmtransCreateSet($db, $prefix);
+
+ foreach my $p (@$toRemove) {
+ #- stuff remove all packages that matches $p, not a problem since $p has name-version-release format.
+ c::rpmtransRemovePackages($db, $trans, $p) if allowedToUpgrade($p);
}
- c::rpmdepOrder($trans) or c::rpmdbClose($db), c::rpmtransFree($trans), die "error ordering package list: ", c::rpmErrorString();
- c::rpmtransSetScriptFd($trans, $fd);
+ eval { fs::mount("/proc", "$prefix/proc", "proc", 0) } unless -e "$prefix/proc/cpuinfo";
- eval { fs::mount("/proc", "$rootPath/proc", "proc", 0) };
+ my $callbackOpen = sub { log::l("trying to open file from $_[0] which should not happen"); };
+ my $callbackClose = sub { log::l("trying to close file from $_[0] which should not happen"); };
- log::ld("starting installation: ", $nb, " packages, ", $total, " bytes");
+ #- we are not checking depends since it should come when
+ #- upgrading a system. although we may remove some functionalities ?
- # !! do not translate these messages, they are used when catched (cf install_steps_graphical)
- my $callbackStart = sub { log::ld("starting installing package ", $_[0]) };
- my $callbackProgress = sub { log::ld("progressing installation ", $_[0], "/", $_[1]) };
+ #- do not modify/translate the message used with installCallback since
+ #- these are keys during progressing installation, or change in other
+ #- place (install_steps_gtk.pm,...).
+ installCallback("Starting removing other packages", scalar @$toRemove);
- if (my @probs = c::rpmRunTransactions($trans, $callbackStart, $callbackProgress, $force)) {
- die "installation of rpms failed:\n ", join("\n ", @probs);
+ if (my @probs = c::rpmRunTransactions($trans, $callbackOpen, $callbackClose, \&installCallback, 1)) {
+ die "removing of old rpms failed:\n ", join("\n ", @probs);
}
- c::rpmtransFree($trans);
+ c::rpmtransFree($trans);
c::rpmdbClose($db);
log::l("rpm database closed");
+
+ #- keep in mind removing of these packages by cleaning $toRemove.
+ @{$toRemove || []} = ();
}
+
+1;
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 0ece8d811..e3ce0f7fa 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -1,537 +1,692 @@
-package printer;
+package printer; # $Id$
use diagnostics;
use strict;
-use vars qw(%thedb %printer_type %printer_type_inv);
+use vars qw(%thedb %thedb_gsdriver %printer_type %printer_type_inv @papersize_type %fields @entries_db_short @entry_db_description %descr_to_help %descr_to_db %db_to_descr %descr_to_ppd);
-########################################################################################
-# misc imports
-########################################################################################
-use Data::Dumper;
-use File::Copy;
+use common qw(:common :system :file);
+use commands;
-########################################################################################
-# pixel imports
-########################################################################################
-#
-########################################################################################
-# EXAMPLES AND TYPES
-########################################################################################
-
-# An entry in the 'printerdb' file, which describes each type of
-# supported printer
-
-#ex:
-#StartEntry: DeskJet550
-# GSDriver: cdj550
-# Description: {HP DeskJet 550C/560C/6xxC series}
-# About: { \
-# This driver supports the HP inkjet printers which have \
-# color capability using both black and color cartridges \
-# simultaneously. Known to work with the 682C and the 694C. \
-# Other 600 and 800 series printers may work \
-# if they have this feature. \
-# If your printer seems to be saturating the paper with ink, \
-# try added an extra GS option of '-dDepletion=2'. \
-# Ghostscript supports several optional parameters for \
-# this driver: see the document 'devices.doc' \
-# in the ghostscript directory under /usr/doc. \
-# }
-# Resolution: {300} {300} {}
-# BitsPerPixel: {3} {Normal color printing with color cartridge}
-# BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
-# BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-# BitsPerPixel: {32} {Sometimes provides better output than 24}
-#EndEntry
-
-my %ex_printerdb_entry =
- (
- ENTRY => "DeskJet550", #Human-readable name of the entry
- GSDRIVER => "cdj550", #gs driver used by this printer
- DESCR => "HP DeskJet 550C/560C/6xxC series", #Single line description of printer
- ABOUT => "
- This driver supports the HP inkjet printers which have
- color capability using both black and color cartridges
- ...", #Lengthy description of printer
- RESOLUTION => [ #List of resolutions supported
- {
- XDPI => 300,
- YDPI => 300,
- DESCR => "commentaire",
- },
- ],
- BITSPERPIXEL => [ #List of color depths supported
- {
- DEPTH => 3,
- DESCR => "Normal color printing with color cartridge",
- },
- ],
- )
-;
-
-
-
-# A printcap entry
-# Only represents a subset of possible options available
-# Sufficient for the simple configuration we are interested in
-
-# there is also some text in the template (.in) file in the spooldir
-
-#ex:
-## /etc/printcap
-##
-## Please don't edit this file directly unless you know what you are doing!
-## Be warned that the control-panel printtool requires a very strict format!
-## Look at the printcap(5) man page for more info.
-##
-## This file can be edited with the printtool in the control-panel.
-#
-###PRINTTOOL3## LOCAL uniprint NAxNA letter {} U_NECPrinwriter2X necp2x6 1
-#lpname:\
-# :sd=/var/spool/lpd/lpnamespool:\
-# :mx#45:\
-# :sh:\
-# :lp=/dev/device:\
-# :if=/var/spool/lpd/lpnamespool/filter:
-###PRINTTOOL3## REMOTE st800 360x180 a4 {} EpsonStylus800 Default 1
-#remote:\
-# :sd=/var/spool/lpd/remotespool:\
-# :mx#47:\
-# :sh:\
-# :rm=remotehost:\
-# :rp=remotequeue:\
-# :if=/var/spool/lpd/remotespool/filter:
-###PRINTTOOL3## SMB la75plus 180x180 letter {} DECLA75P Default {}
-#smb:\
-# :sd=/var/spool/lpd/smbspool:\
-# :mx#46:\
-# :sh:\
-# :if=/var/spool/lpd/smbspool/filter:\
-# :af=/var/spool/lpd/smbspool/acct:\
-# :lp=/dev/null:
-###PRINTTOOL3## NCP ap3250 180x180 letter {} EpsonAP3250 Default {}
-#ncp:\
-# :sd=/var/spool/lpd/ncpspool:\
-# :mx#46:\
-# :sh:\
-# :if=/var/spool/lpd/ncpspool/filter:\
-# :af=/var/spool/lpd/ncpspool/acct:\
-# :lp=/dev/null:
-
-
-my %ex_printcap_entry =
- (
- QUEUE => "lpname", #Queue name, can have multi separated by '|'
-
- #if you want something different from the default
- SPOOLDIR => "/var/spool/lpd/lpnamespool/", #Spool directory
- IF => "/var/spool/lpd/lpnamespool/filter", #input filter
-
- # commentaire inserer dans le printcap pour que printtool retrouve ses petits
- DBENTRY => "DeskJet670", #entry in printer database for this printer
-
- RESOLUTION => "NAxNA", #ghostscript resolution to use
- PAPERSIZE => "letter", #Papersize
- BITSPERPIXEL => "necp2x6", #ghostscript color option
- CRLF => "YES" , #Whether or not to do CR/LF xlation
-
- TYPE => "LOCAL",
-
- # LOCAL
- DEVICE => "/dev/device", #Print device
-
- # REMOTE (lpd) printers only
- REMOTEHOST => "remotehost", #Remote host (not used for all entries)
- REMOTEQUEUE => "remotequeue", #Queue on the remote machine
-
-
- #SMB (LAN Manager) only
- # in spooldir/.config
- #share='\\hostname\printername'
- #hostip=1.2.3.4
- #user='user'
- #password='passowrd'
- #workgroup='AS3'
- SMBHOST => "hostname", #Server name (NMB name, can have spaces)
- SMBHOSTIP => "1.2.3.4", #Can optional specify and IP address for host
- SMBSHARE => "printername", #Name of share on the SMB server
- SMBUSER => "user", #User to log in as on SMB server
- SMBPASSWD => "passowrd", #Corresponding password
- SMBWORKGROUP => "AS3", #SMB workgroup name
- AF => "/var/spool/lpd/smbspool/acct", #accounting filter (needed for smbprint)
-
- # NCP (NetWare) only
- # in spooldir/.config
- #server=printerservername
- #queue=queuename
- #user=user
- #password=pass
- NCPHOST => "printerservername", #Server name (NCP name)
- NCPQUEUE => "queuename", #Queue on server
- NCPUSER => "user", #User to log in as on NCP server
- NCPPASSWD => "pass", #Corresponding password
-
- )
-;
-
-########################################################################################
-# INTERN CONSTANT
-########################################################################################
-my $PRINTER_NONE = "NONE";
-my $PRINTER_LOCAL = "LOCAL";
-my $PRINTER_LPRREM = "REMOTE";
-my $PRINTER_SMB = "SMB";
-my $PRINTER_NCP = "NCP";
-
-########################################################################################
-# EXPORTED CONSTANT
-########################################################################################
-
-
-%printer_type = ("local" => $PRINTER_LOCAL,
- "Remote lpd" => $PRINTER_LPRREM,
- "SMB/Windows 95/NT" => $PRINTER_SMB,
- "NetWare" => $PRINTER_NCP,
- );
+#-if we are in an DrakX config
+my $prefix = "";
+#-location of the printer database in an installed system
+my $PRINTER_DB_FILE = "/usr/lib/rhs/rhs-printfilters/printerdb";
+my $PRINTER_FILTER_DIR = "/usr/lib/rhs/rhs-printfilters";
+
+%printer_type = (
+ __("Local printer") => "LOCAL",
+ __("Remote printer") => "REMOTE",
+ __("Remote CUPS server") => "CUPS",
+ __("Remote lpd server") => "LPD",
+ __("Network printer (socket)") => "SOCKET",
+ __("SMB/Windows 95/98/NT") => "SMB",
+ __("NetWare") => "NCP",
+ __("Printer Device URI") => "URI",
+);
%printer_type_inv = reverse %printer_type;
+%fields = (
+ STANDARD => [qw(QUEUE SPOOLDIR IF)],
+ SPEC => [qw(DBENTRY RESOLUTION PAPERSIZE BITSPERPIXEL CRLF)],
+ LOCAL => [qw(DEVICE)],
+ REMOTE => [qw(REMOTEHOST REMOTEQUEUE)],
+ SMB => [qw(SMBHOST SMBHOSTIP SMBSHARE SMBUSER SMBPASSWD SMBWORKGROUP AF)],
+ NCP => [qw(NCPHOST NCPQUEUE NCPUSER NCPPASSWD)],
+);
+@papersize_type = qw(letter legal ledger a3 a4);
-########################################################################################
-# GLOBALS
-########################################################################################
-
-#db of all entries in the printerdb file
+#------------------------------------------------------------------------------
+sub set_prefix($) { $prefix = $_[0]; }
-#if we are in an panoramix config
-my $prefix = "";
+sub default_queue($) { (split '\|', $_[0]{QUEUE})[0] }
+sub default_spooldir($) { "/var/spool/lpd/" . default_queue($_[0]) }
-# location of the printer database in an installed system
-my $PRINTER_DB_FILE = "/usr/lib/rhs/rhs-printfilters/printerdb";
-my $PRINTER_FILTER_DIR = "/usr/lib/rhs/rhs-printfilters/";
-my $SPOOLDIR = "/var/spool/lpd/";
+sub default_printer_type($) { "LOCAL" }
+sub printer_type($) {
+ for ($_[0]{mode}) {
+ /CUPS/ && return @printer_type_inv{qw(LOCAL REMOTE SMB), $::expert ? qw(URI) : ()};
+ /lpr/ && return @printer_type_inv{qw(LOCAL LPD SMB NCP)};
+ }
+}
-########################################################################################
-# FUNCTIONS
-########################################################################################
+sub copy_printer_params($$) {
+ my ($from, $to) = @_;
+ map { $to->{$_} = $from->{$_} } grep { $_ ne 'configured' } keys %$from; #- avoid cycles.
+}
-sub set_prefix($) {
- $prefix = shift;
+sub getinfo($) {
+ my ($prefix) = @_;
+ my $printer = {};
+
+ set_prefix($prefix);
+
+ #- try to detect which printing system has been previously installed.
+ #- the first detected is the default.
+ read_printers_conf($printer); #- try to read existing cups (local only) queues.
+ read_configured_queue($printer); #- try to read existing lpr queues.
+
+ add2hash($printer, {
+ #- global parameters.
+ want => 0,
+ complete => 0,
+ str_type => undef,
+ QUEUE => "lp",
+
+ #- lpr parameters.
+ SPOOLDIR => "/var/spool/lpd/lp",
+ DBENTRY => "PostScript",
+ PAPERSIZE => "",
+ ASCII_TO_PS => undef,
+ CRLF => undef,
+ NUP => 1,
+ RTLFTMAR => 18,
+ TOPBOTMAR => 18,
+ AUTOSENDEOF => 1,
+
+ DEVICE => "/dev/lp0",
+
+ REMOTEHOST => "",
+ REMOTEQUEUE => "",
+
+ NCPHOST => "", #-"printerservername",
+ NCPQUEUE => "", #-"queuename",
+ NCPUSER => "", #-"user",
+ NCPPASSWD => "", #-"pass",
+
+ SMBHOST => "", #-"hostname",
+ SMBHOSTIP => "", #-"1.2.3.4",
+ SMBSHARE => "", #-"printername",
+ SMBUSER => "", #-"user",
+ SMBPASSWD => "", #-"passowrd",
+ SMBWORKGROUP => "", #-"AS3",
+
+ #- cups parameters.
+ DeviceURI => "parallel:/dev/lp0",
+ Info => "",
+ Location => "",
+ State => "Idle",
+ Accepting => "Yes",
+ });
+ $printer;
}
-#******************************************************************************
-# read function
-#******************************************************************************
-#------------------------------------------------------------------------------
-#Read the printer database from dbpath into memory
+
#------------------------------------------------------------------------------
+sub read_configured_queue($) {
+ my ($printer) = @_;
+ my $current = undef;
+ my $flush_current = sub {
+ if ($current) {
+ add2hash($printer->{configured}{$current->{QUEUE}} ||= {}, $current);
+ $current = undef;
+ }
+ };
+
+ #- read /etc/printcap file.
+ local *PRINTCAP; open PRINTCAP, "$prefix/etc/printcap" or return;
+ local $_;
+ while (<PRINTCAP>) {
+ chomp;
+ my $p = '(?:\{(.*?)\}|(\S+))';
+ if (/^##PRINTTOOL3##\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p(?:\s+$p)?/) {
+ &$flush_current;
+ $current = {
+ mode => 'lpr',
+ TYPE => $1 || $2,
+ GSDRIVER => $3 || $4,
+ RESOLUTION => $5 || $6,
+ PAPERSIZE => $7 || $8,
+ #- ignored $9 || $10,
+ DBENTRY => $11 || $12,
+ BITSPERPIXEL => $13 || $14,
+ CRLF => $15 || $16,
+ };
+ } elsif (/^\s*$/) { &$flush_current }
+ elsif (/^([^:]*):\\/) { $current->{QUEUE} = $1 }
+ if (/^\s+:(?:[^:]*:)*sd=([^:]*):/) { $current->{SPOOLDIR} = $1 }
+ if (/^\s+:(?:[^:]*:)*lp=([^:]*):\\/) { $current->{DEVICE} = $1 }
+ if (/^\s+:(?:[^:]*:)*rm=([^:]*):\\/) { $current->{REMOTEHOST} = $1 }
+ if (/^\s+:(?:[^:]*:)*rp=([^:]*):\\/) { $current->{REMOTEQUEUE} = $1 }
+ if (/^\s+:(?:[^:]*:)*af=([^:]*):\\/) { $current->{AF} = $1 }
+ if (/^\s+:(?:[^:]*:)*if=([^:]*):\\/) { $current->{IF} = $1 }
+ }
+ close PRINTCAP;
+ &$flush_current;
+
+ #- parse general.cfg for any configured queue.
+ foreach (values %{$printer->{configured}}) {
+ my $entry = $_;
+ local *F; open F, "$prefix$entry->{SPOOLDIR}/general.cfg" or next;
+ local $_;
+ while (<F>) {
+ chomp;
+ if (/^\s*(?:export\s+)?PRINTER_TYPE=(.*?)\s*$/) { $entry->{TYPE} = $1 unless defined $entry->{TYPE} }
+ elsif (/^\s*(?:export\s+)?ASCII_TO_PS=(.*?)\s*$/) { $entry->{ASCII_TO_PS} = $1 eq 'YES' unless defined $entry->{ASCII_TO_PS} }
+ elsif (/^\s*(?:export\s+)?PAPER_SIZE=(.*?)\s*$/) { $entry->{PAPERSIZE} = $1 unless defined $entry->{PAPERSIZE} }
+ }
+ close F;
+ }
+
+ #- parse postscript.cfg for any configured queue.
+ foreach (values %{$printer->{configured}}) {
+ my $entry = $_;
+ local *F; open F, "$prefix$entry->{SPOOLDIR}/postscript.cfg" or next;
+ local $_;
+ while (<F>) {
+ chomp;
+ if (/^\s*(?:export\s+)?GSDEVICE=(.*?)\s*$/) { $entry->{GSDRIVER} = $1 unless defined $entry->{GSDRIVER} }
+ elsif (/^\s*(?:export\s+)?RESOLUTION=(.*?)\s*$/) { $entry->{RESOLUTION} = $1 unless defined $entry->{RESOLUTION} }
+ elsif (/^\s*(?:export\s+)?COLOR=-dBitsPerPixel=(.*?)\s*$/) { $entry->{COLOR} = $1 unless defined $entry->{COLOR} }
+ elsif (/^\s*(?:export\s+)?COLOR=(.*?)\s*$/) { $entry->{COLOR} = $1 ? $1 : 'Default' unless defined $entry->{COLOR} }
+ elsif (/^\s*(?:export\s+)?PAPERSIZE=(.*?)\s*$/) { $entry->{PAPERSIZE} = $1 unless defined $entry->{PAPERSIZE} }
+ elsif (/^\s*(?:export\s+)?EXTRA_GS_OPTIONS=(.*?)\s*$/) { $entry->{EXTRA_GS_OPTIONS} = $1 unless defined $entry->{EXTRA_GS_OPTIONS}; $entry->{EXTRA_GS_OPTIONS} =~ s/^\"(.*)\"/$1/ }
+ elsif (/^\s*(?:export\s+)?REVERSE_ORDER=(.*?)\s*$/) { $entry->{REVERSE_ORDER} = $1 unless defined $entry->{REVERSE_ORDER} }
+ elsif (/^\s*(?:export\s+)?PS_SEND_EOF=(.*?)\s*$/) { $entry->{AUTOSENDEOF} = $1 eq 'YES' && $entry->{DBENTRY} eq 'PostScript' unless defined $entry->{AUTOSENDEOF} }
+ elsif (/^\s*(?:export\s+)?NUP=(.*?)\s*$/) { $entry->{NUP} = $1 unless defined $entry->{NUP} }
+ elsif (/^\s*(?:export\s+)?RTLFTMAR=(.*?)\s*$/) { $entry->{RTLFTMAR} = $1 unless defined $entry->{RTLFTMAR} }
+ elsif (/^\s*(?:export\s+)?TOPBOTMAR=(.*?)\s*$/) { $entry->{TOPBOTMAR} = $1 unless defined $entry->{TOPBOTMAR} }
+ }
+ close F;
+ }
+
+ #- parse textonly.cfg for any configured queue.
+ foreach (values %{$printer->{configured}}) {
+ my $entry = $_;
+ local *F; open F, "$prefix$entry->{SPOOLDIR}/textonly.cfg" or next;
+ local $_;
+ while (<F>) {
+ chomp;
+ if (/^\s*(?:export\s+)?TEXTONLYOPTIONS=(.*?)\s*$/) { $entry->{TEXTONLYOPTIONS} = $1 unless defined $entry->{TEXTONLYOPTIONS}; $entry->{TEXTONLYOPTIONS} =~ s/^\"(.*)\"/$1/ }
+ elsif (/^\s*(?:export\s+)?CRLFTRANS=(.*?)\s*$/) { $entry->{CRLF} = $1 eq 'YES' unless defined $entry->{CRLF} }
+ elsif (/^\s*(?:export\s+)?TEXT_SEND_EOF=(.*?)\s*$/) { $entry->{AUTOSENDEOF} = $1 eq 'YES' && $entry->{DBENTRY} ne 'PostScript' unless defined $entry->{AUTOSENDEOF} }
+ }
+ close F;
+ }
+
+ #- get extra parameters for SMB or NCP type queue.
+ foreach (values %{$printer->{configured}}) {
+ my $entry = $_;
+ if ($entry->{TYPE} eq 'SMB') {
+ my $config_file = "$prefix$entry->{SPOOLDIR}/.config";
+ local *F; open F, "$config_file" or next; #die "Can't open $config_file $!";
+ local $_;
+ while (<F>) {
+ chomp;
+ if (/^\s*share='\\\\(.*?)\\(.*?)'/) {
+ $entry->{SMBHOST} = $1;
+ $entry->{SMBSHARE} = $2;
+ } elsif (/^\s*hostip=(.*)/) {
+ $entry->{SMBHOSTIP} = $1;
+ } elsif (/^\s*user='(.*)'/) {
+ $entry->{SMBUSER} = $1;
+ } elsif (/^\s*password='(.*)'/) {
+ $entry->{SMBPASSWD} = $1;
+ } elsif (/^\s*workgroup='(.*)'/) {
+ $entry->{SMBWORKGROUP} = $1;
+ }
+ }
+ close F;
+ } elsif ($entry->{TYPE} eq 'NCP') {
+ my $config_file = "$prefix$entry->{SPOOLDIR}/.config";
+ local *F; open F, "$config_file" or next; #die "Can't open $config_file $!";
+ local $_;
+ while (<F>) {
+ chomp;
+ if (/^\s*server=(.*)/) {
+ $entry->{NCPHOST} = $1;
+ } elsif (/^\s*user='(.*)'/) {
+ $entry->{NCPUSER} = $1;
+ } elsif (/^\s*password='(.*)'/) {
+ $entry->{NCPPASSWD} = $1;
+ } elsif (/^\s*queue='(.*)'/) {
+ $entry->{NCPQUEUE} = $1;
+ }
+ }
+ close F;
+ }
+ }
+
+ #- assume this printing system, but only if some queue are defined.
+ scalar(keys %{$printer->{configured}}) > 0 and $printer->{mode} ||= 'lpr';
+}
+
sub read_printer_db(;$) {
- my ($dbpath) = @_;
-
- #$dbpath = $dbpath ? $dbpath : $DB_PRINTER_FILTER;
- $dbpath ||= $PRINTER_DB_FILE;
- $dbpath = "${prefix}$dbpath";
-
-
- %thedb and return;
-
- local *DBPATH; #don't have to do close
- open DBPATH, "<$dbpath" or die "An error has occurred on $dbpath : $!";
-
+ my $dbpath = $prefix . ($_[0] || $PRINTER_DB_FILE);
+
+ scalar(keys %thedb) > 4 and return; #- try reparse if using only ppa, POSTSCRIPT, TEXT.
+
+ my %available_devices; #- keep only available devices in our database.
+ local $_; #- use of while (<...
+ local *AVAIL; open AVAIL, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/gs --help |";
+ while (<AVAIL>) {
+ if (/^Available devices:/ ... /^\S/) {
+ @available_devices{split /\s+/, $_} = () if /^\s+/;
+ }
+ }
+ close AVAIL;
+ $available_devices{ppa} = undef; #- if -x "$prefix/usr/bin/pbm2ppa" && -x "$prefix/usr/bin/pnm2ppa";
+ delete $available_devices{''};
+ @available_devices{qw/POSTSCRIPT TEXT/} = (); #- these are always available.
+
+ local *DBPATH; #- don't have to do close ... and don't modify globals at least
+ open DBPATH, $dbpath or die "An error has occurred on $dbpath : $!";
+
while (<DBPATH>) {
if (/^StartEntry:\s(\w*)/) {
- my $entryname = $1;
- my $entry = {};
-
- $entry->{ENTRY} = $entryname;
-
- WHILE :
+ my $entry = { ENTRY => $1 };
+
+ WHILE :
while (<DBPATH>) {
SWITCH: {
- /GSDriver:\s*(\w*)/ and do { $entry->{GSDRIVER} = $1; last SWITCH};
- /Description:\s*{(.*)}/ and do { $entry->{DESCR} = $1; last SWITCH};
- /About:\s*{(.*)}/ and do { $entry->{ABOUT} = $1; last SWITCH};
- /About:\s*{(.*)/
- and do
- {
- my $string = "$1\n";
- while (<DBPATH>) {
- /(.*)}/ and do { $entry->{ABOUT} = $string; last SWITCH};
- $string .= $_;
- }
- };
- /Resolution:\s*{(.*)}\s*{(.*)}\s*{(.*)}/
- and do { push @{$entry->{RESOLUTION}}, {XDPI => $1, YDPI => $2, DESCR => $3}; last SWITCH};
- /BitsPerPixel:\s*{(.*)}\s*{(.*)}/
- and do { push @{$entry->{BITSPERPIXEL}}, {DEPTH => $1, DESCR => $2};last SWITCH;};
- /EndEntry/ and do { last WHILE;};
+ /GSDriver:\s*(\w*)/ and do { $entry->{GSDRIVER} = $1; last SWITCH };
+ /Description:\s*{(.*)}/ and do { $entry->{DESCR} = $1; last SWITCH };
+ /About:\s*{\s*(.*?)\s*}/ and do { $entry->{ABOUT} = $1; last SWITCH };
+ /About:\s*{\s*(.*?)\s*\\\s*$/
+ and do {
+ my $string = $1;
+ while (<DBPATH>) {
+ $string =~ /\S$/ and $string .= ' ';
+ /^\s*(.*?)\s*\\\s*$/ and $string .= $1;
+ /^\s*(.*?)\s*}\s*$/ and do { $entry->{ABOUT} = $string . $1; last SWITCH };
+ }
+ };
+ /Resolution:\s*{(.*)}\s*{(.*)}\s*{(.*)}/
+ and do { push @{$entry->{RESOLUTION} ||= []}, { XDPI => $1, YDPI => $2, DESCR => $3 }; last SWITCH };
+ /BitsPerPixel:\s*{(.*)}\s*{(.*)}/
+ and do { push @{$entry->{BITSPERPIXEL} ||= []}, {DEPTH => $1, DESCR => $2}; last SWITCH };
+
+ /EndEntry/ and last WHILE;
}
}
- $thedb{$entryname} = $entry;
+ if (exists $available_devices{$entry->{GSDRIVER}}) {
+ $thedb{$entry->{ENTRY}} = $entry;
+ $thedb_gsdriver{$entry->{GSDRIVER}} = $entry;
+ }
}
}
+
+ @entries_db_short = sort keys %printer::thedb;
+ %descr_to_db = map { $printer::thedb{$_}{DESCR}, $_ } @entries_db_short;
+ %descr_to_help = map { $printer::thedb{$_}{DESCR}, $printer::thedb{$_}{ABOUT} } @entries_db_short;
+ @entry_db_description = keys %descr_to_db;
+ %db_to_descr = reverse %descr_to_db;
+}
+
+#------------------------------------------------------------------------------
+sub read_cupsd_conf {
+ my @cupsd_conf;
+ local *F;
+
+ open F, "$prefix/etc/cups/cupsd.conf";
+ @cupsd_conf = <F>;
+ close F;
+
+ @cupsd_conf;
+}
+sub write_cupsd_conf {
+ my (@cupsd_conf) = @_;
+ local *F;
+
+ open F, ">$prefix/etc/cups/cupsd.conf";
+ print F @cupsd_conf;
+ close F;
+
+ #- restart cups after updating configuration.
+ require run_program;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/cups restart"); sleep 1;
+}
+
+sub read_printers_conf {
+ my ($printer) = @_;
+ my $current = undef;
+
+ #- read /etc/cups/printers.conf file.
+ #- according to this code, we are now using the following keys for each queues.
+ #- DeviceURI > lpd://printer6/lp
+ #- Info > Info Text
+ #- Location > Location Text
+ #- State > Idle|Stopped
+ #- Accepting > Yes|No
+ local *PRINTERS; open PRINTERS, "$prefix/etc/cups/printers.conf" or return;
+ local $_;
+ while (<PRINTERS>) {
+ chomp;
+ /^\s*#/ and next;
+ if (/^\s*<(?:DefaultPrinter|Printer)\s+([^>]*)>/) { $current = { mode => 'CUPS', QUEUE => $1, } }
+ elsif (/\s*<\/Printer>/) { $current->{QUEUE} && $current->{DeviceURI} or next; #- minimal check of synthax.
+ add2hash($printer->{configured}{$current->{QUEUE}} ||= {}, $current); $current = undef }
+ elsif (/\s*(\S*)\s+(.*)/) { $current->{$1} = $2 }
+ }
+ close PRINTERS;
+
+ #- assume this printing system.
+ $printer->{mode} ||= 'CUPS';
+}
+
+sub get_direct_uri {
+ #- get the local printer to access via a Device URI.
+ my @direct_uri;
+ local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/sbin/lpinfo -v |";
+ local $_;
+ while (<F>) {
+ /^(direct|usb|serial)\s+(\S*)/ and push @direct_uri, $2;
+ }
+ close F;
+ @direct_uri;
+}
+
+sub get_descr_from_ppd {
+ my ($printer) = @_;
+ my %ppd;
+
+ #- if there is no ppd, this means this is the PostScript generic filter.
+ local *F; open F, "$prefix/etc/cups/ppd/$printer->{QUEUE}.ppd" or return "Generic PostScript";
+ local $_;
+ while (<F>) {
+ /^\*([^\s:]*)\s*:\s*\"([^\"]*)\"/ and do { $ppd{$1} = $2; next };
+ /^\*([^\s:]*)\s*:\s*([^\s\"]*)/ and do { $ppd{$1} = $2; next };
+ }
+ close F;
+
+ $ppd{Manufacturer} . '|' . ($ppd{NickName} || $ppd{ShortNickName} || $ppd{ModelName}) .
+ ($ppd{LanguageVersion} && (" (" . lc(substr($ppd{LanguageVersion}, 0, 2)) . ")"));
}
+sub poll_ppd_base {
+ #- before trying to poll the ppd database available to cups, we have to make sure
+ #- the file /etc/cups/ppds.dat is no more modified.
+ #- if cups continue to modify it (because it reads the ppd files available), the
+ #- poll_ppd_base program simply cores :-)
+ run_program::rooted($prefix, "ifup lo"); #- else cups will not be happy!
+ run_program::rooted($prefix, "/etc/rc.d/init.d/cups start");
+
+ foreach (1..60) {
+ local *PPDS; open PPDS, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/poll_ppd_base -a |";
+ local $_;
+ while (<PPDS>) {
+ chomp;
+ my ($ppd, $mf, $descr, $lang) = split /\|/;
+ $ppd && $mf && $descr and $descr_to_ppd{"$mf|$descr" . ($lang && " ($lang)")} = $ppd;
+ }
+ close PPDS;
+ scalar(keys %descr_to_ppd) > 5 and last;
+ sleep 1; #- we have to try again running the program, wait here a little before.
+ }
+
+ scalar(keys %descr_to_ppd) > 5 or die "unable to connect to cups server";
-#******************************************************************************
-# write functions
-#******************************************************************************
+ #- assume a default printer not using any ppd at all.
+ $descr_to_ppd{"Generic PostScript"} = '';
+}
+
+#-******************************************************************************
+#- write functions
+#-******************************************************************************
#------------------------------------------------------------------------------
-# given the path queue_path, we create all the required spool directory
+#- given the path queue_path, we create all the required spool directory
#------------------------------------------------------------------------------
sub create_spool_dir($) {
my ($queue_path) = @_;
- my $complete_path = "${prefix}$queue_path";
+ my $complete_path = "$prefix/$queue_path";
+
+ commands::mkdir_("-p", $complete_path);
unless ($::testing) {
- mkdir "$complete_path", 0755
- or die "An error has occurred - can't create $complete_path : $!";
-
- #redhat want that "drwxr-xr-x root lp"
+ #-redhat want that "drwxr-xr-x root lp"
my $gid_lp = (getpwnam("lp"))[3];
- chown 0, $gid_lp, $complete_path
+ chown 0, $gid_lp, $complete_path
or die "An error has occurred - can't chgrp $complete_path to lp $!";
}
}
#------------------------------------------------------------------------------
-#given the input spec file 'input', and the target output file 'output'
-#we set the fields specified by fieldname to the values in fieldval
-#nval is the number of fields to set
-#Doesnt currently catch error exec'ing sed yet
+#-given the input spec file 'input', and the target output file 'output'
+#-we set the fields specified by fieldname to the values in fieldval
+#-nval is the number of fields to set
+#-Doesnt currently catch error exec'ing sed yet
#------------------------------------------------------------------------------
sub create_config_file($$%) {
- my ($inputfile, $outpufile, %toreplace) = @_;
- my ($in, $out) = ("${prefix}$inputfile", "${prefix}$outpufile");
- local *OUT;
- local *IN;
-
- #TODO my $oldmask = umask 0755;
-
- open IN , "<$in" or die "Can't open $in $!";
- if ($::testing) {
- open OUT, ">$out" or die "Can't open $out $!";
- } else {
- *OUT = *STDOUT
- }
-
- while ((<IN>)) {
- if (/@@@(.*)@@@/) {
- my $chaine = $1;
- if (!defined($toreplace{$chaine})) {
- die "I can't replace $chaine";
- }
- s/@@@(.*)@@@/$toreplace{$1}/g;
- }
- print OUT;
- }
-
-
+ my ($inputfile, $outputfile, %toreplace) = @_;
+ template2file("$prefix/$inputfile", "$prefix/$outputfile", %toreplace);
+ eval { commands::chown_("root.lp", "$prefix/$outputfile") };
}
#------------------------------------------------------------------------------
-#copy master filter to the spool dir
+#-copy master filter to the spool dir
#------------------------------------------------------------------------------
sub copy_master_filter($) {
my ($queue_path) = @_;
- my $complete_path = "${prefix}${queue_path}filter";
- my $master_filter = "${prefix}${PRINTER_FILTER_DIR}master-filter";
-
+ my $complete_path = "$prefix/$queue_path/filter";
+ my $master_filter = "$prefix/$PRINTER_FILTER_DIR/master-filter";
- unless ($::testing) {
- copy($master_filter, $complete_path) or die "Can't copy $master_filter to $complete_path $!";
- }
-
-
+ eval { commands::cp('-f', $master_filter, $complete_path) };
+ $@ and die "Can't copy $master_filter to $complete_path $!";
+ eval { commands::chown_("root.lp", $complete_path); };
}
#------------------------------------------------------------------------------
-# given a PrintCap Entry, create the spool dir and special
-# rhs-printfilters related config files which are required
+#- given a PrintCap Entry, create the spool dir and special
+#- rhs-printfilters related config files which are required
#------------------------------------------------------------------------------
-my $intro_printcap_test="
+my $intro_printcap_test = "
#
# Please don't edit this file directly unless you know what you are doing!
# Look at the printcap(5) man page for more info.
# Be warned that the control-panel printtool requires a very strict format!
-# Look at the printcap(5) man page for more info.
#
-# This file can be edited with the printtool in the control-panel.
+# This file can be edited with printerdrake or printtool.
#
";
-
sub configure_queue($) {
my ($entry) = @_;
- $entry->{SPOOLDIR} ||= "$SPOOLDIR";
- $entry->{IF} ||= "$SPOOLDIR$entry->{QUEUE}/filter";
- $entry->{AF} ||= "$SPOOLDIR$entry->{QUEUE}/acct";
-
- my $queue_path = "$entry->{SPOOLDIR}";
- create_spool_dir($queue_path);
+ for ($entry->{mode}) {
+ /CUPS/ && do {
+ #- at this level, we are using lpadmin to create a local printer (only local
+ #- printer are supported with printerdrake).
+ require run_program;
+ run_program::rooted($prefix, "lpadmin",
+ "-p", $entry->{QUEUE},
+ $entry->{State} eq 'Idle' && $entry->{Accepting} eq 'Yes' ? ("-E") : (),
+ "-v", $entry->{DeviceURI},
+ $entry->{cupsPPD} ? ("-m", $entry->{cupsPPD}) : (),
+ $entry->{Info} ? ("-D", $entry->{Info}) : (),
+ $entry->{Location} ? ("-L", $entry->{Location}) : (),
+ );
+ last };
+ /lpr/ && do {
+ #- old style configuration scheme for lpr.
+ my $queue_path = "$entry->{SPOOLDIR}";
+ create_spool_dir($queue_path);
+
+ my $get_name_file = sub {
+ my ($name) = @_;
+ ("$PRINTER_FILTER_DIR/$name.in", "$entry->{SPOOLDIR}/$name")
+ };
+ my ($filein, $file);
+ my %fieldname = ();
+ my $dbentry = $thedb{($entry->{DBENTRY})} or die "no dbentry";
+
+ #- make general.cfg
+ ($filein, $file) = &$get_name_file("general.cfg");
+ $fieldname{ascps_trans} = $entry->{ASCII_TO_PS} || $dbentry->{GSDRIVER} eq 'ppa' ? "YES" : "NO";
+ $fieldname{desiredto} = $dbentry->{GSDRIVER} ne "TEXT" ? "ps" : "asc";
+ $fieldname{papersize} = $entry->{PAPERSIZE} ? $entry->{PAPERSIZE} : "letter";
+ $fieldname{printertype} = $entry->{TYPE};
+ create_config_file($filein, $file, %fieldname);
+
+ #- now do postscript.cfg
+ ($filein, $file) = &$get_name_file("postscript.cfg");
+ %fieldname = ();
+ $fieldname{gsdevice} = $dbentry->{GSDRIVER};
+ $fieldname{papersize} = $entry->{PAPERSIZE} ? $entry->{PAPERSIZE} : "letter";
+ $fieldname{resolution} = $entry->{RESOLUTION};
+ $fieldname{color} = $entry->{BITSPERPIXEL} ne "Default" &&
+ (($dbentry->{GSDRIVER} ne "uniprint" && "-dBitsPerPixel=") . $entry->{BITSPERPIXEL});
+ $fieldname{reversepages} = $entry->{REVERSE_ORDER} ? "YES" : "";
+ $fieldname{extragsoptions} = "\"$entry->{EXTRA_GS_OPTIONS}\"";
+ $fieldname{pssendeof} = $entry->{AUTOSENDEOF} ? ($dbentry->{GSDRIVER} eq "POSTSCRIPT" ? "YES" : "NO") : "NO";
+ $fieldname{nup} = $entry->{NUP};
+ $fieldname{rtlftmar} = $entry->{RTLFTMAR};
+ $fieldname{topbotmar} = $entry->{TOPBOTMAR};
+ create_config_file($filein, $file, %fieldname);
+
+ #- finally, make textonly.cfg
+ ($filein, $file) = &$get_name_file("textonly.cfg");
+ %fieldname = ();
+ $fieldname{textonlyoptions} = "\"$entry->{TEXTONLYOPTIONS}\"";
+ $fieldname{crlftrans} = $entry->{CRLF} ? "YES" : "";
+ $fieldname{textsendeof} = $entry->{AUTOSENDEOF} ? ($dbentry->{GSDRIVER} eq "POSTSCRIPT" ? "NO" : "YES") : "NO";
+ create_config_file($filein, $file, %fieldname);
+
+ if ($entry->{TYPE} eq "SMB") {
+ #- simple config file required if SMB printer
+ my $config_file = "$prefix$queue_path/.config";
+ local *F;
+ open F, ">$config_file" or die "Can't create $config_file $!";
+ print F "share='\\\\$entry->{SMBHOST}\\$entry->{SMBSHARE}'\n";
+ print F "hostip=$entry->{SMBHOSTIP}\n";
+ print F "user='$entry->{SMBUSER}'\n";
+ print F "password='$entry->{SMBPASSWD}'\n";
+ print F "workgroup='$entry->{SMBWORKGROUP}'\n";
+ close F;
+ eval { chmod 0640, $config_file; commands::chown_("root.lp", $config_file) };
+ } elsif ($entry->{TYPE} eq "NCP") {
+ #- same for NCP printer
+ my $config_file = "$prefix$queue_path/.config";
+ local *F;
+ open F, ">$config_file" or die "Can't create $config_file $!";
+ print F "server=$entry->{NCPHOST}\n";
+ print F "queue=$entry->{NCPQUEUE}\n";
+ print F "user=$entry->{NCPUSER}\n";
+ print F "password=$entry->{NCPPASSWD}\n";
+ close F;
+ eval { chmod 0640, $config_file; commands::chown_("root.lp", $config_file) };
+ }
- my $get_name_file = sub {
- my ($name) = @_;
- ("${PRINTER_FILTER_DIR}$name.in)", "$entry->{SPOOLDIR}$name")
- };
- my ($filein, $file);
- my %fieldname = ();
- my $dbentry = $thedb{($entry->{DBENTRY})} or die "no dbentry";
-
-
- ($filein, $file) = &$get_name_file("general.cfg");
- $fieldname{desiredto} = ($entry->{GSDRIVER} eq "TEXT") ? "ps" : "asc";
- $fieldname{papersize} = ($entry->{PAPERSIZES}) ? $entry->{PAPERSIZES} : "letter";
- $fieldname{printertype} = ($entry)->{TYPE};
- $fieldname{ascps_trans} = ($dbentry->{GSDRIVER} eq "POSTSCRIPT") ?
- "NO" : "YES";
- create_config_file($filein,$file, %fieldname);
-
- # successfully created general.cfg, now do postscript.cfg
- ($filein, $file) = &$get_name_file("postscript.cfg");
- %fieldname = ();
- $fieldname{gsdevice} = $dbentry->{GSDRIVER};
- $fieldname{papersize} = ($entry->{PAPERSIZES}) ? $entry->{PAPERSIZES} : "letter";
- $fieldname{resolution} = ($entry->{RESOLUTION} eq "Default") ? "Default" : "";
- $fieldname{color} =
- do {
- if ($dbentry->{GSDRIVER} eq "uniprint") {
- ($entry->{BITSPERPIXEL} eq "Default") ? "-dBitsPerPixel=Default" : "";
- } else {
- $entry->{BITSPERPIXEL};
- }
- };
- $fieldname{reversepages} = "NO";
- $fieldname{extragsoptions} = "";
- $fieldname{pssendeof} = ($dbentry->{GSDRIVER} eq "POSTSCRIPT") ?
- "NO" : "YES";
- $fieldname{nup} = "1";
- $fieldname{rtlftmar} = "18";
- $fieldname{topbotmar} = "18";
- create_config_file($filein, $file, %fieldname);
-
- # finally, make textonly.cfg
- ($filein, $file) = &$get_name_file("textonly.cfg");
- %fieldname = ();
- $fieldname{textonlyoptions} = "";
- $fieldname{crlftrans} = $entry->{CRLF};
- $fieldname{textsendeof} = "1";
- create_config_file($filein, $file, %fieldname);
-
-
- unless ($::testing) {
- if ($entry->{TYPE} eq $PRINTER_SMB) {
- # simple config file required if SMB printer
- my $config_file = "${prefix}${queue_path}.config";
- local *CONFFILE;
- open CONFFILE, ">$config_file" or die "Can't create $config_file $!";
- print CONFFILE "share='\\\\$entry->{SMBHOST}\\$entry->{SMBSHARE}'\n";
- print CONFFILE "hostip='$entry->{SMBHOSTIP}'\n";
- print CONFFILE "user='$entry->{SMBUSER}'\n";
- print CONFFILE "password='$entry->{SMBPASSWD}'\n";
- print CONFFILE "workgroup='$entry->{SMBWORKGROUP}'\n";
- } elsif ($entry->{TYPE} eq $PRINTER_NCP) {
- # same for NCP printer
- my $config_file = "${prefix}${queue_path}.config";
- local *CONFFILE;
- open CONFFILE, ">$config_file" or die "Can't create $config_file $!";
- print CONFFILE "server=$entry->{NCPHOST}\n";
- print CONFFILE "queue=$entry->{NCPQUEUE}\n";
- print CONFFILE "user=$entry->{NCPUSER}\n";
- print CONFFILE "password=$entry->{NCPPASSWD}\n";
- }
+ copy_master_filter($queue_path);
+
+ #-now the printcap file, note this one contains all the printer (use configured for that).
+ local *PRINTCAP;
+ open PRINTCAP, ">$prefix/etc/printcap" or die "Can't open printcap file $!";
+ print PRINTCAP $intro_printcap_test;
+ foreach (values %{$entry->{configured}}) {
+ $_->{DBENTRY} = $thedb_gsdriver{$_->{GSDRIVER}}{ENTRY} unless defined $_->{DBENTRY};
+ my $db_ = $thedb{$_->{DBENTRY}} or next; #die "no dbentry";
+
+ $_->{SPOOLDIR} ||= default_spooldir($_);
+ $_->{IF} ||= "$_->{SPOOLDIR}/filter";
+ $_->{AF} ||= "$_->{SPOOLDIR}/acct";
+
+ printf PRINTCAP "##PRINTTOOL3## %s %s %s %s %s %s %s%s\n",
+ $_->{TYPE} || '{}',
+ $db_->{GSDRIVER} || '{}',
+ $_->{RESOLUTION} || '{}',
+ $_->{PAPERSIZE} || '{}',
+ '{}',
+ $db_->{ENTRY} || '{}',
+ $_->{BITSPERPIXEL} || '{}',
+ $_->{CRLF} ? " 1" : "";
+
+ print PRINTCAP "$_->{QUEUE}:\\\n";
+ print PRINTCAP "\t:sd=$_->{SPOOLDIR}:\\\n";
+ print PRINTCAP "\t:mx#0:\\\n\t:sh:\\\n";
+
+ if ($_->{TYPE} eq "LOCAL") {
+ print PRINTCAP "\t:lp=$_->{DEVICE}:\\\n";
+ } elsif ($_->{TYPE} eq "REMOTE") {
+ print PRINTCAP "\t:rm=$_->{REMOTEHOST}:\\\n";
+ print PRINTCAP "\t:rp=$_->{REMOTEQUEUE}:\\\n";
+ } else {
+ #- (pcentry->Type == (PRINTER_SMB | PRINTER_NCP))
+ print PRINTCAP "\t:lp=/dev/null:\\\n";
+ print PRINTCAP "\t:af=$_->{AF}\\\n";
+ }
+
+ #- cheating to get the input filter!
+ print PRINTCAP "\t:if=$_->{IF}:\n";
+ print PRINTCAP "\n";
+ }
+ eval { commands::chown_("root.lp", "$prefix/etc/printcap") };
+ last };
}
- copy_master_filter($queue_path);
-
- #now the printcap file
- local *PRINTCAP;
- if ($::testing) {
- open PRINTCAP, ">${prefix}etc/printcap" or die "Can't open printcap file $!";
- } else {
- *PRINTCAP = *STDOUT;
+ my $useUSB = 0;
+ foreach (values %{$entry->{configured}}) {
+ $useUSB ||= $_->{DEVICE} =~ /usb/ || $_->{DeviceURI} =~ /usb/;
}
-
- print PRINTCAP $intro_printcap_test;
- printf PRINTCAP "##PRINTTOOL3## %s %s %s %s %s %s %s \n",
- $entry->{TYPE},
- $dbentry->{GSDRIVER},
- $entry->{RESOLUTION},
- $entry->{PAPERSIZE},
- "{}",
- $dbentry->{ENTRY},
- $entry->{BITSPERPIXEL},
- ($entry->{CRLF} eq "YES") ? "1" : "";
-
-
- print PRINTCAP "$entry->{QUEUE}:\\\n";
- print PRINTCAP "\t:sd=$entry->{SPOOLDIR}:\\\n";
- print PRINTCAP "\t:mx#0:\\\n\t:sh:\\\n";
-
- if ($entry->{TYPE} eq $PRINTER_LOCAL) {
- print PRINTCAP "\t:lp=$entry->{DEVICE}:\\\n";
- } elsif ($entry->{TYPE} eq $PRINTER_LPRREM) {
- print PRINTCAP "\t:rm=$entry->{REMOTEHOST}:\\\n";
- print PRINTCAP "\t:rp=$entry->{REMOTEQUEUE}:\\\n";
- } else {
- # (pcentry->Type == (PRINTER_SMB | PRINTER_NCP))
- print PRINTCAP "\t:lp=/dev/null:\\\n";
- print PRINTCAP "\t:af=$entry->{SPOOLDIR}acct\\\n";
+ if ($useUSB) {
+ my $f = "$prefix/etc/sysconfig/usb";
+ my %usb = getVarsFromSh($f);
+ $usb{PRINTER} = "yes";
+ setVarsInSh($f, \%usb);
}
+}
- # cheating to get the input filter!
- print PRINTCAP "\t:if=$entry->{SPOOLDIR}filter:\n";
-
+#- use the queue currently configured at the top of printer hash.
+sub remove_queue($) {
+ my ($printer) = @_;
+ $printer->{configured}{$printer->{QUEUE}} or return; #- something strange at this point.
+
+ if ($printer->{mode} eq 'CUPS') {
+ require run_program;
+ run_program::rooted($prefix, "lpadmin", "-x", $printer->{QUEUE});
+ }
+ delete $printer->{configured}{$printer->{QUEUE}};
}
+sub restart_queue($) {
+ my ($printer) = @_;
+ my $queue = default_queue($printer);
+
+ for ($printer->{mode}) {
+ /CUPS/ && do {
+ #- restart cups before cleaning the queue.
+ require run_program;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/cups start"); sleep 1;
+ run_program::rooted($prefix, "lprm-cups", "-P$queue", "-");
+ last };
+ /lpr/ && do {
+ #- restart lpd after cleaning the queue.
+ foreach (("/var/spool/lpd/$queue/lock", "/var/spool/lpd/lpd.lock")) {
+ my $pidlpd = (cat_("$prefix$_"))[0];
+ kill 'TERM', $pidlpd if $pidlpd;
+ unlink "$prefix$_";
+ }
+ require run_program;
+ run_program::rooted($prefix, "lprm-lpd", "-P$queue", "-"); sleep 1;
+ run_program::rooted($prefix, "lpd"); sleep 1;
+ last };
+ }
+}
-#------------------------------------------------------------------------------
-#interface function
-#------------------------------------------------------------------------------
+sub print_pages($@) {
+ my ($printer, @pages) = @_;
+ my $queue = default_queue($printer);
+ my ($lpr, $lpq);
-sub
-#pixel stuff
-my ($o, $in);
-
+ for ($printer->{mode}) {
+ /CUPS/ and ($lpr, $lpq) = ("/usr/bin/lpr-cups", "/usr/bin/lpq-cups");
+ /lpr/ and ($lpr, $lpq) = ("/usr/bin/lpq-lpd", "/usr/bin/lpq-lpd");
+ }
-#------------------------------------------------------------------------------
-#fonction de test
-#------------------------------------------------------------------------------
-sub test {
- $::testing = 1;
- $printer::prefix="";
-
- read_printer_db();
-
- print "the dump\n";
- print Dumper(%thedb);
-
-
- #
- #eval { printer::create_spool_dir("/tmp/titi/", ".") };
- #print $@;
- #eval { printer::copy_master_filter("/tmp/titi/", ".") };
- #print $@;
- #
- #
- #eval { printer::create_config_file("files/postscript.cfg.in", "files/postscript.cfg","./",
- # (
- # gsdevice => "titi",
- # resolution => "tata",
- # ));
- # };
- #print $@;
- #
- #
- #
- #printer::configure_queue(\%printer::ex_printcap_entry, "/");
+ require run_program;
+ foreach (@pages) {
+ run_program::rooted($prefix, $lpr, "-P$queue", $_);
+ }
+ sleep 5; #- allow lpr to send pages.
+ local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$lpq -P$queue |";
+ my @lpq_output = grep { !/^no entries/ && !(/^Rank\s+Owner/ .. /^\s*$/) } <F>;
+ close F;
+ @lpq_output;
}
-########################################################################################
-# Wonderful perl :(
-########################################################################################
-1; #
+#-######################################################################################
+#- Wonderful perl :(
+#-######################################################################################
+1;
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 28bcd3b1e..4081b9721 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -1,171 +1,229 @@
-package printerdrake;
+package printerdrake; # $Id$
use diagnostics;
use strict;
use common qw(:common :file :functional :system);
use detect_devices;
-use run_program;
use commands;
use modules;
+use network;
use log;
use printer;
1;
-sub getinfo($) {
- my ($prefix) = @_;
- my $entry = {};
-
- printer::set_prefix($prefix);
- printer::read_configured_queue($entry);
-
- add2hash($entry, {
- want => 0,
- complete => 0,
- str_type => $printer::printer_type_default,
- QUEUE => "lp",
- SPOOLDIR => "/var/spool/lpd/lp",
- DBENTRY => "PostScript",
- PAPERSIZE => "legal",
- CRLF => 0,
- AUTOSENDEOF => 1,
-
- DEVICE => "/dev/lp0",
-
- REMOTEHOST => "",
- REMOTEQUEUE => "",
-
- NCPHOST => "", #-"printerservername",
- NCPQUEUE => "", #-"queuename",
- NCPUSER => "", #-"user",
- NCPPASSWD => "", #-"pass",
-
- SMBHOST => "", #-"hostname",
- SMBHOSTIP => "", #-"1.2.3.4",
- SMBSHARE => "", #-"printername",
- SMBUSER => "", #-"user",
- SMBPASSWD => "", #-"passowrd",
- SMBWORKGROUP => "", #-"AS3",
- });
- $entry;
+sub auto_detect {
+ my ($in) = @_;
+ {
+ my $w = $in->wait_message(_("Test ports"), _("Detecting devices..."));
+ modules::get_alias("usb-interface") and eval { modules::load("printer"); sleep(2); };
+ eval { modules::load_multi("parport_pc", "parport_probe", "lp"); };
+ }
+ my $b = before_leaving { eval { modules::unload("parport_probe") } };
+ detect_devices::whatPrinter();
}
-sub copy_printer_params($$) {
- my ($from, $to) = @_;
- foreach (keys %$from) {
- $to->{$_} = $from->{$_} if $_ ne 'configured'; #- avoid cycles.
+sub setup_local($$$) {
+ my ($printer, $in, $install) = @_;
+
+ my @port = ();
+ my @str = ();
+ my @parport = auto_detect($in);
+ foreach (@parport) {
+ $_->{val}{DESCRIPTION} and push @str, _("A printer, model \"%s\", has been detected on ",
+ $_->{val}{DESCRIPTION}) . $_->{port};
+ }
+ if (!$::expert && @str) {
+ @port = map { $_->{port} } grep { $_->{val}{DESCRIPTION} } @parport;
+ @port == 1 and $in = undef;
+ } else {
+ @port = detect_devices::whatPrinterPort();
+ }
+ $printer->{DEVICE} = $port[0] if $port[0];
+
+ if ($in) {
+ $::expert or $in->set_help('configurePrinterDev') if $::isInstall;
+ return if !$in->ask_from_entries_refH(_("Local Printer Device"),
+_("What device is your printer connected to
+(note that /dev/lp0 is equivalent to LPT1:)?\n") . (join "\n", @str), [
+_("Printer Device") => {val => \$printer->{DEVICE}, list => \@port } ],
+ );
}
-}
-#- Program entry point.
-sub main($$$$) {
- my ($prefix, $printer, $in, $install) = @_;
+ #- make the DeviceURI from DEVICE.
+ $printer->{DeviceURI} = ($printer->{DEVICE} =~ /usb/ ? "usb:" : "parallel:") . $printer->{DEVICE};
- unless ($::testing) {
- printer::set_prefix($prefix);
- &$install('rhs-printfilters');
+ foreach (@parport) {
+ $printer->{DEVICE} eq $_->{port} or next;
+ $printer->{DBENTRY} = $printer::descr_to_db{common::bestMatchSentence2($_->{val}{DESCRIPTION},
+ @printer::entry_db_description)};
+ $printer->{cupsDescr} = common::bestMatchSentence2($_->{val}{DESCRIPTION}, keys %printer::descr_to_ppd);
}
- printer::read_printer_db();
+ 1;
+}
- $printer->{complete} = 0;
- if ($::expert || scalar keys %{$printer->{configured}}) {
- $in->ask_from_entries_ref(_("Local Printer Options"),
- _("Every print queue (which print jobs are directed to) needs a
-name (often lp) and a spool directory associated with it. What
-name and directory should be used for this queue?"),
- [_("Name of queue:"), _("Spool directory:")],
- [\$printer->{QUEUE}, \$printer->{SPOOLDIR}],
- changed => sub
- {
- $printer->{SPOOLDIR} = "$printer::spooldir/$printer->{QUEUE}" unless $_[0];
- },
- );
- }
- copy_printer_params($printer->{configured}{$printer->{QUEUE}}, $printer); #- get default parameters from existing queue.
-
- $printer->{str_type} =
- $in->ask_from_list_(_("Select Printer Connection"),
- _("How is the printer connected?"),
- [ keys %printer::printer_type ],
- $printer::printer_type_inv{$printer->{TYPE}},
- );
- $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
-
- if ($printer->{TYPE} eq "LOCAL") {
- {
- my $w = $in->wait_message(_("Test ports"), _("Detecting devices..."));
- eval { modules::load("parport_pc"); modules::load("parport_probe"); modules::load("lp"); };
- }
+sub setup_remote($$$) {
+ my ($printer, $in, $install) = @_;
- my @port = ();
- my @parport = detect_devices::whatPrinter();
- eval { modules::unload("parport_probe") };
- my $str;
- if ($parport[0]) {
- my $port = $parport[0]{port};
- $printer->{DEVICE} = $port;
- my $descr = common::bestMatchSentence2($parport[0]{val}{DESCRIPTION}, @printer::entry_db_description);
- $printer->{DBENTRY} = $printer::descr_to_db{$descr};
- $str = _("A printer, model \"%s\", has been detected on ", $parport[0]{val}{DESCRIPTION}) . $port;
- @port = map { $_->{port}} @parport;
- } else {
- @port = detect_devices::whatPrinterPort();
- }
- $printer->{DEVICE} = $port[0] if $port[0];
-
- return if !$in->ask_from_entries_ref(_("Local Printer Device"),
- _("What device is your printer connected to \n(note that /dev/lp0 is equivalent to LPT1:)?\n") . $str ,
- [_("Printer Device:")],
- [{val => \$printer->{DEVICE}, list => \@port }],
- );
- } elsif ($printer->{TYPE} eq "REMOTE") {
- return if !$in->ask_from_entries_ref(_("Remote lpd Printer Options"),
- _("To use a remote lpd print queue, you need to supply
+ return if !$in->ask_from_entries_refH(_("Remote lpd Printer Options"),
+_("To use a remote lpd print queue, you need to supply
the hostname of the printer server and the queue name
-on that server which jobs should be placed in."),
- [_("Remote hostname:"), _("Remote queue")],
- [\$printer->{REMOTEHOST}, \$printer->{REMOTEQUEUE}],
- );
- } elsif ($printer->{TYPE} eq "SMB") {
- return if !$in->ask_from_entries_ref(
- _("SMB (Windows 9x/NT) Printer Options"),
- _("To print to a SMB printer, you need to provide the
+on that server which jobs should be placed in."), [
+_("Remote hostname") => \$printer->{REMOTEHOST},
+_("Remote queue") => \$printer->{REMOTEQUEUE}, ],
+ );
+ #- make the DeviceURI from DEVICE.
+ $printer->{DeviceURI} = "lpd://$printer->{REMOTEHOST}/$printer->{REMOTEQUEUE}";
+}
+
+sub setup_smb($$$) {
+ my ($printer, $in, $install) = @_;
+
+ return if !$in->ask_from_entries_refH(_("SMB (Windows 9x/NT) Printer Options"),
+_("To print to a SMB printer, you need to provide the
SMB host name (Note! It may be different from its
TCP/IP hostname!) and possibly the IP address of the print server, as
well as the share name for the printer you wish to access and any
-applicable user name, password, and workgroup information."),
- [_("SMB server host:"), _("SMB server IP:"),
- _("Share name:"), _("User name:"), _("Password:"),
- _("Workgroup:")],
- [\$printer->{SMBHOST}, \$printer->{SMBHOSTIP},
- \$printer->{SMBSHARE}, \$printer->{SMBUSER},
- {val => \$printer->{SMBPASSWD}, hidden => 1}, \$printer->{SMBWORKGROUP}
- ],
- complete => sub {
- unless (network::is_ip($printer->{SMBHOSTIP})) {
- $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
- return (1,1);
- }
- return 0;
- },
- );
- &$install('samba');
- } elsif ($printer->{TYPE} eq "NCP") {
- return if !$in->ask_from_entries_ref(_("NetWare Printer Options"),
- _("To print to a NetWare printer, you need to provide the
+applicable user name, password, and workgroup information."), [
+_("SMB server host") => \$printer->{SMBHOST},
+_("SMB server IP") => \$printer->{SMBHOSTIP},
+_("Share name") => \$printer->{SMBSHARE},
+_("User name") => \$printer->{SMBUSER},
+_("Password") => { val => \$printer->{SMBPASSWD}, hidden => 1 },
+_("Workgroup") => \$printer->{SMBWORKGROUP} ],
+ complete => sub {
+ unless (network::is_ip($printer->{SMBHOSTIP})) {
+ $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
+ return (1,1);
+ }
+ return 0;
+ },
+ );
+ #- make the DeviceURI from DEVICE, try to probe for available variable to build a some suitable URI.
+ #- Yes, SMBWORKGROUP is not used here, seems to be not usefull for cups.
+ $printer->{DeviceURI} = join '', ("smb://",
+ ($printer->{SMBUSER} && ($printer->{SMBUSER} .
+ ($printer->{SMBPASSWD} && ":$printer->{SMBPASSWD}") . "@")),
+ ($printer->{SMBHOST} || $printer->{SMBHOSTIP}),
+ "/$printer->{SMBSHARE}");
+
+ &$install('samba');
+ $printer->{mode} eq 'CUPS' and printer::restart_queue($printer);
+ 1;
+}
+
+sub setup_ncp($$$) {
+ my ($printer, $in, $install) = @_;
+
+ return if !$in->ask_from_entries_refH(_("NetWare Printer Options"),
+_("To print to a NetWare printer, you need to provide the
NetWare print server name (Note! it may be different from its
TCP/IP hostname!) as well as the print queue name for the printer you
-wish to access and any applicable user name and password."),
- [_("Printer Server:"), _("Print Queue Name:"),
- _("User name:"), _("Password:")],
- [\$printer->{NCPHOST}, \$printer->{NCPQUEUE},
- \$printer->{NCPUSER}, {val => \$printer->{NCPPASSWD}, hidden => 1}],
- );
- &$install('ncpfs');
+wish to access and any applicable user name and password."), [
+_("Printer Server") => \$printer->{NCPHOST},
+_("Print Queue Name") => \$printer->{NCPQUEUE},
+_("User name") => \$printer->{NCPUSER},
+_("Password") => {val => \$printer->{NCPPASSWD}, hidden => 1} ],
+ );
+ &$install('ncpfs');
+ 1;
+}
+
+sub setup_socket($$$) {
+ my ($printer, $in, $install) = @_;
+ my ($hostname, $port);
+
+ return if !$in->ask_from_entries_refH(_("Socket Printer Options"),
+_("To print to a socket printer, you need to provide the
+hostname of the printer and optionally the port number."), [
+_("Printer Hostname") => \$hostname,
+_("Port") => \$port ],
+ );
+
+ #- make the DeviceURI parameters given above, these parameters are not in printer
+ #- structure as only the URI is needed (cups only).
+ $printer->{DeviceURI} = join '', ("socket://$hostname", $port ? (":$port") : ());
+ 1;
+}
+
+sub setup_uri($$$) {
+ my ($printer, $in, $install) = @_;
+
+ return if !$in->ask_from_entries_refH(_("Printer Device URI"),
+_("You can specify directly the URI to access the printer with CUPS."), [
+_("Printer Device URI") => { val => \$printer->{DeviceURI}, list => [ printer::get_direct_uri(),
+ "file:/",
+ "http://",
+ "ipp://",
+ "lpq://",
+ "smb://",
+ "socket://",
+ ], not_edit => 0 }, ],
+ );
+ if ($printer->{DeviceURI} =~ /^smb:/) {
+ &$install('samba');
+ printer::restart_queue($printer);
}
+ 1;
+}
+
+sub setup_gsdriver($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
+ for ($printer->{mode}) {
+ /CUPS/ && return setup_gsdriver_cups($printer, $in, $install, $upNetwork);
+ /lpr/ && return setup_gsdriver_lpr($printer, $in, $install, $upNetwork);
+ die "mode not chosen to configure a printer";
+ }
+}
+
+sub setup_gsdriver_cups($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
+ my $testpage = "/usr/share/cups/data/testprint.ps";
+
+ $in->set_help('configurePrinterType') if $::isInstall;
+ while (1) {
+ $printer->{cupsDescr} ||= printer::get_descr_from_ppd($printer);
+ $printer->{cupsDescr} = $in->ask_from_treelist('', _("What type of printer do you have?"), '|',
+ [ keys %printer::descr_to_ppd ], $printer->{cupsDescr}) or return;
+ $printer->{cupsPPD} = $printer::descr_to_ppd{$printer->{cupsDescr}};
+
+ #- install additional tools according to PPD files.
+ $printer->{cupsPPD} =~ /lexmark/i and &$install('ghostscript-utils');
+
+ $printer->{complete} = 1;
+ printer::copy_printer_params($printer, $printer->{configured}{$printer->{QUEUE}} ||= {});
+ printer::configure_queue($printer);
+ $printer->{complete} = 0;
+
+ if ($in->ask_yesorno('', _("Do you want to test printing?"), 1)) {
+ my @lpq_output;
+ {
+ my $w = $in->wait_message('', _("Printing test page(s)..."));
+
+ $upNetwork and do { &$upNetwork(); undef $upNetwork; sleep(1) };
+ @lpq_output = printer::print_pages($printer, $testpage);
+ }
+ if (@lpq_output) {
+ $in->ask_yesorno('', _("Test page(s) have been sent to the printer daemon.
+This may take a little time before printer start.
+Printing status:\n%s\n\nDoes it work properly?", "@lpq_output"), 1) and last;
+ } else {
+ $in->ask_yesorno('', _("Test page(s) have been sent to the printer daemon.
+This may take a little time before printer start.
+Does it work properly?"), 1) and last;
+ }
+ } else {
+ last;
+ }
+ }
+ $printer->{complete} = 1;
+}
+
+sub setup_gsdriver_lpr($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
my $action;
my @action = qw(ascii ps both done);
my %action = (
@@ -177,17 +235,21 @@ wish to access and any applicable user name and password."),
do {
$printer->{DBENTRY} ||= $printer::thedb_gsdriver{$printer->{GSDRIVER}}{ENTRY};
- $printer->{DBENTRY} =
- $printer::descr_to_db{
- $in->ask_from_list_(_("Configure Printer"),
- _("What type of printer do you have?"),
- [@printer::entry_db_description],
- $printer::db_to_descr{$printer->{DBENTRY}},
- )
- };
+ eval { $printer->{DBENTRY} = $printer::descr_to_db{
+ $in->ask_from_list_with_help_(_("Configure Printer"),
+ _("What type of printer do you have?"),
+ [ @printer::entry_db_description ],
+ { %printer::descr_to_help },
+ $printer::db_to_descr{$printer->{DBENTRY}},
+ )
+ };
+ }; $@ =~ /^ask_from_list cancel/ and return;
my %db_entry = %{$printer::thedb{$printer->{DBENTRY}}};
+ #- specific printer drivers to install.
+ #-&$install('pnm2ppa') if $db_entry{GSDRIVER} eq 'ppa';
+
my @list_res = @{$db_entry{RESOLUTION} || []};
my @res = map { "$_->{XDPI}x$_->{YDPI}" } @list_res;
my @list_col = @{$db_entry{BITSPERPIXEL} || []};
@@ -196,35 +258,54 @@ wish to access and any applicable user name and password."),
my %depth_to_col = reverse %col_to_depth;
my $is_uniprint = $db_entry{GSDRIVER} eq "uniprint";
- $printer->{RESOLUTION} = "Default" unless @list_res;
- $printer->{CRLF} = $db_entry{DESCR} =~ /HP/;
- $printer->{BITSPERPIXEL} = "Default" unless @list_col;
-
- $printer->{BITSPERPIXEL} = $depth_to_col{$printer->{BITSPERPIXEL}} || $printer->{BITSPERPIXEL}; #- translate.
-
- $in->ask_from_entries_refH('', _("Printer options"), [
-_("Paper Size") => { val => \$printer->{PAPERSIZE}, type => 'list', , not_edit => !$::expert, list => \@printer::papersize_type },
+ $printer->{PAPERSIZE} ||= "letter";
+ $printer->{RESOLUTION} = @res ? $res[0] || "Default" : "Default" unless member($printer->{RESOLUTION}, @res);
+ $printer->{ASCII_TO_PS} = $db_entry{GSDRIVER} eq 'POSTSCRIPT' unless defined($printer->{ASCII_TO_PS});
+ $printer->{CRLF} = $db_entry{DESCR} =~ /HP/ unless defined($printer->{CRLF});
+ $printer->{BITSPERPIXEL} = @list_col ? $depth_to_col{$printer->{BITSPERPIXEL}} || $col[0] : "Default";
+ $printer->{NUP} = 1 unless member($printer->{NUP}, qw(1 2 4 8));
+ $printer->{RTLFTMAR} = 18 unless $printer->{RTLFTMAR} =~ /^\d+$/;
+ $printer->{TOPBOTMAR} = 18 unless $printer->{TOPBOTMAR} =~ /^\d+$/;
+ $printer->{EXTRA_GS_OPTIONS} =~ s/^"(.*)"/$1/;
+ $printer->{TEXTONLYOPTIONS} =~ s/^"(.*)"/$1/;
+
+ return if !$in->ask_from_entries_refH('', _("Printer options"), [
+_("Paper Size") => { val => \$printer->{PAPERSIZE}, type => 'list', not_edit => !$::expert, list => \@printer::papersize_type },
_("Eject page after job?") => { val => \$printer->{AUTOSENDEOF}, type => 'bool' },
@list_res > 1 ? (
-_("Resolution") => { val => \$printer->{RESOLUTION}, type => 'list', , not_edit => !$::expert, list => \@res } ) : (),
-_("Fix stair-stepping text?") => { val => \$printer->{CRLF}, type => "bool" },
+_("Resolution") => { val => \$printer->{RESOLUTION}, type => 'list', not_edit => !$::expert, list => \@res } ) : (),
@list_col > 1 ? (
$is_uniprint ? (
-_("Uniprint driver options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', , not_edit => !$::expert, list => \@col } ) : (
-_("Color depth options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', , not_edit => !$::expert, list => \@col } ), ) : ()
-]);;
-
- $printer->{BITSPERPIXEL} = $col_to_depth{$printer->{BITSPERPIXEL}} || $printer->{BITSPERPIXEL}; #- translate.
+_("Uniprint driver options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', list => \@col } ) : (
+_("Color depth options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', list => \@col } ), ) : (),
+$db_entry{GSDRIVER} ne 'TEXT' && $db_entry{GSDRIVER} ne 'POSTSCRIPT' && $db_entry{GSDRIVER} ne 'ppa' ? (
+_("Print text as PostScript?") => { val => \$printer->{ASCII_TO_PS}, type => 'bool' }, ) : (),
+#+_("Reverse page order") => { val => \$printer->{REVERSE_ORDER}, type => 'bool' },
+$db_entry{GSDRIVER} ne 'POSTSCRIPT' ? (
+_("Fix stair-stepping text?") => { val => \$printer->{CRLF}, type => 'bool' },
+) : (),
+$db_entry{GSDRIVER} ne 'TEXT' ? (
+_("Number of pages per output pages") => { val => \$printer->{NUP}, type => 'list', not_edit => !$::expert, list => [1,2,4,8] },
+_("Right/Left margins in points (1/72 of inch)") => \$printer->{RTLFTMAR},
+_("Top/Bottom margins in points (1/72 of inch)") => \$printer->{TOPBOTMAR},
+) : (),
+$::expert && $db_entry{GSDRIVER} ne 'TEXT' && $db_entry{GSDRIVER} ne 'POSTSCRIPT' ? (
+_("Extra GhostScript options") => \$printer->{EXTRA_GS_OPTIONS},
+) : (),
+$::expert && $db_entry{GSDRIVER} ne 'POSTSCRIPT' ? (
+_("Extra Text options") => \$printer->{TEXTONLYOPTIONS},
+) : (),
+]);
+
+ $printer->{BITSPERPIXEL} = $col_to_depth{$printer->{BITSPERPIXEL}} || $printer->{BITSPERPIXEL}; #- translate back.
$printer->{complete} = 1;
- copy_printer_params($printer, $printer->{configured}{$printer->{QUEUE}} ||= {});
+ printer::copy_printer_params($printer, $printer->{configured}{$printer->{QUEUE}} ||= {});
printer::configure_queue($printer);
$printer->{complete} = 0;
- $action = ${{reverse %action}}{$in->ask_from_list('', _("Do you want to test printing?"),
- [ map { $action{$_} } @action ], $action{'done'})};
+ $action = $in->ask_from_listf('', _("Do you want to test printing?"), sub { $action{$_[0]} }, \@action, 'done');
- my $pidlpd;
my @testpages;
push @testpages, "/usr/lib/rhs/rhs-printfilters/testpage.asc"
if $action eq "ascii" || $action eq "both";
@@ -232,29 +313,190 @@ _("Color depth options") => { val => \$printer->{BITSPERPIXEL}, type => 'list',
if $action eq "ps" || $action eq "both";
if (@testpages) {
- my $w = $in->wait_message('', _(@testpages > 1 ? "Printing tests pages..." : "Printing test page..."));
+ my @lpq_output;
+ {
+ my $w = $in->wait_message('', _("Printing test page(s)..."));
- #- restart lpd with blank spool queue.
- foreach (("/var/spool/lpd/$printer->{QUEUE}/lock", "/var/spool/lpd/lpd.lock")) {
- $pidlpd = (cat_("$prefix$_"))[0]; kill 'TERM', $pidlpd if $pidlpd;
- unlink "$prefix$_";
+ $upNetwork and do { &$upNetwork(); undef $upNetwork; sleep(1) };
+ printer::restart_queue($printer);
+ @lpq_output = printer::print_pages($printer, @testpages);
}
- run_program::rooted($prefix, "lprm", "-P$printer->{QUEUE}", "-"); sleep 1;
- run_program::rooted($prefix, "lpd"); sleep 1;
- run_program::rooted($prefix, "lpr", "-P$printer->{QUEUE}", $_) foreach @testpages;
-
- sleep 3; #- allow lpr to send pages.
- local *F; open F, "chroot $prefix/ /usr/bin/lpq -P$printer->{QUEUE} |";
- my @lpq_output = grep { !/^no entries/ && !(/^Rank\s+Owner/ .. /^\s*$/) } <F>;
-
- undef $w; #- erase wait message window.
if (@lpq_output) {
- $action = $in->ask_yesorno('', _("Is this correct? Printing status:\n%s", "@lpq_output"), 1) ? 'done' : 'change';
+ $action = $in->ask_yesorno('', _("Test page(s) have been sent to the printer daemon.
+This may take a little time before printer start.
+Printing status:\n%s\n\nDoes it work properly?", "@lpq_output"), 1) ? 'done' : 'change';
} else {
- $action = $in->ask_yesorno('', _("Is this correct?"), 1) ? 'done' : 'change';
+ $action = $in->ask_yesorno('', _("Test page(s) have been sent to the printer daemon.
+This may take a little time before printer start.
+Does it work properly?"), 1) ? 'done' : 'change';
}
}
} while ($action ne 'done');
$printer->{complete} = 1;
}
+
+#- Program entry point for configuration with lpr or cups (stored in $mode).
+sub main($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
+ my ($queue, $continue) = ('', 1);
+
+ while ($continue) {
+ if ($::beginner || !(scalar keys %{$printer->{configured} || {}})) {
+ $queue = $printer->{want} || $in->ask_yesorno(_("Printer"),
+ _("Would you like to configure a printer?"), 0) ? 'lp' : 'Done';
+ } else {
+ $queue = $in->ask_from_list_([''],
+_("Here are the following print queues.
+You can add some more or change the existing ones."),
+ [ (sort keys %{$printer->{configured} || {}}), __("Add"), __("Done") ],
+ );
+ if ($queue eq 'Add') {
+ my %queues; @queues{map { split '\|', $_ } keys %{$printer->{configured}}} = ();
+ my $i = ''; while ($i < 100) { last unless exists $queues{"lp$i"}; ++$i; }
+ $queue = "lp$i";
+ }
+ }
+ $queue eq 'Done' and last;
+
+ #- switch according to what is being installed: cups, lpr or other.
+ for ($printer->{mode}) {
+ /CUPS/ && do { &$install('cups-drivers') unless $::testing;
+ my $w = $in->wait_message(_("CUPS starting"), _("Reading CUPS drivers database..."));
+ printer::poll_ppd_base(); last };
+ /lpr/ && do { &$install('rhs-printfilters') unless $::testing;
+ printer::read_printer_db(); last };
+ }
+
+ printer::copy_printer_params($printer->{configured}{$queue}, $printer) if $printer->{configured}{$queue};
+ $printer->{OLD_QUEUE} = $printer->{QUEUE} = $queue; #- keep in mind old name of queue (in case of changing)
+
+ while ($continue) {
+ $in->set_help('configurePrinterConnected') if $::isInstall;
+ $printer::printer_type_inv{$printer->{TYPE}} or $printer->{TYPE} = printer::default_printer_type($printer);
+ $printer->{str_type} = $printer::printer_type_inv{$printer->{TYPE}};
+ if ($printer->{mode} eq 'CUPS') {
+ $printer->{str_type} = $in->ask_from_list_(_("Select Printer Connection"),
+ _("How is the printer connected?"),
+ [ printer::printer_type($printer) ],
+ $printer->{str_type},
+ );
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
+ if ($printer->{TYPE} eq 'REMOTE') {
+ $printer->{str_type} = $printer::printer_type_inv{CUPS};
+ $printer->{str_type} = $in->ask_from_list_(_("Select Remote Printer Connection"),
+_("With a remote CUPS server, you do not have to configure
+any printer here; printers will be automatically detected.
+In case of doubt, select \"Remote CUPS server\"."),
+ [ @printer::printer_type_inv{qw(CUPS LPD SOCKET)} ],
+ $printer->{str_type},
+ );
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
+ }
+ if ($printer->{TYPE} eq 'CUPS') {
+ #- hack to handle cups remote server printing,
+ #- first read /etc/cups/cupsd.conf for variable BrowsePoll address:port
+ my @cupsd_conf = printer::read_cupsd_conf();
+ my ($server, $port);
+
+ foreach (@cupsd_conf) {
+ /^\s*BrowsePoll\s+(\S+)/ and $server = $1, last;
+ }
+ $server =~ /([^:]*):(.*)/ and ($server, $port) = ($1, $2);
+
+ #- then ask user for this combination
+ #- and rewrite /etc/cups/cupsd.conf according to new settings.
+ #- there are no other point where such information is written in this file.
+ if ($in->ask_from_entries_refH(_("Remote CUPS server"),
+_("With a remote CUPS server, you do not have to configure
+any printer here; printers will be automatically detected
+unless you have a server on a different network; in the
+latter case, you have to give the CUPS server IP address
+and optionally the port number."), [
+_("CUPS server IP") => \$server,
+_("Port") => \$port ],
+ complete => sub {
+ unless (!$server || network::is_ip($server)) {
+ $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
+ return (1,0);
+ }
+ if ($port !~ /^\d*$/) {
+ $in->ask_warn('', _("Port number should be numeric"));
+ return (1,1);
+ }
+ return 0;
+ },
+ )) {
+ $server && $port and $server = "$server:$port";
+ if ($server) {
+ @cupsd_conf = map { $server and s/^\s*BrowsePoll\s+(\S+)/BrowsePoll $server/ and $server = '';
+ $_ } @cupsd_conf;
+ $server and push @cupsd_conf, "\nBrowsePoll $server\n";
+ } else {
+ @cupsd_conf = map { s/^\s*BrowsePoll\s+(\S+)/\#BrowsePoll $1/;
+ $_ } @cupsd_conf;
+ }
+ printer::write_cupsd_conf(@cupsd_conf);
+ }
+ return; #- exit printer configuration, here is another hack for simplification.
+ }
+ $in->set_help('configurePrinterLocal') if $::isInstall;
+ $in->ask_from_entries_refH([_("Select Printer Connection"), _("Ok"),
+ $::beginner || !$printer->{configured}{$printer->{QUEUE}} ? () : _("Remove queue")],
+_("Every printer need a name (for example lp).
+Other parameters such as the description of the printer or its location
+can be defined. What name should be used for this printer and
+how is the printer connected?"), [
+_("Name of printer") => { val => \$printer->{QUEUE} },
+_("Description") => { val => \$printer->{Info} },
+_("Location") => { val => \$printer->{Location} },
+ ],
+ ) or printer::remove_queue($printer), $continue = 1, last;
+ } else {
+ if ($::beginner) {
+ $printer->{str_type} = $in->ask_from_list_(_("Select Printer Connection"),
+ _("How is the printer connected?"),
+ [ printer::printer_type($printer) ],
+ $printer->{str_type},
+ );
+ } else {
+ $in->set_help('configurePrinterLPR') if $::isInstall;
+ $in->ask_from_entries_refH([_("Select Printer Connection"), _("Ok"), $::beginner ? () : _("Remove queue")],
+_("Every print queue (which print jobs are directed to) needs a
+name (often lp) and a spool directory associated with it. What
+name and directory should be used for this queue and how is the printer connected?"), [
+_("Name of queue") => { val => \$printer->{QUEUE} },
+_("Spool directory") => { val => \$printer->{SPOOLDIR} },
+_("Printer Connection") => { val => \$printer->{str_type}, list => [ printer::printer_type($printer) ], not_edit => 1 },
+ ],
+ changed => sub {
+ $printer->{SPOOLDIR} = printer::default_spooldir($printer) unless $_[0];
+ }
+ ) or printer::remove_queue($printer), $continue = 1, last;
+ }
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
+ }
+
+ $continue = 0;
+ for ($printer->{TYPE}) {
+ /LOCAL/ and setup_local ($printer, $in, $install) and last;
+ /LPD/ and setup_remote ($printer, $in, $install) and last;
+ /SOCKET/ and setup_socket ($printer, $in, $install) and last;
+ /SMB/ and setup_smb ($printer, $in, $install) and last;
+ /NCP/ and setup_ncp ($printer, $in, $install) and last;
+ /URI/ and setup_uri ($printer, $in, $install) and last;
+ $continue = 1; last;
+ }
+ }
+
+ #- configure specific part according to lpr/cups.
+ if (!$continue && setup_gsdriver($printer, $in, $install, $printer->{TYPE} !~ /LOCAL/ && $upNetwork)) {
+ delete $printer->{OLD_QUEUE}
+ if $printer->{QUEUE} ne $printer->{OLD_QUEUE} && $printer->{configured}{$printer->{QUEUE}};
+ $continue = !$::beginner;
+ } else {
+ $continue = 1;
+ }
+ }
+}
+
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index 7cc2eb7d6..ddc2034ac 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -1,4 +1,4 @@
-package raid;
+package raid; # $Id$
use diagnostics;
use strict;
@@ -7,8 +7,10 @@ use strict;
#- misc imports
#-######################################################################################
use common qw(:common :functional);
+use partition_table qw(:types);
use run_program;
use devices;
+use commands;
use fs;
sub nb($) {
@@ -16,22 +18,20 @@ sub nb($) {
first((ref $nb ? $nb->{device} : $nb) =~ /(\d+)/);
}
-sub is($) {
- my ($part) = @_;
- $part->{device} =~ /^md/;
-}
-
sub new($$) {
my ($raid, $part) = @_;
my $nb = @$raid;
$raid->[$nb] = { 'chunk-size' => "64k", type => 0x83, disks => [ $part ], device => "md$nb", notFormatted => 1 };
$part->{raid} = $nb;
+ delete $part->{mntpoint};
+ $nb;
}
sub add($$$) {
- my ($raid, $part, $nb) = @_;
+ my ($raid, $part, $nb) = @_; $nb = nb($nb);
$raid->[$nb]{isMounted} and die _("Can't add a partition to _formatted_ RAID md%d", $nb);
$part->{raid} = $nb;
+ delete $part->{mntpoint};
push @{$raid->[$nb]{disks}}, $part;
}
@@ -40,12 +40,23 @@ sub delete($$) {
$nb = nb($nb);
delete $_->{raid} foreach @{$raid->[$nb]{disks}};
- $raid->[$nb] = undef;
+ undef $raid->[$nb];
+}
+
+sub changeNb($$$) {
+ my ($raid, $oldnb, $newnb) = @_;
+ if ($oldnb != $newnb) {
+ ($raid->[$newnb], $raid->[$oldnb]) = ($raid->[$oldnb], undef);
+ $raid->[$newnb]{device} = "md$newnb";
+ $_->{raid} = $newnb foreach @{$raid->[$newnb]{disks}};
+ }
+ $newnb;
}
sub removeDisk($$) {
my ($raid, $part) = @_;
my $nb = nb($part->{raid});
+ run_program::run("raidstop", devices::make($part->{device}));
delete $part->{raid};
@{$raid->[$nb]{disks}} = grep { $_ != $part } @{$raid->[$nb]{disks}};
update($raid->[$nb]);
@@ -63,23 +74,34 @@ sub updateSize($) {
};
}
+sub module($) {
+ my ($part) = @_;
+ my $mod = $part->{level};
+
+ $mod = 5 if $mod eq "4";
+ $mod = "raid$mod" if $mod =~ /^\d+$/;
+ $mod;
+}
+
sub updateIsFormatted($) {
my ($part) = @_;
$part->{isFormatted} = and_ map { $_->{isFormatted} } @{$part->{disks}};
$part->{notFormatted} = and_ map { $_->{notFormatted} } @{$part->{disks}};
}
-sub update($) {
- &updateSize;
- &updateIsFormatted;
+sub update {
+ foreach (@_) {
+ updateSize($_);
+ updateIsFormatted($_);
+ }
}
sub write($) {
my ($raid, $file) = @_;
local *F;
local $\ = "\n";
+ open F, ">$file" or die _("Can't write file $file");
foreach (grep {$_} @$raid) {
- open F, ">$file" or die _("Can't write file $file");
print F <<"EOF";
raiddev /dev/$_->{device}
raid-level $_->{level}
@@ -87,26 +109,51 @@ chunk-size $_->{'chunk-size'}
persistent-superblock 1
EOF
print F "nr-raid-disks ", int @{$_->{disks}};
- map_index {
- print F " device /dev/$_->{device}";
+ map_index {
+ print F " device ", devices::make($_->{device});
print F " raid-disk $::i";
} @{$_->{disks}};
}
}
-sub make($$) {
+sub make {
my ($raid, $part) = @_;
+ isMDRAID($_) and make($raid, $_) foreach @{$part->{disks}};
my $dev = devices::make($part->{device});
+ eval { commands::modprobe(module($part)) };
run_program::run("raidstop", $dev);
&write($raid, "/etc/raidtab");
- run_program::run("mkraid", "--really-force", $dev);
- run_program::run("raidstart", $dev);
+ run_program::run("mkraid", "--really-force", $dev) or die
+ $::isStandalone ? _("mkraid failed (maybe raidtools are missing?)") : _("mkraid failed");
}
sub format_part($$) {
my ($raid, $part) = @_;
- make($raid->{raid}, $part) if is($part);
- fs::format_part($part);
+ $part->{isFormatted} and return;
+
+ make($raid->{raid}, $part);
+ fs::real_format_part($part);
+ $_->{isFormatted} = 1 foreach @{$part->{disks}};
+}
+
+sub verify($) {
+ my ($raid) = @_;
+ $raid && $raid->{raid} or return;
+ foreach (grep {$_} @{$raid->{raid}}) {
+ @{$_->{disks}} >= ($_->{level} =~ /4|5/ ? 3 : 2) or die _("Not enough partitions for RAID level %d\n", $_->{level});
+ }
}
+sub prepare_prefixed($$) {
+ my ($raid, $prefix) = @_;
+ $raid && $raid->{raid} or return;
+
+ eval { commands::cp("-f", "/etc/raidtab", "$prefix/etc/raidtab") };
+ foreach (@{$raid->{raid}}) {
+ devices::make("$prefix/dev/$_->{device}") foreach @{$_->{disks}};
+ }
+}
+
+sub stopAll() { run_program::run("raidstop", devices::make("md$_")) foreach 0..7 }
+
1;
diff --git a/perl-install/resize_fat/Makefile b/perl-install/resize_fat/Makefile
index 34c257a4e..a82ca8441 100644
--- a/perl-install/resize_fat/Makefile
+++ b/perl-install/resize_fat/Makefile
@@ -1,12 +1,10 @@
-PRODUCT = libresize
-TARSOURCE = $(PRODUCT).tar.bz2
+.PHONY: clean
-.PHONY: clean tar
+c_rewritten: %: %.xs
+ test -e Makefile_c || perl Makefile.PL
+ $(MAKE) -f Makefile_c LD_RUN_PATH=
+ rm -f ../auto/resize_fat ; ln -s ../resize_fat/blib/arch/auto ../auto/resize_fat
clean:
- rm -f *~ TAGS $(TARSOURCE)
-
-tar: clean
- cp -f ../common.pm .
- cd .. ; tar cfy $(TARSOURCE) $(PRODUCT) ; mv $(TARSOURCE) $(PRODUCT)
- rm -f common.pm
+ test ! -e Makefile_c || $(MAKE) -f Makefile_c clean
+ rm -f *~ *.o
diff --git a/perl-install/resize_fat/README b/perl-install/resize_fat/README
index 2910c06c3..1c4798c82 100644
--- a/perl-install/resize_fat/README
+++ b/perl-install/resize_fat/README
@@ -1,5 +1,7 @@
-just do ./resize.pm and look at usage.
+TODO:
+resize_fat::fat::update($fs) should be called before doing undoable things
+(before the sync in construct_dir_tree)
BUGS:
no known bugs :)
diff --git a/perl-install/resize_fat/any.pm b/perl-install/resize_fat/any.pm
index d78a342be..3844e1c16 100644
--- a/perl-install/resize_fat/any.pm
+++ b/perl-install/resize_fat/any.pm
@@ -1,49 +1,79 @@
-package resize_fat::any;
+package resize_fat::any; # $Id$
use diagnostics;
use strict;
-use vars qw($FREE $FILE $DIRECTORY);
+use vars qw($FREE $FILE $DIRECTORY $UNMOVEABLE);
use common qw(:common :constant);
use resize_fat::fat;
use resize_fat::directory;
use resize_fat::dir_entry;
+use resize_fat::c_rewritten;
-$FREE = 0;
-$FILE = 1;
-$DIRECTORY = 2;
+$FREE = 0;
+$FILE = 1;
+$DIRECTORY = 2;
+$UNMOVEABLE = 8;
1;
-# returns the number of clusters for a given filesystem type
+#- returns the number of clusters for a given filesystem type
sub min_cluster_count($) {
my ($fs) = @_;
- (1 << $ {{ FAT16 => 12, FAT32 => 16 }}{$fs->{fs_type}}) - 12;
+ (1 << $ {{ FAT16 => 12, FAT32 => 12 }}{$fs->{fs_type}}) - 12;
}
sub max_cluster_count($) {
my ($fs) = @_;
- $resize_fat::bad_cluster_value - 2;
+ (1 << $ {{ FAT16 => 16, FAT32 => 28 }}{$fs->{fs_type}}) - 11;
}
-# calculates the minimum size of a partition, in physical sectors
+#- patch to get the function last_used that return the last used cluster of a fs.
+sub last_used($) {
+ my ($fs) = @_;
+
+ #- count in negative so absolute value count back to 2.
+ foreach (-($fs->{nb_clusters}+1)..-2) { return -$_ if resize_fat::c_rewritten::flag(-$_) }
+ die "any: empty FAT table of $fs->{nb_clusters} clusters";
+}
+#- patch to get the function last_unmoveable that return the last unmoveable cluster of a fs.
+sub last_unmoveable($) {
+ my ($fs) = @_;
+
+ #- count in negative so absolute value count back to 2.
+ foreach (-($fs->{nb_clusters}+1)..-2) { return -$_ if 0x8 & resize_fat::c_rewritten::flag(-$_) }
+
+ #- Oh at this point there are no unmoveable blocks!
+ 2;
+}
+
+#- calculates the minimum size of a partition, in physical sectors
sub min_size($) {
my ($fs) = @_;
- my $count = $fs->{clusters}->{count};
+ my $count = $fs->{clusters}{count};
- # directories are both in `used' and `dirs', so are counted twice
- # It's done on purpose since we're moving all directories. So at the worse
- # moment, 2 directories are there, but that way nothing wrong can happen :)
+ #- directories are both in `used' and `dirs', so are counted twice
+ #- It's done on purpose since we're moving all directories. So at the worse
+ #- moment, 2 directories are there, but that way nothing wrong can happen :)
my $min_cluster_count = max(2 + $count->{used} + $count->{bad} + $count->{dirs}, min_cluster_count($fs));
+ $min_cluster_count = max($min_cluster_count, last_unmoveable($fs));
+
+ my $size = $min_cluster_count * divide($fs->{cluster_size}, $SECTORSIZE) +
+ divide($fs->{cluster_offset}, $SECTORSIZE) +
+ 64*1024*1024 / $SECTORSIZE; #- help with such more sectors (ie 64Mb).
+
+ #- help zindozs again with 512Mb+ at least else partition is ignored.
+ if ($resize_fat::isFAT32) {
+ $size = max($size, 524*1024*1024 / $SECTORSIZE);
+ }
+ $size;
- $min_cluster_count * divide($fs->{cluster_size}, $SECTORSIZE) +
- divide($fs->{cluster_offset}, $SECTORSIZE);
}
-# calculates the maximum size of a partition, in physical sectors
+#- calculates the maximum size of a partition, in physical sectors
sub max_size($) {
my ($fs) = @_;
@@ -52,31 +82,42 @@ sub max_size($) {
$max_cluster_count * divide($fs->{cluster_size}, $SECTORSIZE) +
divide($fs->{cluster_offset}, $SECTORSIZE);
}
+#- calculates used size in order to avoid modifying anything.
+sub used_size($) {
+ my ($fs) = @_;
+
+ my $used_cluster_count = max(last_used($fs), min_cluster_count($fs));
+
+ $used_cluster_count * divide($fs->{cluster_size}, $SECTORSIZE) +
+ divide($fs->{cluster_offset}, $SECTORSIZE);
+}
-# fills in $fs->{fat_flag_map}.
-# Each FAT entry is flagged as either FREE, FILE or DIRECTORY.
+#- fills in fat_flag_map in c_rewritten.
+#- Each FAT entry is flagged as either FREE, FILE or DIRECTORY.
sub flag_clusters {
my ($fs) = @_;
- my ($cluster, $entry, $type);
+ my ($cluster, $curr_dir_name, $entry, $type, $nb_dirs);
my $f = sub {
- ($entry) = @_;
+ ($curr_dir_name, $entry) = @_;
$cluster = resize_fat::dir_entry::get_cluster($entry);
if (resize_fat::dir_entry::is_file($entry)) {
$type = $FILE;
+ $type |= $UNMOVEABLE if resize_fat::dir_entry::is_unmoveable($entry);
} elsif (resize_fat::dir_entry::is_directory($entry)) {
$type = $DIRECTORY;
} else { return }
- for (; !resize_fat::fat::is_eof($cluster); $cluster = resize_fat::fat::next($fs, $cluster)) {
- $cluster == 0 and die "Bad FAT: unterminated chain for $entry->{name}\n";
- $fs->{fat_flag_map}->[$cluster] and die "Bad FAT: cluster $cluster is cross-linked for $entry->{name}\n";
- $fs->{fat_flag_map}->[$cluster] = $type;
- $fs->{clusters}->{count}->{dirs}++ if $type == $DIRECTORY;
- }
+ my $nb = resize_fat::c_rewritten::checkFat($cluster, $type, "$curr_dir_name/$entry->{name}");
+ print "resize_fat:flag_clusters: check fat returned $nb of type $type for $curr_dir_name/$entry->{name}\n";
+ $nb_dirs += $nb if $type == $DIRECTORY;
+ 0;
};
- $fs->{fat_flag_map} = [ ($FREE) x ($fs->{nb_clusters} + 2) ];
- $fs->{clusters}->{count}->{dirs} = 0;
+
+ #- this must call allocate_fat_flag that zeroes the buffer allocated.
+ resize_fat::c_rewritten::allocate_fat_flag($fs->{nb_clusters} + 2);
+
resize_fat::directory::traverse_all($fs, $f);
+ $fs->{clusters}{count}{dirs} = $nb_dirs;
}
diff --git a/perl-install/resize_fat/boot_sector.pm b/perl-install/resize_fat/boot_sector.pm
index c236b1617..4ed4a73f7 100644
--- a/perl-install/resize_fat/boot_sector.pm
+++ b/perl-install/resize_fat/boot_sector.pm
@@ -1,69 +1,73 @@
-package resize_fat::boot_sector;
+package resize_fat::boot_sector; # $Id$
use diagnostics;
use strict;
-use common qw(:common :system :constant);
+use common qw(:common :system :constant :functional);
use resize_fat::io;
use resize_fat::any;
use resize_fat::directory;
+#- Oops, this will be unresizable on big-endian machine. trapped by signature.
my $format = "a3 a8 S C S C S S C S S S I I I S S I S S a458 S";
my @fields = (
- 'boot_jump', # boot strap short or near jump
- 'system_id', # Name - can be used to special case partition manager volumes
- 'sector_size', # bytes per logical sector
- 'cluster_size_in_sectors', # sectors/cluster
- 'nb_reserved', # reserved sectors
- 'nb_fats', # number of FATs
- 'nb_root_dir_entries', # number of root directory entries
- 'small_nb_sectors', # number of sectors: big_nb_sectors supersedes
- 'media', # media code
- 'fat16_fat_length', # sectors/FAT for FAT12/16
+ 'boot_jump', #- boot strap short or near jump
+ 'system_id', #- Name - can be used to special case partition manager volumes
+ 'sector_size', #- bytes per logical sector
+ 'cluster_size_in_sectors', #- sectors/cluster
+ 'nb_reserved', #- reserved sectors
+ 'nb_fats', #- number of FATs
+ 'nb_root_dir_entries', #- number of root directory entries
+ 'small_nb_sectors', #- number of sectors: big_nb_sectors supersedes
+ 'media', #- media code
+ 'fat16_fat_length', #- sectors/FAT for FAT12/16
'sectors_per_track',
'nb_heads',
- 'nb_hidden', # (unused)
- 'big_nb_sectors', # number of sectors (if small_nb_sectors == 0)
-
-# FAT32-only entries
- 'fat32_fat_length', # size of FAT in sectors
- 'fat32_flags', # bit8: fat mirroring,
- # low4: active fat
- 'fat32_version', # minor * 256 + major
+ 'nb_hidden', #- (unused)
+ 'big_nb_sectors', #- number of sectors (if small_nb_sectors == 0)
+
+#- FAT32-only entries
+ 'fat32_fat_length', #- size of FAT in sectors
+ 'fat32_flags', #- bit8: fat mirroring,
+ #- low4: active fat
+ 'fat32_version', #- minor * 256 + major
'fat32_root_dir_cluster',
'info_offset_in_sectors',
'fat32_backup_sector',
-# Common again...
- 'boot_code', # Boot code (or message)
- 'boot_sign', # 0xAA55
+#- Common again...
+ 'boot_code', #- Boot code (or message)
+ 'boot_sign', #- 0xAA55
);
1;
-# trimfs_init_boot_sector() - reads in the boot sector - gets important info out
-# of boot sector, and puts in main structure - performs sanity checks - returns 1
-# on success, 0 on failureparameters: filesystem an empty structure to fill.
+#- trimfs_init_boot_sector() - reads in the boot sector - gets important info out
+#- of boot sector, and puts in main structure - performs sanity checks - returns 1
+#- on success, 0 on failureparameters: filesystem an empty structure to fill.
sub read($) {
my ($fs) = @_;
-
+
my $boot = eval { resize_fat::io::read($fs, 0, $SECTORSIZE) }; $@ and die "reading boot sector failed on device $fs->{fs_name}";
@{$fs}{@fields} = unpack $format, $boot;
$fs->{nb_sectors} = $fs->{small_nb_sectors} || $fs->{big_nb_sectors};
- $fs->{cluster_size} = $fs->{cluster_size_in_sectors} * $fs->{sector_size};
+ $fs->{cluster_size} = $fs->{cluster_size_in_sectors} * $fs->{sector_size};
- $fs->{boot_sign} == 0xAA55 or die "Invalid signature for a MS-based filesystem.";
- $fs->{nb_fats} == 2 or die "Weird number of FATs: $fs->{nb_fats}, not 2.",
+ $fs->{boot_sign} == 0xAA55 or die "Invalid signature for a MS-based filesystem.\n";
$fs->{nb_sectors} < 32 and die "Too few sectors for viable file system\n";
+ $fs->{nb_fats} == 2 or cdie "Weird number of FATs: $fs->{nb_fats}, not 2.\n";
+ $fs->{sector_size} == 512 or cdie "Strange sector_size != 512\n";
if ($fs->{fat16_fat_length}) {
- # asserting FAT16, will be verified later on
+ #- asserting FAT16, will be verified later on
+ $resize_fat::isFAT32 = 0;
$fs->{fs_type} = 'FAT16';
$fs->{fs_type_size} = 16;
$fs->{fat_length} = $fs->{fat16_fat_length};
+ $resize_fat::bad_cluster_value = 0xfff7; #- 2**16 - 1
} else {
$resize_fat::isFAT32 = 1;
$fs->{fs_type} = 'FAT32';
@@ -72,9 +76,9 @@ sub read($) {
$fs->{nb_root_dir_entries} = 0;
$fs->{info_offset} = $fs->{info_offset_in_sectors} * $fs->{sector_size};
+ $resize_fat::bad_cluster_value = 0x0ffffff7;
}
- $resize_fat::bad_cluster_value = (1 << $fs->{fs_type_size}) - 9;
-
+
$fs->{fat_offset} = $fs->{nb_reserved} * $fs->{sector_size};
$fs->{fat_size} = $fs->{fat_length} * $fs->{sector_size};
$fs->{root_dir_offset} = $fs->{fat_offset} + $fs->{fat_size} * $fs->{nb_fats};
@@ -83,12 +87,12 @@ sub read($) {
$fs->{nb_fat_entries} = divide($fs->{fat_size}, $fs->{fs_type_size} / 8);
- # - 2 because clusters 0 & 1 doesn't exist
+ #- - 2 because clusters 0 & 1 doesn't exist
$fs->{nb_clusters} = divide($fs->{nb_sectors} * $fs->{sector_size} - $fs->{cluster_offset}, $fs->{cluster_size}) - 2;
$fs->{dir_entries_per_cluster} = divide($fs->{cluster_size}, psizeof($format));
- $fs->{nb_clusters} >= resize_fat::any::min_cluster_count($fs) or die "error: not enough sectors for a $fs->{fs_type}\n";
+#- $fs->{nb_clusters} >= resize_fat::any::min_cluster_count($fs) or die "error: not enough sectors for a $fs->{fs_type}\n";
$fs->{nb_clusters} < resize_fat::any::max_cluster_count($fs) or die "error: too many sectors for a $fs->{fs_type}\n";
}
@@ -99,7 +103,7 @@ sub write($) {
eval { resize_fat::io::write($fs, 0, $SECTORSIZE, $boot) }; $@ and die "writing the boot sector failed on device $fs->{fs_name}";
if ($resize_fat::isFAT32) {
- # write backup
+ #- write backup
eval { resize_fat::io::write($fs, $fs->{fat32_backup_sector} * $SECTORSIZE, $SECTORSIZE, $boot) };
$@ and die "writing the backup boot sector (#$fs->{fat32_backup_sector}) failed on device $fs->{fs_name}";
}
diff --git a/perl-install/resize_fat/c_rewritten.pm b/perl-install/resize_fat/c_rewritten.pm
index 1f5f505c7..d74ecb5d3 100644
--- a/perl-install/resize_fat/c_rewritten.pm
+++ b/perl-install/resize_fat/c_rewritten.pm
@@ -1,4 +1,4 @@
-package resize_fat::c_rewritten;
+package resize_fat::c_rewritten; # $Id$
use strict;
use vars qw($VERSION @ISA);
diff --git a/perl-install/resize_fat/c_rewritten.xs b/perl-install/resize_fat/c_rewritten.xs
index a42f3d133..92361097d 100644
--- a/perl-install/resize_fat/c_rewritten.xs
+++ b/perl-install/resize_fat/c_rewritten.xs
@@ -4,31 +4,105 @@
/* set by scan_fat, used by next */
short *fat = NULL;
+char *fat_flag_map = NULL;
+unsigned int *fat_remap = NULL;
+int fat_remap_size;
int type_size, nb_clusters, bad_cluster_value;
-char *fat_flag_map;
+
+void free_all() {
+#define FREE(p) if (p) free(p), p = NULL;
+ FREE(fat);
+ FREE(fat_flag_map);
+ FREE(fat_remap);
+#undef FREE
+}
unsigned int next(unsigned int cluster) {
short *p = fat + type_size * cluster;
- if (cluster > nb_clusters + 2) croak("fat::next: cluster %d outside filesystem", cluster);
+ if (!fat) {
+ free_all();
+ croak("fat::next: trying to use null pointer");
+ }
+ if (cluster >= nb_clusters + 2) {
+ free_all();
+ croak("fat::next: cluster %d outside filesystem", cluster);
+ }
return type_size == 1 ? *p : *((unsigned int *) p);
}
+void set_next(unsigned int cluster, unsigned int val) {
+ short *p = fat + type_size * cluster;
+ if (!fat) {
+ free_all();
+ croak("fat::set_next: trying to use null pointer");
+ }
+ if (cluster >= nb_clusters + 2) {
+ free_all();
+ croak("fat::set_next: cluster %d outside filesystem", cluster);
+ }
+ type_size == 1 ? *p : *((unsigned int *) p) = val;
+}
+
MODULE = resize_fat::c_rewritten PACKAGE = resize_fat::c_rewritten
+void
+read_fat(fd, offset, size, magic)
+ int fd
+ int offset
+ int size
+ unsigned char magic
+ PPCODE:
+{
+ fat = (short *) malloc(size);
+ if (!fat) {
+ free_all();
+ croak("read_fat: not enough memory");
+ }
+ if (lseek(fd, offset, SEEK_SET) != offset ||
+ read(fd, fat, size) != size) {
+ free_all();
+ croak("read_fat: reading FAT failed");
+ }
+ if (magic != *(unsigned char *) fat) {
+ free_all();
+ croak("read_fat: FAT has invalid signature");
+ }
+}
+
void
-scan_fat(fat_, nb_clusters_, type_size_)
- char *fat_
+write_fat(fd, size)
+ int fd
+ int size
+ PPCODE:
+{
+ if (write(fd, fat, size) != size) {
+ free_all();
+ croak("write_fat: write failed");
+ }
+}
+
+void
+free_all()
+ PPCODE:
+ free_all();
+
+void
+scan_fat(nb_clusters_, type_size_)
int nb_clusters_
int type_size_
PPCODE:
+{
unsigned int v;
int free = 0, bad = 0, used = 0;
short *p;
- fat = (short*) fat_; type_size = type_size_; nb_clusters = nb_clusters_;
- bad_cluster_value = type_size ? 0xffffff7 : 0xfff7;
+ type_size = type_size_; nb_clusters = nb_clusters_;
+ bad_cluster_value = type_size == 32 ? 0x0ffffff7 : 0xfff7;
- if (type_size % 16) fprintf(stderr, "unable to handle type_size"), exit(1);
+ if (type_size % 16) {
+ free_all();
+ croak("scan_fat: unable to handle FAT%d", type_size);
+ }
type_size /= 16;
for (p = fat + 2 * type_size; p < fat + type_size * (nb_clusters + 2); p += type_size) {
@@ -42,6 +116,7 @@ scan_fat(fat_, nb_clusters_, type_size_)
PUSHs(sv_2mortal(newSViv(free)));
PUSHs(sv_2mortal(newSViv(bad)));
PUSHs(sv_2mortal(newSViv(used)));
+}
unsigned int
next(unused, cluster)
@@ -52,20 +127,49 @@ next(unused, cluster)
OUTPUT:
RETVAL
+void
+set_next(unused, cluster, val)
+ void *unused
+ unsigned int cluster
+ unsigned int val
+ CODE:
+ set_next(cluster, val);
+
+void
+allocate_fat_flag(size)
+ int size
+ CODE:
+ fat_flag_map = calloc(size, 1);
+ if (!fat_flag_map) {
+ free_all();
+ croak("allocate_fat_flag: not enough memory");
+ }
+
int
-checkFat(fat_flag_map_, cluster, type, name)
- char *fat_flag_map_
+checkFat(cluster, type, name)
unsigned int cluster
int type
char *name
CODE:
int nb = 0;
- fat_flag_map = fat_flag_map_;
+ if (!fat_flag_map) {
+ free_all();
+ croak("Bad FAT: trying to use null pointer");
+ }
for (; cluster < bad_cluster_value; cluster = next(cluster)) {
- if (cluster == 0) croak("Bad FAT: unterminated chain for %s\n", name);
-
- if (fat_flag_map[cluster]) croak("Bad FAT: cluster $cluster is cross-linked for %s\n", name);
+ if (cluster == 0) {
+ free_all();
+ croak("Bad FAT: unterminated chain for %s\n", name);
+ }
+ if (cluster >= nb_clusters + 2) {
+ free_all();
+ croak("Bad FAT: chain outside filesystem for %s\n", name);
+ }
+ if (fat_flag_map[cluster]) {
+ free_all();
+ croak("Bad FAT: cluster %d is cross-linked for %s\n", cluster, name);
+ }
fat_flag_map[cluster] = type;
nb++;
}
@@ -77,6 +181,14 @@ unsigned int
flag(cluster)
unsigned int cluster
CODE:
+ if (!fat_flag_map) {
+ free_all();
+ croak("Bad FAT: trying to use null pointer");
+ }
+ if (cluster >= nb_clusters + 2) {
+ free_all();
+ croak("Bad FAT: going outside filesystem");
+ }
RETVAL = fat_flag_map[cluster];
OUTPUT:
RETVAL
@@ -86,5 +198,62 @@ set_flag(cluster, flag)
unsigned int cluster
int flag
CODE:
+ if (!fat_flag_map) {
+ free_all();
+ croak("Bad FAT: trying to use null pointer");
+ }
+ if (cluster >= nb_clusters + 2) {
+ free_all();
+ croak("Bad FAT: going outside filesystem");
+ }
fat_flag_map[cluster] = flag;
+void
+allocate_fat_remap(size)
+ int size
+ CODE:
+ fat_remap_size = size;
+ fat_remap = (unsigned int *) calloc(size, sizeof(unsigned int *));
+ if (!fat_remap) {
+ free_all();
+ croak("allocate_fat_remap: not enough memory");
+ }
+
+unsigned int
+fat_remap(cluster)
+ unsigned int cluster
+ CODE:
+ if (!fat_remap) {
+ free_all();
+ croak("fat_remap: trying to use null pointer");
+ }
+ if (cluster >= bad_cluster_value) {
+ RETVAL = cluster; /* special cases */
+ } else {
+ if (cluster >= fat_remap_size) {
+ free_all();
+ croak("fat_remap: cluster %d >= %d in fat_remap", cluster, fat_remap_size);
+ }
+ RETVAL = fat_remap[cluster];
+ }
+ OUTPUT:
+ RETVAL
+
+void
+set_fat_remap(cluster, val)
+ unsigned int cluster
+ unsigned int val
+ CODE:
+ if (!fat_remap) {
+ free_all();
+ croak("set_fat_remap: trying to use null pointer");
+ }
+ if (cluster >= fat_remap_size) {
+ free_all();
+ croak("set_fat_remap: cluster %d >= %d in set_fat_remap", cluster, fat_remap_size);
+ }
+ if (val < bad_cluster_value && val >= fat_remap_size) {
+ free_all();
+ croak("set_fat_remap: remapping cluster %d to cluster %d >= %d in set_fat_remap", cluster, val, fat_remap_size);
+ }
+ fat_remap[cluster] = val;
diff --git a/perl-install/resize_fat/dir_entry.pm b/perl-install/resize_fat/dir_entry.pm
index fa5ebb344..b39c72094 100644
--- a/perl-install/resize_fat/dir_entry.pm
+++ b/perl-install/resize_fat/dir_entry.pm
@@ -1,10 +1,14 @@
-package resize_fat::dir_entry;
+package resize_fat::dir_entry; # $Id$
use diagnostics;
use strict;
my $DELETED_FLAG = 0xe5;
+
+my $READ_ONLY_ATTR = 0x01;
+my $HIDDEN_ATTR = 0x02;
+my $SYSTEM_ATTR = 0x04;
my $VOLUME_LABEL_ATTR = 0x08;
my $VFAT_ATTR = 0x0f;
my $DIRECTORY_ATTR = 0x10;
@@ -13,7 +17,7 @@ my $DIRECTORY_ATTR = 0x10;
sub get_cluster($) {
my ($entry) = @_;
- $entry->{first_cluster} + ($resize_fat::isFAT32 ? $entry->{first_cluster_high} * 65536 : 0);
+ $entry->{first_cluster} + ($resize_fat::isFAT32 ? $entry->{first_cluster_high} * (1 << 16) : 0);
}
sub set_cluster($$) {
my ($entry, $val) = @_;
@@ -21,14 +25,14 @@ sub set_cluster($$) {
$entry->{first_cluster_high} = $val >> 16 if $resize_fat::isFAT32;
}
-sub is_directory_raw($) {
+sub is_unmoveable($) {
my ($entry) = @_;
- !is_special_entry($entry) && $entry->{attributes} & $DIRECTORY_ATTR;
+ $entry->{attributes} & $HIDDEN_ATTR || $entry->{attributes} & $SYSTEM_ATTR;
}
sub is_directory($) {
my ($entry) = @_;
- is_directory_raw($entry) && $entry->{name} !~ /^\.\.? /;
+ $entry->{attributes} & $DIRECTORY_ATTR && $entry->{name} !~ /^\.\.? / && !is_special_entry($entry);
}
sub is_volume($) {
@@ -46,7 +50,7 @@ sub is_special_entry($) {
my ($entry) = @_;
my ($c) = unpack "C", $entry->{name};
- # skip empty slots, deleted files, and 0xF6?? (taken from kernel)
+ #- skip empty slots, deleted files, and 0xF6?? (taken from kernel)
$c == 0 || $c == $DELETED_FLAG || $c == 0xF6 and return 1;
$entry->{attributes} == $VFAT_ATTR and return 1;
@@ -54,18 +58,19 @@ sub is_special_entry($) {
}
-# return true if entry has been modified
+#- return true if entry has been modified
+#- curr_dir_name is added to contains current directory name, "" for root.
sub remap {
- my ($fat_remap, $entry) = @_;
-
+ my ($curr_dir_name, $entry) = @_;
+
is_special_entry($entry) and return;
my $cluster = get_cluster($entry);
- my $new_cluster = $fat_remap->[$cluster];
+ my $new_cluster = resize_fat::c_rewritten::fat_remap($cluster);
- #print "remapping cluster ", get_first_cluster($fs, $entry), " to $new_cluster";
+ #-print "remapping cluster ", get_cluster($entry), " to $new_cluster";
- $new_cluster == $cluster and return; # no need to modify
+ $new_cluster == $cluster and return; #- no need to modify
set_cluster($entry, $new_cluster);
1;
diff --git a/perl-install/resize_fat/directory.pm b/perl-install/resize_fat/directory.pm
index ab8ec5328..beb780bcf 100644
--- a/perl-install/resize_fat/directory.pm
+++ b/perl-install/resize_fat/directory.pm
@@ -1,4 +1,4 @@
-package resize_fat::directory;
+package resize_fat::directory; # $Id$
use diagnostics;
use strict;
@@ -14,35 +14,36 @@ my @fields = (
'extension',
'attributes',
'is_upper_case_name',
- 'creation_time_low', # milliseconds
+ 'creation_time_low', #- milliseconds
'creation_time_high',
'creation_date',
'access_date',
- 'first_cluster_high', # for FAT32
+ 'first_cluster_high', #- for FAT32
'time',
'date',
'first_cluster',
'length',
);
+my $psizeof_format = psizeof($format);
1;
-sub entry_size { psizeof($format) }
+sub entry_size { $psizeof_format }
-# call `f' for each entry of the directory
-# if f return true, then modification in the entry are taken back
+#- call `f' for each entry of the directory
+#- if f return true, then modification in the entry are taken back
sub traverse($$$) {
- my ($fs, $directory, $f) = @_;
+ my ($directory, $curr_dir_name, $f) = @_;
- for (my $i = 0; 1; $i++) {
- my $raw = \substr($directory, $i * psizeof($format), psizeof($format));
+ for (my $i = 0;; $i++) {
+ my $raw = \substr($directory, $i * $psizeof_format, $psizeof_format);
- # empty entry means end of directory
+ #- empty entry means end of directory
$$raw =~ /^\0*$/ and return $directory;
my $entry; @{$entry}{@fields} = unpack $format, $$raw;
- &$f($entry)
+ &$f($curr_dir_name, $entry)
and $$raw = pack $format, @{$entry}{@fields};
}
$directory;
@@ -52,27 +53,27 @@ sub traverse_all($$) {
my ($fs, $f) = @_;
my $traverse_all; $traverse_all = sub {
- my ($entry) = @_;
+ my ($curr_dir_name, $entry) = @_;
- &$f($entry);
+ &$f($curr_dir_name, $entry);
- resize_fat::dir_entry::is_directory($entry)
- and traverse($fs, resize_fat::io::read_file($fs, resize_fat::dir_entry::get_cluster($entry)), $traverse_all);
+ resize_fat::dir_entry::is_directory($entry)
+ and traverse(resize_fat::io::read_file($fs, resize_fat::dir_entry::get_cluster($entry)), "$curr_dir_name/$entry->{name}", $traverse_all);
- undef; # no need to write back (cf traverse)
+ undef; #- no need to write back (cf traverse)
};
my $directory = $resize_fat::isFAT32 ?
resize_fat::io::read_file($fs, $fs->{fat32_root_dir_cluster}) :
resize_fat::io::read($fs, $fs->{root_dir_offset}, $fs->{root_dir_size});
- traverse($fs, $directory, $traverse_all);
+ traverse($directory, "", $traverse_all);
+ undef $traverse_all; #- circular reference is no good for perl's poor GC :(
}
-# function used by construct_dir_tree to translate the `cluster' fields in each
-# directory entry
-sub remap {
+#- function used by construct_dir_tree to translate the `cluster' fields in each
+#- directory entry
+sub remap($$) {
my ($fs, $directory) = @_;
-
- traverse($fs->{fat_remap}, $directory, sub { resize_fat::dir_entry::remap($fs->{fat_remap}, $_[0]) });
+ traverse($directory, "", \&resize_fat::dir_entry::remap);
}
diff --git a/perl-install/resize_fat/fat.pm b/perl-install/resize_fat/fat.pm
index 2b64bd6f7..31643f0a3 100644
--- a/perl-install/resize_fat/fat.pm
+++ b/perl-install/resize_fat/fat.pm
@@ -1,34 +1,21 @@
-package resize_fat::fat;
+package resize_fat::fat; # $Id$
use diagnostics;
use strict;
use resize_fat::any;
use resize_fat::io;
+use resize_fat::c_rewritten;
1;
sub read($) {
my ($fs) = @_;
- @{$fs->{fats}} = map {
- my $fat = eval { resize_fat::io::read($fs, $fs->{fat_offset} + $_ * $fs->{fat_size}, $fs->{fat_size}) };
- $@ and die "reading fat #$_ failed";
- vec($fat, 0, 8) == $fs->{media} or die "FAT $_ has invalid signature";
- $fat;
- } (0 .. $fs->{nb_fats} - 1);
+ resize_fat::c_rewritten::read_fat(fileno $fs->{fd}, $fs->{fat_offset}, $fs->{fat_size}, $fs->{media});
- $fs->{fat} = $fs->{fats}->[0];
-
- my ($free, $bad, $used) = (0, 0, 0);
-
- for (my $i = 2; $i < $fs->{nb_clusters} + 2; $i++) {
- my $cluster = &next($fs, $i);
- if ($cluster == 0) { $free++; }
- elsif ($cluster == $resize_fat::bad_cluster_value) { $bad++; }
- else { $used++; }
- }
- @{$fs->{clusters}->{count}}{qw(free bad used)} = ($free, $bad, $used);
+ @{$fs->{clusters}{count}}{qw(free bad used)} =
+ resize_fat::c_rewritten::scan_fat($fs->{nb_clusters}, $fs->{fs_type_size});
}
sub write($) {
@@ -36,32 +23,34 @@ sub write($) {
sysseek $fs->{fd}, $fs->{fat_offset}, 0 or die "write_fat: seek failed";
foreach (1..$fs->{nb_fats}) {
- syswrite $fs->{fd}, $fs->{fat}, $fs->{fat_size} or die "write_fat: write failed";
+ resize_fat::c_rewritten::write_fat(fileno $fs->{fd}, $fs->{fat_size});
}
}
-# allocates where all the clusters will be moved to. Clusters before cut_point
-# remain in the same position, however cluster that are part of a directory are
-# moved regardless (this is a mechanism to prevent data loss) (cut_point is the
-# first cluster that won't occur in the new fs)
+#- allocates where all the clusters will be moved to. Clusters before cut_point
+#- remain in the same position, however cluster that are part of a directory are
+#- moved regardless (this is a mechanism to prevent data loss) (cut_point is the
+#- first cluster that won't occur in the new fs)
sub allocate_remap {
my ($fs, $cut_point) = @_;
my ($cluster, $new_cluster);
- my $remap = sub { $fs->{fat_remap}->[$cluster] = $new_cluster; };
+ my $remap = sub { resize_fat::c_rewritten::set_fat_remap($cluster, $new_cluster) };
my $get_new = sub {
$new_cluster = get_free($fs);
0 < $new_cluster && $new_cluster < $cut_point or die "no free clusters";
- set_eof($fs, $new_cluster); # mark as used
- #log::ld("resize_fat: [$cluster,", &next($fs, $cluster), "...]->$new_cluster...");
+ set_eof($fs, $new_cluster); #- mark as used
+ #-log::ld("resize_fat: [$cluster,", &next($fs, $cluster), "...]->$new_cluster...");
};
- $fs->{fat_remap}->[0] = 0;
+ #- this must call allocate_fat_remap that zeroes the buffer allocated.
+ resize_fat::c_rewritten::allocate_fat_remap($fs->{nb_clusters} + 2);
+
$fs->{last_free_cluster} = 2;
for ($cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) {
if ($cluster < $cut_point) {
- if ($fs->{fat_flag_map}->[$cluster] == $resize_fat::any::DIRECTORY) {
+ if (resize_fat::c_rewritten::flag($cluster) == $resize_fat::any::DIRECTORY) {
&$get_new();
} else {
$new_cluster = $cluster;
@@ -75,36 +64,26 @@ sub allocate_remap {
}
-# updates the fat for the resized filesystem
+#- updates the fat for the resized filesystem
sub update {
my ($fs) = @_;
for (my $cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) {
- if ($fs->{fat_flag_map}->[$cluster]) {
+ if (resize_fat::c_rewritten::flag($cluster)) {
my $old_next = &next($fs, $cluster);
- my $new = $fs->{fat_remap}->[$cluster];
- my $new_next = $fs->{fat_remap}->[$old_next];
+ my $new = resize_fat::c_rewritten::fat_remap($cluster);
+ my $new_next = resize_fat::c_rewritten::fat_remap($old_next);
set_available($fs, $cluster);
is_eof($old_next) ?
set_eof($fs, $new) :
- set_next($fs, $new, $new_next);
+ set_next ($fs, $new, $new_next);
}
}
}
-# - compares the two FATs (one's a backup that should match) - skips first entry
-# - its just a signature (already checked above) NOTE: checks for cross-linking
-# are done in count.c
-sub check($) {
- my ($fs) = @_;
- foreach (@{$fs->{fats}}) {
- $_ eq $fs->{fats}->[0] or die "FAT tables do not match";
- }
-}
-
sub endianness16($) { (($_[0] & 0xff) << 8) + ($_[0] >> 8); }
sub endianness($$) {
my ($val, $nb_bits) = @_;
@@ -118,17 +97,9 @@ sub endianness($$) {
$r;
}
-sub next($$) {
- my ($fs, $cluster) = @_;
- $cluster > $fs->{nb_clusters} + 2 and die "fat::next: cluster $cluster outside filesystem";
- endianness(vec($fs->{fat}, $cluster, $fs->{fs_type_size}), $fs->{fs_type_size});
+*next = \&resize_fat::c_rewritten::next;
+*set_next = \&resize_fat::c_rewritten::set_next;
-}
-sub set_next($$$) {
- my ($fs, $cluster, $new_v) = @_;
- $cluster > $fs->{nb_clusters} + 2 and die "fat::set_next: cluster $cluster outside filesystem";
- vec($fs->{fat}, $cluster, $fs->{fs_type_size}) = endianness($new_v, $fs->{fs_type_size});
-}
sub get_free($) {
@@ -140,28 +111,28 @@ sub get_free($) {
die "no free clusters";
}
-# returns true if <cluster> represents an EOF marker
+#- returns true if <cluster> represents an EOF marker
sub is_eof($) {
my ($cluster) = @_;
$cluster >= $resize_fat::bad_cluster_value;
}
sub set_eof($$) {
my ($fs, $cluster) = @_;
- set_next($fs, $cluster, $resize_fat::bad_cluster_value + 1);
+ set_next ($fs, $cluster, $resize_fat::bad_cluster_value + 1);
}
-# returns true if <cluster> is empty. Note that this includes bad clusters.
+#- returns true if <cluster> is empty. Note that this includes bad clusters.
sub is_empty($) {
my ($cluster) = @_;
$cluster == 0 || $cluster == $resize_fat::bad_cluster_value;
}
-# returns true if <cluster> is available.
+#- returns true if <cluster> is available.
sub is_available($) {
my ($cluster) = @_;
$cluster == 0;
}
sub set_available($$) {
my ($fs, $cluster) = @_;
- set_next($fs, $cluster, 0);
+ set_next ($fs, $cluster, 0);
}
diff --git a/perl-install/resize_fat/info_sector.pm b/perl-install/resize_fat/info_sector.pm
index c46ae15fc..1d9c1690a 100644
--- a/perl-install/resize_fat/info_sector.pm
+++ b/perl-install/resize_fat/info_sector.pm
@@ -1,4 +1,4 @@
-package resize_fat::info_sector;
+package resize_fat::info_sector; # $Id$
use diagnostics;
use strict;
@@ -6,12 +6,13 @@ use strict;
use common qw(:system);
use resize_fat::io;
+#- Oops, this will be unresizable on big-endian machine. trapped by signature.
my $format = "a484 I I I a16";
my @fields = (
'unused',
- 'signature', # should be 0x61417272
- 'free_clusters', # -1 for unknown
- 'next_cluster', # most recently allocated cluster
+ 'signature', #- should be 0x61417272
+ 'free_clusters', #- -1 for unknown
+ 'next_cluster', #- most recently allocated cluster
'unused2',
);
@@ -20,15 +21,15 @@ my @fields = (
sub read($) {
my ($fs) = @_;
- my $info = resize_fat::io::read($fs, $fs->{offset}, psizeof($format));
+ my $info = resize_fat::io::read($fs, $fs->{info_offset}, psizeof($format));
@{$fs->{info_sector}}{@fields} = unpack $format, $info;
- $fs->{info_sector}->{signature} == 0x61417272 or die "Invalid information sector signature\n";
+ $fs->{info_sector}{signature} == 0x61417272 or die "Invalid information sector signature\n";
}
sub write($) {
my ($fs) = @_;
- $fs->{info_sector}->{free_clusters} = $fs->{clusters}->{count}->{free};
- $fs->{info_sector}->{next_cluster} = 2;
+ $fs->{info_sector}{free_clusters} = $fs->{clusters}->{count}->{free};
+ $fs->{info_sector}{next_cluster} = 2;
my $info = pack $format, @{$fs->{info_sector}}{@fields};
diff --git a/perl-install/resize_fat/io.pm b/perl-install/resize_fat/io.pm
index 8ffaa8355..7643a0953 100644
--- a/perl-install/resize_fat/io.pm
+++ b/perl-install/resize_fat/io.pm
@@ -1,16 +1,18 @@
-package resize_fat::io;
+package resize_fat::io; # $Id$
use diagnostics;
use strict;
use resize_fat::fat;
+use c;
1;
sub read($$$) {
my ($fs, $pos, $size) = @_;
- my $buf;
+ print "reading $size bytes at $pos\n";
+ my $buf = "\0" x $size;
sysseek $fs->{fd}, $pos, 0 or die "seeking to byte #$pos failed on device $fs->{fs_name}";
sysread $fs->{fd}, $buf, $size or die "reading at byte #$pos failed on device $fs->{fs_name}";
$buf;
@@ -18,36 +20,31 @@ sub read($$$) {
sub write($$$$) {
my ($fs, $pos, $size, $buf) = @_;
sysseek $fs->{fd}, $pos, 0 or die "seeking to byte #$pos failed on device $fs->{fs_name}";
- syswrite $fs->{fd}, $buf, $size or die "writing at byte #$pos failed on device $fs->{fs_name}";
+ syswrite $fs->{fd}, $buf or die "writing at byte #$pos failed on device $fs->{fs_name}";
}
sub read_cluster($$) {
my ($fs, $cluster) = @_;
my $buf;
+ my $pos = $fs->{cluster_offset} / 512 + $cluster * ($fs->{cluster_size} / 512);
- eval {
- $buf = &read($fs,
- $fs->{cluster_offset} + $cluster * $fs->{cluster_size},
- $fs->{cluster_size});
- }; @$ and die "reading cluster #$cluster failed on device $fs->{fs_name}";
+ c::lseek_sector(fileno $fs->{fd}, $pos, 0) or die "seeking to sector #$pos failed on device $fs->{fs_name}";
+ sysread $fs->{fd}, $buf, $fs->{cluster_size} or die "reading at sector #$pos failed on device $fs->{fs_name}";
$buf;
}
sub write_cluster($$$) {
my ($fs, $cluster, $buf) = @_;
+ my $pos = $fs->{cluster_offset} / 512 + $cluster * ($fs->{cluster_size} / 512);
- eval {
- &write($fs,
- $fs->{cluster_offset} + $cluster * $fs->{cluster_size},
- $fs->{cluster_size},
- $buf);
- }; @$ and die "writing cluster #$cluster failed on device $fs->{fs_name}";
+ c::lseek_sector(fileno $fs->{fd}, $pos, 0) or die "seeking to sector #$pos failed on device $fs->{fs_name}";
+ syswrite $fs->{fd}, $buf or die "writing at sector #$pos failed on device $fs->{fs_name}";
}
sub read_file($$) {
my ($fs, $cluster) = @_;
my $buf = '';
- for (; !resize_fat::fat::is_eof($cluster); $cluster = resize_fat::fat::next($fs, $cluster)) {
+ for (; !resize_fat::fat::is_eof($cluster); $cluster = resize_fat::fat::next ($fs, $cluster)) {
$cluster == 0 and die "Bad FAT: unterminated chain\n";
$buf .= read_cluster($fs, $cluster);
}
@@ -70,5 +67,5 @@ sub open($) {
check_mounted($fs->{device});
sysopen F, $fs->{fs_name}, 2 or sysopen F, $fs->{fs_name}, 0 or die "error opening device $fs->{fs_name} for writing\n";
- $fs->{fd} = \*F;
+ $fs->{fd} = *F;
}
diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm
index 2d5f4f969..dc1a65e65 100644
--- a/perl-install/resize_fat/main.pm
+++ b/perl-install/resize_fat/main.pm
@@ -1,6 +1,25 @@
#!/usr/bin/perl
-package resize_fat::main;
+# DiskDrake
+# Copyright (C) 1999 MandrakeSoft (pixel@linux-mandrake.com)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This is mainly a perl rewrite of the work of Andrew Clausen (libresize)
+
+package resize_fat::main; # $Id$
use diagnostics;
use strict;
@@ -15,79 +34,86 @@ use resize_fat::fat;
use resize_fat::any;
-#@ARGV == 2 or die "usage: fatresize <device> <size>\n <size> = 100 means `resize to 100Mb'\n <size> = +10 means `keep 10Mb of free space'\n";
-#
-#my $fs = init($ARGV[0]);
-#resize($fs, $ARGV[1]);
-
1;
-# - reads in the boot sector/partition info., and tries to make some sense of it
+#- - reads in the boot sector/partition info., and tries to make some sense of it
sub new($$$) {
my ($type, $device, $fs_name) = @_;
my $fs = { device => $device, fs_name => $fs_name } ;
- resize_fat::io::open($fs);
- resize_fat::boot_sector::read($fs);
- $resize_fat::isFAT32 and eval { resize_fat::info_sector::read($fs) };
- resize_fat::fat::read($fs);
- resize_fat::fat::check($fs);
- resize_fat::any::flag_clusters($fs);
-
+ eval {
+ resize_fat::io::open($fs);
+ resize_fat::boot_sector::read($fs);
+ $resize_fat::isFAT32 and eval { resize_fat::info_sector::read($fs) };
+ resize_fat::fat::read($fs);
+ resize_fat::any::flag_clusters($fs);
+ };
+ if ($@) {
+ close $fs->{fd};
+ die;
+ }
bless $fs, $type;
}
-# copy all clusters >= <start_cluster> to a new place on the partition, less
-# than <start_cluster>. Only copies files, not directories.
-# (use of buffer needed because the seeks slow like hell the hard drive)
+sub DESTROY {
+ my ($fs) = @_;
+ close $fs->{fd};
+ resize_fat::c_rewritten::free_all();
+}
+
+#- copy all clusters >= <start_cluster> to a new place on the partition, less
+#- than <start_cluster>. Only copies files, not directories.
+#- (use of buffer needed because the seeks slow like hell the hard drive)
sub copy_clusters {
my ($fs, $cluster) = @_;
my @buffer;
- my $flush = sub {
- while (@buffer) {
+ my $flush = sub {
+ while (@buffer) {
my $cluster = shift @buffer;
resize_fat::io::write_cluster($fs, $cluster, shift @buffer);
}
};
for (; $cluster < $fs->{nb_clusters} + 2; $cluster++) {
- $fs->{fat_flag_map}->[$cluster] == $resize_fat::any::FILE or next;
- push @buffer, $fs->{fat_remap}->[$cluster], resize_fat::io::read_cluster($fs, $cluster);
+ resize_fat::c_rewritten::flag($cluster) == $resize_fat::any::FILE or next;
+ push @buffer,
+ resize_fat::c_rewritten::fat_remap($cluster),
+ resize_fat::io::read_cluster($fs, $cluster);
@buffer > 50 and &$flush();
}
&$flush();
}
-# Constructs the new directory tree to match the new file locations.
+#- Constructs the new directory tree to match the new file locations.
sub construct_dir_tree {
my ($fs) = @_;
- if ($resize_fat::isFAT32) {
- # fat32's root must remain in the first 64k clusters
- # so don't set it as DIRECTORY, it will be specially handled
- $fs->{fat_flag_map}->[$fs->{fat32_root_dir_cluster}] = $resize_fat::any::FREE;
+ if ($resize_fat::isFAT32) {
+ #- fat32's root must remain in the first 64k clusters
+ #- so don't set it as DIRECTORY, it will be specially handled
+ resize_fat::c_rewritten::set_flag($fs->{fat32_root_dir_cluster}, $resize_fat::any::FREE);
}
for (my $cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) {
- $fs->{fat_flag_map}->[$cluster] == $resize_fat::any::DIRECTORY or next;
+ resize_fat::c_rewritten::flag($cluster) == $resize_fat::any::DIRECTORY or next;
- resize_fat::io::write_cluster($fs,
- $fs->{fat_remap}->[$cluster],
- resize_fat::directory::remap($fs, resize_fat::io::read_cluster($fs, $cluster)));
+ resize_fat::io::write_cluster($fs,
+ resize_fat::c_rewritten::fat_remap($cluster),
+ resize_fat::directory::remap($fs, resize_fat::io::read_cluster($fs, $cluster)));
}
sync();
- # until now, only free clusters have been written. it's a null operation if we stop here.
- # it means no corruption :)
+ #- until now, only free clusters have been written. it's a null operation if we stop here.
+ #- it means no corruption :)
#
- # now we must be as fast as possible!
+ #- now we must be as fast as possible!
- # remapping non movable root directory
+ #- remapping non movable root directory
if ($resize_fat::isFAT32) {
my $cluster = $fs->{fat32_root_dir_cluster};
- resize_fat::io::write_cluster($fs,
- $fs->{fat_remap}->[$cluster],
+ resize_fat::io::write_cluster($fs,
+ resize_fat::c_rewritten::fat_remap($cluster),
resize_fat::directory::remap($fs, resize_fat::io::read_cluster($fs, $cluster)));
} else {
resize_fat::io::write($fs, $fs->{root_dir_offset}, $fs->{root_dir_size},
@@ -97,44 +123,50 @@ sub construct_dir_tree {
sub min_size($) { &resize_fat::any::min_size }
sub max_size($) { &resize_fat::any::max_size }
+sub used_size($) { &resize_fat::any::used_size }
-# resize
-# - size is in sectors
-# - checks boundaries before starting
-# - copies all data beyond new_cluster_count behind the frontier
+#- resize
+#- - size is in sectors
+#- - checks boundaries before starting
+#- - copies all data beyond new_cluster_count behind the frontier
sub resize {
my ($fs, $size) = @_;
my ($min, $max) = (min_size($fs), max_size($fs));
-
$size += $min if $size =~ /^\+/;
$size >= $min or die "Minimum filesystem size is $min sectors";
$size <= $max or die "Maximum filesystem size is $max sectors";
- log::l("resize_fat: Partition size fill be ", $size * $SECTORSIZE >> 20, "Mb (well exactly ${size} sectors)");
+ log::l("resize_fat: Partition size will be ". ($size * $SECTORSIZE >> 20) ."Mb (well exactly ${size} sectors)");
my $new_data_size = $size * $SECTORSIZE - $fs->{cluster_offset};
my $new_nb_clusters = divide($new_data_size, $fs->{cluster_size});
+ my $used_size = used_size($fs);
- log::l("resize_fat: Allocating new clusters");
- resize_fat::fat::allocate_remap($fs, $new_nb_clusters);
+ log::l("resize_fat: Break point for moving files is ". ($used_size * $SECTORSIZE >> 20) ." Mb ($used_size sectors)");
+ if ($size < $used_size) {
+ log::l("resize_fat: Allocating new clusters");
+ resize_fat::fat::allocate_remap($fs, $new_nb_clusters);
- log::l("resize_fat: Copying files");
- copy_clusters($fs, $new_nb_clusters);
+ log::l("resize_fat: Copying files");
+ copy_clusters($fs, $new_nb_clusters);
- log::l("resize_fat: Copying directories");
- construct_dir_tree($fs);
+ log::l("resize_fat: Copying directories");
+ construct_dir_tree($fs);
- log::l("Writing new FAT...");
- resize_fat::fat::update($fs);
- resize_fat::fat::write($fs);
+ log::l("Writing new FAT...");
+ resize_fat::fat::update($fs);
+ resize_fat::fat::write($fs);
+ } else {
+ log::l("resize_fat: Nothing need to be moved");
+ }
$fs->{nb_sectors} = $size;
$fs->{nb_clusters} = $new_nb_clusters;
- $fs->{clusters}->{count}->{free} =
- $fs->{nb_clusters} - $fs->{clusters}->{count}->{used} - $fs->{clusters}->{count}->{bad};
+ $fs->{clusters}{count}->{free} =
+ $fs->{nb_clusters} - $fs->{clusters}{count}->{used} - $fs->{clusters}->{count}->{bad} - 2;
$fs->{system_id} = 'was here!';
$fs->{small_nb_sectors} = 0;
@@ -144,9 +176,10 @@ sub resize {
resize_fat::boot_sector::write($fs);
- $resize_fat::isFAT32 and eval { resize_fat::info_sector::write($fs) }; # doesn't matter if this fails - its pretty useless!
+ $resize_fat::isFAT32 and eval { resize_fat::info_sector::write($fs) }; #- doesn't matter if this fails - its pretty useless!
sync();
+ close $fs->{fd};
log::l("resize_fat: done");
}
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index e4f2a7ef8..293910cb8 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -1,4 +1,4 @@
-package run_program;
+package run_program; # $Id$
use diagnostics;
use strict;
@@ -9,22 +9,53 @@ use log;
sub run($@) { rooted('', @_) }
-sub rooted($$@) {
+sub rooted {
my ($root, $name, @args) = @_;
+ my $str = ref $name ? $name->[0] : $name;
+ log::l("running: $str @args" . ($root ? " with root $root" : ""));
+
+ return 1 if $root && $<;
- log::l("running: $name @args" . ($root ? " with root $root" : ""));
$root ? $root .= '/' : ($root = '');
- fork and wait, return $? == 0;
+ if (my $pid = fork) {
+ waitpid $pid, 0;
+ return $? == 0;
+ }
{
+ my ($stdout, $stdoutm, $stderr, $stderrm);
+ ($stdoutm, $stdout, @args) = @args if $args[0] =~ /^>>?$/;
+ ($stderrm, $stderr, @args) = @args if $args[0] =~ /^2>>?$/;
+
open STDIN, "/dev/null" or die "can't open /dev/null as stdin";
- open STDERR, ">> /dev/tty5" or open STDERR, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";
- open STDOUT, ">> /dev/tty5" or open STDOUT, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";
+ if ($stderr) {
+ $stderrm =~ s/2//;
+ open STDERR, "$stderrm $root$stderr" or die "run_program can't output in $root$stderr (mode `$stderrm')";
+ } elsif ($::isInstall) {
+ open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die "run_program can't log, give me access to /tmp/ddebug.log";
+ }
+ if ($stdout) {
+ open STDOUT, "$stdoutm $root$stdout" or die "run_program can't output in $root$stdout (mode `$stdoutm')";
+ } elsif ($::isInstall) {
+ open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die "run_program can't log, give me access to /tmp/ddebug.log";
+ }
$root and chroot $root;
chdir "/";
- exec $name, @args or log::l("exec of $name failed: $!"), exit(-1);
+ if (ref $name) {
+ unless (exec { $name->[0] } $name->[1], @args) {
+ log::l("exec of $name->[0] failed: $!");
+ c::_exit(1);
+ }
+ } else {
+ unless (exec $name, @args) {
+ log::l("exec of $name failed: $!");
+ c::_exit(1);
+ }
+
+ }
}
+
}
diff --git a/perl-install/sbus_probing/main.pm b/perl-install/sbus_probing/main.pm
index fa40160ae..f3269e671 100644
--- a/perl-install/sbus_probing/main.pm
+++ b/perl-install/sbus_probing/main.pm
@@ -1,7 +1,9 @@
-package sbus_probing::main;
+package sbus_probing::main; # $Id$
use c;
use log;
+use common qw(:common);
+use modules;
my %sbus_table_network = (
hme => [ "Sun Happy Meal Ethernet", "sunhme" ],
@@ -64,13 +66,14 @@ my %sbus_table_video = (
1;
-#- update %sbus_probed according to SBUS detection.
+sub prom_getint($) { unpack "I", c::prom_getproperty($_[0]) }
+
+#- update $@sbus_probed according to SBUS detection.
sub prom_walk($$$$) {
my ($sbus_probed, $node, $sbus, $ebus) = @_;
- my ($prob_name, $prob_type) = (c::prom_getproperty("name"), c::prom_getproperty("device_type"));
+ my ($prob_name, $prob_type) = (c::prom_getstring("name"), c::prom_getstring("device_type"));
my ($nextnode, $nsbus, $nebus) = (undef, $sbus, $ebus);
- log::l("sbus probe at $node => $prob_name of type $prob_type on $sbus,$ebus");
#- probe for network devices.
if ($sbus && $prob_type eq 'network') {
$prob_name =~ s/[A-Z,]*(.*)/$1/;
@@ -96,9 +99,9 @@ sub prom_walk($$$$) {
#- probe for video devices.
if ($prob_type eq 'display' && ($sbus || $prob_name =~ /^(ffb|afb|cgfourteen)$/)) {
$prob_name =~ s/[A-Z,]*(.*)/$1/;
- my $ext = ($prob_name eq 'mgx' && c::prom_getint('fb_size') == 0x400000 && '_4M' ||
+ my $ext = ($prob_name eq 'mgx' && prom_getint('fb_size') == 0x400000 && '_4M' ||
$prob_name eq 'cgsix' && do {
- my ($chiprev, $vmsize) = (c::prom_getint('chiprev'), c::prom_getint('vmsize'));
+ my ($chiprev, $vmsize) = (prom_getint('chiprev'), prom_getint('vmsize'));
my $result = '';
$chiprev >= 1 && $chiprev <= 4 and $result = '_dbl';
$chiprev >= 5 && $chiprev <= 9 and $result = '_sgl';
@@ -107,10 +110,10 @@ sub prom_walk($$$$) {
$chiprev == 11 && !$result and $result = '_t';
$result;
} ||
- $prob_name eq 'leo' && c::prom_getproperty('model') =~ /501-2503/ && '_t' ||
- $prob_name eq 'tcx' && c::prom_getboot('tcx-8-bit') && '_8b' ||
- $prob_name eq 'afb' && sprintf "_btx%x", c::prom_getint('board_type') ||
- $prob_name eq 'ffb' && sprintf "_btx%x", c::prom_getint('board_type'));
+ $prob_name eq 'leo' && c::prom_getstring('model') =~ /501-2503/ && '_t' ||
+ $prob_name eq 'tcx' && c::prom_getbool('tcx-8-bit') && '_8b' ||
+ $prob_name eq 'afb' && sprintf "_btx%x", prom_getint('board_type') ||
+ $prob_name eq 'ffb' && sprintf "_btx%x", prom_getint('board_type'));
$sbus_table_video{$prob_name . $ext} ?
push @$sbus_probed, [ "VIDEO", @{$sbus_table_video{$prob_name . $ext}} ] :
@@ -124,33 +127,12 @@ sub prom_walk($$$$) {
$nextnode = c::prom_getsibling($node) and prom_walk($sbus_probed, $nextnode, $sbus, $ebus);
}
-sub check {
- my $ok = $_[0] !~ /unknown/;
- $ok or log::l("skipping $text, no module available (if you know one, please mail bugs\@linux-mandrake.com)");
- $ok
-}
-
-sub probe($) {
- my ($type) = @_;
-
- my $root_node = c::prom_open();
- my @l;
-
- prom_walk(\@l, $root_node, 0, 0);
- c::prom_close();
-
- $type eq '.' ? @l : map { [ @$_[1..$#$_] ] } grep { !$type || $_->[0] =~ /$type/i } @l;
-}
-
-sub matching_desc($;$) {
- my ($regexp) = @_;
-
+sub probe {
+ eval { modules::load("openprom") } if arch() =~ /sparc/;
my $root_node = c::prom_open();
my @l;
prom_walk(\@l, $root_node, 0, 0);
c::prom_close();
- grep { !$type || $_->[1] =~ /$regexp/ } @l;
+ map { my %l; @l{qw(type description drivers)} = @$_ } @l;
}
-
-sub list { map { "$_->[1] ($_->[0] $_->[2])" } probe('.'); }
diff --git a/perl-install/services.pm b/perl-install/services.pm
index 6e838cc05..319e4ff49 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -1,4 +1,4 @@
-package services;
+package services; # $Id$
use diagnostics;
use strict;
@@ -10,18 +10,18 @@ use common qw(:common :functional :system :file);
use commands;
use run_program;
-my %services = (
+sub description {
+ my %services = (
anacron => __("Anacron a periodic command scheduler."),
-apmd => __("apmd is used for monitoring batery status and logging it via
-syslog(8). It can also be used for shutting down the machine when the battery is
-low."),
+apmd => __("apmd is used for monitoring batery status and logging it via syslog.
+It can also be used for shutting down the machine when the battery is low."),
atd => __("Runs commands scheduled by the at command at the time specified when
at was run, and runs batch commands when the load average is low enough."),
crond => __("cron is a standard UNIX program that runs user-specified programs
at periodic scheduled times. vixie cron adds a number of features to the basic
UNIX cron, including better security and more powerful configuration options."),
gpm => __("GPM adds mouse support to text-based Linux applications such the
-Midnight Commander. Is also allows mouse-based console cut-and-paste operations,
+Midnight Commander. It also allows mouse-based console cut-and-paste operations,
and includes support for pop-up menus on the console."),
httpd => __("Apache is a World Wide Web server. It is used to serve HTML files
and CGI."),
@@ -30,8 +30,8 @@ variety of other internet services as needed. It is responsible for starting
many services, including telnet, ftp, rsh, and rlogin. Disabling inetd disables
all of the services it is responsible for."),
keytable => __("This package loads the selected keyboard map as set in
-/etc/sysconfig/keyboard. This can be selected using the kbdconfig utility. You
-should leave this enabled for most machines."),
+/etc/sysconfig/keyboard. This can be selected using the kbdconfig utility.
+You should leave this enabled for most machines."),
lpd => __("lpd is the print daemon required for lpr to work properly. It is
basically a server that arbitrates print jobs to printer(s)."),
named => __("named (BIND) is a Domain Name Server (DNS) that is used to resolve
@@ -57,7 +57,7 @@ random => __("Saves and restores system entropy pool for higher quality random
number generation."),
routed => __("The routed daemon allows for automatic IP router table updated via
the RIP protocol. While RIP is widely used on small networks, more complex
-routing protocls are needed for complex networks."),
+routing protocols are needed for complex networks."),
rstatd => __("The rstat protocol allows users on a network to retrieve
performance metrics for any machine on that network."),
rusersd => __("The rusers protocol allows users on a network to identify who is
@@ -68,40 +68,62 @@ syslog => __("Syslog is the facility by which many daemons use to log messages
to various system log files. It is a good idea to always run syslog."),
usb => __("This startup script try to load your modules for your usb mouse."),
xfs => __("Starts and stops the X Font Server at boot time and shutdown."),
-);
+ );
+ my ($name, $prefix) = @_;
+ my $s = $services{$name};
+ if ($s) {
+ $s = translate($s);
+ } else {
+ ($s = cat_("$prefix/etc/rc.d/init.d/$_")) =~ s/\\\s*\n#\s*//mg;
+ ($s) = $s =~ /^# description:\s+(.*?)^(?:[^#]|# {0,2}\S)/sm;
+ $s =~ s/^#\s*//m;
+ }
+ $s =~ s/\n/ /gm; $s =~ s/\s+$//;
+ $s;
+}
-sub drakxservices {
- my ($in, $prefix) = @_;
+#- returns:
+#--- the listref of installed services
+#--- the listref of "on" services
+sub services {
+ my ($prefix) = @_;
my $cmd = $prefix ? "chroot $prefix" : "";
- my @services = map { [/(\S+)/, /:on/ ] } sort `$cmd chkconfig --list`;
- my @l = map { $_->[0] } @services;
- my @before = map { $_->[1] } @services;
- my @descr = map {
- my $s = $services{$_};
- if ($s) {
- $s = translate($s);
- } else {
- ($s = cat_("$prefix/etc/rc.d/init.d/$_")) =~ s/\\\s*\n#\s*//mg;
- ($s) = $s =~ /^# description:\s+(.*?)^(?:[^#]|# {0,2}\S)/sm;
- $s =~ s/^#\s*//m;
- }
- $s =~ s/\n/ /gm; $s =~ s/\s+$//;
- $s;
- } @l;
+ my @l = map { [ /([^\s:]+)/, /\bon\b/ ] } grep { !/:$/ } sort `LANGUAGE=C $cmd chkconfig --list`;
+ [ map { $_->[0] } @l ], [ mapgrep { $_->[1], $_->[0] } @l ];
+}
- my $after = $in->ask_many_from_list_with_help("drakxservices",
- _("Choose which services should be automatically started at boot time"),
- \@l, \@descr, \@before) or return;
+sub ask {
+ my ($in, $prefix) = @_;
+ my ($l, $on_services) = services($prefix);
+ $in->ask_many_from_list("drakxservices",
+ _("Choose which services should be automatically started at boot time"),
+ {
+ list => $l,
+ help => sub { description($_, $prefix) },
+ values => $on_services,
+ sort => 1,
+ });
+}
- mapn {
- my ($name, $before, $after) = @_;
+sub doit {
+ my ($in, $on_services, $prefix) = @_;
+ my ($l, $was_on_services) = services($prefix);
+
+ foreach (@$l) {
+ my $before = member($_, @$was_on_services);
+ my $after = member($_, @$on_services);
if ($before != $after) {
- run_program::rooted($prefix, "chkconfig", $after ? "--add" : "--del", $name);
- if ($after && cat_("$prefix/etc/rc.d/init.d/$name") =~ /^#\s+chkconfig:\s+-/m) {
- #- `/sbin/runlevel` =~ /\s(\d+)/ or die "bad runlevel";
- #- $1 == 3 || $1 == 5 or log::l("strange runlevel: ``$1'' (neither 3 nor 5)");
- run_program::rooted($prefix, "chkconfig", "--level", "35", $name, "on");
+ my $script = "/etc/rc.d/init.d/$_";
+ run_program::rooted($prefix, "chkconfig", $after ? "--add" : "--del", $_);
+ if ($after && cat_("$prefix$script") =~ /^#\s+chkconfig:\s+-/m) {
+ run_program::rooted($prefix, "chkconfig", "--level", "35", $_, "on");
+ }
+ if (!$after && $::isStandalone) {
+ run_program::rooted($prefix, $script, "stop");
}
}
- } \@l, \@before, $after;
+ }
}
+
+
+1;
diff --git a/perl-install/share/aliases b/perl-install/share/aliases
index 516733eea..a5fa7def8 100644
--- a/perl-install/share/aliases
+++ b/perl-install/share/aliases
@@ -1,5 +1,8 @@
raidstop raidstart
sh ash
+gunzip gzip
install2 perl-install/install2
commands perl-install/commands
runinstall2 install2
+e2fsck e2fsck.shared
+fsck.ext2 e2fsck.shared
diff --git a/perl-install/share/compssList b/perl-install/share/compssList
index b4996d093..fcbd86d71 100644
--- a/perl-install/share/compssList
+++ b/perl-install/share/compssList
@@ -1,818 +1,1660 @@
-package beginner server developer
-adjtimex 0 100 95
-AfterStep 42 0 0
-afterstep-apps 0 0 0
-aktion 85 0 15
-am-utils 0 0 0
-anacron 70 0 98
-anonftp 50 100 0
-AnotherLevel 80 0 0
-apache 0 100 25
-apache-devel 37 0 25
-apmd 50 100 25
-arpwatch 0 0 0
-ash 70 100 100
-at 37 100 98
-audiofile 50 0 26
-audiofile-devel 50 0 26
-aumix 90 0 2
-authconfig 50 100 50
-autoconf 10 0 98
-autofs 0 0 50
-automake 10 0 98
-awesfx 90 0 0
-basesystem 95 100 100
-bash 95 100 99
-bash1 0 0 0
-bash-doc 0 0 75
-bc 20 0 25
-bdflush 99 100 0
-bdflush-lowmem 0 100 0
-BeroFTPD 0 100 10
-BeroList 0 100 0
-BeroList-CGI 0 100 0
-bin86 40 0 97
-bind 0 100 0
-bind-devel 0 0 0
-bind-utils 35 100 0
-binutils 50 0 95
-bison 10 0 90
-BitchX 0 0 0
-blt 0 0 85
-bootparamd 0 0 0
-byacc 50 0 90
-bzip2 68 100 85
-caching-nameserver 0 100 0
-cbb 15 0 0
-cdecl 10 0 70
-cdp 90 0 0
-cdparanoia 0 0 0
-cdrecord 0 0 0
-cdrecord-cdda2wav 0 0 0
-cdrecord-devel 0 0 0
-cervisia 0 0 0
-chkconfig 22 0 10
-chkfontpath 44 0 50
-chos 0 0 0
-chos-chos 0 0 0
-cleanfeed 0 100 0
-colorgcc 0 0 99
-comanche 0 80 0
-compat-glibc 0 0 99
-comstat 0 0 0
-console-tools 40 100 99
-control-center 78 0 10
-control-center-devel 25 0 10
-control-panel 91 0 0
-cpio 80 100 97
-cpp 50 0 98
-cproto 50 0 90
-cracklib 50 100 35
-cracklib-dicts 50 100 35
-crontabs 75 98 98
-ctags 50 0 90
-cvs 50 100 80
-cxhextris 0 0 0
-defrag 0 0 0
-desktop-backgrounds 90 0 0
-desktopcfg 100 0 0
-dev 99 100 100
-dhcp 0 100 0
-dhcpcd 0 100 0
-dialog 20 0 75
-diffstat 0 0 95
-diffutils 50 0 95
-dip 0 0 0
-dosemu 0 0 0
-dosemu-freedos 0 0 0
-dosfstools 0 0 0
-dump 0 0 95
-e2fsprogs 80 100 99
-e2fsprogs-devel 0 0 25
-econf 0 0 0
-ed 40 0 5
-ee 82 0 0
-efax 0 100 0
-eject 80 0 0
-ElectricFence 0 0 100
-elm 30 0 0
-emacs 40 0 85
-emacs-el 0 0 50
-emacs-leim 0 0 50
-emacs-nox 50 0 50
-emacs-X11 50 0 50
-enlightenment 75 0 0
-enlightenment-conf 75 0 0
-enscript 0 0 75
-esound 79 0 0
-esound-devel 25 0 0
-etcskel 95 100 0
-ethemes 0 0 0
-exmh 50 0 0
-expect 0 0 75
-faces 0 0 0
-faces-devel 25 0 0
-face-xface 0 0 0
-faq 75 0 0
-fbset 0 0 0
-fdutils 0 0 0
-fetchmail 25 100 0
-fetchmailconf 0 0 0
-file 50 0 98
-filesystem 95 100 99
-fileutils 75 100 99
-findutils 75 100 95
-finger 50 0 0
-flash 82 0 0
-flex 50 0 80
-fmirror 0 0 0
-fnlib 75 0 0
-fnlib-devel 25 0 0
-fortune-mod 95 100 0
-freeciv 92 0 0
-freetype 65 0 0
-freetype-devel 0 0 0
-fribidi 0 0 0
-ftp 75 0 0
-fvwm 75 0 0
-fvwm2 40 0 0
-fvwm2-icons 45 0 0
-fwois 0 0 0
-gaddr 56 0 0
-gated 0 100 0
-gatos 65 0 0
-gawk 50 0 95
-gcc-fr 0 0 0
-gd 75 0 75
-gdb 50 0 98
-gdbm 50 0 80
-gdbm-devel 50 0 80
-gd-devel 50 0 75
-gdm 70 0 0
-gedit 35 0 0
-gedit-devel 0 0 0
-genromfs 0 0 0
-gettext 10 0 75
-getty_ps 60 0 0
-gfcc 0 0 0
-gftp 75 0 0
-ghostscript 55 100 85
-ghostscript-fonts 0 100 85
-giftrans 0 0 75
-gimp 80 0 50
-gimp-data-extras 50 0 0
-gimp-devel 0 0 40
-gimp-libgimp 60 0 50
-gimp-manual 0 0 25
-git 70 0 0
-glade 0 0 70
-glib 45 0 100
-glib10 45 0 100
-glibc 75 100 100
-glibc-devel 40 0 99
-glibc-localedata 45 0 98
-glibc-profile 0 0 98
-glib-devel 50 0 98
-gmc 35 0 0
-gmp 18 0 75
-gmp-devel 0 0 75
-gnomba 0 0 0
-gnome-admin 0 0 60
-gnome-audio 80 0 60
-gnome-center 0 0 60
-gnome-core 80 0 60
-gnome-core-devel 0 0 60
-gnome-games 90 0 0
-gnome-games-devel 25 0 0
-gnome-guile 0 0 50
-gnome-guile-devel 0 0 50
-gnomehack 89 0 0
-gnomeicu 76 0 0
-gnome-libs 87 0 60
-gnome-libs-devel 25 0 60
-gnome-linuxconf 70 0 0
-gnome-media 80 0 0
-gnome-objc 50 0 40
-gnome-objc-devel 25 0 40
-gnome-pim 74 0 70
-gnome-pim-devel 25 0 70
-gnome-print 77 0 60
-gnome-print-devel 0 0 60
-gnome-toaster 0 0 0
-gnome-users-guide 75 0 0
-gnome-utils 86 0 50
-gnorpm 50 0 0
-gnotepad+ 42 0 40
-gnuchess 85 0 0
-gnumeric 0 0 0
-gnuplot 25 0 0
-gperf 0 0 90
-gpm 85 0 95
-gpm-devel 50 0 60
-g-print 0 0 0
-gqview 65 0 0
-grep 80 0 98
-groff 60 0 0
-groff-gxeditview 0 0 0
-grpmi 35 0 0
-gscript 0 0 0
-gsl 0 0 0
-gsu 50 0 0
-gtk+ 50 0 70
-gtk+-devel 25 0 70
-gtk-engines 40 0 70
-gtkglarea 0 0 0
-gtkszip 0 0 0
-gtop 85 0 0
-guavac 0 0 90
-guile 0 0 85
-guile-devel 0 0 85
-gv 65 0 0
-GXedit 0 0 60
-gzip 70 100 98
-hdparm 75 100 100
-helptool 75 0 0
-hexedit 0 0 95
-howot-croatian 0 0 0
-howto 75 0 0
-howto-chinese 0 0 0
-howto-french 0 0 0
-howto-german 0 0 0
-howto-greek 0 0 0
-howto-html 0 0 0
-howto-indonesian 0 0 0
-howto-italian 0 0 0
-howto-japanese 0 0 0
-howto-koeran 0 0 0
-howto-polish 0 0 0
-howto-serbian 0 0 0
-howto-sgml 0 0 0
-howto-slovenian 0 0 0
-howto-spanish 0 0 0
-howto-swedish 0 0 0
-howto-turkish 0 0 0
-ibtk 0 0 0
-ical 35 0 0
-iceconf 0 0 0
-icewm 80 0 0
-icewm-themes 62 0 0
-ImageMagick 0 0 65
-ImageMagick-devel 0 0 65
-imap 0 100 0
-imblib-cfgeditor 0 0 75
-imlib 50 0 75
-imlib-devel 25 0 50
-imwheel 85 0 0
-indent 40 0 97
-indexhtml 100 100 100
-inews 0 0 0
-info 95 0 0
-initscripts 100 100 100
-inn 0 100 20
-inn-devel 0 100 20
-install-guide 0 0 0
-interconfig 0 100 100
-intimed 0 100 0
-ipchains 0 100 0
-ipxutils 0 100 0
-irssi 79 0 0
-isapnptools 91 100 100
-isdn4k-utils 0 0 0
-isicom 0 0 0
-ispell 30 0 0
-ispell-francais 0 0 0
-ispell-rus 0 0 0
-itcl 0 0 65
-jed 0 0 0
-jed-common 0 0 0
-jed-xjed 0 0 0
-joe 0 0 0
-kaffe 0 0 50
-kapm 0 0 0
-kbatmon 0 0 0
-kBeroFTPD 0 100 0
-kblade 0 0 0
-kblindsel 0 0 0
-kcdwrite 0 0 0
-kcmclock 0 0 0
-kcmlaptop 1 0 0
-kcpumon 0 0 0
-kdbconfig 100 100 100
-kdbg 0 0 0
-kdeadmin 70 0 0
-kdebase 85 0 0
-kdegames 95 0 0
-kdegames 95 0 0
-kdegraphics 80 0 0
-kdelibs 75 0 0
-kdemultimedia 85 0 0
-kdenetwork 90 0 0
-kderadio 0 0 0
-kdesu 90 0 0
-kdesupport 75 0 0
-kdethemes 0 0 0
-kdetoys 57 0 0
-kdeutils 85 0 0
-kdevelop 0 0 0
-kdf 75 0 0
-kdiff 0 0 0
-kdiskcat 0 0 0
-kdpms 78 0 0
-keasycd 0 0 0
-kencoder 0 0 0
-kernekcfg 0 0 0
-kernel 99 100 100
-kernel-BOOT 0 0 0
-kernel-doc 0 0 75
-kernel-headers 0 0 99
-kernel-icbs 0 0 0
-kernel-pcmci-cs 0 0 0
-kernel-smp 0 0 0
-kernel-smp-fb 0 0 0
-kernel-source 0 0 99
-kfortune 94 0 0
-kfsstatus 0 0 0
-kfun21 0 0 0
-kgoldrunne 0 0 0
-kgoodstuff 0 0 0
-kgredit 0 0 0
-khotkeys 0 0 0
-khylafax 0 0 0
-killustrator 89 0 0
-kimon 0 0 0
-kinterruptinfo 0 0 0
-kisndload 0 0 0
-kjumpingcube 0 0 0
-kless 0 0 0
-klibreta 0 0 0
-klilo 0 0 0
-klyx 80 0 0
-kmag 0 0 0
-kmemmon 0 0 0
-kmol 0 0 0
-kmpg 80 0 0
-kmsgmodem 0 0 0
-knc 0 0 0
-knetload 0 0 0
-knewmail 0 0 0
-knfsd 40 0 0
-knfsd-clients 0 0 0
-knsbookmark 0 0 0
-korganizer 35 0 0
-kover 0 0 0
-kpackage 79 0 0
-kpacman 0 0 0
-kpilot 50 0 0
-kmpg3te 0 0 0
-kmpg3te-devel 0 0 0
-kpppload 49 0 0
-krubik 68 0 0
-ksendfax 11 0 0
-kshow 0 0 0
-kslide 0 0 0
-ksnuffle 0 0 0
-ksysctrl 0 0 0
-ktail 0 0 0
-kteatime 0 0 0
-ktelnet 75 0 0
-kterm 0 0 0
-kthememgr 0 0 0
-ktimemon 0 0 0
-ktop 0 0 0
-ktron 0 0 0
-kuickshow 0 0 0
-kvirc 0 0 0
-kvoice 11 0 0
-kweather 0 0 0
-kwvdial 0 0 0
-lbtrace 0 0 0
-ldconfig 0 0 98
-ld.so 70 0 98
-less 10 0 97
-lftp 0 0 0
-lha 0 0 80
-libc 30 100 85
-libelf 0 100 90
-libghttp 50 0 60
-libghttp-devel 25 0 60
-libglade 60 0 60
-libglade-devel 0 0 40
-libgr 80 0 75
-libgr-devel 25 0 70
-libgr-progs 55 0 0
-libgtop 87 0 60
-libgtop-devel 25 0 60
-libgtop-examples 0 0 55
-libjpeg 80 0 75
-libjpeg6a 0 0 75
-libjpeg-devel 25 0 70
-libmikmod 0 0 60
-libmikmod-devel 0 0 60
-libpcap 0 0 80
-libpng 75 0 75
-libpng-devel 25 0 75
-libPropList 60 0 90
-libstdc++ 50 0 90
-libstdc++-devel 0 0 90
-libtermcap 50 100 95
-libtermcap-devel 0 0 95
-libtiff 75 0 80
-libtiff-devel 25 0 80
-libtool 10 0 94
-libungif 80 0 80
-libungif-devel 25 0 80
-libungif-progs 0 0 0
-libunicode 0 0 90
-libxml 70 0 75
-libxml-devel 0 0 75
-lilo 98 100 100
-linuxconf 80 0 100
-linuxconf-devel 0 0 70
-linux_logo 80 0 0
-logrotate 75 100 100
-losetup 11 100 100
-lout 0 0 10
-lout-doc 0 0 10
-lpg 75 0 90
-lpr 75 100 100
-lrzsz 0 0 0
-lslk 0 0 0
-lsof 0 0 0
-lynx 10 100 80
-m4 5 0 90
-macutils 0 0 0
-mailcap 50 0 0
-mailx 50 100 0
-make 10 0 98
-MAKEDEV 90 100 100
-man 93 0 90
-mandrake_desk 97 0 0
-mandrake_doc 95 0 0
-mandrake-release 75 100 100
-MandrakeUpdate 85 0 0
-man-pages 75 0 80
-man-pages-cs 0 0 0
-man-pages-de 0 0 0
-man-pages-es 0 0 0
-man-pages-fr 0 0 0
-man-pages-it 0 0 0
-man-pages-ja 0 0 0
-man-pages-ko 0 0 0
-man-pages-pl 0 0 0
-man-pages-ru 0 0 0
-mars-nwe 0 0 0
-mawk 0 0 90
-maxwell 34 0 0
-mc 35 0 0
-mcserv 0 100 0
-Mesa 0 0 70
-Mesa-demos 0 0 60
-Mesa-devel 0 0 70
-metamail 50 100 50
-mgetty 10 0 0
-mgetty-sendfax 10 0 0
-mgetty-viewfax 10 0 0
-mgetty-voice 10 0 0
-mikmod 80 0 0
-mingetty 24 0 0
-minicom 0 0 0
-minigetty 0 0 0
-mirrordir 0 100 0
-mkbootdisk 66 0 0
-mkdosfs-ygg 0 0 0
-mkinitrd 50 0 0
-mkisofs 0 0 0
-mkkickstart 0 0 0
-mktemp 50 0 95
-mkxauth 70 100 0
-modemtool 75 0 0
-mod_perl 0 100 0
-mod_php3 0 100 0
-modutils 75 0 99
-mount 50 100 99
-mouseconfig 85 0 0
-mpage 50 0 90
-mpg123 95 0 0
-mswordview 0 0 0
-mtools 90 0 0
-mt-st 65 0 0
-multimedia 75 0 0
-mutt 60 0 0
-mxp 0 0 0
-mysql-share 0 0 0
-nag 0 0 25
-nc 0 0 0
-ncftp 75 0 0
-ncompress 70 100 97
-ncpfs 0 0 0
-ncurses 75 0 90
-ncurses-devel 25 0 90
-netcfg 75 0 0
-netkit-base 80 100 80
-netscape-common 90 0 0
-netscape-communicator 95 0 0
-netscape-navigator 0 0 0
-net-tools 50 100 90
-newt 60 0 85
-newt-devel 25 0 85
-nmh 50 0 0
-npxanim 90 0 0
-nscd 0 0 0
-ntsysv 70 0 0
-open 0 0 90
-ORBit 0 0 60
-ORBit-devel 0 0 60
-p2c 0 0 75
-p2c-devel 0 0 60
-pam 45 100 97
-passwd 70 100 98
-patch 80 0 80
-pciutils 0 0 0
-pdksh 0 0 0
-perl 60 100 90
-perlfitlib 0 0 0
-perl-GTK 0 0 80
-perl-MD5 0 100 85
-perl-Parse-RecDescent 0 0 85
-perl-PDL 0 0 85
-pgcc 60 0 95
-pgcc-c++ 60 0 93
-pgcc-g77 0 0 85
-pgcc-objc 60 0 85
-pidentd 0 100 95
-pilot-link 25 0 0
-pilot-link-devel 25 0 0
-pine 60 0 0
-playmidi 65 0 0
-playmidi-X11 0 0 0
-pmake 10 0 85
-pmake-custom 0 0 80
-popt 50 0 90
-portmap 32 100 0
-postfix 0 0 0
-postgresql 0 100 0
-postgresql-clients 0 0 0
-postgresql-devel 0 100 0
-postgresql-server 0 100 0
-postgresql-tcl 0 0 0
-ppp 0 0 0
-printtool 0 0 0
-procinfo 0 0 99
-procmail 35 100 0
-procps 75 0 0
-procps-X11 0 0 0
-psacct 0 0 95
-psmisc 80 0 90
-pump 40 0 0
-pwdb 49 0 85
-pws 0 0 0
-pygnome 0 0 50
-pygtk 0 0 50
-pygtk-libglade 0 0 50
-python-docs 0 0 40
-pythonlib 25 0 85
-qt 40 0 60
-qt-devel 25 0 60
-qt-qgl 0 0 50
-qt-qimgio 21 0 50
-qt-qxt 0 0 50
-quota 75 100 0
-raidtools 0 100 0
-rcs 40 0 75
-rdate 10 100 0
-rdist 10 100 0
-readline 50 0 70
-recode 0 0 80
-rgrep 0 0 85
-rhl-install-guide-en 0 0 0
-rhmask 0 0 0
-rhsound 50 0 0
-rhs-printfilters 0 100 0
-rmt 37 0 0
-rootfiles 75 100 0
-routed 50 100 0
-rpm 90 100 98
-rpm-devel 25 0 90
-rsh 75 100 85
-rsync 0 100 85
-rusers 50 0 0
-rwall 0 0 0
-rwho 50 0 0
-rxvt 09 0 100
-sag 65 0 25
-sahsh 0 0 0
-samba 0 100 0
-sane 75 0 0
-sane-devel 0 0 0
-screen 0 0 0
-sed 5 0 98
-sendmail 0 100 0
-sendmail.cf 0 100 0
-sendmail-doc 0 0 0
-setconsole 58 0 0
-setserial 80 0 0
-setup 80 0 0
-setuptoll 0 0 0
-sgml-tools 0 0 85
-shadow-utils 0 100 0
-shapecfg 0 0 0
-sharutils 75 100 0
-sh-utils 85 100 98
-slang 50 0 85
-slang-devel 25 0 70
-sliplogin 0 0 0
-slocate 75 100 90
-slrn 75 0 0
-sndconfig 40 0 0
-sox 82 100 90
-sox-devel 0 0 70
-space_sounds 65 0 0
-specspo 0 0 0
-squid 0 0 0
-stat 40 0 85
-statserial 0 0 0
-strace 50 0 95
-svgalib 94 0 75
-svgalib-devel 25 0 75
-svgatextmod 0 0 0
-swatch 0 0 0
-switchdesk-gnome 0 0 0
-switchdesk-kde 85 0 0
-sxitchdesk 0 0 0
-symlinks 0 0 0
-sysklogd 50 0 0
-SysVinit 99 100 100
-t1lib-devel 0 0 96
-talk 75 0 0
-taper 0 0 0
-tar 90 100 98
-tcl 60 0 70
-tclx 60 0 70
-tcpdump 0 85 0
-tcp_wrappers 50 100 0
-tcsh 70 0 0
-telnet 80 100 95
-telnet-server 80 100 0
-termcap 75 100 98
-tetex 15 0 50
-tetex-afm 15 0 40
-tetex-dvilj 15 0 40
-tetex-dvips 15 0 40
-tetex-latex 15 0 40
-texinfo 0 0 50
-textutils 50 100 90
-text-xdvi 0 0 50
-tftp 35 0 0
-thud 0 0 0
-time 50 0 95
-timeconfig 75 0 0
-timed 50 0 0
-timetool 85 0 0
-TiMidity++ 0 0 0
-timidity-instruments 0 0 0
-tin 65 0 0
-tix 60 0 65
-tk 60 0 65
-tkinter 60 0 65
-tksysv 75 0 65
-tmpwatch 46 100 0
-traceroute 20 100 0
-transfig 0 0 0
-tree 0 0 0
-trn 65 0 0
-trojka 70 0 0
-ttfonts 19 0 0
-tunelp 0 0 0
-ucd-snmp 0 0 85
-ucd-snmp-devel 0 0 85
-ucd-snmp-utils 0 0 85
-umb-scheme 0 0 85
-unarj 0 0 0
-unit 0 0 0
-unzip 90 100 97
-urlview 0 0 0
-urw-fonts 48 0 0
-usermode 80 0 0
-usernet 70 0 0
-utemper 0 0 0
-util-linux 90 100 98
-uucp 0 100 0
-vigmeup 0 0 0
-vim-common 5 100 0
-vim-enhanced 0 0 0
-vim-minimal 5 100 0
-vim-X11 0 0 0
-vixie-cron 75 100 99
-vlock 0 100 90
-vnc 0 0 0
-vnc-java 0 0 0
-vnc-server 0 0 0
-vnc-SVGALIB 0 0 0
-w3c-libwww 0 0 0
-w3c-libwww-apps 0 0 0
-w3c-libwww-devel 0 0 0
-wget 75 100 0
-which 75 0 99
-WindowMaker 85 0 0
-wine 0 0 0
-wine-debug 0 0 0
-wmakerconf 0 0 0
-wmconfig 75 0 0
-wmnet 20 0 0
-WMRack 0 0 0
-words 60 0 0
-wu-ftpd 0 100 0
-X11R6-contrib 75 0 75
-x3270 0 0 0
-xanim 75 0 0
-Xaw3d 65 0 70
-Xaw3d-devel 0 0 65
-xbanner 90 0 70
-xbill 97 0 0
-xboard 90 0 0
-xboing 85 0 0
-xcdroast 0 0 0
-xchat 70 0 0
-Xconfigurator 85 0 0
-xcpustate 0 0 0
-xdaliclock 0 0 0
-xdelta 0 0 0
-xdelta-devel 0 0 0
-xdosemu 0 0 0
-xearth 0 0 0
-xemacs 85 0 80
-xemacs-el 0 0 80
-xemacs-extras 85 0 68
-xemacs-info 0 0 50
-xemacs-mule 0 0 0
-xemacs-noX 0 0 0
-xemacs-static 0 0 0
-xemacs-X11 0 0 70
-xfce 0 0 0
-xfig 0 0 0
-xfishtank 0 0 0
-xfm 5 0 0
-XFree86 97 0 70
-XFree86-100dpi-fonts 70 0 70
-XFree86-75dpi-fonts 96 0 70
-XFree86-cyrillic-fonts 0 0 0
-XFree86-devel 0 0 60
-XFree86-doc 0 0 50
-XFree86-FBDev 0 0 0
-XFree86-ISO8859-2 0 0 0
-XFree86-ISO8859-2-100dpi-fonts 0 0 0
-XFree86-ISO8859-2-75dpi-fonts 0 0 0
-XFree86-ISO8859-2-Type1-fonts 0 0 0
-XFree86-ISO8859-9 0 0 0
-XFree86-ISO8859-9-100dpi-fonts 0 0 0
-XFree86-ISO8859-9-75dpi-fonts 0 0 0
-XFree86-libs 0 0 70
-XFree86-Mach64 0 0 0
-XFree86-VGA16 0 0 0
-XFree86-XF86Setup 0 0 0
-XFree86-xfs 0 0 70
-XFree86-Xnest 0 0 60
-XFree86-Xvfb 0 0 0
-xgammon 70 0 0
-xinitrc 65 0 70
-xjewel 70 0 0
-xkobo 89 0 0
-xlipstat 0 0 0
-xloadimage 0 0 0
-xlockmore 0 0 0
-xmailbox 70 0 0
-xmms 82 0 0
-xmms-devel 35 0 0
-xmms-esd 0 0 0
-xmms-gnome 0 0 0
-xmms-mikmod 65 0 0
-xmorph 85 0 0
-xntp3 0 0 0
-xosview 0 0 0
-xpaint 75 0 0
-xpat2 70 0 0
-xpdf 0 0 0
-xpilot 85 0 0
-xplorer 79 0 0
-xpm 66 0 69
-xpm-devel 25 0 61
-xpuzzles 70 0 0
-xrn 70 0 0
-xscreensaver 90 0 0
-xsoldier 0 0 0
-xsysinfo 0 0 61
-xtoolwait 0 0 0
-xtrojka 70 0 0
-xv 77 0 0
-xwpick 0 0 0
-xxgdb 0 0 0
-ypbind 20 0 0
-ypserv 0 0 0
-yp-tools 05 0 0
-ytalk 0 0 0
-yudit 0 0 0
-zgv 0 0 0
-zip 90 0 95
-zlib 75 0 98
-zlib-devel 25 0 80
-zsh 35 0 80
+ normal server developer
+
+AVLTree-devel 0 0 0
+AfterStep 22 0 53
+AfterStep-APPS 22 0 35
+Apache-ASP -99 0 -99
+ApacheJServ -99 0 -99
+Apple-StyleWriter-printer-driver__lpstyl 0 0 0
+Aurora 81 -1 -1
+BasiliskII 35 0 10
+BasiliskII-sheepnet 33 0 8
+BitchX 43 0 15
+C++2LaTeX 0 0 30
+Canon-CaPSL-printer-driver__cjet 0 0 0
+ClanLib 32 0 32
+ClanLib-devel 0 0 25
+ClanLib-docs 0 0 25
+ClanLib-gl 0 0 0
+ClanLib-magick 0 0 0
+ClanLib-mikmod 0 0 0
+ClanLib-png 0 0 0
+Device3Dfx -1 -1 -1
+DrakConf 84 84 84
+drakprofile 50 0 50
+draksync 50 0 50
+DrakeLogo 20 0 0
+ElectricFence 10 0 66
+Epplets 57 0 53
+Eterm 57 0 53
+Eterm-devel 0 0 0
+FaxMail 30 0 0
+FileRunner 45 0 25
+FreeWnn -20 -20 -20
+FreeWnn-devel -70 -60 -40
+GConf 0 0 0
+GConf-devel 0 0 40
+GXedit 40 0 55
+Glide_V2 -1 -1 -1
+Glide_V2-devel -1 -1 -1
+Glide_V3 -1 -1 -1
+Glide_V3-DRI -1 -1 -1
+Glide_V3-DRI-devel -1 -1 -1
+Glide_V3-devel -1 -1 -1
+Glide_V5 -1 -1 -1
+Glide_V5-devel -1 -1 -1
+HTML-Embperl 0 40 40
+Hermes 32 0 42
+Hermes-devel 0 0 35
+ImageMagick 56 5 60
+ImageMagick-devel 10 0 60
+ImageMagick-lib 0 0 0
+MAKEDEV 91 91 91
+MandrakeUpdate 82 0 80
+Mesa 30 0 70
+Mesa-common 30 0 70
+Mesa-common-devel 0 0 70
+Mesa-demos 10 0 15
+MySQL 2 55 15
+MySQL-bench 2 50 10
+MySQL-client 2 52 11
+MySQL-devel 0 0 15
+MySQL-shared 2 50 10
+ORBit 0 0 55
+ORBit-devel 10 0 55
+SDL 50 0 25
+SDL-devel 0 0 25
+SDL_image 0 0 25
+SDL_image-devel 0 0 25
+SDL_mixer 0 0 25
+SDL_mixer-devel 0 0 25
+SDL_net 0 0 25
+SDL_net-devel 0 0 25
+SDL_ttf 0 0 25
+SDL_ttf-devel 0 0 25
+SVGATextMode 0 0 0
+SmallEiffel 0 0 30
+SysVinit 15 52 45
+TiMidity++ 51 0 54
+WMRack 40 0 32
+WindowMaker 47 0 57
+WindowMaker-devel 0 0 30
+WsLib-devel 0 0 0
+X11R6-contrib 55 0 47
+XFree86 91 0 81
+XFree86-100dpi-fonts 56 0 30
+XFree86-3DLabs -30 -30 -30
+XFree86-75dpi-fonts 91 0 81
+XFree86-8514 -30 -30 -30
+XFree86-AGX -30 -30 -30
+XFree86-FBDev -30 -30 -30
+XFree86-I128 -30 -30 -30
+XFree86-ISO8859-2 -20 -30 -20
+XFree86-ISO8859-2-100dpi-fonts -20 -30 -20
+XFree86-ISO8859-2-75dpi-fonts -20 -30 -20
+XFree86-ISO8859-2-Type1-fonts -20 -30 -20
+XFree86-ISO8859-9 -20 -30 -20
+XFree86-ISO8859-9-100dpi-fonts -20 -30 -20
+XFree86-ISO8859-9-75dpi-fonts -20 -30 -20
+XFree86-Mach32 -30 -30 -30
+XFree86-Mach64 -30 -30 -30
+XFree86-Mach8 -30 -30 -30
+XFree86-Mono -30 -30 -30
+XFree86-P9000 -30 -30 -30
+XFree86-S3 -30 -30 -30
+XFree86-S3V -30 -30 -30
+XFree86-SVGA -30 -30 -30
+XFree86-VGA16 -30 -30 -30
+XFree86-W32 -30 -30 -30
+XFree86-Xnest 0 0 55
+XFree86-Xvfb 0 0 15
+XFree86-cyrillic-fonts -20 -30 -20
+XFree86-devel 12 0 55
+XFree86-doc -30 -30 -30
+XFree86-glide-module -2 -2 -2
+XFree86-libs 10 0 0
+XFree86-server -30 -30 -30
+XFree86-server-common -30 -30 -30
+XFree86-static-libs 0 0 20
+XFree86-xfs 0 0 0
+XaoS 40 0 25
+XaoS-aalib 0 0 0
+XaoS-svgalib 0 0 0
+Xaw3d 20 0 70
+Xaw3d-devel 10 0 60
+Zope 0 15 30
+Zope-components 0 15 30
+Zope-core 0 15 30
+Zope-pcgi 0 15 30
+Zope-services 0 15 30
+Zope-zpublisher 0 15 30
+Zope-zserver 0 15 30
+Zope-ztemplates 0 15 30
+aalib 25 0 15
+aalib-devel 0 0 25
+abisuite 59 0 45
+acon -10 -10 -10
+acpid 0 0 0
+adjtimex 22 35 87
+adns 30 30 30
+adns-devel 0 0 30
+aktion 66 0 15
+alsa 0 0 0
+alsa-lib 0 0 0
+alsa-lib-devel 0 0 20
+alsa-source 0 0 0
+alsa-utils 0 0 0
+alsaplayer 0 0 0
+am-utils 0 25 19
+ami -20 -20 -20
+ami-gnome -20 -20 -20
+anacron 85 70 85
+anonftp 0 86 13
+apache -99 80 -99
+apache-common -99 0 -99
+apache-devel -99 0 -99
+apache-manual -99 40 -99
+apache-mod_perl -99 85 -99
+apache-mod_perl-devel -99 0 -99
+apache-suexec -99 75 -99
+apcupsd -1 -1 -1
+apmd -1 -1 -1
+apmd-devel -1 -1 -1
+app-defaults-be -30 -30 -30
+app-defaults-cs -30 -30 -30
+app-defaults-ga -30 -30 -30
+app-defaults-ru -30 -30 -30
+app-defaults-th -30 -30 -30
+app-defaults-uk -30 -30 -30
+arpwatch 0 50 0
+ash 10 10 10
+aspell 49 15 22
+aspell-ca -30 -30 -30
+aspell-cs -30 -30 -30
+aspell-da -30 -30 -30
+aspell-de -30 -30 -30
+aspell-de_CH -30 -30 -30
+aspell-devel 0 0 10
+aspell-en -30 -30 -30
+aspell-en_CA -30 -30 -30
+aspell-en_GB -30 -30 -30
+aspell-eo -30 -30 -30
+aspell-es -30 -30 -30
+aspell-fr -30 -30 -30
+aspell-it -30 -30 -30
+aspell-nl -30 -30 -30
+aspell-no -30 -30 -30
+aspell-pl -30 -30 -30
+aspell-sv -30 -30 -30
+at 42 96 94
+aterm 17 0 13
+audiofile 25 0 26
+audiofile-devel 10 0 26
+aumix 79 0 79
+auth_ldap 5 75 20
+autoconf 15 0 84
+autofs 48 45 50
+autoirpm -60 -60 -60
+autologin 82 0 82
+automake 15 0 84
+awesfx 20 0 13
+basesystem 0 0 0
+bash 0 0 0
+bash-doc 35 50 71
+bash1 15 5 13
+bc 40 25 25
+bdflush 0 0 0
+bind 0 75 0
+bind-devel 0 0 0
+bind-utils 25 35 70
+binutils 47 0 87
+bison 10 0 80
+blackbox 33 0 45
+blt 10 0 75
+bluefish 60 0 60
+boa -99 -99 -99
+bonnie 5 45 25
+bonobo 20 0 20
+bonobo-devel 0 0 35
+bootparamd 20 78 0
+bug-buddy 0 0 20
+byacc 16 0 80
+bzflag -1 -1 -1
+bzip2 41 85 75
+caching-nameserver 0 70 0
+cbb 55 0 13
+cdecl 10 0 70
+cdialog 3 0 20
+cdp 40 0 27
+cdparanoia 45 0 45
+cdparanoia-devel 0 0 30
+cdrecord 45 0 45
+cdrecord-cdda2wav 44 0 45
+cdrecord-devel 10 0 0
+cervisia 0 0 0
+cfengine 0 30 0
+chkconfig 0 65 10
+chkfontpath 0 0 50
+chromium -1 -1 -1
+clanbomber 65 0 25
+cleanfeed 24 65 21
+clisp 0 0 15
+compat-glibc 0 0 40
+compat-libs 0 0 0
+comsat 0 30 2
+console-tools 97 97 97
+console-tools-devel 0 0 0
+control-center 69 0 10
+control-center-devel 0 0 0
+control-panel 2 0 2
+cooledit 0 0 30
+corewars 0 15 0
+cpio 90 89 90
+cproto 15 0 61
+cracklib 10 85 35
+cracklib-devel 0 0 15
+cracklib-dicts 10 82 35
+crontabs 95 95 95
+csmash -1 -1 -1
+ctags 10 0 80
+cttex -30 -30 -30
+cups -99 -99 -99
+cups-devel 0 0 20
+cups-drivers -99 -99 -99
+cvs 18 60 72
+cvsweb 0 0 30
+cxhextris 50 0 36
+detect 25 25 75
+detect-devel 0 0 60
+detect-lst 25 25 75
+dev 99 99 99
+dev86 0 0 40
+dev86-devel 0 0 40
+devfsd 0 0 0
+dhcp -99 80 -99
+dhcp-client 0 79 5
+dhcp-relay 0 10 0
+dhcpcd 0 0 0
+dhcpxd 0 0 0
+dia 30 0 30
+dialog 10 0 71
+diffstat 12 50 87
+diffutils 42 55 87
+dip 40 45 13
+docbook-dtd31-sgml 30 0 45
+docbook-style-dsssl 5 15 15
+docbook-style-dsssl-doc 4 14 14
+dosemu 45 0 49
+dosemu-freedos 45 0 49
+dosfstools 40 15 22
+doxygen 0 0 40
+dpsftp 45 0 0
+dpsftplib 45 0 0
+dpsftplib-devel 45 0 15
+drakfloppy 84 0 84
+drakfont 84 0 84
+drakxtools 86 80 87
+dump 10 75 87
+e2fsprogs 98 98 98
+e2fsprogs-devel 0 0 25
+eMusic 65 0 50
+ed 45 10 5
+ee 58 0 54
+efax 25 78 30
+egcs 5 0 50
+egcs-c++ 5 0 50
+egcs-cpp 5 0 50
+egcs-g77 5 0 50
+egcs-objc 5 0 50
+egcs-objc-devel 4 0 20
+eggdrop 25 0 25
+eject 92 33 91
+elm 22 5 13
+emacs 49 45 0
+emacs-X11 51 0 69
+emacs-el 0 0 15
+emacs-leim 20 0 50
+emacs-nox 20 0 14
+emacs-pcomplete 20 0 30
+emacs-tramp 20 20 30
+enlightenment 41 0 55
+enscript 20 25 71
+eog 30 0 20
+eperl 0 0 10
+eshell 20 0 30
+esound 0 0 0
+esound-devel 12 0 4
+etcskel 98 98 98
+ethemes 40 0 35
+exmh 40 0 36
+expect 23 0 71
+ext2ed 5 52 42
+ext2resize 5 52 42
+faces 20 75 15
+faces-devel 10 0 0
+faces-xface 20 0 15
+faq 63 49 53
+fbset 22 0 0
+fdutils 10 0 0
+fetchmail 45 99 31
+fetchmail-daemon 20 30 20
+fetchmailconf 45 0 40
+file 92 92 94
+filesystem 99 99 99
+fileutils 99 99 99
+findutils 97 97 97
+finger 40 35 27
+finger-server 0 30 0
+flex 13 0 72
+fltk 0 0 0
+fltk-devel 0 0 15
+fmirror 45 35 40
+fnlib 10 0 7
+fnlib-devel 10 0 0
+fonts-ttf-armenian -10 0 -10
+fonts-ttf-big5 -10 0 -10
+fonts-ttf-decoratives 72 0 68
+fonts-ttf-gb2312 -10 0 -10
+fonts-ttf-japanese -10 0 -10
+fonts-ttf-korean -10 0 -10
+fonts-ttf-west_european 77 0 74
+fonts-type1-baltic -15 -15 -15
+fortune-mod 10 0 10
+freeciv 54 0 53
+freetype 10 0 4
+freetype-devel 10 0 0
+fribidi 0 0 0
+fribidi-devel 0 0 0
+ftp 90 92 90
+fvwm 12 0 15
+fvwm2 17 0 17
+fvwm2-icons 17 0 17
+fwhois 25 45 36
+g-print 20 0 20
+g-wrap 0 0 40
+g-wrap-devel 0 0 20
+gaddr 45 0 40
+gaim 35 0 30
+gated 0 80 0
+gatos 55 0 49
+gawk 10 55 87
+gawk-doc 10 35 50
+gcc 50 40 90
+gcc-c++ 15 0 74
+gcc-chill 20 0 65
+gcc-colorgcc 0 0 0
+gcc-cpp 47 0 72
+gcc-fr 0 0 0
+gcc-g77 15 0 27
+gcc-java 16 0 65
+gcc-libgcj 15 0 30
+gcc-objc 16 0 35
+gcombust 40 0 0
+gd 12 0 71
+gd-devel 10 0 71
+gd-utils 45 0 64
+gdb 12 0 94
+gdbm 12 0 72
+gdbm-devel 10 0 72
+gdk-pixbuf 68 0 70
+gdk-pixbuf-devel 0 0 40
+gdm 67 0 55
+gedit 68 0 62
+gedit-devel 0 0 0
+genromfs 10 0 9
+gentoo 30 0 0
+gettext 10 15 71
+gettext-devel 0 0 35
+getty_ps 99 99 99
+gfcc 15 0 31
+gftp 67 0 62
+ggv 25 0 0
+ghc 0 0 35
+ghc-prof 0 0 2
+ghostscript 40 70 75
+ghostscript-utils 30 50 55
+ghostscript-fonts 22 55 75
+ghostscript-module-SVGALIB 10 0 63
+ghostscript-module-X 40 60 65
+gif2png 10 0 20
+giftrans 42 0 71
+gimp 69 0 67
+gimp-data-extras 55 0 58
+gimp-devel 10 0 40
+gimp-libgimp 10 0 50
+gimp-perl 30 0 30
+git 69 35 54
+gkrellm 15 30 15
+gkrellm-devel 0 0 20
+glade 17 0 57
+glademm 0 0 40
+glib 1 0 0
+glib-devel 10 0 87
+glibc 1 99 96
+glibc-devel 25 0 76
+glibc-profile 1 0 54
+gltron -1 -1 -1
+gmc 68 0 59
+gmp 17 0 71
+gmp-devel 10 0 71
+gnomba 24 0 24
+gnome-applets 68 0 55
+gnome-audio 60 0 55
+gnome-audio-extra 55 0 50
+gnome-chess 60 0 55
+gnome-core 68 0 55
+gnome-core-devel 10 0 55
+gnome-games 60 0 59
+gnome-games-devel 10 0 0
+gnome-guile 0 0 50
+gnome-guile-devel 10 0 50
+gnome-iconedit 60 0 55
+gnome-libs 68 0 55
+gnome-libs-devel 10 0 55
+gnome-linuxconf 74 0 74
+gnome-media 60 0 58
+gnome-network 60 0 58
+gnome-objc 0 0 40
+gnome-objc-devel 10 0 40
+gnome-pilot 55 0 45
+gnome-pilot-conduits 45 0 35
+gnome-pilot-devel 0 15 0
+gnome-pim 61 0 70
+gnome-pim-conduits 51 0 60
+gnome-pim-devel 10 0 70
+gnome-print 62 0 55
+gnome-print-devel 10 0 55
+gnome-tiles 60 0 55
+gnome-toaster 65 0 61
+gnome-users-guide 66 0 60
+gnome-utils 66 0 50
+gnome-vfs 0 0 0
+gnome-vfs-devel 0 0 30
+gnomeicu 61 0 58
+gnomemm 0 0 40
+gnomemm-devel 0 0 30
+gnorpm 74 0 71
+gnozip 50 0 60
+gnucash 35 0 15
+gnucash-devel 0 0 12
+gnuchess 40 0 31
+gnumeric 67 0 58
+gnuplot 65 0 53
+gnus 20 0 14
+gob 0 0 20
+gperf 12 0 72
+gphoto 60 0 58
+gpm 0 65 87
+gpm-devel 10 0 55
+gprolog 5 5 45
+gps 30 15 30
+gqcam 0 0 0
+gqview 55 0 49
+grep 0 92 94
+grip 60 0 35
+groff 0 0 62
+groff-for-man 0 0 0
+groff-gxditview 22 0 19
+groff-perl 0 0 0
+grpmi 0 0 0
+grub 99 99 99
+grub-doc 0 0 25
+gsl 10 0 0
+gsl-devel 0 0 0
+gsu 65 0 53
+gtk+ 0 0 70
+gtk+-devel 10 0 70
+gtk+licq 45 0 30
+gtk+mdk 0 0 15
+gtk+mdk-devel 0 0 15
+gtk-engines 0 0 70
+gtk-themes 50 0 20
+gtkdialogs 0 0 0
+gtkeyboard 20 0 0
+gtkglarea 10 0 15
+gtkglarea-devel 0 0 15
+gtkgo 15 0 5
+gtkgraph 65 0 35
+gtkhtml 0 0 0
+gtkhtml-devel 0 0 0
+gtkmm 20 0 55
+gtkmm-devel 20 0 55
+gtktalog 52 0 25
+gtkzip 60 0 58
+gtop 60 0 58
+gtulpas 10 0 10
+guile 11 0 75
+guile-devel 10 0 75
+gurpmi 82 0 86
+gv 55 0 49
+gzip 98 98 98
+hackkernel 0 0 0
+hackkernel-doc 0 0 0
+hackkernel-headers 0 0 0
+hackkernel-pcmcia-cs 0 0 0
+hackkernel-source 0 0 0
+happy 0 0 25
+harddrake 83 0 83
+haskell-GTK 0 0 10
+haskell-GTK-devel 0 0 10
+hdparm 98 98 98
+heartbeat -1 25 -1
+hexedit 91 91 91
+howto-html-de -30 -30 -30
+howto-html-el -30 -30 -30
+howto-html-en -30 -30 -30
+howto-html-es -30 -30 -30
+howto-html-fr -30 -30 -30
+howto-html-hr -30 -30 -30
+howto-html-id -30 -30 -30
+howto-html-it -30 -30 -30
+howto-html-ja -30 -30 -30
+howto-html-ko -30 -30 -30
+howto-html-pl -30 -30 -30
+howto-html-ro -30 -30 -30
+howto-html-sl -30 -30 -30
+howto-html-sv -30 -30 -30
+howto-html-zh -30 -30 -30
+howto-utils 0 0 0
+hugs98 0 0 15
+hylafax 0 0 0
+hylafax-client 0 0 0
+hylafax-server 0 0 0
+ibtk 20 0 13
+ical 40 0 27
+icepref 50 0 54
+icewm 65 0 78
+icewm-light 90 0 80
+imap 0 80 6
+imap-devel 0 0 6
+imlib 10 0 71
+imlib-cfgeditor 70 0 71
+imlib-devel 10 0 50
+imwheel 78 60 73
+indent 20 0 91
+indexhtml 0 87 76
+inews 6 12 15
+info 20 65 70
+info-install 0 0 10
+initscripts 99 99 99
+inn 0 55 0
+inn-devel 0 0 0
+intimed 0 55 10
+ipchains 15 98 13
+iplog 15 15 15
+iproute2 0 30 0
+ipvsadm 0 15 0
+ipxutils 20 85 9
+irda-utils -1 -1 -1
+irssi 59 0 57
+isapnptools 43 73 73
+isapnptools-devel 0 0 70
+isdn4k-utils 26 30 10
+isdn4net -99 -99 -99
+isicom 20 0 13
+ispell 49 15 22
+ispell-af -15 -15 -15
+ispell-br -15 -15 -15
+ispell-ca -15 -15 -15
+ispell-cs -15 -15 -15
+ispell-da -15 -15 -15
+ispell-de -15 -15 -15
+ispell-el -15 -15 -15
+ispell-en -15 -15 -15
+ispell-eo -15 -15 -15
+ispell-es -15 -15 -15
+ispell-fi -15 -15 -15
+ispell-fr -15 -15 -15
+ispell-ga -15 -15 -15
+ispell-gd -15 -15 -15
+ispell-gv -15 -15 -15
+ispell-id -15 -15 -15
+ispell-it -15 -15 -15
+ispell-nl -15 -15 -15
+ispell-no -15 -15 -15
+ispell-pl -15 -15 -15
+ispell-pt -15 -15 -15
+ispell-pt_BR -15 -15 -15
+ispell-ro -15 -15 -15
+ispell-ru -15 -15 -15
+ispell-sk -15 -15 -15
+ispell-sl -15 -15 -15
+ispell-sv -15 -15 -15
+itcl 10 0 60
+jadetex 15 0 45
+jed 16 18 14
+jed-common 0 18 0
+jed-xjed 40 0 22
+jikes 1 0 65
+joe 20 20 15
+kaffe 10 0 60
+kdbg 15 0 27
+kde1-compat 0 0 0
+kde1-compat-devel 0 0 0
+kdeaddutils 73 0 62
+kdeaddutils-devel 1 1 50
+kdeadmin 72 0 60
+kdebase 79 40 68
+kdebase-devel 1 1 60
+kdegames 71 0 59
+kdegraphics 77 40 66
+kdegraphics-devel 1 1 60
+kdelibs 0 0 0
+kdelibs-devel 1 1 60
+kdelibs-sound 60 0 55
+kdelibs-sound-devel 1 1 60
+kdemultimedia 77 0 66
+kdemultimedia-devel 1 1 60
+kdenetwork 72 0 60
+kdenetwork-devel 1 1 60
+kdepim 72 0 63
+kdesdk 0 0 35
+kdesupport 0 0 0
+kdesupport-devel 0 0 15
+kdetoys 70 0 65
+kdeutils 78 0 67
+kdiff 0 0 0
+kdiskcat 0 0 0
+kdoc 0 0 35
+kernel 99 99 99
+kernel-doc 5 50 65
+kernel-headers 1 45 94
+kernel-linus -1 -1 -1
+kernel-pcmcia-cs -1 -1 -1
+kernel-secure 0 0 0
+kernel-smp -1 -1 -1
+kernel-source 0 45 65
+kernel-utils 0 5 25
+kfilecoder 0 0 0
+kfirewall 0 0 0
+kfortune 0 0 0
+kfsstatus 0 0 0
+kfun21 0 0 0
+kimon 0 0 0
+kinput2-wnn4 -15 -15 -15
+kisocd 0 0 0
+kless 0 0 0
+klilo 0 0 0
+klyx 0 0 0
+kmag 0 0 0
+kmol 0 0 0
+kmp3 0 0 0
+kmp3te 0 0 0
+koffice 69 0 55
+koffice-devel 0 0 35
+kon2 -12 -60 -15
+kover 69 0 60
+kpacman 0 0 0
+kreglo 0 0 0
+krubik 0 0 0
+ksendfax 0 0 0
+kslide 0 0 0
+ktail 0 0 0
+ktelnet 0 0 0
+kterm -10 -90 -10
+kudzu 97 0 97
+kudzu-devel 0 0 43
+kups 60 0 50
+kups-devel 0 0 0
+kvideogen 0 0 0
+kvirc 69 0 56
+kvoice 0 0 0
+kvoicecontrol 0 0 0
+kwebget 0 0 0
+lame 15 40 35
+latex2html 25 0 50
+latte 0 0 45
+ld.so 98 98 98
+leafnode 0 50 0
+less 97 97 97
+lesstif 0 0 0
+lesstif-clients 0 0 0
+lesstif-devel 0 0 0
+lesstif-mwm 2 0 2
+lftp 50 78 83
+lha 40 25 72
+libPropList 10 0 80
+libPropList-devel 0 0 34
+libc 10 15 75
+libelf 10 15 80
+libghttp 10 0 55
+libghttp-devel 10 0 55
+libglade 10 0 55
+libglade-devel 10 0 40
+libgr 10 0 71
+libgr-devel 10 0 70
+libgr-progs 10 0 9
+libgtop 10 0 55
+libgtop-devel 10 0 55
+libjpeg 10 0 71
+libjpeg-devel 10 0 70
+libmikmod 10 0 55
+libmikmod-devel 10 0 55
+libnet 97 97 97
+libole2 0 0 0
+libole2-devel 0 0 0
+libpcap 10 80 72
+libpcap-devel 0 0 0
+libpng 10 0 71
+libpng-devel 10 0 71
+librep 10 0 50
+librep-devel 10 0 50
+libsafe 0 0 35
+libsigc++ 0 0 25
+libsigc++-devel 0 0 25
+libsigc++-examples 0 0 25
+libstdc++ 10 0 80
+libstdc++-compat 10 0 60
+libstdc++-devel 10 0 80
+libtabe -15 -90 -15
+libtabe-devel -15 -90 -15
+libtermcap 10 55 87
+libtermcap-devel 10 0 64
+libtiff 10 0 72
+libtiff-devel 10 0 72
+libtool 10 0 85
+libtool-devel 0 0 0
+libungif 10 0 72
+libungif-devel 10 0 72
+libungif-progs 10 0 2
+libunicode 10 0 80
+libunicode-devel 0 0 50
+libwmf 0 0 15
+libxml 10 0 71
+libxml-devel 10 0 71
+libxml2 10 0 71
+libxml2-devel 10 0 71
+licq 62 0 45
+licq-autoreply 45 0 30
+licq-console 45 0 30
+licq-devel 0 0 20
+licq-forwarder 45 0 30
+licq-rms 45 0 30
+licq-update-hosts 45 0 30
+lilo 99 99 99
+lilo-doc 0 0 30
+links 20 25 20
+linux_logo 92 72 92
+linuxconf 90 79 86
+linuxconf-gui -1 -1 -1
+linuxconf-lib 0 0 0
+linuxconf-util 0 0 0
+linuxconf 90 79 86
+linuxconf-devel 10 0 70
+lkmpg 2 0 65
+locales 96 76 96
+locales-af -1 -1 -1
+locales-ar -1 -1 -1
+locales-az -1 -1 -1
+locales-be -1 -1 -1
+locales-bg -1 -1 -1
+locales-br -1 -1 -1
+locales-ca -1 -1 -1
+locales-cs -1 -1 -1
+locales-cy -1 -1 -1
+locales-da -1 -1 -1
+locales-de -1 -1 -1
+locales-el -1 -1 -1
+locales-en -1 -1 -1
+locales-eo -1 -1 -1
+locales-es -1 -1 -1
+locales-et -1 -1 -1
+locales-eu -1 -1 -1
+locales-fa -1 -1 -1
+locales-fi -1 -1 -1
+locales-fo -1 -1 -1
+locales-ur -1 -1 -1
+locales-fr -1 -1 -1
+locales-ga -1 -1 -1
+locales-gd -1 -1 -1
+locales-gl -1 -1 -1
+locales-gv -1 -1 -1
+locales-he -1 -1 -1
+locales-hi -1 -1 -1
+locales-hr -1 -1 -1
+locales-hu -1 -1 -1
+locales-hy -1 -1 -1
+locales-id -1 -1 -1
+locales-is -1 -1 -1
+locales-it -1 -1 -1
+locales-ja -1 -1 -1
+locales-ka -1 -1 -1
+locales-kl -1 -1 -1
+locales-ko -1 -1 -1
+locales-kw -1 -1 -1
+locales-lo -1 -1 -1
+locales-lt -1 -1 -1
+locales-lv -1 -1 -1
+locales-mi -1 -1 -1
+locales-mk -1 -1 -1
+locales-ms -1 -1 -1
+locales-nl -1 -1 -1
+locales-no -1 -1 -1
+locales-oc -1 -1 -1
+locales-pd -1 -1 -1
+locales-ph -1 -1 -1
+locales-pl -1 -1 -1
+locales-pp -1 -1 -1
+locales-pt -1 -1 -1
+locales-ro -1 -1 -1
+locales-ru -1 -1 -1
+locales-sk -1 -1 -1
+locales-sl -1 -1 -1
+locales-sq -1 -1 -1
+locales-sr -1 -1 -1
+locales-sv -1 -1 -1
+locales-ta -1 -1 -1
+locales-tg -1 -1 -1
+locales-th -1 -1 -1
+locales-tr -1 -1 -1
+locales-tt -1 -1 -1
+locales-uk -1 -1 -1
+locales-vi -1 -1 -1
+locales-wa -1 -1 -1
+locales-yi -1 -1 -1
+locales-zh -1 -1 -1
+logrotate 0 25 15
+losetup 5 45 35
+lout 15 35 10
+lout-doc 31 32 10
+lpg 40 0 80
+lpr -99 -99 -99
+lrzsz 0 34 0
+lslk 20 49 54
+lsof 10 0 67
+ltrace 10 0 0
+lynx 42 78 84
+lyx 50 0 58
+m4 15 0 80
+macutils 22 5 19
+mailcap 5 5 4
+mailx 92 92 92
+make 50 50 94
+man 90 65 72
+man-pages 90 65 72
+man-pages-cs -10 -30 -25
+man-pages-de -10 -30 -25
+man-pages-es -10 -30 -25
+man-pages-fr -10 -30 -25
+man-pages-hu -10 -30 -25
+man-pages-id -10 -30 -25
+man-pages-it -10 -30 -25
+man-pages-ja -10 -30 -25
+man-pages-ko -10 -30 -25
+man-pages-pl -10 -30 -25
+man-pages-ru -10 -30 -25
+man-pages-zh -10 -30 -25
+mandrake-release 99 99 99
+mandrake_desk 88 0 88
+mandrake_doc-de -15 -90 -25
+mandrake_doc-en -15 -90 -25
+mandrake_doc-es -15 -90 -25
+mandrake_doc-fr -15 -90 -25
+mandrake_doc-it -15 -90 -25
+mandrake_doc-ru -15 -90 -25
+mars-nwe 0 35 0
+mathplot 30 0 20
+mawk 0 25 80
+mc 49 45 31
+mcserv 0 40 9
+mek 40 0 0
+memprof 2 5 65
+menu 90 0 80
+menudrake 79 75 75
+userdrake 50 0 40
+mercury 0 0 45
+metamail 40 80 50
+mgetty 24 20 9
+mgetty-contrib 28 20 15
+mgetty-sendfax 28 20 15
+mgetty-viewfax 28 20 15
+mgetty-voice 28 20 15
+mikmod 42 0 10
+mingetty 5 25 15
+minicom 27 0 4
+mirrordir 26 99 0
+mkbootdisk 35 55 60
+mkinitrd 99 99 99
+mkisofs 26 0 13
+mktemp 15 75 65
+mkxauth 2 99 1
+mm 0 0 15
+mm-devel 0 0 0
+mod_php -99 35 -99
+php-gd -99 15 -99
+php-imap -99 15 -99
+php-ldap -99 15 -99
+php-mysql -99 15 -99
+php-pgsql -99 15 -99
+php-oracle -99 15 -99
+php-dba_gdbm_db2 -99 15 -99
+php-readline -99 15 -99
+mod_ssl -99 75 -99
+mod_ssl-sxnet -99 30 -99
+modutils 99 99 99
+mon 0 40 0
+mount 97 97 97
+mouseconfig 0 0 0
+mozilla-fonts 0 0 0
+mp3info 50 20 50
+mpage 55 65 80
+mpeg_lib 0 0 0
+mpeg_lib-devel 0 0 30
+mpeg_lib-devel 0 0 0
+mpg123 42 0 42
+msec 98 98 98
+mt-st 40 0 49
+mtools 90 0 84
+mutt 10 0 10
+mxp 0 0 0
+nag 35 75 25
+nasm 20 20 65
+nasm-doc 0 20 65
+nasm-rdoff 0 20 65
+nc 0 0 0
+ncftp 55 0 49
+sftp 15 10 15
+ncompress 42 79 91
+ncpfs 0 0 0
+ncurses 0 0 80
+ncurses-extraterms 0 0 0
+ncurses-devel 10 0 75
+nedit 45 20 65
+net-tools 95 96 95
+netkit-base 82 99 82
+netscape-castellano -13 -30 -18
+netscape-catalan -13 -30 -18
+netscape-common 0 0 0
+netscape-communicator 78 60 73
+netscape-euskara -13 -30 -18
+netscape-francais -13 -30 -18
+netscape-japanese -13 -30 -18
+netscape-navigator 0 0 0
+netscape-polish -13 -30 -18
+netscape-russian -13 -30 -18
+netscape-spanish -13 -30 -18
+netscape-walon -13 -30 -18
+newt 10 0 75
+newt-devel 10 0 75
+nfs-utils -99 80 13
+nfs-utils-clients 23 75 23
+nist 55 0 45
+nmap 5 40 40
+nmap-frontend 5 40 40
+nmh 0 0 0
+nscd 0 40 0
+nss_ldap 0 55 25
+ntp -1 -1 -1
+ntsysv 0 65 25
+numlock -11 -11 -11
+oaf 0 0 0
+oaf-devel 0 0 0
+ocaml 0 0 35
+octave 0 0 30
+oggvorbis 30 10 20
+oggvorbis-devel 0 0 15
+oggvorbis-examples 0 0 15
+open 20 45 80
+openjade 5 15 15
+openldap 0 50 35
+openldap-devel 0 0 25
+openssl 0 0 0
+openssl-devel 0 0 0
+oregano 0 0 0
+p2c 10 0 71
+p2c-devel 10 0 55
+pam 7 99 91
+pam-devel 0 0 0
+pam-doc 0 50 50
+pan 22 0 0
+pango 10 0 10
+pango-devel 0 0 10
+parted 35 35 35
+parted-devel 0 0 35
+passwd 99 99 99
+patch 14 0 72
+pciutils 16 55 55
+pciutils-devel 0 0 20
+pdksh 10 25 9
+penguin-command 35 0 10
+perl 20 19 90
+perl-Apache-Filter 0 0 0
+perl-Apache-SSI 0 0 0
+perl-Apache-Session 0 0 0
+perl-Compress-Zlib 0 0 0
+perl-Convert-BER 0 0 0
+perl-DBI 10 0 65
+perl-DBIx-Recordset 0 0 0
+perl-DB_File 10 0 50
+perl-Data-ShowTable 10 0 50
+perl-Date-Calc 0 0 0
+perl-DateManip 0 0 0
+perl-Devel-Symdump 0 0 0
+perl-Digest-MD5 10 0 70
+perl-ExtUtils_F77 0 0 0
+perl-File-Tail 0 0 0
+perl-GTK 10 0 72
+perl-GTK-GLArea 10 0 70
+perl-GTK-GdkImlib 10 0 70
+perl-GTK-Glade 10 0 70
+perl-GTK-Gnome 10 0 70
+perl-GTK-GtkHTML 0 0 0
+perl-HTML-Clean 0 0 0
+perl-HTML-Parser 10 0 55
+perl-HTML-SimpleParse 10 0 50
+perl-IO-stringy 5 0 65
+perl-MIME-Base64 5 0 45
+perl-MIME-tools 5 0 50
+perl-MLDBM 0 0 0
+perl-MP3-Info 5 0 40
+perl-Magick 0 0 0
+perl-MailTools 5 0 50
+perl-Mon 0 0 0
+perl-Msgcat 5 0 50
+perl-Mysql 5 0 40
+perl-Net-Telnet 0 0 0
+perl-Net_SSLeay 0 0 0
+perl-PDL 10 0 75
+perl-PDL-doc 0 0 0
+perl-Parse-RecDescent 10 0 75
+perl-Parse-Yapp 0 0 0
+perl-Period 0 0 0
+perl-RPM 0 0 0
+perl-Storable 0 0 0
+perl-Term-Readline-Gnu 10 10 88
+perl-Tie-Cache 0 0 0
+perl-Time-HiRes 0 0 0
+perl-TimeDate 0 0 0
+perl-Tk 0 15 0
+perl-Tk-devel 0 0 0
+perl-Tk-doc 0 0 0
+perl-URI 5 0 50
+perl-XML-Parser 0 0 0
+perl-XML-XSLT 0 0 0
+perl-base 0 0 0
+perl-devel 0 0 30
+perl-libnet 10 10 80
+perl-libwww-perl 10 10 80
+perl-libxml-enno 0 0 0
+perl-libxml-perl 0 0 0
+perl-Array-RefElem 0 0 0
+perl-Data-DumpXML 0 0 0
+perl-ExtUtils-PerlPP 0 0 0
+perl-File-NCopy 0 0 0
+perl-Image-Size 0 0 0
+perl-Mail-Sendmail 0 0 0
+perl-Net-XWhois 0 0 0
+perl-XML-RSS 0 0 0
+perlftlib 10 0 0
+php 0 35 5
+php-devel 0 0 5
+php-manual 0 0 5
+pidentd 15 69 87
+pilot-link 40 0 27
+perl-PDA-Pilot 0 0 0
+pilot-link-devel 11 0 25
+pine 40 0 27
+pinfo 20 20 20
+pingus 40 0 10
+piranha 0 10 0
+piranha-docs 0 10 0
+piranha-gui 0 10 0
+playmidi 43 0 19
+playmidi-X11 53 0 20
+plugger 40 0 40
+pmake 22 0 75
+pmake-customs 12 0 72
+popt 10 0 80
+popt-devel 0 0 45
+portmap 0 91 19
+postfix 20 88 51
+postgresql 0 56 23
+postgresql-devel 0 0 23
+postgresql-jdbc 0 0 15
+postgresql-odbc 0 0 23
+postgresql-perl 0 0 23
+postgresql-python 0 0 5
+postgresql-server 0 56 23
+postgresql-tcl 0 0 23
+postgresql-test 0 0 23
+postgresql-tk 0 0 5
+ppp 0 0 0
+pppoe-linuxconf 0 0 0
+pptp-adsl-fr -99 -99 -99
+pptp-client -99 -99 -99
+procinfo 24 15 96
+procmail 2 65 45
+procps 98 98 98
+procps-X11 50 0 32
+procps-devel 0 0 0
+proftpd -99 -99 -99
+psacct 20 70 87
+psmisc 25 62 56
+pspell 0 0 0
+pspell-devel 0 0 0
+psutils 5 42 15
+pth 0 0 25
+pth-devel 0 0 15
+publib-devel 0 0 0
+pump 0 0 0
+pump-devel 0 0 0
+pwdb 13 90 75
+pwdb-devel 0 0 50
+pygnome 12 0 50
+pygnome-applet 10 0 30
+pygnome-capplet 10 0 30
+pygnome-libglade 10 0 30
+pygtk 13 0 50
+pygtk-glarea 15 0 25
+pygtk-libglade 16 0 50
+pysol 27 0 27
+python 15 0 74
+python-devel 0 0 65
+python-docs 31 0 40
+python-imaging 31 0 40
+pythonlib 17 0 75
+qcad 5 0 5
+qiv 78 0 70
+qt 0 0 55
+qt-devel 10 0 55
+qt-qgl 10 0 50
+qt-qimgio 10 0 50
+qt2 0 0 45
+qt2-devel 0 0 45
+qt2-doc 0 0 30
+qtcups 0 0 0
+qtcups-devel 0 0 0
+queso 0 25 35
+quota 42 85 37
+raidtools 25 85 4
+rcs 12 0 71
+rdate 10 80 9
+rdist 10 75 9
+readline 11 0 70
+readline-devel 11 0 65
+recode 10 0 72
+recode-devel 0 0 50
+reiserfs-utils 60 60 60
+rep-gtk 0 0 20
+rep-gtk-gnome 0 0 20
+rep-gtk-libglade 0 0 20
+rgrep 55 55 75
+rhs-printfilters 1 1 0
+rmt 24 0 24
+rocksndiamonds 35 0 10
+rootfiles 99 99 99
+routed 0 90 19
+rp-pppoe -99 -99 -99
+rpm 99 99 99
+rpm-build 45 45 70
+rpm-devel 10 0 80
+rpm-python 0 0 50
+rpmdrake 84 0 81
+rpmlint 10 10 60
+rpmtools 0 0 25
+rpmtools-compat 0 0 0
+rpmtools-devel 0 0 25
+rsh 46 99 75
+rsh-server -99 55 25
+rsync 20 99 75
+ruby 0 0 25
+ruby-doc 0 0 25
+ruby-extensions 0 0 25
+ruby-gtk 0 0 25
+rusers 20 0 20
+rute -50 -75 -60
+rwall -1 0 -1
+rwho -1 0 -1
+rxvt 49 0 80
+rxvt-CLE -10 -90 -10
+sag 39 35 25
+samba 21 99 23
+samba-client 55 56 50
+samba-common 0 0 0
+sane 45 0 53
+sane-devel 10 0 2
+sash 5 5 5
+sawfish 59 0 57
+sawfish-themer 15 0 15
+sawfish-themes 50 0 50
+screen 26 43 79
+sed 97 97 97
+sendmail -99 -99 -99
+sendmail-cf 0 0 0
+sendmail-doc 0 0 0
+setserial 42 0 55
+setup 15 25 15
+sfm 25 0 25
+sgml-common 5 15 15
+sgml-tools 5 15 15
+sh-utils 97 97 97
+shadow-utils 98 98 98
+shapecfg 20 75 8
+sharutils 43 99 38
+sketch 45 0 0
+slang 12 0 75
+slang-devel 10 0 70
+slang-doc 0 0 70
+slocate 99 99 99
+slrn 10 0 10
+slrn-pull 35 0 45
+smpeg 50 0 25
+smpeg-devel 0 0 25
+sndconfig 70 40 70
+sox 41 32 80
+sox-devel 13 0 70
+space_sounds 52 0 55
+spacecup -1 -1 -1
+spec-helper 0 0 35
+spellutils 0 0 0
+spruce 0 0 0
+squid 0 45 16
+stat 5 55 45
+statserial 15 0 13
+strace 11 0 87
+sudo 0 30 0
+svgalib 10 0 63
+svgalib-devel 10 0 63
+swatch 22 65 4
+swi-prolog 5 5 45
+swig 0 0 20
+swig-devel 0 0 10
+symlinks 23 75 29
+sympa -1 40 -1
+sysklogd 97 97 97
+t1lib 1 0 29
+t1lib-devel 10 0 40
+taipeifonts -10 0 -10
+talk 44 0 39
+talk-server 0 0 0
+taper 42 0 27
+tar 97 97 97
+tcl 12 0 70
+tcllib 0 0 0
+tclx 12 0 70
+tcp_wrappers 0 99 0
+tcp_wrappers-devel 0 0 0
+tcpdump 10 79 2
+tcsh 1 25 15
+telnet 90 79 92
+openssh 65 75 65
+openssh-server -99 35 -99
+openssh-clients 65 75 65
+openssh-askpass 0 0 0
+openssh-askpass-gnome 0 0 0
+gnupg 90 90 90
+telnet-server -99 28 -99
+termcap 98 98 98
+tetex 25 0 50
+tetex-afm 25 0 40
+tetex-doc 25 0 40
+tetex-dvilj 40 0 40
+tetex-dvips 25 0 40
+tetex-latex 25 0 40
+tetex-latex-heb -65 -90 -90
+tetex-xdvi 25 0 50
+texinfo 22 0 50
+textutils 99 99 99
+teyjus 0 0 35
+tftp 0 40 2
+tftp-server 0 40 2
+thud 0 0 0
+time 40 65 87
+timeconfig 55 80 60
+timed 40 70 36
+timetool 54 0 57
+timidity-instruments 51 0 54
+tin 44 0 39
+tix 15 0 60
+tk 15 0 60
+tkbabel 15 0 15
+tkcvs 15 0 15
+tkinter 15 0 60
+tksysv 55 0 60
+tmake 10 0 25
+tmpwatch 35 75 60
+traceroute 40 79 29
+transfig 16 0 14
+tree 40 25 10
+trn 46 0 41
+trophy 35 0 10
+tunelp 24 15 28
+tuxracer -1 -1 -1
+ucd-snmp 0 70 45
+ucd-snmp-devel 0 25 45
+ucd-snmp-utils 0 37 45
+umb-scheme 10 0 65
+unarj 40 45 16
+units 22 0 10
+unixODBC 0 0 0
+unzip 70 75 91
+urlview 43 0 47
+urpmi 95 95 95
+urw-fonts 50 0 34
+usbview 5 0 10
+usermode 51 0 58
+usernet 42 55 37
+utempter 90 0 73
+utempter-devel 0 0 0
+util-linux 98 98 98
+uucp 0 80 2
+uxcook 0 0 0
+vigmeup 23 0 11
+vim-X11 52 0 26
+vim-common 0 19 0
+vim-enhanced 46 78 83
+vim-minimal 98 98 98
+vimguide 30 0 25
+vixie-cron 97 97 97
+vlock 40 99 80
+vnc 44 0 39
+vnc-SVGALIB 43 0 38
+vnc-doc 38 35 33
+vnc-java 38 0 34
+vnc-server 0 40 28
+webmin 20 40 20
+wget 65 75 53
+which 1 25 25
+wine 54 0 57
+wine-devel 0 0 0
+wmakerconf 47 0 57
+wmnet 24 0 21
+words 47 85 42
+wu-ftpd -99 85 -99
+wv 55 0 54
+wv-devel 0 0 0
+x3270 1 0 0
+xa+cv -10 -20 -10
+xalf 68 0 55
+xanim 58 0 54
+xbanner 15 0 12
+xboard 54 0 48
+xboing 53 0 47
+xcdroast 59 0 53
+xchat 58 0 52
+xcin -10 -10 -10
+xcpustate 53 0 47
+xdaliclock 57 0 51
+xdelta 16 0 5
+xdelta-devel 10 0 2
+xdosemu 34 0 37
+xearth 53 0 56
+xemacs 57 0 0
+xemacs-el 0 0 15
+xemacs-extras 50 0 36
+xemacs-info 54 0 42
+xemacs-mule 0 0 0
+xfce 0 0 0
+xfig 39 0 33
+xfishtank 51 0 45
+xgammon 40 0 31
+xinetd 0 0 0
+xinetd-devel 0 0 0
+xinitrc 0 0 0
+xinput 10 0 30
+xjewel 58 0 52
+xkobo 57 0 51
+xli 65 0 60
+xlispstat 2 0 45
+xloadimage 45 0 30
+xlockmore 58 0 52
+xmailbox 53 0 47
+xmame 25 0 25
+xmess 25 0 15
+xmms 64 0 57
+xmms-devel 0 0 15
+xmms-esd 46 0 41
+xmms-gnome 62 0 52
+xmms-kjofol-skins 50 0 50
+xmms-mesa -1 -1 -1
+xmms-mikmod 43 0 38
+xmms-more-vis-plugins 55 0 55
+xmms-oggvorbis 64 0 57
+xmms-skins 60 0 55
+xmms-smpeg 50 0 45
+xmorph 52 0 44
+xmovie 55 0 35
+xntp3 0 75 31
+xoscope 10 0 10
+xosview 51 0 45
+xpaint 53 0 47
+xpat2 43 0 38
+xpcd 40 0 30
+xpcd-gimp 30 0 25
+xpcd-svga 0 0 0
+xpdf 57 0 51
+xpilot 59 0 53
+xpm 52 0 64
+xpm-devel 10 0 56
+xpp 60 0 50
+xpuzzles 50 0 43
+xrally 5 0 5
+xrn 55 0 49
+xscreensaver 68 0 55
+xscreensaver-gl -1 -1 -1
+xsoldier 51 0 45
+xsysinfo 55 0 56
+xterm 87 0 80
+xtoolwait 50 0 35
+xtraceroute 50 0 40
+xtrojka 51 0 45
+xwc 65 0 40
+xwpe 0 0 20
+xwpe-X11 0 0 20
+xwpick 55 0 49
+xxgdb 53 0 47
+yodl 0 0 0
+yp-tools 0 40 0
+ypbind 0 40 0
+ypserv 0 0 0
+ytalk 21 75 18
+yudit 50 0 38
+zgv 15 0 13
+zip 70 65 87
+zlib 16 60 94
+zlib-devel 10 0 72
+zsh 20 50 72
+zsh-doc 0 35 60
+jpilot 40 0 30
+jpilot-Mail 12 0 10
+jpilot-syncmal 12 0 10
+jpilot-plugin-devel 0 0 0
+Maelstrom 50 0 35
+auctex 5 0 5
+bcast 15 0 10
+mpeg2_movie 10 0 8
+bg5ps -10 -10 -10
+eroaster 55 0 45
+everybuddy 52 0 52
+jabber 0 30 0
+libjabber 0 0 0
+libjabber-devel 0 0 0
+gabber 35 10 20
+gdk-pixbuf-gnomecanvas 0 0 0
+gdk-pixbuf-loaders 0 0 0
+gdk-pixbuf-xlib 0 0 0
+htdig 20 0 15
+libxode 0 0 0
+libxode-devel 0 0 0
+libgnet 0 0 0
+libgnet-devel 0 0 0
+libetherx 0 0 0
+libetherx-devel 0 0 0
+screem 55 0 60
+portsentry 0 15 0
+ttfprint -10 -10 -10
+kde-i18n-Afrikaans -12 -51 -23
+kde-i18n-Basque -12 -51 -23
+kde-i18n-Brazil -12 -51 -23
+kde-i18n-Breton -12 -51 -23
+kde-i18n-British -12 -51 -23
+kde-i18n-Bulgarian -12 -51 -23
+kde-i18n-Catalan -12 -51 -23
+kde-i18n-Chinese -12 -51 -23
+kde-i18n-Chinese-Big5 -12 -51 -23
+kde-i18n-Croatian -12 -51 -23
+kde-i18n-Czech -12 -51 -23
+kde-i18n-Danish -12 -51 -23
+kde-i18n-Dutch -12 -51 -23
+kde-i18n-Esperanto -12 -51 -23
+kde-i18n-Estonian -12 -51 -23
+kde-i18n-Finnish -12 -51 -23
+kde-i18n-French -12 -51 -23
+kde-i18n-Galacian -12 -51 -23
+kde-i18n-German -12 -51 -23
+kde-i18n-Greek -12 -51 -23
+kde-i18n-Hebrew -12 -51 -23
+kde-i18n-Hungarian -12 -51 -23
+kde-i18n-Icelandic -12 -51 -23
+kde-i18n-Italian -12 -51 -23
+kde-i18n-Japanese -12 -51 -23
+kde-i18n-Korean -12 -51 -23
+kde-i18n-Lithuanian -12 -51 -23
+kde-i18n-Macedonian -12 -51 -23
+kde-i18n-Maori -12 -51 -23
+kde-i18n-Norwegian -12 -51 -23
+kde-i18n-Norwegian -12 -51 -23
+kde-i18n-Polish -12 -51 -23
+kde-i18n-Portuguese -12 -51 -23
+kde-i18n-Romanian -12 -51 -23
+kde-i18n-Russian -12 -51 -23
+kde-i18n-Serbian -12 -51 -23
+kde-i18n-Slovak -12 -51 -23
+kde-i18n-Slovenian -12 -51 -23
+kde-i18n-Spanish -12 -51 -23
+kde-i18n-Swedish -12 -51 -23
+kde-i18n-Tamil -12 -51 -23
+kde-i18n-Thai -12 -51 -23
+kde-i18n-Turkish -12 -51 -23
+kde-i18n-Ukrainian -12 -51 -23
+kde-i18n-Walloon -12 -51 -23
+kde-i18n-Welsh -12 -51 -23
+kde-i18n-Norwegian-Nynorsk -12 -51 -23
+linuxconf-lang-cn -35 -60 -35
+linuxconf-lang-cs -35 -60 -35
+linuxconf-lang-de -35 -60 -35
+linuxconf-lang-es -35 -60 -35
+linuxconf-lang-fi -35 -60 -35
+linuxconf-lang-fr -35 -60 -35
+linuxconf-lang-it -35 -60 -35
+linuxconf-lang-ko -35 -60 -35
+linuxconf-lang-no -35 -60 -35
+linuxconf-lang-pt -35 -60 -35
+linuxconf-lang-ro -35 -60 -35
+linuxconf-lang-ru-SU -35 -60 -35
+linuxconf-lang-se -35 -60 -35
+linuxconf-lang-sk -35 -60 -35
+linuxconf-lang-zh -35 -60 -35
+7colors 15 0 0
+ltris 28 0 0
+lbreakout 35 0 0
+fonts-hebrew-elmar -30 -30 -30
+kwintv 0 0 0
+xawtv 0 0 0
+xawtv-misc 0 0 0
+xawtv-radio 0 0 0
+wxxt 0 0 0
+wxxt-devel 0 0 0
+surfraw 0 0 0
+R-base 0 0 0
+gpa 20 0 0
+gnome-telnet 0 0 0
+quanta 32 0 24
+nslint 0 12 0
+logcheck 0 12 0
+kisdn-free 33 0 30
+
+# commercial
+ac3d 20 0 20
+acroread 24 15 24
+acroread-nppdf 24 15 24
+IglooFTP-PRO 20 20 20
+interbase 0 15 15
+interbase-docs 0 15 15
+civctp-demo 22 0 20
+compupic 19 0 19
+commercial-menu 50 40 50
+eus-demo 23 0 20
+myth2-demo 24 0 25
+macromedia-flash 45 15 45
+RealPlayer 27 15 27
+RealPlayer-rpnp 27 15 27
+scol 23 0 23
+avp-database 20 20 20
+avp-linux 20 20 20
+arkeia-arkc 0 20 0
+arkeia-client 20 0 20
+arkeia-gui 24 0 20
+arkeia-server-shareware 0 30 0
+Artstream 20 0 0
+citrix-icaclient-en -70 -70 -70
+citrix-icaclient-fr -70 -70 -70
+citrix-icaclient-ge -70 -70 -70
+citrix-icaclient-sp -70 -70 -70
+printpro 0 0 0
+printpro-agfa 0 0 0
+printpro-alps 0 0 0
+printpro-apple 0 0 0
+printpro-autologic 0 0 0
+printpro-calcomp 0 0 0
+printpro-canon 0 0 0
+printpro-digital 0 0 0
+printpro-efi 0 0 0
+printpro-encad 0 0 0
+printpro-epson 0 0 0
+printpro-hp 0 0 0
+printpro-ibm 0 0 0
+printpro-lexmark 0 0 0
+printpro-lhag 0 0 0
+printpro-linotronic 0 0 0
+printpro-nec 0 0 0
+printpro-oki 0 0 0
+printpro-otheram 0 0 0
+printpro-othernz 0 0 0
+printpro-qms 0 0 0
+printpro-seiko 0 0 0
+printpro-sony 0 0 0
+printpro-tektronix 0 0 0
+printpro-ti 0 0 0
+printpro-varityper 0 0 0
+printpro-xerox 0 0 0
+emumail4.0 0 20 0
+EnlightenDSMFree 0 24 0
+EnlightenDSMFree-dsa 0 24 0
+EnlightenDSMFree-gui 0 24 0
+ForteCE-FCS 0 0 30
+ViaVoice_Outloud_rtk 0 0 45
+ViaVoice_Outloud_sdk 0 0 45
+ViaVoice_runtime 0 0 45
+ViaVoice_sdk 0 0 45
+jdk-sun 0 0 35
+jdk-sun-doc 0 0 35
+jre-sun 20 0 35
+heretic2-demo 24 0 24
+heroes3-demo 24 0 24
+rt2-demo 24 0 24
+MainActor 24 0 0
+mupad 20 0 20
+mtv 24 0 24
+mtv-fullscreen-extension 15 0 15
+NetPartitioner 0 24 0
+omnimark 0 0 35
+rebol-core 0 0 30
+staroffice-de -64 -90 -64
+staroffice-en -64 -90 -64
+staroffice-fr -64 -90 -64
+staroffice-it -64 -90 -64
+staroffice-nl -64 -90 -64
+staroffice-pt -64 -90 -64
+staroffice-es -64 -90 -64
+staroffice-sv -64 -90 -64
+tina-base 20 0 10
+tina-lesstif 20 0 10
+tina-oracle80 0 0 0
+tina-oracle8i 0 0 0
+tina-server 0 20 0
+VMware 20 0 35
+VariCAD 24 0 24
+ViaVoice_runtime 26 0 26
+viavoicemenu 26 0 26
+kisdn 0 0 0
diff --git a/perl-install/share/compssUsers b/perl-install/share/compssUsers
index 2c82418f8..a141bb9aa 100644
--- a/perl-install/share/compssUsers
+++ b/perl-install/share/compssUsers
@@ -1,27 +1,96 @@
-Graphics Manipulation
- kde:multimedia:graphics
- multimedia:graphic
+KDE [icon=kde] [descr=The K Desktop Environment, the basic graphical environment with a collection of accompanying tools]
+ Graphical desktop/KDE
-KDE
- kde
+Gnome [icon=gnome] [descr=A graphical environment with user-friendly set of applications and desktop tools]
+ Graphical desktop/GNOME
+ Graphical desktop/Sawfish
+ +XFree86-75dpi-fonts
+ +fonts-ttf-west_european
-Gnome
- gnome
+Other Graphical Desktops [icon=windowmanager] [descr=Icewm, Window Maker, Enlightenment, Fvwm, etc]
+ Graphical desktop/Window Maker
+ Graphical desktop/Enlightenment
+ Graphical desktop/FVWM based
+ Graphical desktop/Icewm
+ Graphical desktop/Other
+ +XFree86
+ +XFree86-75dpi-fonts
-Mail/WWW/News Tools
- network:web
- network:mail
- network:usenet
+Internet Tools [icon=networking] [descr=Set of tools to read and send mail and news (pine, mutt, tin..) and to browse the Web]
+ Networking/WWW
+ Networking/Mail
+ Networking/News
+ Applications/Networking
-Games
- games
+Communication facilities [icon=chat] [descr=Chat (IRC or instant messaging) programs such as xchat, licq, gaim, and file transfer tools]
+ Communications
+ Networking/Chat
+ Networking/File transfer
+ Networking/IRC
+ Networking/Instant messaging
+ Network
-Multimedia Support
- multimedia:sound
- multimedia:video
+Office [icon=office] [descr=Office programs: wordprocessors (kword, abiword), spreadsheets (kspread, gnumeric), pdf viewers, etc]
+ Office
+ Publishing
+ Archiving/Cd burning
+ Applications
-Web Server
- daemons:network:http
+Multimedia [icon=multimedia] [descr=Sound and video playing/editing programs]
+ Sound
+ Video
+ Multimedia/sound
+ Applications/Sound
+ Applications/Multimedia
+
+Graphics Manipulation [icon=graphics] [descr=Graphics programs such as The Gimp]
+ Graphics
+
+Games [icon=arcade] [descr=Amusement programs: arcade, boards, strategy, etc]
+ Games
+
+Documentation [icon=documentation] [descr=Books and Howto's on Linux and Free Software]
+ Books
+
+Databases [icon=documentation] [descr=Databases clients and servers (mysql and postgresql)]
+ Databases
+ Applications/Databases
+
+Development C/C++ [icon=editors] [descr=C and C++ development libraries, programs and include files]
+ Development/C
+ Development/C++
+
+Development other [icon=editors] [descr=Python, Perl, libraries, tools]
+ Development/Python
+ Development/Libraries
+ Development/Databases
+ Development/Java
+ Development/Perl
+ Development/Tools
+ Development/Other
+
+Development applications [icon=editors] [descr=KDE, QT, Gnome, GTK+]
+ Development/Kernel
+ Development/KDE and QT
+ Development/GNOME and GTK+
+
+Console Tools [icon=terminals] [descr=editors, shells, file tools, terminals]
+ Editors
+ Terminals
+ Text tools
+ Shells
+ File tools
+ Networking/Remote access
+
+Utilities [icon=configuration] [descr=Archiving, emulators, monitoring]
+ Monitoring
+ Toys
+ Emulators
+ Accessibility
+ Archiving
+ Networking/Other
+ X11/Applications
+
+Sciences [icon=sciences] [descr=Scientific applications]
+ Sciences
-Network Management Workstation
- network:tools
diff --git a/perl-install/share/compssUsers.desktop b/perl-install/share/compssUsers.desktop
index 7418f4ea3..d82d4fcaf 100644
--- a/perl-install/share/compssUsers.desktop
+++ b/perl-install/share/compssUsers.desktop
@@ -1,38 +1,39 @@
-Other Graphical Desktops (Gnome, IceWM)
- Graphical desktop/GNOME
- Graphical desktop/Sawmill
- Graphical desktop/Icewm
- +XFree86-75dpi-fonts
- +fonts-ttf-west_european
+Office [icon=office] [descr=Office programs: wordprocessors (kword, abiword), spreadsheets (kspread, gnumeric), pdf viewers, etc]
+ Office
+
+Internet [icon=networking] [descr=Set of tools for mail, news, web, file transfer, and chat]
+ Networking
-Games
+Games [icon=amusement] [descr=Amusement programs: arcade, boards, strategy, etc]
Games
-Multimedia - Graphics
+Multimedia - Graphics [icon=graphics] [descr=Graphics programs such as The Gimp]
Graphics
-Multimedia - Sound
+Multimedia - Sound [icon=multimedia] [descr=Audio-related tools: mp3 or midi players, mixers, etc]
Sound
-Multimedia - Video
+Multimedia - Video [icon=video] [descr=Video players and editors]
Video
-Multimedia - CD Burning
+Multimedia - CD Burning [icon=cd_burning] [descr=Tools to create and burn CD's]
Archiving/Cd burning
-Internet
- Networking
+More Graphical Desktops (Gnome, IceWM) [icon=windowmanager] [descr=Gnome, Icewm, Window Maker, Enlightenment, Fvwm, etc]
+ Graphical desktop/GNOME
+ Graphical desktop/Sawmill
+ Graphical desktop/Icewm
+ +XFree86-75dpi-fonts
+ +fonts-ttf-west_european
-Personnal Information Management
+Personnal Information Management [icon=remote_access] [descr=Tools for your Palm Pilot or your Visor]
+jpilot
+pilot-link
+kde-pim
+gnome-pim
+gnome-pim-conduits
-Personnal Finance
+Personnal Finance [icon=sciences] [descr=Programs to manage your finance, such as gnucash]
+gnucash
+MoneyDance
-Office productivity
- Office
diff --git a/perl-install/share/diskdrake.rc b/perl-install/share/diskdrake.rc
index ffbf762b1..06bdee053 100644
--- a/perl-install/share/diskdrake.rc
+++ b/perl-install/share/diskdrake.rc
@@ -1,26 +1,23 @@
-binding "bind"
-{
- bind "m" {
- "clicked" ("Mount")
- }
-}
-
style "font"
{
- font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
+ fontset = "-*-*-medium-r-normal-*-8-*-*-*-*-*-iso8859-1,*-r-*"
}
-
-
style "red" = "font"
{
bg[NORMAL] = { 1.0, 0, 0 }
bg[PRELIGHT] = { 0.9, 0, 0 }
}
+style "darkred" = "font"
+{
+ bg[NORMAL] = { 0.7, 0, 0 }
+ bg[PRELIGHT] = { 0.6, 0, 0 }
+}
style "green" = "font"
{
bg[NORMAL] = { 0, 1.0, 0 }
bg[PRELIGHT] = { 0, 0.9, 0 }
+ fg[NORMAL] = { 0, 0, 0 }
}
style "blue" = "font"
{
@@ -30,10 +27,17 @@ style "blue" = "font"
style "white" = "font"
{
bg[NORMAL] = { 1.0, 1.0, 1.0 }
+ bg[PRELIGHT] = { 0.67, 0.67, 0.67 }
+ fg[NORMAL] = { 0, 0, 0 }
}
-widget "*PART_*" binding "bind"
-widget "*Linux*" style "red"
-widget "*Linux swap" style "green"
-widget "*DOS*" style "blue"
-widget "*Empty*" style "white"
+widget "*Linux*" style "red"
+widget "*Ext2*" style "red"
+widget "*ReiserFS*" style "darkred"
+widget "*Linux swap*" style "green"
+widget "*Swap*" style "green"
+widget "*FAT*" style "blue"
+widget "*SunOS*" style "blue"
+widget "*NT NTFS*" style "blue"
+widget "*Empty*" style "white"
+widget "*Other*" style "font"
diff --git a/perl-install/share/fonts.tar.bz2 b/perl-install/share/fonts.tar.bz2
index dea12bf63..97a1f71c2 100644
--- a/perl-install/share/fonts.tar.bz2
+++ b/perl-install/share/fonts.tar.bz2
Binary files differ
diff --git a/perl-install/share/install.rc b/perl-install/share/install.rc
index aa893579d..b86a22c29 100644
--- a/perl-install/share/install.rc
+++ b/perl-install/share/install.rc
@@ -1,22 +1,21 @@
-
-
-style "border"
+style "default-font"
{
- bg[NORMAL] = { 0, 0, 0 }
+ fontset = "-*-*-medium-r-normal-*-12-*-*-*-*-*-iso8859-15"
}
-style "steps"
+style "small-font"
{
- bg[NORMAL] = { 0, 0, 0 }
- fg[NORMAL] = { 1.0, 1.0, 1.0 }
+ fontset = "-*-*-medium-r-normal-*-8-*-*-*-*-*-iso8859-15"
}
-style "title"
+style "logo" = "background"
{
- bg[NORMAL] = { 0, 0.66, 1.0 }
-# fg[NORMAL] = { 1.0, 1.0, 1.0 }
+ # no background image
+ engine "pixmap" { image { function = FLAT_BOX } }
}
+widget "*" style "default-font"
+widget "Steps" style "steps"
+widget "*Steps*" style "small-font"
+widget "*logo*" style "logo"
-widget "*Title" style "title"
-widget "*Steps" style "steps"
diff --git a/perl-install/share/keyboards.tar.bz2 b/perl-install/share/keyboards.tar.bz2
index ffaad5100..df9bb563f 100644
--- a/perl-install/share/keyboards.tar.bz2
+++ b/perl-install/share/keyboards.tar.bz2
Binary files differ
diff --git a/perl-install/share/keymaps.tar.bz2 b/perl-install/share/keymaps.tar.bz2
index c5d5177cc..8ca03c137 100644
--- a/perl-install/share/keymaps.tar.bz2
+++ b/perl-install/share/keymaps.tar.bz2
Binary files differ
diff --git a/perl-install/share/keymaps_generate b/perl-install/share/keymaps_generate
index 29fd576fb..a2c461fb6 100755
--- a/perl-install/share/keymaps_generate
+++ b/perl-install/share/keymaps_generate
@@ -3,15 +3,16 @@
use lib "..";
use keyboard;
-system("rm -rf keymaps ; mkdir keymaps");
+my $dir = "keymaps/usr/share/keymaps";
+system("rm -rf keymaps ; mkdir -p keymaps/usr/share/keymaps");
foreach (keyboard::xmodmaps()) {
my $kmap = keyboard::keyboard2kmap($_);
- if (system("./kmap2bkmap $kmap > keymaps/$kmap.bkmap 2>/dev/null") != 0) {
+ if (system("./kmap2bkmap $kmap > $dir/$kmap.bkmap 2>/dev/null") != 0) {
warn "unknown kmap $kmap\n";
- unlink "keymaps/$kmap.bkmap";
+ unlink "$dir/$kmap.bkmap";
}
}
-system("tar cfI keymaps.tar.bz2 keymaps") == 0 or die;
+system("tar cfI keymaps.tar.bz2 -C keymaps usr") == 0 or die;
system("rm -rf keymaps");
diff --git a/perl-install/share/list b/perl-install/share/list
index 83ca02797..0794c4e7c 100644
--- a/perl-install/share/list
+++ b/perl-install/share/list
@@ -1,37 +1,130 @@
/bin/ash
+/bin/consolechars
+/bin/cpio
+/bin/gzip
+/lib/libnss_nis.so.2
+/lib/libnss_files.so.2
+/lib/libnss_dns.so.2
+/lib/libresolv.so.2
+/lib/libresolv.so.2.1
+/etc/protocols
+/etc/imrc
+/etc/im_palette.pal
+/sbin/badblocks
+/sbin/fdisk
+/sbin/insmod
+/sbin/mkraid
+/sbin/rmmod
/sbin/mke2fs
+/sbin/mkreiserfs
+/sbin/raidstart
+/usr/X11R6/lib/modules/xf86Wacom.so
+/usr/bin/bzip2
+/usr/bin/packdrake
+/usr/bin/perl
+/usr/lib/gconv/BIG5.so
+/usr/lib/gconv/EUC-JP.so
+/usr/lib/gconv/libGB.so
+/usr/lib/gconv/libKSC.so
+/usr/lib/gconv/EUC-KR.so
+/usr/lib/gconv/ISO8859-15.so
+/usr/lib/gconv/ISO8859-10.so
+/usr/lib/gconv/ISO8859-13.so
+/usr/lib/gconv/ISO8859-14.so
+/usr/lib/gconv/ISO8859-4.so
+/usr/lib/gconv/ISO8859-5.so
+/usr/lib/gconv/ISO8859-7.so
+/usr/lib/gconv/ISO8859-8.so
+/usr/lib/gconv/ISO8859-9.so
+/usr/lib/gconv/ISO8859-2.so
+/usr/lib/gconv/ISO8859-3.so
+/usr/lib/gconv/KOI8-U.so
+/usr/lib/gconv/TIS-620.so
+/usr/lib/gconv/ARMSCII-8.so
+/usr/lib/gconv/CP1251.so
+/usr/lib/gconv/VISCII.so
+/usr/lib/gconv/TCVN-5712.so
+/usr/lib/gconv/GEORGIAN-ACADEMY.so
+/usr/lib/gconv/GEORGIAN-PS.so
+/usr/lib/gconv/EUC-CN.so
+/usr/lib/gconv/ISO8859-6.so
+/usr/lib/gtk/themes/engines/libpixmap.so
+/usr/lib/gtk/themes/engines/libpixmap.la
+/usr/lib/libimlib-png.so
+/usr/lib/perl5/5.6.0/AutoLoader.pm
+/usr/lib/perl5/5.6.0/Carp.pm
+/usr/lib/perl5/5.6.0/Carp/Heavy.pm
+/usr/lib/perl5/5.6.0/Exporter.pm
+/usr/lib/perl5/5.6.0/Exporter/Heavy.pm
+/usr/lib/perl5/5.6.0/FileHandle.pm
+/usr/lib/perl5/5.6.0/SelectSaver.pm
+/usr/lib/perl5/5.6.0/SelfLoader.pm
+/usr/lib/perl5/5.6.0/Symbol.pm
+/usr/lib/perl5/5.6.0/Time/Local.pm
+/usr/lib/perl5/5.6.0/IO/Socket/INET.pm
+/usr/lib/perl5/5.6.0/IO/Socket/UNIX.pm
+/usr/lib/perl5/5.6.0/dumpvar.pl
+/usr/lib/perl5/5.6.0/warnings.pm
+/usr/lib/perl5/5.6.0/warnings/register.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/File/Glob.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/File/Glob/Glob.so
+/usr/lib/perl5/5.6.0/ARCH-linux/Config.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/Data/Dumper.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/DynaLoader.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/Errno.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/Fcntl.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/XSLoader.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/Fcntl/Fcntl.so
+/usr/lib/perl5/5.6.0/ARCH-linux/IO.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/IO/File.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/IO/Handle.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/IO/Seekable.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/IO/Select.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/IO/Socket.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/Socket.pm
+/usr/lib/perl5/5.6.0/ARCH-linux/_h2ph_pre.ph
+/usr/lib/perl5/5.6.0/ARCH-linux/asm/unistd.ph
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/Data/Dumper/Dumper.so
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/IO/IO.so
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/Socket/Socket.so
+/usr/lib/perl5/5.6.0/ARCH-linux/bits/syscall.ph
+/usr/lib/perl5/5.6.0/ARCH-linux/sys/syscall.ph
+/usr/lib/perl5/5.6.0/ARCH-linux/syscall.ph
+/usr/lib/perl5/5.6.0/ARCH-linux/auto/DynaLoader/dl_findfile.al
+/usr/lib/perl5/5.6.0/lib.pm
+/usr/lib/perl5/5.6.0/overload.pm
+/usr/lib/perl5/5.6.0/strict.pm
+/usr/lib/perl5/5.6.0/vars.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/Cmd.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/Config.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/FTP.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/FTP/A.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/FTP/I.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/FTP/dataconn.pm
+/usr/lib/perl5/site_perl/5.6.0/Net/Netrc.pm
+/usr/lib/perl5/site_perl/5.6.0/ARCH-linux/Gtk.pm
+/usr/lib/perl5/site_perl/5.6.0/ARCH-linux/Gtk/Types.pm
+/usr/lib/perl5/site_perl/5.6.0/ARCH-linux/auto/Gtk/Gtk.so
/usr/lib/rpm/rpmrc
-/usr/X11R6/bin/xmodmap
-/usr/X11R6/bin/XF86_VGA16
-/usr/X11R6/lib/X11/locale/compose.dir
-/usr/X11R6/lib/X11/locale/iso8859-1/Compose
-/usr/X11R6/lib/X11/locale/iso8859-1/XLC_LOCALE
-/usr/X11R6/lib/X11/locale/locale.alias
-/usr/X11R6/lib/X11/locale/locale.dir
-/usr/lib/perl5/5.00503/AutoLoader.pm
-/usr/lib/perl5/5.00503/Carp.pm
-/usr/lib/perl5/5.00503/Exporter.pm
-/usr/lib/perl5/5.00503/SelfLoader.pm
-/usr/lib/perl5/5.00503/Term/Cap.pm
-/usr/lib/perl5/5.00503/Term/ReadLine.pm
-/usr/lib/perl5/5.00503/diagnostics.pm
-/usr/lib/perl5/5.00503/dumpvar.pl
-/usr/lib/perl5/5.00503/i386-linux/Config.pm
-/usr/lib/perl5/5.00503/i386-linux/DynaLoader.pm
-/usr/lib/perl5/5.00503/i386-linux/Socket.pm
-/usr/lib/perl5/5.00503/i386-linux/auto/Socket/Socket.bs
-/usr/lib/perl5/5.00503/i386-linux/auto/Socket/Socket.so
-/usr/lib/perl5/5.00503/i386-linux/bits/syscall.ph
-/usr/lib/perl5/5.00503/i386-linux/sys/syscall.ph
-/usr/lib/perl5/5.00503/i386-linux/syscall.ph
-/usr/lib/perl5/5.00503/i386-linux/_h2ph_pre.ph
-/usr/lib/perl5/5.00503/i386-linux/asm/unistd.ph
-/usr/lib/perl5/5.00503/lib.pm
-/usr/lib/perl5/5.00503/perl5db.pl
-/usr/lib/perl5/5.00503/pod/perldiag.pod
-/usr/lib/perl5/5.00503/strict.pm
-/usr/lib/perl5/5.00503/vars.pm
-/usr/lib/perl5/site_perl/5.005/i386-linux/Gtk.pm
-/usr/lib/perl5/site_perl/5.005/i386-linux/Gtk/Types.pm
-/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Gtk/Gtk.bs
-/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Gtk/Gtk.so
+/usr/sbin/ext2resize
+/usr/sbin/rescuept
+/usr/share/icons/amusement_section.xpm
+/usr/share/icons/arcade_section.xpm
+/usr/share/icons/cd_burning_section.xpm
+/usr/share/icons/chat_section.xpm
+/usr/share/icons/default_section.xpm
+/usr/share/icons/documentation_section.xpm
+/usr/share/icons/gnome.xpm
+/usr/share/icons/graphics_section.xpm
+/usr/share/icons/kde.xpm
+/usr/share/icons/multimedia_section.xpm
+/usr/share/icons/development_section.xpm
+/usr/share/icons/networking_section.xpm
+/usr/share/icons/office_section.xpm
+/usr/share/icons/remote_access_section.xpm
+/usr/share/icons/sciences_section.xpm
+/usr/share/icons/video_section.xpm
+/usr/share/icons/windowmanager_section.xpm
+/usr/share/icons/editors_section.xpm
+/usr/share/icons/terminals_section.xpm
+/usr/share/icons/configuration_section.xpm
diff --git a/perl-install/share/list.alpha b/perl-install/share/list.alpha
index cdcd669c5..81f7dcb0c 100644
--- a/perl-install/share/list.alpha
+++ b/perl-install/share/list.alpha
@@ -1,71 +1,6 @@
-/bin/ash
-/bin/cpio
-/lib/libnss_nis.so.2
-/lib/libnss_files.so.2
-/lib/libnss_dns.so.2
-/lib/libresolv.so.2
-/etc/protocols
-/sbin/fdisk
-/sbin/ifport
-/sbin/insmod
-/sbin/mkraid
-/sbin/rmmod
-/sbin/mkdosfs
-/sbin/mke2fs
-/sbin/raidstart
-/usr/bin/bzip2
-/usr/bin/perl
-/usr/lib/libimlib-png.so
-/usr/lib/gtk/themes/engines/libpixmap.so
-/usr/lib/gtk/themes/engines/libpixmap.la
-/usr/lib/libimlib-png.so
-/usr/lib/perl5/5.00503/AutoLoader.pm
-/usr/lib/perl5/5.00503/Carp.pm
-/usr/lib/perl5/5.00503/Data/Dumper.pm
-/usr/lib/perl5/5.00503/Exporter.pm
-/usr/lib/perl5/5.00503/FileHandle.pm
-/usr/lib/perl5/5.00503/SelectSaver.pm
-/usr/lib/perl5/5.00503/SelfLoader.pm
-/usr/lib/perl5/5.00503/Symbol.pm
-/usr/lib/perl5/5.00503/Time/Local.pm
-/usr/lib/perl5/5.00503/dumpvar.pl
-/usr/lib/perl5/5.00503/alpha-linux/Config.pm
-/usr/lib/perl5/5.00503/alpha-linux/DynaLoader.pm
-/usr/lib/perl5/5.00503/alpha-linux/Fcntl.pm
-/usr/lib/perl5/5.00503/alpha-linux/auto/Fcntl/Fcntl.bs
-/usr/lib/perl5/5.00503/alpha-linux/auto/Fcntl/Fcntl.so
-/usr/lib/perl5/5.00503/alpha-linux/IO/File.pm
-/usr/lib/perl5/5.00503/alpha-linux/IO/Handle.pm
-/usr/lib/perl5/5.00503/alpha-linux/IO/Seekable.pm
-/usr/lib/perl5/5.00503/alpha-linux/IO/Socket.pm
-/usr/lib/perl5/5.00503/alpha-linux/Socket.pm
-/usr/lib/perl5/5.00503/alpha-linux/_h2ph_pre.ph
-/usr/lib/perl5/5.00503/alpha-linux/asm/unistd.ph
-/usr/lib/perl5/5.00503/alpha-linux/auto/Data/Dumper/Dumper.bs
-/usr/lib/perl5/5.00503/alpha-linux/auto/Data/Dumper/Dumper.so
-/usr/lib/perl5/5.00503/alpha-linux/auto/IO/IO.so
-/usr/lib/perl5/5.00503/alpha-linux/auto/Socket/Socket.bs
-/usr/lib/perl5/5.00503/alpha-linux/auto/Socket/Socket.so
-/usr/lib/perl5/5.00503/alpha-linux/bits/syscall.ph
-/usr/lib/perl5/5.00503/alpha-linux/sys/syscall.ph
-/usr/lib/perl5/5.00503/alpha-linux/syscall.ph
-/usr/lib/perl5/5.00503/lib.pm
-/usr/lib/perl5/5.00503/overload.pm
-/usr/lib/perl5/5.00503/strict.pm
-/usr/lib/perl5/5.00503/vars.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Gtk.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Gtk/Types.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/Cmd.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/Config.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/FTP.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/FTP/A.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/FTP/I.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/FTP/dataconn.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/Net/Netrc.pm
-/usr/lib/perl5/site_perl/5.005/alpha-linux/auto/Gtk/Gtk.bs
-/usr/lib/perl5/site_perl/5.005/alpha-linux/auto/Gtk/Gtk.so
-/usr/lib/rpm/rpmrc
-/usr/X11R6/bin/XF86_FBDev
/usr/X11R6/bin/XF86_3DLabs
+/usr/X11R6/bin/XF86_SVGA
/usr/X11R6/bin/XF86_TGA
+/usr/X11R6/bin/XF86_S3
+/usr/X11R6/bin/XF86_Mach64
/usr/X11R6/bin/xmodmap
diff --git a/perl-install/share/list.i386 b/perl-install/share/list.i386
index af684bd7b..9575f3896 100644
--- a/perl-install/share/list.i386
+++ b/perl-install/share/list.i386
@@ -1,2 +1,6 @@
+/sbin/ifport
+/sbin/mkdosfs
+/sbin/resize_reiserfs
/usr/X11R6/bin/XF86_FBDev
/usr/X11R6/bin/XF86_VGA16
+/usr/X11R6/bin/xmodmap
diff --git a/perl-install/share/list.ppc b/perl-install/share/list.ppc
index 29669351b..3d1c38a02 100644
--- a/perl-install/share/list.ppc
+++ b/perl-install/share/list.ppc
@@ -1,2 +1,7 @@
-/usr/X11R6/bin/XF68_FBDev
-/usr/X11R6/bin/xmodmap
+/usr/bin/hformat
+/usr/bin/hmount
+/usr/bin/humount
+/usr/bin/hattrib
+/usr/bin/hcopy
+/usr/bin/hcd
+/sbin/pdisk
diff --git a/perl-install/share/list.sparc b/perl-install/share/list.sparc
index d35feefa2..16fb13a44 100644
--- a/perl-install/share/list.sparc
+++ b/perl-install/share/list.sparc
@@ -13,61 +13,72 @@
/sbin/mkdosfs
/sbin/mke2fs
/sbin/raidstart
+/sbin/losetup
+/usr/bin/genromfs
/usr/bin/bzip2
/usr/bin/perl
/usr/lib/libimlib-png.so
/usr/lib/gtk/themes/engines/libpixmap.so
/usr/lib/gtk/themes/engines/libpixmap.la
/usr/lib/libimlib-png.so
-/usr/lib/perl5/5.00503/AutoLoader.pm
-/usr/lib/perl5/5.00503/Carp.pm
-/usr/lib/perl5/5.00503/Data/Dumper.pm
-/usr/lib/perl5/5.00503/Exporter.pm
-/usr/lib/perl5/5.00503/FileHandle.pm
-/usr/lib/perl5/5.00503/SelectSaver.pm
-/usr/lib/perl5/5.00503/SelfLoader.pm
-/usr/lib/perl5/5.00503/Symbol.pm
-/usr/lib/perl5/5.00503/Time/Local.pm
-/usr/lib/perl5/5.00503/dumpvar.pl
-/usr/lib/perl5/5.00503/sparc-linux/Config.pm
-/usr/lib/perl5/5.00503/sparc-linux/DynaLoader.pm
-/usr/lib/perl5/5.00503/sparc-linux/Fcntl.pm
-/usr/lib/perl5/5.00503/sparc-linux/auto/Fcntl/Fcntl.bs
-/usr/lib/perl5/5.00503/sparc-linux/auto/Fcntl/Fcntl.so
-/usr/lib/perl5/5.00503/sparc-linux/IO/File.pm
-/usr/lib/perl5/5.00503/sparc-linux/IO/Handle.pm
-/usr/lib/perl5/5.00503/sparc-linux/IO/Seekable.pm
-/usr/lib/perl5/5.00503/sparc-linux/IO/Socket.pm
-/usr/lib/perl5/5.00503/sparc-linux/Socket.pm
-/usr/lib/perl5/5.00503/sparc-linux/_h2ph_pre.ph
-/usr/lib/perl5/5.00503/sparc-linux/asm/unistd.ph
-/usr/lib/perl5/5.00503/sparc-linux/asm-sparc/unistd.ph
-/usr/lib/perl5/5.00503/sparc-linux/asm-sparc64/unistd.ph
-/usr/lib/perl5/5.00503/sparc-linux/auto/Data/Dumper/Dumper.bs
-/usr/lib/perl5/5.00503/sparc-linux/auto/Data/Dumper/Dumper.so
-/usr/lib/perl5/5.00503/sparc-linux/auto/IO/IO.so
-/usr/lib/perl5/5.00503/sparc-linux/auto/Socket/Socket.bs
-/usr/lib/perl5/5.00503/sparc-linux/auto/Socket/Socket.so
-/usr/lib/perl5/5.00503/sparc-linux/bits/syscall.ph
-/usr/lib/perl5/5.00503/sparc-linux/sys/syscall.ph
-/usr/lib/perl5/5.00503/sparc-linux/syscall.ph
-/usr/lib/perl5/5.00503/lib.pm
-/usr/lib/perl5/5.00503/overload.pm
-/usr/lib/perl5/5.00503/strict.pm
-/usr/lib/perl5/5.00503/vars.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Gtk.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Gtk/Types.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/Cmd.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/Config.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/FTP.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/FTP/A.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/FTP/I.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/FTP/dataconn.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/Net/Netrc.pm
-/usr/lib/perl5/site_perl/5.005/sparc-linux/auto/Gtk/Gtk.bs
-/usr/lib/perl5/site_perl/5.005/sparc-linux/auto/Gtk/Gtk.so
+/usr/lib/perl5/5.6.0/AutoLoader.pm
+/usr/lib/perl5/5.6.0/Carp.pm
+/usr/lib/perl5/5.6.0/sparc-linux/Data/Dumper.pm
+/usr/lib/perl5/5.6.0/Exporter.pm
+/usr/lib/perl5/5.6.0/Carp/Heavy.pm
+/usr/lib/perl5/5.6.0/Exporter/Heavy.pm
+/usr/lib/perl5/5.6.0/FileHandle.pm
+/usr/lib/perl5/5.6.0/SelectSaver.pm
+/usr/lib/perl5/5.6.0/SelfLoader.pm
+/usr/lib/perl5/5.6.0/Symbol.pm
+/usr/lib/perl5/5.6.0/Time/Local.pm
+/usr/lib/perl5/5.6.0/dumpvar.pl
+/usr/lib/perl5/5.6.0/warnings.pm
+/usr/lib/perl5/5.6.0/warnings/register.pm
+/usr/lib/perl5/5.6.0/sparc-linux/File/Glob.pm
+/usr/lib/perl5/5.6.0/sparc-linux/auto/File/Glob/Glob.bs
+/usr/lib/perl5/5.6.0/sparc-linux/auto/File/Glob/Glob.so
+/usr/lib/perl5/5.6.0/sparc-linux/Config.pm
+/usr/lib/perl5/5.6.0/sparc-linux/XSLoader.pm
+/usr/lib/perl5/5.6.0/sparc-linux/DynaLoader.pm
+/usr/lib/perl5/5.6.0/sparc-linux/Fcntl.pm
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Fcntl/Fcntl.bs
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Fcntl/Fcntl.so
+/usr/lib/perl5/5.6.0/sparc-linux/IO/File.pm
+/usr/lib/perl5/5.6.0/sparc-linux/IO/Handle.pm
+/usr/lib/perl5/5.6.0/sparc-linux/IO/Seekable.pm
+/usr/lib/perl5/5.6.0/sparc-linux/IO/Socket.pm
+/usr/lib/perl5/5.6.0/sparc-linux/Socket.pm
+/usr/lib/perl5/5.6.0/sparc-linux/_h2ph_pre.ph
+/usr/lib/perl5/5.6.0/sparc-linux/asm/unistd.ph
+/usr/lib/perl5/5.6.0/sparc-linux/asm-sparc/unistd.ph
+/usr/lib/perl5/5.6.0/sparc-linux/asm-sparc64/unistd.ph
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Data/Dumper/Dumper.bs
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Data/Dumper/Dumper.so
+/usr/lib/perl5/5.6.0/sparc-linux/auto/IO/IO.so
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Socket/Socket.bs
+/usr/lib/perl5/5.6.0/sparc-linux/auto/Socket/Socket.so
+/usr/lib/perl5/5.6.0/sparc-linux/bits/syscall.ph
+/usr/lib/perl5/5.6.0/sparc-linux/sys/syscall.ph
+/usr/lib/perl5/5.6.0/sparc-linux/syscall.ph
+/usr/lib/perl5/5.6.0/sparc-linux/auto/DynaLoader/dl_findfile.al
+/usr/lib/perl5/5.6.0/lib.pm
+/usr/lib/perl5/5.6.0/overload.pm
+/usr/lib/perl5/5.6.0/strict.pm
+/usr/lib/perl5/5.6.0/vars.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Gtk.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Gtk/Types.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/Cmd.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/Config.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/FTP.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/FTP/A.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/FTP/I.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/FTP/dataconn.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/Net/Netrc.pm
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/auto/Gtk/Gtk.bs
+/usr/lib/perl5/site_perl/5.6.0/sparc-linux/auto/Gtk/Gtk.so
/usr/lib/rpm/rpmrc
-/usr/X11R6/bin/XF86_FBDev
+/usr/X11R6/bin/Xsun24
/usr/X11R6/bin/XF86_Mach64
+/usr/X11R6/bin/XF86_3DLabs
/usr/X11R6/bin/xmodmap
-/usr/X11R6/lib/modules/xf86Wacom.so
diff --git a/perl-install/share/po/Changelog b/perl-install/share/po/Changelog
index e94dc0893..bbe3a7a19 100644
--- a/perl-install/share/po/Changelog
+++ b/perl-install/share/po/Changelog
@@ -1,5 +1,240 @@
-1999-08-18 Pablo Saratxaga <pablo@mandrakesoft.com>
+2000-10-03 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ * fr.po: fixed bug #518 and fixed other misc errors
+
+2000-09-16 Pixel <pixel@mandrakesoft.com>
+ * de.po: fix translation of "Size: %d KB\n" (was MB instead of KB)
+
+2000-04-28 Stefan Siegel <siegel@linux-mandrake.com>
+ * de.po: Update German File
+
+2000-04-18 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * cy.po: There is now a Welsh file, Thanks Dafydd !
+ * da.po: Updated Danish file
+
+2000-04-04 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * lv.po: Added Latvian file; now we are the very first to have
+ Latvian alnguage :)
+
+2000-03-26 Pablo Saratxaga <pablo@mandrakesoft.com>
+
+ * sk.po: Slovakian translation is now mantained and updated
+
+2000-01-10 Pixel <pixel@mandrakesoft.com>
+
+ * po/Changelog: remove the paragraph which was removed from
+ help.pm in br.po cs.po el.po et.po gl.po ro.po ru.po tr.po
+
+2000-01-06 François PONS <fpons@mandrakesoft.com>
+ * it.po: updated by Maurizio.
+
+2000-01-06 David BAUDENS <baudens@mandrakesoft.com>
+ * fr.po: updated
+
+2000-01-05 Pixel <pixel@mandrakesoft.com>
+ * *.po: changed the crypto message (french address in usa, and
+ removed a paragraph)
+
+2000-01-03 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * *.po: merged some strigns from gnorpm to help transaltiosn fo
+ rpmdrake new strings
+
+2000-01-03 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: updated Norwegian file
+ * id.po: updated Indonesian file
+ * hr.po: updated Croatian file
+ * da.po: updated Danish file
+ * et.po: updated Estonian file
+
+2000-01-01 Pablo Saratxaga <pablo@mandrakesoft.com>
+ Happy New Year to all !
+ * es.po: completed Spanish file
+ * zh_CN.po: created a GB2312 version by converting the Big5 one
+ however a real mantainer for a GB2312 version is still wanted
+ * ca.po: the first one to be updated after Y2K :)
+
+1999-12-30 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * zh_TW.Big5.po: uddated chinese file
+ * it.po: updated the Italian file
+ * es.po: completed spanish file
+ * br.po: updated Britton file
+ * ja.po: updated Japanese file
+
+1999-12-29 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: completed Norwegian file
+ * eo.po: Completed esperanto file
+ * sv.po: updated Swedish file
+ * hu.po: compelted Hungarian file
+
+1999-12-27 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * ru.po: updated Russian file
+ * id.po: completed Indonesian file
+ * et.po: Estonian files fixes
+ * no.po: completed file
+ * et.po: completed file
+ * lt.po: updated Lithuanian file
+ * da.po: completed Danish file
+ * ja.po: updated Japanese file
+
+1999-12-24 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * lt.po: updated Lithuanian file
+ * *.po: new strings have been added...
+
+1999-12-23 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * eo.po: completed esperanto file
+ * hr.po: updated Croatian file
+ * zh_TW.Big5: updated chinese file
+ * id.po: completed Indonesian file
+ * et.po: completed Estonian file
+ * sv.po: updated swedish file
+ * da.po: completed Danish file
+ * bg.po: updated Bulgarian file
+ * sr.po: updated serbian file
+ * no.po: completed norwegian file
+
+1999-12-22 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * de.po: update from Stefan Siegel <siegel@informatik.uni-kl.de>
+ * bg.po: updated Bulgarian file
+
+1999-12-16 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * *.po: updated po files
+ * ja.po: added japanese file
+
+1999-12-12 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * pt_BR.po: added portuguese file from Andrei <andreib@zaz.com.br>
+
+1999-12-10 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * et.po: completed 100% the Estonian file
+
+1999-12-09 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * th.po: Thai file from Kan Yuenyong <kan@kaiwal.com>
+
+1999-12-07 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * ro.po: did 'ispell -d romanian ro.po', I hope that improves the
+ lack of 8 bit letters; but a real mantainer is needed.
+
+1999-12-02 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po, ca.po, no.po, id.po: Completed Spanish, Catalan,
+ Norwegian and Indonesian language files.
+ * hu.po: Update of Hungarian file (60% done)
+
+1999-11-30 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * hu.po: added Hungarian language file
+
+1999-11-26 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: updated Norwegian file
+ * ca.po: added beginnign of Catalan file from SoftCatalà
+1999-11-25 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * *.po: corrected a typo ( s/Size: %d/Size: %s/ )
+ * de.po: updated German file
+ * id.po: updated Indonesian file
+
+1999-11-24 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * bg.po: added Bulgarian file from Elena Radåva <ely@triada.bg>
+
+1999-11-19 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * uk.po: added Ukrainian file
+ * pl.po: Polish is now 100% complete!
+
+1999-11-18 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * et.po: added estonian from Riho Kurg <riho@aso.ee>
+ * pl.po: updated polish from Pawel Jablonski
+
+1999-11-16 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * update-po, lots of new strings :)
+ * es.po: updated & completed
+
+1999-11-10 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po: completed
+ * pl.po: updated from Pavel Jablonski
+
+1999-11-08 François PONS <fpons@mandrakesoft.com>
+ * fr.po: updated.
+
+1999-11-05 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * pl.po: added Polish language file
+ * ru.po: updated russian file
+ * no.po: completed norwegian file
+
+1999-11-04 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po: updated and completed spanish language file
+ * wa.po: updated walon language file
+
+1999-10-30 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po: updated spanish language file
+
+1999-10-22 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * it.po, es.po: uopdated spanish and italian language files
+
+1999-10-22 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: update of the Nowegian translation by Terje Bjerkelia
+
+1999-10-22 Pixel <pixel@linux-mandrake.com>
+ * es.po: some corrections by Camille <camille@mandrakesoft.com>
+
+1999-10-21 François PONS <fpons@mandrakesoft.com>
+ * fr.po: modified printer or queue translation (line 1950 and 2778)
+
+1999-10-21 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po: updated Spanish language file
+
+1999-10-20 François PONS <fpons@mandrakesoft.com>
+ * fr.po: corrected "Skip PCMCIA probing" message with new msgid
+
+1999-10-14 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * ru.po: new Russian translations from Aleksey Smirnov
+ * no.po: update of the Nowegian translation by Terje Bjerkelia
+
+1999-10-13 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * *.po: checked that the name is correctly DrakX now, and updated them
+ * tr.po: newer translations from Hakan Terzioðlu <hakan@gelecek.com.tr>
+
+1999-10-11 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po,es.po: updated Norwegian and Spanish language files
+
+1999-09-30 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * es.po: updated Spanish language file
+
+1999-09-26 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: updated norwegian file
+
+1999-09-25 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * it.po: updated italian file
+
+1999-09-19 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: update Norwegian language file
+
+1999-09-18 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * tr.po: Added Turkish language file from
+ Hakan Terzioðlu <hakan@gelecek.com.tr>
+ * it.po: updated italian file
+
+1999-09-13 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * it.po: added italian language file from
+ "Paolo Lorenzin" <pasusu@tin.it>
+
+1999-09-08 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * id.po, es.po: completed files
+
+1999-08-26 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * fr.po: updated fr.po from gregus@linux-mandrake.com (Grégoire Colbert)
+ who is now in charge of the French translation
+
+1999-08-25 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * Makefile: corrected the msgmerge update (translations were
+ being deleted !). make it so DrakX.pot has a header
+ * *.po: get back all *.po files to the latest version including
+ translated strings. add headers
+ * id.po: update from indonesian team
+
+1999-08-22 Pablo Saratxaga <pablo@mandrakesoft.com>
+ * no.po: added norwegian translations from
+ Terje Bjerkelia <terje@bjerkelia.com>
+
+1999-08-18 Pablo Saratxaga <pablo@mandrakesoft.com>
* Changelog: created a Changelog file
* id.po: added indonesian translations from
Mohammad DAMT <mdamt@cakraweb.com>
diff --git a/perl-install/share/po/DrakX.pot b/perl-install/share/po/DrakX.pot
index 9ecc97e38..e851c4dcf 100644
--- a/perl-install/share/po/DrakX.pot
+++ b/perl-install/share/po/DrakX.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-10-13 00:04+0200\n"
+"POT-Creation-Date: 2000-11-11 21:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -14,23 +14,89 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
-#: ../Xconfigurator.pm_.c:164
+#: ../../Xconfigurator.pm_.c:179
+msgid "Graphic card"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:179
msgid "Select a graphic card"
msgstr ""
-#: ../Xconfigurator.pm_.c:165
+#: ../../Xconfigurator.pm_.c:180
msgid "Choose a X server"
msgstr ""
-#: ../Xconfigurator.pm_.c:184
+#: ../../Xconfigurator.pm_.c:180
+msgid "X server"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:217 ../../Xconfigurator.pm_.c:223
+#, c-format
+msgid "XFree %s"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:220
+msgid "Which configuration of XFree do you want to have?"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:232
+#, c-format
+msgid ""
+"Your card can have 3D hardware acceleration support but only with XFree %s.\n"
+"Your card is supported by XFree %s which may have a better support in 2D."
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:234 ../../Xconfigurator.pm_.c:257
+#, c-format
+msgid "Your card can have 3D hardware acceleration support with XFree %s."
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:236 ../../Xconfigurator.pm_.c:259
+#, c-format
+msgid "XFree %s with 3D hardware acceleration"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:245
+#, c-format
+msgid ""
+"Your card can have 3D hardware acceleration support but only with XFree %s,\n"
+"NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.\n"
+"Your card is supported by XFree %s which may have a better support in 2D."
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:248
+#, c-format
+msgid ""
+"Your card can have 3D hardware acceleration support with XFree %s,\n"
+"NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER."
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:250
+#, c-format
+msgid "XFree %s with EXPERIMENTAL 3D hardware acceleration"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:265
+msgid "XFree configuration"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:303
msgid "Select the memory size of your graphic card"
msgstr ""
-#: ../Xconfigurator.pm_.c:197
+#: ../../Xconfigurator.pm_.c:347
+msgid "Choose options for server"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:358
msgid "Choose a monitor"
msgstr ""
-#: ../Xconfigurator.pm_.c:200
+#: ../../Xconfigurator.pm_.c:358
+msgid "Monitor"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:361
msgid ""
"The two critical parameters are the vertical refresh rate, which is the "
"rate\n"
@@ -44,519 +110,994 @@ msgid ""
" If in doubt, choose a conservative setting."
msgstr ""
-#: ../Xconfigurator.pm_.c:207
+#: ../../Xconfigurator.pm_.c:368
msgid "Horizontal refresh rate"
msgstr ""
-#: ../Xconfigurator.pm_.c:207
+#: ../../Xconfigurator.pm_.c:368
msgid "Vertical refresh rate"
msgstr ""
-#: ../Xconfigurator.pm_.c:246
+#: ../../Xconfigurator.pm_.c:407
msgid "Monitor not configured"
msgstr ""
-#: ../Xconfigurator.pm_.c:249
+#: ../../Xconfigurator.pm_.c:410
msgid "Graphic card not configured yet"
msgstr ""
-#: ../Xconfigurator.pm_.c:252
+#: ../../Xconfigurator.pm_.c:413
msgid "Resolutions not chosen yet"
msgstr ""
-#: ../Xconfigurator.pm_.c:259
+#: ../../Xconfigurator.pm_.c:429
msgid "Do you want to test the configuration?"
msgstr ""
-#: ../Xconfigurator.pm_.c:259
-msgid "Test configuration"
+#: ../../Xconfigurator.pm_.c:433
+msgid "Warning: testing this graphic card may freeze your computer"
msgstr ""
-#: ../Xconfigurator.pm_.c:289
-msgid "An error occurred:"
+#: ../../Xconfigurator.pm_.c:436
+msgid "Test of the configuration"
msgstr ""
-#: ../Xconfigurator.pm_.c:291
+#: ../../Xconfigurator.pm_.c:475
msgid ""
"\n"
-"try changing some parameters"
+"try to change some parameters"
msgstr ""
-#: ../Xconfigurator.pm_.c:312
-#, c-format
-msgid "(leaving in %d seconds)"
+#: ../../Xconfigurator.pm_.c:475
+msgid "An error has occurred:"
msgstr ""
-#: ../Xconfigurator.pm_.c:316 ../my_gtk.pm_.c:348
-msgid "Is this correct?"
+#: ../../Xconfigurator.pm_.c:497
+#, c-format
+msgid "Leaving in %d seconds"
msgstr ""
-#: ../Xconfigurator.pm_.c:324
-msgid "An error occurred, try changing some parameters"
+#: ../../Xconfigurator.pm_.c:507
+msgid "Is this the correct setting?"
msgstr ""
-#: ../Xconfigurator.pm_.c:332 ../Xconfigurator.pm_.c:481
-msgid "Automatic resolutions"
+#: ../../Xconfigurator.pm_.c:515
+msgid "An error has occurred, try to change some parameters"
msgstr ""
-#: ../Xconfigurator.pm_.c:333
-msgid ""
-"To find the available resolutions I will try different ones.\n"
-"Your screen will blink...\n"
-"You can switch if off if you want, you'll hear a beep when it's over"
+#: ../../Xconfigurator.pm_.c:552 ../../printerdrake.pm_.c:276
+msgid "Resolution"
msgstr ""
-#: ../Xconfigurator.pm_.c:380 ../install_steps_interactive.pm_.c:450
-#: ../install_steps_interactive.pm_.c:451
-msgid "Resolution"
+#: ../../Xconfigurator.pm_.c:587
+msgid "Choose the resolution and the color depth"
msgstr ""
-#: ../Xconfigurator.pm_.c:414
-msgid "Choose resolution and color depth"
+#: ../../Xconfigurator.pm_.c:589
+#, c-format
+msgid "Graphic card: %s"
msgstr ""
-#: ../Xconfigurator.pm_.c:422
-msgid "Show all"
+#: ../../Xconfigurator.pm_.c:590
+#, c-format
+msgid "XFree86 server: %s"
msgstr ""
-#: ../Xconfigurator.pm_.c:482
-msgid ""
-"I can try to find the available resolutions (eg: 800x600).\n"
-"Sometimes, though, it may hang the machine.\n"
-"Do you want to try?"
+#: ../../Xconfigurator.pm_.c:599
+msgid "Show all"
msgstr ""
-#: ../Xconfigurator.pm_.c:487
-msgid ""
-"No valid modes found\n"
-"Try with another video card or monitor"
+#: ../../Xconfigurator.pm_.c:623
+msgid "Resolutions"
msgstr ""
-#: ../Xconfigurator.pm_.c:672
+#: ../../Xconfigurator.pm_.c:1021
#, c-format
msgid "Keyboard layout: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:673
+#: ../../Xconfigurator.pm_.c:1022
#, c-format
msgid "Mouse type: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:674
+#: ../../Xconfigurator.pm_.c:1023
#, c-format
msgid "Mouse device: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:675
+#: ../../Xconfigurator.pm_.c:1024
#, c-format
msgid "Monitor: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:676
+#: ../../Xconfigurator.pm_.c:1025
#, c-format
msgid "Monitor HorizSync: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:677
+#: ../../Xconfigurator.pm_.c:1026
#, c-format
msgid "Monitor VertRefresh: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:678
+#: ../../Xconfigurator.pm_.c:1027
#, c-format
msgid "Graphic card: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:679
+#: ../../Xconfigurator.pm_.c:1028
#, c-format
msgid "Graphic memory: %s kB\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:680
+#: ../../Xconfigurator.pm_.c:1030
+#, c-format
+msgid "Color depth: %s\n"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1031
+#, c-format
+msgid "Resolution: %s\n"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1033
#, c-format
msgid "XFree86 server: %s\n"
msgstr ""
-#: ../Xconfigurator.pm_.c:705
+#: ../../Xconfigurator.pm_.c:1034
+#, c-format
+msgid "XFree86 driver: %s\n"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1053
+msgid "Preparing X-Window configuration"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1067
msgid "Change Monitor"
msgstr ""
-#: ../Xconfigurator.pm_.c:706
+#: ../../Xconfigurator.pm_.c:1068
msgid "Change Graphic card"
msgstr ""
-#: ../Xconfigurator.pm_.c:707
-msgid "Change Resolution"
+#: ../../Xconfigurator.pm_.c:1069
+msgid "Change Server options"
msgstr ""
-#: ../Xconfigurator.pm_.c:708
-msgid "Automatical resolutions search"
+#: ../../Xconfigurator.pm_.c:1070
+msgid "Change Resolution"
msgstr ""
-#: ../Xconfigurator.pm_.c:712
+#: ../../Xconfigurator.pm_.c:1071
msgid "Show information"
msgstr ""
-#: ../Xconfigurator.pm_.c:713
+#: ../../Xconfigurator.pm_.c:1072
msgid "Test again"
msgstr ""
-#: ../Xconfigurator.pm_.c:714
+#: ../../Xconfigurator.pm_.c:1073 ../../standalone/rpmdrake_.c:46
msgid "Quit"
msgstr ""
-#: ../Xconfigurator.pm_.c:717
+#: ../../Xconfigurator.pm_.c:1077 ../../standalone/drakboot_.c:40
msgid "What do you want to do?"
msgstr ""
-#: ../Xconfigurator.pm_.c:722
+#: ../../Xconfigurator.pm_.c:1084
+#, c-format
+msgid ""
+"Keep the changes?\n"
+"Current configuration is:\n"
+"\n"
+"%s"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1105
+#, c-format
+msgid "Please relog into %s to activate the changes"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1125
+msgid "Please log out and then use Ctrl-Alt-BackSpace"
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1128
msgid "X at startup"
msgstr ""
-#: ../Xconfigurator.pm_.c:723
+#: ../../Xconfigurator.pm_.c:1129
msgid ""
"I can set up your computer to automatically start X upon booting.\n"
"Would you like X to start when you reboot?"
msgstr ""
-#: ../Xconfigurator.pm_.c:728
-msgid "X successfully configured"
+#: ../../Xconfigurator.pm_.c:1153
+msgid "Autologin"
msgstr ""
-#: ../Xconfigurator.pm_.c:729
+#: ../../Xconfigurator.pm_.c:1154
msgid ""
-"Configuration file has been written. Take a look at it before running "
-"'startx'.\n"
-"Within the server, press Ctrl, Alt and '+' simultaneously to cycle through "
-"video resolutions.\n"
-"Pressing Ctrl, Alt and Backspace simultaneously immediately exits the "
-"server\n"
-"For further configuration, refer to /usr/X11R6/lib/X11/doc/README.Config."
+"I can set up your computer to automatically log on one user.\n"
+"If you don't want to use this feature, click on the cancel button."
+msgstr ""
+
+#: ../../Xconfigurator.pm_.c:1156
+msgid "Choose the default user:"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:4
-msgid "256 colors"
+#: ../../Xconfigurator.pm_.c:1157
+msgid "Choose the window manager to run:"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:5
-msgid "32 thousand colors"
+#: ../../Xconfigurator_consts.pm_.c:6
+msgid "256 colors (8 bits)"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:6
-msgid "65 thousand colors"
+#: ../../Xconfigurator_consts.pm_.c:7
+msgid "32 thousand colors (15 bits)"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:7
-msgid "16 million colors"
+#: ../../Xconfigurator_consts.pm_.c:8
+msgid "65 thousand colors (16 bits)"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:8
-msgid "4 billion colors"
+#: ../../Xconfigurator_consts.pm_.c:9
+msgid "16 million colors (24 bits)"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:57
+#: ../../Xconfigurator_consts.pm_.c:10
+msgid "4 billion colors (32 bits)"
+msgstr ""
+
+#: ../../Xconfigurator_consts.pm_.c:106
msgid "256 kB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:58
+#: ../../Xconfigurator_consts.pm_.c:107
msgid "512 kB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:59
+#: ../../Xconfigurator_consts.pm_.c:108
msgid "1 MB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:60
+#: ../../Xconfigurator_consts.pm_.c:109
msgid "2 MB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:61
+#: ../../Xconfigurator_consts.pm_.c:110
msgid "4 MB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:62
+#: ../../Xconfigurator_consts.pm_.c:111
msgid "8 MB"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:63
+#: ../../Xconfigurator_consts.pm_.c:112
msgid "16 MB or more"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:67 ../Xconfigurator_consts.pm_.c:68
+#: ../../Xconfigurator_consts.pm_.c:117 ../../Xconfigurator_consts.pm_.c:118
msgid "Standard VGA, 640x480 at 60 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:69
+#: ../../Xconfigurator_consts.pm_.c:119
msgid "Super VGA, 800x600 at 56 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:70
+#: ../../Xconfigurator_consts.pm_.c:120
msgid "8514 Compatible, 1024x768 at 87 Hz interlaced (no 800x600)"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:71
+#: ../../Xconfigurator_consts.pm_.c:121
msgid "Super VGA, 1024x768 at 87 Hz interlaced, 800x600 at 56 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:72
+#: ../../Xconfigurator_consts.pm_.c:122
msgid "Extended Super VGA, 800x600 at 60 Hz, 640x480 at 72 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:73
+#: ../../Xconfigurator_consts.pm_.c:123
msgid "Non-Interlaced SVGA, 1024x768 at 60 Hz, 800x600 at 72 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:74
+#: ../../Xconfigurator_consts.pm_.c:124
msgid "High Frequency SVGA, 1024x768 at 70 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:75
+#: ../../Xconfigurator_consts.pm_.c:125
msgid "Multi-frequency that can do 1280x1024 at 60 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:76
+#: ../../Xconfigurator_consts.pm_.c:126
msgid "Multi-frequency that can do 1280x1024 at 74 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:77
+#: ../../Xconfigurator_consts.pm_.c:127
msgid "Multi-frequency that can do 1280x1024 at 76 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:78
+#: ../../Xconfigurator_consts.pm_.c:128
msgid "Monitor that can do 1600x1200 at 70 Hz"
msgstr ""
-#: ../Xconfigurator_consts.pm_.c:79
+#: ../../Xconfigurator_consts.pm_.c:129
msgid "Monitor that can do 1600x1200 at 76 Hz"
msgstr ""
-#: ../diskdrake.pm_.c:15
+#: ../../any.pm_.c:91 ../../any.pm_.c:121 ../../any_new.pm_.c:91
+#: ../../any_new.pm_.c:121
+msgid "First sector of boot partition"
+msgstr ""
+
+#: ../../any.pm_.c:91 ../../any.pm_.c:121 ../../any.pm_.c:150
+#: ../../any_new.pm_.c:91 ../../any_new.pm_.c:121 ../../any_new.pm_.c:150
+msgid "First sector of drive (MBR)"
+msgstr ""
+
+#: ../../any.pm_.c:95 ../../any_new.pm_.c:95
+msgid "SILO Installation"
+msgstr ""
+
+#: ../../any.pm_.c:96 ../../any.pm_.c:102 ../../any_new.pm_.c:96
+#: ../../any_new.pm_.c:102
+msgid "Where do you want to install the bootloader?"
+msgstr ""
+
+#: ../../any.pm_.c:101 ../../any_new.pm_.c:101
+msgid "LILO/grub Installation"
+msgstr ""
+
+#: ../../any.pm_.c:111 ../../any_new.pm_.c:111
+#: ../../install_steps_interactive.pm_.c:736
+msgid "None"
+msgstr ""
+
+#: ../../any.pm_.c:111 ../../any_new.pm_.c:111
+msgid "Which bootloader(s) do you want to use?"
+msgstr ""
+
+#: ../../any.pm_.c:125 ../../any_new.pm_.c:125
+msgid "Bootloader installation"
+msgstr ""
+
+#: ../../any.pm_.c:127 ../../any_new.pm_.c:127
+msgid "Boot device"
+msgstr ""
+
+#: ../../any.pm_.c:128 ../../any_new.pm_.c:128
+msgid "LBA (doesn't work on old BIOSes)"
+msgstr ""
+
+#: ../../any.pm_.c:129 ../../any_new.pm_.c:129
+msgid "Compact"
+msgstr ""
+
+#: ../../any.pm_.c:129 ../../any_new.pm_.c:129
+msgid "compact"
+msgstr ""
+
+#: ../../any.pm_.c:130 ../../any.pm_.c:199 ../../any_new.pm_.c:130
+#: ../../any_new.pm_.c:199
+msgid "Video mode"
+msgstr ""
+
+#: ../../any.pm_.c:132 ../../any_new.pm_.c:132
+msgid "Delay before booting default image"
+msgstr ""
+
+#: ../../any.pm_.c:134 ../../any_new.pm_.c:134
+#: ../../install_steps_interactive.pm_.c:764
+#: ../../install_steps_interactive.pm_.c:815 ../../netconnect.pm_.c:560
+#: ../../netconnect_new.pm_.c:686 ../../printerdrake.pm_.c:94
+#: ../../printerdrake.pm_.c:128 ../../standalone/adduserdrake_.c:42
+msgid "Password"
+msgstr ""
+
+#: ../../any.pm_.c:135 ../../any_new.pm_.c:135
+#: ../../install_steps_interactive.pm_.c:765
+#: ../../install_steps_interactive.pm_.c:816
+#: ../../standalone/adduserdrake_.c:43
+msgid "Password (again)"
+msgstr ""
+
+#: ../../any.pm_.c:136 ../../any_new.pm_.c:136
+msgid "Restrict command line options"
+msgstr ""
+
+#: ../../any.pm_.c:136 ../../any_new.pm_.c:136
+msgid "restrict"
+msgstr ""
+
+#: ../../any.pm_.c:142 ../../any_new.pm_.c:142
+msgid "Bootloader main options"
+msgstr ""
+
+#: ../../any.pm_.c:145 ../../any_new.pm_.c:145
+msgid ""
+"Option ``Restrict command line options'' is of no use without a password"
+msgstr ""
+
+#: ../../any.pm_.c:146 ../../any_new.pm_.c:146
+#: ../../install_steps_interactive.pm_.c:774
+#: ../../install_steps_interactive.pm_.c:829
+#: ../../standalone/adduserdrake_.c:56
+msgid "Please try again"
+msgstr ""
+
+#: ../../any.pm_.c:146 ../../any_new.pm_.c:146
+#: ../../install_steps_interactive.pm_.c:774
+#: ../../install_steps_interactive.pm_.c:829
+#: ../../standalone/adduserdrake_.c:56
+msgid "The passwords do not match"
+msgstr ""
+
+#: ../../any.pm_.c:157 ../../any_new.pm_.c:157
+msgid ""
+"Here are the different entries.\n"
+"You can add some more or change the existing ones."
+msgstr ""
+
+#: ../../any.pm_.c:165 ../../any_new.pm_.c:165 ../../printerdrake.pm_.c:352
+#: ../../standalone/rpmdrake_.c:302
+msgid "Add"
+msgstr ""
+
+#: ../../any.pm_.c:165 ../../any_new.pm_.c:165 ../../diskdrake.pm_.c:46
+#: ../../install_steps_interactive.pm_.c:809 ../../netconnect.pm_.c:842
+#: ../../netconnect_new.pm_.c:984 ../../printerdrake.pm_.c:352
+#: ../../standalone/adduserdrake_.c:36
+msgid "Done"
+msgstr ""
+
+#: ../../any.pm_.c:174 ../../any_new.pm_.c:174
+msgid "Which type of entry do you want to add?"
+msgstr ""
+
+#: ../../any.pm_.c:175 ../../any_new.pm_.c:175
+msgid "Linux"
+msgstr ""
+
+#: ../../any.pm_.c:175 ../../any_new.pm_.c:175
+msgid "Other OS (SunOS...)"
+msgstr ""
+
+#: ../../any.pm_.c:175 ../../any_new.pm_.c:175
+msgid "Other OS (windows...)"
+msgstr ""
+
+#: ../../any.pm_.c:196 ../../any_new.pm_.c:196
+msgid "Image"
+msgstr ""
+
+#: ../../any.pm_.c:197 ../../any.pm_.c:206 ../../any_new.pm_.c:197
+#: ../../any_new.pm_.c:206
+msgid "Root"
+msgstr ""
+
+#: ../../any.pm_.c:198 ../../any_new.pm_.c:198
+msgid "Append"
+msgstr ""
+
+#: ../../any.pm_.c:200 ../../any_new.pm_.c:200
+msgid "Initrd"
+msgstr ""
+
+#: ../../any.pm_.c:201 ../../any_new.pm_.c:201
+msgid "Read-write"
+msgstr ""
+
+#: ../../any.pm_.c:208 ../../any_new.pm_.c:208
+msgid "Table"
+msgstr ""
+
+#: ../../any.pm_.c:209 ../../any_new.pm_.c:209
+msgid "Unsafe"
+msgstr ""
+
+#: ../../any.pm_.c:215 ../../any_new.pm_.c:215
+msgid "Label"
+msgstr ""
+
+#: ../../any.pm_.c:217 ../../any_new.pm_.c:217
+msgid "Default"
+msgstr ""
+
+#: ../../any.pm_.c:220 ../../any_new.pm_.c:220 ../../install_gtk.pm_.c:82
+#: ../../install_steps_interactive.pm_.c:762 ../../interactive.pm_.c:76
+#: ../../interactive.pm_.c:86 ../../interactive.pm_.c:250
+#: ../../interactive_newt.pm_.c:51 ../../interactive_newt.pm_.c:99
+#: ../../interactive_stdio.pm_.c:27 ../../my_gtk.pm_.c:243
+#: ../../my_gtk.pm_.c:486 ../../my_gtk.pm_.c:661 ../../printerdrake.pm_.c:444
+#: ../../printerdrake.pm_.c:464
+msgid "Ok"
+msgstr ""
+
+#: ../../any.pm_.c:220 ../../any_new.pm_.c:220
+msgid "Remove entry"
+msgstr ""
+
+#: ../../any.pm_.c:223 ../../any_new.pm_.c:223
+msgid "Empty label not allowed"
+msgstr ""
+
+#: ../../any.pm_.c:224 ../../any_new.pm_.c:224
+msgid "This label is already used"
+msgstr ""
+
+#: ../../any.pm_.c:500 ../../any_new.pm_.c:492
+#, c-format
+msgid "Found %s %s interfaces"
+msgstr ""
+
+#: ../../any.pm_.c:501 ../../any_new.pm_.c:493
+msgid "Do you have another one?"
+msgstr ""
+
+#: ../../any.pm_.c:502 ../../any_new.pm_.c:494
+#, c-format
+msgid "Do you have any %s interfaces?"
+msgstr ""
+
+#: ../../any.pm_.c:504 ../../any_new.pm_.c:496 ../../interactive.pm_.c:81
+#: ../../my_gtk.pm_.c:485 ../../netconnect.pm_.c:90 ../../netconnect.pm_.c:470
+#: ../../netconnect_new.pm_.c:148 ../../netconnect_new.pm_.c:509
+#: ../../printerdrake.pm_.c:233
+msgid "No"
+msgstr ""
+
+#: ../../any.pm_.c:504 ../../any_new.pm_.c:496 ../../interactive.pm_.c:81
+#: ../../my_gtk.pm_.c:485 ../../netconnect.pm_.c:88 ../../netconnect.pm_.c:468
+#: ../../netconnect_new.pm_.c:146 ../../netconnect_new.pm_.c:507
+msgid "Yes"
+msgstr ""
+
+#: ../../any.pm_.c:505 ../../any_new.pm_.c:497
+msgid "See hardware info"
+msgstr ""
+
+#. -PO: the first %s is the card type (scsi, network, sound,...)
+#. -PO: the second is the vendor+model name
+#: ../../any.pm_.c:522 ../../any_new.pm_.c:533
+#, c-format
+msgid "Installing driver for %s card %s"
+msgstr ""
+
+#: ../../any.pm_.c:523 ../../any_new.pm_.c:534
+#, c-format
+msgid "(module %s)"
+msgstr ""
+
+#. -PO: the %s is the driver type (scsi, network, sound,...)
+#: ../../any.pm_.c:534 ../../any_new.pm_.c:545
+#, c-format
+msgid "Which %s driver should I try?"
+msgstr ""
+
+#: ../../any.pm_.c:542 ../../any_new.pm_.c:553
+#, c-format
+msgid ""
+"In some cases, the %s driver needs to have extra information to work\n"
+"properly, although it normally works fine without. Would you like to "
+"specify\n"
+"extra options for it or allow the driver to probe your machine for the\n"
+"information it needs? Occasionally, probing will hang a computer, but it "
+"should\n"
+"not cause any damage."
+msgstr ""
+
+#: ../../any.pm_.c:547 ../../any_new.pm_.c:558
+msgid "Autoprobe"
+msgstr ""
+
+#: ../../any.pm_.c:547 ../../any_new.pm_.c:558
+msgid "Specify options"
+msgstr ""
+
+#: ../../any.pm_.c:551 ../../any_new.pm_.c:562
+#, c-format
+msgid "You may now provide its options to module %s."
+msgstr ""
+
+#: ../../any.pm_.c:557 ../../any_new.pm_.c:568
+#, c-format
+msgid ""
+"You may now provide its options to module %s.\n"
+"Options are in format ``name=value name2=value2 ...''.\n"
+"For instance, ``io=0x300 irq=7''"
+msgstr ""
+
+#: ../../any.pm_.c:560 ../../any_new.pm_.c:571
+msgid "Module options:"
+msgstr ""
+
+#: ../../any.pm_.c:570 ../../any_new.pm_.c:581
+#, c-format
+msgid ""
+"Loading module %s failed.\n"
+"Do you want to try again with other parameters?"
+msgstr ""
+
+#: ../../bootloader.pm_.c:234
+#, c-format
+msgid ""
+"Welcome to %s the operating system chooser!\n"
+"\n"
+"Choose an operating system in the list above or\n"
+"wait %d seconds for default boot.\n"
+"\n"
+msgstr ""
+
+#: ../../bootloader.pm_.c:596
+msgid "Welcome to GRUB the operating system chooser!"
+msgstr ""
+
+#: ../../bootloader.pm_.c:597
+#, c-format
+msgid "Use the %c and %c keys for selecting which entry is highlighted."
+msgstr ""
+
+#: ../../bootloader.pm_.c:598
+msgid "Press enter to boot the selected OS, 'e' to edit the"
+msgstr ""
+
+#: ../../bootloader.pm_.c:599
+msgid "commands before booting, or 'c' for a command-line."
+msgstr ""
+
+#: ../../bootloader.pm_.c:600
+#, c-format
+msgid "The highlighted entry will be booted automatically in %d seconds."
+msgstr ""
+
+#: ../../bootloader.pm_.c:604
+msgid "not enough room in /boot"
+msgstr ""
+
+#. -PO: "Desktop" and "Start Menu" are the name of the directories found in c:\windows
+#: ../../bootloader.pm_.c:696
+msgid "Desktop"
+msgstr ""
+
+#: ../../bootloader.pm_.c:696
+msgid "Start Menu"
+msgstr ""
+
+#: ../../common.pm_.c:610
+#, c-format
+msgid "%d minutes"
+msgstr ""
+
+#: ../../common.pm_.c:612
+msgid "1 minute"
+msgstr ""
+
+#: ../../common.pm_.c:614
+#, c-format
+msgid "%d seconds"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:21 ../../diskdrake.pm_.c:427
msgid "Create"
msgstr ""
-#: ../diskdrake.pm_.c:16
+#: ../../diskdrake.pm_.c:22
msgid "Unmount"
msgstr ""
-#: ../diskdrake.pm_.c:17
+#: ../../diskdrake.pm_.c:23 ../../diskdrake.pm_.c:429
msgid "Delete"
msgstr ""
-#: ../diskdrake.pm_.c:17
+#: ../../diskdrake.pm_.c:23
msgid "Format"
msgstr ""
-#: ../diskdrake.pm_.c:17 ../diskdrake.pm_.c:376
-msgid "Move"
-msgstr ""
-
-#: ../diskdrake.pm_.c:17 ../diskdrake.pm_.c:434
+#: ../../diskdrake.pm_.c:23 ../../diskdrake.pm_.c:610
msgid "Resize"
msgstr ""
-#: ../diskdrake.pm_.c:17
+#: ../../diskdrake.pm_.c:23 ../../diskdrake.pm_.c:427
+#: ../../diskdrake.pm_.c:480
msgid "Type"
msgstr ""
-#: ../diskdrake.pm_.c:18
-msgid "Mount_point"
+#: ../../diskdrake.pm_.c:24 ../../diskdrake.pm_.c:500
+msgid "Mount point"
msgstr ""
-#: ../diskdrake.pm_.c:32
+#: ../../diskdrake.pm_.c:38
msgid "Write /etc/fstab"
msgstr ""
-#: ../diskdrake.pm_.c:33
-msgid "Normal > Expert"
+#: ../../diskdrake.pm_.c:39
+msgid "Toggle to expert mode"
msgstr ""
-#: ../diskdrake.pm_.c:34
-msgid "Expert > Normal"
+#: ../../diskdrake.pm_.c:40
+msgid "Toggle to normal mode"
msgstr ""
-#: ../diskdrake.pm_.c:35
+#: ../../diskdrake.pm_.c:41
msgid "Restore from file"
msgstr ""
-#: ../diskdrake.pm_.c:36
+#: ../../diskdrake.pm_.c:42
msgid "Save in file"
msgstr ""
-#: ../diskdrake.pm_.c:37
-msgid "Restore from floppy"
+#: ../../diskdrake.pm_.c:43
+msgid "Wizard"
msgstr ""
-#: ../diskdrake.pm_.c:38
-msgid "Save on floppy"
+#: ../../diskdrake.pm_.c:44
+msgid "Restore from floppy"
msgstr ""
-#: ../diskdrake.pm_.c:39 ../install_steps_interactive.pm_.c:533
-#: ../install_steps_interactive.pm_.c:642
-msgid "Done"
+#: ../../diskdrake.pm_.c:45
+msgid "Save on floppy"
msgstr ""
-#: ../diskdrake.pm_.c:42
+#: ../../diskdrake.pm_.c:49
msgid "Clear all"
msgstr ""
-#: ../diskdrake.pm_.c:43
+#: ../../diskdrake.pm_.c:50
msgid "Format all"
msgstr ""
-#: ../diskdrake.pm_.c:44
+#: ../../diskdrake.pm_.c:51
msgid "Auto allocate"
msgstr ""
-#: ../diskdrake.pm_.c:47
+#: ../../diskdrake.pm_.c:54
msgid "All primary partitions are used"
msgstr ""
-#: ../diskdrake.pm_.c:47
+#: ../../diskdrake.pm_.c:54
msgid "I can't add any more partition"
msgstr ""
-#: ../diskdrake.pm_.c:47
+#: ../../diskdrake.pm_.c:54
msgid ""
"To have more partitions, please delete one to be able to create an extended "
"partition"
msgstr ""
-#: ../diskdrake.pm_.c:50
+#: ../../diskdrake.pm_.c:57
msgid "Rescue partition table"
msgstr ""
-#: ../diskdrake.pm_.c:51
+#: ../../diskdrake.pm_.c:58
msgid "Undo"
msgstr ""
-#: ../diskdrake.pm_.c:52
+#: ../../diskdrake.pm_.c:59
msgid "Write partition table"
msgstr ""
-#: ../diskdrake.pm_.c:94
-msgid "Details"
-msgstr ""
-
-#: ../diskdrake.pm_.c:98
-msgid "Legend"
+#: ../../diskdrake.pm_.c:60
+msgid "Reload"
msgstr ""
-#: ../diskdrake.pm_.c:100
-msgid "Empty"
+#: ../../diskdrake.pm_.c:101
+msgid "loopback"
msgstr ""
-#: ../diskdrake.pm_.c:100
+#: ../../diskdrake.pm_.c:114
msgid "Ext2"
msgstr ""
-#: ../diskdrake.pm_.c:100
+#: ../../diskdrake.pm_.c:114
msgid "FAT"
msgstr ""
-#: ../diskdrake.pm_.c:100
-msgid "Other"
+#: ../../diskdrake.pm_.c:114
+msgid "HFS"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:114
+msgid "SunOS"
msgstr ""
-#: ../diskdrake.pm_.c:100
+#: ../../diskdrake.pm_.c:114
msgid "Swap"
msgstr ""
-#: ../diskdrake.pm_.c:120
-#, c-format
-msgid "After %s partition %s,"
+#: ../../diskdrake.pm_.c:115
+msgid "Empty"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:115 ../../mouse.pm_.c:125
+msgid "Other"
msgstr ""
-#: ../diskdrake.pm_.c:120 ../diskdrake.pm_.c:367 ../diskdrake.pm_.c:394
+#: ../../diskdrake.pm_.c:121
+msgid "Filesystem types:"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:130
+msgid "Details"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:144
+msgid ""
+"You have one big FAT partition\n"
+"(generally used by MicroSoft Dos/Windows).\n"
+"I suggest you first resize that partition\n"
+"(click on it, then click on \"Resize\")"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:149
+msgid "Please make a backup of your data first"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:149 ../../diskdrake.pm_.c:166
+#: ../../diskdrake.pm_.c:175 ../../diskdrake.pm_.c:532
+#: ../../diskdrake.pm_.c:554
msgid "Read carefully!"
msgstr ""
-#: ../diskdrake.pm_.c:120
-msgid "all data on this partition will be lost"
+#: ../../diskdrake.pm_.c:152
+msgid ""
+"If you plan to use aboot, be carefull to leave a free space (2048 sectors is "
+"enough)\n"
+"at the beginning of the disk"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:166
+msgid "Be careful: this operation is dangerous."
msgstr ""
-#: ../diskdrake.pm_.c:138 ../install_any.pm_.c:177 ../install_steps.pm_.c:67
-#: ../install_steps_interactive.pm_.c:37
+#: ../../diskdrake.pm_.c:203 ../../install_steps.pm_.c:73
+#: ../../install_steps_interactive.pm_.c:38
+#: ../../install_steps_interactive.pm_.c:315 ../../standalone/diskdrake_.c:60
+#: ../../standalone/rpmdrake_.c:294 ../../standalone/rpmdrake_.c:304
msgid "Error"
msgstr ""
-#: ../diskdrake.pm_.c:159 ../diskdrake.pm_.c:511
+#: ../../diskdrake.pm_.c:227 ../../diskdrake.pm_.c:708
msgid "Mount point: "
msgstr ""
-#: ../diskdrake.pm_.c:160 ../diskdrake.pm_.c:182
+#: ../../diskdrake.pm_.c:228 ../../diskdrake.pm_.c:269
msgid "Device: "
msgstr ""
-#: ../diskdrake.pm_.c:161
+#: ../../diskdrake.pm_.c:229
#, c-format
msgid "DOS drive letter: %s (just a guess)\n"
msgstr ""
-#: ../diskdrake.pm_.c:162 ../diskdrake.pm_.c:185
+#: ../../diskdrake.pm_.c:230 ../../diskdrake.pm_.c:272
msgid "Type: "
msgstr ""
-#: ../diskdrake.pm_.c:163
+#: ../../diskdrake.pm_.c:231
#, c-format
-msgid "Start: sector /*%s\n"
+msgid "Start: sector %s\n"
msgstr ""
-#: ../diskdrake.pm_.c:164
-msgid "Size: %s MB (%s%%)"
+#: ../../diskdrake.pm_.c:232
+#, c-format
+msgid "Size: %d MB"
msgstr ""
-#: ../diskdrake.pm_.c:165
+#: ../../diskdrake.pm_.c:234
#, c-format
msgid ", %s sectors"
msgstr ""
-#: ../diskdrake.pm_.c:167
+#: ../../diskdrake.pm_.c:236
#, c-format
msgid "Cylinder %d to cylinder %d\n"
msgstr ""
-#: ../diskdrake.pm_.c:168
+#: ../../diskdrake.pm_.c:237
msgid "Formatted\n"
msgstr ""
-#: ../diskdrake.pm_.c:169
+#: ../../diskdrake.pm_.c:238
msgid "Not formatted\n"
msgstr ""
-#: ../diskdrake.pm_.c:170
+#: ../../diskdrake.pm_.c:239
msgid "Mounted\n"
msgstr ""
-#: ../diskdrake.pm_.c:171
+#: ../../diskdrake.pm_.c:240
+#, c-format
+msgid "RAID md%s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:241
+#, c-format
+msgid "Loopback file(s): %s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:242
msgid ""
"Partition booted by default\n"
" (for MS-DOS boot, not for lilo)\n"
msgstr ""
-#: ../diskdrake.pm_.c:183
+#: ../../diskdrake.pm_.c:244
+#, c-format
+msgid "Level %s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:245
+#, c-format
+msgid "Chunk size %s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:246
+#, c-format
+msgid "RAID-disks %s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:248
+#, c-format
+msgid "Loopback file name: %s"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:265
+msgid "Please click on a partition"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:270
#, c-format
msgid "Size: %d MB\n"
msgstr ""
-#: ../diskdrake.pm_.c:184
+#: ../../diskdrake.pm_.c:271
#, c-format
msgid "Geometry: %s cylinders, %s heads, %s sectors\n"
msgstr ""
-#: ../diskdrake.pm_.c:186
+#: ../../diskdrake.pm_.c:273
+#, c-format
+msgid "Partition table type: %s\n"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:274
#, c-format
msgid "on bus %d id %d\n"
msgstr ""
-#: ../diskdrake.pm_.c:198
+#: ../../diskdrake.pm_.c:290
msgid "Mount"
msgstr ""
-#: ../diskdrake.pm_.c:200
+#: ../../diskdrake.pm_.c:292
msgid "Active"
msgstr ""
-#: ../diskdrake.pm_.c:289
+#: ../../diskdrake.pm_.c:294
+msgid "Add to RAID"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:296
+msgid "Remove from RAID"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:298
+msgid "Modify RAID"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:300
+msgid "Use for loopback"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:307
+msgid "Choose action"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:400
msgid ""
"Sorry I won't accept to create /boot so far onto the drive (on a cylinder > "
"1024).\n"
@@ -564,7 +1105,7 @@ msgid ""
"need /boot"
msgstr ""
-#: ../diskdrake.pm_.c:293
+#: ../../diskdrake.pm_.c:404
msgid ""
"The partition you've selected to add as root (/) is physically located "
"beyond\n"
@@ -572,394 +1113,1128 @@ msgid ""
"If you plan to use the LILO boot manager, be careful to add a /boot partition"
msgstr ""
-#: ../diskdrake.pm_.c:307
+#: ../../diskdrake.pm_.c:410
+msgid ""
+"You've selected a software RAID partition as root (/).\n"
+"No bootloader is able to handle this without a /boot partition.\n"
+"So be careful to add a /boot partition"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:427 ../../diskdrake.pm_.c:429
+#, c-format
+msgid "Use ``%s'' instead"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:432
+msgid "Use ``Unmount'' first"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:433 ../../diskdrake.pm_.c:475
+#, c-format
+msgid ""
+"After changing type of partition %s, all data on this partition will be lost"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:445
+msgid "Continue anyway?"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:450
msgid "Quit without saving"
msgstr ""
-#: ../diskdrake.pm_.c:307
+#: ../../diskdrake.pm_.c:450
msgid "Quit without writing the partition table?"
msgstr ""
-#: ../diskdrake.pm_.c:322
-msgid "changing type of"
+#: ../../diskdrake.pm_.c:478
+msgid "Change partition type"
msgstr ""
-#: ../diskdrake.pm_.c:324
-msgid "Change partition type"
+#: ../../diskdrake.pm_.c:479
+msgid "Which filesystem do you want?"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:482 ../../diskdrake.pm_.c:740
+msgid "You can't use ReiserFS for partitions smaller than 32MB"
msgstr ""
-#: ../diskdrake.pm_.c:325
-msgid "Which partition type do you want?"
+#: ../../diskdrake.pm_.c:498
+#, c-format
+msgid "Where do you want to mount loopback file %s?"
msgstr ""
-#: ../diskdrake.pm_.c:339
+#: ../../diskdrake.pm_.c:499
#, c-format
msgid "Where do you want to mount device %s?"
msgstr ""
-#: ../diskdrake.pm_.c:340
-msgid "Mount point"
+#: ../../diskdrake.pm_.c:504
+msgid ""
+"Can't unset mount point as this partition is used for loop back.\n"
+"Remove the loopback first"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:523
+#, c-format
+msgid "After formatting partition %s, all data on this partition will be lost"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:525
+msgid "Formatting"
msgstr ""
-#: ../diskdrake.pm_.c:361
-msgid "formatting"
+#: ../../diskdrake.pm_.c:526
+#, c-format
+msgid "Formatting loopback file %s"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:527 ../../install_steps_interactive.pm_.c:402
+#, c-format
+msgid "Formatting partition %s"
msgstr ""
-#: ../diskdrake.pm_.c:367
+#: ../../diskdrake.pm_.c:532
msgid "After formatting all partitions,"
msgstr ""
-#: ../diskdrake.pm_.c:367
+#: ../../diskdrake.pm_.c:532
msgid "all data on these partitions will be lost"
msgstr ""
-#: ../diskdrake.pm_.c:377
-msgid "Which disk do you want to move to?"
+#: ../../diskdrake.pm_.c:538
+msgid "Move"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:539
+msgid "Which disk do you want to move it to?"
msgstr ""
-#: ../diskdrake.pm_.c:381
+#: ../../diskdrake.pm_.c:540
msgid "Sector"
msgstr ""
-#: ../diskdrake.pm_.c:382
-msgid "Which sector do you want to move to?"
+#: ../../diskdrake.pm_.c:541
+msgid "Which sector do you want to move it to?"
msgstr ""
-#: ../diskdrake.pm_.c:385
+#: ../../diskdrake.pm_.c:544
msgid "Moving"
msgstr ""
-#: ../diskdrake.pm_.c:385
+#: ../../diskdrake.pm_.c:544
msgid "Moving partition..."
msgstr ""
-#: ../diskdrake.pm_.c:394
+#: ../../diskdrake.pm_.c:554
#, c-format
msgid "Partition table of drive %s is going to be written to disk!"
msgstr ""
-#: ../diskdrake.pm_.c:396
+#: ../../diskdrake.pm_.c:556
msgid "You'll need to reboot before the modification can take place"
msgstr ""
-#: ../diskdrake.pm_.c:417
-msgid "Computing fat filesystem bounds"
+#: ../../diskdrake.pm_.c:577
+msgid "Computing FAT filesystem bounds"
msgstr ""
-#: ../diskdrake.pm_.c:417 ../diskdrake.pm_.c:462
+#: ../../diskdrake.pm_.c:577 ../../diskdrake.pm_.c:637
+#: ../../install_interactive.pm_.c:107
msgid "Resizing"
msgstr ""
-#: ../diskdrake.pm_.c:431
-msgid "resizing"
+#: ../../diskdrake.pm_.c:600
+msgid "This partition is not resizeable"
msgstr ""
-#: ../diskdrake.pm_.c:441
+#: ../../diskdrake.pm_.c:605
+msgid "All data on this partition should be backed-up"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:607
+#, c-format
+msgid "After resizing partition %s, all data on this partition will be lost"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:617
msgid "Choose the new size"
msgstr ""
-#: ../diskdrake.pm_.c:441 ../install_steps_graphical.pm_.c:303
+#: ../../diskdrake.pm_.c:617 ../../install_steps_graphical.pm_.c:287
+#: ../../install_steps_graphical.pm_.c:334
+#: ../../install_steps_interactive.pm_.c:518
+#: ../../partition_table_raw.pm_.c:101
msgid "MB"
msgstr ""
-#: ../diskdrake.pm_.c:488
+#: ../../diskdrake.pm_.c:674
msgid "Create a new partition"
msgstr ""
-#: ../diskdrake.pm_.c:504
+#: ../../diskdrake.pm_.c:700
msgid "Start sector: "
msgstr ""
-#: ../diskdrake.pm_.c:507
+#: ../../diskdrake.pm_.c:704 ../../diskdrake.pm_.c:779
msgid "Size in MB: "
msgstr ""
-#: ../diskdrake.pm_.c:510
+#: ../../diskdrake.pm_.c:707 ../../diskdrake.pm_.c:782
msgid "Filesystem type: "
msgstr ""
-#: ../diskdrake.pm_.c:512
+#: ../../diskdrake.pm_.c:710
msgid "Preference: "
msgstr ""
-#: ../diskdrake.pm_.c:554 ../diskdrake.pm_.c:570
+#: ../../diskdrake.pm_.c:758
+msgid "This partition can't be used for loopback"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:768
+msgid "Loopback"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:778
+msgid "Loopback file name: "
+msgstr ""
+
+#: ../../diskdrake.pm_.c:804
+msgid "File already used by another loopback, choose another one"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:805
+msgid "File already exists. Use it?"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:827 ../../diskdrake.pm_.c:843
msgid "Select file"
msgstr ""
-#: ../diskdrake.pm_.c:563
+#: ../../diskdrake.pm_.c:836
msgid ""
"The backup partition table has not the same size\n"
"Still continue?"
msgstr ""
-#: ../diskdrake.pm_.c:571
+#: ../../diskdrake.pm_.c:844
msgid "Warning"
msgstr ""
-#: ../diskdrake.pm_.c:572
+#: ../../diskdrake.pm_.c:845
msgid ""
"Insert a floppy in drive\n"
"All data on this floppy will be lost"
msgstr ""
-#: ../diskdrake.pm_.c:586
+#: ../../diskdrake.pm_.c:856
msgid "Trying to rescue partition table"
msgstr ""
-#: ../fs.pm_.c:67 ../fs.pm_.c:73
-#, c-format
-msgid "%s formatting of %s failed"
+#: ../../diskdrake.pm_.c:867
+msgid "device"
msgstr ""
-#: ../fs.pm_.c:92
+#: ../../diskdrake.pm_.c:868
+msgid "level"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:869
+msgid "chunk size"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:881
+msgid "Choose an existing RAID to add to"
+msgstr ""
+
+#: ../../diskdrake.pm_.c:882
+msgid "new"
+msgstr ""
+
+#: ../../fs.pm_.c:88 ../../fs.pm_.c:95 ../../fs.pm_.c:101 ../../fs.pm_.c:107
#, c-format
-msgid "don't know how to format %s in type %s"
+msgid "%s formatting of %s failed"
msgstr ""
-#: ../fs.pm_.c:105
-msgid "nfs mount failed"
+#: ../../fs.pm_.c:133
+#, c-format
+msgid "I don't know how to format %s in type %s"
msgstr ""
-#: ../fs.pm_.c:122
+#: ../../fs.pm_.c:218
msgid "mount failed: "
msgstr ""
-#: ../fs.pm_.c:133
+#: ../../fs.pm_.c:230
#, c-format
msgid "error unmounting %s: %s"
msgstr ""
-#: ../fsedit.pm_.c:162
+#: ../../fsedit.pm_.c:235
msgid "Mount points must begin with a leading /"
msgstr ""
-#: ../fsedit.pm_.c:165
+#: ../../fsedit.pm_.c:238
#, c-format
-msgid "There is already a partition with mount point %s"
+msgid "There is already a partition with mount point %s\n"
msgstr ""
-#: ../fsedit.pm_.c:294
+#: ../../fsedit.pm_.c:246
+#, c-format
+msgid "Circular mounts %s\n"
+msgstr ""
+
+#: ../../fsedit.pm_.c:258
+msgid "This directory should remain within the root filesystem"
+msgstr ""
+
+#: ../../fsedit.pm_.c:259
+msgid "You need a true filesystem (ext2, reiserfs) for this mount point\n"
+msgstr ""
+
+#: ../../fsedit.pm_.c:335
#, c-format
msgid "Error opening %s for writing: %s"
msgstr ""
-#: ../fsedit.pm_.c:363
+#: ../../fsedit.pm_.c:417
msgid ""
"An error has occurred - no valid devices were found on which to create new "
"filesystems. Please check your hardware for the cause of this problem"
msgstr ""
-#: ../fsedit.pm_.c:378
+#: ../../fsedit.pm_.c:431
msgid "You don't have any partitions!"
msgstr ""
-#: ../help.pm_.c:7 ../help.pm_.c:238
-msgid "Choose preferred language for install and system usage."
+#: ../../help.pm_.c:9
+msgid ""
+"Please choose your preferred language for installation and system usage."
+msgstr ""
+
+#: ../../help.pm_.c:12
+msgid ""
+"You need to accept the terms of the above license to continue installation.\n"
+"\n"
+"\n"
+"Please click on \"Accept\" if you agree with its terms.\n"
+"\n"
+"\n"
+"Please click on \"Refuse\" if you disagree with its terms. Installation will "
+"end without modifying your current\n"
+"configuration."
msgstr ""
-#: ../help.pm_.c:10 ../help.pm_.c:241
+#: ../../help.pm_.c:22
msgid "Choose the layout corresponding to your keyboard from the list above"
msgstr ""
-#: ../help.pm_.c:13 ../help.pm_.c:244
+#: ../../help.pm_.c:25
+msgid ""
+"If you wish other languages (than the one you choose at\n"
+"beginning of installation) will be available after installation, please "
+"chose\n"
+"them in list above. If you want select all, you just need to select \"All\"."
+msgstr ""
+
+#: ../../help.pm_.c:30
+msgid ""
+"Please choose \"Install\" if there are no previous version of "
+"Linux-Mandrake\n"
+"installed or if you wish to use several operating systems.\n"
+"\n"
+"\n"
+"Please choose \"Update\" if you wish to update an already installed version "
+"of Linux-Mandrake.\n"
+"\n"
+"\n"
+"Depend of your knowledge in GNU/Linux, you can choose one of the following "
+"levels to install or update your\n"
+"Linux-Mandrake operating system:\n"
+"\n"
+"\t* Recommanded: if you have never installed a GNU/Linux operating system "
+"choose this. Installation will be\n"
+"\t be very easy and you will be asked only on few questions.\n"
+"\n"
+"\n"
+"\t* Customized: if you are familiar enough with GNU/Linux, you may choose "
+"the primary usage (workstation, server,\n"
+"\t development) of your sytem. You will need to answer to more questions "
+"than in \"Recommanded\" installation\n"
+"\t class, so you need to know how GNU/Linux works to choose this "
+"installation class.\n"
+"\n"
+"\n"
+"\t* Expert: if you have a good knowledge in GNU/Linux, you can choose this "
+"installation class. As in \"Customized\"\n"
+"\t installation class, you will be able to choose the primary usage "
+"(workstation, server, development). Be very\n"
+"\t careful before choose this installation class. You will be able to "
+"perform a higly customized installation.\n"
+"\t Answer to some questions can be very difficult if you haven't a good "
+"knowledge in GNU/Linux. So, don't choose\n"
+"\t this installation class unless you know what you are doing."
+msgstr ""
+
+#: ../../help.pm_.c:56
msgid ""
-"Choose \"Installation\" if there are no previous versions of Linux\n"
-"installed, or if you wish use to multiple distributions or versions.\n"
+"Select:\n"
+"\n"
+" - Customized: If you are familiar enough with GNU/Linux, you may then "
+"choose\n"
+" the primary usage for your machine. See below for details.\n"
"\n"
"\n"
-"Choose \"Update\" if you wish to update a previous version of Mandrake\n"
-"Linux: 5.1 (Venice), 5.2 (Leeloo), 5.3 (Festen) or 6.0 (Venus)."
+" - Expert: This supposes that you are fluent with GNU/Linux and want to\n"
+" perform a highly customized installation. As for a \"Customized\"\n"
+" installation class, you will be able to select the usage for your "
+"system.\n"
+" But please, please, DO NOT CHOOSE THIS UNLESS YOU KNOW WHAT YOU ARE "
+"DOING!"
msgstr ""
-#: ../help.pm_.c:21 ../help.pm_.c:252
+#: ../../help.pm_.c:68
msgid ""
-"Select:\n"
+"You must now define your machine usage. Choices are:\n"
+"\n"
+"\t* Workstation: this the ideal choice if you intend to use your machine "
+"primarily for everyday use, at office or\n"
+"\t at home.\n"
+"\n"
+"\n"
+"\t* Development: if you intend to use your machine primarily for software "
+"development, it is the good choice. You\n"
+"\t will then have a complete collection of software installed in order to "
+"compile, debug and format source code,\n"
+"\t or create software packages.\n"
+"\n"
+"\n"
+"\t* Server: if you intend to use this machine as a server, it is the good "
+"choice. Either a file server (NFS or\n"
+"\t SMB), a print server (Unix style or Microsoft Windows style), an "
+"authentication server (NIS), a database\n"
+"\t server and so on. As such, do not expect any gimmicks (KDE, GNOME, etc.) "
+"to be installed."
+msgstr ""
+
+#: ../../help.pm_.c:84
+msgid ""
+"DrakX will attempt to look for PCI SCSI adapter(s). If DrakX\n"
+"finds an SCSI adapter and knows which driver to use, it will be "
+"automatically\n"
+"installed.\n"
+"\n"
+"\n"
+"If you have no SCSI adapter, an ISA SCSI adapter or a PCI SCSI adapter that\n"
+"DrakX doesn't recognize, you will be asked if a SCSI adapter is present in "
+"your\n"
+"system. If there is no adapter present, you can click on \"No\". If you "
+"click on\n"
+"\"Yes\", a list of drivers will be presented from which you can select your\n"
+"specific adapter.\n"
+"\n"
+"\n"
+"If you have to manually specify your adapter, DrakX will ask if you want to\n"
+"specify options for it. You should allow DrakX to probe the hardware for "
+"the\n"
+"options. This usually works well.\n"
+"\n"
+"\n"
+"If not, you will need to provide options to the driver. Please review the "
+"User\n"
+"Guide (chapter 3, section \"Collective informations on your hardware) for "
+"hints\n"
+"on retrieving this information from hardware documentation, from the\n"
+"manufacturer's Web site (if you have Internet access) or from Microsoft "
+"Windows\n"
+"(if you have it on your system)."
+msgstr ""
+
+#: ../../help.pm_.c:108
+msgid ""
+"At this point, you need to choose where to install your\n"
+"Linux-Mandrake operating system on your hard drive. If it is empty or if an\n"
+"existing operating system uses all the space available on it, you need to\n"
+"partition it. Basically, partitioning a hard drive consists of logically\n"
+"dividing it to create space to install your new Linux-Mandrake system.\n"
+"\n"
+"\n"
+"Because the effects of the partitioning process are usually irreversible,\n"
+"partitioning can be intimidating and stressful if you are an inexperienced "
+"user.\n"
+"This wizard simplifies this process. Before beginning, please consult the "
+"manual\n"
+"and take your time.\n"
+"\n"
+"\n"
+"You need at least two partitions. One is for the operating system itself and "
+"the\n"
+"other is for the virtual memory (also called Swap).\n"
+"\n"
+"\n"
+"If partitions have been already defined (from a previous installation or "
+"from\n"
+"another partitioning tool), you just need choose those to use to install "
+"your\n"
+"Linux system.\n"
+"\n"
+"\n"
+"If partitions haven't been already defined, you need to create them. \n"
+"To do that, use the wizard available above. Depending of your hard drive\n"
+"configuration, several solutions can be available:\n"
+"\n"
+"\t* Use existing partition: the wizard has detected one or more existing "
+"Linux partitions on your hard drive. If\n"
+"\t you want to keep them, choose this option. \n"
+"\n"
+"\n"
+"\t* Erase entire disk: if you want delete all data and all partitions "
+"present on your hard drive and replace them by\n"
+"\t your new Linux-Mandrake system, you can choose this option. Be careful "
+"with this solution, you will not be\n"
+"\t able to revert your choice after confirmation.\n"
+"\n"
+"\n"
+"\t* Use the free space on the Windows partition: if Microsoft Windows is "
+"installed on your hard drive and takes\n"
+"\t all space available on it, you have to create free space for Linux data. "
+"To do that you can delete your\n"
+"\t Microsoft Windows partition and data (see \"Erase entire disk\" or "
+"\"Expert mode\" solutions) or resize your\n"
+"\t Microsoft Windows partition. Resizing can be performed without loss of "
+"any data. This solution is\n"
+"\t recommended if you want use both Linux-Mandrake and Microsoft Windows on "
+"same computer.\n"
+"\n"
+"\n"
+"\t Before choosing this solution, please understand that the size of your "
+"Microsoft\n"
+"\t Windows partition will be smaller than at present time. It means that "
+"you will have less free space under\n"
+"\t Microsoft Windows to store your data or install new software.\n"
+"\n"
+"\n"
+"\t* Expert mode: if you want to partition manually your hard drive, you can "
+"choose this option. Be careful before\n"
+"\t choosing this solution. It is powerful but it is very dangerous. You can "
+"lose all your data very easily. So,\n"
+"\t don't choose this solution unless you know what you are doing."
+msgstr ""
+
+#: ../../help.pm_.c:160
+msgid ""
+"At this point, you need to choose what\n"
+"partition(s) to use to install your new Linux-Mandrake system. If "
+"partitions\n"
+"have been already defined (from a previous installation of GNU/Linux or "
+"from\n"
+"another partitioning tool), you can use existing partitions. In other "
+"cases,\n"
+"hard drive partitions must be defined.\n"
+"\n"
+"\n"
+"To create partitions, you must first select a hard drive. You can select "
+"the\n"
+"disk for partitioning by clicking on \"hda\" for the first IDE drive, "
+"\"hdb\" for\n"
+"the second or \"sda\" for the first SCSI drive and so on.\n"
+"\n"
+"\n"
+"To partition the selected hard drive, you can use these options:\n"
+"\n"
+" * Clear all: this option deletes all partitions available on the selected "
+"hard drive.\n"
+"\n"
+"\n"
+" * Auto allocate:: this option allows you to automatically create Ext2 and "
+"swap partitions in free space of your\n"
+" hard drive.\n"
+"\n"
+"\n"
+" * Rescue partition table: if your partition table is damaged, you can try "
+"to recover it using this option. Please\n"
+" be careful and remember that it can fail.\n"
+"\n"
+"\n"
+" * Undo: you can use this option to cancel your changes.\n"
+"\n"
+"\n"
+" * Reload: you can use this option if you wish to undo all changes and "
+"load your initial partitions table\n"
+"\n"
+"\n"
+" * Wizard: If you wish to use a wizard to partition your hard drive, you "
+"can use this option. It is recommended if\n"
+" you do not have a good knowledge in partitioning.\n"
+"\n"
+"\n"
+" * Restore from floppy: if you have saved your partition table on a floppy "
+"during a previous installation, you can\n"
+" recover it using this option.\n"
+"\n"
+"\n"
+" * Save on floppy: if you wish to save your partition table on a floppy to "
+"be able to recover it, you can use this\n"
+" option. It is strongly recommended to use this option\n"
+"\n"
+"\n"
+" * Done: when you have finished partitioning your hard drive, use this "
+"option to save your changes.\n"
+"\n"
+"\n"
+"For information, you can reach any option using the keyboard: navigate "
+"trough the partitions using Tab and Up/Down arrows.\n"
+"\n"
+"\n"
+"When a partition is selected, you can use:\n"
+"\n"
+" * Ctrl-c to create a new partition (when a empty partition is "
+"selected)\n"
+"\n"
+" * Ctrl-d to delete a partition\n"
+"\n"
+" * Ctrl-m to set the mount point"
+msgstr ""
+
+#: ../../help.pm_.c:218
+msgid ""
+"Above are listed the existing Linux partitions detected on\n"
+"your hard drive. You can keep choices make by the wizard, they are good for "
+"a\n"
+"common usage. If you change these choices, you must at least define a root\n"
+"partition (\"/\"). Don't choose a too little partition or you will not be "
+"able\n"
+"to install enough software. If you want store your data on a separate "
+"partition,\n"
+"you need also to choose a \"/home\" (only possible if you have more than "
+"one\n"
+"Linux partition available).\n"
+"\n"
+"\n"
+"For information, each partition is listed as follows: \"Name\", "
+"\"Capacity\".\n"
+"\n"
"\n"
-" - Beginner: If you have never installed Linux before, and wish to\n"
-"install the distribution elected \"Product of the year\" for 1999,\n"
-"click here.\n"
+"\"Name\" is coded as follow: \"hard drive type\", \"hard drive number\",\n"
+"\"partition number\" (for example, \"hda1\").\n"
"\n"
-" - Developer: If you are familiar with Linux and will be using the\n"
-"computer primarily for software development, you will find happiness\n"
-"here.\n"
"\n"
-" - Server: If you wish to install a general purpose server, or the\n"
-"Linux distribution elected \"Distribution/Server\" for 1999, select\n"
-"this.\n"
+"\"Hard drive type\" is \"hd\" if your hard drive is an IDE hard drive and "
+"\"sd\"\n"
+"if it is an SCSI hard drive.\n"
"\n"
-" - Expert: If you are fluent with GNU/Linux and want to perform\n"
-"a highly customized installation, this Install Class is for you."
+"\n"
+"\"Hard drive number\" is always a letter after \"hd\" or \"sd\". With IDE "
+"hard drives:\n"
+"\n"
+" * \"a\" means \"master hard drive on the primary IDE controller\",\n"
+"\n"
+" * \"b\" means \"slave hard drive on the primary IDE controller\",\n"
+"\n"
+" * \"c\" means \"master hard drive on the secondary IDE controller\",\n"
+"\n"
+" * \"d\" means \"slave hard drive on the secondary IDE controller\".\n"
+"\n"
+"\n"
+"With SCSI hard drives, a \"a\" means \"primary hard drive\", a \"b\" means "
+"\"secondary hard drive\", etc..."
+msgstr ""
+
+#: ../../help.pm_.c:252
+msgid ""
+"Choose the hard drive you want to erase to install your\n"
+"new Linux-Mandrake partition. Be careful, all data present on it will be "
+"lost\n"
+"and will not be recoverable."
+msgstr ""
+
+#: ../../help.pm_.c:257
+msgid ""
+"Click on \"OK\" if you want to delete all data and\n"
+"partitions present on this hard drive. Be careful, after clicking on \"OK\", "
+"you\n"
+"will not be able to recover any data and partitions present on this hard "
+"drive,\n"
+"including any Windows data.\n"
+"\n"
+"\n"
+"Click on \"Cancel\" to cancel this operation without losing any data and\n"
+"partitions present on this hard drive."
+msgstr ""
+
+#: ../../help.pm_.c:267
+msgid ""
+"More than one Microsoft Windows partition have been\n"
+"detected on your hard drive. Please choose the one you want resize to "
+"install\n"
+"your new Linux-Mandrake operating system.\n"
+"\n"
+"\n"
+"For information, each partition is listed as follow; \"Linux name\", "
+"\"Windows\n"
+"name\" \"Capacity\".\n"
+"\n"
+"\"Linux name\" is coded as follow: \"hard drive type\", \"hard drive "
+"number\",\n"
+"\"partition number\" (for example, \"hda1\").\n"
+"\n"
+"\n"
+"\"Hard drive type\" is \"hd\" if your hard dive is an IDE hard drive and "
+"\"sd\"\n"
+"if it is an SCSI hard drive.\n"
+"\n"
+"\n"
+"\"Hard drive number\" is always a letter putted after \"hd\" or \"sd\". With "
+"IDE hard drives:\n"
+"\n"
+" * \"a\" means \"master hard drive on the primary IDE controller\",\n"
+"\n"
+" * \"b\" means \"slave hard drive on the primary IDE controller\",\n"
+"\n"
+" * \"c\" means \"master hard drive on the secondary IDE controller\",\n"
+"\n"
+" * \"d\" means \"slave hard drive on the secondary IDE controller\".\n"
+"\n"
+"With SCSI hard drives, a \"a\" means \"primary hard drive\", a \"b\" means "
+"\"secondary hard drive\", etc.\n"
+"\n"
+"\n"
+"\"Windows name\" is the letter of your hard drive under Windows (the first "
+"disk\n"
+"or partition is called \"C:\")."
+msgstr ""
+
+#: ../../help.pm_.c:300
+msgid "Please be patient. This operation can take several minutes."
+msgstr ""
+
+#: ../../help.pm_.c:303
+msgid ""
+"Any partitions that have been newly defined must be\n"
+"formatted for use (formatting meaning creating a filesystem).\n"
+"\n"
+"\n"
+"At this time, you may wish to reformat some already existing partitions to "
+"erase\n"
+"the data they contain. If you wish do that, please also select the "
+"partitions\n"
+"you want to format.\n"
+"\n"
+"\n"
+"Please note that it is not necessary to reformat all pre-existing "
+"partitions.\n"
+"You must reformat the partitions containing the operating system (such as "
+"\"/\",\n"
+"\"/usr\" or \"/var\") but do you no have to reformat partitions containing "
+"data\n"
+"that you wish to keep (typically /home).\n"
+"\n"
+"\n"
+"Please be careful selecting partitions, after formatting, all data will be\n"
+"deleted and you will not be able to recover any of them.\n"
+"\n"
+"\n"
+"Click on \"OK\" when you are ready to format partitions.\n"
+"\n"
+"\n"
+"Click on \"Cancel\" if you want to choose other partitions to install your "
+"new\n"
+"Linux-Mandrake operating system."
+msgstr ""
+
+#: ../../help.pm_.c:329
+msgid ""
+"You may now select the group of packages you wish to\n"
+"install or upgrade.\n"
+"\n"
+"\n"
+"DrakX will then check whether you have enough room to install them all. If "
+"not,\n"
+"it will warn you about it. If you want to go on anyway, it will proceed onto "
+"the\n"
+"installation of all selected groups but will drop some packages of lesser\n"
+"interest. At the bottom of the list you can select the option \n"
+"\"Individual package selection\"; in this case you will have to browse "
+"through\n"
+"more than 1000 packages..."
+msgstr ""
+
+#: ../../help.pm_.c:341
+msgid ""
+"You can now choose individually all the packages you\n"
+"wish to install.\n"
+"\n"
+"\n"
+"You can expand or collapse the tree by clicking on options in the left "
+"corner of\n"
+"the packages window.\n"
+"\n"
+"\n"
+"If you prefer to see packages sorted in alphabetic order, click on the icon\n"
+"\"Toggle flat and group sorted\".\n"
+"\n"
+"\n"
+"If you want not to be warned on dependencies, click on \"Automatic\n"
+"dependencies\". If you do this, note that unselecting one package may "
+"silently\n"
+"unselect several other packages which depend on it."
+msgstr ""
+
+#: ../../help.pm_.c:358
+msgid ""
+"If you have all the CDs in the list above, click Ok. If you have\n"
+"none of those CDs, click Cancel. If only some CDs are missing, unselect "
+"them,\n"
+"then click Ok."
+msgstr ""
+
+#: ../../help.pm_.c:363
+msgid ""
+"Your new Linux-Mandrake operating system is currently being\n"
+"installed. This operation should take a few minutes (it depends on size you\n"
+"choose to install and the speed of your computer).\n"
+"\n"
+"\n"
+"Please be patient."
+msgstr ""
+
+#: ../../help.pm_.c:371
+msgid ""
+"You can now test your mouse. Use buttons and wheel to verify\n"
+"if settings are good. If not, you can click on \"Cancel\" to choose another\n"
+"driver."
+msgstr ""
+
+#: ../../help.pm_.c:376
+msgid ""
+"Please select the correct port. For example, the COM1\n"
+"port under MS Windows is named ttyS0 under GNU/Linux."
msgstr ""
-#: ../help.pm_.c:39 ../help.pm_.c:270
+#: ../../help.pm_.c:380
msgid ""
-"DrakX will attempt at first to look for one or more PCI\n"
-"SCSI adapter(s). If it finds it (or them) and knows which driver(s)\n"
-"to use, it will insert it (them) automatically.\n"
+"If you wish to connect your computer to the Internet or\n"
+"to a local network please choose the correct option. Please turn on your "
+"device\n"
+"before choosing the correct option to let DrakX detect it automatically.\n"
"\n"
-"If your SCSI adapter is ISA, or is PCI but DrakX doesn't know\n"
-"which driver to use for this card, or if you have no SCSI adapters\n"
-"at all, you will then be prompted on whether you have one or not.\n"
-"If you have none, answer \"No\". If you have one or more, answer\n"
-"\"Yes\". A list of drivers will then pop up, from which you will\n"
-"have to select one.\n"
"\n"
-"After you have selected the driver, DrakX will ask if you\n"
-"want to specify options for it. First, try and let the driver\n"
-"probe for the hardware: it usually works fine.\n"
+"If you do not have any connection to the Internet or a local network, "
+"choose\n"
+"\"Disable networking\".\n"
"\n"
-"If not, do not forget the information on your hardware that you\n"
-"could get from Windows (if you have it on your system), as\n"
-"suggested by the installation guide. These are the options\n"
-"you will need to provide to the driver."
+"\n"
+"If you wish to configure the network later after installation or if you "
+"have\n"
+"finished to configure your network connection, choose \"Done\"."
msgstr ""
-#: ../help.pm_.c:60 ../help.pm_.c:291
+#: ../../help.pm_.c:393
msgid ""
-"At this point, hard drive partitions must be defined. (Unless you\n"
-"are overwriting a previous install of Linux and have already defined\n"
-"your hard drive partitions as desired.) This operation consists of\n"
-"logically dividing the computer's hard drive capacity into separate\n"
-"areas for use.\n"
+"No modem has been detected. Please select the serial port on which it is "
+"plugged.\n"
"\n"
"\n"
-"Two common partition are: the root partition (/), which is the starting\n"
-"point of the filesystem's directory hierarchy, and /boot, which contains\n"
-"all files necessary to start the operating system when the\n"
-"computer is first turned on.\n"
+"For information, the first serial port (called \"COM1\" under Microsoft\n"
+"Windows) is called \"ttyS0\" under Linux."
+msgstr ""
+
+#: ../../help.pm_.c:400
+msgid ""
+"You may now enter dialup options. If you don't know\n"
+"or are not sure what to enter, the correct informations can be obtained "
+"from\n"
+"your Internet Service Provider. If you do not enter the DNS (name server)\n"
+"information here, this information will be obtained from your Internet "
+"Service\n"
+"Provider at connection time."
+msgstr ""
+
+#: ../../help.pm_.c:407
+msgid ""
+"If your modem is an external modem, please turn on it now to let DrakX "
+"detect it automatically."
+msgstr ""
+
+#: ../../help.pm_.c:410
+msgid "Please turn on your modem and choose the correct one."
+msgstr ""
+
+#: ../../help.pm_.c:413
+msgid ""
+"If you are not sure if informations above are\n"
+"correct or if you don't know or are not sure what to enter, the correct\n"
+"informations can be obtained from your Internet Service Provider. If you do "
+"not\n"
+"enter the DNS (name server) information here, this information will be "
+"obtained\n"
+"from your Internet Service Provider at connection time."
+msgstr ""
+
+#: ../../help.pm_.c:420
+msgid ""
+"You may now enter your host name if needed. If you\n"
+"don't know or are not sure what to enter, the correct informations can be\n"
+"obtained from your Internet Service Provider."
+msgstr ""
+
+#: ../../help.pm_.c:425
+msgid ""
+"You may now configure your network device.\n"
"\n"
+" * IP address: if you don't know or are not sure what to enter, ask your "
+"network administrator.\n"
+" You should not enter an IP address if you select the option \"Automatic "
+"IP\" below.\n"
"\n"
-"Because the effects of this process are usually irreversible, partitioning\n"
-"can be intimidating and stressful to the unexperienced. DiskDrake\n"
-"simplifies the process so that it need not be. Consult the documentation\n"
-"and take your time before proceeding."
+" * Netmask: \"255.255.255.0\" is generally a good choice. If you don't "
+"know or are not sure what to enter,\n"
+" ask your network administrator.\n"
+"\n"
+" * Automatic IP: if your network uses BOOTP or DHCP protocol, select this "
+"option. If selected, no value is needed in\n"
+" \"IP address\". If you don't know or are not sure if you need to select "
+"this option, ask your network administrator."
+msgstr ""
+
+#: ../../help.pm_.c:437
+msgid ""
+"You may now enter your host name if needed. If you\n"
+"don't know or are not sure what to enter, ask your network administrator."
msgstr ""
-#: ../help.pm_.c:79 ../help.pm_.c:310
+#: ../../help.pm_.c:441
msgid ""
-"Any partitions that have been newly defined must be formatted for\n"
-"use (formatting meaning creating a filesystem). At this time, you may\n"
-"wish to re-format some already existing partitions to erase the data\n"
-"they contain. Note: it is not necessary to re-format pre-existing\n"
-"partitions, particularly if they contain files or data you wish to keep.\n"
-"Typically retained are /home and /usr/local."
+"You may now enter your host name if needed. If you\n"
+"don't know or are not sure what to enter, leave blank."
msgstr ""
-#: ../help.pm_.c:87 ../help.pm_.c:318
+#: ../../help.pm_.c:445
msgid ""
-"You may now select the packages you wish to install.\n"
+"You may now enter dialup options. If you're not sure what to enter, the\n"
+"correct information can be obtained from your ISP."
+msgstr ""
+
+#: ../../help.pm_.c:449
+msgid ""
+"If you will use proxies, please configure them now. If you don't know if\n"
+"you should use proxies, ask your network administrator or your ISP."
+msgstr ""
+
+#: ../../help.pm_.c:453
+msgid ""
+"You can install cryptographic package if your internet connection has been\n"
+"set up correctly. First choose a mirror where you wish to download packages "
+"and\n"
+"after that select the packages to install.\n"
+"\n"
+"\n"
+"Note you have to select mirror and cryptographic packages according\n"
+"to your legislation."
+msgstr ""
+
+#: ../../help.pm_.c:462
+msgid "You can now select your timezone according to where you live."
+msgstr ""
+
+#: ../../help.pm_.c:465
+msgid ""
+"GNU/Linux manages time in GMT (Greenwich Manage\n"
+"Time) and translates it in local time according to the time zone you have\n"
+"selected.\n"
+"\n"
+"\n"
+"If you use Microsoft Windows on this computer, choose \"No\"."
+msgstr ""
+
+#: ../../help.pm_.c:473
+msgid ""
+"You may now choose which services you want to start at boot time.\n"
"\n"
"\n"
-"Please note that some packages require the installation of others.\n"
-"These are referred to as package dependencies. The packages you select,\n"
-"and the packages they require will be automatically selected for\n"
-"install. It is impossible to install a package without installing all\n"
-"of its dependencies.\n"
+"When your mouse comes over an item, a small balloon help will popup which\n"
+"describes the role of the service.\n"
"\n"
"\n"
-"Information on each category and specific package is available in the\n"
-"area titled \"Info\", located between list of packages and the five\n"
-"buttons \"Go\", \"Select more/less\" and \"Show more/less\"."
+"Be very careful in this step if you intend to use your machine as a server: "
+"you\n"
+"will probably want not to start any services that you don't need. Please\n"
+"remember that several services can be dangerous if they are enable on a "
+"server.\n"
+"In general, select only the services that you really need."
msgstr ""
-#: ../help.pm_.c:102 ../help.pm_.c:333
+#: ../../help.pm_.c:486
msgid ""
-"The packages selected are now being installed. This operation\n"
-"should only take a few minutes."
+"You can configure a local printer (connected to your computer) or remote\n"
+"printer (accessible via a Unix, Netware or Microsoft Windows network)."
msgstr ""
-#: ../help.pm_.c:106 ../help.pm_.c:337
+#: ../../help.pm_.c:490
msgid ""
-"If DrakX failed to find your mouse, or if you want to\n"
-"check what it has done, you will be presented the list of mice\n"
-"above.\n"
+"If you wish to be able to print, please choose one printing system between\n"
+"CUPS and LPR.\n"
"\n"
"\n"
-"If you agree with DrakX' settings, just jump to the section\n"
-"you want by clicking on it in the menu on the left. Otherwise,\n"
-"choose a mouse type in the menu which you think is the closest\n"
-"match for your mouse.\n"
+"CUPS is a new, powerful and flexible printing system for Unix systems (CUPS\n"
+"means \"Common Unix Printing System\"). It is the default printing system "
+"in\n"
+"Linux-Mandrake.\n"
"\n"
-"In case of a serial mouse, you will also have to tell DrakX\n"
-"which serial port it is connected to."
+"\n"
+"LPR is the old printing system used in previous Linux-Mandrake "
+"distributions.\n"
+"\n"
+"\n"
+"If you don't have printer, click on \"None\"."
msgstr ""
-#: ../help.pm_.c:120 ../help.pm_.c:351
+#: ../../help.pm_.c:505
msgid ""
-"This section is dedicated to configuring a local area network,\n"
-"or LAN. If you answer \"Yes\" here, DrakX will try to find an\n"
-"Ethernet adapter on your machine. PCI adapters should be found and\n"
-"initialized automatically. However, if your peripheral is ISA,\n"
-"autodetection will not work, and you will have to choose a driver\n"
-"from the list that will appear then.\n"
+"GNU/Linux can deal with many types of printer. Each of these types requires\n"
+"a different setup.\n"
+"\n"
"\n"
+"If your printer is physically connected to your computer, select \"Local\n"
+"printer\".\n"
"\n"
-"As for SCSI adapters, you can let the driver probe for the adapter\n"
-"in the first time, otherwise you will have to specify the options\n"
-"to the driver that you will have fetched from Windows' control\n"
-"panel.\n"
"\n"
+"If you want to access a printer located on a remote Unix machine, select\n"
+"\"Remote printer\".\n"
"\n"
-"If you install a Linux-Mandrake system on a machine which is part\n"
-"of an already existing network, the network administrator will\n"
-"have given you all necessary information (IP address, network\n"
-"submask or netmask for short, and hostname). If you're setting\n"
-"up a private network at home for example, you should choose\n"
-"addresses "
+"\n"
+"If you want to access a printer located on a remote Microsoft Windows "
+"machine\n"
+"(or on Unix machine using SMB protocol), select \"SMB/Windows 95/98/NT\"."
msgstr ""
-#: ../help.pm_.c:142 ../help.pm_.c:145 ../help.pm_.c:232 ../help.pm_.c:373
-#: ../help.pm_.c:376 ../help.pm_.c:463 ../install2.pm_.c:65
-msgid "Help"
+#: ../../help.pm_.c:521
+msgid ""
+"Please turn on your printer before continuing to let DrakX detect it.\n"
+"\n"
+"You have to enter some informations here.\n"
+"\n"
+"\n"
+" * Name of printer: the print spooler uses \"lp\" as default printer name. "
+"So, you must have a printer named \"lp\".\n"
+" If you have only one printer, you can use several names for it. You "
+"just need to separate them by a pipe\n"
+" character (a \"|\"). So, if you prefer a more meaningful name, you have "
+"to put it first, eg: \"My printer|lp\".\n"
+" The printer having \"lp\" in its name(s) will be the default printer.\n"
+"\n"
+"\n"
+" * Description: this is optional but can be useful if several printers are "
+"connected to your computer or if you allow\n"
+" other computers to access to this printer.\n"
+"\n"
+"\n"
+" * Location: if you want to put some information on your\n"
+" printer location, put it here (you are free to write what\n"
+" you want, for example \"2nd floor\").\n"
msgstr ""
-#: ../help.pm_.c:148
+#: ../../help.pm_.c:542
msgid ""
-"Linux can deal with many types of printer. Each of these\n"
-"types require a different setup.\n"
+"You need to enter some informations here.\n"
+"\n"
+"\n"
+" * Name of queue: the print spooler uses \"lp\" as default printer name. "
+"So, you need have a printer named \"lp\".\n"
+" If you have only one printer, you can use several names for it. You just "
+"need to separate them by a pipe\n"
+" character (a \"|\"). So, if you prefer to have a more meaningful name, "
+"you have to put it first, eg: \"My printer|lp\".\n"
+" The printer having \"lp\" in its name(s) will be the default printer.\n"
+"\n"
+" \n"
+" * Spool directory: it is in this directory that printing jobs are stored. "
+"Keep the default choice\n"
+" if you don't know what to use\n"
"\n"
"\n"
-"If your printer is directly connected to your computer, select\n"
-"\"Local printer\". You will then have to tell which port your\n"
-"printer is connected to, and select the appropriate filter.\n"
+" * Printer Connection: If your printer is physically connected to your "
+"computer, select \"Local printer\".\n"
+" If you want to access a printer located on a remote Unix machine, "
+"select \"Remote lpd printer\".\n"
"\n"
"\n"
-"If you want to access a printer located on a remote Unix machine,\n"
-"you will have to select \"Remote lpd queue\". In order to make\n"
-"it work, no username or password is required, but you will need\n"
-"to know the name of the printing queue on this server.\n"
+" If you want to access a printer located on a remote Microsoft Windows "
+"machine (or on Unix machine using SMB\n"
+" protocol), select \"SMB/Windows 95/98/NT\".\n"
"\n"
"\n"
-"If you want to access a SMB printer (which means, a printer located\n"
-"on a remote Windows 9x/NT machine), you will have to specify its\n"
-"SMB name (which is not its TCP/IP name), and possibly its IP address,\n"
-"plus the username, workgroup and password required in order to\n"
-"access the printer, and of course the name of the printer. The same goes\n"
-"for a NetWare printer, except that you need no workgroup information."
+" If you want to acces a printer located on NetWare network, select "
+"\"NetWare\".\n"
msgstr ""
-#: ../help.pm_.c:171 ../help.pm_.c:402
+#: ../../help.pm_.c:567
msgid ""
-"You must now enter the root password for your Linux-Mandrake\n"
-"system. The password must be entered twice to verify that both\n"
-"password entries are identical.\n"
+"Your printer has not been detected. Please enter the name of the device on\n"
+"which it is connected.\n"
"\n"
"\n"
-"Root is the administrator of the system, and is the only user\n"
-"allowed to modify the system configuration. Therefore, choose\n"
-"this password carefully! Unauthorized use of the root account can\n"
-"be extremely dangerous to the integrity of the system and its data,\n"
-"and other systems connected to it. The password should be a\n"
-"mixture of alphanumeric characters and a least 8 characters long. It\n"
-"should *never* be written down. Do not make the password too long or\n"
-"complicated, though: you must be able to remember without too much\n"
-"effort."
+"For information, most printers are connected on the first parallel port. "
+"This\n"
+"one is called \"/dev/lp0\" under GNU/Linux and \"LPT1\" under Microsoft "
+"Windows."
msgstr ""
-#: ../help.pm_.c:187 ../help.pm_.c:418
+#: ../../help.pm_.c:575
+msgid "You must now select your printer in the above list."
+msgstr ""
+
+#: ../../help.pm_.c:578
+msgid ""
+"Please select the right options according to your printer.\n"
+"Please see its documentation if you don't know what choose here.\n"
+"\n"
+"\n"
+"You will be able to test your configuration in next step and you will be "
+"able to modify it if it doesn't work as you want."
+msgstr ""
+
+#: ../../help.pm_.c:585
+msgid ""
+"You can now enter the root password for your Linux-Mandrake system.\n"
+"The password must be entered twice to verify that both password entries are "
+"identical.\n"
+"\n"
+"\n"
+"Root is the system's administrator and is the only user allowed to modify "
+"the\n"
+"system configuration. Therefore, choose this password carefully. \n"
+"Unauthorized use of the root account can be extemely dangerous to the "
+"integrity\n"
+"of the system, its data and other system connected to it.\n"
+"\n"
+"\n"
+"The password should be a mixture of alphanumeric characters and at least 8\n"
+"characters long. It should never be written down.\n"
+"\n"
+"\n"
+"Do not make the password too long or complicated, though: you must be able "
+"to\n"
+"remember it without too much effort."
+msgstr ""
+
+#: ../../help.pm_.c:603
+msgid ""
+"To enable a more secure system, you should select \"Use shadow file\" and\n"
+"\"Use MD5 passwords\"."
+msgstr ""
+
+#: ../../help.pm_.c:607
+msgid ""
+"If your network uses NIS, select \"Use NIS\". If you don't know, ask your\n"
+"network administrator."
+msgstr ""
+
+#: ../../help.pm_.c:611
msgid ""
"You may now create one or more \"regular\" user account(s), as\n"
-"opposed to the \"priviledged\" user account, root. You can create\n"
+"opposed to the \"privileged\" user account, root. You can create\n"
"one or more account(s) for each person you want to allow to use\n"
"the computer. Note that each user account will have its own\n"
"preferences (graphical environment, program settings, etc.)\n"
@@ -980,1331 +2255,3669 @@ msgid ""
"and maintenance purposes."
msgstr ""
-#: ../help.pm_.c:206 ../help.pm_.c:437
+#: ../../help.pm_.c:630
msgid ""
-"Please, please, answer \"Yes\" here! Just for example, when you\n"
-"reinstall Windows, it will overwrite the boot sector. Unless you have\n"
-"made the bootdisk as suggested, you won't be able to boot into Linux\n"
-"any more!"
+"Creating a boot disk is strongly recommended. If you can't\n"
+"boot your computer, it's the only way to rescue your system without\n"
+"reinstalling it."
msgstr ""
-#: ../help.pm_.c:212 ../help.pm_.c:443
+#: ../../help.pm_.c:635
msgid ""
"You need to indicate where you wish\n"
-"to place the information required to boot to Linux.\n"
+"to place the information required to boot to GNU/Linux.\n"
"\n"