Mac Linux Testing

From FreekiWiki
Revision as of 10:14, 17 July 2013 by Liliana (talk | contribs)
Jump to navigation Jump to search

Towards building a set of Linux testing tools for MacLand, braindump for tests and projects in progress

Needed
  • Memory test procedure
  • Battery test procedure
  • When OSX is needed to update firmware, see also OSX Bless Testing

Recovery Mode

Intel

Booting into Recovery Mode on an Intel Mac with Linux is a bit trickier than on other systems. Bootcamp (Apple's bootloader) chainloads GRUB which by default selects a standard boot image, but it unfortunately doesn't respect GRUB's escape key (Shift, GRUB v1.98 and above). In order to choose recovery mode, we have to modify GRUB's configuration inside of the operating system (or a chroot).

Open a terminal and follow these steps:

  • Edit /etc/default/grub, and change the value of GRUB_DEFAULT to saved
  • Run sudo grub-update
  • Run sudo grub-reboot 1
  • And reboot. This will make only the next reboot land in Recovery Mode.

Some background info: grub-reboot takes as an argument a number that corresponds to its menu entries' position on the list, counting up from 0. By default, GRUB_DEFAULT is set to menu entry 0, which is the standard graphical boot environment. Changing its value to saved enables grub-reboot to work; otherwise you'll just ceaselessly boot the system into its graphical login. Frustrating!

Unfortunately, you won't always have access or credentials to an account with administrative privileges. An alternative hack you can use is to shut the machine down forcefully while it's booted or booting (to wit: yank the power cord, or press and hold down its power button until it breathes no more). GRUB will then load its menu on its next reboot.

PowerPC

Follow these steps:

  • When booting a PPC Mac with Linux installed, hit Esc when the Yaboot prompt shows.
  • This will drop you at a prompt. (Note: you can see which images are available to boot by pressing Tab.)
  • Enter the following and press Enter:
 Linux recovery

and you'll arrive at the standard Recovery mode menu.

Processor Testing

Both Intel and PowerPC Macs can utilize stress-test, included in the Freekbox image.

Memory Testing

Intel

Intel Macs can run our standard memory testing utility (Memtest86+) through a couple of different methods. The most straightforward is to use a Memtest86+ ISO image and burn it to disc. You can then boot the Mac off the CD (hold down either c, or option while POSTing).

Alternatively, we can have the Mac PXE boot to our internal network and load Memtest86+ from there. As Intel Mac firmware utilize a different boot protocol, in order to perform a PXE boot we'll use a utility known as iPXE. Similarly to Memtest86+, the most straightforward method is to burn an ISO to disc and boot the Mac from CD.

Unfortunately, not all Intel Macs will be able to successfully boot from CD, and even then some models (or firmware revisions) will load iPXE but stall during the network bootstrap. When this is the case, memory testing will have to be conducted inside of an OS: memtester in Linux, or Rember in OSX. See the PowerPC section for more information.

As of December 2012, testing is being conducted to see whether iPXE can be chainloaded from a standard Apple network boot.

PowerPC

Unfortunately, Memtest86+ is not built for the PowerPC architecture, and no bootable alternative is available. This means memory testing has to occur within an OS (memtester in Linux, or Rember in OSX).

By default, memtester isn't included in our Linux images, but it is available in the repositories:

 sudo apt-get install memtester

An important thing to note: Memory testing utilities are only able to test unused system memory. When testing memory inside of an OS, a significant portion is used by the operating system, thereby preventing a fully comprehensive test. This reason in particular is why bootable memory diagnostic utilities are preferable.

To remedy this issue, we boot into Recovery Mode ; a limited console environment that utilizes much less of the system memory (typically by a factor of about 10). See the Recovery Mode section for instructions.

  • memtester's syntax looks like this:
 memtester [size of memory to test] [number of passes]
  • Unfortunately, memtester doesn't automatically work up to the available of RAM, so you'll have to manually specify how much you want tested. In order to see how much free memory is available, run free -m and use the number shown under the free column and the Mem: row, and specify 2 passes. For example:
 memtester 1005 2
  • memtester will immediately lock all of the memory specified. If an error is returned, try running it with less memory.

Battery Testing

Both Intel and PowerPC Macs can utilize the stress-test loop for battery testing. See Laptop Testing for more details.

Wireless Testing

See the Wireless Troubleshooting Guide for instructions on setup of Broadcom drivers.

Otherwise, run our handy wireless setup script: Broadcom-setup

Be sure to make the script executable!

chmod +x $script_name