Skip to content

Instantly share code, notes, and snippets.

@fundon
Forked from couto/raspberrypi_archlinux.md
Created March 12, 2013 14:56

Revisions

  1. @couto couto revised this gist Sep 16, 2012. 1 changed file with 1 addition and 9 deletions.
    10 changes: 1 addition & 9 deletions raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -21,14 +21,6 @@ sudo diskutil unmount /dev/disk2s2
    sudo dd bs=1m if=~/Downloads/archlinuxarm-13-06-2012\ 2/archlinuxarm-13-06-2012.img of=/dev/rdisk2
    ```

    ## [Set the Keyboard Layout](https://wiki.archlinux.org/index.php/KEYMAP)

    * Assuming you want to use the Portuguese Layout

    ```
    setxkbmap pt
    ```

    ## [Expand the SD partition](http://archlinuxarm.org/forum/viewtopic.php?f=31&t=3119#p18160)

    SSH into your raspberry pi and run
    @@ -75,7 +67,7 @@ pacman -Sy extra/python2-pip
    pacman -Sy extra/python2-lxml
    pacman -Sy sudo vim zsh
    pip2 install mitmproxy
    sudo pip2 install mitmproxy
    ```

    ## [Update the hostname](https://wiki.archlinux.org/index.php/Configuring_Network#Set_the_host_name)
  2. @couto couto revised this gist Sep 12, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,7 @@ sudo dd bs=1m if=~/Downloads/archlinuxarm-13-06-2012\ 2/archlinuxarm-13-06-2012.
    ## [Set the Keyboard Layout](https://wiki.archlinux.org/index.php/KEYMAP)

    * Assuming you want to use the Portuguese Layout

    ```
    setxkbmap pt
    ```
  3. @couto couto revised this gist Sep 12, 2012. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,13 @@ sudo diskutil unmount /dev/disk2s2
    sudo dd bs=1m if=~/Downloads/archlinuxarm-13-06-2012\ 2/archlinuxarm-13-06-2012.img of=/dev/rdisk2
    ```

    ## [Set the Keyboard Layout](https://wiki.archlinux.org/index.php/KEYMAP)

    * Assuming you want to use the Portuguese Layout
    ```
    setxkbmap pt
    ```

    ## [Expand the SD partition](http://archlinuxarm.org/forum/viewtopic.php?f=31&t=3119#p18160)

    SSH into your raspberry pi and run
  4. @couto couto revised this gist Sep 10, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -104,7 +104,7 @@ visudo
    ## Install [Nodejs](http://nodejs.org) from source

    ```
    ln -s /usr/bin/python2.7 /usr/bin/python
    ln -s /usr/bin/python2 /usr/bin/python
    git clone git://github.com/joyent/node.git && cd node && git checkout v0.8.8
    ./configure --shared-openssl --without-snapshot
    make
  5. @couto couto revised this gist Sep 10, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -104,6 +104,7 @@ visudo
    ## Install [Nodejs](http://nodejs.org) from source

    ```
    ln -s /usr/bin/python2.7 /usr/bin/python
    git clone git://github.com/joyent/node.git && cd node && git checkout v0.8.8
    ./configure --shared-openssl --without-snapshot
    make
  6. @couto couto created this gist Sep 10, 2012.
    116 changes: 116 additions & 0 deletions raspberrypi_archlinux.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,116 @@
    # ArchLinux on a Raspberry Pi

    ## [Install the system to the SD card](http://elinux.org/RPi_Easy_SD_Card_Setup#Copying_an_image_to_the_SD_Card_in_Mac_OS_X)

    Connect the SD card to your computer and open the terminal.

    * Find the disk id

    ```
    df -h
    ```
    * Unmount the disk

    ```
    sudo diskutil unmount /dev/disk2s2
    ```

    * Replace `/dev/disk2s2/` with `/dev/rdisk2` (it might not be disk2s2, verify first!)

    ```
    sudo dd bs=1m if=~/Downloads/archlinuxarm-13-06-2012\ 2/archlinuxarm-13-06-2012.img of=/dev/rdisk2
    ```

    ## [Expand the SD partition](http://archlinuxarm.org/forum/viewtopic.php?f=31&t=3119#p18160)

    SSH into your raspberry pi and run

    ```
    fdisk /dev/mmcblk0
    ```
    * Delete the second partition

    ```
    Press:
    d [Enter]
    2 [Enter]
    ```
    * Create a new partition and use the default sizes prompted

    ```
    n [Enter]
    p [Enter]
    2 [Enter]
    [Enter]
    [Enter]
    ```
    * Save & Exit

    ```
    w [Enter]
    shutdown -r now
    ```
    * After reboot

    ```
    resize2fs /dev/mmcblk0p2
    ```

    ## [Update the system & Install Packages](https://wiki.archlinux.org/index.php/Pacman)

    ```
    pacman -Syu
    pacman -Sy base-devel
    pacman -Sy core/dnsutils
    pacman -Sy extra/python2
    pacman -Sy extra/python2-pip
    pacman -Sy extra/python2-lxml
    pacman -Sy sudo vim zsh
    pip2 install mitmproxy
    ```

    ## [Update the hostname](https://wiki.archlinux.org/index.php/Configuring_Network#Set_the_host_name)

    ```
    touch /etc/hostname && echo "new-hostname" > /etc/hostname
    ```

    ```
    nano /etc/hosts
    127.0.0.1 new-hostname.domain.org localhost.localdomain localhost new-hostname
    ::1 new-hostname.domain.org localhost.localdomain localhost new-hostname
    ```

    ## [Add user](https://wiki.archlinux.org/index.php/Users_and_Groups)

    * Assuming the username is couto and it has `sudo` privileges [wheel](http://alien.slackbook.org/dokuwiki/doku.php?id=linux:admin#wheel) and uses the `/bin/zsh` shell instead of `/bin/bash`

    ```
    useradd -m -g users -G wheel -s /bin/zsh couto
    chfn couto
    passwd couto
    ```
    * to allow the wheel group to have `sudo` privileges:

    ```
    visudo
    ```
    ```
    ## Uncomment to allow members of group wheel to execute any command
    %wheel ALL=(ALL) ALL
    ```

    ## Install [Nodejs](http://nodejs.org) from source

    ```
    git clone git://github.com/joyent/node.git && cd node && git checkout v0.8.8
    ./configure --shared-openssl --without-snapshot
    make
    sudo make install
    ```

    ## Security
    Depending on the use you might want to consider some advice

    * [Ubuntu tips](http://coderwall.com/p/ybuilq) (ufw is quite useful)