Formatting fix for missing MBR

This commit is contained in:
procount
2019-11-20 13:50:31 +00:00
parent 2e2c8a934d
commit a557b5e88a
2 changed files with 16 additions and 4 deletions

View File

@@ -271,6 +271,13 @@ cp bootcode.bin recovery.elf firmware.latest
bsdtar cvfz firmware.tar.gz firmware.*
popd
# HACK - Copy rpi_firmware from latest NOOBS e5b11a9d32cf4388b09097c33ab7bffbe1ca721c private repo because later firmware has display switching issues
pushd "$FINAL_OUTPUT_DIR"
cp ../noobs_firmware/bootcode.bin .
cp ../noobs_firmware/recovery.elf .
cp ../noobs_firmware/recover4.elf .
popd
# Create build-date timestamp file containing Git HEAD info for build
BUILD_INFO="$FINAL_OUTPUT_DIR/BUILD-DATA"
echo "Build-date: $(date +"%Y-%m-%d")" > "$BUILD_INFO"

View File

@@ -150,9 +150,8 @@ QString findRecoveryDrive()
foreach (QString devname, list)
{
/* Only search first partition and partitionless devices. Skip virtual devices (such as ramdisk) */
if ((devname.right(1).at(0).isDigit() && !devname.endsWith("1"))
|| QFile::symLinkTarget("/sys/class/block/"+devname).contains("/devices/virtual/"))
/* Skip virtual devices (such as ramdisk) */
if (QFile::symLinkTarget("/sys/class/block/"+devname).contains("/devices/virtual/"))
continue;
if (QProcess::execute("mount -t vfat -o ro /dev/"+devname+" /mnt") == 0)
@@ -357,7 +356,13 @@ int main(int argc, char *argv[])
}
qDebug() << "PINN drive:" << drive;
QProcess::execute("mount -o ro -t vfat "+partdev(drive, 1)+" /mnt");
if (!QProcess::execute("mount -o ro -t vfat "+partdev(drive, 1)+" /mnt"))
{
//Maybe there is no MBR
//and partition1 does not exist. But we found a drive, so assume it is mbr-less
QProcess::execute("mount -o ro -t vfat "+drive+" /mnt");
}
cec->loadMap("/mnt/cec_keys.json");
joy->loadMap("/mnt/joy_keys.json");