Today I just could not connect to my MacMini which was displaying a screensaver when I turned the screen off this morning. Usually it works fine when I come back home and turn it back on, but this time it only showed up a black screen, meaning the screen was connected and it was resuming from sleep.
So let’s investigate this
Before trying anything else, back to the basis : it replies to ping - good, so OSX hasn’t crashed.
ssh and Screen Sharing (VNC) also work - so I click on Apple/Retart, all the windows clause but nothing else happens. The VNC connection is not closed.
Weird. I try the same by ssh : sudo then reboot - but reboot also fails with :
/ is busy updating; waiting for lock
Weird. Let’s check /var/log/system.log:
May 23 18:30:57 macmini com.apple.kextcache[41843]: Lock acquired; proceeding.
May 23 18:30:57 macmini com.apple.kextcache[41843]: /: helper partitions appear up to date.
May 23 18:30:59 macmini AppleFileServer[41769]: _Assert: /SourceCache/afpserver/afpserver-585.2/afpserver/../afpserver/SharePointSyncTask.cpp, 215 (4294967253)
May 23 18:31:25: —- last message repeated 1 time —-
May 23 18:31:25 macmini com.apple.backupd[41859]: Starting standard backup
May 23 18:31:25 macmini com.apple.backupd[41859]: Error -35 while resolving alias to backup target
May 23 18:31:35 macmini com.apple.backupd[41859]: Backup failed with error: 19
Weird. After some googling, I see hackintosh users have the same problem with a wrong ACPI VGA kext, but maybe backupd is causing the problem? A killall -9 backupd later :
May 23 18:31:52 macmini com.apple.launchd[1] (com.apple.backupd[41859]): Exited: Killed: 9
Let’s try again to reboot
May 23 18:32:06 macmini reboot[41874]: rebooted by guylhem
May 23 18:32:06 macmini reboot[41874]: BOOT_TIME: 1337812326 786930
Never happened before, so this this warranted further investigations!
First I went into single user mode, where I saw notices of mDNSresponder that could not be spawned.
Figured out I tried to change some perms on the user interface, to increase security on my mother computer, and thus created a strange bug. A google search on mDNSresponder pointed me to: http://www.mac-forums.com/forums/os-x-operating-system/184944-os-hangs-blue-screen-just-before-login.html#post1055281 :
“it was caused by sharing the boot volume via Server Admin and then removing read access for ‘everyone’ (within Server Admin). In my opinion this is a serious bug - Server Admin settings should never be able to inhibit booting - preferably file sharing controlled by Server Admin should be totally independent of any local conventional OS X file sharing, or is this too much to expect?”
Solution : single user boot or CD rescue booth, then as explained in the post :
ls -ld /
(followed by the return key) ; Correct permissions are: drwxrwxr-t and the eighth character is critical. If it is not an r you can correct it as follows, so type:
/sbin/mount -uw /
(followed by the return key) ; then type:
chmod 1775 /
(followed by the return key) ; then type:
exit ; reboot
Thanks google, you save my day here !
I have a good old Microsoft trackball with forward/backward thumb and pinkie mouse buttons which I use to move to the next/previous tab in Safari and Terminal. Living without this functionality on OSX is not possible. The only link I found was not very helpful, so here is the Applescript I wrote: Next tab: tell application ”Google Chrome” set maxIndex to count tabs of (first window) set currentIndex to active tab index of (first window) set proposedIndex to currentIndex + 1 if proposedIndex < 1 then set proposedIndex to maxIndex if proposedIndex > maxIndex then set proposedIndex to 1 set (active tab index of (first window)) to proposedIndex end tell Previous tab:
tell application ”Google Chrome” set maxIndex to count tabs of (first window) set currentIndex to active tab index of (first window) set proposedIndex to currentIndex - 1 if proposedIndex < 1 then set proposedIndex to maxIndex if proposedIndex > maxIndex then set proposedIndex to 1 set (active tab index of (first window)) to proposedIndex end tell This will cycle around your tabs (useful if you have only one spare mouse button). To remove that function, simply change the boundary tests to: if proposedIndex < 1 then set proposedIndex to 1 if proposedIndex > maxIndex then set proposedIndex to maxIndex
With the latest OSX updates separating a rendering process from a user-interface process, Safari became very instable on high system load.
Opera still works fine, and eats far less memory, so I guess it’s time to move back to greener pastures.
Crosstools-ng is very handy to easily prepare a cross compilation toolchain on Linux. On OSX, it can be more complicated, because there are some linuxicisms in dependant config files, such as GNU find defaulting to “.”, which breaks on OSX (on BSD find, the path, even if it is “.”, has to be specified)
There are also many other little things which can and do cause problems. So I decided to get a working mips toolschain for OSX to compile my Fritzbox 7390 binaries directly on my macbook.
It is now available online as a DMG on http://dl.dropbox.com/u/984275/fritzbox/Fritzbox.dmg.bz2, along with the source code that was used to produce it : http://dl.dropbox.com/u/984275/fritzbox/Crosstools.dmg.bz2.
However, the international Fritzbox with firmware 84.04.88i uses uclibc 0.9.29 while I opted for 0.9.30 to minimize crosstools-ng patching, and considering it is also the version used by the current German „labör” (beta) firmwares.
So if you want to use this toolchain to prepare Fritzbox 7390 binaries for firmware 84.04.88i, use the provided “env.sh” script which will setup a static crosscompiling environment.
If you want to recreate the toolchain, for exemple with a different kernel version or uclibc, the source code is in Crosstools.dmg.bz2. You will find there crosstools-ng, with a “make.sh” script, and OSX binaries to replace the missing GNU tools at compile time.
To recreate the toolchain, use the included make.sh script :
Do no forget to create a “Fritzbox” dmg containing a case sensitive filesystem in /Volumes/Fritzbox : that’s where your toolchain will go.export PATH=/Volumes/Crosstools/osx.bins/:$PATH
cd ./crosstool-ng && configure —local —with-sed=/Volumes/Crosstools/osx.bins/sed —with-awk=/Volumes/Crosstools/osx.bins/gawk —with-libtool=/Volumes/Crosstools/osx.bins/libtool —with-libtoolize=/Volumes/Crosstools/osx.bins/libtoolize —with-readelf=/Volumes/Crosstools/osx.bins/readelf —with-objdump=/Volumes/Crosstools/osx.bins/objdump —with-objcopy=/Volumes/Crosstools/osx.bins/objcopy —with-lzma=/Volumes/Crosstools/osx.bins/lzma && cd ..
cd ./crosstool-ng && make && cd ..
cp ./crosstool-ng/fritzbox-7390 ./crosstool-ng/.config
cd ./crosstool-ng && ./ct-ng build && cd ..
There are various “Rescue CD” linux distribution out there. But I have yet to find one that can present itself as a boot option with a simple press of the “Alt” key during a MacIntel reboot.
Nothing impossible - just put a /efi/boot/bootx64.efi file out there - say Grub2 in x86-64 as explained on ArchLinux
This also works for your main distribution : you can put your grub there in /dev/disk0s1 that is reserved for EFI:
mkdir /tmp/efi && mount -t msdos /dev/disk1 /tmp/efi
Simple and effective.
Linux on the macbook should put the bootloader on the specific partition (ex: /dev/sdb4) instead of the MBR. But Grub wants to kill the first 512 bytes of XFS because XFS has no DOS bias for the 1st sector. So I had to use ext3 to finish my install - and for the first time since it was introduced to Linux, there is no XFS for me.
Today I needed a windows machine to do some tests. But bootcamp instructions where not very clear to me - especially the part where you have to reformat the partition in NTFS from within the windows installer.
Here are very complete instructions to have a quad-boot (OSX, Linux, Vista, XP) + shared partition I found :
0.Prepare your Boot Camp driver CD. Backup your files.
1.Prepare your XP winclone image:
1.1 Boot from your Tiger install DVD, from the Utilities manu, choose Disk Utility. Under Volume Scheme, choose 3 partitions. Click the last partition, specify its format as “MS-DOS File System”. Make sure the other two partitions are “Mac OS Extended(Journaled)”, Click Partition. (Now all your data are destroyed)
1.2 Close Disk Utility. Install OS X to the first partition. Do a minimal install for you are about to discard it.
1.3 After reboot into OS X, download and install winclone from www.twocanoes.com
1.4 Insert XP install CD, reboot while holding the Option key. Choose to boot from CD. Install XP into the last partition.(marked C: ) You must format the partition as NTFS. (winclone cannot clone a FAT partition) Remember to hold the option key when reboot and boot from the Windows disk to continue install. After done, i gave the XP partition a volume name “XP”.
1.5 Now you have a clean install of XP, no need to install the hardware driver at this point, just reboot into OS X, make a winclone image of your XP partition. Save the image on an external hard disk.
2.Reboot from your Tiger install DVD, run Disk Utility. This time choose 6 partitions. Partition as below:
0 EFI protected (which is invisible under Disk Utility)
1 Name:Vista Format: MS-DOS File System
2 Name:FAT Format: MS-DOS File System
3 Name:XP Format: MS-DOS File System
4 Name:OSX Format: Mac OS Extended(Journaled)
5 Name:HFS Format: Mac OS Extended(Journaled)
6 Format: Free Space
3.Install Tiger onto volume “OSX”. After reboot into OS X, download rEFIt from refit.sourceforge.net ,install it to volume “OSX”. Now you have a boot manager. Insert Vista install DVD and reboot from it.
4.Install Vista onto partition 2 named “Vista”.(That is the first volume you can see under Tiger’s Disk Utility) You must format it as NTFS at this point. Vista will install with no problems. (It will reboot several times) After done, i gave the vista partition a volume name “VISTA”.
5.(Optional) Now you have a clean install of Vista, reboot into OS X, make a winclone image of your Vista partition for future use. Reboot into Vista and let Vista check the disk.(Do it now, don’t give XP the chance to check the Vista partition or Vista can be hurt.)
6.Restore your XP winclone image to the volume “XP” (/dev/disk0s4). Reboot into XP and let XP check the disk.
7.Now reboot to Vista. If Vista fails to boot, use Vista DVD to repair it. You may need a USB keyboard to do this. (I don’t know why but sometimes restoring XP’s winclone image makes Vista unable to boot, fortunately vista DVD quickly repairs it)
8.Insert ubuntu install live CD,(i use ubuntu 7.04 64bit) reboot from it. Launch install from desktop.
At step 3, choose your keyboard layout as Macintosh.
At step 4, choose to manually partition the disk:
create a / partition and a swap partition at the end of the disk.(Swap must be larger than memory to be able to “hibernate”. And one megabyte here is 1000*1000 bytes, not 1024*1024)
(Optional) You may notice there is a 134M free space(in fact 128M, 134=128*1.024*1.024) between /dev/sda5 and /dev/sda6, believe me, it’s of no use. I create a 9th partition here for /boot to reclaim the space.
At step 7, before you go ahead with the install, click “advanced”, and tell ubuntu to install GRUB to (hd0,2), the FAT partition. (Yes, this is the right place. Installing GRUB into the MBR will let GRUB manage the windows booting, you will have to go through 2 boot manager to boot windows or linux, which is not what we want. Besides MBR, it seems GRUB can only be installed into among the first 4 partitions to be bootable, and the FAT partition right now doesn’t contain a boot code so it’s safe to have GRUB live there)
Proceed with the install. Reboot and you will see 4 OSes from rEFIt menu.
9.Install boot camp drivers under xp and vista. Google and find ways to make airport and wireless mighty mouse work under ubuntu. Google and find ways to fix the screen resolution under ubuntu. Google and find ways to enable touchpad scrolling/tapping/right-clicking under ubuntu.
10.Done! Enjoy your quad booting monster.
If you followed the previous post where I explained how a firewall for IPv6 was a good idea with OSX, you may wonder why ping6 is not working.
Quite simple: Apple ip6fw tool is not 64bit-clean (!!) and thus does not store ipv6-icmp types over 127.
# sudo ip6fw add 20020 allow ipv6-icmp from any to any in icmptype 1,2,3,4,128,129
20020 allow ipv6-icmp from any to any in icmptype 1,2,3,4
At least you can remove the 64-bit code with ditto to use the working i386 code. A fix from Apple would be even better !