my Geek::Story;

06/12/2013

Debian on the MacBookPro11,1

Filed under: — guedou @ 16:27

A lot of contradictory information are available online concerning Linux and Apple computers. It is indeed quite simple to install Linux on the (late 2013) Mac Book Pro, and there is no need for rEFIt or rEFInd.

This step by step installation guide aims to have both Mac OS X and Debian installed on two separated encrypted partitions. Operating systems will be selected at boot time by pressing alt/option.

1. Resize the Mac OS X partition

In OS X, open “Disk Utility” and resize the “Macintosh HD” partition. A 64GB partition is a good compromise and will leave enough space to use Linux as the primary operating system.

Removing OS X seems to be a bad idea as it will be needed for future firmware updates. To stay on the safe side, do not remove the Recovery partition, as it is really useful if anything goes wrong, and as it is required to activate File Vault.

2. Prepare the USB key

From OS X, download a devel netinst ISO and copy it to an USB key, using the following command.
$ sudo dd if=Downloads/netinst.iso of=/dev/rdisk2

If everything is OK, the USB key should contain two partitions. The second one being an UEFI boot partition (that you can mount as a FAT32 volume).

3. Boot and check if UEFI is activated

Reboot, and press the alt/option key. When the menu appears, choose the USB key. The Debian installer will start, with a really tiny font.

You can check that it boots in UEFI mode by typing:
# dmesg | grep -i efi

If you get a lot of information related to EFI memory mapping, you are good to go.

4. Manual partitioning & installation

The automatic install should work fine, however a manual partitioning is required to get an encrypted Linux partition. Three partitions should be visible:

  1. the OS X EFI partition should be visible as an “EFI boot partition”, later on grub will be installed into that partition;
  2. the Macintosh HD;
  3. the Recovery HD.

First you need to create a partition that will be used as /boot; 128MB is enough to store the kernels. Then you need to create an “encrypted volume” (it takes a while are the disk is being blanked).

Once created, the encrypted volume must be used as a LVM volume. Inside the volume group, at least two logical volume/partitions are required: swap and /root.

The last part of the Debian installation runs perfectly find. A the end, the EFI partition is mounted into /boot/efi and grub installed.

5. Make the system bootable

Debian is installed, however it cannot be booted, as grub must be renamed to a filename that the Mac Book Pro will recognized. This can be done on OS X as follows:
$ mkdir /boot/efi
$ sudo mount -t vfat /dev/disk0s1 /Volumes/EFI
$ sudo su –
# cd /Volumes/EFI
# mv debian BOOT
# mv BOOT/grubx64.efi BOOT/bootx64.efi

6. Enjoy

18/08/2011

18/08/2011

Filed under: — guedou @ 0:00


[Big: 80K] [Small: 124K]

Si toi aussi tu veux installer Windows 98 (avec un CD non bootable) dans Virtual Box, il te faut:
1. copier le cd sur le disque dur à coup de DD et expliquer à la VM qu’il faut utiliser l’ISO
2. télécharger une disquette de FreeDOS (http://jorisvr.nl/freedos.html) et faire booter la VM dessus
3. préparer le disque dur comme à l’époquer avec fdisk et format
4. lancer l’installeur avec e:/install /nm /is /nr /iv
5. une clé de produit valide

17/08/2011

17/08/2011

Filed under: — guedou @ 9:00


[Big: 32K] [Small: 364K]

Dans la série ça peut toujours servir, voici deux petites règles iptables permettant de limiter les connexions vers un démon SSH à 4 connexions par 30 secondes. La liste des hostiles est disponible dans /proc/net/xt_recent/ssh_scanners.

$ iptables -A INPUT -d 1.2.3.4 -p tcp --dport 22 --syn -m recent --set --name ssh_scanners
$ iptables -A INPUT -d 1.2.3.4 -p tcp --dport 22 --syn -m recent --update --seconds 30 --hitcount 4 --name ssh_scanners -j DROP

10/08/2011

10/08/2011

Filed under: — guedou @ 9:00


[Big: 60K] [Small: 60K]

Vive le HDMI audio ! J’ai enfin du son sur ma télé =)
Sur ma Debian squeeze, la sortie HDMI audio ne fonctionne pas et il faut, simplement, mettre le noyau à jour.

Pour mémoire, voici les points importants de la recette:
1- récupérer via apt-get le module nvidia-kernel
2- récupérer les sources du 2.6.35.14
3- copier l’ancien fichier config depuis /boot
4- make menuconfig
5- make-kpkg –initrd -j 4 linux_image modules_image
6- dpkg -i /usr/src/*.deb
7- mettre les lignes suivantes dans /etc/asound.conf

pcm.!default {
type plug
slave {
pcm "plughw:1,7"
rate 48000
}
}

8- rebooter

Sur ma carte AT5ION, je peux tester le son avec les commandes suivantes:
$ speaker-test -c 2 -D plughw:1,7
$ mplayer -ao alsa:device=plughw=1.7 test.mp3

01/12/2009

01/12/2009

Filed under: — guedou @ 9:00


[Big: 6.5M] [Small: 324K]

Mon nouveau livre de chevet :)