Can lshw be installed on a standard flash drive

Asked by aninkling

I take old windows machines, shred the hard drive, and install ubuntu. I would like a flash drive resident program that I could use to inventory the hardware and maybe even the software on the machine... this is with ubuntu installed. Can I do that and how? Does the flash drive have to be formatted with a Ubuntu file system (eg, not fat)? Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu lshw Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

Im not entirely sure what you are asking about, but it sounds like you might want to know about liveUSB devices.

You can do an install from liveUSB, or just profile a system using that to boot from.

https://help.ubuntu.com/community/Installation/FromUSBStick#live-usb

Revision history for this message
aninkling (dgleet) said :
#2

I'm asking if I can install ishw or similar application on a flash drive and run it from a computer with ubuntu installedon it without having to install the application on that computer. The flash drive should not have to have any kind of boot system on it, just a executable version of the program.

In windows, it is like having a program on my flash drive that I can run without installing the program on the windows computer. (it doesn't need any registry entries)

Thanks for your reply. I hope this clarifies my question.

Revision history for this message
mycae (mycae) said :
#3

>I'm asking if I can install ishw or similar application on a flash drive and run it from a computer
>with ubuntu installedon it without having to install the application on that computer.

No. Lshw is a linux program, and requires a running linux kernel to function. Windows simply does not provide the neccesary system routines required.

Revision history for this message
aninkling (dgleet) said :
#4

There is a working linux kernel- it is on the machine I'm from which I am trying to obtain a configuration. The flash drive is another drive on that machine by virtue of my plugging it in to a usb port.

Revision history for this message
mycae (mycae) said :
#5

Well, then the answer is a very conditional "yes, in theory".

You could pull all the dynamic libraries (or rebuild it yourself using their static makefile command) that lshw needs and then put it and the binary on a disk -- however, it would only work if the kernel was *exactly* the same -- that is to say, it is so-called "ABI compatible". Same CPU, same compiler, same compilation flags, same source code.

Is there any reason you need this? There may be other ways to solve your problem

Revision history for this message
aninkling (dgleet) said :
#6

I collect old computers, destined for the trash, shred the drive, and install Ubuntu. These computers are recycled, either sold to raise funds for charities or given to needy families. I would like a way to assess the hardware and software after Ubuntu is installed, so I can provide that information with the computer. I do not want to have to go through the installation procedure for an inventory program on each computer. I'd like to be able to insert a flash drive and run the inventory, saving the results to the flash drive and to the computer's desktop.

I have not found an inventory program in the standard Ubuntu release.

Revision history for this message
mycae (mycae) said :
#7

Well, if you homogenise the distributions of ubuntu sufficiently, you can just write a script that installs the package automatically from the flash drive.

If you are confident that the machines will have internet access, then you can simply write a file like this (I have not tested this), You would need to set this as executable permission, then run it. This would download lshw if missing from the system, then run it and dump the results to a text file.

If you don't have internet access, you can still do this, you will just need to keep the dependencies on the USB disk, and install the correct .deb files, as downloaded from the package archive, based upon the output of lsb_release -a

packages.ubuntu.com

-------------------------------------

#!/bin/bash

#Get the package status
INSTALLED=`cat /var/lib/dpkg/status | grep --after-context=1 "Package: lshw" | grep "installed"`

#Install lshw as needed
if [ x$INSTALLED !=x "" ] ; then
    sudo apt-get update
    sudo apt-get install lshw
fi

if [ $? -ne 0 ] ; then
    echo "Lshw installation failed"
end

#Record lshw results
sudo lshw > lshw-results-`uname -n`.txt

-----------------------------------

You also might want to look at what this guy does -- it is similar to your operation:

http://linuxlock.blogspot.com/

Can you help with this problem?

Provide an answer of your own, or ask aninkling for more information if necessary.

To post a message you must log in.