Ticket #80 (new enhancement)

Opened 3 months ago

Last modified 3 months ago

Virtual packages to distinguish between iPhone and iPod Touch

Reported by: Lazarus Long Owned by: saurik
Priority: major Component: Bootstrap
Keywords: virtual package iphone ipod Cc:

Description

In the likes of the "firmware" virtual package, an "iphone" and an "ipod" ones could be created in order to allow other packages being installed to check if they are on the right device.

This way a "Depends:" entry can be used to restrict the installation to a specific device.

Attachments

device.sh (2.1 kB) - added by Lazarus Long 3 months ago.
Virtual package generator

Change History

Changed 3 months ago by Lazarus Long

Virtual package generator

  Changed 3 months ago by Lazarus Long

I've tested and attached a package generator for the above idea.

The only problem I see is that it requires some other packages to be moved to "essential", unless someone knows of another way to get the device type.

It uses "/bin/cat", "/usr/bin/cut" and "/usr/bin/tr" from "coreutils", so no problem here, it uses "/bin/grep" from "grep" and "/usr/sbin/ioreg" from "iokittools" which are not essential packages so there might be a problem here.

follow-up: ↓ 3   Changed 3 months ago by saurik

In general you should not script or in any way attempt to parse ioreg. It isn't at all designed for it: it's a mismash of a few serialization formats, and there is no reason to believe that, even with the same ioreg, a driver or library upgrade won't add a bunch of stuff to it.

Example: you are doing a cut -d '"' -f 40... I'm assuming you are trying to get a key with a specific name from a dictionary here, why do you believe it's always going to be around the 20th entry?

Pretty much anything you want to pull from IOKit can be done with a one-liner of Objective-C, which can then ship with a tiny little binary that links against nothing but IOKit. If this is done, it should be done in this fashion.

in reply to: ↑ 2   Changed 3 months ago by Lazarus Long

Replying to saurik:

As I wrote before "... unless someone knows of another way to get the device type.", it seems you do, so there is another way.

Anyhow that specific key is part of the USB device definition, it has been constant between all firmware versions I checked, from 1.1.1 to 1.1.4, and its sequence is the same for other USB devices that are readable by HAL in Linux (I also checked that), so it seems quite stable.

Of course that your knowledge of the iPhon/iPod Touch is better than mine, so you may have a solution that is more error free, this was just to get things started.

Note: See TracTickets for help on using tickets.