Letzte Einträge »

This is a how to install Gentoo on a brand new Apple Mac Mini Server 2,1. It turned out to be a bit tricky (in fact i wasted 5 days). So if you want to follow my guide, you should already be experienced with linux. I still provide a step by step tutorial. But please READ ALL THE MENTIONED DOCS first, before you start! How to read the following text:

# italic is a command line you enter in a terminal
italic is a line you add to a config file

blockquote is a config file

Well, to install an unencrypted linux on the Mac Mini was easy, but i wanted to install an RAID 1 with DM-CRYPT and LVM2 on the 500gb disks.

-1.) Howto install a regular Gentoo on a Mini
Now if you don’t need RAID, encryption and the logical volume manager, then its quite simple to install Gentoo. Just
- Install rEFIt
- Boot Live CD and install Gentoo according to the manual.
- Use LILO instead of GRUB and reboot.

0.) Now lets start with the tricky part.
But to add all the other features to the mac mini installation was not that simple. More or less we work with the three following HOWTOS

[1] The Gentoo Handbook
[2] HOWTO for LVM2, RAID, DM-Crypt
[3] HOWTO for GRUB2

And i will just refer to them as [1],[2],[3]. Something like „[1] / 10.b. Default: Using GRUB“ refers to the section of document 1 ;) Again: Read them first and my article before you start anything. Also you should read the rEFIt documentation and all man pages of unknown commands.

1.) Preparing EFI
Apple does not use a regular BIOS, but an Extensible Firmware Interface (EFI). That means we have to tell the EFI, to boot other OS as well.

Boot your Mac Mini, download rEFIt from their website, open the .dmg file and install rEFIt.mpkg. Now you can switch between your OS when pressing „ALT“ (on a windows keyboard) before starting the mac.

2.) Booting from a Live CD
Welcome to the first problem: The Mac Mini (4,1) , Mac Mini Server (2,1) and the new Mac Book Pros (Generation 8 ) use the nVidia MCP89 SATA Chip. It is not really supported by the kernel [UPDATE: SINCE 2.6.37 A PATCH FOR EHCI USB HOST IS PROVIDED, THERE IS NO NEED TO APPLY THE PATCH ANY MORE], so if you boot e.g. a regular Gentoo Install CD (or Debian), then you won’t find any drives or harddisks at all. A workaround is provided by Kernel >=2.6.36. Also Ubuntu 10.10 patched their 2.6.35 kernel to find this chip. Thats the Live CD i used.

Get the Ubuntu 10.10 Live CD from here. Boot your Mac while pressing „ALT“, in rEFIt choose „Windows CD“ (yeah ;) ). Don’t just hit enter to boot Ubuntu, you’ll end at a black screen. Instead, in the first menu hit F6, activate „nomodeset“ and then boot up Ubuntu.

3.) Installing additional things & stuff
Perhaps you want to change your keyboard first, but i’ll stick with the necessary informations: Ubuntu does not know LVM2 and RAID, but thats what we need for [2]. Open a terminal and install

# sudo apt-get install lvm2 mdadm

Now lets deal with the Hard Disks. Apple uses Guid Partition Table (GPT), i just have Gentoo running on the hard disks, no boot option for Mac OS X any more. So there was no need to keep any GPT signatures. I later deleted the 200MB EFI partitions as well.

# sudo parted /dev/sda and mklabel msdos

repeat for the second hard disk:

# sudo parted /dev/sdb and mklabel msdos

4.) Follow instructions
Until you have entered the chroot environment, don’t forget to use sudo, if you stick to my way (booting from Ubuntu). In case you are booting from any other cd and got a real root account, then of course you don’t need sudo.

After using parted, you can can just follow instructions from the HOWTOs. Start with [2] / Partitions till you have reached the Point [2] / Installation. Then you continue with [1] / 4.d. Don’t forget to activate the swap partition after making file systems!

# sudo swapon /dev/mapper/vg-swap

Mount all your partitions, unpack the stage3 file, portage tree, until you reach [1] / 7.b.

5.) Kernel configuration
You need at least a Kernel >= 2.6.36, get it from here. Keep in mind, you’re still in the chroot environment:

# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2
# tar xvjf linux-2.6.36.tar.bz2
# ln -s linux-2.6.36 linux
# cd /usr/src/linux
# make menuconfig

[2] / Installation tells you, that you need the Device Drivers + Crypt Support. But as you have no PS2 Keyboard, you also need USB + FULL HID installed, otherwise you have no chance to enter you password. Yeah, that happened to me… ;)

Device Drivers —> Multiple device drivers -> Device mapper support
Device Drivers —> Multiple device drivers -> Crypt target suport
Cryptographic API —>
Device Drivers —> HID Devices -> full HID support
Device Drivers —> USB support -> EHCI HCD (USB 2.0)
Device Drivers —> USB support -> OHCI
Device Drivers —> USB support -> UHCI

Yes, i got all three activated. When i got some time, i will update this howto and provide a minimal kernel config for the mac mini server.

# make && make modules_install
# cp arch/i386/boot/bzImage /boot/kernel-2.6.36

6.) Follow [1] until [1] / 10
Until you got to the point of installing a boot loader. If you really stick to the partition scheme from [2] you use this /etc/fstab:

/dev/md1 /boot ext3 noauto,noatime 1 2
/dev/mapper/vg-root / ext3 noatime 0 1
/dev/mapper/vg-swap none swap sw 0 0
/dev/mapper/vg-home /home ext3 defaults 0 2
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
proc /proc proc defaults 0 0

7.) Install Bootloader
Now it gets a bit tricky: Because GRUB does not know how to handle EFI, LiLo is easy to configure as long as you don’t use RAIDS, LVM and DM-Crypt. So we have to install GRUB2 and more or less continue with [3]. For now just tell /etc/portage/package.keyword to install grub-1.98 (don’t get confused, thats Grub2). Grub2 doesn’t like premounted /boot partitions. So we leave chroot, umount /mnt/gentoo/boot, reenter chroot and mount it from there:

# exit
# sudo umount /mnt/gentoo/boot
# sudo chroot /mnt/gentoo /bin/bash
# env-update && source /etc/profile
# mount /boot

Furthermore Grub2 can’t really handle LVM volumes, so we have to patch it. Get the PATCH

# cp lvm-detection.patch /usr/portage/sys-boot/grub/files

Tell the ebuild to use the patch file:

# nano /usr/portage/sys-boot/grub/grub.198 ebuild

add the following line to the src_unpack section

epatch „${FILESDIR}“/lvm-detection.patch

then tell portage not to complain about the new file size

# ebuild /usr/portage/sys-boot/grub/grub-1.98.ebuild manifest

now finally install grub2:

# emerge -vat grub

8.) Create Initrd before installing grub
Follow [2] / Packages to create the initramfs. But there is one important modification:
/dev/mapper/vg-root is only a symlink to ../dm-1. If you just use the line from the HOWTO

cp -a /dev/console /dev/sda2 /dev/sdb2 /dev/null /dev/urandom dev

you end with an unbootable initramfs (sth. like „cannot open / create device node“). To avoid this, use

cp -a /dev/console /dev/sda2 /dev/sdb2 /dev/null /dev/urandom /dev/dm-* dev

instead! Then you can continue according to [2] and create the initramfs.

9.) Configuring Grub2
Thats where i became a bit lazy and tired of rebooting and rebooting all the time, so this is a quick and dirty work around, not really clean. First

# grub-mkconfig -o /boot/grub/grub.cfg

Then edit /boot/grub/grub.cfg

# nano /boot/grub/grub.cfg

(YES, i can READ: „DO NOT EDIT THIS FILE“ -> it just means, you have to do this step every time you reconfigure grub2. Any helpful comment for a clean and neat solution is appreciated!).

and scroll till you find

linux /kernel.2.6.36 root=/dev/mapper/vg-root ro

below (but within the {} ) add:

initrd /initramfs

Now we install grub on both MBR (in case one of the disks fails we can still boot the raid from the second one:

# grub-install /dev/sda
# grub-install /dev/sdb

10.) Thats it!
Just leave the Chroot, umount everything and reboot. Don’t forget to hit „ALT“ for rEFIt – then hit ENTER on any of the two partitions. Wait a bit, enter you password and then enjoy your new system. ;)

11.) Helpful commands & advices
If you screw anything up and you have to reenter the Chroot enviroment:

Press ALT, boot Ubuntu Live CD (nomodeset), then

# sudo apt-get install lvm2 mdadm
# sudo mdadm –assemble /dev/md1 /dev/sda1 /dev/sdb1
# sudo mdadm –assemble /dev/md2 /dev/sda2 /dev/sdb2
# sudo cryptsetup luksOpen /dev/md2 vault
# sudo vgchange -ay vg
# sudo mkdir /mnt/gentoo
# sudo mount /dev/mapper/vg-root /mnt/gentoo
# sudo mount /dev/mapper/vg-home /mnt/gentoo/home
# sudo swapon /dev/mapper/vg-swap
# sudo mount -t proc none /mnt/gentoo/proc
# sudo mount -o bind /dev /mnt/gentoo/dev
# sudo chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
# mount /boot

Also if anything goes wrong during the boot process, it helps to slow down the init file in the initramfs by adding a sleep 10 after every line.

So far so good, hope i was able to give something back to the linux community.

c7temp module

Friday night it took me several hours to get lm_sensors to work. Somehow Genkernel didn’t compile my modules the way i needed them, so i started to configure everything with make menuconfig && make. But thats another story…

My Hardware:Commell 66AD Mainboard, Via C7 1.5Ghz
Distribution: Gentoo x86.
Kernel: 2.6.27.5

Of course you don’t have to use the same kernel version as i did, but according to Debian Bug List, you need some Kernel >=2.6.24 !!!

Step by step tutorial:
1.) Install lm_sensors, emerge -vat lm_sensors.
2.) Run sensors-detect and let sensor-detect write the config file.
3.) Get the kernel source: wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.5.tar.bz2
and copy it to /usr/src/
4.) Unpack it tar xfvj linux-2.6.27.5.tar.bz2
5.) Link /usr/src/linux to your kernel version, ln -s /usr/src/linux-2.6.27.5 linux
6.) Download C7Temp Kernel Patch and copy it to /usr/src/linux .
7.) Patch the Kernel: cd /usr/src/linux/ && patch -p1 < attachment.bin
8.) Configure Kernel: make menuconfig
9.) You need I2C and Hardware Monitoring support: (Device Drivers —> I2C / Device Drivers —> Hardware Monitoring support), compile them as modules, in DD—>HMs —> check „VIA C7 temperature sensor“ – that gives you the wanted c7temp kernel module
10.) Compile your Kernel make… ;)
11.) Update modules: update-modules
12.) Start /etc/init.d/lm_sensors, and if that worked, add it to Runlevel rc-update add lm_sensors default

If you want to patch your existing kernel, start with 6, and instead of recompiling the whole kernel in 10 just run make modules && make modules_install.

More to read:Lm_Sensors Mailing List

Via C7 Cflags

Just when i decided to move my Linux Computers from Debian back 2 Gentoo, the most helpful site – Gentoo – Wiki – is unavailable. If someone would be so kind and could tell me CFLAGS for VIA C7 cpus? That would be really helpful!

Furthermore i am actually redesigning my backup concept due to what happened to G-W.

UPDATE:
I found a copy of Gentoo-Wikis CFLAGS List at downpour.egloos.com. Problem solved…

CHOST=“i686-pc-linux-gnu“CFLAGS=“-march=i686 -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer“CXXFLAGS=“${CFLAGS}“

iPod Touch Jailbreak 2.0.2 Tutorial

Tested with:
Windows XP / SP3 and iTunes (Version 7.7.1.11)
iPod Touch (doh! ;) ) with 32GB and 1.1.5 Firmware

The follwing article describes how to install the 2.0.2 Firmware on an iPod Touch and jailbreak it.

Foreword
I experienced several problems jailbreaking the 1.1.4. Firmware (maybe because i got the 32GB iPod Touch?), the actual process of jailbreaking worked fine with ZiPhone, but about 1h-2days later the cracked firmware froze. It didn’t really freeze, in fact it always refreshed the Home Screen, and there was no chance to get rid of that bug. So this time, i wanted to jailbreak the newest 2.0 Firmware, and one result is this Step by Step Tutorial. None the less, you should only continue if you really know what you are going to do. That means, you should know the meaning of the word „iPod“, errr … „Jailbreak“, and i expect you to read the README files and documentions. Thats the most important thing if something is going wrong – precise informations on what happend. No one will care if you’re just asking „my iPod is broken, plz heeeeelp me!!!!111!!!!!ONE!!!!“. You should know how to restore another firmware (explained later on), put your iPod in recovery mode (press down Home Button, connect it then to your computer), etc. Try to solve your problems, even if you didn’t succeed, you gained knowledge.

I know that i am not the first to write a tutorial about that topic, but i did it for a very simple reason. I experienced some difficulties and when i was finished with the research, downloading the software, etc. i had about 20-30 tabs in my firefox, as most of the existing tutorials only partly provided informations and some important facts where missing (like i had to figure out the „restore/update“ trick, wasn’t mentioned on the sites i googled). That doesn’t mean there where no usefull informations available, but they where scattered all over the web.

For the impatient: Read at least the whole tutorial, before spamming the net with your problems ;)

If you are not sure, what jailbreaking is, why you probably want to do it, Bigboss wrote an article, read it!

Last but not least: This worked fine for me, but i don’t take any responsibility if you bricked your iPod Touch!

Download the Software you need:
- Download iTunes from Apple – Version should be >=7.7 .
- Download Quick PwnRC3 for the Jailbreak.
-Then get the Firmware from here: Download. Select the iPod1,1 (2.0.2/5C1) Firmware Version.

All links worked fine when i wrote the Tutorial. If some links are broken when you read this, please tell me, and i try to update them or provide the software/fw for you.

Then install iTunes and unpack QuickPwn, try to remember the folder where you downloaded the Firmware ;)

Update your iPod
QuickPwn is not designed to update your device to a newer firmware version. Therefore we have to do it manually, before we jailbreak it. Connect your iPod Touch to your PC and run iTunes, then select your iPod in the Category „Devices“. And now comes the tricky part – you actually don’t have to upgrade your firmware to 2.0.2, you have to restore it.

Hold down the Shift Key and press „Restore“. A window pops up and you can select the firmware you want to restore. Now browse for the Ipod1,1_2.0.2_5C1_Restore.ipsw file and open it. Get a cup of coffee, as it takes about 10 minutes to install the 2.0.2 firmware.

When i tried that the first time, i encountered the following error. About 1-2 Minutes after starting the Firmware update i got the message: „The iPod could not be updated. An unknown error occurred (6).“. Then i figured out, that the real trick is not to „Update“ the Software, but to Shift+“Restore“ it. So if you get that error, its most likely, that you clicked on the „Update“, not the „Restore“ Button. ;)

Jailbreak the restored firmware
So we managed to update/restore the new firmware, lets jailbreak it now with the following steps:

-Disconnect your iPod from your computer again.
-Run QuickPwn:
– Select the iPod Touch on the first screen
– Browse for the Firmware you want to jailbreak (v2.0.2), basically select the same firmware you running on your iPod.
– Check „Add Cydia“ and „Add Installer“ (but you can also only just install Cydia or the Installer.app, for informations read „Post-Install“)
– Connect your iPod to your computer
– Follow orders on the next screen – after pressing the Home/Power Button Combinations according to QuickPwn, your iPod will be recognised as a new hardware in „DFU Mode“.
– Wait till QuickPwn does the rest, then the iPod Device reboots as a new jailbreaked version.

Post-Install
First of all configure your Wifi. I prefered to install both Cydia and the Installer, but after playing around with it, it looks like i’m going to uninstall „Installer“ and just use Cydia. If you want to get more informations, read here:

Installing Cydia (an alternative to Installer)
Bringing Debian Apt to the iPhone
Cydia 2.0 vs Installer 4.0
Conclusion: „Whether your preference is the new Installer 4.0 or Cydia, rest assured they will both play nicely together. Some developers will only package their apps in an Installer repository, and some will only put theirs in Cydia, and of course some will publish to both. No matter what the developer’s preference you will be able to run Cydia, Installer, and AppStore all on your iPhone with no problems.“

And last but not least a list of Sources for Cydia and the Installer:

Cydia
BigBoss & Planet-iPhones – http://apt.bigboss.us.com/repofiles/cydia/
Hack&Dev.org – http://iphone.hackndev.org/apt/
iFonetec – http://app.ifonetec.com/cydia/
Free Coder – http://iphone.freecoder.org/apt/
ModMyiFone – http://modmyifone.com/repo/
Ste – http://repo.smxy.org/cydia/apt/
Telesphoreo Tangelo – http://apt.saurik.com/
Urban Fanatics – http://urbanfanatics.com/cydia/
ZodTTD – http://zodttd.com/repo/cydia/
Intelliborn – http://intelliborn.com/cydia

Installer 4
RiP Dev – http://i.ripdev.com/
BigBoss’s Apps and Things. – http://apptapp.thebigboss.org/repofiles/installer4/
iSpazio Official – http://repo.neolinus.org/ispazio/
Ste Packaging – http://repo.smxy.org/installer4/
andyman repo – http://repo.gafoogle.com [CURRENTLY DOWN]
iModZone – http://imodzone.net/repo/ [CURRENTLY DOWN]
ClubiFone – http://www.clubifone.com/repo/
iPhone-notes.de – http://sendowski.de/iphone/

Copied from here.

If you are using OpenSSH, don’t forget to change the password, otherwise everyone with knowledge of the original root password („alpine“ on 1.1.4. to 2.0.2.) can hack your iPod, read your data and do harm to it. Install „MobileTerminal“, open it, su, enter „alpine“. Then passwd $NEWPASSWORD. Done.

Hope that this helped you guys & girls out there :)

This had been tested with
Debian Etch
Gnome 2.14.3
Amarok 1.4.4. (Using KDE 3.5.5)

For some reason, i don’t like the whole KDE windowmanager stuff, but prefer to use GNOME instead. However, i think that Amarok is the finest media player out there. I used Amarok (and some other KDE apps) already when i was still running XFCE as window manager, so i decided to stick to it on my Debian workstation. As a proud owner of an iPod (thanks to my sister who will never read this ;) ), i want to sync the iPod with Amarok instead of one of the other apps. GNOME’s own app, „Rythmbox Music player“ syncs the iPod fine, but i had several problems with GTKpod: errors occurred when GTKpod tried to read/write the iPods database -> syncing didn’t work any more.

Install Software
First of all, install Amarok, by running

4life:~# apt-get install amarok

as root. If that worked out fine, plug in your iPod. GNOME detected it automatically on my system, here is some output of my system

4life:~# lsusb
Bus 004 Device 006: ID 05ac:120a Apple, Inc. iPod Nano

and some more:

4life:~# dmesg
usb 4-1: new high speed USB device using ehci_hcd and address 6
usb 4-1: configuration #1 chosen from 2 choices
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 6
usb-storage: waiting for device to settle before scanning
Vendor: Apple Model: iPod Rev: 1.62
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sde: 7999487 512-byte hdwr sectors (4096 MB)
sde: Write Protect is off
sde: Mode Sense: 68 00 00 08
sde: assuming drive cache: write through
SCSI device sde: 7999487 512-byte hdwr sectors (4096 MB)
sde: Write Protect is off
sde: Mode Sense: 68 00 00 08
sde: assuming drive cache: write through
sde: sde1 sde2
sd 2:0:0:0: Attached scsi removable disk sde
usb-storage: device scan complete
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will b e case sensitive!

Don’t care about the UTF warning, i never experienced problems with it. If no errors appeared until now, continue with configuring Amarok:

Configure
Start Amarok, go to

Applications -> Sound & Video -> Amarok

Later the iPod can be found in the Category „Media Device“ (the button down below „Magnatune.com“ ;) ) But first of all, we have to configure Amarok, so that it finds your iPod. Therefore go to

Settings -> Configure Amarok -> Amarok... -> Media Devices

Clicking on the Autodetect Devices shows :

No new media devices were found. If you feel this is an error, ensure that the DBUS and HAL daemons are running and KDE was built with support for them. You can test this by running "dcop kded mediamanager fullList" in a Konsole window.

Running the suggested command as user results only in

user@4life:~$ dcop kded mediamanager fullList
call failed

As root you get more informations

4life:~# dcop kded mediamanager fullList
ERROR: Couldn't attach to DCOP server!

In case you want to use your iPOD under KDE, the DCOP should be up and running and ready to use now. But we have to add it manually, because when using GNOME there is no KDE DCOP server listening in the background. Click on Add Device:

Select the plugin to use with this device:

Choose the Apple iPod Media Device here. Take any name for your Ipod.

Get the Mounting Point of your iPOD, in my case:

4life:~# mount
/dev/sde2 on /media/IPOD type vfat (rw,noexec,nosuid,nodev,quiet,shortname=mixed,uid=1000,gid=1000,umask=077,iocharset=utf8)

Enter that in the last field, click OK. The iPod appears in the Media Devicecategory, if not you have to press Connect.

You are now ready to drag n drop your collection onto the iPod. When finished, don’t forget to press the Disconnect button, otherwise you can’t unmount the iPod. On my system Amarok displays always

Post-disconnect command failed, before removing device, please make sure that it is safe to do so.

but this is irrelevant.

Finetuning
Finally, i don’t want to have Rhythmbox started automatically when i plug in the iPod, so i disabled it here:

Desktop -> Preferences ->Removable Drives and Media
Multimedia -> Portable Music Players

Now uncheck the Play music files when connected. If you want to autostart Amarok, keep it enabled and enter amarok instead of rhythmbox. Doing so also means that your system is putting Amarok in foreground if it is already running when connecting the iPod.

Have fun.

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Follow

Get every new post delivered to your Inbox.