Skip to content

Commit

Permalink
Fixed issues caused by new markdown generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaman committed Feb 17, 2016
1 parent f82e342 commit d82140d
Show file tree
Hide file tree
Showing 28 changed files with 123 additions and 123 deletions.
12 changes: 6 additions & 6 deletions articles/CONTRIBUTING.md
Expand Up @@ -3,16 +3,16 @@ title: "PiNet, a centralised user accounts and file storage system for a Raspber
layout: article
---

#Contributing to the PiNet project
# Contributing to the PiNet project

One of the key things about the PiNet documentation is it should be easy to contribute fixes, edits or new guides to the documentation.
The documentation is all written in markdown, a simple, easy to to learn plain text language for formatting documents.
The documentation is stored in a Github repository which can be found [here](https://github.com/PiNet/PiNet.github.io).

##I have never used markdown before
## I have never used markdown before
Don't worry, it is very easy to pick up, [here is a handy guide to get your started](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).

##Do you have a nice text editor you recommend using to write it with?
## Do you have a nice text editor you recommend using to write it with?
![](/assets/images/atom-1.jpeg)


Expand All @@ -22,13 +22,13 @@ All the markdown files end in .md and are stored in the [articles folder](https:
Once you open a markdown file, hit ```ctrl``` + ```shift``` + ```m``` to open the markdown renderer beside the text editor.
You will also want to disable ```Remove Trailing Whitespace``` from the ```Whitespace``` package in Atom. To do this, open Atom preferences, select packages, search for ```whitespace```, select the package settings and uncheck ```Remove Trailing Whitespace```.

##I am completely new to Github!
## I am completely new to Github!
No problem, the Raspberry Pi foundation have a great getting started guide over on their [github](https://github.com/raspberrypilearning/creating-resources/blob/master/github.md).

##Ok, I have got a change or edit I want to make, what do I do?
## Ok, I have got a change or edit I want to make, what do I do?
If it is a small edit, create a pull request ([how to do that](https://github.com/raspberrypilearning/creating-resources/blob/master/github.md)) with your change [here](https://github.com/PiNet/PiNet.github.io/pulls).
If it is a new page or big edit, please open an issue first [here](https://github.com/PiNet/PiNet.github.io/issues) (In case someone else is already doing it).
One of the documentation team will have a look over and decide the next step.

##My edit has been accepted, now what?
## My edit has been accepted, now what?
It will take 2-3 minutes for the main documentation site to update with your change. Once it has updated, check [http://pinet.org.uk](http://pinet.org.uk) and your change should be there. If the change is not there after an hour, please open an [issue](https://github.com/PiNet/PiNet.github.io/issues).
12 changes: 6 additions & 6 deletions articles/advanced/benchmarks.md
Expand Up @@ -15,31 +15,31 @@ For PiNet there are 2 modes it can be run in
**2. NBD mode** - Uses NBD and squashFS compression to compress the operating system beforehand. After every change to the master operating system, the OS must be recompressed, which takes roughly 5-10 minutes. It is recommended for production use. The compression normally involves the amount of data cross the network dropping to roughly 40% of what NFS mode uses making it very useful for slower networks or networks running 8+ Raspberry Pis.

The tests were completed on a Raspberry Pi model B revision 2 and the SD card used in these tests was a class 10 SanDisk Ultra card rated at 30MB/s.
##Results
####Boot to login
## Results
#### Boot to login
Test | SD card | NFS | NBD (with compression)
----|----|----|----
Time | 35s* |66s| 63s

####Open Libreoffice Writer
#### Open Libreoffice Writer
| SD card | NFS | NBD (with compression)
----|----|----|----
Time | 15s |24s| 20s
Data crossing network | N/A |75mb| 28mb

####Open Chromium web browser
#### Open Chromium web browser
| SD card | NFS | NBD (with compression)
----|----|----|----
Time | 13s |20s| 12s
Data crossing network | N/A |45mb| 30mb

####Open Scratch
#### Open Scratch
| SD card | NFS | NBD (with compression)
----|----|----|----
Time | 6s |7s| 6s
Data crossing network | N/A |4.7mb| 3.6mb

####Open Sonic-Pi version 2 RC3
#### Open Sonic-Pi version 2 RC3
| SD card | NFS | NBD (with compression)
----|----|----|----
Time | 37s |42s| 36s
Expand Down
2 changes: 1 addition & 1 deletion articles/advanced/boot-files.md
Expand Up @@ -57,7 +57,7 @@ up of a number of configuration files and boot files.

- **Vmlinuz-KERNEL** – The main PiNet kernel.

###Additional files you may have
### Additional files you may have

- **Kernel.img** – An untouched Raspbian kernel.

Expand Down
2 changes: 1 addition & 1 deletion articles/advanced/change-background.md
Expand Up @@ -9,7 +9,7 @@ Changing PiNet background
PiNet comes with the amazing stars background photograph taken by [John Lemieux](https://www.flickr.com/photos/newdimensionfilms/7108632527/).
![](/assets/images/desktop-background.png)

##Changing this image
## Changing this image
If you want to change it to your own custom background image, the image is stored in 2 places.
- Desktop background - ```/opt/ltsp/armhf/usr/share/images/desktop-base/PiNet.png```.
- Login screen background - ```/opt/ltsp/armhf/usr/share/ldm/themes/raspi/bg.png```.
Expand Down
2 changes: 1 addition & 1 deletion articles/advanced/custom-config-file.md
Expand Up @@ -9,7 +9,7 @@ Like normal Raspberry Pis running Raspbian. The config.txt file is the first thi
The config.txt file can contain some key configuration/setup variables which can be used to set stuff like monitor resolution, overclocking etc.
A full list of the config.txt supported values can be found [here](https://www.raspberrypi.org/documentation/configuration/config-txt.md).

##What you need to know
## What you need to know
Right now PiNet does not fully support custom config.txt parameters.
They can be manually added to each config.txt on each SD card, but they will be overwritten when the system does an automated kernel update (every 3-6 months).

Expand Down
2 changes: 1 addition & 1 deletion articles/advanced/editing-outside.md
Expand Up @@ -26,7 +26,7 @@ The key things you need to know are

- The raw boot files before configuration changes have been made can be found at [here](https://github.com/gbaman/PiNet/tree/master/boot)

##An example - Deleting Minecraft Pi edtion
## An example - Deleting Minecraft Pi edtion

Lets say you want to run a command in the Raspbian operating system, which is stored on the server (and each Pi boots from).
For example, lets say you want to remove Minecraft-Pi edition (which is installed by default).
Expand Down
24 changes: 12 additions & 12 deletions articles/advanced/kernels.md
Expand Up @@ -9,39 +9,39 @@ Understanding kernels on the Raspberry Pi and PiNet
***Note*** - This guide is provided as is, it is unlikely any additional support will be offered for its contents if you get stuck. It is only designed for more advanced Raspberry Pi / Linux users. If you do have issues though, you could always try you luck at [contacting support](../support.html).
***Note 2*** - Take this document as draft level quality as it has not been double checked by all relevant experts yet, it is only what I have been able to gather myself over the past year.

##What is a kernel?
## What is a kernel?
"In computing, the kernel is a computer program that manages I/O (input/output) requests from software, and translates them into data processing instructions for the central processing unit and other electronic components of a computer. The kernel is a fundamental part of a modern computer's operating system." - [Wikipedia](http://en.wikipedia.org/wiki/Kernel_%28operating_system%29)

The kernel is a vital part of Raspbian (and any operating system), it is the bridge between the computer hardware and the software on top. It is incredibly complex and is generally just huge! The standard Linux kernel currently (February 2015) has over 17 million lines of code contributed by over 13,000 people.
It contains all the drivers/modules required to work with the hardware. Sometimes if you want a very specialist piece of hardware to work, you may need to compile your own kernel.

##Raspberry Pi kernels
## Raspberry Pi kernels
The kernel for the Raspberry Pi can be found on the /boot partition (the FAT32 partition you can open on Windows, Mac and Linux).
For the Raspberry Pi 1 (B, B+, A, A+) it is called kernel.img.
For the Raspberry Pi 2 (B) it is called kernel7.img.

The kernel is one of the few bits of software that wasn't able to run on both the Raspberry Pi 1 CPU (ARM6) and the Raspberry Pi 2 (ARM7) with the same version.
Instead the 2 versions had to be compiled separately and the firmware selects the correct one depending on the hardware it detects on boot.

##Kernel sources
## Kernel sources
There are 2 main sources for Raspberry Pi kernels. Both have their advantages and disadvantages.
- Official Raspberry Pi foundation kernels
- Unofficial Raspbian team kernels

####Raspberry Pi foundation kernels
#### Raspberry Pi foundation kernels
The Raspberry Pi foundation kernels are the official kernels the Raspberry Pi is shipped with. They are considerably more stripped down than the Raspbian team kernels, but are always the most up to date. For new hardware (like the new USB chip in the B+ or new CPU in Raspberry Pi 2 B), they available on day 1 of the hardware release.
They have a number of issues including not being correctly in line with the standard Debian kernels and lacking the header files, required to build custom kernel modules with.
They also don't follow the normal installation method and package names in the Raspbian software repositories.
For the average user though, these 2 downsides make no difference.
The kernel is though currently lacking AUFS support. AUFS is a virtual module for PiNet.

####Raspbian team kernels
#### Raspbian team kernels
The Raspbian team maintains their own kernels. The Raspbian team maintain the Raspbian software repositories. Their kernels are based off the standard Debian kernels, and so contain a larger array of modules to support even more hardware. Due to this fact alone, their kernels are larger and take longer to build, although this is rarely an issue.
They include proper header files for compiling your own modules and generally more closely follow the standard Debian way of handling kernels, including the standard Debian way of packaging kernels and distributing them using apt.
One of the extra modules they include is AUFS, a vital module for PiNet network booting that is currently missing from the Raspberry Pi foundation kernels.
One of their major downsides though is they usually arrive quite a bit later than the Raspberry Pi foundation kernels, sometimes a number of weeks later.

###Initramfs
### Initramfs
When talking about kernels, another key thing to discuss is the initramfs (also sometimes known as initrd although they are slightly different).
The initramfs is a tiny compressed entire filesystem in a single file. It contains a complete mini linux filesystem in 5mb-10mb.
The idea behind it is it is an extension of the kernel, containing a number of modules and startup scripts. It can be easily edited, while editing the kernel would require completely recompiling it again! It also allows you to start a mini operating system to load more advanced modules to use as a springboard for loading more advanced operating systems in complicated circumstances, for example network booting!
Expand All @@ -51,16 +51,16 @@ Then use ```sudo mkinitramfs /boot/myAwesomeInitramfs3.18.img 3.18.6-v7+```.
**Note - You must build the initramfs with the exact same kernel version you intend to use. Even if they are out by one minor version or they are out of date with the version on the server, devices (like keyboards and mice) may not work**


##So where does PiNet come into all this?
## So where does PiNet come into all this?
With PiNet, the kernel and initramfs version is extremely important.
Both live on the SD card with normal Raspberry Pi firmware and all the config files.
**PiNet currently uses the Raspbian team kernels as they contain the required extra modules (OverlayFS or AUFS, SquashFS and NBD) which are missing from the Raspberry Pi foundation kernels.** - this is being worked on though.
You may notice after software updates to PiNet, sometimes your PiNet clients will randomly reboot just after hitting the login screen a single time. This is because they have detected they are running an out of date version of the kernel files (mismatch with the version on the server) and the server has automatically copied the new kernel and initramfs over to the SD card. It must restart the Pi to apply the update. It should only happen a single time for each SD card on a new kernel update.

##I am impatient and want to try the new kernel features right now!
## I am impatient and want to try the new kernel features right now!
You can do this if you compile your own kernel.
Kernel compiling is an incredibly CPU intensive job. Although it could be done natively on the Raspberry Pi, it would take many hours. Fortunately we can cross compile (compile it on another more powerful computer) it.
####Building the kernel
#### Building the kernel
Adafruit has an excellent kernel building tool that runs on Windows, Mac and Linux called the [Kernel-O-Matic](https://learn.adafruit.com/raspberry-pi-kernel-o-matic/overview) that is a great place to start.
Once it is installed (and you have got as far as ```vagrant ssh```), you need to grab a few extra bits.
The main one being AUFS.
Expand Down Expand Up @@ -89,18 +89,18 @@ To enable a module, hit y when it is selected.
Finally, select exit at the bottom (tab then enter).
The kernel will start compiling. You will need to do the same for the Pi 2 kernel once the Pi 1 kernel is completed.

####Installing the new kernel
#### Installing the new kernel
The new kernel is packaged up inside a .deb file. Follow the instructions on the kernel-o-matic guide on how to get the newly created .deb file.
- Once you have it, move it to your PiNet server (via pendrive or FTP) and copy the file into somewhere like ```/opt/ltsp/armhf/tmp```.
- Next, switch to the Raspbian OS with ```sudo ltsp-chroot --arch armhf```.
- Install the .deb package using ```dpkg -i /tmp/whatYouNamedIt.deb```.

####Generating the initramfs
#### Generating the initramfs
We now need to generate the initramfs for the new kernel. To do so (continuing on from above)
- Build the initramfs with ```sudo mkinitramfs /boot/myAwesomeInitramfs3.18.img 3.18.6-v7+```. (Remember to change the version number if need be, see initramfs section above).
- At this point it would be worth starting a manual recompress of the Raspbian install, the tool can be found in PiNet, in "other" and is called ```NBD-recompress```.

####Install it on the SD card
#### Install it on the SD card
- First, start with a normal PiNet SD card.
- Delete anything with pervious kernel versions in its name (e.g.```vmlinuz-3.12-1-rpi``` or ```initrd.img-3.12-1-rpi``` etc). Also, if you have it, delete the ```kernel.img``` and ```kernel7.img```.
- Copy the new kernel and initramfs from /opt/ltsp/armhf/boot to the SD card. They will be named ```kernel.img```, ```kernel7.img```, ```myAwesomeInitramfs3.18.img```.
Expand Down
4 changes: 2 additions & 2 deletions articles/advanced/keyboard-layout.md
Expand Up @@ -9,12 +9,12 @@ Changing keyboard mapping
If you are having issues with keys in the wrong place on PiNet on your keyboard, you may need to change your keyboard layout.
It is recommended you first test it on a running Raspberry Pi then select the final working layout on the server.

###Changing keyboard mapping on a Raspberry Pi
### Changing keyboard mapping on a Raspberry Pi
Launch a terminal and enter ```dpkg-reconfigure keyboard-configuration```. This will launch the configuration utility allowing you to select your keyboard model.
To test it, enter ```invoke-rc.d keyboard-setup start```.
If it does not fix it, try another option in the keyboard-configuration panel.
If you loose control of your keyboard, just reboot your Raspberry Pi and all configuration changes will be reverted.

###Changing keyboard mapping for all Raspberry Pis via the server
### Changing keyboard mapping for all Raspberry Pis via the server
Once you have figured out the needed keyboard mapping, open a terminal on the server and enter ```sudo ltsp-chroot dpkg-reconfigure keyboard-configuration```.
Select the required layout and then recompress the operating system with ```ltsp-update-image /opt/ltsp/armhf```.
8 changes: 4 additions & 4 deletions articles/advanced/network-technologies.md
Expand Up @@ -15,13 +15,13 @@ NFS is an older standard that its competitor NBD. It has been proved reliable fo
and is still the default for underlying LTSP for Ubuntu and Debian.
Keep in mind though PiNet's default is NBD.

###Advantages
### Advantages
- Old and reliable.
- Well supported on everything.
- All changes made to Raspbian from the server are live! No need to recompress the operating system.
- Very useful for testing and trying out different changes

###Disadvantages
### Disadvantages
- No compression enabled by default with LTSP so slower.
- Lacking some newer error detection etc.

Expand All @@ -31,11 +31,11 @@ NBD
NBD is a much newer file sharing technology that is the default for PiNet.
With NBD, we have enabled squashfs compression to reduce network traffic by roughly 40%!

###Advantages
### Advantages
- Raspberry Pis boos faster and load large applications faster.
- Considerably less network traffic transferred across the network due to compression (roughly 40% less).

###Disadvantages
### Disadvantages
- Changes are not live. You must recompress the operating system after each change with takes 5-10 minuets.
- After a recompress of the operating system, all clients need rebooted.

Expand Down
8 changes: 4 additions & 4 deletions articles/advanced/raspbian-kernels-process.md
Expand Up @@ -10,8 +10,8 @@ This guide is mainly written as a reminder for the PiNet team on the process of

**WARNING** - This guide was written mainly for myself to on steps to build the SD card boot files. The guide may be missing parts or may be out of date. This guide is not an officially supported piece of documentation, follow at your own risk.

##Steps
###Getting up to date files
## Steps
### Getting up to date files
1. Enter chroot ```sudo ltsp-chroot```.
2. Update the package lists ```apt-get update```.
3. Make sure ```overlay``` is in ```/opt/ltsp/armhf/etc/initramfs-tools/modules```.
Expand All @@ -25,7 +25,7 @@ This guide is mainly written as a reminder for the PiNet team on the process of
9. Copy new firmware files ```cd /opt/ltsp/armhf/boot``` followed by ```cp -r bcm2708-rpi-b.dtb bcm2708-rpi-b-plus.dtb bcm2709-rpi-2-b.dtb bootcode.bin overlays start_cd.elf start.elf start_x.elf fixup_cd.dat fixup.dat fixup_x.dat /home/$USER/newBootFiles/``` then ```cd```.
10. Copy the kernels. Remember you will need to change the names if you are using a different version other than 3.18. ```cd /opt/ltsp/armhf/boot``` followed by ```cp vmlinuz-3.18.0-trunk-rpi vmlinuz-3.18.0-trunk-rpi2 initrd.img-3.18.0-trunk-rpi initrd.img-3.18.0-trunk-rpi2 /home/$USER/newBootFiles/``` then ```cd```.

###Adding OverlayFS support to boot files - No longer needed
### Adding OverlayFS support to boot files - No longer needed
This section is kept for reference but is no longer needed.

In the 3.18 kernel release, overlayfs was renamed to overlay, which breaks LTSP support for it. We must manually fetch a more up to date version of the script.
Expand All @@ -39,5 +39,5 @@ In the 3.18 kernel release, overlayfs was renamed to overlay, which breaks LTSP
7. Zip the folder back up again ```find . | cpio -o -H newc | gzip -9 > ../initrd.img-3.18.0-trunk-rpi```.
8. Repeat for Pi2 (initrd.img-3.18.0-trunk-rpi2)

###Final steps
### Final steps
The boot files should now be ready. Verify the cmdline files have 1.1.1.1 in them and that the config.txt files are correct. Then copy to an SD card and test.

0 comments on commit d82140d

Please sign in to comment.