Project38.Profile the System Software


Project 38. Profile the System Software

"What version of Darwin am I running, and how do I update Mac OS X from the command line?"

This project illustrates a few Unix commands that return information about system software and shows you how to run Software Update from the command line. Then it looks at utilities for viewing and configuring Open Firmware settings in NV-RAM (Non-Volatile RAM). It covers the commands softwareupdate, nvram, and uname.

Tip

Use system_profiler, covered in Project 37, to discover more OS details. Select detail level full to see information on all installed software.


Display Darwin Information

To discover details such as the processor type and operating-system version, use the Unix command uname. We display all this information in one go by typing

$ uname -a Darwin sauron.mayo-family.com 8.1.0 Darwin Kernel Version 8.1.0: Tue May 10 18:16:08 PDT 2005; root:xnu-792.1.5.obj ~4/RELEASE_PPC Power Macintosh powerpc


Alternatively, select individual system characteristics by specifying the appropriate option. Here are a few examples displaying the machine (processor) name, the operating system (OS), the OS version (revision), and the machine's node name (Internet host name).

$ uname -m Power Macintosh $ uname -s Darwin $ uname -r 8.1.0 $ uname -n sauron.mayo-family.com


Update Mac OS X

Apple has provided a command-line version of the Software Update applicationuseful for updating a machine remotely. The features of softwareupdate are similar to those in the graphical application: They allow you to view available updates, install them, download them without installing, or ignore them.

List all available updates by typing

$ softwareupdate --list Software Update Tool Copyright 2002-2005 Apple Software Update found following new or updated software:    * SecUpd2005-006Ti         Security Update 2005-006 (1.0), 6600K...


Apply all updates by typing the following command, giving your administrator password when prompted.

$ sudo softwareupdate --install --all Password: ...


Option --all says to install all available updates. Alternatively, you may specify which updates to install by naming them on the command line, exactly as shown by the --list option.

Manage Open Firmware

When your Mac powers up, and before the kernel is loaded and Unix springs into life, it executes Open Firmware (OF) commands. OF initializes the hardware, selects a startup disk, and initiates the boot process. OF configuration parameters are held in NV-RAM. You may view and set then by using the nvram command. To view the current setting of all NV-RAM variables, type

$ nvram -p


A discussion of Open Firmware is beyond the scope of this book. We'll look at just one example to show how OF variables may be set.

Suppose you wish to boot into verbose mode, whereby the Unix underbelly is revealed as the boot process proceeds. To enable verbose mode, set the NV-RAM variable boot-args to -v, using the following command, and give your administrator password when prompted. (Check the output from nvram -p first, and if boot-args is already set to some value, don't try this example.)

$ sudo nvram boot-args="-v" Password:


Setting boot-args to -v has the same effect as holding down the key sequence Command-v while your Mac boots.

Restore boot-args to its default null value by typing

$ sudo nvram boot-args=""





Mac OS X UNIX 101 Byte-Sized Projects
Mac OS X Unix 101 Byte-Sized Projects
ISBN: 0321374118
EAN: 2147483647
Year: 2003
Pages: 153
Authors: Adrian Mayo

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net