Archive for the 'Gentoo' Category

Updates for Ruby

So, portage must really be behind the updates or someone in charge of ruby is slacking. As of now, portage only recognizes =dev-lang/ruby-1.8.7-p174, which the file doesn’t exist in any repository. What does exist however is =dev-lang/ruby-1.8.7-p249. The downfall is that it relies on =app-admin/eselect-ruby-20091225 which… doesn’t exist. You have to love updates!!

For convenience, I just added both into the /usr/local/portage tree, and digested these. Hopefully in the next day or two this problem will be fixed.

http://www.gentoo-portage.com/dev-lang/ruby

http://www.gentoo-portage.com/app-admin/eselect-ruby

Samba is a Pain!

Well, today on the update of world, I got the great circular error of dependencies on net-fs/samba and net-fs/samba-libs. I am not sure what is going on upstream, but all of the kde 4.4.1 packages are really having problems with particular versions of samba, and the libs were fighting me on the versions as well. The only solution I had was to unmask =net-fs/samba-3.5.0 and pull that one manually (with –oneshot) and then pull =net-fs/samba-libs-3.4.5 (with –oneshot). After that, world updated with no problems. It was simple enough yet it was just a pain in the ass.

iPhone 3.x Sync’ed in Linux (Full Gentoo Guide)

Okay, so This is the third (and hopefully final) walkthrough for getting your iPhone to sync with Gentoo and now I am incorporating file transfer and music management. The process is actually very simple, but you should make sure to follow all of the steps. I encountered some problems along the way as well; I received an error from one of the commands that used in other walkthroughs “Couldn’t read xml sysinfo from uuid.” I simply fixed it by “READING” all of the steps properly and everything worked, so if you don’t read, you won’t get it!

Even though I have thanked him once before, thanks again to Marcan and his blog. His hard work has made this possible. I recommend reading his walkthrough to get a better understanding of everything. This walkthrough is a similar walkthrough to his, but targets Gentoo. As stated in all other walkthroughs, you do not need to jailbreak your phone, but I recommend it, makes everything easier. I nor any developer or provider is responsible for any damages that you cause by following our walkthroughs, so, if you brick, it is on you. Lastly, your iPhone should have already been plugged into iTunes and received a song at least once.

The way I did it might not be the way it SHOULD be done, but it did work. If you know of a better way, please bring it to light.

First, you will need the Rion overlay like I wrote in earlier posts.

# emerge -va layman
# layman -a rion
# layman -S
# echo `PORTDIR_OVERLAY="/usr/local/portage/layman/rion"` >> /etc/make.conf
# env-update
# eix-update

Next, you will need to emerge a few needed packages. I found that the libgpod package in portage isn’t going to work, so will have to manually install that one from the sourceforge project page. In the mean time, I will try writing an ebuild for it so that it can be emerged. (I emerged it, an then built new one over it) Additionally, the versions that you have will also matter, but the 9999 versions mostly don’t work yet, so a couple of entries into your package.keywords and package.use will be necessary. Also, before emerging any of this, I would recommend adding “ipod” you your USE flags in your /etc/make.conf file.

# echo "dev-libs/libusb debug doc" >> /etc/portage/package.use
# echo "media-libs/libgpod gtk hal python test" >> /etc/portage/package.use
# echo "dev-util/gtk-doc debug doc" >> /etc/portage/package.use

# echo "=app-pda/libplist-9999" >> /etc/portage/package.mask
# echo "=app-pda/libiphone-9999" >> /etc/portage/package.mask
# echo "=app-pda/ifuse-9999" >> /etc/portage/package.mask
# echo "dev-libs/libusb **" >> /etc/portage/package.keywords
# echo "app-pda/ifuse **" >> /etc/portage/package.keywords
# echo "app-pda/libplist **" >> /etc/portage/package.keywords
# echo "app-pda/libiphone **" >> /etc/portage/package.keywords
# echo "app-pda/usbmuxd **" >> /etc/portage/package.keywords

# emerge -va libusb libiphone ifuse libplist usbmuxd libgpod gtk-doc gtkpod dev-util/git

Next, you will need to build the custom version of libgpod. If everything is built right on your system, then you should be fine, but if you get any errors, of course you will need to fix them before you continue. You will need git in order to obtain this build from the sourceforge repository. Find a nice location on your drive, and as root, execute the following.

# git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/libgpod
# cd libgpod
# CFLAGS="-g -O0" sh autogen.sh --prefix=/usr
# make
# make install

Now, we have start testing everything out. We need to make sure that your phone is fully connected once you plug it in, and we need to make sure that usbmuxd is detecting your phone. We have to create the usbmux user so that usbmuxd will work properly. You will have to make sure that this user has access to usb and plugdev. I added wheel too, but it isn’t necessary.

# useradd -G usb,plugdev,wheel -s /bin/bash usbmux

Once everything is emerged successfully, you need to test out and make sure that your iphone is being registered when it connects. First you will have to modify the udev rules so that you can see the output. Increase the syslog debug level by editing “/lib/udev/rules.d/85-usbmuxd.rules” and adding “-v -v” flags to the end of both RUN statements. Now you can run the following and see if usbmuxd is seeing your iphone.

Jan  9 12:43:24 ghost kernel: [139025.359653] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004
Jan  9 12:43:24 ghost kernel: [139025.359663] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001403 POWER sig=k CSC CONNECT
Jan  9 12:43:24 ghost kernel: [139025.359670] hub 2-0:1.0: port 2, status 0501, change 0001, 480 Mb/s
Jan  9 12:43:24 ghost kernel: [139025.385242] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001002 POWER sig=se0 CSC
Jan  9 12:43:24 ghost kernel: [139025.463060] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT
Jan  9 12:43:24 ghost kernel: [139025.567304] hub 2-0:1.0: debounce: port 2: total 200ms stable 100ms status 0x501
Jan  9 12:43:24 ghost kernel: [139025.618227] ehci_hcd 0000:00:1d.7: port 2 high speed
Jan  9 12:43:24 ghost kernel: [139025.618232] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT
Jan  9 12:43:24 ghost kernel: [139025.669065] usb 2-2: new high speed USB device using ehci_hcd and address 14
Jan  9 12:43:24 ghost kernel: [139025.720353] ehci_hcd 0000:00:1d.7: port 2 high speed
Jan  9 12:43:24 ghost kernel: [139025.720358] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT
Jan  9 12:43:24 ghost kernel: [139025.785527] usb 2-2: skipped 3 descriptors after interface
Jan  9 12:43:24 ghost kernel: [139025.785530] usb 2-2: skipped 2 descriptors after interface
Jan  9 12:43:24 ghost kernel: [139025.785533] usb 2-2: skipped 1 descriptor after endpoint
Jan  9 12:43:24 ghost kernel: [139025.785535] usb 2-2: skipped 1 descriptor after interface
Jan  9 12:43:24 ghost kernel: [139025.788140] usb 2-2: default language 0x0409
Jan  9 12:43:24 ghost kernel: [139025.789388] usb 2-2: udev 14, busnum 2, minor = 141
Jan  9 12:43:24 ghost kernel: [139025.789391] usb 2-2: New USB device found, idVendor=05ac, idProduct=1292
Jan  9 12:43:24 ghost kernel: [139025.789393] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan  9 12:43:24 ghost kernel: [139025.789395] usb 2-2: Product: iPhone
Jan  9 12:43:24 ghost kernel: [139025.789397] usb 2-2: Manufacturer: Apple Inc.
Jan  9 12:43:24 ghost kernel: [139025.789399] usb 2-2: SerialNumber: 69a4294a91a56958927f3fafe0086bf90ccd2d2b
Jan  9 12:43:24 ghost kernel: [139025.789469] usb 2-2: uevent
Jan  9 12:43:24 ghost kernel: [139025.789486] usb 2-2: usb_probe_device
Jan  9 12:43:24 ghost kernel: [139025.789489] usb 2-2: configuration #1 chosen from 4 choices
Jan  9 12:43:24 ghost kernel: [139025.791263] usb 2-2: adding 2-2:1.0 (config #1, interface 0)
Jan  9 12:43:24 ghost kernel: [139025.791282] usb 2-2:1.0: uevent
Jan  9 12:43:24 ghost kernel: [139025.791351] drivers/usb/core/inode.c: creating file '014'
Jan  9 12:43:24 ghost kernel: [139025.791371] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004
Jan  9 12:43:24 ghost kernel: [139025.791385] usb 2-2: usb_disable_device nuking non-ep0 URBs
Jan  9 12:43:24 ghost kernel: [139025.791388] usb 2-2: unregistering interface 2-2:1.0
Jan  9 12:43:24 ghost kernel: [139025.791434] usb 2-2:1.0: uevent
Jan  9 12:43:24 ghost kernel: [139025.793892] usb 2-2: adding 2-2:4.0 (config #4, interface 0)
Jan  9 12:43:24 ghost kernel: [139025.793929] usb 2-2:4.0: uevent
Jan  9 12:43:24 ghost kernel: [139025.793989] usb 2-2: adding 2-2:4.1 (config #4, interface 1)
Jan  9 12:43:24 ghost kernel: [139025.794005] usb 2-2:4.1: uevent
Jan  9 12:43:24 ghost kernel: [139025.794035] usb 2-2: adding 2-2:4.2 (config #4, interface 2)
Jan  9 12:43:24 ghost kernel: [139025.794053] usb 2-2:4.2: uevent
Jan  9 12:43:24 ghost kernel: [139025.811303] usb 2-2: uevent

Now it is time to mount the device, create some required folders, and get your UUID. Since you now have ifuse, you can easily mount your device, but in order to do this, it is required to be in a specific location. Additionally, if you want your users (not root) to also have ifuse privileges, you will need to edit the config files to do that.

# echo "user_allow_other" >> /etc/fuse.conf
# mkdir /mnt/ipod
# chmod 777 /mnt/ipod
# ifuse /mnt/ipod
# mkdir /mnt/ipod/iTunes_Control/Device

Now obtain your UUID either from the logs, or by running…

# lsusb -v | grep -i iSerial

Your UUID is a long hexadecimal string that is roughly 40 characters long. In the longs above, mine is 69a4294a91a56958927f3fafe0086bf90ccd2d2b. Now, lets generate the XML file for your phone, simply run…

ipod-read-sysinfo-extended YOUR_UUID /mnt/ipod

This will create the file iTunes_Control/Device/SysInfoExtended file. Make sure there is stuff in it, and it is not empty. It should be a large XML file with a bunch of info.

If there were no errors, then you are good to go. You can now sync up with linux and transfer music. In the future, when you plug your device in, you simply need to run…

$ ifuse /mnt/ipod

I have been using GTKPod to transfer my music over to the device, however, it should work with other applications like RhythmBox or Amarok. I haven’t tried them out yet, but I would be interested to see if anyone gets that working.

gtkpod gtkpod-xfer-status

iPhone 3G(s) 3.1.2 Sync’ed in Gentoo

Yep, that’s right.  Sync’ed, finally.  It took a little work, and thanks to Marcan and his team of helpers, this can finally be done. The following guide is for gentoo users, but can be tailored to work for any linux OS. I successfully got Rhythmbox and Amarok to play all of the music from my iPhone.

Step 1: First, you need add the Rion overlay from layman.

# emerge -va layman
# layman -a rion
# layman -S
# echo `PORTDIR_OVERLAY="/usr/local/portage/layman/rion"` >> /etc/make.conf
# env-update
# eix-update

(if you have a PORTDIR_OVERLAY line already, then just add it manually with your favorite editor)

Step 2: You will need to emerge a couple of packages, if you have them installed, it is best to remove them first, then emerge the new ones.

# emerge -C libusb usbmuxd libplist libiphone ifuse

You will need the following packages in order for this to work right. Note that the version DOES matter. If you have older versions, they need to go, but same or later versions are good.

  • 1. dev-libs/libusb-1.0.5
  • virtual/libusb-1
  • 2. app-pda/ifuse-0.9.4
  • 3. app-pda/libplist-0.16
  • 4. app-pda/libiphone-0.9.4
  • 5. app-pda/usbmuxd-1.0.0_rc2

The 9999 packages of any of these really didn’t work for me, so I suggest masking them out.

# echo "=app-pda/libplist-9999" >> /etc/portage/package.mask
# echo "=app-pda/libiphone-9999" >> /etc/portage/package.mask
# echo "=app-pda/ifuse-9999" >> /etc/portage/package.mask
# echo "dev-libs/libusb **" >> /etc/portage/package.keywords
# echo "app-pda/ifuse **" >> /etc/portage/package.keywords
# echo "app-pda/libplist **" >> /etc/portage/package.keywords
# echo "app-pda/libiphone **" >> /etc/portage/package.keywords
# echo "app-pda/usbmuxd **" >> /etc/portage/package.keywords
# emerge -va libusb libiphone ifuse libplist usbmuxd libgpod

Additionally, I would make sure that amarok and/or rhythmbox are built with ipod support (USE=”ipod”). Just add the ‘ipod’ use flag to your USE line in /etc/make.conf.

Now, we have to create the usbmux user so that usbmuxd will work properly. You will have to make sure that this user has access to usb and plugdev. I added wheel too, but it isn’t necessary.

# useradd -G usb,plugdev,wheel -s /bin/bash usbmux

Once everything is emerged successfully, you need to test out and make sure that your iphone is being registered when it connects. First you will have to modify the udev rules so that you can see the output. Increase the syslog debug level by editing “/lib/udev/rules.d/85-usbmuxd.rules” and adding “-v -v” flags to the end of both RUN statements. Now you can run the following and see if usbmuxd is seeing your iphone.

# tail -f /var/log/messages
Dec 12 11:39:27 ghost kernel: [450381.899021] usb 2-4: New USB device found, idVendor=05ac, idProduct=1292
Dec 12 11:39:27 ghost kernel: [450381.899024] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 12 11:39:27 ghost kernel: [450381.899026] usb 2-4: Product: iPhone
Dec 12 11:39:27 ghost kernel: [450381.899028] usb 2-4: Manufacturer: Apple Inc.
Dec 12 11:39:27 ghost kernel: [450381.899030] usb 2-4: SerialNumber: 69a4294a91a56958927f3fafe0086bf90ccd2d2b
Dec 12 11:39:27 ghost kernel: [450381.899134] usb 2-4: usb_probe_device
Dec 12 11:39:27 ghost kernel: [450381.899137] usb 2-4: configuration #1 chosen from 4 choices
Dec 12 11:39:27 ghost kernel: [450381.900385] usb 2-4: adding 2-4:1.0 (config #1, interface 0)
Dec 12 11:39:27 ghost kernel: [450381.900413] usb 2-4:1.0: uevent
Dec 12 11:39:27 ghost kernel: [450381.900485] drivers/usb/core/inode.c: creating file '012'
Dec 12 11:39:27 ghost kernel: [450381.900505] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0010
Dec 12 11:39:27 ghost kernel: [450381.905696] usb 2-4: usb_disable_device nuking non-ep0 URBs
Dec 12 11:39:27 ghost kernel: [450381.905701] usb 2-4: unregistering interface 2-4:1.0
Dec 12 11:39:27 ghost kernel: [450381.905782] usb 2-4:1.0: uevent

If you are seeing your phone come up, then everything was done right. The last thing to do is mount the phone. simply use ifuse, and mount it to a specified mount point.

# ifuse /mnt/to/location

Again, you can now browse the entire filing system, and when you import the music, it should convert so that it isn’t in the hashed/encrypted form. Rhythmbox even got the album art.

I am working on how to copy music to the iphone now, so if anyone got that down, please let me know.