From: Steven Baltakatei Sandoval Date: Tue, 30 Jun 2020 17:15:30 +0000 (+0000) Subject: doc(location):Describe how to disable swap file X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/abd68e662c16e798caf51fb5ecd76d74ca100290?ds=inline;hp=-c doc(location):Describe how to disable swap file --- abd68e662c16e798caf51fb5ecd76d74ca100290 diff --git a/doc/location/README.html b/doc/location/README.html index 0fb1b6a..11a6516 100644 --- a/doc/location/README.html +++ b/doc/location/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ninfacyzga-01 Manual @@ -234,24 +234,24 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Location Logging

+
+

1 Location Logging

This document was created by Steven Baltakatei Sandoval on -<2020-06-29 Mon 12:14> under a Creative Commons BY-SA 4.0 license. It -was updated by Steven Baltakatei Sandoval on <2020-06-29 Mon 22:06>. +2020-06-29T12:14Z under a Creative Commons BY-SA 4.0 license. It +was updated by Steven Baltakatei Sandoval on 2020-06-30T17:13Z

-
-

1.1 Narrative

+
+

1.1 Narrative

Ninfacyzga-01 records (logs) its position in time and space using a @@ -282,23 +282,23 @@ before being processed and written to disk.

-
-

1.2 Description

+
+

1.2 Description

-
-

1.2.1 Hardware

+
+

1.2.1 Hardware

    -
  1. Raspberry Pi Zero W
    +
  2. Raspberry Pi Zero W

    See the OEM webpage for this product.

  3. -
  4. PiZ UpTime 2.0
    +
  5. PiZ UpTime 2.0

    See the OEM webpage for this product. @@ -307,8 +307,8 @@ See the OEM webpage for

-
-

1.2.2 Software

+
+

1.2.2 Software

bkgpslog : The bash script that performs the location data @@ -349,7 +349,7 @@ should be copied to $HOME/.local/bin.

    -
  1. Narrative
    +
  2. Narrative

    bkgpslog populates a 60-second buffer with NMEA data from gpsd via @@ -362,28 +362,28 @@ encrypted with age, and then written to disk.

-
-

1.2.3 Output

+
+

1.2.3 Output

    -
  1. File Formats
    +
  2. File Formats
      -
    1. NMEA
      +
    2. NMEA

      See the Wikipedia page for this.

    3. -
    4. GPX
      +
    5. GPX

      See the Wikipedia page for this. WGS84 is the datum used.

    6. -
    7. KML
      +
    8. KML

      See the Wikipedia page for this. WGS84 is the datum used. @@ -392,7 +392,7 @@ See the Wikipedi

  3. -
  4. Encryption Method
    +
  5. Encryption Method

    Files produced by the bkgpslog script are encrypted against a set of @@ -421,7 +421,7 @@ Help information for age is available by running $ age --help

      -
    1. Encryption Commands
      +
    2. Encryption Commands

      Files may be encrypted to several recipients using a command similar to: @@ -442,7 +442,7 @@ bech32-formatted public key strings.

    3. -
    4. Decryption Commands
      +
    5. Decryption Commands

      Files may be decrypted using a command similar to: @@ -462,12 +462,12 @@ The version of age used to perform the encryption

-
-

1.3 Operating Procedures

+
+

1.3 Operating Procedures

-
-

1.3.1 Initial Startup

+
+

1.3.1 Initial Startup

See OEM (Ozzmaker) quickstart guide for the BerryGPS-IMU. @@ -475,7 +475,7 @@ See OEM (Ozzmaker) -

  • Physical Setup
    +
  • Physical Setup

    BerryGPS-IMU must be electrically connected to the correct pins on the @@ -490,9 +490,9 @@ possible.

  • -
  • Software Setup
    +
  • Software Setup
      -
    1. Install Executables
      +
    2. Install Executables

      Install Raspbian 10 Buster onto an SD card image. See the Raspberry Pi @@ -523,9 +523,46 @@ Linux) in $HOME/.local/bin.

    3. -
    4. Automatic Start Configuration
      +
    5. Disable Swap File

      +Since standard Raspbian 10 install involves copying unencrypted file +system image to SD card which is mounted by the Raspberry Pi, system +memory may be written to disk in the form of a Swap file as described +here. In order to reduce the chance that location log data is ever +written to disk, swap file functionality must be disabled. +

      + +

      +To view the status of the swap file in Raspbian 10, run free -m: +

      + +
      +pi@ninfacyzga-01:~$ free -m
      +              total        used        free      shared  buff/cache   available
      +Mem:            432          86          36          21         309         268
      +Swap:            99           0          99
      +
      + +

      +The swap file may be disabled by: +

      + +
      +pi@ninfacyzga-01:~$ sudo dphys-swapfile swapoff
      +pi@ninfacyzga-01:~$ sudo dphys-swapfile uninstall
      +pi@ninfacyzga-01:~$ sudo update-rc.d dphys-swapfile remove
      +pi@ninfacyzga-01:~$ free -m
      +              total        used        free      shared  buff/cache   available
      +Mem:            432          96          33          22         302         258
      +Swap:             0           0           0
      +
      +
      +
    6. + +
    7. Automatic Start Configuration
      +
      +

      Edit the user cron job list with $ crontab -e to add the following lines:

      @@ -563,7 +600,7 @@ may resemble:

      The age1z2...qkv6p is an age public key string. Please see the -Key Generation section for an explanation. +Key Generation section for an explanation.

      @@ -581,8 +618,8 @@ The options are:

    8. -
    9. Log Transfer Configuration
      -
      +
    10. Log Transfer Configuration
      +

      Log files may be shared to other machines via syncthing. See this manual for how to set up a shared folder and add Ninfacyzga-01 as a @@ -598,8 +635,8 @@ of this document.

    11. -
    12. Key Generation
      -
      +
    13. Key Generation
      +

      An age encryption key may be generated like so:

      @@ -642,8 +679,8 @@ be readable, writeable, or executable to anyone except the owner
  • -
    -

    1.3.2 Normal Startup

    +
    +

    1.3.2 Normal Startup

    Turn on Ninfacyzga-01 by supplying 5VDC power to the Raspberry Pi. No @@ -651,8 +688,8 @@ further interaction should be required.

    -
    -

    1.3.3 Normal Operation

    +
    +

    1.3.3 Normal Operation

    No interaction beyond continually supplying approximately 100mA of @@ -661,14 +698,14 @@ is required.

      -
    1. Log Transfer
      +
    2. Log Transfer

      Log files may be transferred by use of syncthing shared folders.

    3. -
    4. Automatic Updates
      +
    5. Automatic Updates

      The automatic-upgrades package, if installed, should automatically @@ -678,8 +715,8 @@ install security patches to packages installed via apt.

    -
    -

    1.3.4 Normal Shutdown

    +
    +

    1.3.4 Normal Shutdown

    The system may be shutdown via SSH by running: @@ -692,8 +729,8 @@ $ sudo shutdown -r 0

    -
    -

    1.3.5 Unscheduled Shutdown

    +
    +

    1.3.5 Unscheduled Shutdown

    Ninfacyzga-01 as described and setup should tolerate unscheduled power @@ -702,8 +739,8 @@ seconds worth of location data may be lost.

    -
    -

    1.3.6 End of Life Disposal

    +
    +

    1.3.6 End of Life Disposal

    LiPo batteries used by the PiZ Uptime 2.0 module should be disposed of @@ -728,9 +765,8 @@ lead-free solder.

    -

    Date: 2020-06-29T22:16Z

    Author: Steven Baltakatei Sandoval

    -

    Created: 2020-06-29 Mon 22:27

    +

    Created: 2020-06-30 Tue 17:14

    Validate

    diff --git a/doc/location/README.odt b/doc/location/README.odt index 7959c8b..5bcd124 100644 Binary files a/doc/location/README.odt and b/doc/location/README.odt differ diff --git a/doc/location/README.org b/doc/location/README.org index 7158a73..ebabe81 100644 --- a/doc/location/README.org +++ b/doc/location/README.org @@ -1,10 +1,9 @@ * Location Logging This document was created by Steven Baltakatei Sandoval on -<2020-06-29 Mon 12:14> under a [[https://creativecommons.org/licenses/by-sa/4.0/][Creative Commons BY-SA 4.0 license]]. It -was updated by Steven Baltakatei Sandoval on <2020-06-29 Mon 22:06>. +~2020-06-29T12:14Z~ under a [[https://creativecommons.org/licenses/by-sa/4.0/][Creative Commons BY-SA 4.0 license]]. It +was updated by Steven Baltakatei Sandoval on ~2020-06-30T17:13Z~ #+TITLE: Ninfacyzga-01 Manual #+AUTHOR: Steven Baltakatei Sandoval -#+DATE: 2020-06-29T22:16Z #+EMAIL: baltakatei@gmail.com ** Narrative Ninfacyzga-01 records (logs) its position in time and space using a @@ -112,7 +111,6 @@ conflict so a simple stacking and soldering with long header pins is possible. **** Software Setup - ***** Install Executables Install Raspbian 10 Buster onto an SD card image. See the Raspberry Pi @@ -132,6 +130,34 @@ Install ~syncthing~ for log file transfer capability. Place ~age~ binary (the one compiled for ARM CPU architecture for Linux) in ~$HOME/.local/bin~. +***** Disable Swap File +Since standard Raspbian 10 install involves copying unencrypted file +system image to SD card which is mounted by the Raspberry Pi, system +memory may be written to disk in the form of a Swap file as described +[[https://ideaheap.com/2013/07/stopping-sd-card-corruption-on-a-raspberry-pi/][here]]. In order to reduce the chance that location log data is ever +written to disk, swap file functionality must be disabled. + +To view the status of the swap file in Raspbian 10, run ~free -m~: + +#+BEGIN_EXAMPLE +pi@ninfacyzga-01:~$ free -m + total used free shared buff/cache available +Mem: 432 86 36 21 309 268 +Swap: 99 0 99 +#+END_EXAMPLE + +The swap file may be disabled by: + +#+BEGIN_EXAMPLE +pi@ninfacyzga-01:~$ sudo dphys-swapfile swapoff +pi@ninfacyzga-01:~$ sudo dphys-swapfile uninstall +pi@ninfacyzga-01:~$ sudo update-rc.d dphys-swapfile remove +pi@ninfacyzga-01:~$ free -m + total used free shared buff/cache available +Mem: 432 96 33 22 302 258 +Swap: 0 0 0 +#+END_EXAMPLE + ***** Automatic Start Configuration Edit the user cron job list with ~$ crontab -e~ to add the following