Monday, August 9, 2010

sudo lsusb -d 05ac:0205 -vvx

Bus 004 Device 003: ID 05ac:0205 Apple, Inc. Extended Keyboard [Mitsumi]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x05ac Apple, Inc.
  idProduct          0x0205 Extended Keyboard [Mitsumi]
  bcdDevice            1.22
  iManufacturer           1 Mitsumi Electric
  iProduct                3 Apple Extended USB Keyboard
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           13 International (ISO)
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      65
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           13 International (ISO)
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     110
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval             255
Device Status:     0x0000
  (Bus Powered)

cat /proc/cpuinfo

processor : 0
cpu  : 7447A, altivec supported
clock  : 1416.666661MHz
revision : 0.2 (pvr 8003 0102)
bogomips : 83.20
timebase : 41620997
platform : PowerMac
model  : PowerMac10,1
machine  : PowerMac10,1
motherboard : PowerMac10,1 MacRISC3 Power Macintosh 
detected as : 287 (Mac mini)
pmac flags : 00000010
L2 cache : 512K unified
pmac-generation : NewWorld

First steps on my mac mini g4

$ sudo lshw
macminig4
    description: Computer
    product: Mac mini
    vendor: Copyright 1983-2004 Apple Computer, Inc. All Rights Reserved
    serial: TYXYM5306NSTYX
    width: 32 bits
  *-core
       description: Motherboard
       physical id: 0
       clock: 166MHz
       capabilities: powermac10_1 macrisc3 power_macintosh
     *-firmware
          product: OpenFirmware 3
          physical id: 0
          logical name: /proc/device-tree
          capabilities: bootinfo
     *-memory
          description: System memory
          physical id: 1
          size: 512MiB
        *-bank
             description: DDR SDRAM
             product: PC3200U-30330
             physical id: 0
             version: 2000,05 27,09
             serial: M1U51264DS8HC3G-5T
             slot: DIMM0/J11
             size: 512MiB
     *-cpu
          description: CPU
          product: 7447A, altivec supported
          physical id: 2
          bus info: cpu@0
          version: 0.2 (pvr 8003 0102)
          size: 1416MHz
          clock: 166MHz
          capabilities: altivec performance-monitor
        *-cache:0
             description: L1 Cache
             physical id: 0
             size: 32KiB
        *-cache:1
             description: L2 Cache (unified)
             physical id: 1
             size: 512KiB
             clock: 1416MHz (0.7ns)
     *-pci:0
          description: Host bridge
          product: UniNorth 2 AGP
          vendor: Apple Computer Inc.
          physical id: 100
          bus info: pci@0000:00:0b.0
          version: 00
          width: 32 bits
          clock: 66MHz
          configuration: driver=agpgart-uninorth latency=16 module=uninorth_agp
        *-display
             description: VGA compatible controller
             product: RV280 [Radeon 9200]
             vendor: ATI Technologies Inc
             physical id: 10
             bus info: pci@0000:00:10.0
             version: 01
             width: 32 bits
             clock: 66MHz
             capabilities: agp agp-2.0 pm vga_controller bus_master cap_list
             configuration: driver=radeonfb latency=255 mingnt=8 module=radeonfb
     *-pci:1
          description: Host bridge
          product: UniNorth 2 PCI
          vendor: Apple Computer Inc.
          physical id: 101
          bus info: pci@0001:10:0b.0
          version: 00
          width: 32 bits
          clock: 66MHz
          configuration: latency=16
        *-network
             description: Network controller
             product: BCM4306 802.11b/g Wireless LAN Controller
             vendor: Broadcom Corporation
             physical id: 12
             bus info: pci@0001:10:12.0
             version: 03
             width: 32 bits
             clock: 33MHz
             capabilities: pm bus_master cap_list
             configuration: driver=b43-pci-bridge latency=16 module=ssb
        *-generic
             product: KeyLargo/Intrepid Mac I/O
             vendor: Apple Computer Inc.
             physical id: 17
             bus info: pci@0001:10:17.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: bus_master
             configuration: driver=macio latency=16
           *-ide
                description: IDE Channel 0
                physical id: 1
                bus info: ide@1
                logical name: ide1
                clock: 33MHz
        *-usb:0 UNCLAIMED
             description: USB Controller
             product: KeyLargo/Intrepid USB
             vendor: Apple Computer Inc.
             physical id: 18
             bus info: pci@0001:10:18.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: ohci
             configuration: latency=0 maxlatency=86 mingnt=3
        *-usb:1 UNCLAIMED
             description: USB Controller
             product: KeyLargo/Intrepid USB
             vendor: Apple Computer Inc.
             physical id: 19
             bus info: pci@0001:10:19.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: ohci
             configuration: latency=0 maxlatency=86 mingnt=3
        *-usb:2
             description: USB Controller
             product: KeyLargo/Intrepid USB
             vendor: Apple Computer Inc.
             physical id: 1a
             bus info: pci@0001:10:1a.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: ohci bus_master
             configuration: driver=ohci_hcd latency=16 maxlatency=86 mingnt=3 module=ohci_hcd
           *-usbhost
                product: OHCI Host Controller
                vendor: Linux 2.6.26-2-powerpc ohci_hcd
                physical id: 1
                bus info: usb@1
                logical name: usb1
                version: 2.06
                capabilities: usb-1.10
                configuration: driver=hub slots=2 speed=12.0MB/s
              *-usb
                   description: Keyboard
                   product: Bluetooth HCI MacBookPro (HID mode)
                   vendor: Apple, Inc.
                   physical id: 1
                   bus info: usb@1:1
                   version: 15.86
                   capabilities: usb-2.00
                   configuration: driver=usbhid maxpower=100mA speed=12.0MB/s
        *-usb:3
             description: USB Controller
             product: USB
             vendor: NEC Corporation
             physical id: 1b
             bus info: pci@0001:10:1b.0
             version: 43
             width: 32 bits
             clock: 33MHz
             capabilities: pm ohci bus_master cap_list
             configuration: driver=ohci_hcd latency=16 maxlatency=42 mingnt=1 module=ohci_hcd
           *-usbhost
                product: OHCI Host Controller
                vendor: Linux 2.6.26-2-powerpc ohci_hcd
                physical id: 1
                bus info: usb@2
                logical name: usb2
                version: 2.06
                capabilities: usb-1.10
                configuration: driver=hub slots=3 speed=12.0MB/s
              *-usb
                   description: USB hub
                   product: Hub in Apple Extended USB Keyboard
                   vendor: Mitsumi Electric
                   physical id: 1
                   bus info: usb@2:1
                   version: 1.22
                   capabilities: usb-1.10
                   configuration: driver=hub maxpower=50mA slots=3 speed=12.0MB/s
                 *-usb:0
                      description: Keyboard
                      product: Apple Extended USB Keyboard
                      vendor: Mitsumi Electric
                      physical id: 1
                      bus info: usb@2:1.1
                      version: 1.22
                      capabilities: usb-1.10
                      configuration: driver=usbhid maxpower=50mA speed=12.0MB/s
                 *-usb:1
                      description: Mouse
                      product: USB Optical Mouse
                      vendor: Primax Electronics, Ltd
                      physical id: 2
                      bus info: usb@2:1.2
                      version: 2.00
                      capabilities: usb-2.00
                      configuration: driver=usbhid maxpower=100mA speed=1.5MB/s
        *-usb:4
             description: USB Controller
             product: USB
             vendor: NEC Corporation
             physical id: 1b.1
             bus info: pci@0001:10:1b.1
             version: 43
             width: 32 bits
             clock: 33MHz
             capabilities: pm ohci bus_master cap_list
             configuration: driver=ohci_hcd latency=16 maxlatency=42 mingnt=1 module=ohci_hcd
           *-usbhost
                product: OHCI Host Controller
                vendor: Linux 2.6.26-2-powerpc ohci_hcd
                physical id: 1
                bus info: usb@3
                logical name: usb3
                version: 2.06
                capabilities: usb-1.10
                configuration: driver=hub slots=2 speed=12.0MB/s
        *-usb:5
             description: USB Controller
             product: USB 2.0
             vendor: NEC Corporation
             physical id: 1b.2
             bus info: pci@0001:10:1b.2
             version: 04
             width: 32 bits
             clock: 33MHz
             capabilities: pm ehci bus_master cap_list
             configuration: driver=ehci_hcd latency=16 maxlatency=34 mingnt=16 module=ehci_hcd
           *-usbhost
                product: EHCI Host Controller
                vendor: Linux 2.6.26-2-powerpc ehci_hcd
                physical id: 1
                bus info: usb@4
                logical name: usb4
                version: 2.06
                capabilities: usb-2.00
                configuration: driver=hub slots=5 speed=480.0MB/s
     *-pci:2
          description: Host bridge
          product: UniNorth 2 Internal PCI
          vendor: Apple Computer Inc.
          physical id: 102
          bus info: pci@0002:20:0b.0
          version: 00
          width: 32 bits
          clock: 66MHz
          configuration: latency=16
        *-generic
             product: UniNorth/Intrepid ATA/100
             vendor: Apple Computer Inc.
             physical id: d
             bus info: pci@0002:20:0d.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: bus_master
             configuration: driver=ide-pmac latency=32
           *-ide
                description: IDE Channel 0
                physical id: 0
                bus info: ide@0
                logical name: ide0
                clock: 33MHz
              *-disk
                   description: ATA Disk
                   product: ST9808210A
                   vendor: Seagate
                   physical id: 0
                   bus info: ide@0.0
                   logical name: /dev/hda
                   version: 3.04
                   serial: 3LF1QH95
                   size: 74GiB (80GB)
                   capacity: 74GiB (80GB)
                   capabilities: ata dma lba iordy smart security pm apm partitioned partitioned:mac
                   configuration: apm=off smart=on
                 *-volume:0
                      description: Apple partition map
                      physical id: 1
                      bus info: ide@0.0,1
                      logical name: /dev/hda1
                      capacity: 31KiB
                 *-volume:1
                      description: Apple Bootstrap
                      physical id: 2
                      bus info: ide@0.0,2
                      logical name: /dev/hda2
                      size: 974KiB
                      capacity: 977KiB
                      capabilities: bootable hfs initialized
                      configuration: created=2010-08-09 12:16:17 filesystem=hfs label=bootstrap modified=2010-08-09 12:16:18 state=clean
                 *-volume:2
                      description: Apple UNIX SVR2
                      vendor: Linux
                      physical id: 3
                      bus info: ide@0.0,3
                      logical name: /dev/hda3
                      logical name: /boot
                      version: 1.0
                      serial: 331213d0-516a-4ba3-9a9b-5711d7668919
                      size: 244MiB
                      capacity: 244MiB
                      capabilities: large_files huge_files recover ext2 initialized
                      configuration: filesystem=ext2 modified=2010-08-09 12:18:06 mount.fstype=ext2 mount.options=rw,errors=continue mounted=2010-08-09 12:18:06 state=mounted
                 *-volume:3
                      description: Linux LVM
                      physical id: 4
                      bus info: ide@0.0,4
                      logical name: /dev/hda4
                      serial: gAjmpy-CTY2-N9Us-3SCV-WZSS-j5nE-CqIWJ4
                      size: 74GiB
                      capacity: 74GiB
                      capabilities: multi lvm2
              *-cdrom
                   description: DVD writer
                   product: MATSHITADVD-R UJ-845C
                   physical id: 1
                   bus info: ide@0.1
                   logical name: /dev/hdb
                   version: DPP9
                   capabilities: packet atapi cdrom removable nonmagnetic dma lba iordy audio cd-r cd-rw dvd dvd-r
                   configuration: mode=udma4 status=open
        *-firewire
             description: FireWire (IEEE 1394)
             product: UniNorth 2 FireWire
             vendor: Apple Computer Inc.
             physical id: e
             bus info: pci@0002:20:0e.0
             version: 81
             width: 32 bits
             clock: 33MHz
             capabilities: pm ohci bus_master cap_list
             configuration: driver=ohci1394 latency=64 maxlatency=24 mingnt=12 module=ohci1394
        *-network
             description: Ethernet interface
             product: UniNorth 2 GMAC (Sun GEM)
             vendor: Apple Computer Inc.
             physical id: f
             bus info: pci@0002:20:0f.0
             logical name: eth0
             version: 80
             serial: 00:14:51:09:e1:34
             size: 100MB/s
             capacity: 100MB/s
             width: 32 bits
             clock: 66MHz
             capabilities: bus_master ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
             configuration: autonegotiation=on broadcast=yes driver=sungem driverversion=0.98 duplex=full ip=192.168.0.19 latency=16 link=yes maxlatency=64 mingnt=64 module=sungem multicast=yes port=MII speed=100MB/s
  *-network DISABLED
       description: Wireless interface
       physical id: 1
       logical name: wlan0
       serial: 00:11:24:a3:d8:ad
       capabilities: ethernet physical wireless
       configuration: broadcast=yes multicast=yes wireless=IEEE 802.11

Debian on MacMiniG4

I finally manage to get the debian-installer to work !

Steps:

$ wget http://cdimage.debian.org/debian-cd/5.0.5/powerpc/iso-dvd/debian-505-powerpc-DVD-1.iso
--2010-08-09 14:34:09--  http://cdimage.debian.org/debian-cd/5.0.5/powerpc/iso-dvd/debian-505-powerpc-DVD-1.iso
Resolving cdimage.debian.org... 130.239.18.173, 130.239.18.163, 2001:6b0:e:2018::163, ...
Connecting to cdimage.debian.org|130.239.18.173|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://caesar.acc.umu.se/debian-cd/5.0.5/powerpc/iso-dvd/debian-505-powerpc-DVD-1.iso [following]
--2010-08-09 14:34:09--  http://caesar.acc.umu.se/debian-cd/5.0.5/powerpc/iso-dvd/debian-505-powerpc-DVD-1.iso
Resolving caesar.acc.umu.se... 130.239.18.142, 2001:6b0:e:2018::142
Connecting to caesar.acc.umu.se|130.239.18.142|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4698593280 (4.4G) [application/octet-stream]
Saving to: `debian-505-powerpc-DVD-1.iso'

100%[================================================================================================================================>] 4,698,593,280 1.29M/s   in 55m 13s

2010-08-09 15:29:22 (1.35 MB/s) - `debian-505-powerpc-DVD-1.iso' saved [4698593280/4698593280]


Then using k3b, just open the iso image, burn onto a SONY DVD+R 4.7GB/120min AccuCORE. Apparently this is a bad idea to check "Verify written data", this leads to the following error:


Anyway using this DVD, just go back to your MacMiniG4, reboot, press the Option key during reboot, wait ... and finally it should display a cute pinguin logo, next to the mac hard drive.

Conclusion:
- CDROM does NOT work (I tried sarge 31r8, lenny 504, lenny 505 on different cd-r and cd-rw)
- I could never get USB to boot

Solution: just get the dvd iso, toat it, it works !

Warning: during installation I choose "use LVM on whole disk", when you press next you should get:

No NewWorld boot partition was found. The yaboot boot loader requires an Apple_Bootstrap 
partition of at least 819200 bytes in size, using the HFS Macintosh file system.

Simply ignore this message (press 'No').

I could also find this problem on another post:

http://www.macfreek.nl/mindmaster/Debian_on_PowerBookG4

It seems this guy, also had issue booting from a cdrom / usb !

References to the whole story:
- http://lists.debian.org/debian-powerpc/2010/07/msg00097.html
- http://malatsblog.blogspot.com/2010/07/preparing-bootable-debian-installer-cd.html

Friday, July 30, 2010

Still struggling with cmake/git

  cd CMake
  git checkout master
  git pull
  git checkout -b fix-issue-9611
  cp ~/tmp/cmake-2.8.2/Modules/FindJNI.cmake Modules/FindJNI.cmake
  git add --  Modules/FindJNI.cmake
  git commit -m"BUG: 0009611 Fix Arch independent FindJNI.cmake on Linux to support Sun Java, OpenJDK, Kaffe and GCJ paths. Based on patch from debian"
  git checkout -b next origin/next
  git checkout next
  git pull
  git merge  fix-issue-9611
  git push
Counting objects: 15, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 1.58 KiB, done.
Total 8 (delta 6), reused 0 (delta 0)
----------------------------------------------------------------------
commit 6a3d7d46 has an invalid message:
  the first line must not be more than 78 characters
commit message is:
BUG: 0009611 Fix Arch independent FindJNI.cmake on Linux to support Sun Java, OpenJDK, Kaffe and GCJ paths. Based on patch from debian
----------------------------------------------------------------------
error: hook declined to update refs/heads/next
To git@cmake.org:cmake.git
 ! [remote rejected] next -> next (hook declined)
error: failed to push some refs to 'git@cmake.org:cmake.git'

Tuesday, July 27, 2010

Preparing bootable debian-installer CD for MacMini/PPC

Here is a follow up on my quest to get a proper bootable CD of debian-installer for my PPC MacMini.



$ wodim  -eject -v speed=2 -data -pad  ./debian-505-powerpc-netinst.iso
wodim: No write mode specified.
wodim: Asuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits.Device was not specified. Trying to find an appropriate drive...
Looking for a CD-R drive to store 199.59 MiB...
Detected CD-R drive: /dev/cdrw
Using /dev/cdrom of unknown capabilities
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.9
Driveropts: 'burnfree'
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   :
Vendor_info    : 'HL-DT-ST'
Identification : 'DVD+-RW GH30N   '
Revision       : 'A102'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0009 (CD-R)
Profile: 0x0012 (DVD-RAM)
Profile: 0x002B (DVD+R/DL)
Profile: 0x001B (DVD+R)
Profile: 0x001A (DVD+RW)
Profile: 0x0015 (DVD-R/DL sequential recording)
Profile: 0x0014 (DVD-RW sequential recording)
Profile: 0x0013 (DVD-RW restricted overwrite)
Profile: 0x0011 (DVD-R sequential recording)
Profile: 0x0010 (DVD-ROM)
Profile: 0x000A (CD-RW)
Profile: 0x0009 (CD-R) (current)
Profile: 0x0008 (CD-ROM)
Profile: 0x0002 (Removable disk)
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Drive buf size : 1114112 = 1088 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
Drive DMA Speed: 126494 kB/s 718x CD 91x DVD
FIFO size      : 12582912 = 12288 KB
Track 01: data   199 MB         padsize:   30 KB
Total size:      229 MB (22:42.73) = 102205 sectors
Lout start:      229 MB (22:44/55) = 102205 sectors
Current Secsize: 2048
ATIP info from disk:
  Indicated writing power: 4
  Is not unrestricted
  Is not erasable
  Disk sub type: Medium Type A, low Beta category (A-) (2)
  ATIP start of lead in:  -12508 (97:15/17)
  ATIP start of lead out: 359845 (79:59/70)
Disk type:    Short strategy type (Phthalocyanine or similar)
Manuf. index: 22
Manufacturer: Ritek Co.
Blocks total: 359845 Blocks current: 359845 Blocks remaining: 257640
Speed set to 2822 KB/s
Starting to write CD/DVD at speed  16.0 in real TAO mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01:  199 of  199 MB written (fifo 100%) [buf  91%]  16.8x.
Track 01: writing  30 KB of pad data.
Track 01: Total bytes read/written: 209281024/209311744 (102203 sectors).
Writing  time:   94.845s
Average write speed  14.4x.
Min drive buffer fill was 90%
Fixating...
Fixating time:   18.573s
wodim: fifo had 3297 puts and 3297 gets.
wodim: fifo was 0 times empty and 3069 times full, min fill was 95%.

Let's try checking the iso was burned ok:

$ cmp /dev/cdrom debian-505-powerpc-netinst.iso
cmp: EOF on debian-505-powerpc-netinst.iso

I followed instructions from:
http://www.debian.org/CD/faq/#record-unix

Still no luck using:
- C reboot solution
- Option solution
- Command+Option+o+f solution

Friday, July 23, 2010

API Sanity Autotest

I just discover today a neet tool to detect API/ABI change in shared C/C++ libraries:

http://ispras.linux-foundation.org/index.php/API_Sanity_Autotest

This is used at:

http://linuxtesting.org/upstream-tracker/

I think I need to compare that to the other one I had in mind:

http://ispras.linux-foundation.org/index.php/ABI_compliance_checker