FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 06-28-2011, 09:15 PM
Chris Lumens
 
Default Remove things from utils/ that lorax obsoletes.

---
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("
")[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@de.ibm.com>
- * 2008-09-22 Updated by David Cantrell <dcantrell@redhat.com>
- *
- * 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>
", 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: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...
");
- printf("kernel is : %s
", image);
- printf("ramdisk is : %s
", ramdisk);
- printf("parmfile is: %s
", parmfile);
- printf("outfile is : %s
", outfile);
-
- if ((fd1 = fopen(outfile, "w")) == NULL) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if ((fd2 = fopen(image, "r")) == NULL) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if ((fd3 = fopen(ramdisk, "r")) == NULL) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if ((fd4 = fopen(parmfile, "r")) == NULL) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- printf("writing kernel...
");
- while (1) {
- rc = fread(buffer, 1, 1, fd2);
-
- if (rc == 0) {
- break;
- }
-
- if (feof(fd2) || ferror(fd2)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(buffer, 1, 1, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != rc) {
- fprintf(stderr, "could only write %i of %i bytes of kernel
",
- wc, rc);
- }
- }
-
- printf("writing initrd...
");
- 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
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(buffer, 1, 1, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != rc) {
- fprintf(stderr, "could only write %i of %i bytes of initrd
",
- wc, rc);
- }
- }
-
- if (fseek(fd3, 0, SEEK_END) == -1) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if ((initrd_size = ftell(fd3)) == -1) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- printf("changing start PSW address to 0x%08x...
", start_psw_address);
- if (fseek(fd1, 0x4, SEEK_SET) == -1) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(&start_psw_address, 1, 4, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != 4) {
- fprintf(stderr, "could only write %i of %i bytes of PSW address
",
- wc, 4);
- }
-
- printf("writing initrd address and size...
");
- printf("INITRD start: 0x%016llx
", initrd_start);
- printf("INITRD size : 0x%016llx
", initrd_size);
-
- if (fseek(fd1, 0x10408, SEEK_SET) == -1) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(&initrd_start, 1, 8, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != 8) {
- fprintf(stderr, "could only write %i of %i bytes of INITRD start
",
- wc, 8);
- }
-
- if (fseek(fd1, 0x10410, SEEK_SET) == -1) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(&initrd_size, 1, 8, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != 8) {
- fprintf(stderr, "could only write %i of %i bytes of INITRD size
",
- wc, 8);
- }
-
- printf("writing parmfile...
");
- if (fseek(fd1, 0x10480, SEEK_SET) == -1) {
- fprintf(stderr, "%s (%d): %s
", __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
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- wc = fwrite(buffer, 1, 1, fd1);
- if (feof(fd1) || ferror(fd1)) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- abort();
- }
-
- if (wc != 1) {
- fprintf(stderr, "could only write %i of %i bytes of parmfile
",
- wc, 1);
- }
- }
-
- if (fclose(fd1) == EOF) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- }
-
- if (fclose(fd2) == EOF) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- }
-
- if (fclose(fd3) == EOF) {
- fprintf(stderr, "%s (%d): %s
", __func__, __LINE__, strerror(errno));
- }
-
- if (fclose(fd4) == EOF) {
- fprintf(stderr, "%s (%d): %s
", __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
", 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
", modInfoFile);
- exit(1);
- }
-
- if (showModInfo) {
- printf("Version 0
");
- while ((mod = remaining[arg]) != NULL) {
- mi = findModuleInfo(mis, mod);
- if (mi) {
- printf("%s
", mi->moduleName);
- switch (mi->major) {
- case DRIVER_CDROM: printf(" cdrom
"); break;
- case DRIVER_SCSI: printf(" scsi
"); break;
- case DRIVER_FS: printf(" fs
"); break;
- case DRIVER_PCMCIA: printf(" pcmcia
"); break;
- case DRIVER_IDE: printf(" ide
"); break;
- case DRIVER_OTHER: printf(" other
"); break;
- case DRIVER_NET:
- switch (mi->minor) {
- case DRIVER_MINOR_ETHERNET: printf(" eth
"); break;
- case DRIVER_MINOR_TR: printf(" tr
"); break;
-
- default:
- fprintf(stderr, "unknown net minor type for %s
",
- mi->moduleName);
- g_strfreev(remaining);
- exit(1);
- }
- break;
-
- default:
- fprintf(stderr, "unknown device type for %s (%d)
",
- mi->moduleName, mi->major);
- g_strfreev(remaining);
- exit(1);
-
- }
- printf(" "%s"
", mi->description);
- for (i = 0; i < mi->numArgs; i++) {
- printf(" %s "%s"
", mi->args[i].arg,
- mi->args[i].description);
- }
- } else if (!ignoreMissing) {
- fprintf(stderr, "I know nothing about %s
", 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
");
- g_strfreev(remaining);
- exit(1);
- }
-
- list = getModuleList(mis, major);
- for (m = list; m && m->moduleName; m++)
- printf("%s
", 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
" %(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 == "
":
- continue
- if line.startswith(" "):
- continue
- if not line.startswith(" "):
- 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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-29-2011, 06:47 AM
Martin Gracik
 
Default Remove things from utils/ that lorax obsoletes.

mk-s390-cdboot has not been rewritten yet.

--

Martin Gracik

----- Original Message -----
> ---
> 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("
")[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@de.ibm.com>
> - * 2008-09-22 Updated by David Cantrell <dcantrell@redhat.com>
> - *
> - * 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>
", 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: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...
");
> - printf("kernel is : %s
", image);
> - printf("ramdisk is : %s
", ramdisk);
> - printf("parmfile is: %s
", parmfile);
> - printf("outfile is : %s
", outfile);
> -
> - if ((fd1 = fopen(outfile, "w")) == NULL) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if ((fd2 = fopen(image, "r")) == NULL) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if ((fd3 = fopen(ramdisk, "r")) == NULL) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if ((fd4 = fopen(parmfile, "r")) == NULL) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - printf("writing kernel...
");
> - while (1) {
> - rc = fread(buffer, 1, 1, fd2);
> -
> - if (rc == 0) {
> - break;
> - }
> -
> - if (feof(fd2) || ferror(fd2)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(buffer, 1, 1, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != rc) {
> - fprintf(stderr, "could only write %i of %i bytes of kernel
",
> - wc, rc);
> - }
> - }
> -
> - printf("writing initrd...
");
> - 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
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(buffer, 1, 1, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != rc) {
> - fprintf(stderr, "could only write %i of %i bytes of initrd
",
> - wc, rc);
> - }
> - }
> -
> - if (fseek(fd3, 0, SEEK_END) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if ((initrd_size = ftell(fd3)) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - printf("changing start PSW address to 0x%08x...
",
> start_psw_address);
> - if (fseek(fd1, 0x4, SEEK_SET) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(&start_psw_address, 1, 4, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != 4) {
> - fprintf(stderr, "could only write %i of %i bytes of PSW address
",
> - wc, 4);
> - }
> -
> - printf("writing initrd address and size...
");
> - printf("INITRD start: 0x%016llx
", initrd_start);
> - printf("INITRD size : 0x%016llx
", initrd_size);
> -
> - if (fseek(fd1, 0x10408, SEEK_SET) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(&initrd_start, 1, 8, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != 8) {
> - fprintf(stderr, "could only write %i of %i bytes of INITRD start
",
> - wc, 8);
> - }
> -
> - if (fseek(fd1, 0x10410, SEEK_SET) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(&initrd_size, 1, 8, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != 8) {
> - fprintf(stderr, "could only write %i of %i bytes of INITRD size
",
> - wc, 8);
> - }
> -
> - printf("writing parmfile...
");
> - if (fseek(fd1, 0x10480, SEEK_SET) == -1) {
> - fprintf(stderr, "%s (%d): %s
", __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
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - wc = fwrite(buffer, 1, 1, fd1);
> - if (feof(fd1) || ferror(fd1)) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - abort();
> - }
> -
> - if (wc != 1) {
> - fprintf(stderr, "could only write %i of %i bytes of parmfile
",
> - wc, 1);
> - }
> - }
> -
> - if (fclose(fd1) == EOF) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - }
> -
> - if (fclose(fd2) == EOF) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - }
> -
> - if (fclose(fd3) == EOF) {
> - fprintf(stderr, "%s (%d): %s
", __func__, __LINE__,
> strerror(errno));
> - }
> -
> - if (fclose(fd4) == EOF) {
> - fprintf(stderr, "%s (%d): %s
", __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
", 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
", modInfoFile);
> - exit(1);
> - }
> -
> - if (showModInfo) {
> - printf("Version 0
");
> - while ((mod = remaining[arg]) != NULL) {
> - mi = findModuleInfo(mis, mod);
> - if (mi) {
> - printf("%s
", mi->moduleName);
> - switch (mi->major) {
> - case DRIVER_CDROM: printf(" cdrom
"); break;
> - case DRIVER_SCSI: printf(" scsi
"); break;
> - case DRIVER_FS: printf(" fs
"); break;
> - case DRIVER_PCMCIA: printf(" pcmcia
"); break;
> - case DRIVER_IDE: printf(" ide
"); break;
> - case DRIVER_OTHER: printf(" other
"); break;
> - case DRIVER_NET:
> - switch (mi->minor) {
> - case DRIVER_MINOR_ETHERNET: printf(" eth
"); break;
> - case DRIVER_MINOR_TR: printf(" tr
"); break;
> -
> - default:
> - fprintf(stderr, "unknown net minor type for %s
",
> - mi->moduleName);
> - g_strfreev(remaining);
> - exit(1);
> - }
> - break;
> -
> - default:
> - fprintf(stderr, "unknown device type for %s (%d)
",
> - mi->moduleName, mi->major);
> - g_strfreev(remaining);
> - exit(1);
> -
> - }
> - printf(" "%s"
", mi->description);
> - for (i = 0; i < mi->numArgs; i++) {
> - printf(" %s "%s"
", mi->args[i].arg,
> - mi->args[i].description);
> - }
> - } else if (!ignoreMissing) {
> - fprintf(stderr, "I know nothing about %s
", 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
");
> - g_strfreev(remaining);
> - exit(1);
> - }
> -
> - list = getModuleList(mis, major);
> - for (m = list; m && m->moduleName; m++)
> - printf("%s
", 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
"
> %(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 == "
":
> - continue
> - if line.startswith(" "):
> - continue
> - if not line.startswith(" "):
> - 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@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-29-2011, 05:13 PM
Chris Lumens
 
Default Remove things from utils/ that lorax obsoletes.

> mk-s390-cdboot has not been rewritten yet.

Well, I can remove just that piece from the patch and keep the rest. I
don't really expect s390 to be too happy right now anyway given that no
work has taken place on the init side.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-05-2011, 11:48 PM
 
Default Remove things from utils/ that lorax obsoletes.

> > mk-s390-cdboot has not been rewritten yet.
>
> Well, I can remove just that piece from the patch and keep the rest. I
> don't really expect s390 to be too happy right now anyway given that no
> work has taken place on the init side.

I saw a message from wwoods just the other day saying he'd rewritten it
in python, so perhaps I can go ahead with everything here?

- Chris

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

Thread Tools




All times are GMT. The time now is 12:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org