xuv's notebook

Side notes, howtos and random bits of information related to Julien Deswaef's projects

User Tools

Site Tools


arch:arch_on_the_pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arch:arch_on_the_pi [2015/12/31 19:48] – created Julien Deswaefarch:arch_on_the_pi [2020/08/06 21:11] (current) Julien Deswaef
Line 1: Line 1:
 ====== Arch on a Pi ====== ====== Arch on a Pi ======
  
-Installing Archlinux on a Raspberry Pi and turn it into a server+Some random notes related to [[http://archlinuxarm.org|Arch Linux ARM]] on a Raspberry Pi. Some of these notes might be turned into their own page one day.
  
-http://archlinuxarm.org/platforms/armv6/raspberry-pi+===== Blender ===== 
 +==== Installing from packages on RPi3 ==== 
 +[[https://archlinuxarm.org/packages/aarch64/blender|Blender is compiled for ARMv8 architecture only for AArch64]]. 
 + 
 +See bottom of this page for the right archive to use at installation: https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3#installation 
 + 
 +Rendering a default file seems to require ''xvfb'': 
 +<code> 
 +xvfb-run blender -b -noaudio untitled_e.blend -o // -f 1 
 +</code> 
 + 
 + 
 +==== Compiling on RPi2 ==== 
 +If it's still not in the repositories, here's a way to compile latest stable Blender for RPi2 
 +[[https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/blender|Download these two files]]. And change these two lines from PKGBUILD: 
 + 
 +<code> 
 +arch=('i686' 'x86_64'
 +… 
 +  make -j4 # -j5 needs 48 GB of RAM while -j9 needs 64 GB 
 +</code> 
 +into  
 +<code> 
 +arch=('armv7h'
 +… 
 +  make -j2 
 +</code> 
 +This will get it compiled on the Raspberry Pi 2 itself. It will take a while ( couple hours ).
  
 ===== Installing server ===== ===== Installing server =====
Line 47: Line 74:
  
 ===== Installing ikiwiki ===== ===== Installing ikiwiki =====
-  * Install Git +Install git and dev tools. 
-  * Install Make +<code> 
-  * <del><code=bash>$: cpan</code></del+$: sudo pacman -Syu git base-devel 
-  * Use Pacman with this[[https://aur.archlinux.org/packages/ikiwiki/| Aur package]]+</code> 
 + 
 +Install [[https://aur.archlinux.org/packages/ikiwiki/ikiwiki from Aur package]].  
 + 
 +You'll need 2 extra dependencies from Aur:  
 +  * [[https://aur.archlinux.org/packages/perl-cgi-formbuilder/ | perl-cgi-formbuilder]] 
 +  * [[https://aur.archlinux.org/packages/perl-rpc-xml/ | perl-rpc-xml]].  
 +Install those first. Compiling ikiwiki takes a while on a Raspberry Pi. Be patient. 
 + 
 +If you want to have images handle by the wiki, you will need also Imagemagick  
 + 
 +Although ikiwiki could be running from any server, I found it easier to run it behind Apache. So be sure to have that installed. 
 + 
 +Create an unprivileged user (here called wiki) who will be editing the wiki: 
 +<code> 
 +sudo useradd -m wiki 
 +sudo passwd wiki 
 +</code> 
 + 
 +Following https://www.linode.com/docs/websites/wikis/ikiwiki-on-arch-linux/ 
 + 
 +===== Resizing a partition ===== 
 +//Copied from  http://raspberrypi.stackexchange.com/a/501 // 
 + 
 +  * ''sudo fdisk /dev/mmcblk0'' 
 +  * Type ''p'' to list the partition table 
 + 
 +<code> 
 +Device         Boot  Start      End  Sectors  Size Id Type 
 +/dev/mmcblk0p1        2048   206847   204800  100M  c W95 FAT32 (LBA) 
 +/dev/mmcblk0p2      206848 60588031 60381184 28.8G 83 Linux 
 +</code> 
 + 
 +  * Take note of the start number for partition 2 (if that's the one you want to resize) 
 +  * Type ''d'' to delete a partition. \\ You will then be prompted for the number of the partition you want to delete. In the case above you want to delete partition 2. 
 +  * Type ''n'' to create a new partition. 
 +  * This new partition needs to be a primary partition so type ''p''
 +  * Next enter ''2'' when prompted for a partition number. 
 +  * You will now be prompted for the first sector for the new partition. Enter the start number from the partition 2 you deleted before. 
 +  * Next you will be prompted for the last sector you can just hit enter to accept the default which will utilize the remaining disk space. 
 +  * Type ''w'' to save the changes you have made. (There will be some error showing saying: "Re-reading the partition table failed.: Device or resource busy", but no worries). 
 +  * Reboot the Pi: '' sudo reboot'' 
 +  * Once the system has reboot and you are back at the commandline enter: ''sudo resize2fs /dev/mmcblk0p2'' Note: this can take a long time (epending on the card size and speed) be patient and let it finish. 
 +  * Reboot one more time. 
 +  * You can now verify that the system is using the full capacity of the SD Card by entering the following command: ''df -h'' 
 + 
 +=== Why This Works === 
 +Actually, when we delete a partition, we don't delete data, we just delete the reference to the partition in the partition table. By creating a new partition exactly from the same spot and of the same type, we keep the data but expanded the size to the full available space of the SD card. 
 + 
 +By resizing (which is safe to run on a mounted disk), we tell the file system to use all the space in the new partition. 
  
 +===== Python UnicodeEncodeError horror =====
 +So your Python script works on your machine. But when you port it to a freshly installed Arch Linux Arm on a Pi, all hell breaks loose as soon as a weird character pops up. Something like this shows up: 
 +<code>UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 227: ordinal not in range(128)</code>
 +Well, don't start modifying your Python code (as you said, it does not have that problem on your machine).  It's because the default locale of Arch Linux is ''LANG-C'' and what you want is UTF-8 support. There is many ways to solve this, including forcing Python to use a locale different from the system. But I like to have my systems with similar settings. So just follow tutorials [[https://wiki.archlinux.org/index.php/Locale|here]].
  
-  
arch/arch_on_the_pi.txt · Last modified: 2020/08/06 21:11 by Julien Deswaef