diff options
Diffstat (limited to 'tools')
70 files changed, 0 insertions, 4545 deletions
diff --git a/tools/.cvsignore b/tools/.cvsignore deleted file mode 100644 index 88754bc8b..000000000 --- a/tools/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -rpm2header -gendepslist -xhost+ -rpcinfo-flushed diff --git a/tools/2adsldb.pm b/tools/2adsldb.pm deleted file mode 100644 index 23328aafc..000000000 --- a/tools/2adsldb.pm +++ /dev/null @@ -1,17 +0,0 @@ -open F, "isplist.txt" or die "file $file not found"; -open G, ">tutu" or die "file $file not found"; -foreach (<F>) { - s/\#.*//; - /.*ADSL.*/ or next; -#| NOM | PAYS | CONNECTION | MAILTYPE | SMTP | MAILSERVER | NEWS | MY1DNS | MY2DNS | PROXY | PROXYSERVER | DHCP | EMAIL - s/(.*)france(.*)/$1France$2/; - s/(.*)FRANCE(.*)/$1France$2/; - s/(.*)USA(.*)/$1United States$2/; - s/(.*)U.S.A(.*)/$1United States$2/; - s/(.*)US(.*)/$1United States$2/; - s/(.*)usa(.*)/$1United States$2/; - s/(.*)club-internet(.*)/$1club internet$2/; - my ($name, $country, $connexion, $mailtype, $smtp, $popserver, $mailserver, $news, $dns1, $dns2, $proxy, $proxyserver, $dhcp, $email) = split /\|/; - print G join("|", $country, join("=>", $name, $dns1, $dns2)), "\n"; #$domain, -} - diff --git a/tools/2isdndb.pm b/tools/2isdndb.pm deleted file mode 100644 index 536808706..000000000 --- a/tools/2isdndb.pm +++ /dev/null @@ -1,25 +0,0 @@ -open F, "isdndb.txt" or die "file $file not found"; -open G, ">tutu" or die "file $file not found"; -foreach (<F>) { - s/\#.*//; -# s/\[City\]\s+National//; - /\[Country\]\s*(.*)/ and $country = $1; - /\[City\]\s*(.*)/ and $city = $1; - /\[Name\]\s*(.*)/ and $name = $1; - /\[Prefix\]\s*(.*)/ and $prefix = $1; - /\[ISDN\]\s*(.*)/ and $isdn = $1; - /\[Encaps\]\s*.*/ and do { defined $dns1 and $dns2=""; }; - /\[Domain\]\s*(.*)/ and $domain = $1; - /\[DNS\]\s*(.*)/ and ($dns1 ? $dns2 : $dns1) = $1; - /\[End\]\s*(.*)/ and do { undef $name; undef $prefix; undef $isdn; undef $domain; undef $dns1; undef $dns2; }; - if ($isdn && !$prefix) { $prefix = "" } - if (defined $name && defined $isdn && defined $domain && defined $dns1 && defined $dns2) { - print G join("|", $country, $city, join("=>", $name, $prefix . $isdn, $domain, $dns1, $dns2)), "\n"; - undef $name; - undef $prefix; - undef $isdn; - undef $domain; - undef $dns1; - undef $dns2; - } -} diff --git a/tools/Makefile b/tools/Makefile deleted file mode 100644 index 67e34ade8..000000000 --- a/tools/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -ROOTDEST = /export -DEST = $(ROOTDEST)/Mandrake/mdkinst -RPMS = $(wildcard $(ROOTDEST)/Mandrake/RPMS/*.rpm) -DIRS = ddcprobe serial_probe -BASE = $(ROOTDEST)/Mandrake/base -CFLAGS = -Wall - -.PHONY: clean install $(DIRS) - -all: $(DIRS) xhost+ rpcinfo-flushed install - -$(DIRS): - make -C $@ - -install: - install -d $(ROOTDEST)/misc/auto - install make_mdkinst_stage2 $(ROOTDEST)/misc - cd /usr/bin ; install packdrake $(ROOTDEST)/misc || { echo "packdrake is missing"; exit 1; } - cd /usr/bin ; install gendistrib rpm2header $(ROOTDEST)/misc || { echo "install rpmtools first!" ; exit 1; } - eval `perl -V:version`; cd /usr/lib/perl5/site_perl/$$version/*-linux ; install packdrake.pm rpmtools.pm $(ROOTDEST)/misc || { echo "install rpmtools first!" ; exit 1; } - eval `perl -V:version`; cd /usr/lib/perl5/site_perl/$$version/*-linux/auto ; cp -rf rpmtools $(ROOTDEST)/misc/auto || { echo "install rpmtools first!" ; exit 1; } - mkdir -p $(DEST)/usr/bin - -xhost+: %: %.c - $(CC) $(CFLAGS) $< -L/usr/X11R6/lib -lX11 -o $@ - -ddcprobe/ddcxinfos: - $(MAKE) -C ddcprobe ddcxinfos - -clean: - for i in $(DIRS); do $(MAKE) -C $$i clean; done - rm -rf *~ xhost+ rpcinfo-flushed ddcprobe/ddcxinfos */*.o diff --git a/tools/addchangelog.pl b/tools/addchangelog.pl deleted file mode 100755 index 8e39802a6..000000000 --- a/tools/addchangelog.pl +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/perl - -@ARGV == 1 or die "usage $0: <cvslog2changelog script>\n"; - -($script) = @ARGV; - -$date = (split('/', `grep ChangeLog perl-install/CVS/Entries`))[3]; - -@changelog = `(cvs log -d ">$date" docs mdk-stage1 rescue tools ; cd perl-install; cvs log -d ">$date") | $script`; -@before = `cat perl-install/ChangeLog`; - -open F, ">perl-install/ChangeLog"; -print F foreach @changelog, @before; - -`cvs commit -m '' perl-install/ChangeLog` =~ /new revision: (.*?);/; - -print "$1\n"; -print foreach @changelog; diff --git a/tools/alpha/cd/Makefile b/tools/alpha/cd/Makefile deleted file mode 100644 index 67af70f2f..000000000 --- a/tools/alpha/cd/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -install: - cp -f README README.milo $(ROOTDEST) - install -d $(ROOTDEST)/etc - cp -f aboot.cnf $(ROOTDEST)/etc - - install -d $(ROOTDEST)/boot - cp -a up1000 $(ROOTDEST)/boot - mv -f $(ROOTDEST)/boot/up1000/apb.* $(ROOTDEST) diff --git a/tools/alpha/cd/README b/tools/alpha/cd/README deleted file mode 100644 index 78eb94bd5..000000000 --- a/tools/alpha/cd/README +++ /dev/null @@ -1,40 +0,0 @@ -!! beta version !! - -Mandrake Alpha short Howto-Install - -this doc is for SRM, if you have alphabios, see README.milo - - -* to install from the cdrom: - -- either boot on the cdrom: - - in SRM, find the device name corresponding to the cdrom (`show device' can help) - - enter `boot dqa0 -fl 0' (replacing dqa0 by the cdrom device) - -- or you can boot on a floppy: - - first create a boot floppy from images/cdrom.img - - in SRM, find the device name corresponding to the floppy (`show device' can help) - - enter `boot dva0 -fl 0' (replacing dva0 by the floppy device) - - fulfill the install. - -* on reboot: - -- either enter `boot XXXX -fl 0' where XXXX is the device where you installed -the system - -- if the device is not available via SRM, use the -cdrom: `boot dqa0 -file boot/v.gz -fl root=/dev/sda1' (replace sda1 by the -root you installed on, and dqa0 by the cdrom device) - - -* to install from the network: - -Same as for the cdrom install, except give `boot dqa0 -fl 1' or boot on -images/network.img floppy (with `boot dva0 -fl 0') - - - - Alpha Team. - -Reports problems to Chmouel Boudjnah <chmouel@mandrakesoft.com> or Pixel -<pixel@mandrakesoft.com>. diff --git a/tools/alpha/cd/README.milo b/tools/alpha/cd/README.milo deleted file mode 100644 index d2a52abe9..000000000 --- a/tools/alpha/cd/README.milo +++ /dev/null @@ -1,13 +0,0 @@ -* to install from the cdrom: - -- put boot/cdrom.rdz on a floppy - -- put that floppy in drive fd0 - -- configure alphabios with (example for miata): - -Boot File: CD: \milo\miata\linload.exe -OS path: CD: \milo\miata\milo -OS options: boot scd0:/boot/instboot.gz root=/dev/fd0 load_ramdisk=1 mdkinst rw ramdisk_size=32000 - -if you want text install, just add "text" to the options above diff --git a/tools/alpha/cd/aboot.cnf b/tools/alpha/cd/aboot.cnf deleted file mode 100644 index 42c7a4382..000000000 --- a/tools/alpha/cd/aboot.cnf +++ /dev/null @@ -1,3 +0,0 @@ -0:boot/instboot.gz initrd=boot/cdrom.rdz mdkinst rw ramdisk=32000 cdrom -1:boot/instboot.gz initrd=boot/network.rdz mdkinst rw ramdisk=32000 network -2:boot/instboot.gz initrd=boot/hd.rdz mdkinst rw ramdisk=32000 hd diff --git a/tools/alpha/cd/up1000/5100440A.txt b/tools/alpha/cd/up1000/5100440A.txt deleted file mode 100644 index ba6c5a9f1..000000000 --- a/tools/alpha/cd/up1000/5100440A.txt +++ /dev/null @@ -1,25 +0,0 @@ -The source code for the object code and executable programs licensed - -under GNU General Public License Version 2, June 1991 are available - -from Alpha Processor, Inc. at the API web site - - - - http://www.Alpha-Processor.COM - - - -For each distributed object or executable form of the programs, you - -will find an identifying API part number. You may use that part - -number to find the corresponding machine-readable source code. - - - -If you have any questions, contact Customer Support at API. - - - -51-0044-0A
\ No newline at end of file diff --git a/tools/alpha/cd/up1000/README.txt b/tools/alpha/cd/up1000/README.txt deleted file mode 100644 index 88f8855d3..000000000 --- a/tools/alpha/cd/up1000/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -Known issues with the UP1000 system: - -1. Linux boot via floppy disk drive: - When booting Linux via APB, it takes about 5 minutes for APB to load the kernel image from a floppy device. Booting from a hard disk takes a matter of seconds. - -2. 2x AGP card: - a. At the present time, 2x AGP driver for Linux is not available so 2x mode has not been tested. - b. The following cards have been used in 1x AGP mode: cards with Permedia-2 controller: Fire - GL1000, ELSA Synergy, E&S, Matrox Millenium G200 and Stealth 2000. - c. 3Dfx Rage Pro Turbo card does not work because the option ROM on the AGP card is - not properly emulated by Alpha BIOS. - -3. Linux installation: - a. To install Linux, please click the "Utilities" menu in the Alpha BIOS setup mode and the - "Run Maintenance Program". And follow the Linux installation procedure that API provides. - b. Please do not use the "Install Linux" menu in the "Operating System" menu.
\ No newline at end of file diff --git a/tools/alpha/cd/up1000/apb.cfg b/tools/alpha/cd/up1000/apb.cfg deleted file mode 100755 index 06614adcb..000000000 --- a/tools/alpha/cd/up1000/apb.cfg +++ /dev/null @@ -1,2 +0,0 @@ -floppy|bootl boot\up1000\up1000.pal boot\instboot.gz root=/dev/fd0 load_ramdisk=1 mdkinst rw ramdisk_size=32000 -floppy_text|bootl boot\up1000\up1000.pal boot\instboot.gz root=/dev/fd0 load_ramdisk=1 mdkinst rw ramdisk_size=32000 text diff --git a/tools/alpha/cd/up1000/apb.exe b/tools/alpha/cd/up1000/apb.exe Binary files differdeleted file mode 100755 index 4b3aa6099..000000000 --- a/tools/alpha/cd/up1000/apb.exe +++ /dev/null diff --git a/tools/alpha/cd/up1000/install.txt b/tools/alpha/cd/up1000/install.txt deleted file mode 100644 index 61dff54f9..000000000 --- a/tools/alpha/cd/up1000/install.txt +++ /dev/null @@ -1,356 +0,0 @@ - -- Contents of floppy - -apb.exe Alpha Processor bootloader v. 1.0.1. -apb.cfg Sample apb configuration file. -up1000.pal PAL code for Linux on UP1000. -vmlinux.gz Linux kernel v. 2.2.12 with UP1000 patch. -System.gz Kernel Symbol table. -INSTALL This file. - - -- Installation of RedHat Linux from CD ROM - -1. Copy this directory to a floppy disk. - -2. Insert floppy disk and RedHat Linux CD ROM. - This installation guide assumes - - hard disk is connected to primary channel as a master - - CD ROM drive is connected to primary channel as a slave - -3. From AlphaBIOS run apb.exe as a utility program. - [F2]->Utility->Run maintanace program - -4. At the apb command prompt, type - apb> cd floppy - apb> bootl up1000.pal vmlinux.gz root=/dev/hdb - This assumes you have an ATAPI CD ROM drive which Linux recognizes - as /dev/hdb (you may have to try /dev/hda, /dev/hdc, etc. depending - on your configuration. For a SCSI CD ROM drive, /dev/scd or - /dev/scd0. - -5. This should get you into the RedHat installation program. During the - disk partitioning phase of the installation be sure to allocate a small - FAT partition to be used as the "boot" partition. 10 MB should be ample. - If you choose 'Workstation' or 'Server' package then you don't need to - partition the disk by yourself. - * Follow the common redhat installation procedure. - * During install, Don't configure X server, - * Select 'Startup through ARC console' on timezone setup menu. - -6. Due to bugs in redhat 6.0, FAT partition is not formatted during installation - depends on package selection. - So, After installation, run apb.exe from flopy again and at the - apb command prompt, type - apb> cd floppy - apb> bootl up1000.pal vmlinux.gz root=/dev/hda5 single - You'll get shell prompt then type following commands. - # mkfs -t msdos /dev/hda1 - # mount /dev/hda1 /dos - # mcopy a:*.* /dos - # gzip -dc /dos/system.gz > /boot/System.map - # ln -s Tsunami /etc/alpha_systype - # init 6 - -8. Configure the OS selection menu of AlphaBIOS to start apb.exe - from the boot partition. - In 'OS Selection' menu([F2]->Operating system->OS selection setup), - Make an entry like this. - - Boot name: Linux - Boot file: Disk 0 Partition 1 \apb.exe - OS Path : Disk 0 Partition 2 \winnt - OS Options: - - OS Path doesn't have any meaning, just leave it intact. - -9. You can run apb from hard disk by selecting what you configured on step 8. - -10. Set the environment variable APB_DEVICE to be the AlphaBIOS name - of the boot partition. - For example, - apb> setenv APB_DEVICE scsi(0)disk(0)rdisk(0)partition(1) - type 'cd' once to make above environment variable change to be applied. - apb> cd - -11. Now, You can boot linux by selecting 'Linux' on BIOS' OS boot menu - and then type this on apb prompt - - apb> bootl up1000.pal vmlinux.gz root=/dev/hda5 - - If you don't want to type above long line everytime. You have two options - 1. Create apb.cfg file under /dos directory, Its contents look like - - linux|bootl up1000.pal vmlinux.gz root=/dev/hda5 - - then you can boot linux by typying - - apb> boot linux - - 2. Put option string in OS Selection setup menu of BIOS setup. - - Boot name: Linux - Boot file: Disk 0 Partition 1 \apb.exe - OS Path : Disk 0 Partition 2 \winnt - OS Options: bootl up1000.pal vmlinux.gz root=/dev/hda5 - - Then this setup will boot linux without apb prompt. - - -------------------------------------------------------------------------------- - - - APB -- Alpha Processor Bootstrap Loader for AlphaBIOS - - Alpha Processor, Inc. - 130C Baker Ave. Ext. - Concord, MA 01742, USA - - David Daniel, Soohoon Lee, Stig Telfer - customer.support@alpha-processor.com - -======================================================================== - - Copyright (c) 1999, Alpha Processor, Inc. - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the copyright notice and this permission notice appear -in all copies of software and supporting documentation, and that the -name of Alpha Processor not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. Alpha Processor grants this permission provided -that you prominently mark, as not part of the original, any -modifications made to this software or documentation. - -Alpha Processor disclaims all warranties and/or guarantees with regard -to this software, including all implied warranties of fitness for a -particular purpose and merchantability, and makes no representations -regarding the use of, or the results of the use of, the software and -documentation in terms of correctness, accuracy, reliability, -currentness or otherwise; and you rely on the software, documentation -and results solely at your own risk. - -======================================================================== - - -0. Introduction - -APB is a bootstrap loader for Alpha processor based systems with -AlphaBIOS firmware. It is primarily intended to be used for booting -Linux, though it may also be useful for free BSD derived systems. - -APB borrows ideas and some code from many places, notably Linux and -other Linux loaders for Alpha systems (aboot and MILO), and the ARCDos -example in the ARC Application Development Kit. APB can also be -linked against zlib to support reading compressed kernel and PALcode -images. See the file CREDITS for details. - - -1. Using APB - -+ Overview - -APB presents a simple command line interface with the following -commands - - boot TARGET boot a target in the configuration file - bootl PALCODE KERNEL ARG1 ... boot Unix - cd DEVICE set the current device - cp | copy FILE1 FILE2 copy files - exit | quit exit to AlphaBIOS - halt | reset system shutdown options - ls | dir list files on the current device - mkdir DIR make a directory - more FILE list a file - mv | rename FILE1 FILE2 rename a file - pwd print the current device - rm | delete FILE delete a file - printenv [NAME] print environment variable(s) - setenv [NAME [VAL]] (un)set environment variable - show targets | devices show information - -At any time an AlphaBIOS is device is selected as the default or -current device. On initialization this is set to the value of the -APB_DEVICE firmware environment variable, or "multi(0)disk(0)fdisk(0)" -(usually the floppy device) if this is not set. - -To change the default device, use the "cd" command. For example - - cd scsi(0)disk(0)rdisk(0)partition(2)\os\linux - -sets the default device to be the second partition of the disk 0 on -the 0th SCSI controller. To save this for future invocations, set the -APB_DEVICE firmware environment variable using the "setenv" command: - - setenv APB_DEVICE scsi(0)disk(0)rdisk(0)partition(2)\os\linux - -After this you can return to this device using "cd". - -Also the special targets - - cd floppy - cd cdrom - -will take you to the (first) floppy and CD-ROM drives respectively. - -If there is a file system supported by AlphaBIOS on the device -- FAT, -ISO 9660 (CD-ROM) -- then a directory listing can be obtained using -the "dir" or "ls" command: - - apb> ls - Directory listing of scsi(0)disk(0)rdisk(0)partition(2): - APB.CFG - APB.EXE - LINUX.PAL - VMLINUX - - -+ Booting from disk - -The recommended way to boot a system using APB is set aside a small -(10 - 30 MB) FAT partition on one disk to be used as a boot partition. -The following files should be placed on the boot partition: - - The APB image (APB.EXE) - The PALcode image - The kernel image - An optional configuration file "APB.CFG" (see below) - -Run APB (either from floppy or from the boot partition and use it to -set the environment variable APB_DEVICE to the name of the boot -partition. For example if the boot partition is the first partition -on a SCSI disk with SCSI ID 3 on the first SCSI controller, and the files are in directory \os\linux set APB_DEVICE using - - apb> setenv APB_DEVICE scsi(0)disk(3)rdisk(0)partition(1)\os\linux - -To enable autoboot - - apb> setenv APB_AUTOBOOT 1 - -This performs the first boot command it finds in the APB configuration -file, unless interrupted. - -Otherwise boot manually using a command such as - - apb> bootl palcode kernel [kernel_arg1 [kernel_arg1 ...]] - -or use one of the labels defined in the APB configuration file, for -example - - apb> boot linux - -See below for the configuration file format. - -+ Environment variables - -APB uses the following firmware environment variables to set default -noptions: - - APB_DEVICE Default device for all operations - APB_AUTOBOOT Determines whether an autoboot should be attempted - -If these are not set on invocation, then they are set to reasonable -values, namely - - APB_DEVICE=multi(0)disk(0)fdisk(0) - APB_AUTOBOOT=0 - -+ Configuration file - -APB consults a configuration file "APB.CFG" that is assumed to be -located at the current device path (initially given by environment -variable APB_DEVICE). The file consists of lines that are either -comments, or boot commands prefixed with a mnemonic label. For example - - # This is comment - linux-2.2|bootl linux.pal vmlinux.gz root=/dev/sda3 - linux-2.0|bootl linux.pal vml20.gz root=/dev/sda3 - -In this case, to boot linux-2.2, type - - apb> boot linux-2.2 - -which is equivalent to - - apb> bootl linux.pal vmlinux.gz root=/dev/sda3 - -If the AUTO_BOOT environment variable is set TRUE, then the default -configuration will be booted after 10 seconds, unless a key is -pressed. - -+ Boot devices - -APB can boot from any filesystem supported by AlphaBIOS. At present -these are limited to FAT, NTFS and ISO 9660 (CD-ROM). - -+ Booting from a network device - -Not yet implemented. - - -2. Building APB - -APB is an AlphaBIOS/ARC application. Currently it must be built on an -Microsoft Windows NT 4.0 Alpha processor system, with Microsoft Visual -C++ 5.0 (or higher), the Microsoft Software Development Kit (SDK) and -Device Driver Development Kit (DDK) for NT 4.0, and Compaq ARC -Application Development Kit (ADK) 1.3. - -Optionally, APB can be linked against zlib (a free compression -library) to support reading compressed kernel and PALcode images. - -To build, open a command window, set up the environment: - - VC++ (e.g "C:Program Files\DevStudio\VC\bin\vcvars32.bat") - DDK (e.g. "C:\DDK\bin\setenv.bat C:\DDK") - ADK (e.g. "set ADK=C:\adkv13\adk") - -and then and make using nmake. For example: - - C:\apb-1.0> nmake - -where the DDK has been installed on the C: drive. - -If building with compressed file support, obtain and unpack zlib -(http://www.cdrom.com/pub/infozip/zlib/), set the variable ZLIB to -the zlib directory, and then make. For example - - C:\apb-1.0> set ZLIB=C:\zlib-1.1.3 - C:\apb-1.0> nmake - -In either case, the executable is placed in the "obj\alpha" -subdirectory. - - -3. What APB does - -Booting Linux with APB involves the following steps: - - AlphaBIOS loads and transfers control to APB. - - APB is called with an argument specifying the device (as known to - AlphaBIOS) from which to read the Linux kernel, and additional - arguments to be passed on to the kernel. - - APB sets up the environment for Linux, including loading and - switching to the correct PAL code, setting up the HWRPB, copying - kernel arguments to the right location in memory etc. - - APB reads the Linux kernel image into memory from the specified - device (raw disk initially, and eventually filesystems or network - devices via bootp) and transfers control. - - -4. Modifying APB - -APB has been written with the aim of maintaining platform independence -across all AlphaBIOS (and ARC) systems. Furthermore, all dependence -on the ARC API has been isolated in the file "arc.c", so that porting -to another firmware environment should not be too difficult as long as -it provides a sufficiently complete API. - -Additional user commands can be incorporated through the command -dispatch table in "cmd.c". - diff --git a/tools/alpha/cd/up1000/up1000.pal b/tools/alpha/cd/up1000/up1000.pal Binary files differdeleted file mode 100644 index a47b359f3..000000000 --- a/tools/alpha/cd/up1000/up1000.pal +++ /dev/null diff --git a/tools/alpha/e2fsck.shared b/tools/alpha/e2fsck.shared Binary files differdeleted file mode 100755 index 765e664a1..000000000 --- a/tools/alpha/e2fsck.shared +++ /dev/null diff --git a/tools/closurepkgs b/tools/closurepkgs deleted file mode 100755 index 2ef479486..000000000 --- a/tools/closurepkgs +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/perl - -use rpmtools; - -sub chop_version($) { - ($_[0] =~ /(.*)-[^-]+-[^-]+/)[0] || $_[0]; -} - -sub read_compsslist { - my ($file) = @_; - my %compsslist; - - local *F; - open F, $file or die "closurepkgs: unable to open compsslist file $file\n"; - foreach (<F>) { - my ($name, $level) = /^\s*(\S+)\s+(\d+)/; - $compsslist{$name} = $level; - } - close F; - - \%compsslist; -} - -sub main { - my ($dir, $lang) = @_; - - #- compute depslist on line directly. - my $params = new rpmtools; - foreach (glob("$dir/*.cz*")) { $params->read_hdlists($_) } - $params->keep_only_cleaned_provides_files(); - foreach (glob("$dir/*.cz*")) { $params->read_hdlists($_) } - $params->compute_depslist(); - - my $compsslist = read_compsslist("$dir/compssList"); - - #- DO NOT FORGET TO UPDATE HERE ACCORDING TO gi/perl-install/install_any.pm - my @pkgs = qw(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 - kernel-pcmcia-cs apmd cdrecord - ); - push @pkgs, "XFree86-$_" foreach qw(3DLabs 3dfx 8514 AGX FBDev I128 Mach8 Mach32 Mach64 Mono P9000 Rage128 S3 S3V SVGA VGA16 W32); - - #- closure the list of package to be kept for oem. - my %closure; - foreach (@pkgs) { - $closure{$_} = 1; - map { $closure{chop_version($_->{name})} = 1 } map { $params->{depslist}[$_] } map { split /\|/ } split ' ', $params->{info}{$_}{deps}; - } - #- only if dependancy is ok. - $closure{$_} = 1 foreach qw(xpp kups kisdn); - - #- closure the list of package to always install for oem. (level >= 50)... - my %install; - my @force_install; - if ($params->{info}{"locales-$lang"}) { - foreach (keys %{$params->{info}}) { - push @force_install, $_ if grep { $_ == $params->{info}{"locales-$lang"}{id} } split ' ', $params->{info}{$_}{deps}; - } - } else { - foreach (keys %{$params->{info}}) { - push @force_install, $_ if grep { $params->{depslist}[$_]{name} =~ /locales-/ } split ' ', $params->{info}{$_}{deps}; - } - } - push @force_install, qw(cups cups-drivers drakprofile draksync irda-utils numlock raidtools reiserfs-utils - Mesa Mesa-demos alsa alsa-utils); - foreach (qw( - Aurora xawtv kwintv xscreensaver-gl Mesa-demos xmms-mesa bzflag csmash gltron spacecup chromium tuxracer - ), @force_install, grep { $compsslist->{$_} >= 50 } keys %{$params->{info}}) { - $install{$_} = 1; - map { $install{chop_version($_->{name})} = 1 } map { $params->{depslist}[$_] } map { split /\|/ } split ' ', $params->{info}{$_}{deps}; - } - - #- remove base packages, which have to be installed, according to basesystem. - delete $closure{'basesystem'}; - $install{'basesystem'} = 1; - map { delete $closure{chop_version($_->{name})}; - $install{chop_version($_->{name})} = 1 } map { $params->{depslist}[$_] } map { split /\|/ } split ' ', $params->{info}{'basesystem'}{deps}; - - #- special packages that are to be move to closure always ... - foreach (qw(kernel-smp kernel-linus kernel-secure hackkernel-smp hackkernel-linus hackkernel-secure - Aurora xawtv kwintv xscreensaver-gl xmms-mesa bzflag csmash gltron spacecup chromium tuxracer - )) { - $params->{info}{$_} or next; - $closure{$_} = 1; - delete $install{$_}; - } - - #- dump out the list of package according to the 2 lists defined above. - my $total_install = 0; - my $total_closure = 0; - foreach (@{$params->{depslist}}) { - my $tiny_name = chop_version($_->{name}); - if (exists $install{$tiny_name}) { - my $p = $params->{info}{$tiny_name}; - $total_install += $p->{size}; - print "I:$p->{name}-$p->{version}-$p->{release}\n"; - } elsif (exists $closure{$tiny_name}) { - my $p = $params->{info}{$tiny_name}; - $total_closure += $p->{size}; - print "C:$p->{name}-$p->{version}-$p->{release}\n"; - } - } - print "\n\ntotal_install=$total_install\n"; - print "total_closure=$total_closure\n"; -} - -main(@ARGV); diff --git a/tools/cvslog2changelog.pl b/tools/cvslog2changelog.pl deleted file mode 100755 index 253578249..000000000 --- a/tools/cvslog2changelog.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -while (<>) { - if ($e = /^description:/ .. /^={77}/) { - next if $e == 1 || $e =~ /E0/; - if (/^-{28}/ .. /^date: /) { - if (/^date: (\S+)\s.*author: (\S+);/) { - ($date, $user) = ($1, $2); - } - } elsif (!/^branches: / && !/file .* was initially added on branch/ && !/empty log message/ && !/no_comment/) { - $l{$date}{$user}{$file} .= $_; - } - } elsif (/Working file: (.*)/) { - $file = $1; - } -} - -foreach $date (reverse sort keys %l) { - foreach $user (sort keys %{$l{$date}}) { - $fuser = $users{$user} || $user; - print "$date $fuser\n\n"; - my %inv; - while (($file, $log) = each %{$l{$date}{$user}}) { - $log =~ s/^\s+( \*)?//ms; - $log =~ s/\s+$//ms; - $log = "\n$log" if $log =~ /^-/; - push @{$inv{$log}}, $file; - } - foreach $log (keys %inv) { - $line = join(', ', @{$inv{$log}}) . ($log !~ /^\(/ && ':') . " $log"; - print "\t* ", join("\n\t", auto_fill($line, 72)), "\n\n"; - } - } -} - -1; - -sub auto_fill { - my ($line, $col) = @_; - map { - my @l; - my $l = ''; - $_ = " $_" if /^-/; - while ($_) { - s/^(\s*)(\S*)//; - my $m = "$l$1$2"; - if (length $m > $col) { - push @l, $l; - $l = $2; - } else { - $l = $m - } - } - @l, $l; - } split("\n", $line); -} - -BEGIN { - %users = ( - 'gc' => 'Guillaume Cottenceau <gc@mandrakesoft.com>', - 'fpons' => 'François Pons <fpons@mandrakesoft.com>', - 'pablo' => 'Pablo Saratxaga <pablo@mandrakesoft.com>', - 'damien' => 'dam\'s <damien@mandrakesoft.com>', - 'install' => 'DrakX <install@mandrakesoft.com>', - 'prigaux' => 'Pixel <pixel@mandrakesoft.com>', - 'flepied' => 'Frederic Lepied <flepied@mandrakesoft.com>', - 'chmouel' => 'Chmouel Boudjnah <chmouel@mandrakesoft.com>', - 'uid526' => 'dam\'s <damien@mandrakesoft.com>', - 'uid533' => 'François Pons <fpons@mandrakesoft.com>', - 'uid535' => 'Guillaume Cottenceau <gc@mandrakesoft.com>', - 'uid553' => 'Pixel <pixel@mandrakesoft.com>', - 'sbenedict'=>'Stew Benedict <sbenedict@mandrakesoft.com>', - 'tkamppeter' => 'Till Kamppeter <till@mandrakesoft.com>', - ); -} diff --git a/tools/extractchangelog b/tools/extractchangelog deleted file mode 100644 index d838a0b68..000000000 --- a/tools/extractchangelog +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/perl - diff --git a/tools/gencompss b/tools/gencompss deleted file mode 100755 index b12328e49..000000000 --- a/tools/gencompss +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl - -open F, "packdrake -c @ARGV | hdlist2groups - |"; -foreach (<F>) { - chop; - /(.*):(.*)/; - $l{$2}{$1} = undef; -} -close F or die; -foreach (sort keys %l) { - print "$_\n"; - print "\t$_\n" foreach sort keys %{$l{$_}}; - print "\n"; -} diff --git a/tools/gencryptofiles b/tools/gencryptofiles deleted file mode 100755 index f86b1ec3a..000000000 --- a/tools/gencryptofiles +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/perl - -#- Mandrake cryptographic package hdlist and depslist generation tools. -#- Copyright (C) 1999 MandrakeSoft (fpons@mandrakesoft.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. - -#- usage: gencryptofiles <crypto_dir> -#- build an hdlist and depslist file for crypto, need rpmtools also. - -my %resolver = ( - '/bin/sh' => 'bash', - '/bin/bash' => 'bash', - '/usr/bin/perl' => 'perl', - '/usr/bin/perl5' => 'perl', - - 'libBrokenLocale.so' => 'glibc', - 'libICE.so' => 'XFree86-libs', - 'libSM.so' => 'XFree86-libs', - 'libX11.so' => 'XFree86-libs', - 'libXext.so' => 'XFree86-libs', - 'libXmu.so' => 'XFree86-libs', - 'libXpm.so' => 'xpm', - 'libXt.so' => 'XFree86-libs', - 'libc.so.6' => 'glibc', - 'libgdbm.so' => 'gdbm', - 'libgpm.so' => 'gpm', - 'libm.so' => 'glibc', - 'libncurses.so' => 'ncurses', - 'libnsl.so' => 'glibc', - 'libpam.so' => 'pam', - 'libpthread.so' => 'glibc', - 'libreadline.so' => 'readline', - 'libstdc++-libc6.1-2.so' => 'libstdc++', - 'libstdc++.so' => 'libstdc++-compat', - 'libutil.so' => 'glibc', - 'libz.so' => 'zlib', - 'smtpdaemon' => 'postfix', - ); - -sub gendepslist_crypto { - my ($dir) = @_; - my %depslist; - - #- get information about each rpm. - local *DIR; - opendir DIR, $dir or die "cannot open directory: $!\n"; - while ($_ = readdir DIR) { - my ($key) = /(.*)\..*\.rpm$/ or next; - my ($name) = /(.*)-[^-]*-[^-]*-/; - - my $size = `rpm -qp --queryformat="%{SIZE}" $dir/$_`; - my @filelist = split "\n", `rpm -qpl $dir/$_`; - my @requires = split "\n", `rpm -qpR $dir/$_`; - - $depslist{$key} = { - key => $key, - size => $size, - filelist => \@filelist, - requires => \@requires, - deps => [], - }; - - foreach (@filelist) { - $resolver{$_} = $name; - m|.*/([^/]*)$| and $resolver{$1} = $name; - } - } - close DIR; - - #- resolve the dependancies. - foreach my $pkg (values %depslist) { - foreach (@{$pkg->{requires}}) { - $resolver{$_} and push(@{$pkg->{deps}}, $resolver{$_}), next; - m|^([^\s\(]*)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next; - m|^.*/([^/\s\(]*)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next; - m|^([^\s\(]*\.so)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next; - m|^.*/([^\s\(]*\.so)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next; - m|^([\w-]*)(?:\s+.*)$| and push(@{$pkg->{deps}}, $1); #- last and default to package name. - } - } - - #- build depslist-crypto file. - local *F; - open F, ">$dir/depslist-crypto" or die "cannot open depslist-crypto file for writing: $!\n"; - foreach (values %depslist) { - my %deps; - @deps{@{$_->{deps}}} = (); - print F "$_->{key} $_->{size} ", join(" ", keys %deps), "\n"; - } - close F; -} - -sub main { - my ($dir) = @_; - -d $dir or die "usage: gencryptofiles <crypto_dir>\n"; - -x "/usr/bin/genhdlist_cz2" or die "I need rpmtools to work (ie /usr/bin/genhdlist_cz2)\n"; - - print `genhdlist_cz2 -o $dir/hdlist-crypto.cz2 $dir`; - gendepslist_crypto($dir); -} - -main(@ARGV); diff --git a/tools/genmodparm b/tools/genmodparm deleted file mode 100755 index e4aa5d4e9..000000000 --- a/tools/genmodparm +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/perl - -# Mandrake Graphic Install -# Copyright (C) 1999 MandrakeSoft (fpons@mandrakesoft.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. - -$srctop = $ARGV[0]; - -unless (-d $srctop) { - print STDERR "usage: $0 <linux_src_top>\n"; - print STDERR " <linux_src_top> is the linux source top directory,\n"; - print STDERR " for example /usr/src/linux\n"; - exit 1; -} - -open (FILE_LIST, "find $srctop/ -name \"*.c\" |"); - -while (<FILE_LIST>) { - chomp; - - my $file = $_; - my $dir = $file; - my $module = $file; - my $incfile; - my @incfiles; - my %parms; - my $oldline; - my $descline; - my $default; - my %substvars; - - # get mormalized directory name. - $dir =~ s/^(.*)\/[^\/]*$/$1/; - - # get mormalized module name. - $module =~ s/^.*\/([^\/]*)\.c$/$1/; - - # search for recogniwed special keywords. - open (F, $file); - while (<F>) { - # track for include files. - if (/^\#\s*include\s+[\<\"]([\w-\.\/]*)[\"\>]/) { - # search from /usr/src/linux/include directory. - push @incfiles, "/usr/src/linux/include/$1"; - - # search from current working directory. - push @incfiles, "$dir/$1"; - } - - if (/^\s*MODULE_PARM\s*\((\w*)\s*,\s*\"/) { - $parms{$1}{type} = '?'; - } - if (/^\s*MODULE_PARM\s*\((\w*)\s*,\s*\"([^\"]*)\"\s*\)/) { - $parms{$1}{type} = $2; - } - if (/^\s*MODULE_PARM_DESC\s*\((\w*)\s*,\s*\"([^\"]*)\"\s*\)/) { - $parms{$1}{desc} = $2; - } - } - close F; - - # parse associated include file if exist. - foreach $incfile (@incfiles) { - if (-r $incfile) { - open (F, $incfile); - while (<F>) { - s/^(.*)\/\*.*$/$1/g; - if (/^\#\s*define\s*(\w*)\s*(.*)$/) { - $substvars{$1}=$2; - } - } - close F; - } - } - - # search for comments about each module parameter. - open (F, $file); - while (<F>) { - my $line = $_; - - # manage simple preprocessor. - s/^(.*)\/\*.*$/$1/g; - if (/^\#\s*define\s*(\w*)\s*(.*)$/) { - $substvars{$1}=$2; - } - - # parse for parameters definition. - foreach $parm (keys %parms) { - if ($line =~ /^\s*(static\s+)?((short|long|signed|unsigned)\s+)?\w+(\s*\**\s+|\s+\**\s*)$parm(\s*\[.*\]\s*)?\s*=\s*([^\;]*)\;/) { - $default = $descline = $6; - $default =~ s/^(.*)\/\*.*$/$1/g; - - # remove hypothetic couple of { }. - $default =~ s/^(\s*\{\s*)(.*)(\s*\}\s*)$/$2/; - - # subsitute variable. - foreach $substvar (keys %substvars) { - $default =~ s/$substvar/$substvars{$substvar}/g; - } - $default =~ s/NULL/0/g; - $default =~ s/^\s*(.*?)\s*$/$1/; - $default = '' if $default =~ /\(\s*\(\s*void*\s*\*\)\s*0\s*\)\s*,?/; - - # store value. - $parms{$parm}{default} = $default; - - # try to search a comment on the previous line. - if (!defined($parms{$parm}{desc})) { - if ($oldline =~ /^\s*\/\*\s*(.*)\s*\*\/\s*$/ || /\/\*\s*(.*)\s*\*\/\s*$/) { - $parms{$parm}{desc} = $1; - } - } - - # try to search a comment on the line (multiline not supported). - if (!defined($parms{$parm}{desc})) { - if ($descline =~ /^.*\/\*\s*(.*)\s*\*\/\s*$/) { - $parms{$parm}{desc} = $1; - } - } - } - } - $oldline = $_; - } - close F; - - # dump all result to stdout associated to current module. - foreach $parm (keys %parms) { - print "$module:$parm:$parms{$parm}{type}:$parms{$parm}{default}:$parms{$parm}{desc}\n"; - } -} - -close FILE_LIST; diff --git a/tools/i386/busybox b/tools/i386/busybox Binary files differdeleted file mode 100755 index d34bbdd52..000000000 --- a/tools/i386/busybox +++ /dev/null diff --git a/tools/i386/e2fsck.shared b/tools/i386/e2fsck.shared Binary files differdeleted file mode 100755 index ad4d660a0..000000000 --- a/tools/i386/e2fsck.shared +++ /dev/null diff --git a/tools/i386/mkreiserfs b/tools/i386/mkreiserfs Binary files differdeleted file mode 100755 index 65fdf49f6..000000000 --- a/tools/i386/mkreiserfs +++ /dev/null diff --git a/tools/i386/netboot/.cvsignore b/tools/i386/netboot/.cvsignore deleted file mode 100644 index 64daa531c..000000000 --- a/tools/i386/netboot/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -menu.lst -stage1 -stage2 -automatic.para diff --git a/tools/i386/netboot/grub b/tools/i386/netboot/grub Binary files differdeleted file mode 100755 index 166e49f23..000000000 --- a/tools/i386/netboot/grub +++ /dev/null diff --git a/tools/i386/netboot/make_boot_network b/tools/i386/netboot/make_boot_network deleted file mode 100755 index f75092cd7..000000000 --- a/tools/i386/netboot/make_boot_network +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -type=$1 -#[ -z "$type" ] && { echo "usage: $0 <network card type> (eg: 3c59x)" ; exit 1; } -[ -z "$type" ] && type=3c90x - -[ -e menu.lst ] || { echo "missing file menu.lst, create one based on menu.lst.example"; exit 1; } - -ln -sf stage1.$type stage1 -ln -sf stage2.$type stage2 - -mformat a: -mcopy {stage1,stage2} a: -mcopy menu.lst a:menu.lst - -./grub --batch <<EOF -install (fd0)/stage1 d (fd0) (fd0)/stage2 p (fd0)/menu.lst $automatic -EOF diff --git a/tools/i386/netboot/menu.lst.example b/tools/i386/netboot/menu.lst.example deleted file mode 100644 index 8f18a5313..000000000 --- a/tools/i386/netboot/menu.lst.example +++ /dev/null @@ -1,7 +0,0 @@ -timeout 0 - -title linux -dhcp -tftpserver 192.168.1.9 -kernel (nd)/var/lib/tftpboot/vmlinuz ramdisk=32000 vga=788 kickstart=Mandrake/base/auto_inst.cfg.pl useless_thing_accepted automatic=method:ftp,network:static,ip:192.168.100.25,dns:192.168.100.11,server:192.168.100.39,directory:/export,user:a,pass:a -initrd (nd)/var/lib/tftpboot/network.rdz diff --git a/tools/i386/netboot/stage1.3c59x b/tools/i386/netboot/stage1.3c59x Binary files differdeleted file mode 100755 index 1cd1292ac..000000000 --- a/tools/i386/netboot/stage1.3c59x +++ /dev/null diff --git a/tools/i386/netboot/stage1.3c90x b/tools/i386/netboot/stage1.3c90x Binary files differdeleted file mode 100755 index 1cd1292ac..000000000 --- a/tools/i386/netboot/stage1.3c90x +++ /dev/null diff --git a/tools/i386/netboot/stage1.eepro100 b/tools/i386/netboot/stage1.eepro100 Binary files differdeleted file mode 100755 index 90f9c2210..000000000 --- a/tools/i386/netboot/stage1.eepro100 +++ /dev/null diff --git a/tools/i386/netboot/stage1.rtl8139 b/tools/i386/netboot/stage1.rtl8139 Binary files differdeleted file mode 100755 index 1cd1292ac..000000000 --- a/tools/i386/netboot/stage1.rtl8139 +++ /dev/null diff --git a/tools/i386/netboot/stage1.tulip b/tools/i386/netboot/stage1.tulip Binary files differdeleted file mode 100755 index 1cd1292ac..000000000 --- a/tools/i386/netboot/stage1.tulip +++ /dev/null diff --git a/tools/i386/netboot/stage1.via-rhine b/tools/i386/netboot/stage1.via-rhine Binary files differdeleted file mode 100755 index c15d90622..000000000 --- a/tools/i386/netboot/stage1.via-rhine +++ /dev/null diff --git a/tools/i386/netboot/stage2.3c59x b/tools/i386/netboot/stage2.3c59x Binary files differdeleted file mode 100644 index f1efb805d..000000000 --- a/tools/i386/netboot/stage2.3c59x +++ /dev/null diff --git a/tools/i386/netboot/stage2.3c90x b/tools/i386/netboot/stage2.3c90x Binary files differdeleted file mode 100644 index c20761b21..000000000 --- a/tools/i386/netboot/stage2.3c90x +++ /dev/null diff --git a/tools/i386/netboot/stage2.eepro100 b/tools/i386/netboot/stage2.eepro100 Binary files differdeleted file mode 100644 index 5fb781dd8..000000000 --- a/tools/i386/netboot/stage2.eepro100 +++ /dev/null diff --git a/tools/i386/netboot/stage2.rtl8139 b/tools/i386/netboot/stage2.rtl8139 Binary files differdeleted file mode 100644 index 337db4152..000000000 --- a/tools/i386/netboot/stage2.rtl8139 +++ /dev/null diff --git a/tools/i386/netboot/stage2.tulip b/tools/i386/netboot/stage2.tulip Binary files differdeleted file mode 100644 index ca238d182..000000000 --- a/tools/i386/netboot/stage2.tulip +++ /dev/null diff --git a/tools/i386/netboot/stage2.via-rhine b/tools/i386/netboot/stage2.via-rhine Binary files differdeleted file mode 100644 index 7fb5cb251..000000000 --- a/tools/i386/netboot/stage2.via-rhine +++ /dev/null diff --git a/tools/i386/sh b/tools/i386/sh Binary files differdeleted file mode 100755 index 084a97837..000000000 --- a/tools/i386/sh +++ /dev/null diff --git a/tools/ia64/e2fsck.shared b/tools/ia64/e2fsck.shared Binary files differdeleted file mode 100755 index 1ca570a7b..000000000 --- a/tools/ia64/e2fsck.shared +++ /dev/null diff --git a/tools/ia64/elilo.efi b/tools/ia64/elilo.efi Binary files differdeleted file mode 100755 index 994ed43a4..000000000 --- a/tools/ia64/elilo.efi +++ /dev/null diff --git a/tools/mailchangelog.pl b/tools/mailchangelog.pl deleted file mode 100755 index 95015f041..000000000 --- a/tools/mailchangelog.pl +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl - -open F, '| /usr/sbin/sendmail -f devel@mandrakesoft.com'; - -chomp($ver = <STDIN>); - -print F -q(Subject: [DrakX] DrakX snapshot #), $ver, q( uploaded -From: devel@mandrakesoft.com -To: changelog@mandrakesoft.com, install@mandrakesoft.com -Reply-To: install@mandrakesoft.com - -); -print F foreach <STDIN>; diff --git a/tools/make_mdkinst_stage2 b/tools/make_mdkinst_stage2 deleted file mode 100755 index 1d1270b87..000000000 --- a/tools/make_mdkinst_stage2 +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -[ $# != 2 ] && { - echo "usage: make_mdkinst_stage2 <live dir> <output image>" ; - echo " example: misc/make_mdkinst_stage2 Mandrake/mdkinst Mandrake/base/mdkinst_stage2" - exit -} - -TMPDIR=${TMPDIR=/tmp} -STAGE2TMP=$TMPDIR/stage2_tmp -MKE2FS="/sbin/mke2fs -q -m 0 -F -s 1" -MNTPOINT=$TMPDIR/stage2_img -REP4PMS=/usr/bin/perl-install -DEST=$1 -STAGE2=$2 - -testandset() { [ -x $1/packdrake ] && BUILD_ARCHIVE=$1/packdrake; } -testandset `pwd`/misc -testandset `pwd`/. -testandset /$DEST/../../misc -testandset `pwd`/$DEST/../../misc -[ -z "$BUILD_ARCHIVE" ] && { echo "can't find packdrake"; exit 1; } - -if [ $EUID != "0" ]; then - SUDO="sudo" - PATH="/sbin:/usr/sbin:$PATH" -fi - -$SUDO rm -rf $STAGE2TMP -install -d $STAGE2TMP -$SUDO cp -a $DEST/* $STAGE2TMP - -#mkdir -p $MNTPOINT 2>/dev/null -#for i in $MNTPOINT $STAGE2; do $SUDO umount $i 2>/dev/null ; done -#dd if=/dev/zero of=$STAGE2 bs=1k count=24000 -#$MKE2FS -N 1000 $STAGE2 -#$SUDO mount -t ext2 $STAGE2 $MNTPOINT -o loop -# hack to reduce the STAGE2 image (do not edit without modifying in DrakX) -# be sure to keep the biggest server -rm -f $STAGE2TMP/usr/X11R6/bin/XF86_{VGA16,3DLabs,TGA,S3} -rm -f `ls --sort=size $STAGE2TMP/lib/modules.cz-* | perl -ne 'print if $i++'` -rm -f $STAGE2TMP/usr/bin/{pv*,vg*,lv*} $STAGE2TMP/lib/liblvm* -rm -f $STAGE2TMP/usr/bin/{resize_reiserfs} -rm -f $STAGE2TMP/usr/X11R6/lib/X11/fonts/{taipei16,gb16fs,k14,baekmuk_gulim_h_14,cu12}.pcf.gz -rm -rf $STAGE2TMP/usr/share/locale_special -for i in /usr/share/locale; do - name=`basename $i` - (cd $STAGE2TMP/$i ; find * | $BUILD_ARCHIVE -b9s ../$name.cz2 4000000) - rm -rf $STAGE2TMP/$i -done -for i in /usr/share/keymaps /usr/share/xmodmap; do - name=`basename $i` - (cd $STAGE2TMP/$i ; ls * | $BUILD_ARCHIVE -b9s ../$name.cz2 400000) - rm -rf $STAGE2TMP/$i -done - - - -mkdir -p $MNTPOINT 2>/dev/null -for i in $MNTPOINT $STAGE2; do $SUDO umount $i 2>/dev/null ; done -dd if=/dev/zero of=$STAGE2 bs=1k count=$[ `du -s $STAGE2TMP | cut -f1` + 1024 + 200 ] -$MKE2FS -N 1000 $STAGE2 -$SUDO mount -t ext2 $STAGE2 $MNTPOINT -o loop - -$SUDO cp -a $STAGE2TMP/* $MNTPOINT -$SUDO rm -rf $STAGE2TMP - -df $MNTPOINT -$SUDO umount $STAGE2 -rmdir $MNTPOINT - -echo bzipping $STAGE2 - -bzip2 -f -9 $STAGE2 diff --git a/tools/mkhdlist b/tools/mkhdlist deleted file mode 100755 index 6ef783ca1..000000000 --- a/tools/mkhdlist +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Regenerate hdlist, root_directory should be the binary -# root_directory where you find generally this structure : -# -# COPYING Mandrake/ RPM-GPG-KEYS VERSION dosutils/ images/ lnx4win/ -# misc/ - -if [ -z "$1" ];then - echo "Usage: $(basename $0) /path/to/root_directory/" - exit 1 -fi - -cd $1 -rm -rf /tmp/.build_hdlist/ -./misc/genhdlist_cz2 --noclean --distrib . -./misc/gendepslist2 -o Mandrake/base/depslist Mandrake/base/hdlist.cz2 diff --git a/tools/ntp_servers.pl b/tools/ntp_servers.pl deleted file mode 100644 index 62640557c..000000000 --- a/tools/ntp_servers.pl +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/perl - -open F, "links -dump http://www.eecis.udel.edu/~mills/ntp/clock1.htm|"; -open G, "links -dump http://www.eecis.udel.edu/~mills/ntp/clock2.htm|"; - -# Chris Kloiber <ckloiber@redhat.com> writes: -# > It's not considered polite to use the Stratum 1 servers for purposes that -# > are not absolutely critical. I would use Stratum 2 servers and live with -# > the few nanoseconds difference. -#parse() while <F>; - -parse() while <G>; - -sub parse { - /\0/ .. 1 or return; - if (/^ [\d\0]\d\./) { - push @all, { name => $name, indic => $indic, %l } if $name; - %l = (); - $nb = 0; - } else { - s/^\s*//; - s/\s*$//; - if ($nb == 2) { - s/US CA:/US CA/; - ($indic, $name) = /([A-Z ]*[A-Z])\s+([.\w-]+)/ or die "bad line $_"; - } else { - s/^(.*):\s*/$field = $1; ''/e; - $field = lc $field; - if ($field =~ /policy/) { - $field = "policy"; - $_ = lc $_; - s/glad to receive a note//; - s/[(), ]*$//; - $_ = "open access" if $_ eq "public"; - } - $l{$field} .= ($l{$field} && ' ') . $_; - } - } - $nb++; -} - - -use Data::Dumper; -#print Dumper(\@all); - -foreach (grep { $_->{policy} eq 'open access' } @all) { - ($country, $state) = split ' ', $_->{indic}; - $country = ucfirst(lc $country_codes{$country}); - $country .= " $state" if $state; - print "$country (", lc($_->{name}), ")\n"; -} - -BEGIN { -%country_codes = ( # from ftp://ftp.ripe.net/iso3166-countrycodes -"AF", "AFGHANISTAN", -"AL", "ALBANIA", -"DZ", "ALGERIA", -"AS", "AMERICAN SAMOA", -"AD", "ANDORRA", -"AO", "ANGOLA", -"AI", "ANGUILLA", -"AQ", "ANTARCTICA", -"AG", "ANTIGUA AND BARBUDA", -"AR", "ARGENTINA", -"AM", "ARMENIA", -"AW", "ARUBA", -"AU", "AUSTRALIA", -"AT", "AUSTRIA", -"AZ", "AZERBAIJAN", -"BS", "BAHAMAS", -"BH", "BAHRAIN", -"BD", "BANGLADESH", -"BB", "BARBADOS", -"BY", "BELARUS", -"BE", "BELGIUM", -"BZ", "BELIZE", -"BJ", "BENIN", -"BM", "BERMUDA", -"BT", "BHUTAN", -"BO", "BOLIVIA", -"BA", "BOSNIA AND HERZEGOWINA", -"BW", "BOTSWANA", -"BV", "BOUVET ISLAND", -"BR", "BRAZIL", -"IO", "BRITISH INDIAN OCEAN TERRITORY", -"BN", "BRUNEI DARUSSALAM", -"BG", "BULGARIA", -"BF", "BURKINA FASO", -"BI", "BURUNDI", -"KH", "CAMBODIA", -"CM", "CAMEROON", -"CA", "CANADA", -"CV", "CAPE VERDE", -"KY", "CAYMAN ISLANDS", -"CF", "CENTRAL AFRICAN REPUBLIC", -"TD", "CHAD", -"CL", "CHILE", -"CN", "CHINA", -"CX", "CHRISTMAS ISLAND", -"CC", "COCOS (KEELING) ISLANDS", -"CO", "COLOMBIA", -"KM", "COMOROS", -"CG", "CONGO", -"CD", "CONGO, THE DEMOCRATIC REPUBLIC OF THE", -"CK", "COOK ISLANDS", -"CR", "COSTA RICA", -"CI", "COTE D'IVOIRE", -"HR", "CROATIA", -"CU", "CUBA", -"CY", "CYPRUS", -"CZ", "CZECH REPUBLIC", -"DK", "DENMARK", -"DJ", "DJIBOUTI", -"DM", "DOMINICA", -"DO", "DOMINICAN REPUBLIC", -"TP", "EAST TIMOR", -"EC", "ECUADOR", -"EG", "EGYPT", -"SV", "EL SALVADOR", -"GQ", "EQUATORIAL GUINEA", -"ER", "ERITREA", -"EE", "ESTONIA", -"ET", "ETHIOPIA", -"FK", "FALKLAND ISLANDS (MALVINAS)", -"FO", "FAROE ISLANDS", -"FJ", "FIJI", -"FI", "FINLAND", -"FR", "FRANCE", -"FX", "FRANCE, METROPOLITAN", -"GF", "FRENCH GUIANA", -"PF", "FRENCH POLYNESIA", -"TF", "FRENCH SOUTHERN TERRITORIES", -"GA", "GABON", -"GM", "GAMBIA", -"GE", "GEORGIA", -"DE", "GERMANY", -"GH", "GHANA", -"GI", "GIBRALTAR", -"GR", "GREECE", -"GL", "GREENLAND", -"GD", "GRENADA", -"GP", "GUADELOUPE", -"GU", "GUAM", -"GT", "GUATEMALA", -"GN", "GUINEA", -"GW", "GUINEA-BISSAU", -"GY", "GUYANA", -"HT", "HAITI", -"HM", "HEARD AND MC DONALD ISLANDS", -"VA", "HOLY SEE (VATICAN CITY STATE)", -"HN", "HONDURAS", -"HK", "HONG KONG", -"HU", "HUNGARY", -"IS", "ICELAND", -"IN", "INDIA", -"ID", "INDONESIA", -"IR", "IRAN (ISLAMIC REPUBLIC OF)", -"IQ", "IRAQ", -"IE", "IRELAND", -"IL", "ISRAEL", -"IT", "ITALY", -"JM", "JAMAICA", -"JP", "JAPAN", -"JO", "JORDAN", -"KZ", "KAZAKHSTAN", -"KE", "KENYA", -"KI", "KIRIBATI", -"KP", "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", -"KR", "KOREA, REPUBLIC OF", -"KW", "KUWAIT", -"KG", "KYRGYZSTAN", -"LA", "LAO PEOPLE'S DEMOCRATIC REPUBLIC", -"LV", "LATVIA", -"LB", "LEBANON", -"LS", "LESOTHO", -"LR", "LIBERIA", -"LY", "LIBYAN ARAB JAMAHIRIYA", -"LI", "LIECHTENSTEIN", -"LT", "LITHUANIA", -"LU", "LUXEMBOURG", -"MO", "MACAU", -"MK", "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", -"MG", "MADAGASCAR", -"MW", "MALAWI", -"MY", "MALAYSIA", -"MV", "MALDIVES", -"ML", "MALI", -"MT", "MALTA", -"MH", "MARSHALL ISLANDS", -"MQ", "MARTINIQUE", -"MR", "MAURITANIA", -"MU", "MAURITIUS", -"YT", "MAYOTTE", -"MX", "MEXICO", -"FM", "MICRONESIA, FEDERATED STATES OF", -"MD", "MOLDOVA, REPUBLIC OF", -"MC", "MONACO", -"MN", "MONGOLIA", -"MS", "MONTSERRAT", -"MA", "MOROCCO", -"MZ", "MOZAMBIQUE", -"MM", "MYANMAR", -"NA", "NAMIBIA", -"NR", "NAURU", -"NP", "NEPAL", -"NL", "NETHERLANDS", -"AN", "NETHERLANDS ANTILLES", -"NC", "NEW CALEDONIA", -"NZ", "NEW ZEALAND", -"NI", "NICARAGUA", -"NE", "NIGER", -"NG", "NIGERIA", -"NU", "NIUE", -"NF", "NORFOLK ISLAND", -"MP", "NORTHERN MARIANA ISLANDS", -"NO", "NORWAY", -"OM", "OMAN", -"PK", "PAKISTAN", -"PW", "PALAU", -"PA", "PANAMA", -"PG", "PAPUA NEW GUINEA", -"PY", "PARAGUAY", -"PE", "PERU", -"PH", "PHILIPPINES", -"PN", "PITCAIRN", -"PL", "POLAND", -"PT", "PORTUGAL", -"PR", "PUERTO RICO", -"QA", "QATAR", -"RE", "REUNION", -"RO", "ROMANIA", -"RU", "RUSSIA", -"RW", "RWANDA", -"KN", "SAINT KITTS AND NEVIS", -"LC", "SAINT LUCIA", -"VC", "SAINT VINCENT AND THE GRENADINES", -"WS", "SAMOA", -"SM", "SAN MARINO", -"ST", "SAO TOME AND PRINCIPE", -"SA", "SAUDI ARABIA", -"SN", "SENEGAL", -"SC", "SEYCHELLES", -"SL", "SIERRA LEONE", -"SG", "SINGAPORE", -"SK", "SLOVAKIA (Slovak Republic)", -"SI", "SLOVENIA", -"SB", "SOLOMON ISLANDS", -"SO", "SOMALIA", -"ZA", "SOUTH AFRICA", -"GS", "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", -"ES", "SPAIN", -"LK", "SRI LANKA", -"SH", "ST. HELENA", -"PM", "ST. PIERRE AND MIQUELON", -"SD", "SUDAN", -"SR", "SURINAME", -"SJ", "SVALBARD AND JAN MAYEN ISLANDS", -"SZ", "SWAZILAND", -"SE", "SWEDEN", -"CH", "SWITZERLAND", -"SY", "SYRIAN ARAB REPUBLIC", -"TW", "TAIWAN, PROVINCE OF CHINA", -"TJ", "TAJIKISTAN", -"TZ", "TANZANIA, UNITED REPUBLIC OF", -"TH", "THAILAND", -"TG", "TOGO", -"TK", "TOKELAU", -"TO", "TONGA", -"TT", "TRINIDAD AND TOBAGO", -"TN", "TUNISIA", -"TR", "TURKEY", -"TM", "TURKMENISTAN", -"TC", "TURKS AND CAICOS ISLANDS", -"TV", "TUVALU", -"UG", "UGANDA", -"UA", "UKRAINE", -"AE", "UNITED ARAB EMIRATES", -"GB", "UNITED KINGDOM", -"US", "UNITED STATES", -"UM", "UNITED STATES MINOR OUTLYING ISLANDS", -"UY", "URUGUAY", -"UZ", "UZBEKISTAN", -"VU", "VANUATU", -"VE", "VENEZUELA", -"VN", "VIET NAM", -"VG", "VIRGIN ISLANDS (BRITISH)", -"VI", "VIRGIN ISLANDS (U.S.)", -"WF", "WALLIS AND FUTUNA ISLANDS", -"EH", "WESTERN SAHARA", -"YE", "YEMEN", -"YU", "YUGOSLAVIA", -"ZM", "ZAMBIA", -"ZW", "ZIMBABWE", - -#added -"UK", "UNITED KINGDOM", -); -} diff --git a/tools/oem-prepare b/tools/oem-prepare deleted file mode 100755 index 8897dc202..000000000 --- a/tools/oem-prepare +++ /dev/null @@ -1,397 +0,0 @@ -#!/usr/bin/perl - -my ($mode, $dir, $reject_dir, $lang, $flang) = @ARGV; -$mode =~ s/^--(rebuild|clean)$/$1/ or die "mode should be --rebuild or --clean\n"; --e "$dir/Mandrake/base/hdlists" && -d $reject_dir or die "usage: oem-prepare <--rebuild|--clean> <top_dir> <reject_dir> <lang>\n"; - -#- default language fall to what is contained in VERSION file. -open F, "$dir/VERSION"; -foreach (<F>) { - /[\s-]fr/ and $lang = "fr"; -} -close F; -$lang ||= "en"; -$lang eq "fr" and $flang = "fr_FR"; -$lang eq "en" and $flang = "en_US"; -print "Found lang $lang (flang is $flang)\n"; - -my $packages = select_packages($dir, $lang); - -my @media; -open F, "$dir/Mandrake/base/hdlists"; -foreach (<F>) { - chomp; - s/\s*#.*$//; - /^\s*$/ and next; - m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file"; - - push @media, { hdlist => $1, rpmsdir => $2, descr => $3 }; -} -close F; - -#- keep in mind all the rpm files available (according to hdlists). -my %rpms; - -require packdrake; -foreach my $medium (@media) { - my $packer = new packdrake("$dir/Mandrake/base/$medium->{hdlist}"); - foreach (@{$packer->{files}}) { - $packer->{data}{$_}[0] eq 'f' or next; - $rpms{$_} = $medium->{rpmsdir}; - -e "$dir/$medium->{rpmsdir}/$_.rpm" and next; #- already exist in the right directory. - if (-e "$reject_dir/$_.rpm") { - $mode eq 'rebuild' and system "mv", "-f", "$reject_dir/$_.rpm", "$dir/$medium->{rpmsdir}"; - next; - } - print STDERR "unable to find package $_ listed in medium \"$medium->{descr}\"\n"; - } -} - -if ($mode eq 'clean') { - #- copy and install from each cd image. - foreach my $medium (@media) { - foreach my $pkg (@{$packages->{depslist}}) { - $pkg->{closure} && !$pkg->{selected} or next; - foreach (qw(i586 i486 i386 ppc sparc64 sparc alpha noarch)) { - delete $rpms{"$pkg->{name}.$_"} or next; - my $file = "$dir/$medium->{rpmsdir}/$pkg->{name}.$_.rpm"; - -e $file or print STDERR "package $pkg->{name} should be available in [$dir/$medium->{rpmsdir}]", next; - print "copying $file\n"; - delete $pkg->{closure}; - } - } - - if (my $pkg = pkgs::packageByName($packages, 'glibc')) { #- HACK FOR GLIBC - if (delete $pkg->{selected}) { - foreach (qw(i586 i486 i386 ppc sparc64 sparc alpha noarch)) { - delete $rpms{"$pkg->{name}.$_"} or next; - my $file = "$dir/$medium->{rpmsdir}/$pkg->{name}.$_.rpm"; - -e $file or next; - print " installing $file\n"; - } - } - } else { - die "no glibc package found"; - } - my @files; - foreach my $pkg (@{$packages->{depslist}}) { - $pkg->{selected} or next; - foreach (qw(i586 i486 i386 ppc sparc64 sparc alpha noarch)) { - delete $rpms{"$pkg->{name}.$_"} or next; - my $file = "$dir/$medium->{rpmsdir}/$pkg->{name}.$_.rpm"; - -e $file or next; - print " installing $file\n"; - delete $pkg->{selected}; - } - } - - scalar(grep { $_->{selected} || $_->{closure} } @{$packages->{depslist}}) == 0 and last; - } - - #- at this point, everything left in %rpms has to be moved to $reject_dir. - foreach (keys %rpms) { - -e "$reject_dir/$_.rpm" and next; #- already cleaned. - -e "$dir/$rpms{$_}/$_.rpm" or print STDERR "file \"$_.rpm\" should be in [$dir/$rpms{$_}]\n", next; - system "mv", "-f", "$dir/$rpms{$_}/$_.rpm", $reject_dir; - } -} - -#- provide package fullname that have to be installed and copied. -sub select_packages { - my ($dir, $lang) = @_; - my $o = { packages => read_depslist("$dir/Mandrake/base/depslist.ordered") }; - - #- DO NOT FORGET TO UPDATE HERE ACCORDING TO gi/perl-install/install_any.pm - my @pkgs = qw(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 autologin - kernel-pcmcia-cs apmd cdrecord rio500 - ); - push @pkgs, "XFree86-$_" foreach qw(3DLabs 3dfx 8514 AGX FBDev I128 Mach8 Mach32 Mach64 Mono P9000 Rage128 S3 S3V SVGA VGA16 W32); - foreach (@pkgs) { - my $pkg = pkgs::packageByName($o->{packages}, $_); - $pkg and pkgs::selectPackage($o->{packages}, $pkg); - } - foreach my $pkg (@{$o->{packages}{depslist}}) { - $pkg->{name} =~ /NVIDIA/ and pkgs::selectPackage($o->{packages}, $pkg); - } - foreach my $pkg (@{$o->{packages}{depslist}}) { - delete $pkg->{selected} and $pkg->{closure} = 1; - } - foreach (qw(Mesa-common xpp libqtcups2 qtcups kups)) { - my $pkg = pkgs::packageByName($o->{packages}, $_); - $pkg and $pkg->{closure} = 1; - } - - #- act as DrakX will do to select packages. - pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'basesystem') || die "no basesystem package found"); - pkgs::read_rpmsrate($o->{packages}, install_any::getFile("Mandrake/base/rpmsrate") || die "unable to read rpmsrate"); - ($o->{compssUsers}, $o->{compssUsersSorted}, $o->{compssUsersIcons}, $o->{compssUsersDescr}) = - pkgs::readCompssUsers($o->{packages}, $o->{meta_class}); - eval { install_any::getFile("XXX") }; #- close out any still opened filehandle.. - - $o->{compssUsersChoice}{$_} = 1 foreach map { @{$o->{compssUsers}{$_}} } @{$o->{compssUsersSorted}}; - $o->{compssUsersChoice}{SYSTEM} = 1; - - my $lang_pkg = $lang && pkgs::packageByName($o->{packages}, "locales-$lang"); - if ($lang_pkg) { - pkgs::selectPackage($o->{packages}, $lang_pkg); - $o->{compssUsersChoice}{qq(LOCALES"$lang")} = 1; - $o->{compssUsersChoice}{qq(LOCALES"$flang")} = 1; - } - - pkgs::setSelectedFromCompssList($o->{packages}, $o->{compssUsersChoice}, 4, 0); - - #- package that have to selected here as a bonus for oem install. - foreach (qw(cups cups-drivers drakprofile draksync irda-utils numlock raidtools reiserfs-utils icewm-light - Mesa Mesa-demos alsa alsa-utils - xawtv kwintv xscreensaver-gl Mesa-demos xmms-mesa bzflag csmash gltron spacecup chromium tuxracer - glibc vim-minimal kernel kernel22 - sox aumix xawtv gatos kwintv sane-frontends gphoto gnome-toaster gcombust xcdroast apmd cdlabelgen - )) { - my $pkg = pkgs::packageByName($o->{packages}, $_); - $pkg and pkgs::selectPackage($o->{packages}, $pkg); - } - - #- special packages that are to be move to closure always ... - foreach (qw(kernel-smp kernel-linus kernel-secure hackkernel-smp hackkernel-linus hackkernel-secure - xawtv kwintv xscreensaver-gl xmms-mesa bzflag csmash gltron spacecup chromium tuxracer - kernel22-smp kernel22-secure alsa imwheel nfs-utils-clients lvm usbd reiserfsprogs - sox aumix xawtv gatos kwintv sane-frontends gphoto gnome-toaster gcombust xcdroast apmd cdlabelgen - )) { - my $pkg = pkgs::packageByName($o->{packages}, $_); - $pkg and $pkg->{closure} = 1, delete $pkg->{selected}; - } - - $o->{packages}; -} - -sub chop_version($) { - ($_[0] =~ /(.*)-[^-]+-[^-]+/)[0] || $_[0]; -} - -sub read_depslist { - my ($file) = @_; - my $packages = { depslist => [], names => {} }; - - #- read depslist.oredered file. - my $id = 0; - - open F, "$file" or die "unable to open ordered dependencies list file"; - while (<F>) { - my ($name, $size, @deps) = split; - push @{$packages->{depslist}}, { id => $id++, name => $name, size => $size, deps => \@deps }; - } - close F; - - foreach (@{$packages->{depslist}}) { - $packages->{names}{chop_version($_->{name})} = $_; - } - - print STDERR "read " . scalar(@{$packages->{depslist}}) . " package dependancies\n"; - $packages; -} - -#- compability method for the below ones, wrap DrakX code extracted. -package log; -sub l {} - -package detect_devices; -sub matching_desc { 0 } - -package install_any; -sub getFile { open FILE, "/cdrom/$_[0]" or return; \*FILE } - -package pkgs; -sub formatXiB { $_[0] } #- NOP -sub packageName { ::chop_version($_[0]{name}) } -sub packageSize { $_[0]{size} } -sub packageDepsId { @{$_[0]{deps}} } -sub packageRate { $_[0]{values}[0] } -sub packageRateRFlags { @{$_[0]{values}} } -sub packageSetRateRFlags { - my ($pkg, @rate_rflags) = @_; - $pkg->{values} = [ @rate_rflags ]; -} -sub packageByName { - my ($packages, $name) = @_; - $packages->{names}{$name}; -} -sub packageById { - my ($packages, $id) = @_; - $packages->{depslist}[$id]; -} -sub selectedSize { - my ($packages) = @_; - my $size = 0; - foreach (@{$packages->{depslist}}) { - $_->{selected} and $size += $_->{size}; - } - $size; -} -my @preferred = qw(perl-GTK postfix wu-ftpd ghostscript-X vim-minimal kernel ispell-en); -sub selectPackage { - my ($packages, $pkg, $base, $otherOnly, $check_recursion) = @_; - - #- avoid infinite recursion (mainly against badly generated depslist.ordered). - $check_recursion ||= {}; exists $check_recursion->{$pkg->{name}} and return; $check_recursion->{$pkg->{name}} = undef; - - #- make sure base package are set even if already selected. - $base and $pkg->{base} = 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 ($pkg->{selected}) { - foreach (@{$pkg->{deps}}) { - 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 = $packages->{depslist}[$_] or next; - $preferred ||= $dep; - $dep->{selected} and $preferred = $dep, last; - exists $preferred{::chop_version($dep->{name})} 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 = $packages->{depslist}[$_]; - $base and $dep->{base} = 1; - $otherOnly and !$dep->{selected} and $otherOnly->{::chop_version($dep->{name})} = 1; - $otherOnly or $dep->{selected} += 1; - } - } - } - $otherOnly and !$pkg->{selected} and $otherOnly->{::chop_version($pkg->{name})} = 1; - $otherOnly or $pkg->{selected} += 1; - 1; -} - -#- this code is extracted from DrakX and SHOULD NOT BE MODIFIED, wrapper method exists above to provide a good choice. -sub read_rpmsrate { - my ($packages, $f) = @_; - my $line_nb = 0; - my (@l); - while (<$f>) { - $line_nb++; - /\t/ and die "tabulations not allowed at line $line_nb\n"; - s/#.*//; # comments - - my ($indent, $data) = /(\s*)(.*)/; - next if !$data; # skip empty lines - - @l = grep { $_->[0] < length $indent } @l; - - my @m = @l ? @{$l[$#l][1]} : (); - my ($t, $flag, @l2); - while ($data =~ - /^(( - [1-5] - | - (?: (?: !\s*)? [0-9A-Z_]+(?:".*?")?) - (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)* - ) - (?:\s+|$) - )(.*)/x) { - ($t, $flag, $data) = ($1,$2,$3); - while ($flag =~ s,^\s*(("[^"]*"|[^"\s]*)*)\s+,$1,) { - } - my $ok = 0; - $flag = join('||', grep { - if (my ($inv, $p) = /^(!)?HW"(.*)"/) { - ($inv xor detect_devices::matching_desc($p)) and $ok = 1; - 0; - } else { - 1; - } - } split '\|\|', $flag); - push @m, $ok ? 'TRUE' : $flag || 'FALSE'; - push @l2, [ length $indent, [ @m ] ]; - $indent .= $t; - } - if ($data) { - # has packages on same line - my ($rate) = grep { /^\d$/ } @m or die sprintf qq(missing rate for "%s" at line %d (flags are %s)\n), $data, $line_nb, join('&&', @m); - foreach (split ' ', $data) { - if ($packages) { - my $p = packageByName($packages, $_) or next; - - my @m2 = map { packageName(packageById($packages, $_)) =~ /locales-(.*)/ ? qq(LOCALES"$1") : () } packageDepsId($p); - packageSetRateRFlags($p, $rate, (grep { !/^\d$/ } @m), @m2); - } else { - print "$_ = ", join(" && ", @m), "\n"; - } - } - push @l, @l2; - } else { - push @l, [ $l2[0][0], $l2[$#l2][1] ]; - } - } - $line_nb > 0 or die "nothing read in rpmsrate"; -} - -sub readCompssUsers { - my ($packages, $meta_class) = @_; - my (%compssUsers, %compssUsersIcons, , %compssUsersDescr, @sorted, $l); - my (%compss); - - 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.*)/) { - 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; - } - } - \%compssUsers, \@sorted, \%compssUsersIcons, \%compssUsersDescr; -} - -sub setSelectedFromCompssList { - my ($packages, $compssUsersChoice, $min_level, $max_size, $install_class) = @_; - $compssUsersChoice->{TRUE} = 1; #- ensure TRUE is set - my $nb = selectedSize($packages); -# foreach my $p (sort { substr($a,0,1) <=> substr($b,0,1) } values %{$packages->{names}}) { - foreach my $p (sort { $b->{values}[0] <=> $a->{values}[0] } @{$packages->{depslist}}) { #- LOCALLY MODIFIED FOR OEM -# my ($rate, @flags) = split "\t", $p->[$VALUES]; - my ($rate, @flags) = packageRateRFlags($p); - next if !$rate || $rate < $min_level || grep { !grep { /^!(.*)/ ? !$compssUsersChoice->{$1} : $compssUsersChoice->{$_} } split('\|\|') } @flags; - - #- 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->{names}{$_}); - } - if ($max_size && $nb > $max_size) { - $nb = $old_nb; - $min_level = packageRate($p); - last; - } - - #- at this point the package can safely be selected. - selectPackage($packages, $p); - } - log::l("setSelectedFromCompssList: reached size ", formatXiB($nb), ", up to indice $min_level (less than ", formatXiB($max_size), ")"); - $min_level; -} diff --git a/tools/ppc/README b/tools/ppc/README deleted file mode 100644 index fd1aaae03..000000000 --- a/tools/ppc/README +++ /dev/null @@ -1,39 +0,0 @@ -Mini-Howto on burning Mandrake PPC Bootable CD's for Apple G3/G4 systems -------------------------------------------------------------------------- -email: John Buswell <johnb@mandrakesoft.com> - -To create a disk image simply use the mkINSTALLCD script provided in this -directory. The path you provide the script should point to the root directory -for the CD. - -For example after you have built the gi install with /export, simply pass -/export to the script as the distribution path and a name for the image. -Once the image is built you can use hmount, humount, hdir, hcd and hattrib -to modify and inspect the image before you commit it to CD-R. - -Before you run the script make sure the CD version of iBoot is in the -iBoot directory below /export (eg. /export/iBoot), if you want to use some -other directory then simply modify the script. Beware, HFS is not case -sensitive, so if you already have an INSTALL file you cannot create install. - -Currently iBoot sports two trees, one for the install CD and another for -regular usage. These will be merged shortly and a simply #define can be used -in the Makefile to implement one or the other from a single binary. - -Enjoy!! - - -Addendum: 3/15/2001 Stew Benedict <sbenedict@mandrakesoft.com> --------------------------------------------------------------------------- - -A couple of changes. - -I've opted to standardize on yaboot, which is user configurable, so the script -is modified now to use yaboot. - -Secondly, since mkhybrid merged with mkisofs, the hybrid images it creates are -read-only, so one is unable to mount the image and bless the boot directory for -booting. Consequently, I've included the binary for mkhybrid-1.12b5.4, which -does work. - - diff --git a/tools/ppc/Xpmac b/tools/ppc/Xpmac Binary files differdeleted file mode 100755 index ec50e6aa0..000000000 --- a/tools/ppc/Xpmac +++ /dev/null diff --git a/tools/ppc/convert b/tools/ppc/convert deleted file mode 100755 index a2622c630..000000000 --- a/tools/ppc/convert +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -mv $1.orig $1.Unix -tr "\n" "\r" < $1.Unix > $1.MacOS -perl -e '@line = <>; $line = join("\r\n", split(/\n/, join("", @line))); print $line; print "\r\n";' < $1.Unix > $1.DOS diff --git a/tools/ppc/e2fsck.shared b/tools/ppc/e2fsck.shared Binary files differdeleted file mode 100644 index 32e506c31..000000000 --- a/tools/ppc/e2fsck.shared +++ /dev/null diff --git a/tools/ppc/magic b/tools/ppc/magic deleted file mode 100755 index 387727c4e..000000000 --- a/tools/ppc/magic +++ /dev/null @@ -1,81 +0,0 @@ -# -# Example magic file for mkhybrid -# -# The "message" for the offset MUST be 4 characters for the CREATOR -# and 4 characters for the TYPE - white space is optional between them. -# Any other characters on this line are ignored. Continuation lines (starting -# with '>') are also ignored i.e. only the initial offset lines are used. -# -# The continuation lines are given here, but they do not need to exist. - -# -# James Pearson 20/5/98 - -# off type test message - -# GIF -0 string GIF8 8BIM GIFf ->4 string 7a \b, version 8%s, ->4 string 9a \b, version 8%s, ->6 leshort >0 %hd x ->8 leshort >0 %hd, -#>10 byte &0x80 color mapped, -#>10 byte&0x07 =0x00 2 colors -#>10 byte&0x07 =0x01 4 colors -#>10 byte&0x07 =0x02 8 colors -#>10 byte&0x07 =0x03 16 colors -#>10 byte&0x07 =0x04 32 colors -#>10 byte&0x07 =0x05 64 colors -#>10 byte&0x07 =0x06 128 colors -#>10 byte&0x07 =0x07 256 colors - -# JPEG images -# -0 ubeshort 0xffd8 8BIM JPEG image data - -# StuffIt -# -0 string SIT! SIT!SIT! - -# standard unix compress -0 string \037\235 LZIV ZIVU ->2 byte&0x80 >0 block compressed ->2 byte&0x1f x %d bits - -# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver) -0 string \037\213 GNUz ZIVU gzip compressed data ->2 byte <8 \b, reserved method, ->2 byte 8 \b, deflated, ->3 byte &0x01 ASCII, ->3 byte &0x02 continuation, ->3 byte &0x04 extra field, ->3 byte &0x08 original filename, ->3 byte &0x10 comment, ->3 byte &0x20 encrypted, ->4 ledate x last modified: %s, ->8 byte 2 max compression, ->8 byte 4 max speed, ->9 byte =0x00 os: MS-DOS ->9 byte =0x01 os: Amiga ->9 byte =0x02 os: VMS ->9 byte =0x03 os: Unix ->9 byte =0x05 os: Atari ->9 byte =0x06 os: OS/2 ->9 byte =0x07 os: MacOS ->9 byte =0x0A os: Tops/20 ->9 byte =0x0B os: Win/32 - -# Postscript -0 string %! ASPSTEXT ->2 string PS-Adobe- conforming ->>11 string >\0 at level %.3s ->>>15 string EPS - type %s ->>>15 string Query - type %s ->>>15 string ExitServer - type %s -# Some PCs have the annoying habit of adding a ^D as a document separator -0 string \004%! ASPS TEXT PostScript document text ->3 string PS-Adobe- conforming ->>12 string >\0 at level %.3s ->>>16 string EPS - type %s ->>>16 string Query - type %s ->>>16 string ExitServer - type %s diff --git a/tools/ppc/mapping b/tools/ppc/mapping deleted file mode 100755 index 2a32fb09c..000000000 --- a/tools/ppc/mapping +++ /dev/null @@ -1,20 +0,0 @@ -# Example filename mapping file -# -# EXTN XLate CREATOR TYPE Comment -COPYING Ascii 'ttxt' 'ttro' "Text File" -CREDITS Ascii 'ttxt' 'ttro' "Text File" -README Ascii 'ttxt' 'ttro' "Text File" -RPM-PGP-KEY Ascii 'ttxt' 'ttro' "Text File" -.gif Raw '8BIM' 'GIFf' "Gif File" -.jpg Raw '8BIM' 'JPEG' "Jpeg File" -.tif Raw '8BIM' 'TIFF' "Photoshop TIFF image" -.hqx Ascii 'BnHq' 'TEXT' "BinHex file" -.doc Raw 'MSWD' 'WDBN' "Word file" -.mov Raw 'TVOD' 'MooV' "QuickTime Movie" -.html Ascii 'MOSS' 'TEXT' "HTML File" -.htm Ascii 'MOSS' 'TEXT' "HTML File" -.txt Ascii 'ttxt' 'TEXT' "Text File" -.conf Ascii 'ttxt' 'TEXT' "config file" -.tbxi Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file" -.sea Raw 'aust' 'APPL' "Self Expanding Archive" -* Raw '????' '????' "Unknown" diff --git a/tools/ppc/mkINSTALLCD b/tools/ppc/mkINSTALLCD deleted file mode 100755 index e05ec8b54..000000000 --- a/tools/ppc/mkINSTALLCD +++ /dev/null @@ -1,78 +0,0 @@ -# -# quick script to make bootable HFS CD for linux -# -# -#!/bin/sh -# -#mkCD1 <CD tree> <output image name> -#Parameters: - -if ! rpm -q hfsutils ; then - echo 'You need hfsutils installed!!' - exit 1 -fi - -if [ -e $2 ] ; then - echo 'Output image $2 exists, please delete' - echo 'usage: mkCD1 <CD tree> <output image name>' - exit 1 -fi - -if [ ! -d $1 ] ; then - echo 'CD tree $1 is not a directory!' - echo 'usage: mkCD1 <CD tree> <output image name>' - exit 1 -fi - -# select the appropriate mkhybrid binary depending on if -# we are on x86 or ppc - -ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'` - -if [ "$ARCH" == "ppc" ]; then - MKHYBRID=mkhybrid-1.12b5.4 -else - if [ "$ARCH" == "i386" ]; then - MKHYBRID=mkhybrid-1.12b5.4-x86 - else - echo "Sorry, no mkhybrid binary for $ARCH..." - exit - fi -fi - -#Change these when you build the CD.. -ApplicationID="Linux-Mandrake" -PublisherID="MandrakeSoft" -PreparerID="sbenedict@mandrakesoft.com" -SystemID=PPC -volid=ppc -hfsVolid=Linux-Mandrake -curPwd=`pwd` - -$curPwd/$MKHYBRID -part -hfs -r -l -J \ --A $ApplicationID \ --P $PublisherID \ --p $PreparerID \ --abstract "README" \ --sysid $SystemID \ --V $volid \ --volset "Update" \ --volset-size 2 \ --volset-seqno 1 \ --hfs-volid $hfsVolid \ --map $curPwd/mapping \ --magic $curPwd/magic \ --m "*.orig" \ --hide '*.MacOS' -hide '*.DOS' \ --hide-joliet '*.Unix' -hide-joliet '*.MacOS' \ --hide-hfs '*.Unix' -hide-hfs '*.DOS' \ --pad \ --o $2 \ -$1 - -#Bless boot folder so yaboot can boot -hmount $2 -hattrib -b boot -hcd boot -hattrib -t tbxi yaboot -humount diff --git a/tools/ppc/mkhybrid-1.12b5.4 b/tools/ppc/mkhybrid-1.12b5.4 Binary files differdeleted file mode 100755 index 0e0901314..000000000 --- a/tools/ppc/mkhybrid-1.12b5.4 +++ /dev/null diff --git a/tools/ppc/mkhybrid-1.12b5.4-x86 b/tools/ppc/mkhybrid-1.12b5.4-x86 Binary files differdeleted file mode 100755 index fd5b21709..000000000 --- a/tools/ppc/mkhybrid-1.12b5.4-x86 +++ /dev/null diff --git a/tools/ppc/yaboot b/tools/ppc/yaboot Binary files differdeleted file mode 100644 index 72b19b911..000000000 --- a/tools/ppc/yaboot +++ /dev/null diff --git a/tools/rpcinfo-flushed.c b/tools/rpcinfo-flushed.c deleted file mode 100644 index 16303406d..000000000 --- a/tools/rpcinfo-flushed.c +++ /dev/null @@ -1,740 +0,0 @@ -#define _(x) x - -/* @(#)rpcinfo.c 2.2 88/08/11 4.0 RPCSRC */ -#if !defined(lint) && defined (SCCSID) -static char sccsid[] = "@(#)rpcinfo.c 1.22 87/08/12 SMI"; -#endif - -/* - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -/* - * rpcinfo: ping a particular rpc program - * or dump the portmapper - */ - -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#include <getopt.h> -#include <string.h> -#include <unistd.h> -#include <rpc/rpc.h> -#include <stdio.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <rpc/pmap_prot.h> -#include <rpc/pmap_clnt.h> -#include <signal.h> -#include <ctype.h> -#include <locale.h> -#include <libintl.h> - -#define MAXHOSTLEN 256 - -#define MIN_VERS ((u_long) 0) -#define MAX_VERS ((u_long) 4294967295UL) - -static void udpping (u_short portflag, int argc, char **argv); -static void tcpping (u_short portflag, int argc, char **argv); -static int pstatus (CLIENT *client, u_long prognum, u_long vers); -static void pmapdump (int argc, char **argv); -static bool_t reply_proc (void *res, struct sockaddr_in *who); -static void brdcst (int argc, char **argv) __attribute__ ((noreturn)); -static void deletereg (int argc, char **argv); -static void usage (void); -static u_long getprognum (char *arg); -static u_long getvers (char *arg); -static void get_inet_address (struct sockaddr_in *addr, char *host); - -/* - * Functions to be performed. - */ -#define NONE 0 /* no function */ -#define PMAPDUMP 1 /* dump portmapper registrations */ -#define TCPPING 2 /* ping TCP service */ -#define UDPPING 3 /* ping UDP service */ -#define BRDCST 4 /* ping broadcast UDP service */ -#define DELETES 5 /* delete registration for the service */ - -int -main (int argc, char **argv) -{ - register int c; - int errflg; - int function; - u_short portnum; - - setlocale (LC_ALL, ""); - - function = NONE; - portnum = 0; - errflg = 0; - while ((c = getopt (argc, argv, "ptubdn:")) != -1) - { - switch (c) - { - - case 'p': - if (function != NONE) - errflg = 1; - else - function = PMAPDUMP; - break; - - case 't': - if (function != NONE) - errflg = 1; - else - function = TCPPING; - break; - - case 'u': - if (function != NONE) - errflg = 1; - else - function = UDPPING; - break; - - case 'b': - if (function != NONE) - errflg = 1; - else - function = BRDCST; - break; - - case 'n': - portnum = (u_short) atoi (optarg); /* hope we don't get bogus # */ - break; - - case 'd': - if (function != NONE) - errflg = 1; - else - function = DELETES; - break; - - case '?': - errflg = 1; - } - } - - if (errflg || function == NONE) - { - usage (); - return 1; - } - - switch (function) - { - - case PMAPDUMP: - if (portnum != 0) - { - usage (); - return 1; - } - pmapdump (argc - optind, argv + optind); - break; - - case UDPPING: - udpping (portnum, argc - optind, argv + optind); - break; - - case TCPPING: - tcpping (portnum, argc - optind, argv + optind); - break; - - case BRDCST: - if (portnum != 0) - { - usage (); - return 1; - } - brdcst (argc - optind, argv + optind); - break; - - case DELETES: - deletereg (argc - optind, argv + optind); - break; - } - - return 0; -} - -static void -udpping (portnum, argc, argv) - u_short portnum; - int argc; - char **argv; -{ - struct timeval to; - struct sockaddr_in addr; - enum clnt_stat rpc_stat; - CLIENT *client; - u_long prognum, vers, minvers, maxvers; - int sock = RPC_ANYSOCK; - struct rpc_err rpcerr; - int failure; - - if (argc < 2 || argc > 3) - { - usage (); - exit (1); - } - prognum = getprognum (argv[1]); - get_inet_address (&addr, argv[0]); - /* Open the socket here so it will survive calls to clnt_destroy */ - sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (sock < 0) - { - perror ("rpcinfo: socket"); - exit (1); - } - failure = 0; - if (argc == 2) - { - /* - * A call to version 0 should fail with a program/version - * mismatch, and give us the range of versions supported. - */ - addr.sin_port = htons (portnum); - to.tv_sec = 5; - to.tv_usec = 0; - if ((client = clntudp_create (&addr, prognum, (u_long) 0, - to, &sock)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu is not available\n"), prognum); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, - (char *) NULL, (xdrproc_t) xdr_void, - (char *) NULL, to); - if (rpc_stat == RPC_PROGVERSMISMATCH) - { - clnt_geterr (client, &rpcerr); - minvers = rpcerr.re_vers.low; - maxvers = rpcerr.re_vers.high; - } - else if (rpc_stat == RPC_SUCCESS) - { - /* - * Oh dear, it DOES support version 0. - * Let's try version MAX_VERS. - */ - addr.sin_port = htons (portnum); - to.tv_sec = 5; - to.tv_usec = 0; - if ((client = clntudp_create (&addr, prognum, MAX_VERS, - to, &sock)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, MAX_VERS); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, to); - if (rpc_stat == RPC_PROGVERSMISMATCH) - { - clnt_geterr (client, &rpcerr); - minvers = rpcerr.re_vers.low; - maxvers = rpcerr.re_vers.high; - } - else if (rpc_stat == RPC_SUCCESS) - { - /* - * It also supports version MAX_VERS. - * Looks like we have a wise guy. - * OK, we give them information on all - * 4 billion versions they support... - */ - minvers = 0; - maxvers = MAX_VERS; - } - else - { - (void) pstatus (client, prognum, MAX_VERS); - exit (1); - } - } - else - { - (void) pstatus (client, prognum, (u_long) 0); - exit (1); - } - clnt_destroy (client); - for (vers = minvers; vers <= maxvers; vers++) - { - addr.sin_port = htons (portnum); - to.tv_sec = 5; - to.tv_usec = 0; - if ((client = clntudp_create (&addr, prognum, vers, - to, &sock)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, vers); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, to); - if (pstatus (client, prognum, vers) < 0) - failure = 1; - clnt_destroy (client); - } - } - else - { - vers = getvers (argv[2]); - addr.sin_port = htons (portnum); - to.tv_sec = 5; - to.tv_usec = 0; - if ((client = clntudp_create (&addr, prognum, vers, - to, &sock)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, vers); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, 0, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_void, NULL, to); - if (pstatus (client, prognum, vers) < 0) - failure = 1; - } - (void) close (sock); /* Close it up again */ - if (failure) - exit (1); -} - -static void -tcpping (portnum, argc, argv) - u_short portnum; - int argc; - char **argv; -{ - struct timeval to; - struct sockaddr_in addr; - enum clnt_stat rpc_stat; - CLIENT *client; - u_long prognum, vers, minvers, maxvers; - int sock = RPC_ANYSOCK; - struct rpc_err rpcerr; - int failure; - - if (argc < 2 || argc > 3) - { - usage (); - exit (1); - } - prognum = getprognum (argv[1]); - get_inet_address (&addr, argv[0]); - failure = 0; - if (argc == 2) - { - /* - * A call to version 0 should fail with a program/version - * mismatch, and give us the range of versions supported. - */ - addr.sin_port = htons (portnum); - if ((client = clnttcp_create (&addr, prognum, MIN_VERS, - &sock, 0, 0)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu is not available\n"), prognum); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_void, NULL, to); - if (rpc_stat == RPC_PROGVERSMISMATCH) - { - clnt_geterr (client, &rpcerr); - minvers = rpcerr.re_vers.low; - maxvers = rpcerr.re_vers.high; - } - else if (rpc_stat == RPC_SUCCESS) - { - /* - * Oh dear, it DOES support version 0. - * Let's try version MAX_VERS. - */ - addr.sin_port = htons (portnum); - if ((client = clnttcp_create (&addr, prognum, MAX_VERS, - &sock, 0, 0)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, MAX_VERS); - exit (1); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, to); - if (rpc_stat == RPC_PROGVERSMISMATCH) - { - clnt_geterr (client, &rpcerr); - minvers = rpcerr.re_vers.low; - maxvers = rpcerr.re_vers.high; - } - else if (rpc_stat == RPC_SUCCESS) - { - /* - * It also supports version MAX_VERS. - * Looks like we have a wise guy. - * OK, we give them information on all - * 4 billion versions they support... - */ - minvers = 0; - maxvers = MAX_VERS; - } - else - { - (void) pstatus (client, prognum, MAX_VERS); - exit (1); - } - } - else - { - (void) pstatus (client, prognum, MIN_VERS); - exit (1); - } - clnt_destroy (client); - (void) close (sock); - sock = RPC_ANYSOCK; /* Re-initialize it for later */ - for (vers = minvers; vers <= maxvers; vers++) - { - addr.sin_port = htons (portnum); - if ((client = clnttcp_create (&addr, prognum, vers, - &sock, 0, 0)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, vers); - exit (1); - } - to.tv_usec = 0; - to.tv_sec = 10; - rpc_stat = clnt_call (client, 0, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_void, NULL, to); - if (pstatus (client, prognum, vers) < 0) - failure = 1; - clnt_destroy (client); - (void) close (sock); - sock = RPC_ANYSOCK; - } - } - else - { - vers = getvers (argv[2]); - addr.sin_port = htons (portnum); - if ((client = clnttcp_create (&addr, prognum, vers, &sock, - 0, 0)) == NULL) - { - clnt_pcreateerror ("rpcinfo"); - printf (_("program %lu version %lu is not available\n"), - prognum, vers); - exit (1); - } - to.tv_usec = 0; - to.tv_sec = 10; - rpc_stat = clnt_call (client, 0, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_void, NULL, to); - if (pstatus (client, prognum, vers) < 0) - failure = 1; - } - if (failure) - exit (1); -} - -/* - * This routine should take a pointer to an "rpc_err" structure, rather than - * a pointer to a CLIENT structure, but "clnt_perror" takes a pointer to - * a CLIENT structure rather than a pointer to an "rpc_err" structure. - * As such, we have to keep the CLIENT structure around in order to print - * a good error message. - */ -static int -pstatus (client, prognum, vers) - register CLIENT *client; - u_long prognum; - u_long vers; -{ - struct rpc_err rpcerr; - - clnt_geterr (client, &rpcerr); - if (rpcerr.re_status != RPC_SUCCESS) - { - clnt_perror (client, "rpcinfo"); - printf (_("program %lu version %lu is not available\n"), prognum, vers); - return -1; - } - else - { - printf (_("program %lu version %lu ready and waiting\n"), prognum, vers); - return 0; - } -} - -static void -pmapdump (argc, argv) - int argc; - char **argv; -{ - struct sockaddr_in server_addr; - register struct hostent *hp; - struct pmaplist *head = NULL; - int socket = RPC_ANYSOCK; - struct timeval minutetimeout; - register CLIENT *client; - struct rpcent *rpc; - - if (argc > 1) - { - usage (); - exit (1); - } - if (argc == 1) - get_inet_address (&server_addr, argv[0]); - else - { - bzero ((char *) &server_addr, sizeof server_addr); - server_addr.sin_family = AF_INET; - if ((hp = gethostbyname ("localhost")) != NULL) - bcopy (hp->h_addr, (caddr_t) & server_addr.sin_addr, - hp->h_length); - else - server_addr.sin_addr.s_addr = inet_addr ("0.0.0.0"); - } - minutetimeout.tv_sec = 60; - minutetimeout.tv_usec = 0; - server_addr.sin_port = htons (PMAPPORT); - if ((client = clnttcp_create (&server_addr, PMAPPROG, - PMAPVERS, &socket, 50, 500)) == NULL) - { - clnt_pcreateerror (_("rpcinfo: can't contact portmapper")); - exit (1); - } - if (clnt_call (client, PMAPPROC_DUMP, (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_pmaplist, (caddr_t) &head, - minutetimeout) != RPC_SUCCESS) - { - fputs (_("rpcinfo: can't contact portmapper"), stderr); - fputs (": ", stderr); - clnt_perror (client, "rpcinfo"); - exit (1); - } - if (head == NULL) - { - fputs (_("No remote programs registered.\n"), stdout); - } - else - { - fputs (_(" program vers proto port\n"), stdout); - for (; head != NULL; head = head->pml_next) - { - printf ("%10ld%5ld", - head->pml_map.pm_prog, - head->pml_map.pm_vers); - if (head->pml_map.pm_prot == IPPROTO_UDP) - printf ("%6s", "udp"); - else if (head->pml_map.pm_prot == IPPROTO_TCP) - printf ("%6s", "tcp"); - else - printf ("%6ld", head->pml_map.pm_prot); - printf ("%7ld", head->pml_map.pm_port); - rpc = getrpcbynumber (head->pml_map.pm_prog); - if (rpc) - printf (" %s\n", rpc->r_name); - else - printf ("\n"); - } - } -} - -/* - * reply_proc collects replies from the broadcast. - * to get a unique list of responses the output of rpcinfo should - * be piped through sort(1) and then uniq(1). - */ - -/*ARGSUSED */ -static bool_t -reply_proc (res, who) - void *res; /* Nothing comes back */ - struct sockaddr_in *who; /* Who sent us the reply */ -{ - register struct hostent *hp; - - hp = gethostbyaddr ((char *) &who->sin_addr, sizeof who->sin_addr, - AF_INET); - printf ("%s %s\n", inet_ntoa (who->sin_addr), - (hp == NULL) ? _("(unknown)") : hp->h_name); - fflush(stdout); - return FALSE; -} - -static void -brdcst (argc, argv) - int argc; - char **argv; -{ - enum clnt_stat rpc_stat; - u_long prognum, vers; - - if (argc != 2) - { - usage (); - exit (1); - } - prognum = getprognum (argv[0]); - vers = getvers (argv[1]); - rpc_stat = clnt_broadcast (prognum, vers, NULLPROC, (xdrproc_t) xdr_void, - NULL, (xdrproc_t) xdr_void, NULL, - (resultproc_t) reply_proc); - if ((rpc_stat != RPC_SUCCESS) && (rpc_stat != RPC_TIMEDOUT)) - { - fprintf (stderr, _("rpcinfo: broadcast failed: %s\n"), - clnt_sperrno (rpc_stat)); - exit (1); - } - exit (0); -} - -static void -deletereg (argc, argv) - int argc; - char **argv; -{ - u_long prog_num, version_num; - - if (argc != 2) - { - usage (); - exit (1); - } - if (getuid ()) - { /* This command allowed only to root */ - fputs (_("Sorry. You are not root\n"), stderr); - exit (1); - } - prog_num = getprognum (argv[0]); - version_num = getvers (argv[1]); - if ((pmap_unset (prog_num, version_num)) == 0) - { - fprintf (stderr, _("rpcinfo: Could not delete registration for prog %s version %s\n"), - argv[0], argv[1]); - exit (1); - } -} - -static void -usage () -{ - fputs (_("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"), - stderr); - fputs (_(" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"), - stderr); - fputs (_(" rpcinfo -p [ host ]\n"), stderr); - fputs (_(" rpcinfo -b prognum versnum\n"), stderr); - fputs (_(" rpcinfo -d prognum versnum\n"), stderr); -} - -static u_long -getprognum (arg) - char *arg; -{ - register struct rpcent *rpc; - register u_long prognum; - - if (isalpha (*arg)) - { - rpc = getrpcbyname (arg); - if (rpc == NULL) - { - fprintf (stderr, _("rpcinfo: %s is unknown service\n"), arg); - exit (1); - } - prognum = rpc->r_number; - } - else - { - prognum = (u_long) atoi (arg); - } - - return prognum; -} - -static u_long -getvers (arg) - char *arg; -{ - register u_long vers; - - vers = (int) atoi (arg); - return vers; -} - -static void -get_inet_address (addr, host) - struct sockaddr_in *addr; - char *host; -{ - register struct hostent *hp; - - bzero ((char *) addr, sizeof *addr); - addr->sin_addr.s_addr = (u_long) inet_addr (host); - if (addr->sin_addr.s_addr == INADDR_NONE - || addr->sin_addr.s_addr == INADDR_ANY) - { - if ((hp = gethostbyname (host)) == NULL) - { - fprintf (stderr, _("rpcinfo: %s is unknown host\n"), - host); - exit (1); - } - bcopy (hp->h_addr, (char *) &addr->sin_addr, hp->h_length); - } - addr->sin_family = AF_INET; -} diff --git a/tools/serial_probe/.cvsignore b/tools/serial_probe/.cvsignore deleted file mode 100644 index e8e3e2d94..000000000 --- a/tools/serial_probe/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -serial_probe diff --git a/tools/serial_probe/Makefile b/tools/serial_probe/Makefile deleted file mode 100644 index 8e8590d62..000000000 --- a/tools/serial_probe/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -CFLAGS = -Wall -Os -CFILES = $(wildcard *.c) -OFILES = $(CFILES:%.c=%.o) -GOAL = serial_probe - -$(GOAL): $(OFILES) - -clean: - rm -f $(GOAL) $(OFILES) *~ diff --git a/tools/serial_probe/device.h b/tools/serial_probe/device.h deleted file mode 100644 index fa5f8183e..000000000 --- a/tools/serial_probe/device.h +++ /dev/null @@ -1,80 +0,0 @@ - -/* Copyright 1999 Red Hat, Inc. - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - - -#ifndef _KUDZU_DEVICES_H_ -#define _KUDZU_DEVICES_H_ - -#include <stdio.h> - -enum deviceClass { - /* device classes... this is somewhat ad-hoc */ - CLASS_UNSPEC, CLASS_OTHER, CLASS_NETWORK, CLASS_SCSI, CLASS_VIDEO, - CLASS_AUDIO, CLASS_MOUSE, CLASS_MODEM, CLASS_CDROM, CLASS_TAPE, - CLASS_FLOPPY, CLASS_SCANNER, CLASS_HD, CLASS_RAID, CLASS_PRINTER, - CLASS_CAPTURE, CLASS_KEYBOARD, CLASS_PCMCIA -}; - -enum deviceBus { - /* 'bus' that a device is attached to... this is also ad-hoc */ - /* BUS_SBUS is sort of a misnomer - it's more or less Sun */ - /* OpenPROM probing of all various associated non-PCI buses */ - BUS_UNSPEC = 0, - BUS_OTHER = (1 << 0), - BUS_PCI = (1 << 1), - BUS_SBUS = (1 << 2), - BUS_PSAUX = (1 << 3), - BUS_SERIAL = (1 << 4), - BUS_PARALLEL = (1 << 5), - BUS_SCSI = (1 << 6), - BUS_IDE = (1 << 7), - /* Again, misnomer */ - BUS_KEYBOARD = (1 << 8), -#ifdef _i_wanna_build_this_crap_ - BUS_ISAPNP = (1 << 9), -#endif -}; - -struct device { - /* This pointer is used to make lists by the library. */ - /* Do not expect it to remain constant (or useful) across library calls. */ - struct device *next; - /* Used for ordering, and for aliasing (modem0, modem1, etc.) */ - int index; - enum deviceClass class; /* type */ - enum deviceBus bus; /* bus it's attached to */ - char * device; /* device file associated with it */ - char * driver; /* driver to load, if any */ - char * desc; /* a description */ - int detached; /* should we care if it disappears? */ - struct device *(*newDevice) (struct device *old, struct device *new); - void (*freeDevice) (struct device *dev); - void (*writeDevice) (FILE *file, struct device *dev); - int (*compareDevice) (struct device *dev1, struct device *dev2); -}; - -struct device *newDevice(struct device *old, struct device *new); -void freeDevice(struct device *dev); -void writeDevice(FILE *file, struct device *dev); -int compareDevice(struct device *dev1, struct device *dev2); -struct device *readDevice(FILE *file); - -/* Most of these aren't implemented yet...... */ -/* Return everything found, even non-useful stuff */ -#define PROBE_ALL 1 -/* Don't do 'dangerous' probes that could do weird things (isapnp, serial) */ -#define PROBE_SAFE (1<<1) -/* Stop at first device found */ -#define PROBE_ONE (1<<2) - - -#endif diff --git a/tools/serial_probe/serial.c b/tools/serial_probe/serial.c deleted file mode 100644 index 14b315817..000000000 --- a/tools/serial_probe/serial.c +++ /dev/null @@ -1,1209 +0,0 @@ -/* probe serial port for PnP/Legacy devices - * - * Copyright 1999 Red Hat, Inc. - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <unistd.h> -#include <termios.h> -#include <errno.h> -#include <string.h> -#include <signal.h> -#include <time.h> -#include <libgen.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/ioctl.h> - -#include <linux/serial.h> -#include "serial.h" - -/* character strings ARE null-terminated in the following structure */ -/* these elements are marked with a (string) in the comment */ -/* If PnP device sent 6 bit data stream, we've xlated by a 0x20 offset */ -/* When computing checksum, must remove this offset */ -struct pnp_com_id { - unsigned char xlate_6bit; /* does this contain xlated data */ - unsigned char other_id[17]; /* backward compatibility with pre-PNP */ - unsigned char other_len; /* length of the other_id */ - unsigned char pnp_rev[2]; /* PnP revision bytes */ - unsigned char pnp_rev_str[8]; /* PnP revision (string version) */ - unsigned char eisa_id[4]; /* EISA Mfr identifier (string) */ - unsigned char product_id[5]; /* Mfr determined product ID (string) */ - unsigned char serial_number[9];/* Optional dev serial number (string) */ - unsigned char class_name[33]; /* Optional PnP Class name (string) */ - unsigned char driver_id[42]; /* Optional compat device IDs (string) */ - unsigned char user_name[42]; /* Optional verbose product descr (string)*/ - unsigned char checksum[2]; /* Optional checksum */ -}; - -/* there are two possible bytes to signify the start of a PnP ID string */ -#define BeginPnP1 0x28 -#define BeginPnP2 0x08 - -/* Likewise, two possible stop bytes */ -#define EndPnP1 0x29 -#define EndPnP2 0x09 - -/* these chars indicate extensions to the base dev id exist */ -#define ExtendPnP1 0x5c -#define ExtendPnP2 0x3c - -#define PNP_COM_MAXLEN 256 - -/* results from initiating hardware probe of a hardware device */ -#define PNP_COM_FATAL 1 /* system error, check errno */ -#define PNP_COM_FAIL 2 /* probe ok, but found nothing */ -#define PNP_COM_OK 3 /* probe ok, we found it */ - -/* types of devices we might find */ -/* if PNP_COM_PNPDEV is NOT set, its a legacy device */ -#define PNP_COM_MOUSE 1 /* its a mouse */ -#define PNP_COM_MODEM 2 /* its a modem */ -#define PNP_COM_OTHER 4 /* device is there, cant tell what kind */ -#define PNP_COM_NOEXIST 8 /* no device seen */ -#define PNP_COM_PNPDEV 512 /* its a PNP device */ - -/* level of debugging output */ -/* current any value > 0 dumps all available debugging output */ -static int debug_level=0; - -static void serialFreeDevice(struct serialDevice *dev) { - if (dev->pnpmfr) free(dev->pnpmfr); - if (dev->pnpmodel) free(dev->pnpmodel); - if (dev->pnpcompat) free(dev->pnpcompat); - if (dev->pnpdesc) free(dev->pnpdesc); - freeDevice((struct device *)dev); -} - -static void serialWriteDevice(FILE *file, struct serialDevice *dev) -{ - writeDevice(file, (struct device *) dev); - if (dev->pnpmfr) - fprintf(file,"pnpmfr: %s\n",dev->pnpmfr); - if (dev->pnpmodel) - fprintf(file,"pnpmodel: %s\n",dev->pnpmodel); - if (dev->pnpcompat) - fprintf(file,"pnpcompat: %s\n",dev->pnpcompat); - if (dev->pnpdesc) - fprintf(file,"pnpdesc: %s\n",dev->pnpdesc); -} - -static int serialCompareDevice( struct serialDevice *dev1, struct serialDevice *dev2) -{ - int x; - - x = compareDevice((struct device *)dev1, (struct device *)dev2); - if (x && x!=2) return x; - if (dev1->pnpmfr && dev2->pnpmfr && strcmp(dev1->pnpmfr,dev2->pnpmfr)) - return 1; - if ((!dev1->pnpmfr || !dev2->pnpmfr) && (dev1->pnpmfr != dev2->pnpmfr)) - return 1; - if (dev1->pnpmodel && dev2->pnpmodel && strcmp(dev1->pnpmodel,dev2->pnpmodel)) - return 1; - if ((!dev1->pnpmodel || !dev2->pnpmodel) && (dev1->pnpmodel != dev2->pnpmodel)) - return 1; - if (dev1->pnpcompat && dev2->pnpcompat && strcmp(dev1->pnpcompat,dev2->pnpcompat)) - return 1; - if ((!dev1->pnpcompat || !dev2->pnpcompat) && (dev1->pnpcompat != dev2->pnpcompat)) - return 1; - if (dev1->pnpdesc && dev2->pnpdesc && strcmp(dev1->pnpdesc,dev2->pnpdesc)) - return 1; - if ((!dev1->pnpdesc || !dev2->pnpdesc) && (dev1->pnpdesc != dev2->pnpdesc)) - return 1; - return x; -} - - -struct serialDevice * serialNewDevice(struct serialDevice *dev) { - struct serialDevice *ret; - - ret = malloc(sizeof(struct serialDevice)); - memset(ret,'\0',sizeof(struct serialDevice)); - ret=(struct serialDevice *)newDevice((struct device *)dev,(struct device *)ret); - ret->bus = BUS_SERIAL; - ret->newDevice = serialNewDevice; - ret->freeDevice = serialFreeDevice; - ret->writeDevice = serialWriteDevice; - ret->compareDevice = serialCompareDevice; - if (dev && dev->bus == BUS_SERIAL) { - if (dev->pnpmfr) - ret->pnpmfr=strdup(dev->pnpmfr); - if (dev->pnpmodel) - ret->pnpmodel=strdup(dev->pnpmodel); - if (dev->pnpcompat) - ret->pnpcompat=strdup(dev->pnpcompat); - if (dev->pnpdesc) - ret->pnpdesc=strdup(dev->pnpdesc); - } - return ret; -} - -/* UNUSED */ -void print_status_lines( int fd ) { - int modem_lines; - - ioctl(fd, TIOCMGET, &modem_lines); - - printf("DTR : %s\n",(modem_lines & TIOCM_DTR ? "On" : "Off")); - printf("RTS : %s\n",(modem_lines & TIOCM_RTS ? "On" : "Off")); - printf("CTS : %s\n",(modem_lines & TIOCM_CTS ? "On" : "Off")); - printf("DSR : %s\n",(modem_lines & TIOCM_DSR ? "On" : "Off")); - printf("CD : %s\n",(modem_lines & TIOCM_CD ? "On" : "Off")); - printf("RI : %s\n",(modem_lines & TIOCM_RI ? "On" : "Off")); - -} - - -/* UNUSED except in debug */ -/* outputs data in a hex table, 8 values per row */ -void print_hex_data( unsigned char *data, int len ) { - int i, j, pos; - - if (len == 0) { - printf("No data to print.\n"); - return; - } - - pos = 0; - for (i=0; i< len; i+=8) { - printf("0x%.4x ", i); - for (j=i; j < len && j < i+8; j++) { - printf("0x%.2x ",data[pos++]); - } - printf("\n"); - } -} - - -/* - * wait_input - wait until there is data available on fd, - * for the length of time specified by *timo (indefinite - * if timo is NULL). - */ - -int wait_for_input (int fd, struct timeval *timo) { - fd_set ready; - int n; - - FD_ZERO(&ready); - FD_SET(fd, &ready); - - n = select(fd+1, &ready, NULL, &ready, timo); - return n; -} - -/* UNUSED */ -/* read characters into the buffer buf, until one of: */ -/* char_timeout expired before next character arrives */ -/* total_timeout expires */ -/* maxlen characters are retrieved */ -/* */ -/* returns < 0 if it fails */ -/* otherwise the # of characters received is returned */ -/* char_timeout is in microseconds (millionths of a sec) */ -/* total_timeout is in seconds */ -int timed_serial_read(int fd, int char_timeout, int total_timeout, - unsigned char *buf, int maxlen ) { - - int done, pos, starttime, temp; - struct timeval timo; - unsigned char intbuf[2]; - - /* start reading */ - done = 0; - pos = 0; - starttime=time(NULL); - memset(buf, 0, maxlen); - while (!done) { - timo.tv_sec=0; - timo.tv_usec=char_timeout; - if (wait_for_input(fd, &timo) > 0) { - temp = read( fd, intbuf, 1 ); - if (temp < 0) { - if (errno != EAGAIN) - return -1; - } else { - buf[pos++] = intbuf[0]; - buf[pos] = 0; - } - } else - done = 1; - - /* shouldnt run more than 5 seconds */ - if (time(NULL)-starttime > total_timeout ) - done = 1; - - if (pos > maxlen) - done = 1; - } - return pos; -} - - -int open_serial_port( char *port ) { - int fd; - - fd = open( port, O_RDWR | O_NONBLOCK); - if (fd < 0) - return -1; - - /* reset file so it is no longer in non-blocking mode */ - if (fcntl(fd, F_SETFL, 0) < 0) { - close(fd); - return -1; - } - - return fd; -} - -/* <0 means ioctl error occurred */ -int get_serial_lines( int fd ) { - int modem_lines; - - ioctl(fd, TIOCMGET, &modem_lines); - return modem_lines; -} - -/* <0 means ioctl error occurred */ -int set_serial_lines( int fd, int modem_lines ) { - return ioctl(fd, TIOCMSET, &modem_lines); -} - -/* set serial port to 1200 baud, 'nbits' bits, 1 stop, no parity */ -int setup_serial_port( int fd, int nbits, struct termios *attr ) { - - attr->c_iflag = IGNBRK | IGNPAR; - attr->c_cflag = 0; - attr->c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | PARENB); - attr->c_cflag |= CREAD | CLOCAL; /*| CRTSCTS ; */ - if (nbits == 7) - attr->c_cflag |= CS7 | CSTOPB; - else - attr->c_cflag |= CS8; - attr->c_oflag = 0; - attr->c_lflag = 0; - - attr->c_cc[VMIN] = 1; - attr->c_cc[VTIME] = 5; - - cfsetospeed( attr, B1200); - cfsetispeed( attr, B1200); - return tcsetattr(fd, TCSANOW, attr); -} - -/* Initialize the serial port to a known state *before* probing. This is - * apparently required for some Logitech mice, who will stubbornly refuse - * to respond to PnP probes after they've been opened by gpm or XFree. - */ - -int init_port(int fd) { - struct termios attr; - - if (tcgetattr(fd,&attr)) - return 1; - - cfsetospeed(&attr, B2400); - cfsetispeed(&attr, B2400); - attr.c_iflag = IXON | ICRNL; - attr.c_cflag = CLOCAL | HUPCL | CREAD | B9600 | CS8; - attr.c_oflag = 0; - attr.c_lflag = 0; - return tcsetattr(fd, TCSANOW, &attr); -} - - -/* Request for PnP info from serial device */ -/* See page 6 of the pnpcom doc from Microsoft */ -/* Return code tells us what happened */ -/* */ -/* PNP_COM_FATAL - error, errno has reason */ -/* PNP_COM_OK - probe initiated successfully */ -/* PNP_COM_FAIL - DSR never came on - try alterntives */ -/* means (ATI9?) to get PnP string */ -int init_pnp_com_seq1( int fd ) { - int modem_lines; - int temp; - int dsr_status; - int rc = PNP_COM_OK; - struct termios portattr; - - if (init_port(fd)) - return PNP_COM_FATAL; - - modem_lines = get_serial_lines(fd); - - /* turn off RTS */ - modem_lines &= ~TIOCM_RTS; - set_serial_lines(fd, modem_lines); - - /* wait 200ms for DSR=1 */ - usleep(200000); - - dsr_status = get_serial_lines(fd) & TIOCM_DSR; - /* see if we got DSR coming up */ - - if (!dsr_status) { - /* turn DTR and RTS back on and try alternative methods */ - modem_lines |= TIOCM_DTR | TIOCM_RTS; - set_serial_lines(fd, modem_lines); - rc = PNP_COM_OK; - } - - /* COM port Setup, 1st phase */ - /* now we set port to be 1200 baud, 7 bits, no parity, 1 stop bit */ - temp = tcgetattr(fd, &portattr); - if (temp < 0) - return PNP_COM_FATAL; - /* goto 1200 baud, etc etc as PnP requires */ - temp = setup_serial_port( fd, 7, &portattr ); - if (temp < 0) - return PNP_COM_FATAL; - - /* we drop DTR and RTS */ - modem_lines &= ~( TIOCM_RTS | TIOCM_DTR); - set_serial_lines(fd, modem_lines); - usleep(200000); - - /* bring DTR back up */ - modem_lines |= TIOCM_DTR; - set_serial_lines(fd, modem_lines); - usleep(200000); - - /* now entering next phase */ - modem_lines |= TIOCM_RTS; - set_serial_lines(fd, modem_lines); - usleep(200000); - - return rc; -} - - -/* Request for PnP info from serial device */ -/* Uses ATI9 code, may not do anything but return 'ERROR' */ -/* Return code tells us what happened */ -/* */ -/* PNP_COM_FATAL - error, errno has reason */ -/* PNP_COM_OK - probe initiated successfully */ -/* PNP_COM_FAIL - DSR never came on - try alterntives */ -/* means (ATI9?) to get PnP string */ -int init_pnp_com_ati9( int fd ) { - int modem_lines; - int temp; - int done; - int respindex; - int starttime; - unsigned char resp[100], buf[2]; - struct timeval timo; - struct termios portattr; - - modem_lines = get_serial_lines(fd); - - /* turn off RTS */ - modem_lines &= ~TIOCM_RTS; - set_serial_lines(fd, modem_lines); - - /* wait 200ms for DSR=1 */ - usleep(200000); - - /* now we set port to be 1200 baud, 8 bits, no parity, 1 stop bit */ - temp = tcgetattr(fd, &portattr); - if (temp < 0) { - modem_lines |= TIOCM_DTR | TIOCM_RTS; - set_serial_lines(fd, modem_lines); - return PNP_COM_FATAL; - } - - /* goto 1200 baud, 8 bits */ - temp = setup_serial_port( fd, 8, &portattr ); - if (temp < 0) { - modem_lines |= TIOCM_DTR | TIOCM_RTS; - set_serial_lines(fd, modem_lines); - return PNP_COM_FATAL; - } - - /* turn on DTR and RTS */ - modem_lines = get_serial_lines(fd); - modem_lines |= TIOCM_RTS | TIOCM_DTR; - set_serial_lines(fd, modem_lines); - usleep(200000); - - /* send the 'AT' command */ - if (debug_level > 0) - printf("Sending ATI9 command to modem\n"); - - write(fd, "ATI9\r", 5); - - /* start reading - read the AT command back */ - done = 0; - respindex= 0; - starttime=time(NULL); - memset(resp, 0, sizeof(resp)); - while (!done) { - timo.tv_sec=0; - timo.tv_usec=250000; - if (wait_for_input(fd, &timo) > 0) { - temp = read( fd, buf, 1 ); - if (temp < 0) { - if (errno != EAGAIN) - return PNP_COM_FATAL; - } else { - resp[respindex++] = buf[0]; - resp[respindex] = 0; - } - } else - done = 1; - - /* shouldnt run more than 5 seconds */ - if (time(NULL)-starttime > 5 ) - done = 1; - - if (respindex > 6) - done = 1; - - if (strstr(resp, "ATI9\r")) - done = 1; - - if (debug_level > 0) - printf("ATI9 probe ->%d \"%s\"\n",respindex, resp); - } - - /* see if we saw the 'OK' response */ - if (strstr(resp, "(")) - return PNP_COM_OK; - else - return PNP_COM_FAIL; - - return PNP_COM_OK; -} - -/* See if this is a legacy mouse device */ -/* Only called if the PnP probe above failed */ -/* We turn off the mouse via RS232 lines, then turn it on */ -/* If it spits out an 'M' character (at 1200 baud, 7N1) */ -/* it could be a mouse. */ -/* */ -/* Return code tells us what happened */ -/* */ -/* PNP_COM_FATAL - error, errno has reason */ -/* PNP_COM_OK - probe saw 'M' */ -/* PNP_COM_FAIL - Never saw the 'M' response */ - -int find_legacy_mouse( int fd ) { - int modem_lines; - int temp; - int done; - int starttime; - unsigned char resp[2]; - struct timeval timo; - struct termios portattr; - - /* now we set port to be 1200 baud, 7 bits, no parity, 1 stop bit */ - temp = tcgetattr(fd, &portattr); - if (temp < 0) - return PNP_COM_FATAL; - - /* goto 1200 baud, etc etc*/ - temp = setup_serial_port( fd, 7, &portattr ); - if (temp < 0) - return PNP_COM_FATAL; - - /* we drop DTR and RTS */ - modem_lines = get_serial_lines(fd); - modem_lines &= ~( TIOCM_RTS | TIOCM_DTR); - set_serial_lines(fd, modem_lines); - usleep(200000); - - /* bring them DTR back up */ - modem_lines |= TIOCM_DTR | TIOCM_RTS; - set_serial_lines(fd, modem_lines); - - /* start reading - after first character we quit */ - done = 0; - starttime=time(NULL); - while (!done) { - timo.tv_sec=0; - timo.tv_usec=250000; - if (wait_for_input(fd, &timo) > 0) { - temp = read( fd, resp, 1 ); - if (temp < 0) { - if (errno != EAGAIN) - return PNP_COM_FATAL; - } else { - done = 1; - } - } else - done = 1; - - - /* shouldnt run more than 2 seconds */ - if (time(NULL)-starttime > 2 ) - done = 1; - } - if (*resp == 'M') - return PNP_COM_OK; - else - return PNP_COM_FAIL; -} - -/* See if this is a legacy modem device */ -/* Only called if the PnP probe above failed */ -/* We send a '!AT' and see if we get an 'OK' back */ -/* */ -/* Return code tells us what happened */ -/* */ -/* PNP_COM_FATAL - error, errno has reason */ -/* PNP_COM_OK - probe saw 'OK' */ -/* PNP_COM_FAIL - Never saw the 'OK' response */ -int find_legacy_modem( int fd ) { - int modem_lines; - int temp; - int done; - int respindex; - int starttime; - unsigned char resp[10], buf[2]; - struct timeval timo; - struct termios portattr; - - /* now we set port to be 1200 baud, 8 bits, no parity, 1 stop bit */ - temp = tcgetattr(fd, &portattr); - if (temp < 0) - return PNP_COM_FATAL; - - /* goto 1200 baud, 8 bits */ - temp = setup_serial_port( fd, 8, &portattr ); - if (temp < 0) - return PNP_COM_FATAL; - - /* turn on DTR and RTS */ - modem_lines = get_serial_lines(fd); - modem_lines |= TIOCM_RTS | TIOCM_DTR; - set_serial_lines(fd, modem_lines); - usleep(200000); - - /* send the 'AT' command */ - if (debug_level > 0) - printf("Sending AT command to modem\n"); - - write(fd, "AT\r", 3); - - /* start reading - we'll get AT command back first, then modem response */ - done = 0; - respindex= 0; - starttime=time(NULL); - memset(resp, 0, sizeof(resp)); - while (!done) { - timo.tv_sec=0; - timo.tv_usec=250000; - if (wait_for_input(fd, &timo) > 0) { - temp = read( fd, buf, 1 ); - if (temp < 0) { - if (errno != EAGAIN) - return PNP_COM_FATAL; - } else { - resp[respindex++] = buf[0]; - } - } else - done = 1; - - /* shouldnt run more than 5 seconds */ - if (time(NULL)-starttime > 5 ) - done = 1; - - if (respindex > 9) - done = 1; - } - - /* see if we saw the 'OK' response */ - if (strstr(resp, "OK")) - return PNP_COM_OK; - else - return PNP_COM_FAIL; -} - -/* retrieve the PnP ID string */ -/* timeout after 3 seconds */ -/* should probably set a 200 msec timeout per char, as spec says */ -/* if no char received, we're done */ -int read_pnp_string( int fd, unsigned char *pnp_string, int *pnp_len, int pnp_stringbuf_size ) { - int pnp_index; - int temp, done, counter; - int seen_start; - time_t starttime; - struct timeval timo; - unsigned char buf[80]; - unsigned char end_char; - - /* see if we have any input waiting */ - pnp_index =0; - seen_start = 0; - done = 0; - end_char = 0; - starttime=time(NULL); - while (!done) { - timo.tv_sec=0; - timo.tv_usec=250000; - if (wait_for_input(fd, &timo) > 0) { - temp = read( fd, buf, 1 ); - if (temp < 0) { - if (errno != EAGAIN) - return PNP_COM_FATAL; - } else { - for (counter=0; counter < temp; counter++) { - pnp_string[pnp_index++] = buf[counter]; - if (seen_start) { - if (buf[counter] == end_char) { - done=1; - break; - } - } else { - if (buf[counter] == BeginPnP1) { - seen_start = 1; - end_char = EndPnP1; - } else if (buf[counter] == BeginPnP2) { - seen_start = 1; - end_char = EndPnP2; - } - } - } - } - } else - done = 1; - - /* shouldnt run more than 4 seconds */ - if (time(NULL)-starttime > 4 ) - done = 1; - - if (pnp_index >= pnp_stringbuf_size) - done = 1; - } - pnp_string[pnp_index] = 0; - *pnp_len=pnp_index; - return 0; -} - -/* UNUSED */ -/* simple little helper function */ -void xlate_memcpy( void *dest, void *src, int len, int xlate_flag ) { - unsigned char *d, *s; - int i; - - for (i=0,d=dest,s=src; i<len; i++, d++, s++) - *d = (*s) + ((xlate_flag) ? 0x20 : 0 ); -} - -/* parse the PnP ID string into components */ -int parse_pnp_string( unsigned char *pnp_id_string, int pnp_len, - struct pnp_com_id *pnp_id ) { - unsigned char *p1, *p2; - unsigned char *start; - unsigned char *end; - unsigned char *curpos; - unsigned char *endfield; - unsigned char *temppos; - unsigned char *pnp_string; - unsigned char end_char; - - int no_more_extensions=0; - int stage; - int len; - unsigned short int checksum; - char hex_checksum[5]; - - char extension_delims[] = {EndPnP1, EndPnP2, ExtendPnP1, ExtendPnP2, 0}; - char end_delims[] = {EndPnP1, EndPnP2, 0}; - - /* clear out pnp_id */ - memset(pnp_id, 0, sizeof(*pnp_id)); - - /* copy pnp_string to temp space */ - pnp_string = alloca(pnp_len+1); - memcpy(pnp_string, pnp_id_string, pnp_len+1); - - /* first find the start of the PnP part of string */ - p1 = memchr( pnp_string, BeginPnP1, pnp_len ); - p2 = memchr( pnp_string, BeginPnP2, pnp_len ); - - /* use the one which points nearest to start of the string */ - /* and is actually defined */ - if ( p1 && p2 ) { - start = (p1 < p2) ? p1 : p2; - } else if (p1) - start = p1; - else if (p2) - start = p2; - else - start = NULL; - - /* if no start then we're done */ - if (!start) - return -1; - - /* the length of the initial part cannot be more than 17 bytes */ - if ((start - pnp_string) > 17) - return -1; - - /* setup end character we are looking for based on the start character */ - if (start == p2) { - pnp_id->xlate_6bit = 1; - end_char = EndPnP2; - /* we need to xlate data in PnP fields */ - /* remember to skip the revision fields (bytes 1 and 2 after start) */ - temppos=start; - while (1) { - if (*temppos == EndPnP2) { - *temppos += 0x20; - break; - } else if (temppos != start+1 && temppos != start+2 ) - *temppos += 0x20; - - temppos++; - } - } else { - pnp_id->xlate_6bit = 0; - end_char = EndPnP1; - } - - /* move everything before the start of the PnP block */ - memcpy(pnp_id->other_id, pnp_string, start-pnp_string); - pnp_id->other_len = start - pnp_string; - - /* now we get the PnP fields - all were zero'd out above */ - curpos = start+1; - memcpy(pnp_id->pnp_rev,curpos,2); curpos += 2; - memcpy(pnp_id->eisa_id,curpos,3); curpos += 3; - memcpy(pnp_id->product_id,curpos,4); curpos += 4; - /* now we see if have extension fields */ - no_more_extensions = 0; - stage = 0; - while (!no_more_extensions) { - if (*curpos == ExtendPnP1 || *curpos == ExtendPnP2) { - curpos++; - endfield = strpbrk(curpos, extension_delims); - if (!endfield) - return -1; - /* if we reached the end of all PnP data, back off */ - /* cause there is a checksum at the end of extension data */ - if (*endfield == EndPnP1 || *endfield == EndPnP2) - endfield -= 2; - } else - break; - - len = endfield - curpos; - switch (stage) { - case 0: - if (len != 8 && len != 0 ) - return -1; - - memcpy(pnp_id->serial_number,curpos,len); - curpos += len; - break; - - case 1: - if (len > 33) - return -1; - memcpy(pnp_id->class_name, curpos, len); - curpos = endfield; - break; - - case 2: - if (len > 41) - return -1; - memcpy(pnp_id->driver_id, curpos, len); - curpos = endfield; - break; - - case 3: - if (len > 41) - return -1; - memcpy(pnp_id->user_name, curpos, len); - curpos = endfield; - break; - } - stage++; - } - - /* now find the end of all PnP data */ - end = strpbrk(curpos, end_delims); - if (!end) - return -1; - - /* if we had any extensions, we expect an checksum */ - if (stage != 0) { - /* copy checksum into struct */ - memcpy(pnp_id->checksum, curpos, 2); - - /* compute the checksum as the sum of all PnP bytes, excluding */ - /* the two byte checksum. */ - checksum = 0; - for (temppos=start; temppos <= end; temppos++) { - /* skip checksum in calculation */ - if (temppos == (end-2) || temppos == (end-1)) - continue; - /* dont xlate the revision at start */ - if (temppos != (start+1) && temppos != (start+2)) - checksum += *temppos - ((pnp_id->xlate_6bit) ? 0x20 : 0); - else - checksum += *temppos; - } - sprintf(hex_checksum, "%.2X", checksum & 0xff); - if (strncmp(hex_checksum, pnp_id->checksum, 2)) - return -1; - } - - /* checksum was ok, so we're done */ - return 0; -} - -/* UNUSED except for debugging */ -void print_pnp_id( struct pnp_com_id id ) { - int i; - int extensions_exist; - int revision_temp; - - if (id.other_len != 0) { - printf("Detected non-PnP data stream at start.\n"); - printf(" Length = 0x%x\n",id.other_len); - printf(" Contents ="); - for (i=0; i<id.other_len; i++) - printf(" 0x%x",id.other_id[i]); - printf("\n"); - } else - printf("Non-PnP data stream not detected at start.\n"); - - - /* parse PnP revision bytes into a string values (eg. "1.00") */ - revision_temp = ((id.pnp_rev[0]&0x3f) << 6)+(id.pnp_rev[1]&0x3f); - sprintf(id.pnp_rev_str, "%d.%d",revision_temp/100,revision_temp % 100); - - printf("\nPnP Required fields:\n"); - printf(" Revision = %s\n",id.pnp_rev_str); - printf(" Manufacturer = %s\n",id.eisa_id); - printf(" Product ID = %s\n",id.product_id); - - extensions_exist = id.serial_number[0] || id.class_name[0] || - id.driver_id[0] || id.user_name[0]; - - if (extensions_exist) { - printf("\nPnP extension field(s) exist:\n"); - if (id.serial_number[0]) - printf(" Serial Number = %s\n",id.serial_number); - if (id.class_name[0]) - printf(" PnP class name = %s\n",id.class_name); - if (id.driver_id[0]) - printf(" PnP Compatible = %s\n",id.driver_id); - if (id.user_name[0]) - printf(" PnP Description = %s\n",id.user_name); - } -} - -int attempt_pnp_retrieve(int fd, char *pnp_string, int *pnp_strlen, int pnp_stringbuf_size) { - int pnp_probe_status; - int tried_at_prodding; - int give_up; - struct pnp_com_id pnp_id; - - tried_at_prodding=0; - give_up=0; - - while (!give_up) { - pnp_probe_status = init_pnp_com_seq1(fd); - if (pnp_probe_status == PNP_COM_FATAL) { - return(PNP_COM_FATAL); - } else if (pnp_probe_status == PNP_COM_OK) { - read_pnp_string(fd, pnp_string, pnp_strlen, pnp_stringbuf_size ); - - if (debug_level > 0) { - printf("\nPNP string = |%s|\n\n",pnp_string); - print_hex_data(pnp_string, *pnp_strlen); - } - - if (*pnp_strlen == 1 && pnp_string[0] == 'M') /* legacy mouse */ - return PNP_COM_OK; - /* see if we got anything useful, if not try at command */ - /* to prod device into correct serial params */ - if (parse_pnp_string( pnp_string, *pnp_strlen, &pnp_id )<0) - if (!tried_at_prodding) { - write(fd, "AT\r", 3); - tried_at_prodding=1; - } else - give_up = 1; - else - return PNP_COM_OK; - } else - give_up = 1; - } - - /* try sending a ATI9 code to the modem to see if we get PnP id back */ - init_pnp_com_ati9(fd); - read_pnp_string(fd, pnp_string, pnp_strlen, pnp_stringbuf_size ); - if (parse_pnp_string( pnp_string, *pnp_strlen, &pnp_id )<0) { - *pnp_strlen = 0; - pnp_string[0] = 0; - return PNP_COM_FAIL; - } else - return PNP_COM_OK; -} - -struct device *serialProbe(enum deviceClass probeClass, int probeFlags, - struct device *devlist) { - int fd; - int temp; - int pnp_strlen; - int devicetype=-1; - unsigned char pnp_string[100]; - char port[20]; - struct termios origattr; - struct pnp_com_id pnp_id; - struct serialDevice *serdev; - struct stat sb; - int maj, twelve=12; - int console=-1; - int stdin_line=-1; - struct serial_struct si; - - if (probeFlags & PROBE_SAFE) return devlist; - - /* Are we on a serial console? */ - fstat(0,&sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl (0, TIOCLINUX, &twelve) < 0) { - if (ioctl (0, TIOCGSERIAL, &si) >= 0) { - if (si.line > 0) { - stdin_line = 1 << si.line; - } else { - stdin_line = 0; - } - } else stdin_line = 0; - } - } - - fd=open("/dev/console",O_RDWR); - if (fd != -1) { - fstat(fd,&sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl (fd, TIOCLINUX, &twelve) < 0) { - #ifdef __powerpc__ - // we could have gotten an error for another reason - like EINVAL - // skipping ttyS0 on PPC - which is where most modems reside - if (errno == ENOTTY) { - #endif - if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { - if (si.line > 0) { - console = 1 << si.line; - } else { - console = 0; - } - } else console = 0; - #ifdef __powerpc__ - } - #endif - } - } - close(fd); - } - - - if ( - (probeClass == CLASS_UNSPEC) || - (probeClass == CLASS_OTHER) || - (probeClass == CLASS_MOUSE) || - (probeClass == CLASS_MODEM) || - (probeClass == CLASS_PRINTER) - ) { - int x; - - for (x=0; x<=3 ; x++) { - struct stat sbuf; - char lockfile[32]; - if (x==console || x==stdin_line) continue; - snprintf(port,20,"/dev/ttyS%d",x); - - /* Make sure it's not in use */ - snprintf(lockfile,32,"/var/lock/LCK..ttyS%d",x); - if (!stat(lockfile,&sbuf)) - continue; - memset(lockfile,'\0',32); - if (readlink("/dev/modem",lockfile,32)>0) { - if (!strcmp(basename(port),basename(lockfile))) { - snprintf(lockfile,32,"/var/lock/LCK..modem"); - if (!stat(lockfile,&sbuf)) - continue; - } - } - - if ((fd=open_serial_port(port)) < 0) { - continue; - } - /* save the current state of the port */ - temp = tcgetattr(fd, &origattr); - if (temp < 0) { - close(fd); - continue; - } - - /* try twiddling RS232 control lines and see if it talks to us */ - devicetype=-1; - pnp_strlen = 0; - attempt_pnp_retrieve( fd, pnp_string, &pnp_strlen, sizeof(pnp_string) - 1 ); - - /* see if we found any PnP signature */ - if (pnp_strlen != 0) { - if (*pnp_string == 'M') { /* Legacy mouse */ - if (probeClass == CLASS_MOUSE || probeClass == CLASS_UNSPEC) { - serdev = serialNewDevice(NULL); - serdev->class=CLASS_MOUSE; - serdev->device=strdup(port+5); - serdev->desc=strdup("Generic Serial Mouse"); - serdev->driver=strdup("generic"); - if (devlist) - serdev->next = devlist; - devlist = (struct device *)serdev; - if (probeFlags & PROBE_ONE) { - tcsetattr(fd, TCSANOW, &origattr); - tcflush(fd, TCIOFLUSH); - close(fd); - return devlist; - } - } - tcsetattr(fd, TCSANOW, &origattr); - close(fd); - continue; - } - /* fill in the PnP com structure */ - if (parse_pnp_string( pnp_string, pnp_strlen, &pnp_id )<0) { - goto endprobe; - } else { - char *foo; - int len; - - if (debug_level > 0) { - printf("PnP ID string for serial device on port %s\n",port); - print_pnp_id( pnp_id ); - } - serdev = serialNewDevice(NULL); - if (pnp_id.user_name[0]) { - serdev->pnpdesc = strdup(pnp_id.user_name); - len = strlen(pnp_id.eisa_id)+strlen(pnp_id.product_id)+strlen(pnp_id.user_name)+3; - foo = malloc(len); - snprintf(foo,len,"%s|%s %s",pnp_id.eisa_id,pnp_id.product_id,pnp_id.user_name); - } else { - len = strlen(pnp_id.eisa_id)+strlen(pnp_id.product_id)+3; - foo = malloc(len); - snprintf(foo,len,"%s|%s",pnp_id.eisa_id,pnp_id.product_id); - } - serdev->desc=strdup(foo); - serdev->device=strdup(port+5); - serdev->driver=strdup("ignore"); - serdev->pnpmfr = strdup(pnp_id.eisa_id); - serdev->pnpmodel = strdup(pnp_id.product_id); - - free(foo); - foo=pnp_id.product_id; - if (pnp_id.driver_id) { - if (strstr(pnp_id.driver_id,"PNP")) - foo = strstr(pnp_id.driver_id,"PNP")+3; - serdev->pnpcompat = strdup(pnp_id.driver_id); - } - if (!strncmp(foo, "0F", 2)) - serdev->class = CLASS_MOUSE; - else if (!strncmp(foo, "C", 1)) - serdev->class = CLASS_MODEM; - else if (!strncmp(pnp_id.class_name, "Modem", 5)) - serdev->class = CLASS_MODEM; - else - serdev->class = CLASS_OTHER; - if (serdev->class == probeClass || probeClass == CLASS_UNSPEC) { - if (devlist) - serdev->next = devlist; - devlist = (struct device *)serdev; - if (probeFlags & PROBE_ONE) { - tcsetattr(fd, TCSANOW, &origattr); - tcflush(fd, TCIOFLUSH); - close(fd); - return devlist; - } - } else { - serdev->freeDevice(serdev); - } - goto endprobe; - } - } else { - /* try to find a legacy device */ - - temp = find_legacy_mouse(fd); - if (temp == PNP_COM_FATAL) { - goto endprobe; - } else if (temp == PNP_COM_OK) { - if (probeClass == CLASS_UNSPEC || probeClass == CLASS_MOUSE) { - serdev=serialNewDevice(NULL); - serdev->class = CLASS_MOUSE; - serdev->device = strdup(port+5); - serdev->driver= strdup("generic"); - serdev->desc = strdup("Generic Serial Mouse"); - if (devlist) - serdev->next = devlist; - devlist = (struct device *)serdev; - if (probeFlags & PROBE_ONE) { - tcsetattr(fd, TCSANOW, &origattr); - tcflush(fd, TCIOFLUSH); - close(fd); - return devlist; - } - } - goto endprobe; - } else { - if (debug_level > 0) - printf("Didnt see a legacy mouse, need to ATI it now.\n"); - - temp = find_legacy_modem(fd); - if (temp == PNP_COM_FATAL) { - goto endprobe; - } else if (temp == PNP_COM_OK) { - if (debug_level > 0) - printf("\nLegacy modem signature seen.\n\n"); - if (probeClass == CLASS_UNSPEC || probeClass == CLASS_MODEM) { - serdev=serialNewDevice(NULL); - serdev->class = CLASS_MODEM; - serdev->device = strdup(port+5); - serdev->driver= strdup("ignore"); - serdev->desc = strdup("Generic Serial Modem"); - if (devlist) - serdev->next = devlist; - devlist = (struct device *)serdev; - if (probeFlags & PROBE_ONE) { - tcsetattr(fd, TCSANOW, &origattr); - tcflush(fd, TCIOFLUSH); - close(fd); - return devlist; - } - } - goto endprobe; - } else { - if (debug_level > 0) - printf("Didnt see a legacy modem, game over.\n"); - } - } - } -endprobe: - tcsetattr(fd, TCSANOW, &origattr); - tcflush(fd, TCIOFLUSH); - close(fd); - } - } - return devlist; -} diff --git a/tools/serial_probe/serial.h b/tools/serial_probe/serial.h deleted file mode 100644 index 75d178ce9..000000000 --- a/tools/serial_probe/serial.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 1999 Red Hat, Inc. - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef _KUDZU_SERIAL_H_ -#define _KUDZU_SERIAL_H_ - -#include "device.h" - -struct serialDevice { - /* common fields */ - struct device *next; /* next device in list */ - int index; - enum deviceClass class; /* type */ - enum deviceBus bus; /* bus it's attached to */ - char * device; /* device file associated with it */ - char * driver; /* driver to load, if any */ - char * desc; /* a description */ - int detached; - /* serial-specific fields */ - struct serialDevice *(*newDevice) (struct serialDevice *dev); - void (*freeDevice) (struct serialDevice *dev); - void (*writeDevice) (FILE *file, struct serialDevice *dev); - int (*compareDevice) (struct serialDevice *dev1, struct serialDevice *dev2); - char * pnpmfr; - char * pnpmodel; - char * pnpcompat; - char * pnpdesc; - -}; - -struct serialDevice *serialNewDevice(struct serialDevice *dev); -struct device *serialProbe(enum deviceClass probeClass, int probeFlags, - struct device *devlist); - -#endif diff --git a/tools/serial_probe/serial_probe.c b/tools/serial_probe/serial_probe.c deleted file mode 100644 index b8abb6917..000000000 --- a/tools/serial_probe/serial_probe.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright 1999 MandrakeSoft <fpons@mandrakesoft.com> - * - * The following file used by this one are copyrighted by RedHat and - * are taken from kudzu : - * device.h - * serial.h - * serial.c - * This file is taken from kudzu.c copyrighted by RedHat, 1999. - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#include "serial.h" -#include "device.h" - -typedef struct device *(newFunc)(struct device *); -typedef int (initFunc)(); -typedef struct device *(probeFunc)(enum deviceClass, int, struct device *); - -char *classStrings[] = { - "UNSPEC", "OTHER", "NETWORK", "SCSI", "VIDEO", "AUDIO", - "MOUSE", "MODEM", "CDROM", "TAPE", "FLOPPY", "SCANNER", - "HD", "RAID", "PRINTER", "CAPTURE", "KEYBOARD", NULL -}; - -struct device *newDevice(struct device *old, struct device *new) { - if (!old) { - if (!new) { - new = malloc(sizeof(struct device)); - memset(new,'\0',sizeof(struct device)); - } - new->class = CLASS_UNSPEC; - } else { - new->class = old->class; - if (old->device) new->device = strdup(old->device); - if (old->driver) new->driver = strdup(old->driver); - if (old->desc) new->desc = strdup(old->desc); - } - new->newDevice = newDevice; - new->freeDevice = freeDevice; - new->compareDevice = compareDevice; - return new; -} - -void freeDevice(struct device *dev) { - if (!dev) { - printf("freeDevice(null)\n"); - abort(); /* return; */ - } - if (dev->device) free (dev->device); - if (dev->driver) free (dev->driver); - if (dev->desc) free (dev->desc); - free (dev); -} - -void writeDevice(FILE *file, struct device *dev) {} -int compareDevice(struct device *dev1, struct device *dev2) { return 0; } - -int main () { - struct device* devices = NULL; - struct serialDevice* serialDevice = NULL; - - devices = serialProbe(CLASS_UNSPEC, 0, devices); - while (devices) { - serialDevice = (struct serialDevice*)devices; - - printf("CLASS=%s\n", classStrings[serialDevice->class]); - printf("BUS=SERIAL\n"); - printf("DEVICE=/dev/%s\n", serialDevice->device); - printf("DRIVER=%s\n", serialDevice->driver); - if (!serialDevice->pnpdesc) printf("DESCRIPTION=%s\n", serialDevice->desc); - if (serialDevice->pnpmfr) printf("MANUFACTURER=%s\n", serialDevice->pnpmfr); - if (serialDevice->pnpmodel) printf("MODEL=%s\n", serialDevice->pnpmodel); - if (serialDevice->pnpcompat) printf("COMPAT=%s\n", serialDevice->pnpcompat); - if (serialDevice->pnpdesc) printf("DESCRIPTION=%s\n", serialDevice->pnpdesc); - printf("\n"); - - devices=devices->next; - } - - return 0; -} diff --git a/tools/sparc/e2fsck.shared b/tools/sparc/e2fsck.shared Binary files differdeleted file mode 100755 index b423986e5..000000000 --- a/tools/sparc/e2fsck.shared +++ /dev/null diff --git a/tools/specific_arch b/tools/specific_arch deleted file mode 100755 index 57da2d259..000000000 --- a/tools/specific_arch +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl - -%compat_arch = ( - 'noarch' => '', - 'i386' => 'noarch', - 'i486' => 'i386', - 'i586' => 'i486', - 'i686' => 'i586', - 'i786' => 'i686', - 'k6' => 'i586', - 'k7' => 'k6', - 'k8' => 'k7', - 'alpha' => 'noarch', - 'sparc' => 'noarch', - 'sparc32' => 'sparc', - 'sparc64' => 'sparc32', - 'ia64' => 'noarch', - ); - -$arch = `uname -m` || 'unknownarch'; -$arch =~ s/\s//g; - -print join ' ', map { - my $arch = $arch; - $arch = $compat_arch{$arch} while $arch && !-e "$_.$arch"; - -e "$_.$arch" ? "$_.$arch" : $_; - } @ARGV; -print "\n"; diff --git a/tools/syncrpms b/tools/syncrpms deleted file mode 100755 index 946032e52..000000000 --- a/tools/syncrpms +++ /dev/null @@ -1,263 +0,0 @@ -#!/usr/bin/perl - -#- Synchronize mulitple RPMS/SRPMS directories. -#- Copyright (C) 1999 MandrakeSoft (fpons@mandrakesoft.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 strict qw(subs vars refs); - -#- compare a version string. -use rpmtools; - -#- get basename for a file. -sub basename { $_[0] =~ /([^\/]*)$/ ? $1 : $_[0]; } - -#- system functions. -sub cp { - my $pid; - if ($pid = fork()) { - waitpid($pid, 0); - } else { - exec '/bin/cp', @_; - } -} -sub mv { - my $pid; - if ($pid = fork()) { - waitpid($pid, 0); - } else { - exec '/bin/mv', @_; - } -} -sub rm { - my $pid; - if ($pid = fork()) { - waitpid($pid, 0); - } else { - exec '/bin/rm', '-f', @_; - } -} - -#- get a hash on name of srpms/rpms in a directory. -sub get_rpms { - my ($dir, $rpms, $flag, $modifiable) = @_; - - opendir D, $dir or die "cannot open directory $dir\n"; - map { - if (/([^\/]*?)-([^-]*)-([^-]*)\.([^-\.]*)\.rpm$/) { - my $key = "$1 $4"; #- get name including architecture. - if ($rpms->{$key}) { - if (rpmtools::version_compare($2, $rpms->{$key}{version}) > 0 || - rpmtools::version_compare($2, $rpms->{$key}{version}) == 0 && rpmtools::version_compare($3, $rpms->{$key}{release}) > 0) { - if ($modifiable) { - if ($flag->{sorted}) { - print "you said rpms directory are sorted, so I keep obseleted $rpms->{$key}{file} by $_ in $rpms->{$key}{dir}\n" if $flag->{verbose}; - } else { - if (-d $flag->{conflict}) { - print "moving obseleted $rpms->{$key}{file} by $_ in $rpms->{$key}{dir}\n" if $flag->{verbose}; - mv("$rpms->{$key}{dir}/$rpms->{$key}{file}", $flag->{conflict}); - } elsif ($flag->{clean}) { - print "removing obseleted $rpms->{$key}{file} by $_ in $rpms->{$key}{dir}\n" if $flag->{verbose}; - rm("$rpms->{$key}{dir}/$rpms->{$key}{file}"); - } - } - } - $rpms->{$key} = { key => $key, - name => $1, - version => $2, - release => $3, - arch => $4, - dir => $dir, - file => $_, - }; - } else { - if ($modifiable) { - if (-d $flag->{conflict}) { - print "copying older or equal $_ by $rpms->{$key}{file} in $flag->{conflict}\n" if $flag->{verbose}; - cp("$dir/$_", $flag->{conflict}); - chmod 0644, "$flag->{conflict}/$_"; - } elsif ($flag->{clean}) { - print "removing older or equal $_ by $rpms->{$key}{file} in $dir\n" if $flag->{verbose}; - rm("$dir/$_"); - } - } - } - } else { - $rpms->{$key} = { key => $key, - name => $1, - version => $2, - release => $3, - arch => $4, - dir => $dir, - file => $_, - }; - } - } else { - print STDERR "unable to parse filename $_\n"; - } - } grep { /\.rpm$/ } readdir D; - closedir D; -} - -#- sync packages list according to hashes of rpms. -sub sync_medium { - my ($rpmsdirs, $list, $rpms, $flag) = @_; - my %pkg2dir; - - #- build a hash according to rpmsdirs and list for package name. - my $i = 0; - foreach (@$list) { - local *F; - open F, $_ or die "unable to open packages list file \"$_\"\n"; - foreach (<F>) { - chomp; - print STDERR "package \"$_\" is listed in mulitple list files!\n" if $pkg2dir{$_}; - $pkg2dir{$_} = $rpmsdirs->[$i]; - print "package \"$_\" listed in list files does not exists in rpms directory\n" if $flag->{verbose} && !$rpms->{$_}; - } - close F; - - ++$i; - } - - #- check for right directory, and move if necessary. - foreach (values %$rpms) { - unless ($pkg2dir{$_->{key}}) { - print "file $_->{file} in $_->{dir} define package \"$_->{name}\" not listed in list files\n" if $flag->{verbose}; - } elsif ($_->{dir} ne $pkg2dir{$_->{key}}) { - print "moving file $_->{file} in $_->{dir} to $pkg2dir{$_->{key}}\n" if $flag->{verbose}; - mv("$_->{dir}/$_->{file}", $pkg2dir{$_->{key}}); - $_->{dir} = $pkg2dir{$_->{key}}; - } - } -} - -#- sync two hashes of rpms, update rpms and printer newer version that are not taken into account. -sub sync_rpms { - my ($source, $target, $flag) = @_; - - #- search in source part. - foreach (keys %$source) { - unless ($target->{$_}) { - if ($flag->{verbose}) { - print "adding $source->{$_}{file}" . (-d $flag->{add} ? " to $flag->{add}\n" : " is neccessary!\n"); - } - if (-d $flag->{add}) { - cp("$source->{$_}{dir}/$source->{$_}{file}", $flag->{add}); - chmod 0644, "$flag->{add}/$source->{$_}{file}"; - } - } - } - - #- search in both part. - foreach (keys %$source) { - if ($target->{$_}) { - if (rpmtools::version_compare($source->{$_}{version}, $target->{$_}{version}) > 0 || - rpmtools::version_compare($source->{$_}{version}, $target->{$_}{version}) == 0 && - (rpmtools::version_compare($source->{$_}{release}, $target->{$_}{release}) > 0 || - rpmtools::version_compare($source->{$_}{release}, $target->{$_}{release}) == 0 && - -s "$source->{$_}{dir}/$source->{$_}{file}" != -s "$target->{$_}{dir}/$target->{$_}{file}")) { - if ($flag->{verbose}) { - print "updating $target->{$_}{dir}/$target->{$_}{file} with newer version $source->{$_}{file}\n"; - } - if ($flag->{update}) { - cp("$source->{$_}{dir}/$source->{$_}{file}", $target->{$_}{dir}); - chmod 0644, "$target->{$_}{dir}/$source->{$_}{file}"; - unless (-e "$target->{$_}{dir}/$source->{$_}{file}") { - die "unable to copy $source->{$_}{file} from $source->{$_}{dir} into $target->{$_}{dir}\n"; - } - rm("$target->{$_}{dir}/$target->{$_}{file}") unless $source->{$_}{file} eq $target->{$_}{file}; #- copy on eq - } - } elsif (rpmtools::version_compare($source->{$_}{version}, $target->{$_}{version}) != 0 || - rpmtools::version_compare($source->{$_}{release}, $target->{$_}{release}) != 0) { - if ($flag->{verbose}) { - print STDERR "keeping more up-to-date version $target->{$_}{dir}/$target->{$_}{file} against $source->{$_}{dir}/$source->{$_}{file}, check your repository !\n"; - } - } #- say nothing if source is equal to target. - } - } - - #- search in target part. - foreach (keys %$target) { - unless ($source->{$_}) { - if ($flag->{verbose}) { - print "removing $target->{$_}{file}" . ($flag->{remove} ? " from $target->{$_}{dir}\n" : " is neccessary!\n"); - my $k = $_; - } - if ($flag->{remove}) { - rm("$target->{$_}{dir}/$target->{$_}{file}"); - } - } - } -} - -#- main program. -sub main { - my @from_rpms; - my @to_rpms; - my @list; - my $target; - my %flag; - my %source; - my %target; - - foreach (@_) { - if (/^--(\w*)$/) { - if ($1 eq 'verbose' || $1 eq 'update' || $1 eq 'remove' || $1 eq 'clean' || $1 eq 'sorted') { - $flag{$1} = 1; - } elsif ($1 eq 'add' || $1 eq 'conflict') { - $flag{$1} = undef; - } elsif ($1 eq 'from') { - $target = \@from_rpms; - } elsif ($1 eq 'to') { - $target = \@to_rpms; - } elsif ($1 eq 'list') { - $target = \@list; - } else { - die "unknown option: $1\n"; - } - } else { - if (exists $flag{add} && ! $flag{add}) { - $flag{add} = $_; - die "cannot add to non-directory: $_\n" unless -d $flag{add}; - } elsif (exists $flag{conflict} && ! $flag{conflict}) { - $flag{conflict} = $_; - die "cannot add to non-directory: $_\n" unless -d $flag{conflict}; - } else { - die "unknown parameter: $_\n" unless $target; - push @$target, $_; - } - } - } - - die "usage: syncrpms [--update] [--remove] [--clean] [--sorted] [--add <dir>] [--conflict <dir>] --from <dir_sources> --to <dir_targets> [--list <files>]\n" - unless scalar(@from_rpms) > 0 || scalar(@to_rpms) > 0; - - #- parse directory structures. - get_rpms($_, \%source, \%flag, 0) foreach @from_rpms; - print STDERR "reading " . scalar(keys %source) . " packages as source rpms from\n"; - print STDERR " $_\n" foreach @from_rpms; - - get_rpms($_, \%target, \%flag, 1) foreach @to_rpms; - print STDERR "reading " . scalar(keys %target) . " packages as target rpms from\n"; - print STDERR " $_\n" foreach @to_rpms; - - sync_medium(\@to_rpms, \@list, \%target, \%flag) if scalar(@list) > 0 && scalar(@to_rpms) > 0; - sync_rpms(\%source, \%target, \%flag) if scalar(@from_rpms) > 0 && scalar(@to_rpms) > 0; -} - -main(@ARGV); diff --git a/tools/xhost+.c b/tools/xhost+.c deleted file mode 100644 index 58781274e..000000000 --- a/tools/xhost+.c +++ /dev/null @@ -1,11 +0,0 @@ -#include <stdlib.h> -#include <X11/Xlib.h> - - -int main(int argc, char **argv) { - Display *d = XOpenDisplay(getenv("DISPLAY") ? getenv("DISPLAY") : ":0"); - if (d == NULL) exit(1); - XDisableAccessControl(d); - XCloseDisplay(d); - exit(0); -} |