Skip to content

Commit

Permalink
FIx for new boot system
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronDewes committed Aug 23, 2020
1 parent 758683a commit 7fe60ca
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
20 changes: 11 additions & 9 deletions BUILDME.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ if [ $SKIP_KERNEL_REBUILD -ne 1 ]; then
select_kernelconfig armv7l
make linux-reconfigure
# copy ARMv7L kernel
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/recovery7l.img"
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/kernel7l.img"
else
echo "Warning: kernel armv7l in '$NOOBS_OUTPUT_DIR' directory hasn't been updated"
fi
Expand All @@ -229,7 +229,7 @@ if [ $SKIP_KERNEL_REBUILD -ne 1 ]; then
select_kernelconfig armv7
make linux-reconfigure
# copy ARMv7 kernel
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/recovery7.img"
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/kernel7.img"
else
echo "Warning: kernel armv7 in '$NOOBS_OUTPUT_DIR' directory hasn't been updated"
fi
Expand All @@ -239,7 +239,7 @@ if [ $SKIP_KERNEL_REBUILD -ne 1 ]; then
select_kernelconfig armv6
make linux-reconfigure
# copy ARMv6 kernel
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/recovery.img"
cp "$IMAGES_DIR/zImage" "$FINAL_OUTPUT_DIR/kernel.img"
else
echo "Warning: kernel armv6 in '$NOOBS_OUTPUT_DIR' directory hasn't been updated"
fi
Expand All @@ -257,20 +257,22 @@ cp "$IMAGES_DIR/rootfs.squashfs" "$FINAL_OUTPUT_DIR/recovery.rfs"
#cp "$IMAGES_DIR/rootfs.cpio.lzo" "$FINAL_OUTPUT_DIR/recovery.rfs"

# Ensure that final output dir contains files necessary to boot
cp "$IMAGES_DIR/rpi-firmware/start.elf" "$FINAL_OUTPUT_DIR/recovery.elf"

cp "$IMAGES_DIR/rpi-firmware/start4.elf" "$FINAL_OUTPUT_DIR/recover4.elf"
cp "$IMAGES_DIR/rpi-firmware/fixup.dat" "$FINAL_OUTPUT_DIR/fixup.dat"
cp "$IMAGES_DIR/rpi-firmware/fixup4.dat" "$FINAL_OUTPUT_DIR/fixup4.dat"
cp "$IMAGES_DIR/rpi-firmware/start.elf" "$FINAL_OUTPUT_DIR/start.elf"
cp "$IMAGES_DIR/rpi-firmware/start4.elf" "$FINAL_OUTPUT_DIR/start4.elf"

cp "$IMAGES_DIR/rpi-firmware/bootcode.bin" "$FINAL_OUTPUT_DIR"
cp -a $IMAGES_DIR/*.dtb "$IMAGES_DIR/overlays" "$FINAL_OUTPUT_DIR"
cp "$IMAGES_DIR/cmdline.txt" "$FINAL_OUTPUT_DIR/recovery.cmdline"
cp "$IMAGES_DIR/recovery.cmdline.new" "$FINAL_OUTPUT_DIR"
cp "$IMAGES_DIR/rpi-firmware/config.txt" "$FINAL_OUTPUT_DIR/config.txt"
cp "$IMAGES_DIR/cmdline.txt" "$FINAL_OUTPUT_DIR/cmdline.txt"
cp "$IMAGES_DIR/cmdline.txt.new" "$FINAL_OUTPUT_DIR"
touch "$FINAL_OUTPUT_DIR/RECOVERY_FILES_DO_NOT_EDIT"

#Use the latest PINN firmware
pushd "$FINAL_OUTPUT_DIR"
bsdtar xvfz firmware.tar.gz
cp bootcode.bin recovery.elf firmware.latest
cp bootcode.bin start.elf fixup.dat firmware.latest
bsdtar cvfz firmware.tar.gz firmware.*
popd

Expand Down
17 changes: 9 additions & 8 deletions buildroot/package/rpi-firmware/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
start_file=start.elf
fixup_file=fixup.dat

kernel=zImage

# To use an external initramfs file
#initramfs rootfs.cpio.gz
initramfs recovery.rfs

# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1

# How much memory in MB to assign to the GPU on Pi models having
# 256, 512 or 1024 MB total memory
gpu_mem_256=100
gpu_mem_512=100
gpu_mem_1024=100
# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

4 changes: 2 additions & 2 deletions recovery/confeditdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ConfEditDialog::ConfEditDialog(const QVariantMap &map, const QString &partition,
{ //This is the PINN reference
QProcess::execute("mount -o remount,rw /mnt");
_tabs.append(new ConfEditDialogTab("config.txt", "/mnt/config.txt", false, ui->tabWidget));
_tabs.append(new ConfEditDialogTab("recovery.cmdline", "/mnt/recovery.cmdline", false, ui->tabWidget));
_tabs.append(new ConfEditDialogTab("cmdline.txt", "/mnt/cmdline.txt", false, ui->tabWidget));
ui->pbEdit->show();
}
else
Expand Down Expand Up @@ -166,7 +166,7 @@ void ConfEditDialog::options_finished(int result)
{
ui->tabWidget->removeTab(_tabs.count()-1);
_tabs.removeLast();
_tabs.append(new ConfEditDialogTab("recovery.cmdline", "/mnt/recovery.cmdline", false, ui->tabWidget));
_tabs.append(new ConfEditDialogTab("cmdline.txt", "/mnt/cmdline.txt", false, ui->tabWidget));
}

void ConfEditDialog::on_cbvk_toggled(bool checked)
Expand Down
4 changes: 1 addition & 3 deletions recovery/fullfatthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ void FullFatThread::run()
return;
}

QString cmdlinefilename = "/mnt/recovery.cmdline";
if (!QFile::exists(cmdlinefilename))
cmdlinefilename = "/mnt/cmdline.txt";
QString cmdlinefilename = "/mnt/cmdline.txt";

/* Add "runinstaller" to cmdline.txt */
QFile f(cmdlinefilename);
Expand Down
4 changes: 1 addition & 3 deletions recovery/initdrivethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ void InitDriveThread::run()
dir.mkdir("/mnt/os");
emit statusUpdate(tr("Editing cmdline.txt"));

QString cmdlinefilename = "/mnt/recovery.cmdline";
if (!QFile::exists(cmdlinefilename))
cmdlinefilename = "/mnt/cmdline.txt";
QString cmdlinefilename = "/mnt/cmdline.txt";

/* Remove "runinstaller" from cmdline.txt */
QFile f(cmdlinefilename);
Expand Down
4 changes: 2 additions & 2 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ bool MainWindow::canInstallOs(const QString &name, const QVariantMap &values)
}
}

/* Display OS in list if it is supported or "showall" is specified in recovery.cmdline */
/* Display OS in list if it is supported or "showall" is specified in cmdline.txt */
if (_showAll)
{
return true;
Expand Down Expand Up @@ -4346,7 +4346,7 @@ void MainWindow::downloadUpdateComplete()
{
qDebug() << "Time to update PINN!";
QProcess::execute("mount -o remount,rw /mnt");
QProcess::execute("unzip /tmp/pinn-lite.zip -o -x recovery.cmdline -d /mnt");
QProcess::execute("unzip /tmp/pinn-lite.zip -o -x cmdline.txt -d /mnt");
QProcess::execute("mount -o remount,ro /mnt");
QProcess::execute(QString("rm ")+BUILD_IGNORE);
QProcess::execute("sync");
Expand Down
4 changes: 2 additions & 2 deletions recovery/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void OptionsDialog::read()
{
int sep;
QString line;
QString file = getFileContents("/mnt/recovery.cmdline");
QString file = getFileContents("/mnt/cmdline.txt");

sep = file.indexOf('\n');
if (-1==sep)
Expand Down Expand Up @@ -273,7 +273,7 @@ void OptionsDialog::write()

contents += remainderOptions.trimmed() + "\n" + remainderFile;

QFile f("/mnt/recovery.cmdline");
QFile f("/mnt/cmdline.txt");
if (f.open(QIODevice::WriteOnly))
{
f.write(contents.toLatin1());
Expand Down

0 comments on commit 7fe60ca

Please sign in to comment.