mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 08:11:39 +00:00
Enhanced features!! Huge BSD upgrades! Bug Fixes!! Elbrus Fixes!! More bluetooth
fixes!! What are you waiting for?!!? A special thanks for significant help, ongoing, leading to a huge boost to BSD support, Stan Vandiver, who did a lot of BSD testing, and setup many remote access systems for testing and development of the latest BSD upgrades. If you're a BSD user, you can thank him for helping to expand BSD support! Take special note of the code folding fixes in Fix 1, those open up possible free software code editors that can be used to work with inxi to more than just Kwrite/Kate, to include scite and geany, nice lightweight code editors. You can't do real work in inxi without code folding, so getting this finally resolved was I think worth it. Also, for the first time ever!! inxi is now using Pledge, well, if OpenBSD::Pledge module is available, which is currently only in OpenBSD, since that's the only system that supports Pledge security, except for Serenity, but inxi doesn't support Serenity. Note that OpenBSD was smart and added OpenBSD::Pledge and OpenBSD::Unveil to Perl Core modules, thus removing any hoop that might stop a Perl program from implementing it. Nice going OpenBSD guys! The addition of OpenBSD softraid support for RAID and CRYPTO types highlights the problem with --raid and --logical, where --raid is really just a subset of Logical volume management. Note that while the hardware RAID feature only lists the actual PCI RAID device, OpenBSD bioctl supports hardware RAID out of the box, something I'd thought of doing in inxi for a few years, but it's too much work, but bioctl has done the work, which is impressive. Can't do much without a lot of debugger data there though, but it's worth being aware of. In this case, since softraid is the primary device, I opted to call Crypto and RAID types all RAID, same as with linear zfs. -------------------------------------------------------------------------------- KNOWN ISSUES BUT CAN'T OR WON'T BE FIXED: 1. FreeBSD: USB drivers. I really gave this a try, but could not get any logic to be stable across systems and varying syntaxes used. Will wait for FreeBSD to add drivers to usbconfig -vl. Note that this makes it not possible to correctly match USB networking devices to their respective IF data, so USB networking IF will fall back to the undetected IF-ID, which means it was found but not connected to a specific hardware device. 2. FreeBSD Battery Report: there are non-objective values for Battery state data in sysctl output, as in minutes remaining, which has no meaning, and percent charge (percent of what? original design capacity? current actual capacity?). If data with voltages, design/current capacity in Ah or Wh, is made available, support will be added. Note that there are 3rd party tools that do supply this data in a usable format, but they are not in core so no point. 3. BSDs All: have found no way to get physical CPU counts. this will lead to odd outputs in some cases, like a 2 cpu system reporting itself as a 2x the actual core counts single CPU, but the data just isn't there as far as I know. Dragonfly in some cases appears to have that data. 4. BSDs All: so far no way to get live per core cpu speeds using a file or fast command query. Thought I'd found a way in FreeBSD but that was not the correct clockrate values, or inconsistently right/wrong, so not using it. Also saw the same issue with max/min frequencies in FreeBSD so removed that item, it's better to show nothing than data that is not reliable or actually not even referring to what it seems to be. 5. BSD SOC Support: An issue poster asked why FreeBSD (but really BSD in general) SOC ARM device, like RaPi, support, was so weak in inxi. The reason is simple: to do SOC ARM device data in a meaningful way requires a complete path based data structure, which the BSDs do not appear to have, at least from what I've seen so far. See Linux's /sys data structures for examples of what is required to add or expand inxi SOC device support in inxi. It's hard even with that type of rich path based data, and without it I won't try. The bright side is inxi runs perfectly on such devices, no errors, which was amazing to see, and spoke volumes of the recent work done to extend support for the BSDs. 6. Perl / inxi, when run as root, shows read error when trying to open a 200 / --w------- permission /sys uevent file for reading. The test works as expected as user, but not as root. Perl will try to read it when run as root even though it has no read permissions, only write. This in reality only manifests on very old /sys, from Debian Etch kernel 2.26 days. -------------------------------------------------------------------------------- BUGS: 1. tput + urxvt / FreeBSD: There appears to be a bug in Arch Linux urxvt that leads to failed terminal/console size from tput. Also while trying to resolve this bug, discovered that if you use "tput cols 2>/dev/null" in FreeBSD, for some inexplicable reason tput puts out defaults 80 cols x 24 rows. Why? Who knows. Added in non numeric tests of output to handle errors from tput instead. The bug appears to be what rxvt reports itself as vs what it is actually running as. This issue isn't present in any other distro I tried, but could just be a new bug in urxvt, don't know. 2. Elbrus CPU: Ongoing issue #197 Elbrus poster gave sample of new 2C3 cpuinfo, that exposed some bugs internally in inxi Elbrus handling, I was using integer values instead of hex for model IDs in the Elbrus logic, which would fail after model 9. 3. BSD dmesg.boot: The logic used for dmesg.boot data processing had errors, and had to be fully redone because of the need to detect in a reliable way the current state of USB drives. This logic now is much more robust and reliable, and no longer relies on using 'uniq' values per line, which would fail in all kinds of situations. 4. OpenBSD USB Speeds: bugs fixed for OpenBSD speeds, these were found during the USB data refactor testing process. 5. BSDs: in some cases, wrong memory used values were being generated, this should be largely corrected now. Also pulled the weird NetBSD use of /proc/meminfo which had wrong data in it, and now use vmstat for all BSDs, which after the used bug fixes, is more reliable for BSDs. 6. All systems: CPU stepping would report as N/A if stepping 0, luckily I came across some systems with an actual stepping: 0, which are not common. 7. FreeBSD: dmidecode sourced L2 cache data failed to show correct totals in some cases. Due to no MT detection possible for FreeBSD currently, these totals will still be wrong, but now it says note; check to let users know. 8. dmidecode: some cases were getting the wrong failure error message, this bug became exposed due to OpenBSD locking /dev/mem even to root, which then failed to show the expected message. This was a bug, and is now corrected. 9. FreeBSD: partition swap size didn't show in at least some cases, that's corrected. 10. Linux Partitions: partitions would let doubled swap items through in several cases, and also failed to create in rare cases matches for hidden partition mapped id's. Finally tracked down the actual cause, when moving the partition filters I'd forgotten to add swap into the filter list, oops. But now it will catch duplicates in several different ways, so that's fine. 11. Unmounted: Failed to properly handle detecting RAID components in the case of lvm, mdraid, it was only working for zfs. This was an accident, and should now be corrected. -------------------------------------------------------------------------------- FIXES: 1. Code Folding: Note that this was NOT a bug or failure in inxi, it was a bug in scintilla/scite geany code editors with folding, basically if you commented out logic, without using a space or other marker after the comment #, folding would break in weird ways. Obviously the core scintilla engine should IGNORE the darned # commented out lines, but it doesn't, which is a real bug. But not in inxi. This was however worth working around, because without folding, you can't work on or learn how inxi works, and the only editor I know of in the free software eco-system that can handle folding reasonably accurately was until now Kwrite/Kate code editors, and those have some real, long standing, weaknesses, and bugs around folding that have never been resolved, and yes, did notify them about them, and no, they remain unfixed after years, or they were fixed briefly, then broke again. So it was important to expand the base of possible code editors to more than just the KDE stuff. Fixing this was tedious, but I think worth it. On the bright side, geany/scite folding / unfolding is FAST, and once the code issues that triggered folding failures were resolved, very accurate, much better than Kate's to be honest, though Kate isn't as picky, but Kate's unfold top nodes has been broken more often than it's worked. To avoid this issue, it's also important to configure geany/scite to use a space after the comment when using keyboard shortcuts to comment out lines/blocks. Same goes for Kate/Kwrite, by the way. 2. Battery: Forgot to add battery-force to -v7, which means you would never see the battery line in full output if there was no battery present, this is similar to how raid-forced worked, it was just an oversight which I hadn't noticed until testing the new BSD battery logic. 3. Indentation: small indentation fixes on Sound Server data. Those are visible with -y1, that is. 4. OpenBSD PCI: enabled Device matching to PCI networking device, this required an odd little hack, but seems to be pretty reliable, and allowed me to add driver to PCI device reports as well. Not sure why driver isn't in pcidump -v but it probably will be in the future. Note to self: add in support for that so if they include it in a future release, it will suddenly 'just work', assume they use the same basic syntax as usbdevs -vv output. 5. BSDs: Added in some null data protections for BSDs, which do not always have all the data types found in Linux, those would trigger Perl undefined value errors, which are warnings that inxi failed internally to test for null data in that, but it's hard to know when to do that when the data is basically always there in Linux. 6. Debugger: Added test for required Net::FTP module in debugger, had forgotten to make that test explicit, which led to odd failures. 7. BSDs: nvme detections should be better now. But I have seen no live test system to confirm the fixes work as expected, plus, at least, OpenBSD swaps nvme0 to sd0 internally, so I'm not actually sure how that data will even work, we'll see how that goes. 8. BSDs: oddly, despite using 0x hex numbers almost everywhere, for CPU stepping, the stepping is in decimal, which is even odder because CPU makers list their steppings as hex in many if not most cases. In case this is corrected in the future, if 0x appears before stepping number, will not then try to convert to hex since it already is. 9a. CPU L3: Subtle, probably won't change behaviors, but L3 cache is per physical CPU in every case I've found, so never multiply value by cores for L3. Like everything, this may lead to corner cases being wrong, but that's life, it will also lead to the data being right for most users. 9b. CPU L1: Different L1 syntaxes found so inxi now uses more loose detections, should cover most OpenBSD L1 variants at least. 10. BSDs: inxi was using internal 'sleep' right before reading /proc/cpuinfo, but that was silly for BSDs since cpu speeds there come from sysctl, so the BSD sleeps are now running before sysctl if CPU data feature is required. 11. Too many to remember, but lots of subtle message output changes to make more clear, more accurate, shorter, whatever. 12. USB: a very subtle fix, some devices can be both audio and video, like cameras, but inxi would default to the first detected. Now it checks for both before going to the list of checks, and correctly assigns a type that is both audio and video to the audio and video hashes so both features will show the USB device, not just Audio. 13: BSD: fixes for BSD ifconfig IF status, it was slicing off the full status string, like 'no network' to 'no', which is silly. Now shows full string. 14. OpenBSD: restored USB Hub ports: xx item, I hadn't realized that the data was still there with usbdevs but it required an extra -v, like: usbdevs -vv to trigger, so now the OpenBSD USB ports works fine again. 15. Fedora Xorg: updated --recommends to use the newer split apart xorg utils package names, only xrandr I think needed updating. Thanks Mr. Mazda for keeping up with that stuff! 16. OpenBSD SMART: the actual device being queried turns out to the 'c' partition, the one that represents the entire disk, NOT the main device ID, like sd0, so now inxi tacks on 'c', sd0c, when smartctl runs, and it works fine. So previously SMART report would never have worked in OpenBSD. 17. Partion labels/uuids: in Partitions and Unmounted, does not show label/uuid if fs type is ffs or if fs is a logical type one, like zfs, hammer, and remote fs mounts etc. This cleans up output, since these file system types will never have labels or uuids. 18. Mr Mazda inxi was missing data and showing errors if run in Debian Etch with Perl 5.008, and I realized I'd slipped up and had used the -k option without testing lspci version, but -k was only available in 3.0 in Lenny. But -v turns on -k automatically, so the easy solution was just to remove the -k and leave the -nnv, which is the same thing, but does not cause errors in early lspci. There are also errors with reading as root some /sys uevent files, but upon examination, those had only root write permission, so the perl -r test isn't right. Don't think that can be fixed. See Can't/Won't fix for more. Another issue I noticed was that in some cases Perl seemed to lose track of some hash values in local %trigger in OptionsHandler, and just lose them, thus leading to things like --help --version --recommends not working. Moving %trigger to globals %show and %use fixed that one, but that's weird, no idea what happened, but it works now. Tested in Sarge 3.1, where core modules have to be explicitly installed, they were not included in base Perl install. Kernel 2.4 had some key differences, different lspci syntax, different /proc/partitions, so the block device output and device output is flawed, but otherwise inxi worked fine in Sarge, from 2005! But these issues will not be corrected, kernel 2.24 is just too old, lol. inxi should always run ok in very old systems, like Etch, back to when Perl 5.8 was standard, so bugs like this are always welcome, it's easy to slip up and use something that didn't work in those old systems, then forget to test. 19. Corner case SMART errors, sometimes occur much later in output than inxi expects, this is now corrected and errors should show in smart data no matter where the main error type occured. -------------------------------------------------------------------------------- ENHANCEMENTS: 1. Elbrus: Going along with Bug 2, Updated Elbrus microarch to use family 6, assuming models 10, 11, are the same, which they should be since 12 is the same as in family 4. 2. IPMI Sensors: More sensor syntax detections, sensors will never be stable... 3. OpenBSD: Rolled out live battery state feature, they have very good data, simple, but solid, that allows for a quality battery state report. Handles both Wh/Ah, though I am slightly suspicious of the reality of the arithmetic for Ah > Wh conversion, it seems to be too high. That's Ah * Design Voltage. But Linux battery data has the same issue, though I think in most cases, the data is in Wh, so this issue isn't BSD specific. My suspicion is that the voltages used to determine Ah may actually be slightly lower than the listed design voltage, which inxi calls min: but it's actually the design voltage. Unknown if NetBSD data is the same as OpenBSD for battery, was unable to locate any samples, so can't say, if you have a NetBSD laptop that correctly reports battery state in sysctl -a, please file an issue with some sample battery charge/voltage syntax and values, ideally from > 1 system. If the data is complete, it's easy to add support. 4a. BSD USB rev: inxi now emulates USB rev versions for BSD USB speed/rev version data. Note that this is not guaranteed to be right, because USB devices can be different rev versions than the speed they run at, but as far as I could find, the USB revision data is not available in any practical sense, unless I create a complicated recursive tool to build up a snapshot of the usb system and devices from dmesg data, but I already blew a day on that attempt, so will wait for more complete data in the usb tools in future. The rev version is based on the device/hub speed, using a standard USB rev speed mapping. But a 12 Mbps device can be rev 2, not rev 1.1, for example, that is, it's actually a USB 2.0 device, but a slow speed one. 4b. USB Type: Expanded fallback USB device type tests, these are useful for cases where it's either a vendor defined type, or for Open/NetBSD, which do not yet show USB class/subclass data. But it's a good fallback tool, added Mass Storage, expanded detections. 5. BSD Sensors: Going along with Enhancement 3, rolled out live sensors data. Confirmed working in OpenBSD and FreeBSD, not sure about NetBSD, no data, problem with vm testing is no sensors, but don't have any NetBSD hardware installs to verify. Stan gave it a good try, but could not get NetBSD running so far, maybe later. This basically means the -B and -s features are largely feature complete for the BSDs as far as practical, though due to difficulties in getting the data in a consistent clear way, some more advanced features, like gpu temps, which are now available in Linux kernel values and lm-sensors, do not yet appear to be present in the BSDs, though if this changes, the structures are in place to make updates to these logics very easy to implement now. Note that the --sensors-include and --sensors-exclude items, or config items, work fine with this BSD logic, though you have to figure out what exact syntax to use, but that's the same in Linux. 6. OpenBSD Pledge: Yes, that's right, inxi is now Pledged!!! In OpenBSD, anyway, they did a really good job, and the OpenBSD Perl packager made a very nice Perl modules, OpenBSD::Pledge, which was very easy to implement. Now I know what inxi needs to run its features!! So far OpenBSD only, but Pledge seems like a really good idea, so I figured, let's give it a spin, even if it will only currently work on OpenBSD, but that's fine, inxi is pledged as tightly as I could make it, including unpledging features not required post options processing, once inxi knows what it's actually going to be doing. Note that I'm aware of OpenBSD::Unveil, but that's a lot harder to implement due to never really being sure about what files inxi will need to be looking at until well into the logic. I may look at that in the future. 7. Bluetooth Rfkill: Due to ongoing failures in current inxi to show consistent Bluetooth hci report on Linux, added in one last fallback, rfkill state, which allows inxi to always fallback to at least that basic data. Also added in which tool is providing the report mostly, like: Report: bt-adapter ID: hci0 and so on. Also integrated into -xxx data, or for down state, the full rfkill report, since that can be quite useful. Note that bluetooth is a real pain for users to debug because you can have: * Bluetooth Service: enabled/disabled * Bluetooth Service: started/stopped * bluetoothctl: start/stop * bt-adapter: start/stop * hciconfig: start/stop * rfkill: software: block/unblock; hardware: block/unblock - however, for hardware, that means a physical button has been pressed to disable it, on the laptop that is. To make matters worse, one tool does not always even know when another tool has changed something, for example, if I rfkill blocked hci0, then unblocked it, hciconfig would keep seeing it as down until it was switched to on with hciconfig explicitly. This is I suspect one reason hciconfig is being dropped, it doesn't know how to listen to the newer tools like bluetoothctl, bt-adapter, or rfkill. 8. OpenBSD: Going along with Code Change 1, now has disk serial (doas/root), more consistent physical block size data, more reliable disk data, and for -Dxxx, duid, if available. Also added disk partition table scheme, aka MBR / GPT. Some of these new items may also work with NetBSD. See also Fix 17, SMART fix for OpenBSD. 9. OpenBSD/NetBSD/FreeBSD: the DiskDataBSD refactor now allows Unmounted partitions report. 10. OpenBSD: added in CPU MT detections using siblings data, I think only OpenBSD and Dragonfly support proper MT cpu core counts. Still no way to get physical cpu counts in OpenBSD or FreeBSD or NetBSD that I am aware of. 11. OpenBSD: added in cpu speed min/max data, that was available in most cases, didn't realize that. 12. BSDs: expanded and made more robust cpu L1/L2/L3 cache detections, now for example, OpenBSD will report its L1/L2/L3 cache without root. FreeBSD requires root since that data is coming from dmidecode. This logic update made BSD L-cache data much more reliable and consistent, and, important, easy to work with. This was directly connected to Code Changes 2 and 3, which made dealing with those data sources a lot easier. Note that L1/L2 cache data if not from OpenBSD will show note: check because it's not possible to determine if it's a multithreaded MT cpu or not, and thus if L1/L2 * core count would so often be totally wrong that inxi won't try to guess, it will just list the single value found, and tell the user to check it themselves. 13. OpenBSD: Added rcctl tool to init tools, I hadn't known about that one, that replaces the fallback default used before, /etc/rc.d. 14. RAM Vendor: Issue #245 raised the point that it would be good to try to show RAM vendor data when the manufactorer field is empty, and since that logic is already present in disk_vendor, it was just matter of researching the product IDs to find the matching patterns for the RAM vendors, the initial list is pretty good, but will need updates now and then to correct errors. Also will override only vendor ID 4 character hex value and see if it can find a better value. 15. OpenBSD RAM: data quality is decent (no vendor/product no, unfortunately). The data is often, but sadly not always, available. I'm not clear why sometimes it isn't, but since OpenBSD also defaults to blocking /dev/mem to even root user, which then blocks dmidecode, this is the only practical way to give basic RAM data for OpenBSD, so that's running fine now, when the data is available, with the added bonus of not needing doas/root. Note that due to the way that this data is present, I can have inxi deduce some things like how many arrays there are, and then guess at overall capacity, max stick size, and so on, but all Array-x: values are followed by note: est because they are never based on hard data, just extrapolations. I debated if inxi should even show the guesses, but I think by saying note: est after each Array-x: item, it's pretty clear that it's not hard data, and it does give an idea roughly. I made an initial guess at > 1 ram array but found no data samples to let me see if my guess was right or not, so > 1 array remains roughly theoretical until shown to work or not work empirically. While NetBSD sometimes has the system ram data in a similar way that OpenBSD does in dmesg.boot, it varies too much, and is too inconsistent. There are not enough data samples with good consistent data, and the samples I did see suggested that it would take too much code and convoluted logic to handle the variations, so I'm leaving this one alone. Also, NetBSD probably doesn't block /dev/mem so dmidecode should work fine. 16. Using system clang version info for OpenBSD kernel compiler, the assumption being that a BSD is an OS, so the Clang version it shipped with would be the clang version that compiled the kernel. Please correct if this is wrong. 17. OpenBSD RAID: support added for softraid, including for drive storage totals, unmounted raid component detections. Plugged in pretty smoothly, able to generate a partial report for non root, and shows message if not root. 18. VM detections upgraded, particularly for BSDs, now includes vmm, hvm, hyper-v, kvm. Not all of these would have been detected before. Also cleaned up vm logic, moved all vm detections into $dboot{'machine-vm'}, and only use the first found item. 19. Disk Vendors!!: Yes, last, but not least!! More disk vendors, vendor ID matches!! Yep. What else can I say? Eternity? Man's quest for something that cannot be found, yet these strivings never cease, here manifested by always new vendors and ID matches! -------------------------------------------------------------------------------- DOCUMENTATION: 1. Very significant ongoing upgrades to the docs in inxi-perl/docs/, particularly in inxi-values.txt, inxi-resources.txt, and inxi-data.txt. These are now increasingly useful, and I am trying to keep in particular inxi-values.txt up to date as a primary reference for various features, though it will always lag, because that's how it is, lol. 2. Cleaned up changelog, made 80 cols wide for text, bars, etc, made numbered lists and headers consistent, but otherwise did not change any of the actual content. -------------------------------------------------------------------------------- CODE CHANGES: 1. Complete rewrite of BSD disk/partition data tools, now there is one core tool that generates a mega-disk/partition hash, which is then used for all features that need partition/disk data. This worked out super well, and allowed new features like BSD Unmounted disk data to be generated for the first time ever, along with filling in various block device fields that were missing before. 2. Change 1 also went along with a refactor of dmesg data tool for BSDs, which allowed for much more granular data generation, along with a complex %dboot hash which stores all sub types as well as the main full dataset. This allowed inxi to stop looping through all of dmesg data each time a feature needed it. Now all the data types are assigned if required by a feature, and only then. This, along with change 1, worked really well. See also Bug 3, which mandated completely changing how dmesg.boot and dmesg live data were / are merged, the result is far more robust now, and far less prone to error. 3. Similar to dmesg changes, used same methods for sysctl data, now all the data is assigned to %sysctl data structure based on if needed or not, so it only does the assignments one time, in one location. Much cleaner code this way, and allows for testing set/unset substructures, like $sysctl{'cpu'}. 4. The %dboot and %sysctl refactors went so well that I switched the core USB and Devices to also use %usb and %devices structures. These updates let me dump a lot of global hashes and arrays, and leaned everything down a lot, and also removed basically all the testing loops for these data types, now the Item features just test to see if a reference to the specific type exists, if it does, it has data, if not, it doesn't, this is a lot easier to manage. 5. Ongoing: moving related subroutines to Packages, the goal is to have pretty much all related subroutines (functions) contained in parent classes/packages, makes it easier to maintain. 6. Ongoing: making all internal package tools have similar sub names, getting rid of the specific names for output and data generator functions. This makes each Item Generator increasingly like all the others, as much as practical. 7. A big one, renamed all the feature generators to be XxxxxItem, instead of XxxxData, which was colliding as a package name with actual data generator tools, now all the Feature generators are [Feature]Item, and all the Data generators have Data type names where relevant. This avoided in particular the silly case where I was relying on case to differentiate UsbData and USBData, feature vs data generator. 8. As part of the move to data hash global structures, also moved as many of the top global scalars and hashes and arrays to these now much more heavily utilized global hashes, like %alerts, %use, %fake, %force, and so on. There are now far fewer globals running than before, and where it makes sense, I keep moving them into global hashes, and giving the global hashes more work to do. 9. Significantly expanded list of debuggers for specific data types always available, see docs/inxi-values.txt for list of options there. Decided for rapid development, it was too much of a pain to always be uncommenting the debuggers, so now am uncommenting, adding to @dbg supported items, then documenting. I guess this means the @dbg items are more or less stable and consistent now, give or take. 10. Refactored UsbData and DeviceData, for in particular the BSDs, to be much more robust and to rely less on very fragile regex parsing patterns, takes more lines of code, but better than having the detections break every other BSD release. This was part of the %device and %usb refactors as well. 11. Fixed system_files() too, which was really silly logic, it used a global packed hash of system files, then would do a function call for the paths when required, which was redundant since the values were already in a hash which could be used directly. This was a throwback to inxi gawk/bash, where hashes were not really used in this way, and the logic had been translated to Perl without thinking about it, but once I thought about it, I realized how silly that was. This must have knocked off a good 50 or more unnecessary, and always expensive, function calls.
This commit is contained in:
parent
a539c8fd47
commit
991a35d665
Loading…
Reference in a new issue