Skip to content

Commit

Permalink
Add dosfsck
Browse files Browse the repository at this point in the history
For folks managing to corrupt their FAT partition.
  • Loading branch information
maxnet committed Aug 13, 2014
1 parent b7c87de commit cf117d0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
28 changes: 15 additions & 13 deletions BerrybootGUI2.0/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,34 +610,36 @@ void MainWindow::on_actionSetPassword_triggered()

void MainWindow::on_actionRepair_file_system_triggered()
{
QFile f("/proc/cmdline");
f.open(f.ReadOnly);
QByteArray options = f.readAll();
f.close();
QString datadev, cmd, cmd2;

QByteArray datadev, cmd;

if (options.contains("luks"))
if (_i->bootoptions().contains("luks"))
datadev = "/dev/mapper/luks";
else
datadev = "/dev/"+_i->datadev().toAscii();

if (options.contains("btrfs"))
/*if (_i->bootoptions().contains("btrfs"))
cmd = "fsck.btrfs -y "+datadev;
else
cmd = "/usr/sbin/fsck.ext4 -yf "+datadev;
else */

if (QMessageBox::question(this, tr("Confirm"), tr("Run '%1' on tty5?").arg(QString(cmd)), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
cmd = "/usr/sbin/fsck.ext4 -yf "+datadev;
cmd2 = "/sbin/dosfsck -a /dev/mmcblk0p1";

if (QMessageBox::question(this, tr("Confirm"), tr("Run '%1'\n'%2'\n on tty5?").arg(cmd, cmd2), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
_i->umountSystemPartition();
QProcess::execute("umount "+datadev);

QProcess proc;
_i->switchConsole(5);
proc.start(QByteArray("openvt -c 5 -w "+cmd));
proc.start("openvt -c 5 -w "+cmd);
QApplication::processEvents();
proc.waitForFinished();

QProcess::execute("mount "+datadev+" /mnt");
proc.start("openvt -c 5 -w "+cmd2);
proc.waitForFinished();

_i->mountSystemPartition();
QProcess::execute("mount -t ext4 "+datadev+" /mnt");
_i->switchConsole(1);
}
}
4 changes: 2 additions & 2 deletions buildroot-2012.05/.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
# Buildroot 2012.05-ga3376fb-dirty Configuration
# Buildroot 2012.05-gb7c87de Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_arm=y
Expand Down Expand Up @@ -512,7 +512,7 @@ BR2_PACKAGE_QT_NETWORK=y
# BR2_PACKAGE_DMRAID is not set
BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_MKDOSFS=y
# BR2_PACKAGE_DOSFSTOOLS_DOSFSCK is not set
BR2_PACKAGE_DOSFSTOOLS_DOSFSCK=y
# BR2_PACKAGE_DOSFSTOOLS_DOSFSLABEL is not set
BR2_PACKAGE_E2FSPROGS=y
# BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set
Expand Down
4 changes: 2 additions & 2 deletions buildroot-2012.05/package/dosfstools/dosfstools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
#############################################################

DOSFSTOOLS_VERSION = 3.0.12
DOSFSTOOLS_SITE = http://www.daniel-baumann.ch/software/dosfstools
DOSFSTOOLS_VERSION = 3.0.14
DOSFSTOOLS_SITE = http://daniel-baumann.ch/files/software/dosfstools
MKDOSFS_BINARY = mkdosfs
DOSFSCK_BINARY = dosfsck
DOSFSLABEL_BINARY = dosfslabel
Expand Down

0 comments on commit cf117d0

Please sign in to comment.