Difference between revisions of "Freedomstack"

From gr0x0rd
Jump to navigation Jump to search
Line 15: Line 15:
 
=Install=
 
=Install=
  
If you are unfamiliar with the raspberry pi and how it works, you may benefit from browsing some of my [[Building_a_Streaming_Media_Center||previous documentation]].
+
If you are unfamiliar with the raspberry pi and how it works, you may benefit from browsing some of my [[Building_a_Streaming_Media_Center|previous documentation]].
 
<br><br>
 
<br><br>
 
I procured the ArchLinux ARM boot image for the raspberry pi from https://archlinuxarm.org/about/downloads . You will want the image for the Raspberry Pi 3/4, which is the ARMv8 image. I noted that the download was not secure as it lacked a security certificate (fucking guys too lazy for letsencrypt I guess). I didn't bother with the md5 checksums, but I did a quick clamscan on it to make sure there weren't any nasties in the archive.  
 
I procured the ArchLinux ARM boot image for the raspberry pi from https://archlinuxarm.org/about/downloads . You will want the image for the Raspberry Pi 3/4, which is the ARMv8 image. I noted that the download was not secure as it lacked a security certificate (fucking guys too lazy for letsencrypt I guess). I didn't bother with the md5 checksums, but I did a quick clamscan on it to make sure there weren't any nasties in the archive.  
Line 21: Line 21:
 
Insert your sd card into a reader and connect it to your system. Note that these instructions are for linux. Someone may want to make instructions for Windows eventually, but time would likely be better spent teaching Windows users to use linux (my opinion). This guide assumes a kernel assignment for the sd cards of /dev/sdX . I usually use
 
Insert your sd card into a reader and connect it to your system. Note that these instructions are for linux. Someone may want to make instructions for Windows eventually, but time would likely be better spent teaching Windows users to use linux (my opinion). This guide assumes a kernel assignment for the sd cards of /dev/sdX . I usually use
 
  $ ls -al /dev/sd*  
 
  $ ls -al /dev/sd*  
To identify the drive. Before you overwrite it with the image, if there is anything precious on it, you may want to [[make an image of it for later||Create_a_disk_image_of_an_sdcard]]. If any of the sdcard partitions auto-mounted in your desktop UI, unmount (but do no eject) them. Next, extract the disk image to the sdcard.  
+
To identify the drive. Before you overwrite it with the image, if there is anything precious on it, you may want to [[Create_a_disk_image_of_an_sdcard|make an image of it for later]]. If any of the sdcard partitions auto-mounted in your desktop UI, unmount (but do no eject) them. Next, we will prepare the sdcard.
  $
+
$ sudo fdisk /dev/sdX
 +
Press d until the existing partitions are deleted, if they exist. Press p to display partitions, and you should see none. Now create a 128MB boot partition.
 +
Command (m for help): n
 +
Partition type
 +
    p  primary (0 primary, 0 extended, 4 free)
 +
    e  extended (container for logical partitions)
 +
Select (default p): <press enter>
 +
Using default response p.
 +
Partition number (1-4, default 1): <press enter>
 +
First sector (2048-15351807, default 2048): <press enter>
 +
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-??????, default ??????): +128M
 +
 
 +
Created a new partition 1 of type 'Linux' and of size 128 MiB.
 +
Next we will set the boot partition to type FAT32.
 +
Command (m for help): t
 +
Hex code or alias (type L to list all): c
 +
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
 +
Now we will create the root partition, which will essentially be the rest of the disk.
 +
<pre>
 +
Command (m for help): n
 +
Partition type
 +
  p  primary (1 primary, 0 extended, 3 free)
 +
  e  extended (container for logical partitions)
 +
Select (default p):
 +
 
 +
Using default response p.
 +
Partition number (2-4, default 2):
 +
First sector (264192-15351807, default 264192):
 +
Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-15351807, default 15351807):
 +
 
 +
Created a new partition 2 of type 'Linux' and of size 7.2 GiB.
 +
</pre>
 +
Write the new partitions to the disk.
 +
<pre>
 +
Command (m for help): w
 +
The partition table has been altered.
 +
Calling ioctl() to re-read partition table.
 +
Syncing disks.
 +
</pre>
 +
To confirm the partitions have been correctly created, check devices.
 +
$ sudo ls -al /dev/sd*
 +
You should see partitions '''/dev/sdX1''' and '''/dev/sdX2'''. Now, let's apply a vfat filesystem to the boot partition.
 +
$ sudo mkfs.vfat /dev/sdX1
 +
Next we apply a linux filesystem to the root partition.  
 +
  $ sudo mkfs.ext4 /dev/sdX2
 +
The command should complete with a note about superblocks.

Revision as of 19:51, 24 April 2022

Overview

On Thursday, April 21 2022 a meeting was held at meet.gr0x0rd.com where we discussed the necessity of building a local alternative to the internet. We agreed that we would use raspberry pi devices running linux that could serve as hosts for a mesh network based on reticulum and qortal. I was tasked with getting an image up and running that could be deployed to pi devices within the community, and to provide that image.

My intention here is to provide the instructions for building said image so that can be reviewed by the community and leveraged by others.

After some basic research I have, at least initially, chosen to implement this project using Archlinux.

Why Archlinux?

There will probably be some questions on why I would choose Archlinux to run on the Raspberry Pi ARM architecture as opposed to the default Raspberry Pi OS or some other more common or vanilla distro. Some justification for that thought process:

  • Customization. Arch is highly customizable and lean, but doesn't suffer from the "build your own excitement brick by brick" heavy lifting of Gentoo and other from-source distros.
  • Heterogeneity. The most commonly used distros, and those will some sort of corporate structure attached (for example Red Hat and Ubuntu) will be early targets.
  • It's Canadian. Yes, Arch is still a Canadian based project, as far as I know eh.
  • Documentation. The community docs are great (I haven't ever had to ask a question on the forums and have run it nearly 5 years) and have expanded on that here in this wiki.

Install

If you are unfamiliar with the raspberry pi and how it works, you may benefit from browsing some of my previous documentation.

I procured the ArchLinux ARM boot image for the raspberry pi from https://archlinuxarm.org/about/downloads . You will want the image for the Raspberry Pi 3/4, which is the ARMv8 image. I noted that the download was not secure as it lacked a security certificate (fucking guys too lazy for letsencrypt I guess). I didn't bother with the md5 checksums, but I did a quick clamscan on it to make sure there weren't any nasties in the archive.

Insert your sd card into a reader and connect it to your system. Note that these instructions are for linux. Someone may want to make instructions for Windows eventually, but time would likely be better spent teaching Windows users to use linux (my opinion). This guide assumes a kernel assignment for the sd cards of /dev/sdX . I usually use

$ ls -al /dev/sd* 

To identify the drive. Before you overwrite it with the image, if there is anything precious on it, you may want to make an image of it for later. If any of the sdcard partitions auto-mounted in your desktop UI, unmount (but do no eject) them. Next, we will prepare the sdcard.

$ sudo fdisk /dev/sdX

Press d until the existing partitions are deleted, if they exist. Press p to display partitions, and you should see none. Now create a 128MB boot partition.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): <press enter>
Using default response p.
Partition number (1-4, default 1): <press enter>
First sector (2048-15351807, default 2048): <press enter>
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-??????, default ??????): +128M
 
Created a new partition 1 of type 'Linux' and of size 128 MiB.

Next we will set the boot partition to type FAT32.

Command (m for help): t
Hex code or alias (type L to list all): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Now we will create the root partition, which will essentially be the rest of the disk.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (2-4, default 2): 
First sector (264192-15351807, default 264192): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-15351807, default 15351807): 

Created a new partition 2 of type 'Linux' and of size 7.2 GiB.

Write the new partitions to the disk.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

To confirm the partitions have been correctly created, check devices.

$ sudo ls -al /dev/sd*

You should see partitions /dev/sdX1 and /dev/sdX2. Now, let's apply a vfat filesystem to the boot partition.

$ sudo mkfs.vfat /dev/sdX1

Next we apply a linux filesystem to the root partition.

$ sudo mkfs.ext4 /dev/sdX2

The command should complete with a note about superblocks.