Skip to content

Commit

Permalink
v3.0 Added support for Backup OS & Set Time. Documentation. Splash sc…
Browse files Browse the repository at this point in the history
…reen tidy up. Iconcache. Update it, zh_TW translations
  • Loading branch information
procount committed Dec 10, 2018
1 parent 187f33b commit 6a8ee42
Show file tree
Hide file tree
Showing 47 changed files with 2,065 additions and 664 deletions.
700 changes: 345 additions & 355 deletions README.md

Large diffs are not rendered by default.

43 changes: 38 additions & 5 deletions README_PINN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The latest version of [PINN](http://downloads.sourceforge.net/projects/pinn/pinn

### - [If you have PINN v2.4.3 - v2.4.4b installed, please manually update to v2.4.4c](https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574&start=200#p1239359)

This README relates to v2.8.5.7
This README relates to v3.0

<sup>(PINN-lite does not include any operating systems at all. It is more akin to `NOOBS-lite` rather than `NOOBS`. For that reason, the filename that you download is called `pinn-lite.zip`. More recently, `pinn.zip` has also been made available for download which includes versions of Raspbian and LibreELEC.)</sup>

Expand All @@ -33,6 +33,7 @@ This README relates to v2.8.5.7
- An operating system selector
- A boot manager
- An OS maintenance utility:
- Backup and Restore OSes
- A recovery shell
- SD card clone utility
- Password restorer
Expand Down Expand Up @@ -146,9 +147,11 @@ There are three toolbars:
- **[Clone SD](#how-to-clone-an-sd-card)**: Clones the SD to another card.
- **[Info](#info-on-os)**: [Networking Required] Opens a browser that displays the webpage for the selected OS.
- **[Firmware](#pinns-firmware-upgradedowngrade)**: Upgrades or downgrades PINN's firmware for use on RPI3B+ or other models.
- **[Maintenance](#maintenance-ment)**
- **[Time](#set-time)**: Sets the current time.
- **[Maintenance](#maintenance-menu)**
- **[Edit Config](#easy-config-file-editor)**: Opens a text editor, allowing the `cmdline` and `config` files for the selected installed OS to be edited.
- **[Password](#how-to-recover-from-a-lost-password)**: Allows the password of an OS to be restored or replaced.
- **[Backup](#backup)**: Backup Operating Systems.
- **[Fix](#how-to-fix-an-os)**: Performs repairs on file systems of the selected installed OSes.
- **[Reinstall](#reinstall-individual-oses)**: Allows individual installed OSes to be reinstalled back to their original installation without affecting any of the other installed OSes.
- **[Replace](#replace-individual-oses)**: Allows individual installed OSes to be replaced by other/different OSes without affecting any of the other installed OSes.
Expand Down Expand Up @@ -546,7 +549,7 @@ Project Spaces are useful when used with the [Replace](#replace-individual-os) O
2. They allow multiple instances of the same OS to be installed.
3. They allow the same amount of space to be used for each OS.

When replacing a project space with another OS, remember that the new OS must have the same number of partitions as the project space and each partition must fit within the existing partition sizes. So creating 8 project spaces on a 16GB card may not be very useful as there will be <2GB left on each of the ext4 partitions. That maybe ok for some of the minimal OSes, but no good for a full Raspbian installation, for example.
When replacing a project space with another OS, remember that the new OS must have the same number of partitions as the project space and each partition must fit within the existing partition sizes. So creating 8 project spaces on a 16GB card may not be very useful as there will be &lt;2GB left on each of the ext4 partitions. That maybe ok for some of the minimal OSes, but no good for a full Raspbian installation, for example.

## PINN's Firmware Upgrade/Downgrade

Expand Down Expand Up @@ -775,6 +778,12 @@ In this way, your existing data can be migrated to a smaller or larger SD card.
_Note1: that if you have installed multiple OSes using PINN, only the last partition of the last OS on the SD card will be resized._
_Note2: The clone function can also be used to copy any USB drive to any other USB drive - it doesn't have to incldue the SD card at all._

## Set Time

The Raspberry Pi has no real time clock, but it needs to know the correct time for https transfers and to timestamp any backups.
The Pi's clock can be set automatically once it is connected to the internet, but this function can be used to set the clock manually if no internet connection is available.
If a backup is attempted with no internet connection, this function will be called first to ensure the current time is set.

<!-- ## Wipe the Drive
This option will wipe your drive of all installed OSes by deleting all the OS partitions and restore its capacity to full size by expanding the first partition to the whole disk size,
Expand Down Expand Up @@ -821,9 +830,33 @@ If you have changed your login password for an OS and forget what it is, PINN wi
7. The `Use Default` button will enter the default username and password for the selected OS.
8. Tick the `show password` box to display the passwords on the screen.

## Backup

The backup function allows an installed OS to be backed up to a USB drive. The USB drive must first be formatted as FAT32, ext4 or ntfs and have a /os folder on it to store the backups in, otherwise it will not be recognised.

Select all OSes to backup and then click the backup button. After a confirmation dialog, OSes that are not suitable for backing up will be indicated in a dialog box and deselected. These currently include Risc OS, XBian and Win10 IoT. Some other OSes have required modified setup scripts in order to restore them properly after backing up. If you are trying to backup an OS that was installed prior to this modification, PINN will try to install these modified files from an installable source. So to backup such an OS it may be necessary to connect the RPi to the internet or plug in a USB stick with the OS installation files on it.

When an OS is backed up, it is given a name that includes the current time as a suffix in the format #YYYYMMDD-HHMMSS so that backups can be readily identified. If the RPi does not know the current time because it is not connected to the internet, you will be prompted to enter the current time. PINN gives you the opportunity to change this suffix and alter the OS description in the next dialog.

OSes are backed up in NOOBS/PINN format as .tar.gz files. These do not compress as well as .tar.xz files, but require less memory and can be created faster on the RPi.
Nevertheless, compressing tar files is still a processor intensive task, so backing up an OS will take a lot longer than installing an OS, especially on some of the less powerful RPis.
Due to the compression, it is not known precisely how much disk space is required to store the backup, so PINN makes a conservative guess of 33% of the original size. It may require more or less that this amount, but if less disk space is available, a warning message is displayed, but the backup may continue if you wish. If there is insufficient disk space to complete the backup, this should be indicated. (You can also check the log in /tmp/debug for any errors.)

**Backups should be thoroughly tested that they are valid and restorable before relying upon them. This is a new PINN feature and every effort has been made to ensure it works as expected, but the author accepts no liability or responsibility for loss of data.**

After backing up an OS, it may not show up in the list of installable OSes until PINN is rebooted. After that it will appear is a separate "Backups" tab with all the other backup versions.

## Restoring Backups

There is no specific "Restore" button to restore a Backed up OS. As the backup is aready in NOOBS format, the backed up OS can be installed as any other OS to a fresh (PINN format) SD Card or USB drive, or they can be used to replace an existing OS or ProjectSpace (if it is in a compatible partition layout).

When a backed up OS is restored, PINN will fix up partition references by running the partitions_setup.sh script. However, certain tasks in that script that are only needed on an initial install will be skipped, as it is assumed they have were already done and are not needed on restoration. This also includes the copying of ssh and wpa_supplicant.conf files from the PINN partition. Flavour customisation scripts are also not executed.

Backed up OSes may be installed by NOOBS, but some OSes may not restore properly due to the need for modified setup scripts (see above) that NOOBS is not aware of.

## How to Fix an OS

If your installed OS will not boot, the Fix option in the maintenance menu may help. It provides a list of operatiosn that you may perform to fix the OS. Check all operations that you want to be performed on your selected OSes.
If your installed OS will not boot, the Fix option in the maintenance menu may help. It provides a list of operations that you may perform to fix the OS. Check all operations that you want to be performed on your selected OSes.

![alt text](screenshots/fix.png "Fix an OS options.")

Expand All @@ -837,7 +870,7 @@ To recover from a corrupted drive, PINN includes a file system check option whic

### Re-run partition_setup.sh

Installed OSes may be upgraded using their standard upgrade procedure (e.g. sudo update;sudo upgrade etc.). However, some OS upgrade procedures may not be aware that they are running in a multi-boot environment and may break the changes PINN made to allow them to work. In this situation, re-running the OSes partition_setup.sh script should fix-up these changes to allow the OS to boot properly.
Installed OSes may be upgraded using their standard upgrade procedure (e.g. sudo update;sudo upgrade etc.). However, some OS upgrade procedures may not be aware that they are running in a multi-boot environment and may break the changes PINN made to allow them to work. In this situation, re-running the OSes partition_setup.sh script should fix-up these changes to allow the OS to boot properly. From v3.0, PINN will now skip initial installation tasks in this script and it is restricted to fixing up partition references.

## Reinstall Individual OSes

Expand Down
13 changes: 11 additions & 2 deletions README_SUM.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ Please note that in some cases it may extract the files into a folder, if this i

## Change History

## V3.0

- **Backup** - Backup an OS in PINN format
- **Time** - Added button to set date & time
- **Download** - Fix Foldername of some OSes when downloaded
- **Iconcache** - Cache icons when connected to internet to speedup startup

## V2.8.5.8

- **RPi 3A+** - Supports RPi 3A+

## V2.8.5.7

- **Firmware** - Disabled firmware downgrade on 3B+
Expand Down Expand Up @@ -332,5 +343,3 @@ A major change to the User Interface in preparation for some new features.
- **NOOBSCONFIG support** - Allow customisation of an OS installation as it installs
- **SSH support** - SSH remotely into you PINN installation.
- **Progress** - View your installation progress via alternative means


6 changes: 2 additions & 4 deletions buildroot/package/dropbear/S50dropbear
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ test -r /etc/default/dropbear && . /etc/default/dropbear
start() {
DROPBEAR_ARGS="$DROPBEAR_ARGS -R"

echo -n "Starting dropbear sshd: "
umask 077
start-stop-daemon -S -q -p /var/run/dropbear.pid \
--exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
[ $? = 0 ] && echo "OK" || echo "FAIL"
[ $? = 0 ] && echo "" || echo "Starting dropbear sshd: FAIL"
}
stop() {
echo -n "Stopping dropbear sshd: "
start-stop-daemon -K -q -p /var/run/dropbear.pid
[ $? = 0 ] && echo "OK" || echo "FAIL"
[ $? = 0 ] && echo "" || echo "Stopping dropbear sshd: FAIL"
}
restart() {
stop
Expand Down
16 changes: 15 additions & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Fixes the incorrect recovery.cmdline bug in v2.5.2.
- **Reserve disk space** - Reserve some space on PINN's partition before formatting
- **mkimage** - Added mkimage from uboot
- **xz** - Allow XZ Compression
- **Update Dialog** - This now cancels any timeout setting
5885253- **Update Dialog** - This now cancels any timeout setting

## V2.8.5

Expand Down Expand Up @@ -445,3 +445,17 @@ Fixes the incorrect recovery.cmdline bug in v2.5.2.
- **SilentInstall** - Fixed waiting for USB images
- **networktimeout** - 0 means wait indefinitely for network before silentinstall

## V2.8.5.8

- **RPi 3A+** - Supports RPi 3A+

## V3.0

- **Backup** - Backup an OS in PINN format
- **Time** - Added button to set date & time
- **Download** - Fixed foldername of some OSes when downloaded
- **Iconcache** - Cache icons when connected to internet to speed up startup




15 changes: 14 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
set -x

# backup the source code to pinn
#===============================
cd ~/pinn
git checkout p2.4.5a
cd ~/noobs_test
Expand All @@ -15,18 +17,24 @@ git add README_PINN.md
git commit --amend

# Copy the distributable files
#=============================

cp history.md ../pinn-release/README.md

cd ~/noobs_test/output
# remove anything existing
dst=~/pinn-release/dist/
rm -rf $dst/*

cd ~/noobs_test/output
cp *.dtb $dst
cp bootcode.bin $dst
cp BUILD-DATA $dst
cp INSTRUC* $dst
cp -r defaults $dst
cp -r os $dst
cp -r overlays $dst
cp -r wallpapers $dst
cp wallpapers/wallpaper1.png $dst/wallpaper.png
cp *.img $dst
cp recovery* $dst
cp riscos-boot.bin $dst
Expand All @@ -39,13 +47,18 @@ cp ~/pinn-os/os/overrides.json $dst
cp config.txt $dst

# Make amendments
#================
cp ~/pinn-release/recovery.cmdline $dst
cp ~/pinn-release/recovery.cmdline.new $dst

# Create the Zip file
#====================
cd $dst
zip -r ../pinn-lite.zip *
cp BUILD-DATA ..
cd ..

# Create other formats
#=====================
./create_etcher_img
./create_full
11 changes: 11 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ PINN is a version of the NOOBS Operating System Installer for the Raspberry Pi w

## Change History

## V3.0

- **Backup** - Backup an OS in PINN format
- **Time** - Added button to set date & time
- **Download** - Fixed foldername of some OSes when downloaded
- **Iconcache** - Cache icons when connected to internet to speedup startup

## V2.8.5.8

- **RPi 3A+** - Supports RPi 3A+

## V2.8.5.7

- **Firmware** - Disabled firmware downgrade on 3B+
Expand Down
60 changes: 60 additions & 0 deletions recovery/backupdialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include "json.h"
#include "backupdialog.h"
#include "util.h"
#include "ui_backupdialog.h"

#include <QDebug>

backupdialog::backupdialog(QVariantMap &Map, QWidget *parent) :
QDialog(parent),
ui(new Ui::backupdialog), _map(Map)
{
ui->setupUi(this);

QString description;
QString name;
QString datetime;

QString fullname;
if (_map.contains("backupName"))
fullname = _map.value("backupName").toString();
else if (_map.contains("name"))
fullname = _map.value("name").toString();

name = getNameParts(fullname, eCORE);
datetime = getNameParts(fullname, eDATE|eSPLIT);

if (_map.contains("description"))
description = _map.value("description").toString();

ui->nameEdit->setText(name);
ui->datetimeEdit->setText(datetime);
ui->descriptionEdit->setText(description);
}

backupdialog::~backupdialog()
{
delete ui;
}


void backupdialog::on_buttonBox_accepted()
{
QString core = ui->nameEdit->text();
QString datetime = ui->datetimeEdit->text();
QString description = ui->descriptionEdit->text();

datetime.remove(QChar('#'));
datetime.remove(QChar('='));
datetime.remove(QChar('@'));

//Set backupName to datetime
QString name = _map.value("backupName").toString();
QStringList parts = splitNameParts(name);
setNameParts(parts, eDATE, datetime);
name = joinNameParts(parts);

//Update map with new name & Description
_map["backupName"] = name.replace(" ","_");
_map["description"] = description;
}
27 changes: 27 additions & 0 deletions recovery/backupdialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef backupdialog_H
#define backupdialog_H

#include <QDialog>
#include <QVariantMap>

namespace Ui {
class backupdialog;
}

class backupdialog : public QDialog
{
Q_OBJECT

public:
explicit backupdialog(QVariantMap &map, QWidget *parent = 0);
~backupdialog();

private slots:
void on_buttonBox_accepted();

private:
Ui::backupdialog *ui;
QVariantMap &_map;
};

#endif // backupdialog_H
Loading

0 comments on commit 6a8ee42

Please sign in to comment.