Bug 1702735
| Summary: | enable SQLite support in lshw | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jeff Bastian <jbastian> | |
| Component: | lshw | Assignee: | lijiang | |
| Status: | CLOSED ERRATA | QA Contact: | Jeff Bastian <jbastian> | |
| Severity: | low | Docs Contact: | ||
| Priority: | low | |||
| Version: | 8.0 | CC: | ruyang | |
| Target Milestone: | rc | Flags: | ruyang:
mirror+
|
|
| Target Release: | 8.1 | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | lshw-B.02.18-20.el8 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1727393 (view as bug list) | Environment: | ||
| Last Closed: | 2019-11-05 22:12:50 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1690227, 1727393 | |||
|
Description
Jeff Bastian
2019-04-24 15:33:28 UTC
Verified on RHEL-8.1.0-Beta-1.1, although a new bug was found: the -dump option requires a full path to the file. I'll open a new BZ for this.
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 Beta (Ootpa)
[root@localhost ~]# rpm -q lshw
lshw-B.02.18-21.el8.x86_64
[root@localhost ~]# uname -r
4.18.0-107.el8.x86_64
[root@localhost ~]# lshw -dump lshw.sql >/dev/null
[root@localhost ~]# file lshw.sql
lshw.sql: cannot open `lshw.sql' (No such file or directory)
### That's odd: why didn't it create the file?
[root@localhost ~]# strace -e trace=file -o lshw.trace lshw -dump lshw.sql >/dev/null
[root@localhost ~]# grep lshw.sql lshw.trace
execve("/usr/sbin/lshw", ["lshw", "-dump", "lshw.sql"], 0x7ffdf2697a60 /* 42 vars */) = 0
lstat("lshw.sql", 0x7ffe34364af0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/bus/pnp/devices/lshw.sql", O_RDWR|O_CREAT|O_CLOEXEC, 0644) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/sys/bus/pnp/devices/lshw.sql", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
### Why is it trying to save the file to /sys/bus/pnp/devices?
### Try again with a full path:
[root@localhost ~]# lshw -dump /root/lshw.sql >/dev/null
[root@localhost ~]# file lshw.sql
lshw.sql: SQLite 3.x database, last written using SQLite version 3026000
[root@localhost ~]# sqlite3 lshw.sql .dump | head
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE META(key TEXT PRIMARY KEY COLLATE NOCASE, value BLOB);
INSERT INTO META VALUES('schema',1.0);
INSERT INTO META VALUES('application','org.ezix.lshw');
INSERT INTO META VALUES('creator','lshw/B.012.18');
INSERT INTO META VALUES('OS','Red Hat Enterprise Linux release 8.1 Beta (Ootpa) ; Linux 4.18.0-107.el8.x86_64 ; glibc 2.28');
INSERT INTO META VALUES('platform','x86_64');
CREATE TABLE nodes(path TEXT PRIMARY KEY, id TEXT NOT NULL COLLATE NOCASE, parent TEXT COLLATE NOCASE, class TEXT NOT NULL COLLATE NOCASE, enabled BOOL, claimed BOOL, description TEXT, vendor TEXT, product TEXT, version TEXT, serial TEXT, businfo TEXT, physid TEXT, slot TEXT, size INTEGER, capacity INTEGER, clock INTEGER, width INTEGER, dev TEXT);
INSERT INTO nodes VALUES('/','localhost.localdomain',NULL,'system',1,1,'Rack Mount Chassis','Dell Inc.','PowerEdge R730 (SKU=NotProvided;ModelName=PowerEdge R730)',NULL,'J6H8GB2',NULL,NULL,NULL,NULL,NULL,NULL,64,NULL);
See bug 1727393 for the problem with relative vs absolute paths for the dump file. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:3549 |