Skip to content

Commit

Permalink
p3.9.2 Modified update process. Fixed HDMI1
Browse files Browse the repository at this point in the history
  • Loading branch information
procount committed May 22, 2024
1 parent c2d7fc2 commit 736c745
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 83 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

---
name: Bug report
about: Create a report to help us fix your issue

---


**Describe the bug**
Add a clear and concise description of what you think the bug is.

**To reproduce**
List the steps required to reproduce the issue.

**Expected behaviour**
Add a clear and concise description of what you expected to happen.

**Actual behaviour**
Add a clear and concise description of what actually happened.

**System**
Add answers to the following questions:

* Which model of Raspberry Pi? e.g. Pi3B+, PiZeroW
* Which version of PINN?

**Logs**
If applicable, add the relevant output from `/tmp/debug` or `dmesg`.

**Additional context**
Add any other relevant context for the problem.
5 changes: 5 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ PINN is a version of the NOOBS Operating System Installer for the Raspberry Pi w

## Change History

### V3.9.2

- **HDMI2** - fixed crash when using HDMI2 on Pi4
- **Translation** - Updated Czech translation

### V3.9.1

- **Update** - Update Italian. Update process deletes all of boot.
Expand Down
2 changes: 1 addition & 1 deletion recovery/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


/* Version number displayed in the title bar */
#define VERSION_NUMBER "3.9.1"
#define VERSION_NUMBER "3.9.2"

/* Color of the background */
// #define BACKGROUND_COLOR Qt::white
Expand Down
3 changes: 3 additions & 0 deletions recovery/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ fixup_file=fixup.dat
disable_overscan=1
initramfs pinn.rfs

[HDMI1]
hdmi_force_hotplug=1

[pi4]
start_file=start4.elf
fixup_file=fixup4.dat
Expand Down
2 changes: 1 addition & 1 deletion recovery/initdrivethread.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class InitDriveThread : public QThread
bool formatUsbDrive();
static bool saveBootFiles();
static bool restoreBootFiles();
static int sizeofBootFilesInKB();

protected:
virtual void run();

bool method_resizePartitions();
int sizeofBootFilesInKB();
uint sizeofSDCardInBlocks();
bool mountSystemPartition();
bool umountSystemPartition();
Expand Down
52 changes: 16 additions & 36 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4636,23 +4636,15 @@ int MainWindow::updatePinn()
int error=0;
int dummy;
//When PINN is updated, We don't need these files to be extracted
QString exclusions = " -x cmdline.txt -x updatepinn -x exclude.txt";
QString exclusions = " -x cmdline.txt -x preupdate -x postupdate -x exclude.txt";

readexec(1,"mount -o remount,rw /mnt",dummy);

//First we'll extract these 2 files to /tmp to automate hte update process
readexec(1,"unzip /tmp/pinn-lite.zip -o exclude.txt updatepinn preupdate -d /tmp",dummy);
//First we'll extract these 2 files to /tmp to automate the update process
readexec(1,"unzip /tmp/pinn-lite.zip -o exclude.txt preupdate postupdate -d /tmp",dummy);


//Save the existing installation in case of failure
if (_qpdup)
((QProgressDialog*)_qpdup)->setLabel( new QLabel(tr("Saving current version")));
QApplication::processEvents();


InitDriveThread::saveBootFiles();

//In case we need to do some additional upgrade processing
//In case we need to do some additional pre-update processing
if (QFile::exists("/tmp/preupdate"))
{
if (_qpdup)
Expand Down Expand Up @@ -4685,35 +4677,23 @@ int MainWindow::updatePinn()

QString cmd = "unzip /tmp/pinn-lite.zip -o" + exclusions + " -d /mnt";
readexec(1,cmd,dummy);

//In case we need to do some additional upgrade processing
if (QFile::exists("/tmp/updatepinn"))
{
if (_qpdup)
((QProgressDialog*)_qpdup)->setLabel( new QLabel(tr("Executing updatepinn")));
QApplication::processEvents();

QProcess::execute("chmod +x /tmp/updatepinn");
error = QProcess::execute("/tmp/updatepinn");
}
}
if (error)
{
int dummy;
QString cmd;

qDebug() << "preupdate failed.";
cmd = "sh -c \" cd /mnt; rm -rf *\"";
QString type = readexec(1,cmd, dummy);

//In case we need to do some additional upgrade processing
if (QFile::exists("/tmp/postupdate"))
{
if (_qpdup)
{
((QProgressDialog*)_qpdup)->setLabel( new QLabel(tr("Update failed. Restoring previous version.")));
QApplication::processEvents();
}
((QProgressDialog*)_qpdup)->setLabel( new QLabel(tr("Executing postupdate")));
QApplication::processEvents();

InitDriveThread::restoreBootFiles();
QProcess::execute("chmod +x /tmp/postupdate");
QString cmd = "/tmp/postupdate " + QString::number(error);
QProcess::execute(cmd);
}

if (error)
{
qDebug() << "update failed.";
}

QProcess::execute("mount -o remount,ro /mnt");
Expand Down
Loading

0 comments on commit 736c745

Please sign in to comment.