[PATCH 2/2] Remove things from utils/ that lorax obsoletes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 utils/Makefile.am      |   11 +--
 utils/genmodinfo       |   76 -------------
 utils/mk-s390-cdboot.c |  284 ------------------------------------------------
 utils/modlist.c        |  146 -------------------------
 utils/trimpciids       |   80 --------------
 5 files changed, 1 insertions(+), 596 deletions(-)
 delete mode 100755 utils/genmodinfo
 delete mode 100644 utils/mk-s390-cdboot.c
 delete mode 100644 utils/modlist.c
 delete mode 100755 utils/trimpciids

diff --git a/utils/Makefile.am b/utils/Makefile.am
index 5d4323d..d654a51 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -22,16 +22,7 @@ SUBDIRS = log_picker
 utilsdir            = $(libexecdir)/$(PACKAGE_NAME)
 
 dist_sbin_SCRIPTS    = logpicker
-utils_PROGRAMS      = modlist mapshdr readmap
-dist_utils_SCRIPTS  = genmodinfo trimpciids
+utils_PROGRAMS      = mapshdr readmap
 noinst_PROGRAMS     = snarffont
 
-if IS_S390
-utils_PROGRAMS      += addrsize mk-s390-cdboot
-endif
-
-modlist_CFLAGS      = -I$(top_srcdir)/loader $(GLIB_CFLAGS)
-modlist_LDADD       = $(GLIB_LIBS)
-modlist_SOURCES     = modlist.c $(top_srcdir)/loader/moduleinfo.c
-
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/utils/genmodinfo b/utils/genmodinfo
deleted file mode 100755
index 44c8247..0000000
--- a/utils/genmodinfo
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/python
-#
-# genmodinfo
-#
-# Copyright (C) 2007  Red Hat, Inc.  All rights reserved.
-#
-# 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 of the License, 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, see <http://www.gnu.org/licenses/>.
-#
-
-import commands
-import os
-import string
-import sys
-
-uname = os.uname()[2]
-
-if len(sys.argv) > 1:
-    path = sys.argv[1]
-else:
-    path = '/lib/modules/%s' % (uname,)
-    
-mods = {}
-for root, dirs, files in os.walk(path):
-    for file in files:
-        mods[file] = os.path.join(root,file)
-
-modules = { 'scsi_hostadapter' : [ 'block' ], 'eth' : [ 'networking'] }
-blacklist = ("floppy", "scsi_mod", "libiscsi")
-
-list = {}
-
-for modtype in modules.keys():
-    list[modtype] = {}
-    for file in modules[modtype]:
-        try:
-            f = open('%s/modules.%s' % (path,file),'r')
-        except:
-            continue
-        lines = f.readlines()
-        f.close()
-        for line in lines:
-            line = line.strip()
-            if mods.has_key(line):
-                desc = commands.getoutput("modinfo -F description %s" % (mods[line])).split("\n")[0]
-                desc = desc.strip()
-                modname = line[:-3]
-                if modname in blacklist:
-                    continue
-                if desc and len(desc) > 65:
-                    desc = desc[:65]
-                if not desc:
-                    desc = "%s driver" % (modname,)
-                modinfo = """
-%s
-        %s
-        "%s"
-""" % (modname, modtype, desc)
-                list[modtype][modname] = modinfo
-
-print "Version 0"
-for type in list.keys():
-    modlist = list[type].keys()
-    modlist.sort()
-    for m in modlist:
-        print list[type][m]
diff --git a/utils/mk-s390-cdboot.c b/utils/mk-s390-cdboot.c
deleted file mode 100644
index 4a58258..0000000
--- a/utils/mk-s390-cdboot.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * mk-s390-cdboot -- creates one big image using a kernel, a ramdisk and
- *                   a parmfile
- *
- * 2003-07-24 Volker Sameske <sameske@xxxxxxxxxx>
- * 2008-09-22 Updated by David Cantrell <dcantrell@xxxxxxxxxx>
- *
- * compile with:
- *     gcc -Wall -o mk-s390-cdboot mk-s390-cdboot.c
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <string.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <libgen.h>
-
-#define BUFFER_LEN 1024
-#define INITRD_START 0x0000000000800000LL
-#define START_PSW_ADDRESS 0x80010000
-
-static struct option getopt_long_options[]= {
-    { "image", 1, 0, 'i'},
-    { "ramdisk", 1, 0, 'r'},
-    { "parmfile", 1, 0, 'p'},
-    { "outfile", 1, 0, 'o'},
-    { "help", 0, 0, 'h'},
-    {0, 0, 0, 0}
-};
-
-static void usage(char *cmd) {
-    printf("%s [-h] [-v] -i <kernel> -r <ramdisk> -p <parmfile> -o <outfile>\n", cmd);
-}
-
-int main (int argc, char **argv) {
-    char *cmd = basename(argv[0]);
-    FILE *fd1 = NULL;
-    FILE *fd2 = NULL;
-    FILE *fd3 = NULL;
-    FILE *fd4 = NULL;
-    char buffer[BUFFER_LEN];
-    int wc, rc, oc, index;
-    unsigned long long initrd_start = INITRD_START;
-    unsigned long long initrd_size;
-    char *image = NULL;
-    char *ramdisk = NULL;
-    char *parmfile = NULL;
-    char *outfile = NULL;
-    int image_specified = 0;
-    int ramdisk_specified = 0;
-    int parmfile_specified = 0;
-    int outfile_specified = 0;
-    int start_psw_address = START_PSW_ADDRESS;
-
-    opterr = 0;
-    while (1) {
-        oc = getopt_long(argc, argv, "i:r:p:o:h?", getopt_long_options, &index);
-        if (oc == -1) {
-            break;
-        }
-
-        switch (oc) {
-            case '?':
-            case 'h':
-                usage(cmd);
-                exit(0);
-            case 'i':
-                image = strdup(optarg);
-                image_specified = 1;
-                break;
-            case 'r':
-                ramdisk = strdup(optarg);
-                ramdisk_specified = 1;
-                break;
-            case 'p':
-                parmfile = strdup(optarg);
-                parmfile_specified = 1;
-                break;
-            case 'o':
-                outfile = strdup(optarg);
-                outfile_specified = 1;
-                break;
-            default:
-                usage(cmd);
-                exit(0);
-        }
-    }
-
-    if (!image_specified || !ramdisk_specified ||
-        !parmfile_specified || !outfile_specified) {
-        usage(cmd);
-        exit(0);
-    }
-
-    printf("Creating bootable CD-ROM image...\n");
-    printf("kernel is  : %s\n", image);
-    printf("ramdisk is : %s\n", ramdisk);
-    printf("parmfile is: %s\n", parmfile);
-    printf("outfile is : %s\n", outfile);
-
-    if ((fd1 = fopen(outfile, "w")) == NULL) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if ((fd2 = fopen(image, "r")) == NULL) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if ((fd3 = fopen(ramdisk, "r")) == NULL) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if ((fd4 = fopen(parmfile, "r")) == NULL) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    printf("writing kernel...\n");
-    while (1) {
-        rc = fread(buffer, 1, 1, fd2);
-
-        if (rc == 0) {
-            break;
-        }
-
-        if (feof(fd2) || ferror(fd2)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        wc = fwrite(buffer, 1, 1, fd1);
-        if (feof(fd1) || ferror(fd1)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        if (wc != rc) {
-          fprintf(stderr, "could only write %i of %i bytes of kernel\n",
-                  wc, rc);
-        }
-    }
-
-    printf("writing initrd...\n");
-    fseek(fd1, initrd_start, SEEK_SET);
-    while (1) {
-        rc = fread(buffer, 1, 1, fd3);
-
-        if (rc == 0) {
-            break;
-        }
-
-        if (feof(fd3) || ferror(fd3)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        wc = fwrite(buffer, 1, 1, fd1);
-        if (feof(fd1) || ferror(fd1)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        if (wc != rc) {
-          fprintf(stderr, "could only write %i of %i bytes of initrd\n",
-                  wc, rc);
-        }
-    }
-
-    if (fseek(fd3, 0, SEEK_END) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if ((initrd_size = ftell(fd3)) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    printf("changing start PSW address to 0x%08x...\n", start_psw_address);
-    if (fseek(fd1, 0x4, SEEK_SET) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    wc = fwrite(&start_psw_address, 1, 4, fd1);
-    if (feof(fd1) || ferror(fd1)) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if (wc != 4) {
-        fprintf(stderr, "could only write %i of %i bytes of PSW address\n",
-                wc, 4);
-    }
-
-    printf("writing initrd address and size...\n");
-    printf("INITRD start: 0x%016llx\n",  initrd_start);
-    printf("INITRD size : 0x%016llx\n", initrd_size);
-
-    if (fseek(fd1, 0x10408, SEEK_SET) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    wc = fwrite(&initrd_start, 1, 8, fd1);
-    if (feof(fd1) || ferror(fd1)) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if (wc != 8) {
-        fprintf(stderr, "could only write %i of %i bytes of INITRD start\n",
-                wc, 8);
-    }
-
-    if (fseek(fd1, 0x10410, SEEK_SET) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    wc = fwrite(&initrd_size, 1, 8, fd1);
-    if (feof(fd1) || ferror(fd1)) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    if (wc != 8) {
-        fprintf(stderr, "could only write %i of %i bytes of INITRD size\n",
-                wc, 8);
-    }
-
-    printf("writing parmfile...\n");
-    if (fseek(fd1, 0x10480, SEEK_SET) == -1) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-        abort();
-    }
-
-    while (1) {
-        rc = fread(buffer, 1, 1, fd4);
-
-        if (rc == 0) {
-            break;
-        }
-
-        if (feof(fd4) || ferror(fd4)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        wc = fwrite(buffer, 1, 1, fd1);
-        if (feof(fd1) || ferror(fd1)) {
-            fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-            abort();
-        }
-
-        if (wc != 1) {
-            fprintf(stderr, "could only write %i of %i bytes of parmfile\n",
-                    wc, 1);
-        }
-    }
-
-    if (fclose(fd1) == EOF) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-    }
-
-    if (fclose(fd2) == EOF) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-    }
-
-    if (fclose(fd3) == EOF) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-    }
-
-    if (fclose(fd4) == EOF) {
-        fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
-    }
-
-    return EXIT_SUCCESS;
-}
diff --git a/utils/modlist.c b/utils/modlist.c
deleted file mode 100644
index 2107ffd..0000000
--- a/utils/modlist.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * modlist.c
- *
- * Copyright (C) 2007  Red Hat, Inc.  All rights reserved.
- *
- * 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 of the License, 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-
-#include "../pyanaconda/isys/isys.h"
-#include "moduleinfo.h"
-
-int main(int argc, char ** argv) {
-    GOptionContext *optCon = g_option_context_new(NULL);
-    GError *optErr = NULL;
-    gchar *modInfoFile = "/boot/module-info";
-    gboolean ignoreMissing = FALSE, showModInfo = FALSE;
-    gchar **remaining = NULL;
-    enum driverMajor major;
-    const char * type;
-    const char * mod;
-    struct moduleInfo * list, * m;
-    int i, arg = 0;
-    moduleInfoSet mis;
-    struct moduleInfo * mi;
-    GOptionEntry optionTable[] = {
-        { "ignore-missing", 'I', 0, G_OPTION_ARG_NONE, &ignoreMissing,
-          "Ignore modules not in modinfo file for --modinfo", NULL },
-        { "modinfo", 'm', 0, G_OPTION_ARG_NONE, &showModInfo,
-          "Give output in module-info file for listed args", NULL },
-        { "modinfo-file", 'f', 0, G_OPTION_ARG_STRING, &modInfoFile,
-          "Module info file to use", NULL },
-        { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining,
-          NULL, NULL },
-        { NULL },
-    };
-
-    g_option_context_add_main_entries(optCon, optionTable, NULL);
-
-    if (!g_option_context_parse(optCon, &argc, &argv, &optErr)) {
-       fprintf(stderr, "bad option: %s\n", optErr->message);
-       g_error_free(optErr);
-       g_option_context_free(optCon);
-       g_strfreev(remaining);
-       exit(1);
-    }
-
-    g_option_context_free(optCon);
-
-    if (remaining == NULL) {
-        exit(1);
-    }
-
-    mis = newModuleInfoSet();
-    if (readModuleInfo(modInfoFile, mis, NULL, 0)) {
-        fprintf(stderr, "Failed to read %s\n", modInfoFile);
-	exit(1);
-    }
-
-    if (showModInfo) {
-        printf("Version 0\n");
-	while ((mod = remaining[arg]) != NULL) {
-	    mi = findModuleInfo(mis, mod);
-	    if (mi) {
-	    	printf("%s\n", mi->moduleName);
-		switch (mi->major) {
-		  case DRIVER_CDROM: printf("\tcdrom\n"); break;
-		  case DRIVER_SCSI: printf("\tscsi\n"); break;
-		  case DRIVER_FS: printf("\tfs\n"); break;
-                  case DRIVER_PCMCIA: printf("\tpcmcia\n"); break;
-                  case DRIVER_IDE: printf("\tide\n"); break;
-                  case DRIVER_OTHER: printf("\tother\n"); break;
-		  case DRIVER_NET: 
-		    switch (mi->minor) {
-		      case DRIVER_MINOR_ETHERNET: printf("\teth\n"); break;
-		      case DRIVER_MINOR_TR: printf("\ttr\n"); break;
-
-		      default:
-		      	fprintf(stderr, "unknown net minor type for %s\n",
-				mi->moduleName);
-			g_strfreev(remaining);
-			exit(1);
-		    }
-		    break;
-
-		  default:
-		    fprintf(stderr, "unknown device type for %s (%d)\n",
-			    mi->moduleName, mi->major);
-		    g_strfreev(remaining);
-		    exit(1);
-
-		}
-	    	printf("\t\"%s\"\n", mi->description);
-	    	for (i = 0; i < mi->numArgs; i++) {
-		    printf("\t%s \"%s\"\n", mi->args[i].arg,
-		    	   mi->args[i].description);
-		}
-	    } else if (!ignoreMissing) {
-	    	fprintf(stderr, "I know nothing about %s\n", mod);
-		g_strfreev(remaining);
-		exit(1);
-	    }
-	    arg++;
-	}
-    } else {
-	while ((type = remaining[arg]) != NULL) {
-	    if (!strcasecmp(type, "scsi")) {
-		major = DRIVER_SCSI;
-	    } else if (!strcasecmp(type, "net")) {
-		major = DRIVER_NET;
-	    } else if (!strcasecmp(type, "fs")) {
-		major = DRIVER_FS;
-	    } else if (!strcasecmp(type, "cdrom")) {
-		major = DRIVER_CDROM;
-	    } else {
-		fprintf(stderr, "type must be one of scsi, net, fs, cdrom\n");
-		g_strfreev(remaining);
-		exit(1);
-	    }
-
-	    list = getModuleList(mis, major);
-	    for (m = list; m && m->moduleName; m++)
-		printf("%s\n", m->moduleName);
-	    free(list);
-	    arg++;
-	}
-    }
-
-    g_strfreev(remaining);
-    return 0;
-}
diff --git a/utils/trimpciids b/utils/trimpciids
deleted file mode 100755
index ba94629..0000000
--- a/utils/trimpciids
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-#
-# trimpciids
-#
-# Copyright (C) 2007  Red Hat, Inc.  All rights reserved.
-#
-# 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 of the License, 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, see <http://www.gnu.org/licenses/>.
-#
-
-import sys
-import os
-import string
-
-vendors = []
-devices = []
-
-f = open(sys.argv[1])
-if f:
-	pcitable = f.readlines()
-	f.close()
-	for line in pcitable:
-	    if not line.startswith("alias pci:"):
-		continue
-	    vend = "0x%s" % (line[15:19],)
-	    dev = "0x%s" % (line[24:28],)
-	    vend = vend.upper()
-	    dev = dev.upper()
-	    if vend not in vendors:
-		vendors.append(vend)
-	    if (vend, dev) not in devices:
-		devices.append( (vend, dev) )
-
-for file in sys.argv[2:]:
-   if not os.path.exists(file):
-       sys.stderr.write("WARNING: non-existent file %s for trimpciids\n" %(file,))
-       continue
-   f = open(file)
-   if f:
-	pcitable = f.readlines()
-	f.close()
-	for line in pcitable:
-	    if not line.startswith("alias pcivideo:"):
-		continue
-	    vend = "0x%s" % (line[20:24],)
-	    dev = "0x%s" % (line[29:33],)
-	    vend = vend.upper()
-	    dev = dev.upper()
-	    if vend not in vendors:
-		vendors.append(vend)
-	    if (vend, dev) not in devices:
-		devices.append( (vend, dev) )
-
-pciids = sys.stdin.readlines()
-current_vend = 0
-for line in pciids:
-    if line.startswith("#") or line == "\n":
-	continue
-    if line.startswith("\t\t"):
-	continue
-    if not line.startswith("\t"):
-	current_vend = "0x%s" % line.split()[0]
-	current_vend = current_vend.upper()
-	if current_vend in vendors:
-	    print line,
-	continue
-    dev = "0x%s" % line.split()[0]
-    dev = dev.upper()
-    if (current_vend, dev) in devices:
-	print line,
-- 
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux