Gentoo Stage 4 for the Raspberry Pi

This is a great guide for getting Gentoo on the Pi. I did not see any stage4 installs available so I wanted to make one for the public to help save time on the Pi. If you follow all the steps on the Wiki yourself, it will take a few hours to accomplish the same steps.

Instructions:

Download the stage 4: https://www.dropbox.com/s/7m0dilz3me76mr8/stage4-01232013.tar

[insert url here]

Partition SD card :
100 MB -> /boot (/dev/mmcblk0p1) (Windows partition)
2GB or more -> / (/dev/mmcblk0p2) (Linux )

mkfs.vfat /dev/mmcblk0p1
mkfs.ext4 /dev/mmcblk0p2

Extract stage4-01232013.tar.gz somewhere

Mount /boot somewhere and copy the files in “boot” to it from the stage4 tar file.
Mount / somewhere and move everything else there.
Download the latest portage snapshot per the Gentoo Guide and extract it to usr/ on your new / .

Unmount everything and turn on your Pi.

Simple iptables tutorial for Linux

File: /etc/sysconfig/iptables :

———————————————————————————–

*filter

#This line will block any incoming connections except for the rules we allow later in this file.
:INPUT DROP [5:574]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [136:13895]

#These two lines are the basics for allowing incoming connections.

-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT

# This line allows SSH

-A INPUT -p tcp -m tcp –dport 22 -j ACCEPT

COMMIT
*nat

:PREROUTING ACCEPT [468:62332]

:POSTROUTING ACCEPT [252:15827]
:OUTPUT ACCEPT [559:41614]
COMMIT

———————————————————————————–

When your done editing this file run:

# service iptables restart