Skip to content

Commit

Permalink
3.8.4 Better debug options. Added mkswap option for fs.
Browse files Browse the repository at this point in the history
  • Loading branch information
procount committed Feb 11, 2023
1 parent a566dc9 commit 24ba917
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 31 deletions.
2 changes: 1 addition & 1 deletion BUILDME.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,5 @@ echo "rpi-linux Git rpi-$KERNEL.y @ $(get_kernel_version)" >> "$BUILD_INFO"

cd ..

clear
#clear
echo "Build complete. Copy files in '$NOOBS_OUTPUT_DIR' directory onto a clean FAT formatted SD card to use."
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.8.4

- **Security** - Fixed Secure remote SSH and VNC access
- **Images** - Added support for mkswap in OS images

### V3.8.3

- **NVMe** - Support for booting on NVMe drives on CM4
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 "3.8.3a"
#define VERSION_NUMBER "3.8.4"

/* Color of the background */
// #define BACKGROUND_COLOR Qt::white
Expand Down
7 changes: 4 additions & 3 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include "dlginstall.h"

#define LOCAL_DBG_ON 0
#define LOCAL_DBG_FUNC 0
#define LOCAL_DBG_OUT 0
#define LOCAL_DBG_MSG 0
#define LOCAL_DBG_FUNC 1
#define LOCAL_DBG_OUT 1
#define LOCAL_DBG_MSG 1

#include "mydebug.h"

Expand Down Expand Up @@ -882,6 +882,7 @@ QMap<QString, QVariantMap> MainWindow::listImages(const QString &folder)
images[name] = osv;
}
}
DBG(osv);
}
DBG("-------");
for (QMap<QString,QVariantMap>::iterator i = images.begin(); i != images.end(); i++)
Expand Down
43 changes: 25 additions & 18 deletions recovery/multiimagewritethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#include "partitioninfo.h"
#include "util.h"

#define LOCAL_DBG_ON 0
#define LOCAL_DBG_FUNC 0
#define LOCAL_DBG_OUT 0
#define LOCAL_DBG_MSG 0
#define LOCAL_DBG_ON 1
#define LOCAL_DBG_FUNC 1
#define LOCAL_DBG_OUT 1
#define LOCAL_DBG_MSG 1

#include "mydebug.h"
#include <QDir>
Expand Down Expand Up @@ -1396,25 +1396,32 @@ bool MultiImageWriteThread::mkfs(const QByteArray &device, const QByteArray &fst
cmd += "-L "+makeLabelUnique(label, 16, device)+" "; //maxlength might be 255?
}
}
else if (fstype == "swap")
{
cmd = "/sbin/mkswap ";
}

if (!mkfsopt.isEmpty())
cmd += mkfsopt+" ";
if (!cmd.isEmpty())
{
if (!mkfsopt.isEmpty())
cmd += mkfsopt+" ";

cmd += device;
cmd += device;

qDebug() << "Executing:" << cmd;
QProcess p;
p.setProcessChannelMode(p.MergedChannels);
p.start(cmd);
p.closeWriteChannel();
p.waitForFinished(-1);
qDebug() << "Executing:" << cmd;
QProcess p;
p.setProcessChannelMode(p.MergedChannels);
p.start(cmd);
p.closeWriteChannel();
p.waitForFinished(-1);

if (p.exitCode() != 0)
{
emit error(tr("Error creating file system")+"\n"+p.readAll());
return false;
if (p.exitCode() != 0)
{
DBG(p.exitCode());
emit error(tr("Error creating file system")+"\n"+p.readAll());
return false;
}
}

return true;
}

Expand Down
18 changes: 10 additions & 8 deletions recovery/mydebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#define GLOBAL_DBG_ON 0 //Use the global data everywhere (overrides ths other globals. sets them to 0)

#if GLOBAL_DBG_ON
#define GLOBAL_DBG_FUNC 0 //global Debug entry/exit of functions
#define GLOBAL_DBG_OUT 0 //global Debug output strings
#define GLOBAL_DBG_MSG 0 //global Debug message boxes
#define GLOBAL_DBG_FUNC 1 //global Debug entry/exit of functions
#define GLOBAL_DBG_OUT 1 //global Debug output strings
#define GLOBAL_DBG_MSG 1 //global Debug message boxes
#else
#define GLOBAL_DBG_FUNC 0 //global Debug entry/exit of functions
#define GLOBAL_DBG_OUT 0 //global Debug output strings
Expand Down Expand Up @@ -45,14 +45,16 @@

#if GLOBAL_ENABLE_DEBUG

#define MYDEBUG MyDebug dbg(__PRETTY_FUNCTION__, DBG_FUNC)
#define TRACE MYDEBUG;
#define PARAMS qDebug() << dbg.header() << (const char *)"Params:"
#define MYDEBUG(x) MyDebug dbg(__PRETTY_FUNCTION__, x);
#define TRACE MYDEBUG(DBG_FUNC);
#define TRACEIF(x) MYDEBUG(x);

#define PARAMS if (dbg._display) qDebug() << dbg.header() << (const char *)"Params:"
#define INDENT(n) dbg._local_level+=n
#define OUTDENT(n) dbg._local_level-=n

#if DBG_OUT
#define DBG2 qDebug() << dbg.header() <<""
#define DBG2 if (dbg._display==1) qDebug() << dbg.header() << ""
#define DBG(x) DBG2 << x
#else
#define DBG2 QNoDebug()
Expand All @@ -72,12 +74,12 @@ class MyDebug
MyDebug(const char * funcname, int display=0);
~MyDebug();
int _local_level;
int _display;

const char * header();
private:
QString _name;
static int _level;
int _display;
};

#else //GLOBAL_ENABLE_DEBUG
Expand Down
2 changes: 2 additions & 0 deletions recovery/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ void OverrideJson(QVariantMap& m)
name = CORE(m.value("os_name").toString());
else
return;
DBG(name);

SupplantUSBdevice(m);

Expand Down Expand Up @@ -743,4 +744,5 @@ void OverrideJson(QVariantMap& m)
m.remove(key);
}
}
DBG(m);
}

0 comments on commit 24ba917

Please sign in to comment.