Mailinglist Archive: opensuse-commit (1426 mails)

< Previous Next >
commit hwinfo
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 02 Mar 2007 09:35:42 +0100
  • Message-id: <20070302083543.146CE678182@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package hwinfo
checked in at Fri Mar 2 09:35:42 CET 2007.

--------
--- hwinfo/hwinfo.changes 2007-02-21 14:27:21.000000000 +0100
+++ /mounts/work_src_done/STABLE/hwinfo/hwinfo.changes 2007-03-01 12:03:05.000000000 +0100
@@ -1,0 +2,16 @@
+Thu Mar 1 12:02:55 CET 2007 - snwint@xxxxxxx
+
+- perfer libata modules over ide
+
+-------------------------------------------------------------------
+Wed Feb 28 15:28:43 CET 2007 - snwint@xxxxxxx
+
+- map only disks
+
+-------------------------------------------------------------------
+Tue Feb 27 16:38:25 CET 2007 - snwint@xxxxxxx
+
+- new xen code broke non-x86 archs
+- rewrote '--map' option
+
+-------------------------------------------------------------------

Old:
----
hwinfo-13.23.tar.bz2

New:
----
hwinfo-13.27.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hwinfo.spec ++++++
--- /var/tmp/diff_new_pack.y32105/_old 2007-03-02 09:34:19.000000000 +0100
+++ /var/tmp/diff_new_pack.y32105/_new 2007-03-02 09:34:19.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package hwinfo (Version 13.23)
+# spec file for package hwinfo (Version 13.27)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -20,9 +20,9 @@
PreReq: /sbin/ldconfig %insserv_prereq %fillup_prereq
Autoreqprov: on
Summary: Hardware Library
-Version: 13.23
+Version: 13.27
Release: 1
-Source: hwinfo-13.23.tar.bz2
+Source: hwinfo-13.27.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
@@ -89,6 +89,13 @@
%doc doc/libhd/html

%changelog
+* Thu Mar 01 2007 - snwint@xxxxxxx
+- perfer libata modules over ide
+* Wed Feb 28 2007 - snwint@xxxxxxx
+- map only disks
+* Tue Feb 27 2007 - snwint@xxxxxxx
+- new xen code broke non-x86 archs
+- rewrote '--map' option
* Wed Feb 21 2007 - snwint@xxxxxxx
- removed most of prom parsing code (#220762)
- detect new xen stuff (#241564)

++++++ hwinfo-13.23.tar.bz2 -> hwinfo-13.27.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.23/Changelog new/hwinfo-13.27/Changelog
--- old/hwinfo-13.23/Changelog 2007-02-21 14:26:50.000000000 +0100
+++ new/hwinfo-13.27/Changelog 2007-03-01 11:53:15.000000000 +0100
@@ -1,3 +1,15 @@
+1/3/2007: v13.27
+ - perfer libata modules over ide
+
+28/2/2007: v13.26
+ - map only disks
+
+27/2/2007: v13.25
+ - rewrote '--map' option
+
+23/2/2007: v13.24
+ - new xen code broke non-x86 archs
+
21/2/2007: v13.23
- removed most of prom parsing code (#220762)
- detect new xen stuff (#241564)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.23/hwinfo.c new/hwinfo-13.27/hwinfo.c
--- old/hwinfo-13.23/hwinfo.c 2007-02-21 12:31:38.000000000 +0100
+++ new/hwinfo-13.27/hwinfo.c 2007-02-28 15:21:47.000000000 +0100
@@ -11,6 +11,21 @@
#include "hd.h"
#include "hd_int.h"

+typedef struct {
+ hd_hw_item_t type;
+ char *dev;
+ char *dev_old;
+ char *serial;
+ char *model;
+ uint64_t size;
+ char *id;
+ char *p_id;
+ unsigned model_ok:1;
+ unsigned serial_ok:1;
+ unsigned size_ok:1;
+ unsigned assigned:1;
+} map_t;
+
static int get_probe_flags(int, char **, hd_data_t *);
static void progress2(char *, char *);

@@ -47,12 +62,16 @@
void dump_db(hd_data_t *hd_data);
void do_chroot(hd_data_t *hd_data, char *dir);
void ask_db(hd_data_t *hd_data, char *query);
-void get_mapping(hd_data_t *hd_data);
+// void get_mapping(hd_data_t *hd_data);
int get_mapping2(void);
void write_udi(hd_data_t *hd_data, char *udi);

void do_saveconfig(hd_data_t *hd_data, hd_t *hd, FILE *f);

+int map_cmp(const void *p0, const void *p1);
+unsigned map_fill(map_t *map, hd_data_t *hd_data, hd_t *hd_manual);
+void map_dump(map_t *map, unsigned map_len);
+
struct {
unsigned db_idx;
unsigned separate:1;
@@ -271,7 +290,7 @@
break;

case 313:
- get_mapping(hd_data);
+ return get_mapping2();
break;

case 314:
@@ -1429,6 +1448,8 @@
}


+#if 0
+
int is_same_block_dev(hd_t *hd1, hd_t *hd2)
{
if(!hd1 || !hd2 || hd1 == hd2) return 0;
@@ -1536,6 +1557,8 @@
}
}

+#endif
+

void write_udi(hd_data_t *hd_data, char *udi)
{
@@ -1581,46 +1604,30 @@
}


-int get_mapping2()
+int map_cmp(const void *p0, const void *p1)
{
- hd_data_t *hd_data, *hd_data_new;
- hd_t *hd_manual, *hd, *hd_ctrl;
- hd_hw_item_t hw_items[] = { hw_disk, hw_cdrom, hw_storage_ctrl, 0 };
- hd_hw_item_t type;
- struct {
- hd_hw_item_t type;
- char *dev;
- char *dev_new;
- char *id;
- char *p_id;
- } *map;
- unsigned i, cnt, unassigned = 0;
- int err = 0;
- char *s;
-
- hd_data = calloc(1, sizeof *hd_data);
- hd_data->flags.list_all = 1;
- hd_data->debug = -1;
+ const map_t *m0, *m1;

- hd_data_new = calloc(1, sizeof *hd_data_new);
- hd_data_new->flags.list_all = 1;
+ m0 = p0;
+ m1 = p1;

- hd_list(hd_data, hw_manual, 1, NULL);
- hd_manual = hd_list2(hd_data, hw_items, 0);
+ if(!m0->dev && !m1->dev) return 0;
+ if(!m0->dev && m1->dev) return 1;
+ if(m0->dev && !m1->dev) return -1;

- for(cnt = 0, hd = hd_manual; hd; hd = hd->next) {
- cnt++;
- if(opt.verbose) {
- hd_dump_entry(hd_data, hd, stderr);
- fprintf(stderr, "\n");
- }
- }
+ return strcmp(m0->dev, m1->dev);
+}

- if(!cnt) return 0;

- map = calloc(cnt, sizeof *map);
+unsigned map_fill(map_t *map, hd_data_t *hd_data, hd_t *hd_manual)
+{
+ hd_t *hd, *hd_ctrl;
+ hd_hw_item_t type;
+ hd_res_t *res;
+ unsigned map_len = 0;
+ int i, j;

- cnt = 0;
+ if(!map) return 0;

for(hd = hd_manual; hd; hd = hd->next) {
type = hw_none;
@@ -1629,24 +1636,118 @@

if(type == hw_none || !hd->unix_dev_name) continue;

- // printf("%s: %s\n %s\n %s\n", hd->unix_dev_name, hd->model, hd->unique_id, hd->udi);
+ if(hd->status.available_orig == status_no) continue;
+
hd_ctrl = hd_get_device_by_idx(hd_data, hd->attached_to);
- map[cnt].type = type;
- map[cnt].dev = hd->unix_dev_name;
- map[cnt].id = hd->unique_id;
- if(hd_ctrl) {
- map[cnt].p_id = hd_ctrl->unique_id;
- // printf(" %s\n %s\n", hd_ctrl->unique_id, hd_ctrl->udi);
+ map[map_len].type = type;
+ map[map_len].dev = hd->unix_dev_name;
+ map[map_len].id = hd->unique_id;
+ if(hd_ctrl) map[map_len].p_id = hd_ctrl->unique_id;
+ if(hd->serial && *hd->serial) map[map_len].serial = hd->serial;
+ if(hd->model) map[map_len].model = hd->model;
+
+ for(res = hd->res; res; res = res->next) {
+ if(
+ res->any.type == res_size &&
+ res->size.unit == size_unit_sectors
+ ) {
+ map[map_len].size = res->size.val1;
+ break;
+ }
}

- cnt++;
+ map_len++;
}

- if(!cnt) {
- free(map);
- return 0;
+ if(map_len) qsort(map, map_len, sizeof *map, map_cmp);
+
+ /* check whether model, serial and size are unique */
+
+ for(i = 0; i < map_len; i++) {
+ if(map[i].model) {
+ map[i].model_ok = 1;
+ for(j = i + 1; j < map_len; j++) {
+ if(map[j].model && !strcmp(map[i].model, map[j].model)) {
+ map[i].model_ok = 0;
+ break;
+ }
+ }
+ }
+
+ if(map[i].serial) {
+ map[i].serial_ok = 1;
+ for(j = i + 1; j < map_len; j++) {
+ if(map[j].serial && !strcmp(map[i].serial, map[j].serial)) {
+ map[i].serial_ok = 0;
+ break;
+ }
+ }
+ }
+
+ if(map[i].size) {
+ map[i].size_ok = 1;
+ for(j = i + 1; j < map_len; j++) {
+ if(map[i].size == map[j].size) {
+ map[i].size_ok = 0;
+ break;
+ }
+ }
+ }
}

+ return map_len;
+}
+
+
+void map_dump(map_t *map, unsigned map_len)
+{
+ int i;
+
+ for(i = 0; i < map_len; i++) {
+ fprintf(stderr,
+ "%s: %s = %s\n\t%smodel \"%s\", %sserial \"%s\"\n\t%ssize %"PRIu64" sectors\n\t%s @ %s\n\n",
+ map[i].type == hw_disk ? " disk" : "cdrom",
+ map[i].dev, map[i].dev_old,
+ map[i].model_ok ? "*" : "",
+ map[i].model,
+ map[i].serial_ok ? "*" : "",
+ map[i].serial,
+ map[i].size_ok ? "*" : "",
+ map[i].size,
+ map[i].id, map[i].p_id
+ );
+ }
+}
+
+
+int get_mapping2()
+{
+ hd_data_t *hd_data, *hd_data_new;
+ hd_t *hd_manual, *hd;
+ hd_hw_item_t hw_items[] = { hw_disk, hw_storage_ctrl, 0 };
+ map_t *map, *map_old;
+ unsigned cnt, map_len, map_old_len;
+ int err = 0, i, j;
+ char *s;
+
+ hd_data = calloc(1, sizeof *hd_data);
+ hd_data->flags.list_all = 1;
+
+ hd_data_new = calloc(1, sizeof *hd_data_new);
+ hd_data_new->flags.list_all = 1;
+ hd_data_new->debug = -1;
+
+ /* first, old data */
+
+ hd_list(hd_data, hw_manual, 1, NULL);
+ hd_manual = hd_list2(hd_data, hw_items, 0);
+
+ for(cnt = 0, hd = hd_manual; hd; hd = hd->next) cnt++;
+ map_old = cnt ? calloc(cnt, sizeof *map_old) : NULL;
+ map_old_len = map_fill(map_old, hd_data, hd_manual);
+
+ /* now, new data */
+
s = getenv("LIBHD_HDDB_DIR_NEW");
if(s) {
setenv("LIBHD_HDDB_DIR", s, 1);
@@ -1659,6 +1760,66 @@
hd_manual = hd_list2(hd_data_new, hw_items, 1);
}

+ for(cnt = 0, hd = hd_manual; hd; hd = hd->next) cnt++;
+ map = cnt ? calloc(cnt, sizeof *map) : NULL;
+ map_len = map_fill(map, hd_data_new, hd_manual);
+
+ if(map_len) {
+
+ /* try based on serial... */
+ for(i = 0; i < map_len; i++) {
+ if(map[i].assigned || !map[i].serial_ok) continue;
+ for(j = 0; j < map_old_len; j++) {
+ if(map_old[j].assigned || !map_old[j].serial_ok) continue;
+ if(!strcmp(map[i].serial, map_old[j].serial)) {
+ map[i].dev_old = map_old[j].dev;
+ map[i].assigned = map_old[j].assigned = 1;
+ }
+ }
+ }
+
+ /* ... then based on model... */
+ for(i = 0; i < map_len; i++) {
+ if(map[i].assigned || !map[i].model_ok) continue;
+ for(j = 0; j < map_old_len; j++) {
+ if(map_old[j].assigned || !map_old[j].model_ok) continue;
+ if(!strcmp(map[i].model, map_old[j].model)) {
+ map[i].dev_old = map_old[j].dev;
+ map[i].assigned = map_old[j].assigned = 1;
+ }
+ }
+ }
+
+ /* ... and finally based on disk size */
+ for(i = 0; i < map_len; i++) {
+ if(map[i].assigned || !map[i].size_ok) continue;
+ for(j = 0; j < map_old_len; j++) {
+ if(map_old[j].assigned || !map_old[j].size_ok) continue;
+ if(map[i].size == map_old[j].size) {
+ map[i].dev_old = map_old[j].dev;
+ map[i].assigned = map_old[j].assigned = 1;
+ }
+ }
+ }
+
+ if(opt.verbose) {
+ map_dump(map_old, map_old_len);
+ fprintf(stderr, "- - - - - - - - - - - - - - - - - - - -\n");
+ map_dump(map, map_len);
+ }
+
+ for(i = 0; i < map_len; i++) {
+ if(map[i].dev_old && strcmp(map[i].dev, map[i].dev_old)) {
+ printf("%s\t%s\n", map[i].dev, map[i].dev_old);
+ }
+ }
+
+ }
+
+#if 0
+
+ // based on controller
+
for(hd = hd_manual; hd; hd = hd->next) {
type = hw_none;
if(hd_is_hw_class(hd, hw_cdrom)) type = hw_cdrom;
@@ -1669,7 +1830,7 @@
hd_ctrl = hd_get_device_by_idx(hd_data_new, hd->attached_to);

if(hd_ctrl) {
- for(i = 0; i < cnt; i++) {
+ for(i = 0; i < map_len; i++) {
if(
map[i].type == type &&
!map[i].dev_new &&
@@ -1680,28 +1841,13 @@
break;
}
}
- if(i == cnt) unassigned++;
+ if(i == map_len) unassigned++;
}
}
-
- for(i = 0; i < cnt; i++) {
- if(!map[i].dev_new) {
- unassigned++;
- continue;
- }
- if(strcmp(map[i].dev_new, map[i].dev)) printf("%s\t%s\n", map[i].dev_new, map[i].dev);
- if(opt.verbose) {
- fprintf(stderr,
- "%d: %s = %s (%s @ %s)\n",
- map[i].type, map[i].dev_new, map[i].dev, map[i].id, map[i].p_id
- );
- }
- }
- if(opt.verbose) fprintf(stderr, "unassigned = %d\n", unassigned);
-
- if(unassigned) err = 1;
+#endif

free(map);
+ free(map_old);

hd_free_hd_data(hd_data_new);
free(hd_data_new);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.23/src/hd/hd.c new/hwinfo-13.27/src/hd/hd.c
--- old/hwinfo-13.23/src/hd/hd.c 2007-02-21 12:24:41.000000000 +0100
+++ new/hwinfo-13.27/src/hd/hd.c 2007-03-01 11:55:47.000000000 +0100
@@ -1781,7 +1781,8 @@
if(!hd_probe_feature(hd_data, pr_bios_crc)) hd_data->flags.nobioscrc = 1;
if(hd_probe_feature(hd_data, pr_bios_vram)) hd_data->flags.biosvram = 1;
hd_set_probe_feature(hd_data, pr_bios_acpi);
- if(hd_probe_feature(hd_data, pr_modules_pata)) hd_data->flags.pata = 1;
+ hd_set_probe_feature(hd_data, pr_modules_pata);
+ hd_data->flags.pata = hd_probe_feature(hd_data, pr_modules_pata) ? 1 : 0;
}

/* get shm segment, if we didn't do it already */
@@ -3159,6 +3160,8 @@
*/
int hd_is_xen(hd_data_t *hd_data)
{
+#if defined(__i386__) || defined(__x86_64__)
+
char signature[13];
unsigned u, foo;

@@ -3186,6 +3189,12 @@
signature[12] = 0;

return u < 0x40000002 || strcmp(signature, "XenVMMXenVMM") ? 0 : 1;
+
+#else
+
+ return 0;
+
+#endif
}


diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.23/VERSION new/hwinfo-13.27/VERSION
--- old/hwinfo-13.23/VERSION 2007-02-20 13:04:36.000000000 +0100
+++ new/hwinfo-13.27/VERSION 2007-03-01 11:52:17.000000000 +0100
@@ -1 +1 @@
-13.23
+13.27


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >