Skip to content

Commit

Permalink
Change splash screen behaviour and resized it. Add .tar images and fi…
Browse files Browse the repository at this point in the history
…xed boot_sticky partuuids.

minor correction to history.md
Stops wallpaper disappearing
Change Boot tab order
Added splash
integrated splash
Wallpaper_resize
Add SHIFT message. Prevent default wallpaper resize
More partuuid issues in boot_sticky
Add .tar file images
factored partuuid for boot_sticky
  • Loading branch information
procount committed Sep 6, 2018
1 parent 9da5b5f commit e4dbfd7
Show file tree
Hide file tree
Showing 40 changed files with 2,899 additions and 2,796 deletions.
672 changes: 317 additions & 355 deletions README.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 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.3
This README relates to v2.8.5.4

<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 Down Expand Up @@ -184,7 +184,7 @@ In addition to the toolbars, the following functionality is provided:
- <b>Background colour</b>: To change the background colour for the screen and most windows, add `background=r,g,b` to recovery.cmdline, where 0,0,0 is black and 255,255,255 is white.
- <b>style</b>: The style of the windows display can be modified by adding `style=motif/windows/platinum` to recovery.cmdline
- <b>Wallpaper</b>: The background wallpaper of PINN can be changed by adding your own `wallpaper.png` file to PINN's recovery partition.

- <b>wallpaper_resize</b>: A custom wallpaper can be resized to fill the entire desktop by adding this option.
Note that all user settings (language, keyboard layout, display mode) will persist between reboots and will also be automatically passed to the installed OSes. This means that if you can see the PINN interface on your display device, you should be able to see the OS CLI/GUI when it boots too.

## User Control
Expand Down Expand Up @@ -426,6 +426,8 @@ In addition to specifying a list of OS names, some reserved words are also avail

- **background=\<r,g,b\>**: To change the background colour for the screen and most windows, add `background=r,g,b`, where 0,0,0 is black and 255,255,255 is white. I suggest to use values above 127.

- **wallpaper_resize**: Causes a customised wallpaper.png file to be resized to fill the entire desktop. As an alternative to 'background', a small (8x8) png file can be used to fill the desktop only with a particular colour, leaving the background of the other windows alone.

- **style=**: The style of the windows display can be modified to one of `motif`, `windows` or `platinum`

<!-- fixate not documented -->
Expand Down
6 changes: 5 additions & 1 deletion buildroot/package/recovery/init
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ fi
REPO_LIST=
DEFAULT_STYLE=
DEFAULT_DRIVE=
DEFAULT_WALLPAPER_RESIZE=

if grep -q runinstaller /proc/cmdline; then
RUN_INSTALLER=-runinstaller
fi
if grep -q wallpaper_resize /proc/cmdline; then
DEFAULT_WALLPAPER_RESIZE=-wallpaper_resize
fi
if grep -q gpiotriggerenable /proc/cmdline; then
GPIO_TRIGGER=-gpiotriggerenable
fi
Expand Down Expand Up @@ -173,7 +177,7 @@ fi
echo
fi

/usr/bin/recovery $RUN_INSTALLER $GPIO_TRIGGER $KEYBOARD_NO_TRIGGER $FORCE_TRIGGER $DEFAULT_KBD $DEFAULT_LANG $DEFAULT_DISPLAY $DEFAULT_PARTITION $DEFAULT_NOCONFIG $DEFAULT_DSI $DEFAULT_REPOS $EXTRA_REPOS $REPO_LIST $DEFAULT_STYLE $DEFAULT_DRIVE -qws 2>/tmp/debug
/usr/bin/recovery $RUN_INSTALLER $GPIO_TRIGGER $KEYBOARD_NO_TRIGGER $FORCE_TRIGGER $DEFAULT_KBD $DEFAULT_LANG $DEFAULT_DISPLAY $DEFAULT_PARTITION $DEFAULT_NOCONFIG $DEFAULT_DSI $DEFAULT_REPOS $EXTRA_REPOS $REPO_LIST $DEFAULT_STYLE $DEFAULT_DRIVE $DEFAULT_WALLPAPER_RESIZE -qws 2>/tmp/debug


# Recovery should have rebooted
Expand Down
4 changes: 4 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,7 @@ Fixes the incorrect recovery.cmdline bug in v2.5.2.
- **Partuuid** - Fixed an issue from v2.8 where partuuids were introduced to installed_os.json
- **Wallpaper** - Customised wallpaper is now available by writing your own `wallpaper.png` file to PINN's recovery partition

## V2.8.5.4

- **Boot menu** - Fixed focus and sticky default partuuid issues.
- **wallpaper_resize** - Customised wallpaper can now be resized to fill the screen
7 changes: 6 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ PINN is a version of the NOOBS Operating System Installer for the Raspberry Pi w

## Change History

## V2.8.5.4

- **Boot menu** - Fixed focus and sticky default partuuid issues.
- **wallpaper_resize** - Customised wallpaper can now be resized to fill the screen

## V2.8.5.3

- **Partuuid** - Fixed an issue from v2.8 where partuuids were introduced to installed_os.json
- **Wallpaper** - Customised wallpaper is now available by writing your own `wallpaper.png` file to PINN's recovery partition## V2.8.5.1
- **Wallpaper** - Customised wallpaper is now available by writing your own `wallpaper.png` file to PINN's recovery partition

## V2.8.5.2

Expand Down
72 changes: 26 additions & 46 deletions recovery/bootselectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

#include "bootselectiondialog.h"
#include "ui_bootselectiondialog.h"
#include "config.h"
#include "json.h"
#include "util.h"
#include "ceclistener.h"
#include "config.h"
#include "countdownfilter.h"
#include "json.h"
#include "mydebug.h"
#include "sleepsimulator.h"
#include "util.h"

#include <stdio.h>
#include <QAbstractButton>
Expand Down Expand Up @@ -161,28 +162,25 @@ BootSelectionDialog::BootSelectionDialog(const QString &drive, const QString &de
QString partnrStr = QString::number(partition);
QString stickynrStr = QString::number(oldSticky);

qDebug() << "partnrStr = " << partnrStr;
qDebug() << "stickynrStr = " << stickynrStr;
qDebug() << "partnr = " << partition;
qDebug() << "stickynr = " << oldSticky;

QRegExp partnrRx("([0-9]+)$");
for (int i=0; i<ui->list->count(); i++)
{
QVariantMap m = ui->list->item(i)->data(Qt::UserRole).toMap();
QString bootpart = m.value("partitions").toList().first().toString();
QByteArray ba_bootpart = m.value("partitions").toList().first().toString().toLocal8Bit();
int bootpart = extractPartitionNumber( ba_bootpart );
qDebug() << "Partition " << i << " = " << bootpart;
if (partnrRx.indexIn(bootpart) != -1)

if (bootpart == partition)
{
qDebug() << "Previous OS " << bootpart << " at " <<i;
ui->list->setCurrentRow(i);
}
if (bootpart == oldSticky)
{
qDebug() << "partnrRx = " << partnrRx.cap(1);
if (partnrRx.cap(1) == partnrStr)
{
qDebug() << "Previous OS " << bootpart << " at " <<i;
ui->list->setCurrentRow(i);
}
if (partnrRx.cap(1) == stickynrStr)
{
qDebug() << "found sticky at " << i;
ui->list->item(i)->setCheckState(Qt::Checked);
}
qDebug() << "found sticky at " << i;
ui->list->item(i)->setCheckState(Qt::Checked);
}
}
}
Expand Down Expand Up @@ -232,29 +230,7 @@ void BootSelectionDialog::accept()
QVariantMap m = item->data(Qt::UserRole).toMap();
QByteArray partition = m.value("partitions").toList().first().toByteArray();

QRegExp parttype("^PARTUUID");
int partitionNr;
if (parttype.indexIn(partition) == -1)
{ // Old style /dev/mmcblk0pDD
QRegExp partnrRx("([0-9]+)$");
if (partnrRx.indexIn(partition) == -1)
{
QMessageBox::critical(this, "installed_os.json corrupt", "Not a valid partition: "+partition);
return;
}
partitionNr = partnrRx.cap(1).toInt();
}
else
{ //USB style PARTUUID=000dbedf-XX
QRegExp partnrRx("([0-9a-f][0-9a-f])$");
if (partnrRx.indexIn(partition) == -1)
{
QMessageBox::critical(this, "installed_os.json corrupt", "Not a valid partition: "+partition);
return;
}
bool ok;
partitionNr = partnrRx.cap(1).toInt(&ok, 16);
}
int partitionNr = extractPartitionNumber(partition);

int oldpartitionNr = settings.value("default_partition_to_boot", 0).toInt();

Expand All @@ -277,11 +253,12 @@ void BootSelectionDialog::accept()
if (state == Qt::Checked)
{
QVariantMap m = row->data(Qt::UserRole).toMap();
QByteArray partition = m.value("partitions").toList().first().toByteArray();
QRegExp partnrRx("([0-9]+)$");
if (partnrRx.indexIn(partition) != -1)
QByteArray partition = m.value("partitions").toList().first().toString().toLocal8Bit();

int p = extractPartitionNumber(partition);
if (p!= 800)
{
stickyBoot = partnrRx.cap(1).toInt();
stickyBoot = p;
}
}
}
Expand All @@ -308,6 +285,8 @@ void BootSelectionDialog::accept()

void BootSelectionDialog::setDisplayMode()
{
MSG();

#ifdef Q_WS_QWS
QString cmd, mode;
QSettings settings("/settings/noobs.conf", QSettings::IniFormat, this);
Expand Down Expand Up @@ -363,6 +342,7 @@ void BootSelectionDialog::setDisplayMode()
qApp->processEvents();
QWSServer::instance()->refresh();
#endif
MSG();
}

void BootSelectionDialog::countdown(int count)
Expand Down
2 changes: 1 addition & 1 deletion recovery/bootselectiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private slots:
int _countdown;
void updateConfig4dsi(QByteArray partition);
bool _dsi;
int extractPartition(QVariantMap m);
//int extractPartition(QVariantMap m);

private:
Ui::BootSelectionDialog *ui;
Expand Down
5 changes: 4 additions & 1 deletion recovery/bootselectiondialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel</set>
</property>
Expand Down Expand Up @@ -90,9 +93,9 @@
</layout>
</widget>
<tabstops>
<tabstop>list</tabstop>
<tabstop>pushButton</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>list</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
2 changes: 1 addition & 1 deletion recovery/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CONFIG_H

/* Version number displayed in the title bar */
#define VERSION_NUMBER "2.8.5.3"
#define VERSION_NUMBER "2.8.5.4"

/* Color of the background */
// #define BACKGROUND_COLOR Qt::white
Expand Down
15 changes: 12 additions & 3 deletions recovery/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
#include "util.h"
#include "bootselectiondialog.h"
#include "ceclistener.h"
#include "mydebug.h"
#include "splash.h"

#include <stdio.h>
#include <unistd.h>
#include <QApplication>
#include <QBitmap>
#include <QStyle>
#include <QDesktopWidget>
#include <QSplashScreen>
//#include <QSplashScreen>
#include <QFile>
#include <QIcon>
#include <QProcess>
Expand Down Expand Up @@ -200,6 +202,7 @@ int main(int argc, char *argv[])
bool force_trigger = false;
bool noobsconfig = true;
bool use_default_source = true;
bool wallpaper_resize = false;

QString defaultLang = "en";
QString defaultKeyboard = "gb";
Expand All @@ -212,6 +215,8 @@ int main(int argc, char *argv[])
// Flag to indicate first boot
if (strcmp(argv[i], "-runinstaller") == 0)
runinstaller = true;
if (strcmp(argv[i], "-wallpaper_resize") == 0)
wallpaper_resize = true;
// Enables use of GPIO 3 to force NOOBS to launch by pulling low
else if (strcmp(argv[i], "-gpiotriggerenable") == 0)
gpio = new GpioInput(gpioChannel);
Expand Down Expand Up @@ -360,6 +365,7 @@ int main(int argc, char *argv[])
else
{
pixmap.load(":/wallpaper.png");
wallpaper_resize = false; //We don't want the standard logo resized - it looks really bad
}
QString cmdline = getFileContents("/proc/cmdline");
QStringList args = cmdline.split(QChar(' '),QString::SkipEmptyParts);
Expand Down Expand Up @@ -409,9 +415,11 @@ int main(int argc, char *argv[])
#ifdef Q_WS_QWS
QWSServer::setBackground(backgroundColour);
#endif
QSplashScreen *splash = new QSplashScreen(pixmap);
KSplash *splash = new KSplash(pixmap,0,wallpaper_resize);

splash->show();
splash->resize();
splash->showMessage("For recovery mode, hold SHIFT...");
QApplication::processEvents();

//------------------------------------------------
Expand Down Expand Up @@ -451,13 +459,14 @@ int main(int argc, char *argv[])
}
}

splash->clearMessage();

QProcess::execute("umount /mnt"); //restore mounted behaviour

cec->clearKeyPressed();

if (bailout)
{
splash->hide();
showBootMenu(drive, defaultPartition, true);
}

Expand Down
19 changes: 16 additions & 3 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "mydebug.h"
#include "countdownfilter.h"
#include "replace.h"
#include "mydebug.h"
#include "splash.h"

#include <QByteArray>
#include <QMessageBox>
Expand All @@ -38,7 +40,7 @@
#include <QKeyEvent>
#include <QApplication>
#include <QScreen>
#include <QSplashScreen>
//#include <QSplashScreen>
#include <QDesktopWidget>
#include <QSettings>
#include <QtNetwork/QNetworkAccessManager>
Expand Down Expand Up @@ -136,7 +138,7 @@ void MainWindow::expired(void)
close();
}

MainWindow::MainWindow(const QString &drive, const QString &defaultDisplay, QSplashScreen *splash, bool noobsconfig, QWidget *parent) :
MainWindow::MainWindow(const QString &drive, const QString &defaultDisplay, KSplash *splash, bool noobsconfig, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
_qpd(NULL), _kcpos(0), _defaultDisplay(defaultDisplay),
Expand Down Expand Up @@ -1467,7 +1469,18 @@ void MainWindow::displayMode(int modenr, bool silent)
resize(w,h);

// Update UI item locations
//@@ _splash->setPixmap(QPixmap(":/wallpaper.png")); //Comment out for now whilst changing pixmap background
// QPixmap pixmap;
// if (QFile::exists("/mnt/wallpaper.png"))
// {
// pixmap.load("/mnt/wallpaper.png");
// }
// else
// {
// pixmap.load(":/wallpaper.png");
// }
_splash->resize();
_splash->setPixmap(_splash->pixmap()); //reposition, keeping same image.

LanguageDialog *ld = LanguageDialog::instance("en", "gb");
ld->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignHCenter | Qt::AlignBottom, ld->size(), qApp->desktop()->availableGeometry()));
this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry()));
Expand Down
7 changes: 4 additions & 3 deletions recovery/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#include "osgroup.h"
#include "countdownfilter.h"
#include "repair.h"
#include "splash.h"

#include <QMainWindow>
#include <QModelIndex>
#include <QSplashScreen>
//#include <QSplashScreen>
#include <QMessageBox>
#include <QTimer>
#include <QTime>
Expand All @@ -38,7 +39,7 @@ class MainWindow : public QMainWindow
Q_OBJECT

public:
explicit MainWindow(const QString &drive, const QString &defaultDisplay, QSplashScreen *splash, bool noobsconfig, QWidget *parent = 0);
explicit MainWindow(const QString &drive, const QString &defaultDisplay, KSplash *splash, bool noobsconfig, QWidget *parent = 0);
~MainWindow();

protected:
Expand All @@ -54,7 +55,7 @@ class MainWindow : public QMainWindow
bool _silent, _allowSilent, _showAll, _fixate, _usbimages, _sdimages;
static bool _partInited;
static int _currentMode;
QSplashScreen *_splash;
KSplash *_splash;
QSettings *_settings;
bool _hasWifi;
int _numInstalledOS, _numBootableOS, _devlistcount;
Expand Down
2 changes: 1 addition & 1 deletion recovery/multiimagewritethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ bool MultiImageWriteThread::processImage(OsInfo *image)
if (fstype == "raw" || fstype.startsWith("partclone"))
tarball = findTarballExt(image->folder()+"/"+label,".img.lzo,.img.gz,.img.bz2,.img.zip,.img.xz,.lzo,.gz,.bz2,.zip,.xz");
else
tarball = findTarballExt(image->folder()+"/"+label,".tar.lzo,.tar.gz,.tar.bz2,.tar.zip,.tar.xz");
tarball = findTarballExt(image->folder()+"/"+label,".tar.lzo,.tar.gz,.tar.bz2,.tar.zip,.tar.xz,.tar");

if (!QFile::exists(tarball))
{
Expand Down
Loading

0 comments on commit e4dbfd7

Please sign in to comment.