Heimdall 1.4 RC1:

- Massive refactoring.
    - Support for Qualcomm based devices.
    - Print PIT from file.
    - Use partition names as arguments e.g. --HIDDEN, --KERNEL, --MOVINAND etc.
    - Heimdall Frontend UI improvements.
    - And much more...
alt_setting-error
Benjamin Dobell 2012-10-01 12:43:05 +10:00
parent 66f1e84dd2
commit 6cd6b35c73
90 changed files with 21508 additions and 13379 deletions

8
.gitignore vendored
View File

@ -1,2 +1,10 @@
.DS_Store
._*
Debug/
Release/
GeneratedFiles/
*.vcxproj.user
*.suo
*.sdf
heimdall-frontend/Qt4VSPropertySheet.props
*.opensdf

View File

@ -1,4 +1,4 @@
Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:
@ -84,11 +84,12 @@ Performing a Custom Flash with Heimdall Frontend:
This is the advanced means of flashing firmware to your device.
If you're not an advanced user or a developer, in the event that a Heimdall
Firmware Package doesn't exist for the particular firmware (or files) that
you wish to flash, then I strongly recommend you get in touch with developer
of the firmware (or files) and politely ask them to create a Heimdall
Firmware Package for you. In doing so then you don't have to worry about
making mistakes due to inexperience.
Firmware Package doesn't exist for the particular firmware (or files) that
you wish to flash, then I strongly recommend you get in touch with the
developer of the firmware (or files) and politely ask them to create a
Heimdall Firmware Package for you. In doing so, you avoid the risk of
making mistakes due to inexperience.
If you're looking to customise an existing Heimdall Firmware Package then
follow steps 1-8 of "Flashing Heimdall Firmware Package with Heimdall
@ -104,7 +105,8 @@ Performing a Custom Flash with Heimdall Frontend:
as multiple archives (nested or otherwise), extract them all to the same
location.
NOTE: If you want to use the CSC then extract it last.
NOTE: If you want to use the CSC then extract it last. If you're asked
to overwrite files then do so.
3. Open the a terminal and run Heimdall Frontend by typing:
@ -116,14 +118,14 @@ Performing a Custom Flash with Heimdall Frontend:
5. Before you can chose which partitions you want to flash with particular
files you MUST first select a PIT file. To do this click the "Browse"
button in the "PIT" section. This will open a dialogue allowing you to
navigate to and select a valid PIT (.pit) file.
navigate to and select a valid PIT (.pit) file.
If you do not already have a valid PIT file stored on your computer you
can download your device's PIT file from the "Utilities" tab.
6. If a valid PIT file has been selected then "Add" button below the
"Partitions (Files)" list-box will become enabled. Press this button to
add a partition to your flash.
If you do not already have a valid PIT file stored on your computer you
can download your device's PIT file from the "Utilities" tab.
6. If a valid PIT file has been selected then the "Add" button below the
"Partitions (Files)" list-box will be enabled. Press this button to add
a partition to your flash.
7. When you first add a partition you will see the "Partition Name" and
"Partition ID" be populated with information. Use the "Partition Name"
@ -229,8 +231,7 @@ How to Create a Heimdall Firmware Package:
create a package from scratch, or you can load an existing package, apply
modifications and then save the package. Creating a package from scratch
is the preferred approach, by taking this approach you're far less likely
to run into file name length limitations. These are not Heimdall's own
limitation but rather a limitation of the TAR archive format.
to run into file name length limitations.
Before you can access Heimdall Frontend's firmware creation functionality
(available from the "Create Package" tab) you must first specify which
@ -254,14 +255,14 @@ How to Create a Heimdall Firmware Package:
Firmware Name - This is the name of your particular firmware. An
example would be "Cyanogenmod".
Firmware Version - This is the version identifier for your package. Any
valid string will be accepted although a the inclusion of decimal
point version number is preferred i.e. "7.1". If it makes sense
then feel free to append a text string like "RC1" or "Beta 1" to
the decimal point version.
Firmware Version - This is the version identifier for your package. Any
valid string will be accepted, although the inclusion of decimal
point version number is preferred i.e. "7.1". If it makes sense
then feel free to append a text string like "RC1" or "Beta 1" to
the decimal point version.
Platform Name - This is the name of the platform (or operating system)
that your firmware is based on. In most cases this will simply be
Platform Name - This is the name of platform (or operating system) that
your firmware is based on. In most cases this will simply be
"Android".
Platform Version - This is the operating system version that your
@ -295,8 +296,8 @@ How to Create a Heimdall Firmware Package:
team name. Click "Add" and the developer will be added to the list
on the right. If you make a mistake you can select a developer from
the list and click "Remove". You can list as many developers as you
like however visual constraints of the "Load Package" tab means
only a few names will be visible. Where possible you may want to
like, however visual constraints of the "Load Package" tab means
only a few names will be visible. Where possible you may want to
opt for team names over listing individual team members.
@ -359,8 +360,9 @@ for the format in their own software.
All Heimdall Firmware Packages must contain a file called firmware.xml. This
file stores flash information and meta-data for the package as well as
information about other files contained within the package.
file stores flash information and meta-data for the package as well as
information about other files contained within the package.
The format is fairly straight-forward so it won't be explained in great detail.
Nonetheless the following is an example of a valid firmware.xml file.
@ -458,20 +460,28 @@ be included.
Appendix B - Installing Heimdall from Source:
1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
libusb-1.0-dev (v1.0.8 or newer).
1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
libusb-1.0-dev (v1.0.8 or newer).
NOTE: Package names may not be absolutely identical to those above.
2. Open a terminal and navigate to the directory you downloaded,
or extracted, Heimdall to.
3. Enter the following commands to compile libpit.
3. Enter the following commands to compile libpit:
cd libpit
./configure
make
cd ..
If you have problems please consult http://www.libusb.org/
4. Enter the following commands to compile libpit.
cd libusb-1.0
./configure
make
cd ..
@ -486,11 +496,11 @@ Appendix B - Installing Heimdall from Source:
sudo make install
cd ..
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:
sudo checkinstall --pkgversion <version>
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:
sudo checkinstall --pkgversion <version>
Where <version> is the current Heimdall release e.g. 1.3.0
5. Done
@ -510,9 +520,9 @@ Appendix C - Installing Heimdall Frontend from Source:
4. Enter the following commands to compile and install Heimdall Frontend:
cd heimdall-frontend
qmake heimdall-frontend.pro
qmake-qt4 heimdall-frontend.pro
make
sudo make install
sudo make install
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:

2
README
View File

@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<QTDIR>D:\development\cpp\libraries\Qt\2010.05\qt</QTDIR>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="QTDIR">
<Value>$(QTDIR)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -772,7 +772,9 @@ void FirmwareInfo::WriteXml(QXmlStreamWriter& xml) const
xml.writeStartElement("files");
for (int i = 0; i < fileInfos.length(); i++)
{
fileInfos[i].WriteXml(xml, Packaging::ClashlessFilename(fileInfos, i));
}
xml.writeEndElement();

View File

@ -301,7 +301,7 @@ bool Packaging::WriteTarEntry(const QString& filePath, QTemporaryFile *tarFile,
// Note: We don't support base-256 encoding. Support could be added later.
sprintf(tarHeader.fields.size, "%011llo", file.size());
sprintf(tarHeader.fields.modifiedTime, "%011llo", qtFileInfo.lastModified().toMSecsSinceEpoch() / 1000);
sprintf(tarHeader.fields.modifiedTime, "%011llo", qtFileInfo.lastModified().toTime_t());
// Regular File
tarHeader.fields.typeFlag = '0';
@ -381,6 +381,24 @@ bool Packaging::CreateTar(const FirmwareInfo& firmwareInfo, QTemporaryFile *tarF
for (int i = 0; i < fileInfos.length(); i++)
{
// If the file was already compressed we don't compress it again.
bool skip = false;
for (int j = 0; j < i; j++)
{
if (fileInfos[i].GetFilename() == fileInfos[j].GetFilename())
{
skip = true;
break;
}
}
if (skip)
{
progressDialog.setValue(i);
continue;
}
QString filename = ClashlessFilename(fileInfos, i);
if (filename == "firmware.xml")
@ -389,7 +407,7 @@ bool Packaging::CreateTar(const FirmwareInfo& firmwareInfo, QTemporaryFile *tarF
return (false);
}
if (!WriteTarEntry(fileInfos[i].GetFilename(), tarFile, ClashlessFilename(fileInfos, i)))
if (!WriteTarEntry(fileInfos[i].GetFilename(), tarFile, filename))
{
tarFile->resize(0);
tarFile->close();
@ -666,7 +684,8 @@ QString Packaging::ClashlessFilename(const QList<FileInfo>& fileInfos, int fileI
QString otherFilename = fileInfos[i].GetFilename().mid(lastSlash + 1);
if (filename == otherFilename)
// If the filenames are the same, but the files themselves aren't the same (i.e. not the same path), then rename.
if (filename == otherFilename && fileInfos[i].GetFilename() != fileInfos[fileInfoIndex].GetFilename())
renameIndex++;
}

View File

@ -18,12 +18,107 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Qt
#include <QDir>
#include <QProcess>
// Heimdall Frontend
#include "aboutform.h"
#define UNUSED(x) (void)(x)
using namespace HeimdallFrontend;
AboutForm::AboutForm(QWidget *parent) : QWidget(parent)
{
setupUi(this);
// Heimdall Command Line
QObject::connect(&heimdallProcess, SIGNAL(readyRead()), this, SLOT(HandleHeimdallStdout()));
QObject::connect(&heimdallProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(HandleHeimdallReturned(int, QProcess::ExitStatus)));
QObject::connect(&heimdallProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(HandleHeimdallError(QProcess::ProcessError)));
heimdallFailed = false;
RetrieveHeimdallVersion();
}
void AboutForm::RetrieveHeimdallVersion(void)
{
heimdallProcess.setReadChannel(QProcess::StandardOutput);
heimdallProcess.start("heimdall", QStringList("version"));
heimdallProcess.waitForFinished(350);
// OS X was playing up and not finding heimdall, so we're manually checking the PATH.
if (heimdallFailed)
{
QStringList environment = QProcess::systemEnvironment();
QStringList paths;
// Ensure /usr/bin is in PATH
for (int i = 0; i < environment.length(); i++)
{
if (environment[i].left(5) == "PATH=")
{
paths = environment[i].mid(5).split(':');
paths.prepend("/usr/bin");
break;
}
}
int pathIndex = -1;
while (heimdallFailed && ++pathIndex < paths.length())
{
QString heimdallPath = paths[pathIndex];
if (heimdallPath.length() > 0)
{
heimdallFailed = false;
if (heimdallPath[heimdallPath.length() - 1] != QDir::separator())
heimdallPath += QDir::separator();
heimdallPath += "heimdall";
heimdallProcess.start(heimdallPath, QStringList("version"));
heimdallProcess.waitForFinished(350);
}
}
if (heimdallFailed)
versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", ""));
}
}
void AboutForm::HandleHeimdallStdout(void)
{
QString version = heimdallProcess.readAll();
if (version.length() > 0)
{
if (version.at(0) == QChar('v'))
version = version.mid(1);
versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", "Version " + version + "<br />"));
}
}
void AboutForm::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitStatus)
{
UNUSED(exitCode);
UNUSED(exitStatus);
// If for some reason %HEIMDALL-VERSION% hasn't been replaced yet, we'll replace it with an empty string.
versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", ""));
}
void AboutForm::HandleHeimdallError(QProcess::ProcessError error)
{
UNUSED(error);
heimdallFailed = true;
}

View File

@ -19,6 +19,7 @@
THE SOFTWARE.*/
// Qt
#include <QProcess>
#include <QWidget>
// Heimdall Frontend
@ -28,8 +29,24 @@ namespace HeimdallFrontend
{
class AboutForm : public QWidget, public Ui::AboutForm
{
Q_OBJECT
private:
bool heimdallFailed;
QProcess heimdallProcess;
void RetrieveHeimdallVersion(void);
public:
explicit AboutForm(QWidget *parent = 0);
public slots:
// Heimdall Command Line
void HandleHeimdallStdout(void);
void HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitStatus);
void HandleHeimdallError(QProcess::ProcessError error);
};
}

View File

@ -32,18 +32,18 @@
#include "mainwindow.h"
#include "Packaging.h"
#define UNUSED(x) (void)(x)
using namespace HeimdallFrontend;
void MainWindow::StartHeimdall(const QStringList& arguments)
{
flashProgressBar->setEnabled(true);
UpdateInterfaceAvailability();
heimdallProcess.setReadChannel(QProcess::StandardOutput);
int pathIndex = -1;
process.setReadChannel(QProcess::StandardOutput);
process.start("heimdall", arguments);
process.waitForStarted(3000);
heimdallProcess.start("heimdall", arguments);
heimdallProcess.waitForStarted(3000);
// OS X was playing up and not finding heimdall, so we're manually checking the PATH.
if (heimdallFailed)
@ -63,6 +63,8 @@ void MainWindow::StartHeimdall(const QStringList& arguments)
}
}
int pathIndex = -1;
while (heimdallFailed && ++pathIndex < paths.length())
{
QString heimdallPath = paths[pathIndex];
@ -76,8 +78,8 @@ void MainWindow::StartHeimdall(const QStringList& arguments)
heimdallPath += "heimdall";
process.start(heimdallPath, arguments);
process.waitForStarted(3000);
heimdallProcess.start(heimdallPath, arguments);
heimdallProcess.waitForStarted(3000);
}
}
@ -86,7 +88,6 @@ void MainWindow::StartHeimdall(const QStringList& arguments)
flashLabel->setText("Failed to start Heimdall!");
heimdallState = MainWindow::kHeimdallStateStopped;
flashProgressBar->setEnabled(false);
UpdateInterfaceAvailability();
}
}
@ -101,8 +102,8 @@ void MainWindow::UpdateUnusedPartitionIds(void)
{
const PitEntry *pitEntry = currentPitData.GetEntry(i);
if (!pitEntry->GetUnused() && strcmp(pitEntry->GetPartitionName(), "PIT") != 0)
unusedPartitionIds.append(pitEntry->GetPartitionIdentifier());
if (pitEntry->GetBlockCount() > 0 && strcmp(pitEntry->GetPartitionName(), "PIT") != 0 && strcmp(pitEntry->GetPartitionName(), "PT") != 0)
unusedPartitionIds.append(pitEntry->GetIdentifier());
}
// Remove any used partition IDs from unusedPartitionIds
@ -145,14 +146,9 @@ void MainWindow::UpdatePackageUserInterface(void)
developerNamesLineEdit->clear();
platformLineEdit->clear();
developerHomepageButton->setEnabled(false);
developerDonateButton->setEnabled(false);
repartitionRadioButton->setChecked(false);
noRebootRadioButton->setChecked(false);
loadFirmwareButton->setEnabled(false);
}
else
{
@ -173,16 +169,6 @@ void MainWindow::UpdatePackageUserInterface(void)
platformLineEdit->setText(loadedPackageData.GetFirmwareInfo().GetPlatformInfo().GetName() + " ("
+ loadedPackageData.GetFirmwareInfo().GetPlatformInfo().GetVersion() + ")");
if (!loadedPackageData.GetFirmwareInfo().GetUrl().isEmpty())
developerHomepageButton->setEnabled(true);
else
developerHomepageButton->setEnabled(false);
if (!loadedPackageData.GetFirmwareInfo().GetDonateUrl().isEmpty())
developerDonateButton->setEnabled(true);
else
developerDonateButton->setEnabled(false);
for (int i = 0; i < loadedPackageData.GetFirmwareInfo().GetDeviceInfos().length(); i++)
{
const DeviceInfo& deviceInfo = loadedPackageData.GetFirmwareInfo().GetDeviceInfos()[i];
@ -197,9 +183,9 @@ void MainWindow::UpdatePackageUserInterface(void)
repartitionRadioButton->setChecked(loadedPackageData.GetFirmwareInfo().GetRepartition());
noRebootRadioButton->setChecked(loadedPackageData.GetFirmwareInfo().GetNoReboot());
loadFirmwareButton->setEnabled(true);
}
UpdateLoadPackageInterfaceAvailability();
}
bool MainWindow::IsArchive(QString path)
@ -209,9 +195,9 @@ bool MainWindow::IsArchive(QString path)
|| path.endsWith(".bz2", Qt::CaseInsensitive) || path.endsWith(".7z", Qt::CaseInsensitive) || path.endsWith(".rar", Qt::CaseInsensitive));
}
QString MainWindow::PromptFileSelection(void)
QString MainWindow::PromptFileSelection(const QString& caption, const QString& filter)
{
QString path = QFileDialog::getOpenFileName(this, "Select File", lastDirectory);
QString path = QFileDialog::getOpenFileName(this, caption, lastDirectory, filter);
if (path != "")
lastDirectory = path.left(path.lastIndexOf('/') + 1);
@ -219,9 +205,9 @@ QString MainWindow::PromptFileSelection(void)
return (path);
}
QString MainWindow::PromptFileCreation(void)
QString MainWindow::PromptFileCreation(const QString& caption, const QString& filter)
{
QString path = QFileDialog::getSaveFileName(this, "Save File", lastDirectory);
QString path = QFileDialog::getSaveFileName(this, caption, lastDirectory, filter);
if (path != "")
lastDirectory = path.left(path.lastIndexOf('/') + 1);
@ -229,6 +215,167 @@ QString MainWindow::PromptFileCreation(void)
return (path);
}
void MainWindow::UpdateLoadPackageInterfaceAvailability(void)
{
if (loadedPackageData.IsCleared())
{
developerHomepageButton->setEnabled(false);
developerDonateButton->setEnabled(false);
loadFirmwareButton->setEnabled(false);
}
else
{
if (!loadedPackageData.GetFirmwareInfo().GetUrl().isEmpty())
developerHomepageButton->setEnabled(true);
else
developerHomepageButton->setEnabled(false);
if (!loadedPackageData.GetFirmwareInfo().GetDonateUrl().isEmpty())
developerDonateButton->setEnabled(true);
else
developerDonateButton->setEnabled(false);
loadFirmwareButton->setEnabled(heimdallState == MainWindow::kHeimdallStateStopped);
}
}
void MainWindow::UpdateFlashInterfaceAvailability(void)
{
if (heimdallState == MainWindow::kHeimdallStateStopped)
{
partitionNameComboBox->setEnabled(partitionsListWidget->currentRow() >= 0);
bool allPartitionsValid = true;
QList<FileInfo>& fileList = workingPackageData.GetFirmwareInfo().GetFileInfos();
for (int i = 0; i < fileList.length(); i++)
{
if (fileList[i].GetFilename().isEmpty())
{
allPartitionsValid = false;
break;
}
}
bool validFlashSettings = allPartitionsValid && fileList.length() > 0;
flashProgressBar->setEnabled(false);
optionsGroup->setEnabled(true);
startFlashButton->setEnabled(validFlashSettings);
}
else
{
partitionNameComboBox->setEnabled(false);
flashProgressBar->setEnabled(true);
optionsGroup->setEnabled(false);
startFlashButton->setEnabled(false);
}
}
void MainWindow::UpdateCreatePackageInterfaceAvailability(void)
{
if (heimdallState == MainWindow::kHeimdallStateStopped)
{
const FirmwareInfo& firmwareInfo = workingPackageData.GetFirmwareInfo();
if (firmwareInfo.GetName().isEmpty() || firmwareInfo.GetVersion().isEmpty() || firmwareInfo.GetPlatformInfo().GetName().isEmpty()
|| firmwareInfo.GetPlatformInfo().GetVersion().isEmpty() || firmwareInfo.GetDevelopers().isEmpty() || firmwareInfo.GetDeviceInfos().isEmpty())
{
buildPackageButton->setEnabled(false);
}
else
{
buildPackageButton->setEnabled(true);
}
if (addDeveloperButton->text().isEmpty())
addDeveloperButton->setEnabled(false);
else
addDeveloperButton->setEnabled(true);
if (createDevelopersListWidget->currentRow() >= 0)
removeDeveloperButton->setEnabled(true);
else
removeDeveloperButton->setEnabled(false);
}
else
{
buildPackageButton->setEnabled(false);
}
}
void MainWindow::UpdateUtilitiesInterfaceAvailability(void)
{
if (heimdallState == MainWindow::kHeimdallStateStopped)
{
detectDeviceButton->setEnabled(true);
closePcScreenButton->setEnabled(true);
pitSaveAsButton->setEnabled(true);
if (!pitDestinationLineEdit->text().isEmpty())
downloadPitButton->setEnabled(true);
else
downloadPitButton->setEnabled(false);
if (printPitDeviceRadioBox->isChecked())
{
// Device
printLocalPitGroup->setEnabled(false);
printPitButton->setEnabled(true);
}
else
{
// Local File
printLocalPitGroup->setEnabled(true);
printLocalPitLineEdit->setEnabled(true);
printLocalPitBrowseButton->setEnabled(true);
printPitButton->setEnabled(!printLocalPitLineEdit->text().isEmpty());
}
}
else
{
detectDeviceButton->setEnabled(false);
closePcScreenButton->setEnabled(false);
pitSaveAsButton->setEnabled(false);
downloadPitButton->setEnabled(false);
printLocalPitGroup->setEnabled(false);
printPitButton->setEnabled(false);
}
}
void MainWindow::UpdateInterfaceAvailability(void)
{
UpdateLoadPackageInterfaceAvailability();
UpdateFlashInterfaceAvailability();
UpdateCreatePackageInterfaceAvailability();
UpdateUtilitiesInterfaceAvailability();
if (heimdallState == MainWindow::kHeimdallStateStopped)
{
// Enable/disable tabs
for (int i = 0; i < functionTabWidget->count(); i++)
functionTabWidget->setTabEnabled(i, true);
functionTabWidget->setTabEnabled(functionTabWidget->indexOf(createPackageTab), startFlashButton->isEnabled());
}
else
{
// Disable non-current tabs
for (int i = 0; i < functionTabWidget->count(); i++)
{
if (i == functionTabWidget->currentIndex())
functionTabWidget->setTabEnabled(i, true);
else
functionTabWidget->setTabEnabled(i, false);
}
}
}
void MainWindow::UpdatePartitionNamesInterface(void)
{
populatingPartitionNames = true;
@ -246,78 +393,11 @@ void MainWindow::UpdatePartitionNamesInterface(void)
partitionNameComboBox->addItem(currentPitData.FindEntry(partitionInfo.GetPartitionId())->GetPartitionName());
partitionNameComboBox->setCurrentIndex(unusedPartitionIds.length());
partitionNameComboBox->setEnabled(true);
}
else
{
partitionNameComboBox->setEnabled(false);
}
populatingPartitionNames = false;
}
void MainWindow::UpdateInterfaceAvailability(void)
{
if (heimdallState != MainWindow::kHeimdallStateStopped)
{
startFlashButton->setEnabled(false);
detectDeviceButton->setEnabled(false);
closePcScreenButton->setEnabled(false);
pitSaveAsButton->setEnabled(false);
downloadPitButton->setEnabled(false);
printPitButton->setEnabled(false);
return;
}
else
{
detectDeviceButton->setEnabled(true);
closePcScreenButton->setEnabled(true);
pitSaveAsButton->setEnabled(true);
if (!pitDestinationLineEdit->text().isEmpty())
downloadPitButton->setEnabled(true);
else
downloadPitButton->setEnabled(false);
printPitButton->setEnabled(true);
}
bool allPartitionsValid = true;
QList<FileInfo>& fileList = workingPackageData.GetFirmwareInfo().GetFileInfos();
for (int i = 0; i < fileList.length(); i++)
{
if (fileList[i].GetFilename().isEmpty())
{
allPartitionsValid = false;
break;
}
}
bool validSettings = allPartitionsValid && fileList.length() > 0;
startFlashButton->setEnabled(validSettings);
functionTabWidget->setTabEnabled(functionTabWidget->indexOf(createPackageTab), validSettings);
}
void MainWindow::UpdateBuildPackageButton(void)
{
const FirmwareInfo& firmwareInfo = workingPackageData.GetFirmwareInfo();
if (firmwareInfo.GetName().isEmpty() || firmwareInfo.GetVersion().isEmpty() || firmwareInfo.GetPlatformInfo().GetName().isEmpty()
|| firmwareInfo.GetPlatformInfo().GetVersion().isEmpty() || firmwareInfo.GetDevelopers().isEmpty() || firmwareInfo.GetDeviceInfos().isEmpty())
{
buildPackageButton->setEnabled(false);
}
else
{
buildPackageButton->setEnabled(true);
}
UpdateFlashInterfaceAvailability();
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
@ -388,15 +468,21 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
// Utilities Tab
QObject::connect(detectDeviceButton, SIGNAL(clicked()), this, SLOT(DetectDevice()));
QObject::connect(closePcScreenButton, SIGNAL(clicked()), this, SLOT(ClosePcScreen()));
QObject::connect(printPitDeviceRadioBox, SIGNAL(toggled(bool)), this, SLOT(DevicePrintPitToggled(bool)));
QObject::connect(printPitLocalFileRadioBox, SIGNAL(toggled(bool)), this, SLOT(LocalFilePrintPitToggled(bool)));
QObject::connect(printLocalPitBrowseButton, SIGNAL(clicked()), this, SLOT(SelectPrintPitFile()));
QObject::connect(printPitButton, SIGNAL(clicked()), this, SLOT(PrintPit()));
QObject::connect(pitSaveAsButton, SIGNAL(clicked()), this, SLOT(SelectPitDestination()));
QObject::connect(downloadPitButton, SIGNAL(clicked()), this, SLOT(DownloadPit()));
// Heimdall Command Line
QObject::connect(&process, SIGNAL(readyRead()), this, SLOT(HandleHeimdallStdout()));
QObject::connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(HandleHeimdallReturned(int, QProcess::ExitStatus)));
QObject::connect(&process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(HandleHeimdallError(QProcess::ProcessError)));
QObject::connect(&heimdallProcess, SIGNAL(readyRead()), this, SLOT(HandleHeimdallStdout()));
QObject::connect(&heimdallProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(HandleHeimdallReturned(int, QProcess::ExitStatus)));
QObject::connect(&heimdallProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(HandleHeimdallError(QProcess::ProcessError)));
}
MainWindow::~MainWindow()
@ -429,7 +515,7 @@ void MainWindow::SelectFirmwarePackage(void)
loadedPackageData.Clear();
UpdatePackageUserInterface();
QString path = PromptFileSelection();
QString path = PromptFileSelection("Select Package", "*.tar.gz");
firmwarePackageLineEdit->setText(path);
if (firmwarePackageLineEdit->text() != "")
@ -458,7 +544,6 @@ void MainWindow::LoadFirmwarePackage(void)
workingPackageData.Clear();
currentPitData.Clear();
// Make flashSettings responsible for the temporary files
workingPackageData.GetFiles().append(loadedPackageData.GetFiles());
loadedPackageData.RemoveAllFiles();
@ -575,10 +660,18 @@ void MainWindow::SelectPartitionName(int index)
unusedPartitionIds.append(fileInfo.GetPartitionId());
fileInfo.SetPartitionId(newPartitionIndex);
PitEntry *pitEntry = currentPitData.FindEntry(newPartitionIndex);
QString title("File");
if (pitEntry && strlen(pitEntry->GetFlashFilename()) > 0)
title += " (" + QString(pitEntry->GetFlashFilename()) + ")";
partitionFileGroup->setTitle(title);
if (!fileInfo.GetFilename().isEmpty())
{
PitEntry *pitEntry = currentPitData.FindEntry(newPartitionIndex);
QString partitionFilename = pitEntry->GetFilename();
QString partitionFilename = pitEntry->GetFlashFilename();
int lastPeriod = partitionFilename.lastIndexOf(QChar('.'));
if (lastPeriod >= 0)
@ -610,7 +703,7 @@ void MainWindow::SelectPartitionFile(void)
FileInfo& fileInfo = workingPackageData.GetFirmwareInfo().GetFileInfos()[partitionsListWidget->currentRow()];
PitEntry *pitEntry = currentPitData.FindEntry(fileInfo.GetPartitionId());
QString partitionFilename = pitEntry->GetFilename();
QString partitionFilename = pitEntry->GetFlashFilename();
int lastPeriod = partitionFilename.lastIndexOf(QChar('.'));
if (lastPeriod >= 0)
@ -648,6 +741,15 @@ void MainWindow::SelectPartition(int row)
partitionFileBrowseButton->setEnabled(true);
removePartitionButton->setEnabled(true);
QString title("File");
PitEntry *pitEntry = currentPitData.FindEntry(partitionInfo.GetPartitionId());
if (pitEntry && strlen(pitEntry->GetFlashFilename()) > 0)
title += " (" + QString(pitEntry->GetFlashFilename()) + ")";
partitionFileGroup->setTitle(title);
}
else
{
@ -658,6 +760,8 @@ void MainWindow::SelectPartition(int row)
partitionFileBrowseButton->setEnabled(false);
removePartitionButton->setEnabled(false);
partitionFileGroup->setTitle("File");
}
}
@ -673,6 +777,7 @@ void MainWindow::AddPartition(void)
partitionsListWidget->addItem(currentPitData.FindEntry(partitionInfo.GetPartitionId())->GetPartitionName());
partitionsListWidget->setCurrentRow(partitionsListWidget->count() - 1);
partitionsListWidget->setEnabled(false);
UpdateInterfaceAvailability();
}
@ -693,7 +798,7 @@ void MainWindow::RemovePartition(void)
void MainWindow::SelectPit(void)
{
QString path = PromptFileSelection();
QString path = PromptFileSelection("Select PIT", "*.pit");
bool validPit = path != "";
if (validPit)
@ -723,7 +828,7 @@ void MainWindow::SelectPit(void)
if (pitEntry)
{
fileInfos[partitionInfoIndex++].SetPartitionId(pitEntry->GetPartitionIdentifier());
fileInfos[partitionInfoIndex++].SetPartitionId(pitEntry->GetIdentifier());
partitionsListWidget->addItem(pitEntry->GetPartitionName());
}
else
@ -828,25 +933,25 @@ void MainWindow::StartFlash(void)
void MainWindow::FirmwareNameChanged(const QString& text)
{
workingPackageData.GetFirmwareInfo().SetName(text);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::FirmwareVersionChanged(const QString& text)
{
workingPackageData.GetFirmwareInfo().SetVersion(text);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::PlatformNameChanged(const QString& text)
{
workingPackageData.GetFirmwareInfo().GetPlatformInfo().SetName(text);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::PlatformVersionChanged(const QString& text)
{
workingPackageData.GetFirmwareInfo().GetPlatformInfo().SetVersion(text);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::HomepageUrlChanged(const QString& text)
@ -861,18 +966,16 @@ void MainWindow::DonateUrlChanged(const QString& text)
void MainWindow::DeveloperNameChanged(const QString& text)
{
if (text.isEmpty())
addDeveloperButton->setEnabled(false);
else
addDeveloperButton->setEnabled(true);
UNUSED(text);
UpdateCreatePackageInterfaceAvailability();
}
void MainWindow::SelectDeveloper(int row)
{
if (row >= 0)
removeDeveloperButton->setEnabled(true);
else
removeDeveloperButton->setEnabled(false);
UNUSED(row);
UpdateCreatePackageInterfaceAvailability();
}
void MainWindow::AddDeveloper(void)
@ -881,8 +984,8 @@ void MainWindow::AddDeveloper(void)
createDevelopersListWidget->addItem(createDeveloperNameLineEdit->text());
createDeveloperNameLineEdit->clear();
UpdateBuildPackageButton();
UpdateCreatePackageInterfaceAvailability();
}
void MainWindow::RemoveDeveloper(void)
@ -894,12 +997,14 @@ void MainWindow::RemoveDeveloper(void)
delete item;
removeDeveloperButton->setEnabled(false);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::DeviceInfoChanged(const QString& text)
{
UNUSED(text);
if (deviceManufacturerLineEdit->text().isEmpty() || deviceNameLineEdit->text().isEmpty() || deviceProductCodeLineEdit->text().isEmpty())
addDeviceButton->setEnabled(false);
else
@ -923,8 +1028,8 @@ void MainWindow::AddDevice(void)
deviceManufacturerLineEdit->clear();
deviceNameLineEdit->clear();
deviceProductCodeLineEdit->clear();
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::RemoveDevice(void)
@ -936,13 +1041,13 @@ void MainWindow::RemoveDevice(void)
delete item;
removeDeviceButton->setEnabled(false);
UpdateBuildPackageButton();
UpdateInterfaceAvailability();
}
void MainWindow::BuildPackage(void)
{
QString packagePath = PromptFileCreation();
QString packagePath = PromptFileCreation("Save Package", "*.tar.gz");
if (!packagePath.isEmpty())
{
@ -995,7 +1100,7 @@ void MainWindow::ClosePcScreen(void)
void MainWindow::SelectPitDestination(void)
{
QString path = PromptFileCreation();
QString path = PromptFileCreation("Save PIT", "*.pit");
if (path != "")
{
@ -1029,6 +1134,41 @@ void MainWindow::DownloadPit(void)
StartHeimdall(arguments);
}
void MainWindow::DevicePrintPitToggled(bool checked)
{
if (checked)
{
if (printPitLocalFileRadioBox->isChecked())
printPitLocalFileRadioBox->setChecked(false);
}
UpdateUtilitiesInterfaceAvailability();
}
void MainWindow::LocalFilePrintPitToggled(bool checked)
{
if (checked)
{
if (printPitDeviceRadioBox->isChecked())
printPitDeviceRadioBox->setChecked(false);
}
UpdateUtilitiesInterfaceAvailability();
}
void MainWindow::SelectPrintPitFile(void)
{
QString path = PromptFileSelection("Select PIT", "*.pit");
if (path != "")
printLocalPitLineEdit->setText(path);
if (printLocalPitLineEdit->text() != "")
printPitButton->setEnabled(true);
else
printPitButton->setEnabled(false);
}
void MainWindow::PrintPit(void)
{
utilityOutputPlainTextEdit->clear();
@ -1039,14 +1179,21 @@ void MainWindow::PrintPit(void)
QStringList arguments;
arguments.append("print-pit");
if (printPitLocalFileRadioBox->isChecked())
{
arguments.append("--file");
arguments.append(printLocalPitLineEdit->text());
}
arguments.append("--stdout-errors");
arguments.append("--no-reboot");
StartHeimdall(arguments);
}
void MainWindow::HandleHeimdallStdout(void)
{
QString output = process.readAll();
QString output = heimdallProcess.readAll();
// We often receive multiple lots of output from Heimdall at one time. So we use regular expressions
// to ensure we don't miss out on any important information.
@ -1078,29 +1225,22 @@ void MainWindow::HandleHeimdallStdout(void)
void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitStatus)
{
// This is a work-around for strange issues as a result of a exitCode being cast to
// a unsigned char.
char byteExitCode = exitCode;
if (exitStatus == QProcess::NormalExit && byteExitCode >= 0)
if (exitStatus == QProcess::NormalExit && exitCode == 0)
{
if (heimdallState == MainWindow::kHeimdallStateFlashing)
{
if (byteExitCode == 1)
flashLabel->setText("Failed to detect compatible device!");
else
flashLabel->setText("Flash completed sucessfully!");
flashLabel->setText("Flash completed successfully!");
}
else if (heimdallState == MainWindow::kHeimdallStateDetectingDevice)
{
deviceDetectedRadioButton->setChecked(byteExitCode == 0);
deviceDetectedRadioButton->setChecked(true);
}
}
else
{
if (heimdallState == MainWindow::kHeimdallStateFlashing)
{
QString error = process.readAllStandardError();
QString error = heimdallProcess.readAllStandardError();
int lastNewLineChar = error.lastIndexOf('\n');
@ -1111,6 +1251,10 @@ void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitS
flashLabel->setText(error);
}
else if (heimdallState == MainWindow::kHeimdallStateDetectingDevice)
{
deviceDetectedRadioButton->setChecked(false);
}
}
heimdallState = MainWindow::kHeimdallStateStopped;

View File

@ -56,6 +56,12 @@ namespace HeimdallFrontend
kHeimdallStateCount
};
enum
{
kPrintPitSourceDevice = 0,
kPrintPitSourceLocalFile
};
AboutForm aboutForm;
QString lastDirectory;
@ -64,7 +70,7 @@ namespace HeimdallFrontend
bool heimdallFailed;
int heimdallState;
QProcess process;
QProcess heimdallProcess;
PackageData loadedPackageData;
@ -76,6 +82,7 @@ namespace HeimdallFrontend
bool verboseOutput;
void StartHeimdall(const QStringList& arguments);
void UpdateUnusedPartitionIds(void);
@ -85,13 +92,16 @@ namespace HeimdallFrontend
bool IsArchive(QString path);
QString PromptFileSelection(void);
QString PromptFileCreation(void);
void UpdatePartitionNamesInterface(void);
QString PromptFileSelection(const QString& caption = QString("Select File"), const QString& filter = QString());
QString PromptFileCreation(const QString& caption = QString("Save File"), const QString& filter = QString());
void UpdateLoadPackageInterfaceAvailability(void);
void UpdateFlashInterfaceAvailability(void);
void UpdateCreatePackageInterfaceAvailability(void);
void UpdateUtilitiesInterfaceAvailability(void);
void UpdateInterfaceAvailability(void);
void UpdateBuildPackageButton(void);
void UpdatePartitionNamesInterface(void);
public:
@ -155,6 +165,9 @@ namespace HeimdallFrontend
void SelectPitDestination(void);
void DownloadPit(void);
void DevicePrintPitToggled(bool checked);
void LocalFilePrintPitToggled(bool checked);
void SelectPrintPitFile(void);
void PrintPit(void);
// Heimdall Command Line

View File

@ -96,7 +96,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="versionCopyrightLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -114,11 +114,11 @@
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Heimdall Frontend&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version 1.3.2&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version 1.4 RC1&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright © 2010-2012 Benjamin Dobell, Glass Echidna&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Heimdall (command line)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright © 2010-2012 Benjamin Dobell, Glass Echidna&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;%HEIMDALL-VERSION%Copyright © 2010-2012 Benjamin Dobell, Glass Echidna&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">

View File

@ -1,4 +1,4 @@
Copyright (c) 2010-2011 Benjamin Dobell, Glass Echidna
Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:
@ -23,8 +23,7 @@ Flashing Heimdall Firmware Package with Heimdall Frontend:
1. Fully charge your device (use the wall charger as it's faster).
2. Open Heimdall Frontend, which can be done by entering the following
command in a terminal:
2. Open the a terminal and run Heimdall Frontend by typing:
heimdall-frontend
@ -82,14 +81,15 @@ Flashing Heimdall Firmware Package with Heimdall Frontend:
Performing a Custom Flash with Heimdall Frontend:
This is the advanced means of flashing firmware to your device. You should
only flash firmware to your device this way if you know what you're doing.
This is the advanced means of flashing firmware to your device.
If you're not an advanced user or a developer, in the event that a Heimdall
Firmware Package doesn't exist for the particular firmware you wish to
flash. I strongly recommend you get in touch with developer of the
firmware, or an advanced user, and politely ask them to create a Heimdall
Firmware Package for you.
Firmware Package doesn't exist for the particular firmware (or files) that
you wish to flash, then I strongly recommend you get in touch with the
developer of the firmware (or files) and politely ask them to create a
Heimdall Firmware Package for you. In doing so, you avoid the risk of
making mistakes due to inexperience.
If you're looking to customise an existing Heimdall Firmware Package then
follow steps 1-8 of "Flashing Heimdall Firmware Package with Heimdall
@ -108,8 +108,7 @@ Performing a Custom Flash with Heimdall Frontend:
NOTE: If you want to use the CSC then extract it last. If you're asked
to overwrite files then do so.
3. Open Heimdall Frontend, which can be done by entering the following
command in a terminal:
3. Open the a terminal and run Heimdall Frontend by typing:
heimdall-frontend
@ -119,11 +118,14 @@ Performing a Custom Flash with Heimdall Frontend:
5. Before you can chose which partitions you want to flash with particular
files you MUST first select a PIT file. To do this click the "Browse"
button in the "PIT" section. This will open a dialogue allowing you to
navigate to and select a valid PIT (.pit) file.
navigate to and select a valid PIT (.pit) file.
6. If a valid PIT file has been selected then "Add" button below the list
box will become enabled. Press this button to add a partition to your
flash.
If you do not already have a valid PIT file stored on your computer you
can download your device's PIT file from the "Utilities" tab.
6. If a valid PIT file has been selected then the "Add" button below the
"Partitions (Files)" list-box will be enabled. Press this button to add
a partition to your flash.
7. When you first add a partition you will see the "Partition Name" and
"Partition ID" be populated with information. Use the "Partition Name"
@ -221,7 +223,7 @@ How to Create a Heimdall Firmware Package:
compressed with gzip. The only two real requirements are that a valid
firmware.xml must be included (refer to Appendix A) and you can only
include files (no directories, links etc.) As such if you'd like there is
nothing preventing you creating Heimdall packages manually. Of course
nothing preventing you from creating Heimdall packages manually. Of course
Heimdall Frontend provides a simple user interface that takes care of all
the hard work for you.
@ -229,12 +231,11 @@ How to Create a Heimdall Firmware Package:
create a package from scratch, or you can load an existing package, apply
modifications and then save the package. Creating a package from scratch
is the preferred approach, by taking this approach you're far less likely
to run into file name length limitations, these are not Heimdall's own
limitation but rather a limitation of the TAR archive format.
to run into file name length limitations.
Before you can access Heimdall Frontend's firmware creation functionality
(available from the "Create Package" tab) you must first specify which
files will be included in your package as well as a few flashing options
files will be included in your package, as well as a few flashing options
i.e. Whether or not users should repartition when flashing. This
information must be filled out from the "Flash" tab in exactly the same
fashion you would provide information to flash your device (see "Performing
@ -246,7 +247,7 @@ How to Create a Heimdall Firmware Package:
firmware package the "Create Package" tab will become available. Clicking
this tab will display additional information that you can include in your
package. In order to continue you must fill out all sections except for the
URLs section, which is optional. The following is break-down of what all
URLs section, which is optional. The following is a break-down of what all
these options mean.
- General Firmware Information: -
@ -254,11 +255,11 @@ How to Create a Heimdall Firmware Package:
Firmware Name - This is the name of your particular firmware. An
example would be "Cyanogenmod".
Firmware Version - This is the particular version identifier for your
package. Any valid string will be accepted although a the inclusion
of decimal point version number is preferred releases i.e. "7.1".
If it makes sense then feel free to append a text string like "RC1"
or "Beta 1" to the decimal point version.
Firmware Version - This is the version identifier for your package. Any
valid string will be accepted, although the inclusion of decimal
point version number is preferred i.e. "7.1". If it makes sense
then feel free to append a text string like "RC1" or "Beta 1" to
the decimal point version.
Platform Name - This is the name of platform (or operating system) that
your firmware is based on. In most cases this will simply be
@ -295,9 +296,9 @@ How to Create a Heimdall Firmware Package:
team name. Click "Add" and the developer will be added to the list
on the right. If you make a mistake you can select a developer from
the list and click "Remove". You can list as many developers as you
like however size constraints of the "Load Package" means only a
few will be visible. Where possible you may want to opt for team
names over listing individual team members.
like, however visual constraints of the "Load Package" tab means
only a few names will be visible. Where possible you may want to
opt for team names over listing individual team members.
- Supported Devices -
@ -325,7 +326,7 @@ How to Create a Heimdall Firmware Package:
Product Codes (or product IDs) are designated by manufacturers and
are generally the definitive means of referring to a particular
device. Examples are "GT-I9000", "GT-I9100" and "SCH-I897". If
you're unsure of a particular product code then Google and
you're unsure of a particular product code then both Google and
GSMArena are your friends!
@ -339,7 +340,7 @@ How to Create a Heimdall Firmware Package:
Once you've chosen a file name Heimdall Frontend will begin the process of
building the firmware package. In doing so a valid firmware.xml file will
be generated from the information entered, all files will be archived in a
be generated from the information entered. All files will be archived in a
single TAR file then the TAR archive will be compressed via gzip
compression. Compression will take a little while but you will see progress
bars so you know the application hasn't hung. When the progress bars
@ -359,12 +360,12 @@ for the format in their own software.
All Heimdall Firmware Packages must contain a file called firmware.xml. This
file stores information stores meta-data for the package as well as information
about other files contained in the package that indicates how they should be
flashed.
file stores flash information and meta-data for the package as well as
information about other files contained within the package.
The format is fairly straight-forward so it won't be explained in great detail,
nonetheless the following is an example of a valid firmware.xml file.
The format is fairly straight-forward so it won't be explained in great detail.
Nonetheless the following is an example of a valid firmware.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<firmware version="1">
@ -461,17 +462,19 @@ be included.
Appendix B - Installing Heimdall from Source:
1. First make sure you have installed build-tools and pkgconfig.
1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
libusb-1.0-dev (v1.0.8 or newer).
NOTE: Package names may not be absolutely identical to those above.
2. Open a terminal and navigate to the directory you downloaded,
or extracted, Heimdall to.
3. Enter the following commands to compile and install libusb-1.0:
3. Enter the following commands to compile libpit:
cd libusb-1.0
./configure
make
sudo make install
cd libpit
./configure
make
cd ..
If you have problems please consult http://www.libusb.org/
@ -493,8 +496,12 @@ Appendix B - Installing Heimdall from Source:
sudo make install
cd ..
NOTE: You can use "checkinstall" instead of "make install" in order
to generate a redistributable package.
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:
sudo checkinstall --pkgversion <version>
Where <version> is the current Heimdall release e.g. 1.3.0
5. Done
@ -513,9 +520,9 @@ Appendix C - Installing Heimdall Frontend from Source:
4. Enter the following commands to compile and install Heimdall Frontend:
cd heimdall-frontend
qmake heimdall-frontend.pro
qmake-qt4 heimdall-frontend.pro
make
sudo make install
sudo make install
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:

View File

@ -17,34 +17,34 @@ macx {
config += x86 x86_64 ppc
isEqual(OUTPUTDIR, "") {
isEmpty(OUTPUTDIR) {
DESTDIR = /Applications
} else {
DESTDIR = $$OUTPUTDIR
DESTDIR = $$(OUTPUTDIR)
}
} else {
win32 { # It's recommended that Windows users compile via VS2010, but just in case...
win32 { # It is recommended that Windows users compile via VS2010, but just in case...
DESTDIR = ../Win32
!isEqual(OUTPUTDIR, "") {
target.path = $$OUTPUTDIR
!isEmpty(OUTPUTDIR) {
target.path = $$(OUTPUTDIR)
INSTALLS += target
}
} else {
DESTDIR = ../Linux
isEqual(OUTPUTDIR, "") {
isEmpty(OUTPUTDIR) {
target.path = /usr/local/bin
} else {
target.path = $$OUTPUTDIR
target.path = $$(OUTPUTDIR)
}
INSTALLS += target
}
}
unix:LIBS += -lz ../libpit/libpit-1.3.a
unix:LIBS += -lz ../libpit/libpit-1.4.a
win32:LIBS += ../Win32/Release/lib/libpit.lib
QT += core gui xml

View File

@ -69,7 +69,7 @@
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(SolutionDir)$(Platform)\$(Configuration)\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>qtmaind.lib;QtCored4.lib;QtGuid4.lib;QtXml4.lib;libpit.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>qtmaind.lib;QtCored4.lib;QtGuid4.lib;QtXmld4.lib;libpit.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -94,6 +94,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="GeneratedFiles\Debug\moc_aboutform.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_mainwindow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
@ -103,6 +106,9 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_aboutform.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_mainwindow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
@ -130,7 +136,16 @@
<ItemGroup>
<ClInclude Include="GeneratedFiles\ui_aboutform.h" />
<ClInclude Include="GeneratedFiles\ui_mainwindow.h" />
<ClInclude Include="Source\aboutform.h" />
<CustomBuild Include="Source\aboutform.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing %(Identity)...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtXml" "-I." "-I.\..\libpit\Source" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." -D_UNICODE -DQT_CORE_LIB -DQT_GUI_LIB -DQT_LARGEFILE_SUPPORT -DUNICODE -DWIN32</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing %(Identity)...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtXml" "-I." "-I.\..\libpit\Source" "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)\." -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DUNICODE -DWIN32</Command>
</CustomBuild>
<ClInclude Include="Source\Alerts.h" />
<ClInclude Include="Source\FirmwareInfo.h" />
<ClInclude Include="Source\PackageData.h" />
@ -170,6 +185,7 @@
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Uic%27ing %(Identity)...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
<SubType>Designer</SubType>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -61,6 +61,12 @@
<ClCompile Include="Source\Alerts.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_aboutform.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_aboutform.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="mainwindow.ui">
@ -75,6 +81,9 @@
<CustomBuild Include="AboutForm.ui">
<Filter>Form Files</Filter>
</CustomBuild>
<CustomBuild Include="Source\aboutform.h">
<Filter>Source</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GeneratedFiles\ui_mainwindow.h">
@ -83,9 +92,6 @@
<ClInclude Include="GeneratedFiles\ui_AboutForm.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="Source\aboutform.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="Source\Packaging.h">
<Filter>Source</Filter>
</ClInclude>

View File

@ -414,9 +414,9 @@
</property>
<property name="geometry">
<rect>
<x>320</x>
<x>350</x>
<y>130</y>
<width>301</width>
<width>271</width>
<height>31</height>
</rect>
</property>
@ -451,7 +451,7 @@
<rect>
<x>10</x>
<y>130</y>
<width>301</width>
<width>331</width>
<height>21</height>
</rect>
</property>
@ -1348,7 +1348,7 @@
<rect>
<x>10</x>
<y>80</y>
<width>471</width>
<width>461</width>
<height>141</height>
</rect>
</property>
@ -1360,7 +1360,7 @@
<rect>
<x>10</x>
<y>30</y>
<width>451</width>
<width>441</width>
<height>71</height>
</rect>
</property>
@ -1375,7 +1375,7 @@
<rect>
<x>10</x>
<y>30</y>
<width>321</width>
<width>311</width>
<height>21</height>
</rect>
</property>
@ -1389,7 +1389,7 @@
</property>
<property name="geometry">
<rect>
<x>350</x>
<x>340</x>
<y>30</y>
<width>91</width>
<height>23</height>
@ -1406,7 +1406,7 @@
</property>
<property name="geometry">
<rect>
<x>330</x>
<x>320</x>
<y>110</y>
<width>101</width>
<height>23</height>
@ -1419,7 +1419,7 @@
<widget class="QLabel" name="downloadPitTipLabel">
<property name="geometry">
<rect>
<x>440</x>
<x>430</x>
<y>110</y>
<width>21</width>
<height>23</height>
@ -1432,7 +1432,7 @@
</font>
</property>
<property name="toolTip">
<string notr="true">Download a devices PIT file.</string>
<string notr="true">Download and save a device's PIT file.</string>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
@ -1494,7 +1494,7 @@
<rect>
<x>10</x>
<y>10</y>
<width>301</width>
<width>291</width>
<height>61</height>
</rect>
</property>
@ -1504,7 +1504,7 @@
<widget class="QPushButton" name="detectDeviceButton">
<property name="geometry">
<rect>
<x>180</x>
<x>170</x>
<y>30</y>
<width>81</width>
<height>23</height>
@ -1525,7 +1525,7 @@
<rect>
<x>10</x>
<y>30</y>
<width>161</width>
<width>151</width>
<height>21</height>
</rect>
</property>
@ -1542,7 +1542,7 @@
</property>
<property name="geometry">
<rect>
<x>270</x>
<x>260</x>
<y>30</y>
<width>21</width>
<height>23</height>
@ -1555,7 +1555,7 @@
</font>
</property>
<property name="toolTip">
<string notr="true">Detect for a device connected in download mode.</string>
<string notr="true">Detect whether or not a device is connected in download mode.</string>
</property>
<property name="statusTip">
<string notr="true"/>
@ -1586,10 +1586,10 @@
<widget class="QGroupBox" name="printPitGroup">
<property name="geometry">
<rect>
<x>490</x>
<x>480</x>
<y>10</y>
<width>161</width>
<height>61</height>
<width>291</width>
<height>211</height>
</rect>
</property>
<property name="title">
@ -1598,8 +1598,8 @@
<widget class="QPushButton" name="printPitButton">
<property name="geometry">
<rect>
<x>40</x>
<y>30</y>
<x>160</x>
<y>180</y>
<width>81</width>
<height>23</height>
</rect>
@ -1611,8 +1611,8 @@
<widget class="QLabel" name="printPitTipLabel">
<property name="geometry">
<rect>
<x>130</x>
<y>30</y>
<x>250</x>
<y>180</y>
<width>21</width>
<height>23</height>
</rect>
@ -1624,7 +1624,7 @@
</font>
</property>
<property name="toolTip">
<string notr="true">Print the contents of a device's PIT file.</string>
<string notr="true">Print the contents of a PIT file in a human readable fashion.</string>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
@ -1645,11 +1645,100 @@
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QRadioButton" name="printPitDeviceRadioBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>261</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Device</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QRadioButton" name="printPitLocalFileRadioBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>261</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Local File</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
<widget class="QGroupBox" name="printLocalPitGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>271</width>
<height>71</height>
</rect>
</property>
<property name="title">
<string>PIT File</string>
</property>
<widget class="QLineEdit" name="printLocalPitLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>171</width>
<height>21</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="printLocalPitBrowseButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>190</x>
<y>30</y>
<width>71</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</widget>
</widget>
<widget class="QGroupBox" name="closePcScreenGroup">
<property name="geometry">
<rect>
<x>320</x>
<x>310</x>
<y>10</y>
<width>161</width>
<height>61</height>
@ -1687,7 +1776,7 @@
</font>
</property>
<property name="toolTip">
<string notr="true">Close the device &lt;--&gt; PC screen displayed on a device.</string>
<string notr="true">Close the &quot;device &lt;--&gt; PC&quot; screen displayed on a device.</string>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>

View File

@ -1,4 +1,4 @@
Copyright (c) 2010-2011 Benjamin Dobell, Glass Echidna
Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,34 +1,42 @@
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
AM_CPPFLAGS = $(DEPS_CFLAGS) -I../libpit/Source
STATIC_LIBS = ../libpit/libpit-1.3.a
bin_PROGRAMS = heimdall
heimdall_SOURCES = source/BeginDumpPacket.h source/BridgeManager.cpp \
source/BridgeManager.h source/DumpPartPitFilePacket.h source/DumpResponse.h \
source/EndFileTransferPacket.h source/EndModemFileTransferPacket.h \
source/EndPitFileTransferPacket.h source/EndPhoneFileTransferPacket.h \
source/EndSessionPacket.h source/FileTransferPacket.h source/FlashPartFileTransferPacket.h \
source/FlashPartPitFilePacket.h source/Heimdall.h source/InboundPacket.h \
source/Interface.cpp source/Interface.h source/main.cpp source/OutboundPacket.h \
source/Packet.h source/PitFilePacket.h source/PitFileResponse.h source/ReceiveFilePartPacket.h \
source/ResponsePacket.h source/SendFilePartPacket.h source/SendFilePartResponse.h \
source/ControlPacket.h source/SessionSetupPacket.h source/SessionSetupResponse.h \
source/DumpPartFileTransferPacket.h
heimdall_LDADD = $(DEPS_LIBS) $(STATIC_LIBS)
if LINUXTARGET
udevrulesdir = /lib/udev/rules.d
udevrules_DATA = 60-heimdall-galaxy-s.rules
install-data-hook:
if UDEVADM
sudo udevadm control --reload_rules
else
sudo service udev restart
endif
endif
dist_noinst_SCRIPTS = autogen.sh
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
AM_CPPFLAGS = $(DEPS_CFLAGS) -I../libpit/Source
STATIC_LIBS = ../libpit/libpit-1.4.a
bin_PROGRAMS = heimdall
heimdall_SOURCES = source/Arguments.cpp \
source/BridgeManager.cpp \
source/ClosePcScreenAction.cpp \
source/DetectAction.cpp \
source/DownloadPitAction.cpp \
source/DumpAction.cpp \
source/FlashAction.cpp \
source/HelpAction.cpp \
source/InfoAction.cpp \
source/Interface.cpp \
source/main.cpp \
source/PrintPitAction.cpp \
source/Utility.cpp \
source/VersionAction.cpp
heimdall_LDADD = $(DEPS_LIBS) $(STATIC_LIBS)
if LINUXTARGET
udevrulesdir = /lib/udev/rules.d
udevrules_DATA = 60-heimdall-galaxy-s.rules
install-data-hook:
@echo ""
@echo "IMPORTANT - You must reboot your machine or execute the following as root:"
if UDEVADM
@echo "udevadm control --reload_rules"
else
@echo "service udev restart"
endif
@echo ""
endif
dist_noinst_SCRIPTS = autogen.sh

View File

@ -56,8 +56,15 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(udevrulesdir)"
PROGRAMS = $(bin_PROGRAMS)
am__dirstamp = $(am__leading_dot)dirstamp
am_heimdall_OBJECTS = source/BridgeManager.$(OBJEXT) \
source/Interface.$(OBJEXT) source/main.$(OBJEXT)
am_heimdall_OBJECTS = source/Arguments.$(OBJEXT) \
source/BridgeManager.$(OBJEXT) \
source/ClosePcScreenAction.$(OBJEXT) \
source/DetectAction.$(OBJEXT) \
source/DownloadPitAction.$(OBJEXT) source/DumpAction.$(OBJEXT) \
source/FlashAction.$(OBJEXT) source/HelpAction.$(OBJEXT) \
source/InfoAction.$(OBJEXT) source/Interface.$(OBJEXT) \
source/main.$(OBJEXT) source/PrintPitAction.$(OBJEXT) \
source/Utility.$(OBJEXT) source/VersionAction.$(OBJEXT)
heimdall_OBJECTS = $(am_heimdall_OBJECTS)
am__DEPENDENCIES_1 =
heimdall_DEPENDENCIES = $(am__DEPENDENCIES_1) $(STATIC_LIBS)
@ -75,15 +82,6 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(heimdall_SOURCES)
DIST_SOURCES = $(heimdall_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@ -178,12 +176,9 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@ -251,18 +246,21 @@ udevadminstalled = @udevadminstalled@
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
AM_CPPFLAGS = $(DEPS_CFLAGS) -I../libpit/Source
STATIC_LIBS = ../libpit/libpit-1.3.a
heimdall_SOURCES = source/BeginDumpPacket.h source/BridgeManager.cpp \
source/BridgeManager.h source/DumpPartPitFilePacket.h source/DumpResponse.h \
source/EndFileTransferPacket.h source/EndModemFileTransferPacket.h \
source/EndPitFileTransferPacket.h source/EndPhoneFileTransferPacket.h \
source/EndSessionPacket.h source/FileTransferPacket.h source/FlashPartFileTransferPacket.h \
source/FlashPartPitFilePacket.h source/Heimdall.h source/InboundPacket.h \
source/Interface.cpp source/Interface.h source/main.cpp source/OutboundPacket.h \
source/Packet.h source/PitFilePacket.h source/PitFileResponse.h source/ReceiveFilePartPacket.h \
source/ResponsePacket.h source/SendFilePartPacket.h source/SendFilePartResponse.h \
source/ControlPacket.h source/SessionSetupPacket.h source/SessionSetupResponse.h \
source/DumpPartFileTransferPacket.h
STATIC_LIBS = ../libpit/libpit-1.4.a
heimdall_SOURCES = source/Arguments.cpp \
source/BridgeManager.cpp \
source/ClosePcScreenAction.cpp \
source/DetectAction.cpp \
source/DownloadPitAction.cpp \
source/DumpAction.cpp \
source/FlashAction.cpp \
source/HelpAction.cpp \
source/InfoAction.cpp \
source/Interface.cpp \
source/main.cpp \
source/PrintPitAction.cpp \
source/Utility.cpp \
source/VersionAction.cpp
heimdall_LDADD = $(DEPS_LIBS) $(STATIC_LIBS)
@LINUXTARGET_TRUE@udevrulesdir = /lib/udev/rules.d
@ -373,27 +371,71 @@ source/$(am__dirstamp):
source/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) source/$(DEPDIR)
@: > source/$(DEPDIR)/$(am__dirstamp)
source/Arguments.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/BridgeManager.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/ClosePcScreenAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/DetectAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/DownloadPitAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/DumpAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/FlashAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/HelpAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/InfoAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/Interface.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/main.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/PrintPitAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/Utility.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
source/VersionAction.$(OBJEXT): source/$(am__dirstamp) \
source/$(DEPDIR)/$(am__dirstamp)
heimdall$(EXEEXT): $(heimdall_OBJECTS) $(heimdall_DEPENDENCIES)
@rm -f heimdall$(EXEEXT)
$(CXXLINK) $(heimdall_OBJECTS) $(heimdall_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f source/Arguments.$(OBJEXT)
-rm -f source/BridgeManager.$(OBJEXT)
-rm -f source/ClosePcScreenAction.$(OBJEXT)
-rm -f source/DetectAction.$(OBJEXT)
-rm -f source/DownloadPitAction.$(OBJEXT)
-rm -f source/DumpAction.$(OBJEXT)
-rm -f source/FlashAction.$(OBJEXT)
-rm -f source/HelpAction.$(OBJEXT)
-rm -f source/InfoAction.$(OBJEXT)
-rm -f source/Interface.$(OBJEXT)
-rm -f source/PrintPitAction.$(OBJEXT)
-rm -f source/Utility.$(OBJEXT)
-rm -f source/VersionAction.$(OBJEXT)
-rm -f source/main.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/Arguments.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/BridgeManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/ClosePcScreenAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/DetectAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/DownloadPitAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/DumpAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/FlashAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/HelpAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/InfoAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/Interface.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/PrintPitAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/Utility.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/VersionAction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@source/$(DEPDIR)/main.Po@am__quote@
.cpp.o:
@ -779,8 +821,12 @@ uninstall-am: uninstall-binPROGRAMS uninstall-udevrulesDATA
@LINUXTARGET_TRUE@install-data-hook:
@LINUXTARGET_TRUE@@UDEVADM_TRUE@ sudo udevadm control --reload_rules
@LINUXTARGET_TRUE@@UDEVADM_FALSE@ sudo service udev restart
@LINUXTARGET_TRUE@ @echo ""
@LINUXTARGET_TRUE@ @echo "IMPORTANT - You must reboot your machine or execute the following as root:"
@LINUXTARGET_TRUE@@UDEVADM_TRUE@ @echo "udevadm control --reload_rules"
@LINUXTARGET_TRUE@@UDEVADM_FALSE@ @echo "service udev restart"
@LINUXTARGET_TRUE@ @echo ""
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

81
heimdall/aclocal.m4 vendored
View File

@ -2460,7 +2460,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@ -2485,10 +2485,13 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -2500,18 +2503,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -3099,11 +3090,11 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@ -3720,7 +3711,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@ -3784,7 +3775,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -4004,7 +3995,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@ -4209,9 +4200,6 @@ m4_if([$1], [CXX], [
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -4276,9 +4264,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -4300,7 +4285,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@ -4392,7 +4376,7 @@ _LT_EOF
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
gnu* | linux* | tpf* | k*bsd*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@ -4462,7 +4446,7 @@ _LT_EOF
fi
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -4637,7 +4621,6 @@ _LT_EOF
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
@ -4876,7 +4859,7 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -5872,7 +5855,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@ -7986,7 +7969,6 @@ m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
@ -8014,10 +7996,7 @@ m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
@ -8030,6 +8009,7 @@ if test -n "$PKG_CONFIG"; then
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
@ -8038,20 +8018,21 @@ fi[]dnl
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
@ -8104,7 +8085,6 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
@ -8114,7 +8094,7 @@ if test $pkg_failed = yes; then
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
@ -8122,24 +8102,25 @@ $$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])dnl
])
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
])
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# This file was generated by Autom4te Thu Aug 5 21:29:16 UTC 2010.
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.

View File

@ -6,7 +6,7 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:1: -1- AC_SUBST([SHELL])
m4trace:configure.ac:1: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR])
@ -27,9 +27,6 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
@ -101,27 +98,23 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
#undef PACKAGE_NAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
#undef PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
#undef PACKAGE_VERSION])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
#undef PACKAGE_STRING])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
#undef PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- AC_SUBST([DEFS])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
@ -151,12 +144,6 @@ m4trace:configure.ac:3: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
m4trace:configure.ac:3: -1- AC_SUBST([PKG_CONFIG])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PKG_CONFIG])
m4trace:configure.ac:3: -1- m4_pattern_allow([^PKG_CONFIG$])
m4trace:configure.ac:3: -1- AC_SUBST([PKG_CONFIG_PATH])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PKG_CONFIG_PATH])
m4trace:configure.ac:3: -1- m4_pattern_allow([^PKG_CONFIG_PATH$])
m4trace:configure.ac:3: -1- AC_SUBST([PKG_CONFIG_LIBDIR])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PKG_CONFIG_LIBDIR])
m4trace:configure.ac:3: -1- m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
m4trace:configure.ac:3: -1- AC_SUBST([PKG_CONFIG])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PKG_CONFIG])
m4trace:configure.ac:3: -1- m4_pattern_allow([^PKG_CONFIG$])
@ -167,7 +154,7 @@ m4trace:configure.ac:3: -1- AC_SUBST([DEPS_LIBS])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([DEPS_LIBS])
m4trace:configure.ac:3: -1- m4_pattern_allow([^DEPS_LIBS$])
m4trace:configure.ac:4: -1- _m4_warn([obsolete], [The macro `AC_PROGRAM_CHECK' is obsolete.
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:41: AC_PROGRAM_CHECK is expanded from...
You should run autoupdate.], [../../lib/autoconf/oldnames.m4:62: AC_PROGRAM_CHECK is expanded from...
configure.ac:4: the top level])
m4trace:configure.ac:4: -1- AC_SUBST([udevadminstalled])
m4trace:configure.ac:4: -1- AC_SUBST_TRACE([udevadminstalled])
@ -461,7 +448,7 @@ m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_OBJDIR$])
m4trace:configure.ac:10: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
@%:@undef LT_OBJDIR])
#undef LT_OBJDIR])
m4trace:configure.ac:10: -1- AC_SUBST([lt_ECHO])
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([lt_ECHO])
m4trace:configure.ac:10: -1- m4_pattern_allow([^lt_ECHO$])
@ -482,7 +469,7 @@ m4trace:configure.ac:10: -1- AC_SUBST([OTOOL64])
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OTOOL64])
m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL64$])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
#undef HAVE_DLFCN_H])
m4trace:configure.ac:10: -1- AC_SUBST([CPP])
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
@ -495,27 +482,25 @@ m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:10: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:10: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
#undef STDC_HEADERS])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
#undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
#undef HAVE_SYS_STAT_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
#undef HAVE_STDLIB_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
#undef HAVE_STRING_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
#undef HAVE_MEMORY_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
#undef HAVE_STRINGS_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
#undef HAVE_INTTYPES_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
#undef HAVE_STDINT_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:10: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
#undef HAVE_UNISTD_H])
m4trace:configure.ac:10: -1- LT_SUPPORTED_TAG([CXX])
m4trace:configure.ac:10: -1- AC_SUBST([CXX])
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CXX])
@ -581,19 +566,19 @@ m4trace:configure.ac:13: -1- m4_pattern_allow([^MAINT$])
m4trace:configure.ac:18: -1- AC_DEFINE_TRACE_LITERAL([OS_LINUX])
m4trace:configure.ac:18: -1- m4_pattern_allow([^OS_LINUX$])
m4trace:configure.ac:18: -1- AH_OUTPUT([OS_LINUX], [/* Linux backend */
@%:@undef OS_LINUX])
#undef OS_LINUX])
m4trace:configure.ac:23: -1- AC_DEFINE_TRACE_LITERAL([OS_DARWIN])
m4trace:configure.ac:23: -1- m4_pattern_allow([^OS_DARWIN$])
m4trace:configure.ac:23: -1- AH_OUTPUT([OS_DARWIN], [/* Darwin backend */
@%:@undef OS_DARWIN])
#undef OS_DARWIN])
m4trace:configure.ac:28: -1- AC_DEFINE_TRACE_LITERAL([OS_WINDOWS])
m4trace:configure.ac:28: -1- m4_pattern_allow([^OS_WINDOWS$])
m4trace:configure.ac:28: -1- AH_OUTPUT([OS_WINDOWS], [/* Windows backend */
@%:@undef OS_WINDOWS])
#undef OS_WINDOWS])
m4trace:configure.ac:33: -1- AC_DEFINE_TRACE_LITERAL([OS_WINDOWS])
m4trace:configure.ac:33: -1- m4_pattern_allow([^OS_WINDOWS$])
m4trace:configure.ac:33: -1- AH_OUTPUT([OS_WINDOWS], [/* Windows backend */
@%:@undef OS_WINDOWS])
#undef OS_WINDOWS])
m4trace:configure.ac:41: -1- AM_CONDITIONAL([LINUXTARGET], [test x$linuxtarget = xtrue])
m4trace:configure.ac:41: -1- AC_SUBST([LINUXTARGET_TRUE])
m4trace:configure.ac:41: -1- AC_SUBST_TRACE([LINUXTARGET_TRUE])
@ -628,7 +613,7 @@ m4trace:configure.ac:44: -1- m4_pattern_allow([^WORDS_BIGENDIAN$])
m4trace:configure.ac:44: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD])
m4trace:configure.ac:44: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$])
m4trace:configure.ac:44: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */
@%:@undef AC_APPLE_UNIVERSAL_BUILD])
#undef AC_APPLE_UNIVERSAL_BUILD])
m4trace:configure.ac:46: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:46: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:46: -1- m4_pattern_allow([^LIB@&t@OBJS$])

View File

@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2009-12-30'
timestamp='2009-11-20'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -56,9 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

View File

@ -58,9 +58,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

View File

@ -1,80 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Darwin backend */
#undef OS_DARWIN
/* Linux backend */
#undef OS_LINUX
/* Windows backend */
#undef OS_WINDOWS
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif

19
heimdall/config.sub vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2010-01-22'
timestamp='2009-11-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -75,9 +75,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -381,8 +380,7 @@ case $basic_machine in
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \
@ -1087,11 +1085,6 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
@ -1442,8 +1435,6 @@ case $os in
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)

5590
heimdall/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
Copyright (c) 2010-2011 Benjamin Dobell, Glass Echidna
Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:
@ -23,8 +23,7 @@ Flashing Heimdall Firmware Package with Heimdall Frontend:
1. Fully charge your device (use the wall charger as it's faster).
2. Open Heimdall Frontend, which can be done by entering the following
command in a terminal:
2. Open the a terminal and run Heimdall Frontend by typing:
heimdall-frontend
@ -82,14 +81,15 @@ Flashing Heimdall Firmware Package with Heimdall Frontend:
Performing a Custom Flash with Heimdall Frontend:
This is the advanced means of flashing firmware to your device. You should
only flash firmware to your device this way if you know what you're doing.
This is the advanced means of flashing firmware to your device.
If you're not an advanced user or a developer, in the event that a Heimdall
Firmware Package doesn't exist for the particular firmware you wish to
flash. I strongly recommend you get in touch with developer of the
firmware, or an advanced user, and politely ask them to create a Heimdall
Firmware Package for you.
Firmware Package doesn't exist for the particular firmware (or files) that
you wish to flash, then I strongly recommend you get in touch with the
developer of the firmware (or files) and politely ask them to create a
Heimdall Firmware Package for you. In doing so, you avoid the risk of
making mistakes due to inexperience.
If you're looking to customise an existing Heimdall Firmware Package then
follow steps 1-8 of "Flashing Heimdall Firmware Package with Heimdall
@ -108,8 +108,7 @@ Performing a Custom Flash with Heimdall Frontend:
NOTE: If you want to use the CSC then extract it last. If you're asked
to overwrite files then do so.
3. Open Heimdall Frontend, which can be done by entering the following
command in a terminal:
3. Open the a terminal and run Heimdall Frontend by typing:
heimdall-frontend
@ -119,11 +118,14 @@ Performing a Custom Flash with Heimdall Frontend:
5. Before you can chose which partitions you want to flash with particular
files you MUST first select a PIT file. To do this click the "Browse"
button in the "PIT" section. This will open a dialogue allowing you to
navigate to and select a valid PIT (.pit) file.
navigate to and select a valid PIT (.pit) file.
6. If a valid PIT file has been selected then "Add" button below the list
box will become enabled. Press this button to add a partition to your
flash.
If you do not already have a valid PIT file stored on your computer you
can download your device's PIT file from the "Utilities" tab.
6. If a valid PIT file has been selected then the "Add" button below the
"Partitions (Files)" list-box will be enabled. Press this button to add
a partition to your flash.
7. When you first add a partition you will see the "Partition Name" and
"Partition ID" be populated with information. Use the "Partition Name"
@ -221,7 +223,7 @@ How to Create a Heimdall Firmware Package:
compressed with gzip. The only two real requirements are that a valid
firmware.xml must be included (refer to Appendix A) and you can only
include files (no directories, links etc.) As such if you'd like there is
nothing preventing you creating Heimdall packages manually. Of course
nothing preventing you from creating Heimdall packages manually. Of course
Heimdall Frontend provides a simple user interface that takes care of all
the hard work for you.
@ -229,12 +231,11 @@ How to Create a Heimdall Firmware Package:
create a package from scratch, or you can load an existing package, apply
modifications and then save the package. Creating a package from scratch
is the preferred approach, by taking this approach you're far less likely
to run into file name length limitations, these are not Heimdall's own
limitation but rather a limitation of the TAR archive format.
to run into file name length limitations.
Before you can access Heimdall Frontend's firmware creation functionality
(available from the "Create Package" tab) you must first specify which
files will be included in your package as well as a few flashing options
files will be included in your package, as well as a few flashing options
i.e. Whether or not users should repartition when flashing. This
information must be filled out from the "Flash" tab in exactly the same
fashion you would provide information to flash your device (see "Performing
@ -246,7 +247,7 @@ How to Create a Heimdall Firmware Package:
firmware package the "Create Package" tab will become available. Clicking
this tab will display additional information that you can include in your
package. In order to continue you must fill out all sections except for the
URLs section, which is optional. The following is break-down of what all
URLs section, which is optional. The following is a break-down of what all
these options mean.
- General Firmware Information: -
@ -254,11 +255,11 @@ How to Create a Heimdall Firmware Package:
Firmware Name - This is the name of your particular firmware. An
example would be "Cyanogenmod".
Firmware Version - This is the particular version identifier for your
package. Any valid string will be accepted although a the inclusion
of decimal point version number is preferred releases i.e. "7.1".
If it makes sense then feel free to append a text string like "RC1"
or "Beta 1" to the decimal point version.
Firmware Version - This is the version identifier for your package. Any
valid string will be accepted, although the inclusion of decimal
point version number is preferred i.e. "7.1". If it makes sense
then feel free to append a text string like "RC1" or "Beta 1" to
the decimal point version.
Platform Name - This is the name of platform (or operating system) that
your firmware is based on. In most cases this will simply be
@ -295,9 +296,9 @@ How to Create a Heimdall Firmware Package:
team name. Click "Add" and the developer will be added to the list
on the right. If you make a mistake you can select a developer from
the list and click "Remove". You can list as many developers as you
like however size constraints of the "Load Package" means only a
few will be visible. Where possible you may want to opt for team
names over listing individual team members.
like, however visual constraints of the "Load Package" tab means
only a few names will be visible. Where possible you may want to
opt for team names over listing individual team members.
- Supported Devices -
@ -325,7 +326,7 @@ How to Create a Heimdall Firmware Package:
Product Codes (or product IDs) are designated by manufacturers and
are generally the definitive means of referring to a particular
device. Examples are "GT-I9000", "GT-I9100" and "SCH-I897". If
you're unsure of a particular product code then Google and
you're unsure of a particular product code then both Google and
GSMArena are your friends!
@ -339,7 +340,7 @@ How to Create a Heimdall Firmware Package:
Once you've chosen a file name Heimdall Frontend will begin the process of
building the firmware package. In doing so a valid firmware.xml file will
be generated from the information entered, all files will be archived in a
be generated from the information entered. All files will be archived in a
single TAR file then the TAR archive will be compressed via gzip
compression. Compression will take a little while but you will see progress
bars so you know the application hasn't hung. When the progress bars
@ -359,12 +360,12 @@ for the format in their own software.
All Heimdall Firmware Packages must contain a file called firmware.xml. This
file stores information stores meta-data for the package as well as information
about other files contained in the package that indicates how they should be
flashed.
file stores flash information and meta-data for the package as well as
information about other files contained within the package.
The format is fairly straight-forward so it won't be explained in great detail,
nonetheless the following is an example of a valid firmware.xml file.
The format is fairly straight-forward so it won't be explained in great detail.
Nonetheless the following is an example of a valid firmware.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<firmware version="1">
@ -461,17 +462,19 @@ be included.
Appendix B - Installing Heimdall from Source:
1. First make sure you have installed build-tools and pkgconfig.
1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
libusb-1.0-dev (v1.0.8 or newer).
NOTE: Package names may not be absolutely identical to those above.
2. Open a terminal and navigate to the directory you downloaded,
or extracted, Heimdall to.
3. Enter the following commands to compile and install libusb-1.0:
3. Enter the following commands to compile libpit:
cd libusb-1.0
./configure
make
sudo make install
cd libpit
./configure
make
cd ..
If you have problems please consult http://www.libusb.org/
@ -493,8 +496,12 @@ Appendix B - Installing Heimdall from Source:
sudo make install
cd ..
NOTE: You can use "checkinstall" instead of "make install" in order
to generate a redistributable package.
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:
sudo checkinstall --pkgversion <version>
Where <version> is the current Heimdall release e.g. 1.3.0
5. Done
@ -513,9 +520,9 @@ Appendix C - Installing Heimdall Frontend from Source:
4. Enter the following commands to compile and install Heimdall Frontend:
cd heimdall-frontend
qmake heimdall-frontend.pro
qmake-qt4 heimdall-frontend.pro
make
sudo make install
sudo make install
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:

View File

@ -100,11 +100,23 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="source\Arguments.h" />
<ClInclude Include="source\BeginDumpPacket.h" />
<ClInclude Include="source\BeginSessionPacket.h" />
<ClInclude Include="source\BridgeManager.h" />
<ClInclude Include="source\ClosePcScreenAction.h" />
<ClInclude Include="source\DetectAction.h" />
<ClInclude Include="source\DownloadPitAction.h" />
<ClInclude Include="source\DumpAction.h" />
<ClInclude Include="source\FlashAction.h" />
<ClInclude Include="source\HelpAction.h" />
<ClInclude Include="source\InfoAction.h" />
<ClInclude Include="source\PrintPitAction.h" />
<ClInclude Include="source\ControlPacket.h" />
<ClInclude Include="source\SetupSessionPacket.h" />
<ClInclude Include="source\SetupSessionResponse.h" />
<ClInclude Include="source\DeviceTypePacket.h" />
<ClInclude Include="source\FilePartSizePacket.h" />
<ClInclude Include="source\SessionSetupPacket.h" />
<ClInclude Include="source\SessionSetupResponse.h" />
<ClInclude Include="source\DumpPartFileTransferPacket.h" />
<ClInclude Include="source\DumpPartPitFilePacket.h" />
<ClInclude Include="source\DumpResponse.h" />
@ -127,11 +139,25 @@
<ClInclude Include="source\ResponsePacket.h" />
<ClInclude Include="source\SendFilePartPacket.h" />
<ClInclude Include="source\SendFilePartResponse.h" />
<ClInclude Include="source\TotalBytesPacket.h" />
<ClInclude Include="source\Utility.h" />
<ClInclude Include="source\VersionAction.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="source\Arguments.cpp" />
<ClCompile Include="source\BridgeManager.cpp" />
<ClCompile Include="source\ClosePcScreenAction.cpp" />
<ClCompile Include="source\DetectAction.cpp" />
<ClCompile Include="source\DownloadPitAction.cpp" />
<ClCompile Include="source\DumpAction.cpp" />
<ClCompile Include="source\FlashAction.cpp" />
<ClCompile Include="source\HelpAction.cpp" />
<ClCompile Include="source\InfoAction.cpp" />
<ClCompile Include="source\PrintPitAction.cpp" />
<ClCompile Include="source\Interface.cpp" />
<ClCompile Include="source\main.cpp" />
<ClCompile Include="source\Utility.cpp" />
<ClCompile Include="source\VersionAction.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -5,89 +5,146 @@
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Source\Packets">
<UniqueIdentifier>{7022245a-f8d3-4dd6-b0f4-9cca8f9bdd69}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Packets\Inbound">
<UniqueIdentifier>{0da20d7b-9a83-4c5b-89ea-5f312268048a}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Packets\Outbound">
<UniqueIdentifier>{586c7149-045a-407e-82b5-56e437d71e9b}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Interface">
<UniqueIdentifier>{e334486e-629c-47ed-b8e6-daa083a1d2df}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\BeginDumpPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\BridgeManager.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\ControlPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\DumpPartFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\DumpPartPitFilePacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\DumpResponse.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\EndFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\EndModemFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\EndPhoneFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\FileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\FlashPartFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\FlashPartPitFilePacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\Heimdall.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\InboundPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\OutboundPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\Packet.h">
<Filter>Source</Filter>
<Filter>Source\Packets</Filter>
</ClInclude>
<ClInclude Include="source\PitFilePacket.h">
<Filter>Source</Filter>
<ClInclude Include="source\BeginDumpPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\PitFileResponse.h">
<Filter>Source</Filter>
<ClInclude Include="source\BeginSessionPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\ReceiveFilePartPacket.h">
<Filter>Source</Filter>
<ClInclude Include="source\ControlPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\ResponsePacket.h">
<Filter>Source</Filter>
<ClInclude Include="source\DeviceTypePacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\SendFilePartPacket.h">
<Filter>Source</Filter>
<ClInclude Include="source\DumpPartFileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\SendFilePartResponse.h">
<Filter>Source</Filter>
<ClInclude Include="source\DumpPartPitFilePacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\Interface.h">
<Filter>Source</Filter>
<ClInclude Include="source\EndFileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\EndModemFileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\EndPhoneFileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\EndPitFileTransferPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\SetupSessionPacket.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\SetupSessionResponse.h">
<Filter>Source</Filter>
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\EndSessionPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\FilePartSizePacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\FileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\FlashPartFileTransferPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\FlashPartPitFilePacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\PitFilePacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\SendFilePartPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\SessionSetupPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\TotalBytesPacket.h">
<Filter>Source\Packets\Outbound</Filter>
</ClInclude>
<ClInclude Include="source\DumpResponse.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\PitFileResponse.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\SendFilePartResponse.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\SessionSetupResponse.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\ReceiveFilePartPacket.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\ResponsePacket.h">
<Filter>Source\Packets\Inbound</Filter>
</ClInclude>
<ClInclude Include="source\InboundPacket.h">
<Filter>Source\Packets</Filter>
</ClInclude>
<ClInclude Include="source\OutboundPacket.h">
<Filter>Source\Packets</Filter>
</ClInclude>
<ClInclude Include="source\Interface.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\Arguments.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\PrintPitAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\DownloadPitAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\ClosePcScreenAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\FlashAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\Utility.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\DumpAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\DetectAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\InfoAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\HelpAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
<ClInclude Include="source\VersionAction.h">
<Filter>Source\Interface</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="source\BridgeManager.cpp">
@ -97,7 +154,40 @@
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="source\Interface.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\Arguments.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\PrintPitAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\DownloadPitAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\ClosePcScreenAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\FlashAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\Utility.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="source\DumpAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\DetectAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\InfoAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\HelpAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
<ClCompile Include="source\VersionAction.cpp">
<Filter>Source\Interface</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -65,7 +65,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
# $progname: (GNU libtool) 2.2.6b
# automake: $automake_version
# autoconf: $autoconf_version
#
@ -73,7 +73,7 @@
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
VERSION=2.2.6b
TIMESTAMP=""
package_revision=1.3017
@ -5033,10 +5033,7 @@ func_mode_link ()
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test "$linkmode,$pass" = "lib,dlpreopen"; then
@ -5347,19 +5344,19 @@ func_mode_link ()
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
continue
fi # $pass = conv
@ -5896,7 +5893,6 @@ func_mode_link ()
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
-L*) path="$deplib" ;;
*.la)
@ -6210,9 +6206,6 @@ func_mode_link ()
revision="$number_minor"
lt_irix_increment=no
;;
*)
func_fatal_configuration "$modename: unknown library version type \`$version_type'"
;;
esac
;;
no)

View File

@ -2445,7 +2445,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@ -2470,10 +2470,13 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -2485,18 +2488,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -3084,11 +3075,11 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@ -3705,7 +3696,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@ -3769,7 +3760,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -3989,7 +3980,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@ -4194,9 +4185,6 @@ m4_if([$1], [CXX], [
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -4261,9 +4249,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -4285,7 +4270,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@ -4377,7 +4361,7 @@ _LT_EOF
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
gnu* | linux* | tpf* | k*bsd*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@ -4447,7 +4431,7 @@ _LT_EOF
fi
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -4622,7 +4606,6 @@ _LT_EOF
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
@ -4861,7 +4844,7 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -5861,7 +5844,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler

View File

@ -0,0 +1,212 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Arguments.h"
#include "Heimdall.h"
#include "Interface.h"
#include "Utility.h"
using namespace Heimdall;
FlagArgument *FlagArgument::ParseArgument(int argc, char **argv, int& argi)
{
return new FlagArgument();
}
StringArgument *StringArgument::ParseArgument(int argc, char **argv, int& argi)
{
if (++argi < argc)
{
return (new StringArgument(argv[argi]));
}
else
{
Interface::Print("Missing parameter for argument: %s\n\n", argv[argi - 1]);
return (nullptr);
}
}
UnsignedIntegerArgument *UnsignedIntegerArgument::ParseArgument(int argc, char **argv, int& argi)
{
UnsignedIntegerArgument *unsignedIntegerArgument = nullptr;
if (++argi < argc)
{
unsigned int value;
if (Utility::ParseUnsignedInt(value, argv[argi]) == kNumberParsingStatusSuccess)
unsignedIntegerArgument = new UnsignedIntegerArgument(value);
else
Interface::Print("%s must be a positive integer.", argv[argi - 1]);
}
else
{
Interface::Print("Missing parameter for argument: %s\n\n", argv[argi - 1]);
}
return (unsignedIntegerArgument);
}
Arguments::Arguments(const map<string, ArgumentType>& argumentTypes, const map<string, string>& shortArgumentAliases,
const map<string, string> argumentAliases) :
argumentTypes(argumentTypes),
shortArgumentAliases(shortArgumentAliases),
argumentAliases(argumentAliases)
{
}
Arguments::~Arguments()
{
for (map<string, Argument *>::const_iterator it = arguments.begin(); it != arguments.end(); it++)
delete it->second;
}
bool Arguments::ParseArguments(int argc, char **argv, int argi)
{
for (; argi < argc; ++argi)
{
string argumentName = argv[argi];
string nonwildcardArgumentName;
if (argumentName.find_first_of("--") == 0)
{
// Regular argument
argumentName = argumentName.substr(2);
nonwildcardArgumentName = argumentName;
}
else if (argumentName.find_first_of("-") == 0)
{
// Short argument alias
string shortArgumentAlias = argumentName.substr(1);
map<string, string>::const_iterator shortAliasIt = shortArgumentAliases.find(shortArgumentAlias);
if (shortAliasIt != shortArgumentAliases.end())
{
argumentName = shortAliasIt->second;
nonwildcardArgumentName = argumentName;
}
else
{
Interface::Print("Unknown argument: %s\n\n", argv[argi]);
return (false);
}
}
else
{
Interface::Print("Invalid argument: %s\n\n", argv[argi]);
return (false);
}
map<string, ArgumentType>::const_iterator argumentTypeIt = argumentTypes.find(argumentName);
if (argumentTypeIt == argumentTypes.end())
{
// No argument with that name, maybe it's an alias...
map<string, string>::const_iterator aliasIt = argumentAliases.find(argumentName);
if (aliasIt != argumentAliases.end())
{
argumentName = aliasIt->second;
nonwildcardArgumentName = argumentName;
argumentTypeIt = argumentTypes.find(argumentName);
}
}
// Handle wilcards
unsigned int unsignedIntName;
if (argumentTypeIt == argumentTypes.end())
{
// Look for the unsigned integer wildcard "%d".
if (Utility::ParseUnsignedInt(unsignedIntName, argumentName.c_str()) == kNumberParsingStatusSuccess)
{
argumentTypeIt = argumentTypes.find("%d");
argumentName = "%d";
}
// Look for the string wildcard "%s"
if (argumentTypeIt == argumentTypes.end())
{
argumentTypeIt = argumentTypes.find("%s");
argumentName = "%s";
}
}
Argument *argument = nullptr;
if (argumentTypeIt != argumentTypes.end())
{
switch (argumentTypeIt->second)
{
case kArgumentTypeFlag:
argument = FlagArgument::ParseArgument(argc, argv, argi);
break;
case kArgumentTypeString:
argument = StringArgument::ParseArgument(argc, argv, argi);
break;
case kArgumentTypeUnsignedInteger:
argument = UnsignedIntegerArgument::ParseArgument(argc, argv, argi);
break;
default:
Interface::Print("Unknown argument type: %s\n\n", argv[argi]);
break;
}
}
else
{
Interface::Print("Unknown argument: %s\n\n", argv[argi]);
}
// We don't want to insert wild-cards into our argument map.
if (argumentName == "%d" || argumentName == "%s")
argumentName = nonwildcardArgumentName;
if (argument)
{
pair<map<string, Argument *>::iterator, bool> insertResult = arguments.insert(pair<string, Argument *>(argumentName, argument));
if (!insertResult.second)
{
Interface::Print("Duplicate argument: %s (%s)\n\n", argv[argi], insertResult.first->first.c_str());
delete argument;
return (false);
}
}
else
{
return (false);
}
}
return (true);
}

160
heimdall/source/Arguments.h Normal file
View File

@ -0,0 +1,160 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef ARGUMENTS_H
#define ARGUMENTS_H
// C/C++ Standard Library
#include <map>
#include <string>
// Heimdall
#include "Heimdall.h"
using namespace std;
namespace Heimdall
{
typedef enum
{
kArgumentTypeFlag = 0,
kArgumentTypeString,
kArgumentTypeUnsignedInteger
} ArgumentType;
class Argument
{
private:
ArgumentType argumentType;
protected:
Argument(ArgumentType argumentType)
{
this->argumentType = argumentType;
}
public:
virtual ~Argument()
{
}
ArgumentType GetArgumentType(void) const
{
return argumentType;
}
};
class FlagArgument : public Argument
{
private:
FlagArgument() : Argument(kArgumentTypeFlag)
{
}
public:
static FlagArgument *ParseArgument(int argc, char **argv, int& argi);
};
class StringArgument : public Argument
{
private:
string value;
StringArgument(const string& value) : Argument(kArgumentTypeString)
{
this->value = value;
}
public:
static StringArgument *ParseArgument(int argc, char **argv, int& argi);
const string& GetValue(void) const
{
return (value);
}
};
class UnsignedIntegerArgument : public Argument
{
private:
unsigned int value;
UnsignedIntegerArgument(unsigned int value) : Argument(kArgumentTypeUnsignedInteger)
{
this->value = value;
}
public:
static UnsignedIntegerArgument *ParseArgument(int argc, char **argv, int& argi);
unsigned int GetValue(void) const
{
return (value);
}
};
class Arguments
{
private:
const map<string, ArgumentType> argumentTypes;
const map<string, string> shortArgumentAliases;
const map<string, string> argumentAliases;
map<string, Argument *> arguments;
public:
Arguments(const map<string, ArgumentType>& argumentTypes, const map<string, string>& shortArgumentAliases = map<string, string>(),
const map<string, string> argumentAliases = map<string, string>());
~Arguments();
// argi is the index of the first argument to parse.
bool ParseArguments(int argc, char **argv, int argi);
const Argument *GetArgument(string argumentName) const
{
map<string, Argument *>::const_iterator it = arguments.find(argumentName);
return (it != arguments.end() ? it->second : nullptr);
}
const map<string, ArgumentType>& GetArgumentTypes(void) const
{
return (argumentTypes);
}
const map<string, Argument *>& GetArguments(void) const
{
return (arguments);
}
};
}
#endif

View File

@ -0,0 +1,39 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef BEGINSESSIONPACKET_H
#define BEGINSESSIONPACKET_H
// Heimdall
#include "SessionSetupPacket.h"
namespace Heimdall
{
class BeginSessionPacket : public SessionSetupPacket
{
public:
BeginSessionPacket() : SessionSetupPacket(SessionSetupPacket::kBeginSession)
{
}
};
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -41,8 +41,8 @@ namespace Heimdall
const int productId;
DeviceIdentifier(int vid, int pid) :
vendorId(vid),
productId(pid)
vendorId(vid),
productId(pid)
{
}
};
@ -53,10 +53,12 @@ namespace Heimdall
enum
{
kSupportedDeviceCount = 3,
kSupportedDeviceCount = 3,
};
kCommunicationDelayDefault = 0,
kDumpBufferSize = 4096
enum
{
kCommunicationDelayDefault = 0
};
enum
@ -83,15 +85,18 @@ namespace Heimdall
static const DeviceIdentifier supportedDevices[kSupportedDeviceCount];
bool verbose;
int communicationDelay;
libusb_context *libusbContext;
libusb_device_handle *deviceHandle;
libusb_device *heimdallDevice;
int interfaceIndex;
int altSettingIndex;
int inEndpoint;
int outEndpoint;
int communicationDelay;
bool interfaceClaimed;
#ifdef OS_LINUX
@ -99,29 +104,39 @@ namespace Heimdall
#endif
unsigned int fileTransferSequenceMaxLength;
unsigned int fileTransferPacketSize;
unsigned int fileTransferSequenceTimeout;
int FindDeviceInterface(void);
bool ClaimDeviceInterface(void);
bool SetupDeviceInterface(void);
void ReleaseDeviceInterface(void);
bool CheckProtocol(void) const;
bool InitialiseProtocol(void) const;
public:
BridgeManager(bool verbose, int communicationDelay);
BridgeManager(bool verbose, int communicationDelay = BridgeManager::kCommunicationDelayDefault);
~BridgeManager();
bool DetectDevice(void);
int Initialise(void);
bool BeginSession(void) const;
bool BeginSession(void);
bool EndSession(bool reboot) const;
bool SendPacket(OutboundPacket *packet, int timeout = 3000, bool retry = true) const;
bool ReceivePacket(InboundPacket *packet, int timeout = 3000, bool retry = true) const;
bool ReceivePacket(InboundPacket *packet, int timeout = 3000, bool retry = true, unsigned char *buffer = nullptr, unsigned int bufferSize = -1) const;
bool RequestDeviceInfo(unsigned int request, int *result) const;
bool RequestDeviceType(unsigned int request, int *result) const;
bool SendPitFile(FILE *file) const;
int ReceivePitFile(unsigned char **pitBuffer) const;
int DownloadPitFile(unsigned char **pitBuffer) const; // Thin wrapper around ReceivePitFile() with additional logging.
bool SendFile(FILE *file, unsigned int destination, unsigned int chipIdentifier, unsigned int fileIdentifier = 0xFFFFFFFF) const;
bool SendFile(FILE *file, unsigned int destination, unsigned int deviceType, unsigned int fileIdentifier = 0xFFFFFFFF) const;
bool ReceiveDump(unsigned int chipType, unsigned int chipId, FILE *file) const;
bool IsVerbose(void) const

View File

@ -0,0 +1,94 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "ClosePcScreenAction.h"
#include "Heimdall.h"
#include "Interface.h"
using namespace Heimdall;
const char *ClosePcScreenAction::usage = "Action: close-pc-screen\n\
Arguments: [--verbose] [--no-reboot] [--stdout-errors] [--delay <ms>]\n\
Description: Attempts to get rid off the \"connect phone to PC\" screen.\n";
int ClosePcScreenAction::Execute(int argc, char **argv)
{
// Handle arguments
map<string, ArgumentType> argumentTypes;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
Arguments arguments(argumentTypes);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(ClosePcScreenAction::usage);
return (0);
}
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
// Info
Interface::PrintReleaseInfo();
Sleep(1000);
// Download PIT file from device.
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (communicationDelayArgument)
communicationDelay = communicationDelayArgument->GetValue();
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession())
{
delete bridgeManager;
return (1);
}
Interface::Print("Attempting to close connect to pc screen...\n");
bool success = bridgeManager->EndSession(reboot);
delete bridgeManager;
if (success)
{
Interface::Print("Attempt complete\n");
return (0);
}
else
{
return (1);
}
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef CLOSEPCSCREENACTION_H
#define CLOSEPCSCREENACTION_H
namespace Heimdall
{
namespace ClosePcScreenAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -32,10 +32,10 @@ namespace Heimdall
enum
{
kControlTypeSetupSession = 0x64,
kControlTypePitFile = 0x65,
kControlTypeFileTransfer = 0x66,
kControlTypeEndSession = 0x67
kControlTypeSession = 0x64,
kControlTypePitFile = 0x65,
kControlTypeFileTransfer = 0x66,
kControlTypeEndSession = 0x67
};
protected:

View File

@ -0,0 +1,64 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "DetectAction.h"
#include "Heimdall.h"
#include "Interface.h"
using namespace Heimdall;
const char *DetectAction::usage = "Action: detect\n\
Arguments: [--verbose] [--stdout-errors]\n\
Description: Indicates whether or not a download mode device can be detected.\n";
int DetectAction::Execute(int argc, char **argv)
{
// Handle arguments
map<string, ArgumentType> argumentTypes;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
Arguments arguments(argumentTypes);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(DetectAction::usage);
return (0);
}
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
// Download PIT file from device.
BridgeManager *bridgeManager = new BridgeManager(verbose);
bool detected = bridgeManager->DetectDevice();
delete bridgeManager;
return ((detected) ? 0 : 1);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef DETECTACTION_H
#define DETECTACTION_H
namespace Heimdall
{
namespace DetectAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -0,0 +1,39 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef DEVICETYPEPACKET_H
#define DEVICETYPEPACKET_H
// Heimdall
#include "SessionSetupPacket.h"
namespace Heimdall
{
class DeviceTypePacket : public SessionSetupPacket
{
public:
DeviceTypePacket() : SessionSetupPacket(SessionSetupPacket::kDeviceType)
{
}
};
}
#endif

View File

@ -0,0 +1,135 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// C Standard Library
#include <stdio.h>
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "DownloadPitAction.h"
#include "Heimdall.h"
#include "Interface.h"
using namespace Heimdall;
const char *DownloadPitAction::usage = "Action: download-pit\n\
Arguments: --output <filename> [--verbose] [--no-reboot] [--stdout-errors]\n\
[--delay <ms>]\n\
Description: Downloads the connected device's PIT file to the specified\n\
output file.\n";
int DownloadPitAction::Execute(int argc, char **argv)
{
// Handle arguments
map<string, ArgumentType> argumentTypes;
argumentTypes["output"] = kArgumentTypeString;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
Arguments arguments(argumentTypes);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(DownloadPitAction::usage);
return (0);
}
const StringArgument *outputArgument = static_cast<const StringArgument *>(arguments.GetArgument("output"));
if (!outputArgument)
{
Interface::Print("Output file was not specified.\n\n");
Interface::Print(DownloadPitAction::usage);
return (0);
}
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
// Info
Interface::PrintReleaseInfo();
Sleep(1000);
// Open output file
const char *outputFilename = outputArgument->GetValue().c_str();
FILE *outputPitFile = fopen(outputFilename, "wb");
if (!outputPitFile)
{
Interface::PrintError("Failed to open output file \"%s\"\n", outputFilename);
return (1);
}
// Download PIT file from device.
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (communicationDelayArgument)
communicationDelay = communicationDelayArgument->GetValue();
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession())
{
fclose(outputPitFile);
delete bridgeManager;
return (1);
}
unsigned char *pitBuffer;
int fileSize = bridgeManager->DownloadPitFile(&pitBuffer);
bool success = true;
if (fileSize > 0)
{
if (fwrite(pitBuffer, 1, fileSize, outputPitFile) != fileSize)
{
Interface::PrintError("Failed to write PIT data to output file.\n");
success = false;
}
}
else
{
success = false;
}
if (!bridgeManager->EndSession(reboot))
success = false;
delete bridgeManager;
fclose(outputPitFile);
delete [] pitBuffer;
return (success ? 0 : 1);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef DOWNLOADPITACTION_H
#define DOWNLOADPITACTION_H
namespace Heimdall
{
namespace DownloadPitAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -0,0 +1,158 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// C Standard Library
#include <stdio.h>
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "DumpAction.h"
#include "Heimdall.h"
#include "Interface.h"
using namespace Heimdall;
const char *DumpAction::usage = "Action: dump\n\
Arguments: --chip-type <NAND | RAM> --chip-id <integer> --output <filename>\n\
[--verbose] [--no-reboot] [--stdout-errors] [--delay <ms>]\n\
Description: Attempts to dump data from the phone corresponding to the\n\
specified chip type and chip ID.\n\
NOTE: Galaxy S phones don't appear to properly support this functionality.\n";
int DumpAction::Execute(int argc, char **argv)
{
// Handle arguments
map<string, ArgumentType> argumentTypes;
argumentTypes["chip-type"] = kArgumentTypeString;
argumentTypes["chip-id"] = kArgumentTypeUnsignedInteger;
argumentTypes["output"] = kArgumentTypeString;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
Arguments arguments(argumentTypes);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(DumpAction::usage);
return (0);
}
const StringArgument *chipTypeArgument = static_cast<const StringArgument *>(arguments.GetArgument("chip-type"));
const UnsignedIntegerArgument *chipIdArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("chip-id"));
const StringArgument *outputArgument = static_cast<const StringArgument *>(arguments.GetArgument("output"));
if (!outputArgument)
{
Interface::Print("Output file was not specified.\n\n");
Interface::Print(DumpAction::usage);
return (false);
}
if (!chipTypeArgument)
{
Interface::Print("You must specify a chip type.\n\n");
Interface::Print(DumpAction::usage);
return (false);
}
if (!(chipTypeArgument->GetValue() == "RAM" || chipTypeArgument->GetValue() == "ram" || chipTypeArgument->GetValue() == "NAND"
|| chipTypeArgument->GetValue() == "nand"))
{
Interface::Print("Unknown chip type: %s.\n\n", chipTypeArgument->GetValue().c_str());
Interface::Print(DumpAction::usage);
return (false);
}
if (!chipIdArgument)
{
Interface::Print("You must specify a chip ID.\n\n");
Interface::Print(DumpAction::usage);
return (false);
}
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
// Open output file
const char *outputFilename = outputArgument->GetValue().c_str();
FILE *dumpFile = fopen(outputFilename, "wb");
if (!dumpFile)
{
Interface::PrintError("Failed to open file \"%s\"\n", outputFilename);
return (1);
}
// Info
Interface::PrintReleaseInfo();
Sleep(1000);
// Dump
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (communicationDelayArgument)
communicationDelay = communicationDelayArgument->GetValue();
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession())
{
fclose(dumpFile);
delete bridgeManager;
return (1);
}
int chipType = 0;
if (chipTypeArgument->GetValue() == "NAND" || chipTypeArgument->GetValue() == "nand")
chipType = 1;
bool success = bridgeManager->ReceiveDump(chipType, chipIdArgument->GetValue(), dumpFile);
fclose(dumpFile);
if (!bridgeManager->EndSession(reboot))
success = false;
delete bridgeManager;
if (success)
{
Interface::Print("Attempt complete\n");
return (0);
}
else
{
return (1);
}
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef DUMPACTION_H
#define DUMPACTION_H
namespace Heimdall
{
namespace DumpAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -0,0 +1,56 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef FILEPARTSIZEPACKET_H
#define FILEPARTSIZEPACKET_H
// Heimdall
#include "SessionSetupPacket.h"
namespace Heimdall
{
class FilePartSizePacket : public SessionSetupPacket
{
private:
unsigned int filePartSize;
public:
FilePartSizePacket(unsigned int filePartSize) : SessionSetupPacket(SessionSetupPacket::kFilePartSize)
{
this->filePartSize = filePartSize;
}
unsigned int GetFilePartSize(void) const
{
return filePartSize;
}
void Pack(void)
{
SessionSetupPacket::Pack();
PackInteger(SessionSetupPacket::kDataSize, filePartSize);
}
};
}
#endif

View File

@ -0,0 +1,620 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// C Standard Library
#include <stdio.h>
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "EndModemFileTransferPacket.h"
#include "EndPhoneFileTransferPacket.h"
#include "FlashAction.h"
#include "Heimdall.h"
#include "Interface.h"
#include "SessionSetupResponse.h"
#include "TotalBytesPacket.h"
#include "Utility.h"
using namespace Heimdall;
const char *FlashAction::usage = "Action: flash\n\
Arguments:\n\
--repartition --pit <filename> [--factoryfs <filename>]\n\
[--cache <filename>] [--dbdata <filename>] [--primary-boot <filename>]\n\
[--secondary-boot <filename>] [--param <filename>] [--kernel <filename>]\n\
[--modem <filename>] [--radio <filename>] [--normal-boot <filename>]\n\
[--system <filename>] [--user-data <filename>] [--fota <filename>]\n\
[--hidden <filename>] [--movinand <filename>] [--data <filename>]\n\
[--ums <filename>] [--emmc <filename>]\n\
[--<partition identifier> <filename>]\n\
[--<partition name> <filename>]\n\
[--verbose] [--no-reboot] [--stdout-errors] [--delay <ms>]\n\
or:\n\
[--factoryfs <filename>] [--cache <filename>] [--dbdata <filename>]\n\
[--primary-boot <filename>] [--secondary-boot <filename>]\n\
[--secondary-boot-backup <filename>] [--param <filename>]\n\
[--kernel <filename>] [--recovery <filename>] [--efs <filename>]\n\
[--modem <filename>] [--radio <filename>] [--normal-boot <filename>]\n\
[--system <filename>] [--user-data <filename>] [--fota <filename>]\n\
[--hidden <filename>] [--movinand <filename>] [--data <filename>]\n\
[--ums <filename>] [--emmc <filename>] [--pit <filename>]\n\
[--<partition identifier> <filename>]\n\
[--<partition name> <filename>]\n\
[--verbose] [--no-reboot] [--stdout-errors] [--delay <ms>]\n\
Description: Flashes firmware files to your phone. Partition identifiers are\n\
integer values, they can be obtained by executing the print-pit action.\n\
WARNING: If you're repartitioning it's strongly recommended you specify\n\
all files at your disposal, including bootloaders.\n";
struct PartitionFlashInfo
{
const PitEntry *pitEntry;
FILE *file;
PartitionFlashInfo(const PitEntry *pitEntry, FILE *file)
{
this->pitEntry = pitEntry;
this->file = file;
}
};
static void buildArgumentPartitionNamesMap(map< string, vector<string> >& argumentPartitionNamesMap, map<string, string>& shortArgumentAliases)
{
argumentPartitionNamesMap["pit"].push_back("PIT");
argumentPartitionNamesMap["factoryfs"].push_back("FACTORYFS");
argumentPartitionNamesMap["cache"].push_back("CACHE");
argumentPartitionNamesMap["dbdata"].push_back("DBDATAFS");
argumentPartitionNamesMap["primary-boot"].push_back("IBL+PBL");
argumentPartitionNamesMap["primary-boot"].push_back("BOOT");
argumentPartitionNamesMap["secondary-boot"].push_back("SBL");
argumentPartitionNamesMap["secondary-boot"].push_back("SBL1");
argumentPartitionNamesMap["secondary-boot-backup"].push_back("SBL2");
argumentPartitionNamesMap["param"].push_back("PARAM");
argumentPartitionNamesMap["kernel"].push_back("KERNEL");
argumentPartitionNamesMap["recovery"].push_back("RECOVERY");
argumentPartitionNamesMap["efs"].push_back("EFS");
argumentPartitionNamesMap["modem"].push_back("MODEM");
argumentPartitionNamesMap["radio"].push_back("RADIO");
argumentPartitionNamesMap["normal-boot"].push_back("NORMALBOOT");
argumentPartitionNamesMap["system"].push_back("SYSTEM");
argumentPartitionNamesMap["user-data"].push_back("USERDATA");
argumentPartitionNamesMap["fota"].push_back("FOTA");
argumentPartitionNamesMap["hidden"].push_back("HIDDEN");
argumentPartitionNamesMap["movinand"].push_back("MOVINAND");
argumentPartitionNamesMap["data"].push_back("DATAFS");
argumentPartitionNamesMap["ums"].push_back("UMS.EN");
argumentPartitionNamesMap["emmc"].push_back("GANG");
shortArgumentAliases["pit"] = "pit";
shortArgumentAliases["fs"] = "factoryfs";
shortArgumentAliases["cache"] = "cache";
shortArgumentAliases["db"] = "dbdata";
shortArgumentAliases["boot"] = "primary-boot";
shortArgumentAliases["sbl"] = "secondary-boot";
shortArgumentAliases["sbl2"] = "secondary-boot-backup";
shortArgumentAliases["param"] = "param";
shortArgumentAliases["z"] = "kernel";
shortArgumentAliases["rec"] = "recovery";
shortArgumentAliases["efs"] = "efs";
shortArgumentAliases["m"] = "modem";
shortArgumentAliases["rdio"] = "radio";
shortArgumentAliases["norm"] = "normal-boot";
shortArgumentAliases["sys"] = "system";
shortArgumentAliases["udata"] = "user-data";
shortArgumentAliases["fota"] = "fota";
shortArgumentAliases["hide"] = "hidden";
shortArgumentAliases["nand"] = "movinand";
shortArgumentAliases["data"] = "data";
shortArgumentAliases["ums"] = "ums";
shortArgumentAliases["emmc"] = "emmc";
}
static bool openFiles(Arguments& arguments, const map< string, vector<string> >& argumentPartitionNamesMap,
map<string, FILE *>& argumentFileMap)
{
for (map<string, Argument *>::const_iterator it = arguments.GetArguments().begin(); it != arguments.GetArguments().end(); it++)
{
bool isPartitionArgument = false;
const string& argumentName = it->first;
if (arguments.GetArgumentTypes().find(argumentName) == arguments.GetArgumentTypes().end())
{
// The only way an argument could exist without being in the argument types map is if it's a wild-card.
// The "%d" wild-card refers to a partition by identifier, where as the "%s" wild-card refers to a
// partition by name.
isPartitionArgument = true;
}
else
{
// The argument wasn't a wild-card, check if it's a known partition name.
if (argumentPartitionNamesMap.find(argumentName) != argumentPartitionNamesMap.end())
isPartitionArgument = true;
}
if (isPartitionArgument)
{
const StringArgument *stringArgument = static_cast<StringArgument *>(it->second);
FILE *file = fopen(stringArgument->GetValue().c_str(), "rb");
if (!file)
{
Interface::PrintError("Failed to open file \"%s\"\n", stringArgument->GetValue().c_str());
return (false);
}
argumentFileMap[it->first] = file;
}
}
return (true);
}
static void closeFiles(map<string, FILE *> argumentfileMap)
{
for (map<string, FILE *>::iterator it = argumentfileMap.begin(); it != argumentfileMap.end(); it++)
fclose(it->second);
argumentfileMap.clear();
}
static bool sendTotalTransferSize(BridgeManager *bridgeManager, const map<string, FILE *>& argumentFileMap, bool repartition)
{
int totalBytes = 0;
for (map<string, FILE *>::const_iterator it = argumentFileMap.begin(); it != argumentFileMap.end(); it++)
{
if (repartition || it->first != "pit")
{
fseek(it->second, 0, SEEK_END);
totalBytes += ftell(it->second);
rewind(it->second);
}
}
bool success;
TotalBytesPacket *totalBytesPacket = new TotalBytesPacket(totalBytes);
success = bridgeManager->SendPacket(totalBytesPacket);
delete totalBytesPacket;
if (!success)
{
Interface::PrintError("Failed to send total bytes device info packet!\n");
return (false);
}
SessionSetupResponse *totalBytesResponse = new SessionSetupResponse();
success = bridgeManager->ReceivePacket(totalBytesResponse);
int totalBytesResult = totalBytesResponse->GetResult();
delete totalBytesResponse;
if (!success)
{
Interface::PrintError("Failed to receive device info response!\n");
return (false);
}
if (totalBytesResult != 0)
{
Interface::PrintError("Unexpected device info response!\nExpected: 0\nReceived:%d\n", totalBytesResponse);
return (false);
}
return (true);
}
static bool setupPartitionFlashInfo(const map<string, FILE *>& argumentFileMap, const map< string, vector<string> >& argumentPartitionNamesMap,
const PitData *pitData, vector<PartitionFlashInfo>& partitionFlashInfos)
{
for (map<string, FILE *>::const_iterator it = argumentFileMap.begin(); it != argumentFileMap.end(); it++)
{
const string& argumentName = it->first;
FILE *partitionFile = it->second;
const PitEntry *pitEntry = nullptr;
// Was the argument a partition identifier?
unsigned int partitionIdentifier;
if (Utility::ParseUnsignedInt(partitionIdentifier, argumentName.c_str()) == kNumberParsingStatusSuccess)
{
pitEntry = pitData->FindEntry(partitionIdentifier);
if (!pitEntry)
{
Interface::PrintError("No partition with identifier \"%s\" exists in the specified PIT.\n", argumentName.c_str());
return (false);
}
}
else
{
// The argument wasn't a partition identifier. Was it a known human-readable partition name?
map< string, vector<string> >::const_iterator argumentPartitionNamesIt = argumentPartitionNamesMap.find(argumentName);
if (argumentPartitionNamesIt != argumentPartitionNamesMap.end())
{
const vector<string>& partitionNames = argumentPartitionNamesIt->second;
// Check for the partition in the PIT file using all known names.
for (vector<string>::const_iterator nameIt = partitionNames.begin(); nameIt != partitionNames.end(); nameIt++)
{
pitEntry = pitData->FindEntry(nameIt->c_str());
if (pitEntry)
break;
}
if (!pitEntry)
{
Interface::PrintError("Partition name for \"%s\" could not be located\n", argumentName.c_str());
return (false);
}
}
else
{
// The argument must be an actual partition name. e.g. "ZIMAGE", instead of human-readable "kernel".
pitEntry = pitData->FindEntry(argumentName.c_str());
if (!pitEntry)
{
Interface::PrintError("Partition \"%s\" does not exist in the specified PIT.\n", argumentName.c_str());
return (false);
}
}
}
partitionFlashInfos.push_back(PartitionFlashInfo(pitEntry, partitionFile));
}
return (true);
}
static bool isKnownPartition(const map<string, vector<string> >& argumentPartitionNamesMap, const string& argumentName, const string& partitionName)
{
const vector<string>& partitionNames = argumentPartitionNamesMap.find(argumentName)->second;
for (vector<string>::const_iterator it = partitionNames.begin(); it != partitionNames.end(); it++)
{
if (partitionName == *it)
return (true);
}
return (false);
}
static bool isKnownBootPartition(const map<string, vector<string> >& argumentPartitionNamesMap, const char *partitionName)
{
return (isKnownPartition(argumentPartitionNamesMap, "primary-boot", partitionName)
|| isKnownPartition(argumentPartitionNamesMap, "secondary-boot", partitionName)
|| isKnownPartition(argumentPartitionNamesMap, "secondary-boot-backup", partitionName)
|| isKnownPartition(argumentPartitionNamesMap, "param", partitionName)
|| isKnownPartition(argumentPartitionNamesMap, "normal-boot", partitionName)
|| strcmp(partitionName, "SBL3") == 0
|| strcmp(partitionName, "ABOOT") == 0
|| strcmp(partitionName, "RPM") == 0
|| strcmp(partitionName, "TZ") == 0);
}
static bool flashFile(BridgeManager *bridgeManager, const map< string, vector<string> >& argumentPartitionNamesMap,
const PartitionFlashInfo& partitionFlashInfo)
{
// PIT files need to be handled differently, try determine if the partition we're flashing to is a PIT partition.
if (isKnownPartition(argumentPartitionNamesMap, "pit", partitionFlashInfo.pitEntry->GetPartitionName()))
{
Interface::Print("Uploading %s\n", partitionFlashInfo.pitEntry->GetPartitionName());
if (bridgeManager->SendPitFile(partitionFlashInfo.file))
{
Interface::Print("%s upload successful\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (true);
}
else
{
Interface::PrintError("%s upload failed!\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (false);
}
}
else
{
if (partitionFlashInfo.pitEntry->GetBinaryType() == PitEntry::kBinaryTypeCommunicationProcessor) // Modem
{
Interface::Print("Uploading %s\n", partitionFlashInfo.pitEntry->GetPartitionName());
if (bridgeManager->SendFile(partitionFlashInfo.file, EndModemFileTransferPacket::kDestinationModem,
partitionFlashInfo.pitEntry->GetDeviceType())) // <-- Odin method
{
Interface::Print("%s upload successful\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (true);
}
else
{
Interface::PrintError("%s upload failed!\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (false);
}
}
else // partitionFlashInfo.pitEntry->GetBinaryType() == PitEntry::kBinaryTypeApplicationProcessor
{
Interface::Print("Uploading %s\n", partitionFlashInfo.pitEntry->GetPartitionName());
if (bridgeManager->SendFile(partitionFlashInfo.file, EndPhoneFileTransferPacket::kDestinationPhone,
partitionFlashInfo.pitEntry->GetDeviceType(), partitionFlashInfo.pitEntry->GetIdentifier()))
{
Interface::Print("%s upload successful\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (true);
}
else
{
Interface::PrintError("%s upload failed!\n\n", partitionFlashInfo.pitEntry->GetPartitionName());
return (false);
}
}
}
return (true);
}
static bool flashPartitions(const map<string, FILE *>& argumentFileMap, const map< string, vector<string> >& argumentPartitionNamesMap,
const PitData *pitData, BridgeManager *bridgeManager, bool repartition)
{
vector<PartitionFlashInfo> partitionFlashInfos;
// Map the files being flashed to partitions stored in the PIT file.
if (!setupPartitionFlashInfo(argumentFileMap, argumentPartitionNamesMap, pitData, partitionFlashInfos))
return (false);
// If we're repartitioning then we need to flash the PIT file first.
if (repartition)
{
vector<PartitionFlashInfo>::const_iterator it;
for (it = partitionFlashInfos.begin(); it != partitionFlashInfos.end(); it++)
{
if (isKnownPartition(argumentPartitionNamesMap, "pit", it->pitEntry->GetPartitionName()))
{
if (!flashFile(bridgeManager, argumentPartitionNamesMap, *it))
return (false);
break;
}
}
if (it == partitionFlashInfos.end())
{
Interface::PrintError("Could not identify the PIT partition within the specified PIT file.\n\n");
return (false);
}
}
// Flash partitions not involved in the boot process second.
for (vector<PartitionFlashInfo>::const_iterator it = partitionFlashInfos.begin(); it != partitionFlashInfos.end(); it++)
{
if (!isKnownPartition(argumentPartitionNamesMap, "pit", it->pitEntry->GetPartitionName())
&& !isKnownBootPartition(argumentPartitionNamesMap, it->pitEntry->GetPartitionName()))
{
if (!flashFile(bridgeManager, argumentPartitionNamesMap, *it))
return (false);
}
}
// Flash boot partitions last.
for (vector<PartitionFlashInfo>::const_iterator it = partitionFlashInfos.begin(); it != partitionFlashInfos.end(); it++)
{
if (isKnownBootPartition(argumentPartitionNamesMap, it->pitEntry->GetPartitionName()))
{
if (!flashFile(bridgeManager, argumentPartitionNamesMap, *it))
return (false);
}
}
return (true);
}
static PitData *getPitData(const map<string, FILE *>& argumentFileMap, BridgeManager *bridgeManager, bool repartition)
{
PitData *pitData;
PitData *localPitData = nullptr;
// If a PIT file was passed as an argument then we must unpack it.
map<string, FILE *>::const_iterator localPitFileIt = argumentFileMap.find("pit");
if (localPitFileIt != argumentFileMap.end())
{
FILE *localPitFile = localPitFileIt->second;
// Load the local pit file into memory.
unsigned char *pitFileBuffer = new unsigned char[4096];
memset(pitFileBuffer, 0, 4096);
fseek(localPitFile, 0, SEEK_END);
long localPitFileSize = ftell(localPitFile);
rewind(localPitFile);
// dataRead is discarded, it's here to remove warnings.
int dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile);
rewind(localPitFile);
localPitData = new PitData();
localPitData->Unpack(pitFileBuffer);
delete [] pitFileBuffer;
}
if (repartition)
{
// Use the local PIT file data.
pitData = localPitData;
}
else
{
// If we're not repartitioning then we need to retrieve the device's PIT file and unpack it.
unsigned char *pitFileBuffer;
if (bridgeManager->DownloadPitFile(&pitFileBuffer) == 0)
return (nullptr);
pitData = new PitData();
pitData->Unpack(pitFileBuffer);
delete [] pitFileBuffer;
if (localPitData != nullptr)
{
// The user has specified a PIT without repartitioning, we should verify the local and device PIT data match!
bool pitsMatch = pitData->Matches(localPitData);
delete localPitData;
if (!pitsMatch)
{
Interface::Print("Local and device PIT files don't match and repartition wasn't specified!\n");
Interface::PrintError("Flash aborted!\n");
return (nullptr);
}
}
}
return (pitData);
}
int FlashAction::Execute(int argc, char **argv)
{
// Setup argument types
map<string, ArgumentType> argumentTypes;
argumentTypes["repartition"] = kArgumentTypeString;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
map< string, vector<string> > argumentPartitionNamesMap;
map<string, string> shortArgumentAliases;
buildArgumentPartitionNamesMap(argumentPartitionNamesMap, shortArgumentAliases);
for (map< string, vector<string> >::const_iterator it = argumentPartitionNamesMap.begin(); it != argumentPartitionNamesMap.end(); it++)
argumentTypes[it->first] = kArgumentTypeString;
// Add wild-cards "%d" and "%s", for partition identifiers and partition names respectively.
argumentTypes["%d"] = kArgumentTypeString;
shortArgumentAliases["%d"] = "%d";
argumentTypes["%s"] = kArgumentTypeString;
shortArgumentAliases["%s"] = "%s";
map<string, string> argumentAliases;
argumentAliases["PIT"] = "pit"; // Map upper-case PIT argument (i.e. partition name) to known lower-case pit argument.
// Handle arguments
Arguments arguments(argumentTypes, shortArgumentAliases, argumentAliases);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(FlashAction::usage);
return (0);
}
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
const StringArgument *pitArgument = static_cast<const StringArgument *>(arguments.GetArgument("pit"));
bool repartition = arguments.GetArgument("repartition") != nullptr;
if (repartition && !pitArgument)
{
Interface::Print("If you wish to repartition then a PIT file must be specified.\n\n");
Interface::Print(FlashAction::usage);
return (0);
}
// Open files
map<string, FILE *> argumentFileMap;
if (!openFiles(arguments, argumentPartitionNamesMap, argumentFileMap))
{
closeFiles(argumentFileMap);
return (1);
}
if (argumentFileMap.size() == 0)
{
Interface::Print(FlashAction::usage);
return (0);
}
// Info
Interface::PrintReleaseInfo();
Sleep(1000);
// Perform flash
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (communicationDelayArgument)
communicationDelay = communicationDelayArgument->GetValue();
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession())
{
closeFiles(argumentFileMap);
delete bridgeManager;
return (1);
}
bool success = sendTotalTransferSize(bridgeManager, argumentFileMap, repartition);
if (success)
{
PitData *pitData = getPitData(argumentFileMap, bridgeManager, repartition);
if (pitData)
success = flashPartitions(argumentFileMap, argumentPartitionNamesMap, pitData, bridgeManager, repartition);
else
success = false;
delete pitData;
}
closeFiles(argumentFileMap);
if (!bridgeManager->EndSession(reboot))
success = false;
delete bridgeManager;
return (success ? 0 : 1);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef FLASHACTION_H
#define FLASHACTION_H
namespace Heimdall
{
namespace FlashAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -30,34 +30,26 @@ namespace Heimdall
{
private:
unsigned short unknown;
unsigned int transferCount;
unsigned int sequenceByteCount;
public:
FlashPartFileTransferPacket(unsigned short unknown, unsigned int transferCount)
FlashPartFileTransferPacket(unsigned int sequenceByteCount)
: FileTransferPacket(FileTransferPacket::kRequestPart)
{
this->unknown = unknown;
this->transferCount = transferCount;
this->sequenceByteCount = sequenceByteCount;
}
unsigned short GetUnknown(void) const
unsigned int GetSequenceByteCount(void) const
{
return (unknown);
}
unsigned int GetTransferCount(void) const
{
return (transferCount);
return (sequenceByteCount);
}
void Pack(void)
{
FileTransferPacket::Pack();
PackShort(FileTransferPacket::kDataSize, unknown);
PackInteger(FileTransferPacket::kDataSize + 2, transferCount);
PackInteger(FileTransferPacket::kDataSize, sequenceByteCount);
}
};
}

View File

@ -23,6 +23,7 @@
#ifdef OS_WINDOWS
#include <Windows.h>
#undef GetBinaryType
#else
#include "../config.h"

View File

@ -0,0 +1,35 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Heimdall.h"
#include "HelpAction.h"
#include "Interface.h"
using namespace Heimdall;
const char *HelpAction::usage = "Action: help\n\
Description: Displays this dialogue.\n";
int HelpAction::Execute(int argc, char **argv)
{
Interface::PrintUsage();
return (0);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef HELPACTION_H
#define HELPACTION_H
namespace Heimdall
{
namespace HelpAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -0,0 +1,35 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Heimdall.h"
#include "InfoAction.h"
#include "Interface.h"
using namespace Heimdall;
const char *InfoAction::usage = "Action: info\n\
Description: Displays information about Heimdall.\n";
int InfoAction::Execute(int argc, char **argv)
{
Interface::PrintFullInfo();
return (0);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef INFOACTION_H
#define INFOACTION_H
namespace Heimdall
{
namespace InfoAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -24,330 +24,60 @@
#include <stdio.h>
// Heimdall
#include "ClosePcScreenAction.h"
#include "DetectAction.h"
#include "DownloadPitAction.h"
#include "DumpAction.h"
#include "FlashAction.h"
#include "HelpAction.h"
#include "InfoAction.h"
#include "Heimdall.h"
#include "Interface.h"
#include "PrintPitAction.h"
#include "VersionAction.h"
using namespace std;
using namespace libpit;
using namespace Heimdall;
bool Interface::stdoutErrors = false;
map<string, Interface::ActionInfo> actionMap;
bool stdoutErrors = false;
const char *version = "v1.4 RC1";
const char *actionUsage = "Usage: heimdall <action> <action arguments>\n";
const char *Interface::version = "v1.3.2";
const char *Interface::usage = "Usage: heimdall <action> <action arguments> <common arguments>\n\
\n\
Common Arguments:\n\
[--verbose] [--no-reboot] [--stdout-errors] [--delay <ms>]\n\
\n\
\n\
Action: flash\n\
Arguments:\n\
--repartition --pit <filename> [--factoryfs <filename>]\n\
[--cache <filename>] [--dbdata <filename>] [--primary-boot <filename>]\n\
[--secondary-boot <filename>] [--param <filename>] [--kernel <filename>]\n\
[--modem <filename>] [--normal-boot <filename>] [--system <filename>]\n\
[--user-data <filename>] [--fota <filename>] [--hidden <filename>]\n\
[--movinand <filename>] [--data <filename>] [--ums <filename>]\n\
[--emmc <filename>] [--<partition identifier> <filename>]\n\
or:\n\
[--factoryfs <filename>] [--cache <filename>] [--dbdata <filename>]\n\
[--primary-boot <filename>] [--secondary-boot <filename>]\n\
[--secondary-boot-backup <filename>] [--param <filename>]\n\
[--kernel <filename>] [--recovery <filename>] [--efs <filename>]\n\
[--modem <filename>] [--normal-boot <filename>] [--system <filename>]\n\
[--user-data <filename>] [--fota <filename>] [--hidden <filename>]\n\
[--movinand <filename>] [--data <filename>] [--ums <filename>]\n\
[--emmc <filename>] [--<partition identifier> <filename>]\n\
Description: Flashes firmware files to your phone.\n\
WARNING: If you're repartitioning it's strongly recommended you specify\n\
all files at your disposal, including bootloaders.\n\
\n\
Action: close-pc-screen\n\
Description: Attempts to get rid off the \"connect phone to PC\" screen.\n\
\n\
Action: download-pit\n\
Arguments: --output <filename>\n\
Description: Downloads the connected device's PIT file to the specified\n\
output file.\n\
\n\
Action: detect\n\
Description: Indicates whether or not a download mode device can be detected.\n\
\n\
Action: dump\n\
Arguments: --chip-type <NAND | RAM> --chip-id <integer> --output <filename>\n\
Description: Attempts to dump data from the phone corresponding to the\n\
specified chip type and chip ID.\n\
NOTE: Galaxy S phones don't appear to properly support this functionality.\n\
\n\
Action: print-pit\n\
Description: Dumps the PIT file from the connected device and prints it in\n\
a human readable format.\n\
\n\
Action: version\n\
Description: Displays the version number of this binary.\n\
\n\
Action: help\n\
Description: Displays this dialogue.\n";
const char *Interface::releaseInfo = "Heimdall %s, Copyright (c) 2010-2012, Benjamin Dobell, Glass Echidna\n\
http://www.glassechidna.com.au\n\n\
const char *releaseInfo = "Heimdall %s\n\n\
Copyright (c) 2010-2012, Benjamin Dobell, Glass Echidna\n\
http://www.glassechidna.com.au/\n\n\
This software is provided free of charge. Copying and redistribution is\nencouraged.\n\n\
If you appreciate this software and you would like to support future\ndevelopment please consider donating:\n\
http://www.glassechidna.com.au/donate/\n\n";
const char *Interface::extraInfo = "Heimdall utilises libusb-1.0 for all USB communication:\n\
static const char *extraInfo = "Heimdall utilises libusb-1.0 for all USB communication:\n\
http://www.libusb.org/\n\
\n\
libusb-1.0 is licensed under the LGPL-2.1:\n\
http://www.gnu.org/licenses/licenses.html#LGPL\n\n";
// Flash arguments
string Interface::flashValueArguments[kFlashValueArgCount] = {
"-pit", "-factoryfs", "-cache", "-dbdata", "-primary-boot", "-secondary-boot", "-secondary-boot-backup", "-param", "-kernel", "-recovery", "-efs", "-modem",
"-normal-boot", "-system", "-user-data", "-fota", "-hidden", "-movinand", "-data", "-ums", "-emmc", "-%d"
};
string Interface::flashValueShortArguments[kFlashValueArgCount] = {
"pit", "fs", "cache", "db", "boot", "sbl", "sbl2", "param", "z", "rec", "efs", "m",
"norm", "sys", "udata", "fota", "hide", "nand", "data", "ums", "emmc", "%d"
};
string Interface::flashValuelessArguments[kFlashValuelessArgCount] = {
"-repartition"
};
string Interface::flashValuelessShortArguments[kFlashValuelessArgCount] = {
"r"
};
// Download PIT arguments
string Interface::downloadPitValueArguments[kDownloadPitValueArgCount] = {
"-output"
};
string Interface::downloadPitValueShortArguments[kDownloadPitValueArgCount] = {
"o"
};
// Dump arguments
string Interface::dumpValueArguments[kDumpValueArgCount] = {
"-chip-type", "-chip-id", "-output"
};
string Interface::dumpValueShortArguments[kDumpValueArgCount] = {
"type", "id", "out"
};
// Common arguments
string Interface::commonValueArguments[kCommonValueArgCount] = {
"-delay"
};
string Interface::commonValueShortArguments[kCommonValueArgCount] = {
"d"
};
string Interface::commonValuelessArguments[kCommonValuelessArgCount] = {
"-verbose", "-no-reboot", "-stdout-errors"
};
string Interface::commonValuelessShortArguments[kCommonValuelessArgCount] = {
"v", "nobt", "err"
};
Action Interface::actions[Interface::kActionCount] = {
// kActionFlash
Action("flash", flashValueArguments, flashValueShortArguments, kFlashValueArgCount,
flashValuelessArguments, flashValuelessShortArguments, kFlashValuelessArgCount),
// kActionClosePcScreen
Action("close-pc-screen", nullptr, nullptr, kClosePcScreenValueArgCount,
nullptr, nullptr, kClosePcScreenValuelessArgCount),
// kActionDump
Action("dump", dumpValueArguments, dumpValueShortArguments, kDumpValueArgCount,
nullptr, nullptr, kDumpValuelessArgCount),
// kActionPrintPit
Action("print-pit", nullptr, nullptr, kPrintPitValueArgCount,
nullptr, nullptr, kPrintPitValuelessArgCount),
// kActionVersion
Action("version", nullptr, nullptr, kVersionValueArgCount,
nullptr, nullptr, kVersionValuelessArgCount),
// kActionHelp
Action("help", nullptr, nullptr, kHelpValueArgCount,
nullptr, nullptr, kHelpValuelessArgCount),
// kActionDetect
Action("detect", nullptr, nullptr, kDetectValueArgCount,
nullptr, nullptr, kDetectValuelessArgCount),
// kActionDownloadPit
Action("download-pit", downloadPitValueArguments, downloadPitValueShortArguments, kDownloadPitValueArgCount,
nullptr, nullptr, kDownloadPitValuelessArgCount),
// kActionInfo
Action("info", nullptr, nullptr, kInfoValueArgCount,
nullptr, nullptr, kInfoValuelessArgCount)
};
bool Interface::GetArguments(int argc, char **argv, map<string, string>& argumentMap, int *actionIndex)
void populateActionMap(void)
{
if (argc < 2)
{
Print(usage, version);
return (false);
}
actionMap["close-pc-screen"] = Interface::ActionInfo(&ClosePcScreenAction::Execute, ClosePcScreenAction::usage);
actionMap["detect"] = Interface::ActionInfo(&DetectAction::Execute, DetectAction::usage);
actionMap["download-pit"] = Interface::ActionInfo(&DownloadPitAction::Execute, DownloadPitAction::usage);
actionMap["dump"] = Interface::ActionInfo(&DumpAction::Execute, DumpAction::usage);
actionMap["flash"] = Interface::ActionInfo(&FlashAction::Execute, FlashAction::usage);
actionMap["help"] = Interface::ActionInfo(&HelpAction::Execute, HelpAction::usage);
actionMap["info"] = Interface::ActionInfo(&InfoAction::Execute, InfoAction::usage);
actionMap["print-pit"] = Interface::ActionInfo(&PrintPitAction::Execute, PrintPitAction::usage);
actionMap["version"] = Interface::ActionInfo(&VersionAction::Execute, VersionAction::usage);
}
const char *actionName = argv[1];
*actionIndex = -1;
const map<string, Interface::ActionInfo>& Interface::GetActionMap(void)
{
if (actionMap.size() == 0)
populateActionMap();
for (int i = 0; i < kActionCount; i++)
{
if (actions[i].name == actionName)
{
*actionIndex = i;
break;
}
}
if (*actionIndex < 0)
{
Print("Unknown action \"%s\"\n\n", actionName);
Print(usage, version);
return (false);
}
const Action& action = actions[*actionIndex];
for (int argIndex = 2; argIndex < argc; argIndex++)
{
if (*(argv[argIndex]) != '-')
{
Print(usage, version);
return (false);
}
string argumentName = (char *)(argv[argIndex] + 1);
// Check if the argument is a valid valueless argument
bool valid = false;
for (unsigned int i = 0; i < action.valuelessArgumentCount; i++)
{
if (argumentName == action.valuelessArguments[i] || argumentName == action.valuelessShortArguments[i])
{
argumentName = action.valuelessArguments[i];
valid = true;
break;
}
}
if (!valid)
{
// Check if it's a common valueless argument
for (unsigned int i = 0; i < kCommonValuelessArgCount; i++)
{
if (argumentName == commonValuelessArguments[i] || argumentName == commonValuelessShortArguments[i])
{
argumentName = commonValuelessArguments[i];
valid = true;
break;
}
}
}
if (valid)
{
// The argument is valueless
argumentMap.insert(pair<string, string>(argumentName, ""));
continue;
}
// Check if the argument is a valid value argument
for (unsigned int i = 0; i < action.valueArgumentCount; i++)
{
// Support for --<integer> and -<integer> parameters.
if (argumentName.length() > 1 && action.valueArguments[i] == "-%d")
{
if (atoi(argumentName.substr(1).c_str()) > 0 || argumentName == "-0")
{
valid = true;
break;
}
}
else if (action.valueArguments[i] == "%d")
{
if (atoi(argumentName.c_str()) > 0 || argumentName == "0")
{
argumentName = "-" + argumentName;
valid = true;
break;
}
}
if (argumentName == action.valueArguments[i] || argumentName == action.valueShortArguments[i])
{
argumentName = action.valueArguments[i];
valid = true;
break;
}
}
if (!valid)
{
// Check if it's a common value argument
for (unsigned int i = 0; i < kCommonValueArgCount; i++)
{
// Support for --<integer> and -<integer> parameters.
if (argumentName.length() > 1 && commonValueArguments[i] == "-%d")
{
if (atoi(argumentName.substr(1).c_str()) > 0 || argumentName == "-0")
{
valid = true;
break;
}
}
else if (commonValueArguments[i] == "%d")
{
if (atoi(argumentName.c_str()) > 0 || argumentName == "0")
{
argumentName = "-" + argumentName;
valid = true;
break;
}
}
if (argumentName == commonValueArguments[i] || argumentName == commonValueShortArguments[i])
{
argumentName = commonValueArguments[i];
valid = true;
break;
}
}
}
if (!valid)
{
PrintError("\"%s\" is not a valid argument\n", argumentName.c_str());
return (false);
}
argIndex++;
if (argIndex >= argc)
{
PrintError("\"%s\" is missing a value\n", argumentName.c_str());
return (false);
}
argumentMap.insert(pair<string, string>(argumentName, argv[argIndex]));
}
return (true);
return actionMap;
}
void Interface::Print(const char *format, ...)
@ -362,6 +92,42 @@ void Interface::Print(const char *format, ...)
}
void Interface::PrintWarning(const char *format, ...)
{
va_list args;
va_start(args, format);
fprintf(stderr, "WARNING: ");
vfprintf(stderr, format, args);
fflush(stderr);
if (stdoutErrors)
{
fprintf(stdout, "WARNING: ");
vfprintf(stdout, format, args);
fflush(stdout);
}
va_end(args);
}
void Interface::PrintWarningSameLine(const char *format, ...)
{
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
fflush(stderr);
if (stdoutErrors)
{
vfprintf(stdout, format, args);
fflush(stdout);
}
va_end(args);
}
void Interface::PrintError(const char *format, ...)
{
va_list args;
@ -400,28 +166,33 @@ void Interface::PrintErrorSameLine(const char *format, ...)
void Interface::PrintVersion(void)
{
Print("%s\n", version);
Interface::Print("%s\n", version);
}
void Interface::PrintUsage(void)
{
Print(usage);
const map<string, ActionInfo>& actionMap = Interface::GetActionMap();
Interface::Print(actionUsage);
for (map<string, ActionInfo>::const_iterator it = actionMap.begin(); it != actionMap.end(); it++)
Interface::Print("\n%s", it->second.usage);
}
void Interface::PrintReleaseInfo(void)
{
Print(releaseInfo, version);
Interface::Print(releaseInfo, version);
}
void Interface::PrintFullInfo(void)
{
Print(releaseInfo, version);
Print(extraInfo);
Interface::Print(releaseInfo, version);
Interface::Print(extraInfo);
}
void Interface::PrintDeviceDetectionFailed(void)
{
Print("Failed to detect compatible download-mode device.\n");
Interface::PrintError("Failed to detect compatible download-mode device.\n");
}
void Interface::PrintPit(const PitData *pitData)
@ -442,34 +213,107 @@ void Interface::PrintPit(const PitData *pitData)
const PitEntry *entry = pitData->GetEntry(i);
Interface::Print("\n\n--- Entry #%d ---\n", i);
Interface::Print("Unused: %s\n", (entry->GetUnused()) ? "Yes" : "No");
Interface::Print("Binary Type: %d (", entry->GetBinaryType());
const char *chipIdentifierText = "Unknown";
switch (entry->GetBinaryType())
{
case PitEntry::kBinaryTypeApplicationProcessor:
Interface::Print("AP");
break;
Interface::Print("Chip Identifier: %d (%s)\n", entry->GetChipIdentifier());
case PitEntry::kBinaryTypeCommunicationProcessor:
Interface::Print("CP");
break;
Interface::Print("Partition Identifier: %d\n", entry->GetPartitionIdentifier());
Interface::Print("Partition Flags: %d (", entry->GetPartitionFlags());
if (entry->GetPartitionFlags() & PitEntry::kPartitionFlagWrite)
Interface::Print("R/W");
else
Interface::Print("R");
default:
Interface::Print("Unknown");
break;
}
Interface::Print(")\n");
Interface::Print("Unknown 1: %d\n", entry->GetUnknown1());
Interface::Print("Device Type: %d (", entry->GetDeviceType());
Interface::Print("Partition Block Size: %d\n", entry->GetPartitionBlockSize());
Interface::Print("Partition Block Count: %d\n", entry->GetPartitionBlockCount());
switch (entry->GetDeviceType())
{
case PitEntry::kDeviceTypeOneNand:
Interface::Print("OneNAND");
break;
Interface::Print("Unknown 2: %d\n", entry->GetUnknown2());
Interface::Print("Unknown 3: %d\n", entry->GetUnknown3());
case PitEntry::kDeviceTypeFile:
Interface::Print("File/FAT");
break;
case PitEntry::kDeviceTypeMMC:
Interface::Print("MMC");
break;
case PitEntry::kDeviceTypeAll:
Interface::Print("All (?)");
break;
default:
Interface::Print("Unknown");
break;
}
Interface::Print(")\n");
Interface::Print("Identifier: %d\n", entry->GetIdentifier());
Interface::Print("Attributes: %d (", entry->GetAttributes());
if (entry->GetAttributes() & PitEntry::kAttributeSTL)
Interface::Print("STL ");
if (entry->GetAttributes() & PitEntry::kAttributeWrite)
Interface::Print("Read/Write");
else
Interface::Print("Read-Only");
Interface::Print(")\n");
Interface::Print("Update Attributes: %d", entry->GetUpdateAttributes());
if (entry->GetUpdateAttributes())
{
Interface::Print(" (");
if (entry->GetUpdateAttributes() & PitEntry::kUpdateAttributeFota)
{
if (entry->GetUpdateAttributes() & PitEntry::kUpdateAttributeSecure)
Interface::Print("FOTA, Secure");
else
Interface::Print("FOTA");
}
else
{
if (entry->GetUpdateAttributes() & PitEntry::kUpdateAttributeSecure)
Interface::Print("Secure");
}
Interface::Print(")\n");
}
else
{
Interface::Print("\n");
}
Interface::Print("Partition Block Size: %d\n", entry->GetBlockSize());
Interface::Print("Partition Block Count: %d\n", entry->GetBlockCount());
Interface::Print("File Offset (Obsolete): %d\n", entry->GetFileOffset());
Interface::Print("File Size (Obsolete): %d\n", entry->GetFileSize());
Interface::Print("Partition Name: %s\n", entry->GetPartitionName());
Interface::Print("Filename: %s\n", entry->GetFilename());
Interface::Print("Flash Filename: %s\n", entry->GetFlashFilename());
Interface::Print("FOTA Filename: %s\n", entry->GetFotaFilename());
}
Interface::Print("\n");
}
void Interface::SetStdoutErrors(bool enabled)
{
stdoutErrors = enabled;
}

View File

@ -28,276 +28,55 @@
// libpit
#include "libpit.h"
// Heimdall
#include "Heimdall.h"
using namespace std;
using namespace libpit;
namespace Heimdall
{
struct Action
namespace Interface
{
public:
typedef int (*ActionExecuteFunction)(int, char **);
string name;
string *valueArguments;
string *valueShortArguments;
unsigned int valueArgumentCount;
typedef struct ActionInfo
{
ActionExecuteFunction executeFunction;
const char *usage;
string *valuelessArguments;
string *valuelessShortArguments;
unsigned int valuelessArgumentCount;
Action(const char *name, string *valueArguments, string *valueShortArguments, unsigned int valueArgumentCount,
string *valuelessArguments, string *valuelessShortArguments, unsigned int valuelessArgumentCount)
ActionInfo()
{
this->name = name;
this->valueArguments = valueArguments;
this->valueShortArguments = valueShortArguments;
this->valueArgumentCount = valueArgumentCount;
this->valuelessArguments = valuelessArguments;
this->valuelessShortArguments = valuelessShortArguments;
this->valuelessArgumentCount = valuelessArgumentCount;
}
};
class Interface
{
public:
// Actions
enum
{
kActionFlash = 0,
kActionClosePcScreen,
kActionDump,
kActionPrintPit,
kActionVersion,
kActionHelp,
kActionDetect,
kActionDownloadPit,
kActionInfo,
kActionCount
};
// Flash value arguments
enum
{
kFlashValueArgPit,
kFlashValueArgFactoryFs,
kFlashValueArgCache,
kFlashValueArgDatabaseData,
kFlashValueArgPrimaryBootloader,
kFlashValueArgSecondaryBootloader,
kFlashValueArgSecondaryBootloaderBackup,
kFlashValueArgParam,
kFlashValueArgKernel,
kFlashValueArgRecovery,
kFlashValueArgEfs,
kFlashValueArgModem,
kFlashValueArgNormalBoot,
kFlashValueArgSystem,
kFlashValueArgUserData,
kFlashValueArgFota,
kFlashValueArgHidden,
kFlashValueArgMovinand,
kFlashValueArgData,
kFlashValueArgUms,
kFlashValueArgEmmc,
kFlashValueArgPartitionIndex,
kFlashValueArgCount
};
// Flash valueless arguments
enum
{
kFlashValuelessArgRepartition = 0,
kFlashValuelessArgCount
};
// Close PC Screen value arguments
enum
{
kClosePcScreenValueArgCount = 0
};
// Close PC Screen valueless arguments
enum
{
kClosePcScreenValuelessArgCount = 0
};
// Dump value arguments
enum
{
kDumpValueArgChipType = 0,
kDumpValueArgChipId,
kDumpValueArgOutput,
kDumpValueArgCount
};
// Dump valueless arguments
enum
{
kDumpValuelessArgCount = 0
};
// Print PIT value arguments
enum
{
kPrintPitValueArgCount = 0
};
// Print PIT valueless arguments
enum
{
kPrintPitValuelessArgCount = 0
};
// Version value arguments
enum
{
kVersionValueArgCount = 0
};
// Version valueless arguments
enum
{
kVersionValuelessArgCount = 0
};
// Help value arguments
enum
{
kHelpValueArgCount = 0
};
// Help valueless arguments
enum
{
kHelpValuelessArgCount = 0
};
// Info value arguments
enum
{
kInfoValueArgCount = 0
};
// Info valueless arguments
enum
{
kInfoValuelessArgCount = 0
};
// Detect value arguments
enum
{
kDetectValueArgCount = 0
};
// Detect valueless arguments
enum
{
kDetectValuelessArgCount = 0
};
// Download PIT value arguments
enum
{
kDownloadPitValueArgOutput = 0,
kDownloadPitValueArgCount
};
// Download PIT valueless arguments
enum
{
kDownloadPitValuelessArgCount = 0
};
// Common value arguments
enum
{
kCommonValueArgDelay = 0,
kCommonValueArgCount
};
// Comon valueless arguments
enum
{
kCommonValuelessArgVerbose = 0,
kCommonValuelessArgNoReboot,
kCommonValuelessArgStdoutErrors,
kCommonValuelessArgCount
};
private:
static bool stdoutErrors;
static const char *version;
static const char *usage;
static const char *releaseInfo;
static const char *extraInfo;
// Flash arguments
static string flashValueArguments[kFlashValueArgCount];
static string flashValueShortArguments[kFlashValueArgCount];
static string flashValuelessArguments[kFlashValuelessArgCount];
static string flashValuelessShortArguments[kFlashValuelessArgCount];
// Download PIT arguments
static string downloadPitValueArguments[kDownloadPitValueArgCount];
static string downloadPitValueShortArguments[kDownloadPitValueArgCount];
// Dump arguments
static string dumpValueArguments[kDumpValueArgCount];
static string dumpValueShortArguments[kDumpValueArgCount];
public:
// Common arguments
static string commonValueArguments[kCommonValueArgCount];
static string commonValueShortArguments[kCommonValueArgCount];
static string commonValuelessArguments[kCommonValuelessArgCount];
static string commonValuelessShortArguments[kCommonValuelessArgCount];
static Action actions[kActionCount];
static bool GetArguments(int argc, char **argv, map<string, string>& argumentMap, int *actionIndex);
static void Print(const char *format, ...);
static void PrintError(const char *format, ...);
static void PrintErrorSameLine(const char *format, ...);
static void PrintVersion(void);
static void PrintUsage(void);
static void PrintReleaseInfo(void);
static void PrintFullInfo(void);
static void PrintDeviceDetectionFailed(void);
static void PrintPit(const PitData *pitData);
static string& GetPitArgument(void)
{
return (flashValueArguments[kFlashValueArgPit]);
executeFunction = nullptr;
usage = nullptr;
}
static void SetStdoutErrors(bool enabled)
ActionInfo(ActionExecuteFunction executeFunction, const char *usage)
{
stdoutErrors = enabled;
this->executeFunction = executeFunction;
this->usage = usage;
}
} ActionInfo;
const map<string, ActionInfo>& GetActionMap(void);
void Print(const char *format, ...);
void PrintWarning(const char *format, ...);
void PrintWarningSameLine(const char *format, ...);
void PrintError(const char *format, ...);
void PrintErrorSameLine(const char *format, ...);
void PrintVersion(void);
void PrintUsage(void);
void PrintReleaseInfo(void);
void PrintFullInfo(void);
void PrintDeviceDetectionFailed(void);
void PrintPit(const PitData *pitData);
void SetStdoutErrors(bool enabled);
};
}

View File

@ -50,7 +50,7 @@ namespace Heimdall
delete [] data;
}
int GetSize(void) const
unsigned int GetSize(void) const
{
return (size);
}

View File

@ -0,0 +1,159 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// C Standard Library
#include <stdio.h>
// Heimdall
#include "Arguments.h"
#include "BridgeManager.h"
#include "Heimdall.h"
#include "Interface.h"
#include "PrintPitAction.h"
using namespace Heimdall;
const char *PrintPitAction::usage = "Action: print-pit\n\
Arguments: [--file <filename>] [--verbose] [--no-reboot] [--stdout-errors]\n\
[--delay <ms>]\n\
Description: Prints the contents of a PIT file in a human readable format. If\n\
a filename is not provided then Heimdall retrieves the PIT file from the \n\
connected device.\n";
int PrintPitAction::Execute(int argc, char **argv)
{
// Handle arguments
map<string, ArgumentType> argumentTypes;
argumentTypes["file"] = kArgumentTypeString;
argumentTypes["no-reboot"] = kArgumentTypeFlag;
argumentTypes["delay"] = kArgumentTypeUnsignedInteger;
argumentTypes["verbose"] = kArgumentTypeFlag;
argumentTypes["stdout-errors"] = kArgumentTypeFlag;
Arguments arguments(argumentTypes);
if (!arguments.ParseArguments(argc, argv, 2))
{
Interface::Print(PrintPitAction::usage);
return (0);
}
const StringArgument *fileArgument = static_cast<const StringArgument *>(arguments.GetArgument("file"));
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;
if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);
// Open file (if specified).
FILE *localPitFile = nullptr;
if (fileArgument)
{
const char *filename = fileArgument->GetValue().c_str();
localPitFile = fopen(filename, "rb");
if (!localPitFile)
{
Interface::PrintError("Failed to open file \"%s\"\n", filename);
return (1);
}
}
// Info
Interface::PrintReleaseInfo();
Sleep(1000);
if (localPitFile)
{
// Print PIT from file; there's no need for a BridgeManager.
fseek(localPitFile, 0, SEEK_END);
long localPitFileSize = ftell(localPitFile);
rewind(localPitFile);
// Load the local pit file into memory.
unsigned char *pitFileBuffer = new unsigned char[localPitFileSize];
size_t dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile); // dataRead is discarded, it's here to remove warnings.
fclose(localPitFile);
PitData *pitData = new PitData();
pitData->Unpack(pitFileBuffer);
delete [] pitFileBuffer;
Interface::PrintPit(pitData);
delete pitData;
return (0);
}
else
{
// Print PIT from a device.
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (communicationDelayArgument)
communicationDelay = communicationDelayArgument->GetValue();
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession())
{
delete bridgeManager;
return (1);
}
unsigned char *devicePit;
bool success = bridgeManager->DownloadPitFile(&devicePit) != 0;
if (success)
{
PitData *pitData = new PitData();
if (pitData->Unpack(devicePit))
{
Interface::PrintPit(pitData);
}
else
{
Interface::PrintError("Failed to unpack device's PIT file!\n");
success = false;
}
delete pitData;
}
delete [] devicePit;
if (!bridgeManager->EndSession(reboot))
success = false;
delete bridgeManager;
return (success ? 0 : 1);
}
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef PRINTPITACTION_H
#define PRINTPITACTION_H
namespace Heimdall
{
namespace PrintPitAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -32,11 +32,11 @@ namespace Heimdall
enum
{
kResponseTypeSendFilePart = 0x00,
kResponseTypeBeginSession = 0x64,
kResponseTypePitFile = 0x65,
kResponseTypeFileTransfer = 0x66,
kResponseTypeEndSession = 0x67
kResponseTypeSendFilePart = 0x00,
kResponseTypeSessionSetup = 0x64,
kResponseTypePitFile = 0x65,
kResponseTypeFileTransfer = 0x66,
kResponseTypeEndSession = 0x67
};
private:

View File

@ -34,12 +34,7 @@ namespace Heimdall
{
public:
enum
{
kDefaultPacketSize = 131072
};
SendFilePartPacket(FILE *file, int size = SendFilePartPacket::kDefaultPacketSize) : OutboundPacket(size)
SendFilePartPacket(FILE *file, int size) : OutboundPacket(size)
{
memset(data, 0, size);

View File

@ -0,0 +1,74 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef SESSIONSETUPPACKET_H
#define SESSIONSETUPPACKET_H
// Heimdall
#include "ControlPacket.h"
namespace Heimdall
{
class SessionSetupPacket : public ControlPacket
{
public:
enum
{
kBeginSession = 0,
kDeviceType = 1, // ?
kTotalBytes = 2,
//kEnableSomeSortOfFlag = 3,
kFilePartSize = 5
};
private:
unsigned int request;
protected:
enum
{
kDataSize = ControlPacket::kDataSize + 4
};
public:
SessionSetupPacket(unsigned int request) : ControlPacket(ControlPacket::kControlTypeSession)
{
this->request = request;
}
unsigned int GetRequest(void) const
{
return (request);
}
void Pack(void)
{
ControlPacket::Pack();
PackInteger(ControlPacket::kDataSize, request);
}
};
}
#endif

View File

@ -0,0 +1,58 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef SESSIONSETUPRESPONSE_H
#define SESSIONSETUPRESPONSE_H
// Heimdall
#include "ResponsePacket.h"
namespace Heimdall
{
class SessionSetupResponse : public ResponsePacket
{
private:
unsigned int result;
public:
SessionSetupResponse() : ResponsePacket(ResponsePacket::kResponseTypeSessionSetup)
{
}
unsigned int GetResult(void) const
{
return (result);
}
bool Unpack(void)
{
if (!ResponsePacket::Unpack())
return (false);
result = UnpackInteger(ResponsePacket::kDataSize);
return (true);
}
};
}
#endif

View File

@ -0,0 +1,56 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef TOTALBYTESSPACKET_H
#define TOTALBYTESPACKET_H
// Heimdall
#include "SessionSetupPacket.h"
namespace Heimdall
{
class TotalBytesPacket : public SessionSetupPacket
{
private:
unsigned int totalBytes;
public:
TotalBytesPacket(unsigned int totalBytes) : SessionSetupPacket(SessionSetupPacket::kTotalBytes)
{
this->totalBytes = totalBytes;
}
unsigned int GetTotalBytes(void) const
{
return (totalBytes);
}
void Pack(void)
{
SessionSetupPacket::Pack();
PackInteger(SessionSetupPacket::kDataSize, totalBytes);
}
};
}
#endif

View File

@ -0,0 +1,82 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// C/C++ Standard Library
#include <cerrno>
#include <limits.h>
#include <stdlib.h>
// Heimdall
#include "Heimdall.h"
#include "Utility.h"
using namespace Heimdall;
NumberParsingStatus Utility::ParseInt(int &intValue, const char *string, int base)
{
errno = 0;
char *end;
long longValue = strtol(string, &end, base);
if (*string == '\0' || *end != '\0')
{
return (kNumberParsingStatusInconvertible);
}
else if (errno == ERANGE)
{
intValue = (longValue == LONG_MAX) ? INT_MAX : INT_MIN;
return (kNumberParsingStatusRangeError);
}
else if (longValue > INT_MAX)
{
intValue = INT_MAX;
return (kNumberParsingStatusRangeError);
}
else if (longValue < INT_MIN)
{
intValue = INT_MIN;
return (kNumberParsingStatusRangeError);
}
intValue = longValue;
return (kNumberParsingStatusSuccess);
}
NumberParsingStatus Utility::ParseUnsignedInt(unsigned int &uintValue, const char *string, int base)
{
errno = 0;
char *end;
unsigned long ulongValue = strtoul(string, &end, base);
if (*string == '\0' || *end != '\0')
{
return kNumberParsingStatusInconvertible;
}
else if (errno == ERANGE || ulongValue > INT_MAX)
{
uintValue = UINT_MAX;
return (kNumberParsingStatusRangeError);
}
uintValue = ulongValue;
return (kNumberParsingStatusSuccess);
}

40
heimdall/source/Utility.h Normal file
View File

@ -0,0 +1,40 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef UTILITY_H
#define UTILITY_H
namespace Heimdall
{
typedef enum
{
kNumberParsingStatusSuccess = 0,
kNumberParsingStatusRangeError,
kNumberParsingStatusInconvertible
} NumberParsingStatus;
namespace Utility
{
NumberParsingStatus ParseInt(int &intValue, const char *string, int base = 0);
NumberParsingStatus ParseUnsignedInt(unsigned int &uintValue, const char *string, int base = 0);
}
}
#endif

View File

@ -0,0 +1,35 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
// Heimdall
#include "Heimdall.h"
#include "Interface.h"
#include "VersionAction.h"
using namespace Heimdall;
const char *VersionAction::usage = "Action: version\n\
Description: Displays the version number of this binary.\n";
int VersionAction::Execute(int argc, char **argv)
{
Interface::PrintVersion();
return (0);
}

View File

@ -0,0 +1,34 @@
/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#ifndef VERSIONACTION_H
#define VERSIONACTION_H
namespace Heimdall
{
namespace VersionAction
{
extern const char *usage;
int Execute(int argc, char **argv);
};
}
#endif

View File

@ -28,782 +28,28 @@
#include "libpit.h"
// Heimdall
#include "BridgeManager.h"
#include "SetupSessionPacket.h"
#include "SetupSessionResponse.h"
#include "EndModemFileTransferPacket.h"
#include "EndPhoneFileTransferPacket.h"
#include "Heimdall.h"
#include "HelpAction.h"
#include "Interface.h"
using namespace std;
using namespace Heimdall;
// Known partitions
enum
{
kKnownPartitionPit = 0,
kKnownPartitionFactoryFs,
kKnownPartitionCache,
kKnownPartitionDatabaseData,
kKnownPartitionPrimaryBootloader,
kKnownPartitionSecondaryBootloader,
kKnownPartitionSecondaryBootloaderBackup,
kKnownPartitionParam,
kKnownPartitionKernel,
kKnownPartitionRecovery,
kKnownPartitionEfs,
kKnownPartitionModem,
kKnownPartitionNormalBoot,
kKnownPartitionSystem,
kKnownPartitionUserData,
kKnownPartitionFota,
kKnownPartitionHidden,
kKnownPartitionMovinand,
kKnownPartitionData,
kKnownPartitionUms,
kKnownPartitionEmmc,
kKnownPartitionCount
};
vector<const char *> knownPartitionNames[kKnownPartitionCount];
struct PartitionInfo
{
unsigned int chipIdentifier;
string partitionName;
FILE *file;
PartitionInfo(unsigned int chipIdentifier, const char *partitionName, FILE *file)
{
this->chipIdentifier = chipIdentifier;
this->partitionName = partitionName;
this->file = file;
}
};
void initialiseKnownPartitionNames(void)
{
knownPartitionNames[kKnownPartitionPit].push_back("PIT");
knownPartitionNames[kKnownPartitionFactoryFs].push_back("FACTORYFS");
knownPartitionNames[kKnownPartitionCache].push_back("CACHE");
knownPartitionNames[kKnownPartitionDatabaseData].push_back("DBDATAFS");
knownPartitionNames[kKnownPartitionPrimaryBootloader].push_back("IBL+PBL");
knownPartitionNames[kKnownPartitionPrimaryBootloader].push_back("BOOT");
knownPartitionNames[kKnownPartitionSecondaryBootloader].push_back("SBL");
knownPartitionNames[kKnownPartitionSecondaryBootloader].push_back("SBL1");
knownPartitionNames[kKnownPartitionSecondaryBootloaderBackup].push_back("SBL2");
knownPartitionNames[kKnownPartitionParam].push_back("PARAM");
knownPartitionNames[kKnownPartitionKernel].push_back("KERNEL");
knownPartitionNames[kKnownPartitionRecovery].push_back("RECOVERY");
knownPartitionNames[kKnownPartitionEfs].push_back("EFS");
knownPartitionNames[kKnownPartitionModem].push_back("MODEM");
knownPartitionNames[kKnownPartitionNormalBoot].push_back("NORMALBOOT");
knownPartitionNames[kKnownPartitionSystem].push_back("SYSTEM");
knownPartitionNames[kKnownPartitionUserData].push_back("USERDATA");
knownPartitionNames[kKnownPartitionFota].push_back("FOTA");
knownPartitionNames[kKnownPartitionHidden].push_back("HIDDEN");
knownPartitionNames[kKnownPartitionMovinand].push_back("MOVINAND");
knownPartitionNames[kKnownPartitionData].push_back("DATAFS");
knownPartitionNames[kKnownPartitionUms].push_back("UMS.EN");
knownPartitionNames[kKnownPartitionEmmc].push_back("GANG");
}
bool isKnownPartition(const char *partitionName, unsigned int knownPartitionIndex)
{
for (unsigned int i = 0; i < knownPartitionNames[knownPartitionIndex].size(); i++)
{
if (strcmp(partitionName, knownPartitionNames[knownPartitionIndex][i]) == 0)
return (true);
}
return (false);
}
bool isKnownBootPartition(const char *partitionName)
{
return (isKnownPartition(partitionName, kKnownPartitionPrimaryBootloader) ||
isKnownPartition(partitionName, kKnownPartitionSecondaryBootloader) ||
isKnownPartition(partitionName, kKnownPartitionSecondaryBootloaderBackup) ||
isKnownPartition(partitionName, kKnownPartitionParam) ||
isKnownPartition(partitionName, kKnownPartitionNormalBoot));
}
bool openFiles(const map<string, string>& argumentMap, map<string, FILE *>& argumentFileMap)
{
map<string, string>::const_iterator it = argumentMap.begin();
for (it = argumentMap.begin(); it != argumentMap.end(); it++)
{
bool isFileArgument = false;
int partitionIndex = atoi(it->first.substr(it->first.find_first_not_of('-')).c_str());
// Was the argument a partition index?
if (partitionIndex > 0 || it->first.compare("-0") == 0)
{
isFileArgument = true;
}
else
{
// The argument wasn't a partition index, check if it's a known partition name.
for (int knownPartition = 0; knownPartition < kKnownPartitionCount; knownPartition++)
{
if (it->first == Interface::actions[Interface::kActionFlash].valueArguments[knownPartition])
{
isFileArgument = true;
break;
}
}
}
if (!isFileArgument)
continue;
pair<string, FILE *> argumentFilePair;
argumentFilePair.first = it->first;
argumentFilePair.second = fopen(it->second.c_str(), "rb");
if (!argumentFilePair.second)
{
Interface::PrintError("Failed to open file \"%s\"\n", it->second.c_str());
return (false);
}
argumentFileMap.insert(argumentFilePair);
}
return (true);
}
bool mapFilesToPartitions(const map<string, FILE *>& argumentFileMap, const PitData *pitData, map<unsigned int, PartitionInfo>& partitionInfoMap)
{
map<string, FILE *>::const_iterator it = argumentFileMap.begin();
for (it = argumentFileMap.begin(); it != argumentFileMap.end(); it++)
{
int partitionIndex = atoi(it->first.substr(it->first.find_first_not_of('-')).c_str());
const PitEntry *pitEntry = nullptr;
// Was the argument a partition index?
if (partitionIndex > 0 || it->first.compare("-0") == 0)
{
pitEntry = pitData->FindEntry(partitionIndex);
}
else
{
// The argument wasn't a partition index, so it must be a known partition name.
int knownPartition;
for (knownPartition = 0; knownPartition < kKnownPartitionCount; knownPartition++)
{
if (it->first == Interface::actions[Interface::kActionFlash].valueArguments[knownPartition])
break;
}
// Check for the partition in the PIT file using all known names.
for (unsigned int i = 0; i < knownPartitionNames[knownPartition].size(); i++)
{
pitEntry = pitData->FindEntry(knownPartitionNames[knownPartition][i]);
if (pitEntry)
break;
}
if (!pitEntry && knownPartition == kKnownPartitionPit)
{
// NOTE: We're assuming a PIT file always has chipIdentifier zero.
PartitionInfo partitionInfo(0, knownPartitionNames[kKnownPartitionPit][0], it->second);
partitionInfoMap.insert(pair<unsigned int, PartitionInfo>(0xFFFFFFFF, partitionInfo));
return (true);
}
}
if (!pitEntry)
{
Interface::PrintError("Partition corresponding to %s argument could not be located\n", it->first.c_str());
return (false);
}
PartitionInfo partitionInfo(pitEntry->GetChipIdentifier(), pitEntry->GetPartitionName(), it->second);
partitionInfoMap.insert(pair<unsigned int, PartitionInfo>(pitEntry->GetPartitionIdentifier(), partitionInfo));
}
return (true);
}
void closeFiles(map<string, FILE *> argumentfileMap)
{
for (map<string, FILE *>::iterator it = argumentfileMap.begin(); it != argumentfileMap.end(); it++)
fclose(it->second);
argumentfileMap.clear();
}
int downloadPitFile(BridgeManager *bridgeManager, unsigned char **pitBuffer)
{
Interface::Print("Downloading device's PIT file...\n");
int devicePitFileSize = bridgeManager->ReceivePitFile(pitBuffer);
if (!*pitBuffer)
{
Interface::PrintError("Failed to download PIT file!\n");
return (-1);
}
Interface::Print("PIT file download sucessful\n\n");
return (devicePitFileSize);
}
bool flashFile(BridgeManager *bridgeManager, unsigned int chipIdentifier, unsigned int partitionIndex, const char *partitionName, FILE *file)
{
// PIT files need to be handled differently, try determine if the partition we're flashing to is a PIT partition.
bool isPit = false;
for (unsigned int i = 0; i < knownPartitionNames[kKnownPartitionPit].size(); i++)
{
if (strcmp(partitionName, knownPartitionNames[kKnownPartitionPit][i]) == 0)
{
isPit = true;
break;
}
}
if (isPit)
{
Interface::Print("Uploading %s\n", partitionName);
if (bridgeManager->SendPitFile(file))
{
Interface::Print("%s upload successful\n", partitionName);
return (true);
}
else
{
Interface::Print("%s upload failed!\n", partitionName);
return (false);
}
}
else
{
// Modems need to be handled differently, try determine if the partition we're flashing to is a modem partition.
bool isModem = false;
for (unsigned int i = 0; i < knownPartitionNames[kKnownPartitionModem].size(); i++)
{
if (strcmp(partitionName, knownPartitionNames[kKnownPartitionModem][i]) == 0)
{
isModem = true;
break;
}
}
if (isModem)
{
Interface::Print("Uploading %s\n", partitionName);
//if (bridgeManager->SendFile(file, EndPhoneFileTransferPacket::kDestinationPhone, // <-- Kies method. WARNING: Doesn't work on Galaxy Tab!
// EndPhoneFileTransferPacket::kFileModem))
if (bridgeManager->SendFile(file, EndModemFileTransferPacket::kDestinationModem, chipIdentifier)) // <-- Odin method
{
Interface::Print("%s upload successful\n", partitionName);
return (true);
}
else
{
Interface::Print("%s upload failed!\n", partitionName);
return (false);
}
}
else
{
// We're uploading to a phone partition
Interface::Print("Uploading %s\n", partitionName);
if (bridgeManager->SendFile(file, EndPhoneFileTransferPacket::kDestinationPhone, chipIdentifier, partitionIndex))
{
Interface::Print("%s upload successful\n", partitionName);
return (true);
}
else
{
Interface::Print("%s upload failed!\n", partitionName);
return (false);
}
}
}
return (true);
}
bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFileMap, bool repartition)
{
bool success;
// ------------- SEND TOTAL BYTES TO BE TRANSFERRED -------------
int totalBytes = 0;
for (map<string, FILE *>::const_iterator it = argumentFileMap.begin(); it != argumentFileMap.end(); it++)
{
if (repartition || it->first != Interface::GetPitArgument())
{
fseek(it->second, 0, SEEK_END);
totalBytes += ftell(it->second);
rewind(it->second);
}
}
SetupSessionPacket *deviceInfoPacket = new SetupSessionPacket(SetupSessionPacket::kTotalBytes, totalBytes);
success = bridgeManager->SendPacket(deviceInfoPacket);
delete deviceInfoPacket;
if (!success)
{
Interface::PrintError("Failed to send total bytes device info packet!\n");
return (false);
}
SetupSessionResponse *deviceInfoResponse = new SetupSessionResponse();
success = bridgeManager->ReceivePacket(deviceInfoResponse);
int deviceInfoResult = deviceInfoResponse->GetUnknown();
delete deviceInfoResponse;
if (!success)
{
Interface::PrintError("Failed to receive device info response!\n");
return (false);
}
if (deviceInfoResult != 0)
{
Interface::PrintError("Unexpected device info response!\nExpected: 0\nReceived:%d\n", deviceInfoResult);
return (false);
}
// -----------------------------------------------------
PitData *pitData;
PitData *localPitData = nullptr;
FILE *localPitFile = nullptr;
// If a PIT file was passed as an argument then we must unpack it.
map<string, FILE *>::iterator it = argumentFileMap.find(Interface::actions[Interface::kActionFlash].valueArguments[Interface::kFlashValueArgPit]);
if (it != argumentFileMap.end())
{
localPitFile = it->second;
// Load the local pit file into memory.
unsigned char *pitFileBuffer = new unsigned char[4096];
memset(pitFileBuffer, 0, 4096);
fseek(localPitFile, 0, SEEK_END);
long localPitFileSize = ftell(localPitFile);
rewind(localPitFile);
// dataRead is discarded, it's here to remove warnings.
int dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile);
rewind(localPitFile);
localPitData = new PitData();
localPitData->Unpack(pitFileBuffer);
delete [] pitFileBuffer;
}
if (repartition)
{
// Use the local PIT file data.
pitData = localPitData;
}
else
{
// If we're not repartitioning then we need to retrieve the device's PIT file and unpack it.
unsigned char *pitFileBuffer;
downloadPitFile(bridgeManager, &pitFileBuffer);
pitData = new PitData();
pitData->Unpack(pitFileBuffer);
delete [] pitFileBuffer;
if (localPitData != nullptr)
{
// The user has specified a PIT without repartitioning, we should verify the local and device PIT data match!
bool pitsMatch = pitData->Matches(localPitData);
delete localPitData;
if (!pitsMatch)
{
Interface::Print("Local and device PIT files don't match and repartition wasn't specified!\n");
Interface::PrintError("Flash aborted!\n");
delete pitData;
return (false);
}
}
}
map<unsigned int, PartitionInfo> partitionInfoMap;
// Map the files being flashed to partitions stored in the PIT file.
if (!mapFilesToPartitions(argumentFileMap, pitData, partitionInfoMap))
{
delete pitData;
return (false);
}
delete pitData;
// If we're repartitioning then we need to flash the PIT file first.
if (repartition)
{
for (map<unsigned int, PartitionInfo>::iterator it = partitionInfoMap.begin(); it != partitionInfoMap.end(); it++)
{
if (it->second.file == localPitFile)
{
PartitionInfo *partitionInfo = &(it->second);
if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
break;
}
}
}
// Flash partitions not involved in the boot process second.
for (map<unsigned int, PartitionInfo>::iterator it = partitionInfoMap.begin(); it != partitionInfoMap.end(); it++)
{
if (!isKnownPartition(it->second.partitionName.c_str(), kKnownPartitionPit) && !isKnownBootPartition(it->second.partitionName.c_str()))
{
PartitionInfo *partitionInfo = &(it->second);
if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
}
}
// Flash boot partitions last.
for (map<unsigned int, PartitionInfo>::iterator it = partitionInfoMap.begin(); it != partitionInfoMap.end(); it++)
{
if (isKnownBootPartition(it->second.partitionName.c_str()))
{
PartitionInfo *partitionInfo = &(it->second);
if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
}
}
return (true);
}
int main(int argc, char **argv)
{
map<string, string> argumentMap;
int actionIndex;
if (!Interface::GetArguments(argc, argv, argumentMap, &actionIndex))
if (argc < 2)
{
Sleep(250);
Interface::PrintUsage();
return (0);
}
initialiseKnownPartitionNames();
switch (actionIndex)
{
case Interface::kActionFlash:
if (argumentMap.find(Interface::actions[Interface::kActionFlash].valuelessArguments[Interface::kFlashValuelessArgRepartition]) != argumentMap.end()
&& argumentMap.find(Interface::actions[Interface::kActionFlash].valueArguments[Interface::kFlashValueArgPit]) == argumentMap.end())
{
Interface::Print("If you wish to repartition then a PIT file must be specified.\n\n");
Interface::PrintUsage();
return (0);
}
break;
case Interface::kActionDownloadPit:
if (argumentMap.find(Interface::actions[Interface::kActionDownloadPit].valueArguments[Interface::kDownloadPitValueArgOutput]) == argumentMap.end())
{
Interface::Print("Output file was not specified.\n\n");
Interface::PrintUsage();
return (0);
}
break;
case Interface::kActionDump:
{
if (argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgOutput]) == argumentMap.end())
{
Interface::Print("Output file was not specified.\n\n");
Interface::PrintUsage();
return (0);
}
if (argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipType]) == argumentMap.end())
{
Interface::Print("You must specify a chip type.\n\n");
Interface::PrintUsage();
return (0);
}
string chipType = argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipType])->second;
if (!(chipType == "RAM" || chipType == "ram" || chipType == "NAND" || chipType == "nand"))
{
Interface::Print("Unknown chip type: %s.\n\n", chipType.c_str());
Interface::PrintUsage();
return (0);
}
if (argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipId]) == argumentMap.end())
{
Interface::Print("You must specify a Chip ID.\n\n");
Interface::PrintUsage();
return (0);
}
int chipId = atoi(argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipId])->second.c_str());
if (chipId < 0)
{
Interface::Print("Chip ID must be a non-negative integer.\n");
Interface::PrintUsage();
return (0);
}
break;
}
case Interface::kActionVersion:
Interface::PrintVersion();
return (0);
case Interface::kActionHelp:
Interface::PrintUsage();
return (0);
case Interface::kActionInfo:
Interface::PrintFullInfo();
return (0);
}
bool verbose = argumentMap.find(Interface::commonValuelessArguments[Interface::kCommonValuelessArgVerbose]) != argumentMap.end();
bool reboot = argumentMap.find(Interface::commonValuelessArguments[Interface::kCommonValuelessArgNoReboot]) == argumentMap.end();
Interface::SetStdoutErrors(argumentMap.find(Interface::commonValuelessArguments[Interface::kCommonValuelessArgStdoutErrors]) != argumentMap.end());
int communicationDelay = BridgeManager::kCommunicationDelayDefault;
if (argumentMap.find(Interface::commonValueArguments[Interface::kCommonValueArgDelay]) != argumentMap.end())
communicationDelay = atoi(argumentMap.find(Interface::commonValueArguments[Interface::kCommonValueArgDelay])->second.c_str());
BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay);
if (actionIndex == Interface::kActionDetect)
{
bool detected = bridgeManager->DetectDevice();
delete bridgeManager;
return ((detected) ? 0 : 1);
}
Interface::PrintReleaseInfo();
Sleep(1000);
int initialiseResult = bridgeManager->Initialise();
if (initialiseResult != 0)
{
delete bridgeManager;
return ((initialiseResult == BridgeManager::kInitialiseDeviceNotDetected) ? 1 : 0);
}
bool success;
switch (actionIndex)
{
case Interface::kActionFlash:
{
map<string, FILE *> argumentFileMap;
// We open the files before doing anything else to ensure they exist.
if (!openFiles(argumentMap, argumentFileMap))
{
closeFiles(argumentFileMap);
delete bridgeManager;
return (0);
}
if (!bridgeManager->BeginSession())
{
closeFiles(argumentFileMap);
delete bridgeManager;
return (-1);
}
bool repartition = argumentMap.find(Interface::actions[Interface::kActionFlash].valuelessArguments[Interface::kFlashValuelessArgRepartition]) != argumentMap.end();
success = attemptFlash(bridgeManager, argumentFileMap, repartition);
success = bridgeManager->EndSession(reboot) && success;
closeFiles(argumentFileMap);
break;
}
case Interface::kActionClosePcScreen:
{
if (!bridgeManager->BeginSession())
{
delete bridgeManager;
return (-1);
}
Interface::Print("Attempting to close connect to pc screen...\n");
success = bridgeManager->EndSession(reboot);
if (success)
Interface::Print("Attempt complete\n");
break;
}
case Interface::kActionDownloadPit:
{
map<string, string>::const_iterator it = argumentMap.find(Interface::actions[Interface::kActionDownloadPit].valueArguments[Interface::kDownloadPitValueArgOutput]);
FILE *outputPitFile = fopen(it->second.c_str(), "wb");
if (!outputPitFile)
{
delete bridgeManager;
return (0);
}
if (!bridgeManager->BeginSession())
{
delete bridgeManager;
fclose(outputPitFile);
return (-1);
}
unsigned char *pitBuffer;
int fileSize = downloadPitFile(bridgeManager, &pitBuffer);
if (fileSize > 0)
{
success = fwrite(pitBuffer, 1, fileSize, outputPitFile) == fileSize;
fclose(outputPitFile);
if (!success)
Interface::PrintError("Failed to write PIT data to output file.\n");
success = bridgeManager->EndSession(reboot) && success;
}
else
{
fclose(outputPitFile);
success = false;
bridgeManager->EndSession(reboot);
}
delete [] pitBuffer;
break;
}
case Interface::kActionDump:
{
const char *outputFilename = argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgOutput])->second.c_str();
FILE *dumpFile = fopen(outputFilename, "wb");
if (!dumpFile)
{
Interface::PrintError("Failed to open file \"%s\"\n", outputFilename);
delete bridgeManager;
return (-1);
}
int chipType = 0;
string chipTypeName = argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipType])->second;
if (chipTypeName == "NAND" || chipTypeName == "nand")
chipType = 1;
int chipId = atoi(argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipId])->second.c_str());
if (!bridgeManager->BeginSession())
{
fclose(dumpFile);
delete bridgeManager;
return (-1);
}
success = bridgeManager->ReceiveDump(chipType, chipId, dumpFile);
fclose(dumpFile);
success = bridgeManager->EndSession(reboot) && success;
break;
}
case Interface::kActionPrintPit:
{
if (!bridgeManager->BeginSession())
{
delete bridgeManager;
return (-1);
}
unsigned char *devicePit;
if (downloadPitFile(bridgeManager, &devicePit) < -1)
{
bridgeManager->EndSession(reboot);
delete bridgeManager;
return (-1);
}
PitData *pitData = new PitData();
if (pitData->Unpack(devicePit))
{
Interface::PrintPit(pitData);
success = true;
}
else
{
Interface::PrintError("Failed to unpack device's PIT file!\n");
success = false;
}
delete [] devicePit;
delete pitData;
success = bridgeManager->EndSession(reboot) && success;
break;
}
}
delete bridgeManager;
return ((success) ? 0 : -1);
int result = 0;
map<string, Interface::ActionInfo>::const_iterator actionIt = Interface::GetActionMap().find(argv[1]);
if (actionIt != Interface::GetActionMap().end())
result = actionIt->second.executeFunction(argc, argv);
else
result = HelpAction::Execute(argc, argv);
return (result);
}

View File

@ -175,7 +175,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@

View File

@ -25,18 +25,19 @@ using namespace libpit;
PitEntry::PitEntry()
{
unused = false;
chipIdentifier = 0;
partitionIdentifier = 0;
partitionFlags = 0;
unknown1 = 0;
partitionBlockSize = 0;
partitionBlockCount = 0;
unknown2 = 0;
unknown3 = 0;
binaryType = false;
deviceType = 0;
identifier = 0;
attributes = 0;
updateAttributes = 0;
blockSize = 0;
blockCount = 0;
fileOffset = 0;
fileSize = 0;
memset(partitionName, 0, 32);
memset(filename, 0, 64);
memset(partitionName, 0, PitEntry::kPartitionNameMaxLength);
memset(flashFilename, 0, PitEntry::kFlashFilenameMaxLength);
memset(fotaFilename, 0, PitEntry::kFotaFilenameMaxLength);
}
PitEntry::~PitEntry()
@ -45,10 +46,11 @@ PitEntry::~PitEntry()
bool PitEntry::Matches(const PitEntry *otherPitEntry) const
{
if (unused == otherPitEntry->unused && chipIdentifier == otherPitEntry->chipIdentifier && partitionIdentifier == otherPitEntry->partitionIdentifier
&& partitionFlags == otherPitEntry->partitionFlags && unknown1 == otherPitEntry->unknown1 && partitionBlockSize == otherPitEntry->partitionBlockSize
&& partitionBlockCount == otherPitEntry->partitionBlockCount && unknown2 == otherPitEntry->unknown2 && unknown3 == otherPitEntry->unknown3
&& strcmp(partitionName, otherPitEntry->partitionName) == 0 && strcmp(filename, otherPitEntry->filename) == 0)
if (binaryType == otherPitEntry->binaryType && deviceType == otherPitEntry->deviceType && identifier == otherPitEntry->identifier
&& attributes == otherPitEntry->attributes && updateAttributes == otherPitEntry->updateAttributes && blockSize == otherPitEntry->blockSize
&& blockCount == otherPitEntry->blockCount && fileOffset == otherPitEntry->fileOffset && fileSize == otherPitEntry->fileSize
&& strcmp(partitionName, otherPitEntry->partitionName) == 0 && strcmp(flashFilename, otherPitEntry->flashFilename) == 0
&& strcmp(fotaFilename, otherPitEntry->fotaFilename) == 0)
{
return (true);
}
@ -118,34 +120,35 @@ bool PitData::Unpack(const unsigned char *data)
entries[i] = new PitEntry();
integerValue = PitData::UnpackInteger(data, entryOffset);
entries[i]->SetUnused((integerValue != 0) ? true : false);
entries[i]->SetBinaryType(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 4);
entries[i]->SetChipIdentifier(integerValue);
entries[i]->SetDeviceType(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 8);
entries[i]->SetPartitionIdentifier(integerValue);
entries[i]->SetIdentifier(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 12);
entries[i]->SetPartitionFlags(integerValue);
entries[i]->SetAttributes(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 16);
entries[i]->SetUnknown1(integerValue);
entries[i]->SetUpdateAttributes(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 20);
entries[i]->SetPartitionBlockSize(integerValue);
entries[i]->SetBlockSize(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 24);
entries[i]->SetPartitionBlockCount(integerValue);
entries[i]->SetBlockCount(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 28);
entries[i]->SetUnknown2(integerValue);
entries[i]->SetFileOffset(integerValue);
integerValue = PitData::UnpackInteger(data, entryOffset + 32);
entries[i]->SetUnknown3(integerValue);
entries[i]->SetFileSize(integerValue);
entries[i]->SetPartitionName((const char *)data + entryOffset + 36);
entries[i]->SetFilename((const char *)data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength);
entries[i]->SetFlashFilename((const char *)data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength);
entries[i]->SetFotaFilename((const char *)data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength + PitEntry::kFlashFilenameMaxLength);
}
return (true);
@ -175,22 +178,24 @@ void PitData::Pack(unsigned char *data) const
{
entryOffset = PitData::kHeaderDataSize + i * PitEntry::kDataSize;
PitData::PackInteger(data, entryOffset, (entries[i]->GetUnused()) ? 1 : 0);
PitData::PackInteger(data, entryOffset, entries[i]->GetBinaryType());
PitData::PackInteger(data, entryOffset + 4, entries[i]->GetChipIdentifier());
PitData::PackInteger(data, entryOffset + 8, entries[i]->GetPartitionIdentifier());
PitData::PackInteger(data, entryOffset + 12, entries[i]->GetPartitionFlags());
PitData::PackInteger(data, entryOffset + 4, entries[i]->GetDeviceType());
PitData::PackInteger(data, entryOffset + 8, entries[i]->GetIdentifier());
PitData::PackInteger(data, entryOffset + 12, entries[i]->GetAttributes());
PitData::PackInteger(data, entryOffset + 16, entries[i]->GetUnknown1());
PitData::PackInteger(data, entryOffset + 16, entries[i]->GetUpdateAttributes());
PitData::PackInteger(data, entryOffset + 20, entries[i]->GetPartitionBlockSize());
PitData::PackInteger(data, entryOffset + 24, entries[i]->GetPartitionBlockCount());
PitData::PackInteger(data, entryOffset + 20, entries[i]->GetBlockSize());
PitData::PackInteger(data, entryOffset + 24, entries[i]->GetBlockCount());
PitData::PackInteger(data, entryOffset + 28, entries[i]->GetUnknown2());
PitData::PackInteger(data, entryOffset + 32, entries[i]->GetUnknown3());
PitData::PackInteger(data, entryOffset + 28, entries[i]->GetFileOffset());
PitData::PackInteger(data, entryOffset + 32, entries[i]->GetFileSize());
memcpy(data + entryOffset + 36, entries[i]->GetPartitionName(), PitEntry::kPartitionNameMaxLength);
memcpy(data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength, entries[i]->GetPartitionName(), PitEntry::kFilenameMaxLength);
memcpy(data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength, entries[i]->GetPartitionName(), PitEntry::kFlashFilenameMaxLength);
memcpy(data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength + PitEntry::kFlashFilenameMaxLength,
entries[i]->GetFotaFilename(), PitEntry::kFotaFilenameMaxLength);
}
}
@ -250,7 +255,7 @@ PitEntry *PitData::FindEntry(const char *partitionName)
{
for (unsigned int i = 0; i < entries.size(); i++)
{
if (!entries[i]->GetUnused() && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
if (entries[i]->GetBlockCount() > 0 && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
return (entries[i]);
}
@ -261,7 +266,7 @@ const PitEntry *PitData::FindEntry(const char *partitionName) const
{
for (unsigned int i = 0; i < entries.size(); i++)
{
if (!entries[i]->GetUnused() && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
if (entries[i]->GetBlockCount() > 0 && strcmp(entries[i]->GetPartitionName(), partitionName) == 0)
return (entries[i]);
}
@ -272,7 +277,7 @@ PitEntry *PitData::FindEntry(unsigned int partitionIdentifier)
{
for (unsigned int i = 0; i < entries.size(); i++)
{
if (!entries[i]->GetUnused() && entries[i]->GetPartitionIdentifier() == partitionIdentifier)
if (entries[i]->GetBlockCount() > 0 && entries[i]->GetIdentifier() == partitionIdentifier)
return (entries[i]);
}
@ -283,7 +288,7 @@ const PitEntry *PitData::FindEntry(unsigned int partitionIdentifier) const
{
for (unsigned int i = 0; i < entries.size(); i++)
{
if (!entries[i]->GetUnused() && entries[i]->GetPartitionIdentifier() == partitionIdentifier)
if (entries[i]->GetBlockCount() > 0 && entries[i]->GetIdentifier() == partitionIdentifier)
return (entries[i]);
}

View File

@ -43,32 +43,53 @@ namespace libpit
{
kDataSize = 132,
kPartitionNameMaxLength = 32,
kFilenameMaxLength = 64
kFlashFilenameMaxLength = 32,
kFotaFilenameMaxLength = 32
};
enum
{
kPartitionFlagWrite = 1 << 1
kBinaryTypeApplicationProcessor = 0,
kBinaryTypeCommunicationProcessor = 1
};
enum
{
kDeviceTypeOneNand = 0,
kDeviceTypeFile, // FAT
kDeviceTypeMMC,
kDeviceTypeAll // ?
};
enum
{
kAttributeWrite = 1,
kAttributeSTL = 1 << 1
};
enum
{
kUpdateAttributeFota = 1,
kUpdateAttributeSecure = 1 << 1
};
private:
bool unused;
unsigned int binaryType;
unsigned int deviceType;
unsigned int identifier;
unsigned int attributes;
unsigned int updateAttributes;
unsigned int chipIdentifier;
unsigned int partitionIdentifier;
unsigned int partitionFlags;
unsigned int blockSize;
unsigned int blockCount;
unsigned int unknown1;
unsigned int partitionBlockSize;
unsigned int partitionBlockCount;
unsigned int unknown2;
unsigned int unknown3;
unsigned int fileOffset; // Obsolete
unsigned int fileSize; // Obsolete
char partitionName[kPartitionNameMaxLength];
char filename[kFilenameMaxLength];
char flashFilename[kFlashFilenameMaxLength]; // USB flash filename
char fotaFilename[kFotaFilenameMaxLength]; // Firmware over the air
public:
@ -77,94 +98,94 @@ namespace libpit
bool Matches(const PitEntry *otherPitEntry) const;
bool GetUnused(void) const
unsigned int GetBinaryType(void) const
{
return unused;
return binaryType;
}
void SetUnused(bool unused)
void SetBinaryType(unsigned int binaryType)
{
this->unused = unused;
this->binaryType = binaryType;
}
unsigned int GetChipIdentifier(void) const
unsigned int GetDeviceType(void) const
{
return chipIdentifier;
return deviceType;
}
void SetChipIdentifier(unsigned int chipIdentifier)
void SetDeviceType(unsigned int deviceType)
{
this->chipIdentifier = chipIdentifier;
this->deviceType = deviceType;
}
unsigned int GetPartitionIdentifier(void) const
unsigned int GetIdentifier(void) const
{
return partitionIdentifier;
return identifier;
}
void SetPartitionIdentifier(unsigned int partitionIdentifier)
void SetIdentifier(unsigned int identifier)
{
this->partitionIdentifier = partitionIdentifier;
this->identifier = identifier;
}
unsigned int GetPartitionFlags(void) const
unsigned int GetAttributes(void) const
{
return partitionFlags;
return attributes;
}
void SetPartitionFlags(unsigned int partitionFlags)
void SetAttributes(unsigned int attributes)
{
this->partitionFlags = partitionFlags;
this->attributes = attributes;
}
unsigned int GetUnknown1(void) const
unsigned int GetUpdateAttributes(void) const
{
return unknown1;
return updateAttributes;
}
void SetUnknown1(unsigned int unknown1)
void SetUpdateAttributes(unsigned int updateAttributes)
{
this->unknown1 = unknown1;
this->updateAttributes = updateAttributes;
}
unsigned int GetPartitionBlockSize(void) const
unsigned int GetBlockSize(void) const
{
return partitionBlockSize;
return blockSize;
}
void SetPartitionBlockSize(unsigned int partitionBlockSize)
void SetBlockSize(unsigned int blockSize)
{
this->partitionBlockSize = partitionBlockSize;
this->blockSize = blockSize;
}
unsigned int GetPartitionBlockCount(void) const
unsigned int GetBlockCount(void) const
{
return partitionBlockCount;
return blockCount;
}
void SetPartitionBlockCount(unsigned int partitionBlockCount)
void SetBlockCount(unsigned int blockCount)
{
this->partitionBlockCount = partitionBlockCount;
this->blockCount = blockCount;
}
unsigned int GetUnknown2(void) const
unsigned int GetFileOffset(void) const
{
return unknown2;
return fileOffset;
}
void SetUnknown2(unsigned int unknown2)
void SetFileOffset(unsigned int fileOffset)
{
this->unknown2 = unknown2;
this->fileOffset = fileOffset;
}
unsigned int GetUnknown3(void) const
unsigned int GetFileSize(void) const
{
return unknown3;
return fileSize;
}
void SetUnknown3(unsigned int unknown3)
void SetFileSize(unsigned int fileSize)
{
this->unknown3 = unknown3;
this->fileSize = fileSize;
}
const char *GetPartitionName(void) const
@ -183,20 +204,36 @@ namespace libpit
memcpy(this->partitionName, partitionName, 63);
}
const char *GetFilename(void) const
const char *GetFlashFilename(void) const
{
return filename;
return flashFilename;
}
void SetFilename(const char *filename)
void SetFlashFilename(const char *flashFilename)
{
// This isn't strictly necessary but ensures no junk is left in our PIT file.
memset(this->filename, 0, 32);
memset(this->flashFilename, 0, kFlashFilenameMaxLength);
if (strlen(partitionName) < 32)
strcpy(this->filename, filename);
strcpy(this->flashFilename, flashFilename);
else
memcpy(this->filename, filename, 31);
memcpy(this->flashFilename, flashFilename, 31);
}
const char *GetFotaFilename(void) const
{
return fotaFilename;
}
void SetFotaFilename(const char *fotaFilename)
{
// This isn't strictly necessary but ensures no junk is left in our PIT file.
memset(this->fotaFilename, 0, kFotaFilenameMaxLength);
if (strlen(partitionName) < 32)
strcpy(this->fotaFilename, fotaFilename);
else
memcpy(this->fotaFilename, fotaFilename, 31);
}
};
@ -217,7 +254,7 @@ namespace libpit
unsigned int unknown2; // 0x0C
unsigned short unknown3; // 0x10 (7508 = I9000, 7703 = I9100 & P1000)?
unsigned short unknown4; // 0x12 (Always 65, probably flags of some sort)
unsigned short unknown4; // 0x12 (Always 65, probably attributes of some sort)
unsigned short unknown5; // 0x14
unsigned short unknown6; // 0x16

49
libpit/aclocal.m4 vendored
View File

@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
[m4_warning([this file was generated for autoconf 2.67.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
[m4_warning([this file was generated for autoconf 2.63.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@ -2460,7 +2460,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@ -2485,10 +2485,13 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -2500,18 +2503,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -3099,11 +3090,11 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@ -3720,7 +3711,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@ -3784,7 +3775,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -4004,7 +3995,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@ -4209,9 +4200,6 @@ m4_if([$1], [CXX], [
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -4276,9 +4264,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -4300,7 +4285,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@ -4392,7 +4376,7 @@ _LT_EOF
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
gnu* | linux* | tpf* | k*bsd*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@ -4462,7 +4446,7 @@ _LT_EOF
fi
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -4637,7 +4621,6 @@ _LT_EOF
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
@ -4876,7 +4859,7 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -5872,7 +5855,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# This file was generated by Autom4te Thu Aug 5 21:29:16 UTC 2010.
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.

View File

@ -554,7 +554,7 @@ m4trace:/usr/share/aclocal/libtool.m4:1841: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF
m4trace:/usr/share/aclocal/libtool.m4:1841: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2741: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl
m4trace:/usr/share/aclocal/libtool.m4:2732: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
@ -613,11 +613,11 @@ fi
_LT_DECL([], [MAGIC_CMD], [0],
[Used to examine libraries when file_magic_cmd begins with "file"])dnl
])
m4trace:/usr/share/aclocal/libtool.m4:2803: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2803: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:2794: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2794: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2826: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl
m4trace:/usr/share/aclocal/libtool.m4:2817: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
m4_require([_LT_DECL_SED])dnl
@ -702,15 +702,15 @@ AC_SUBST([LD])
_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
])
m4trace:/usr/share/aclocal/libtool.m4:2914: -1- AU_DEFUN([AM_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2914: -1- AC_DEFUN([AM_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LD' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:2905: -1- AU_DEFUN([AM_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2905: -1- AC_DEFUN([AM_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LD' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2915: -1- AU_DEFUN([AC_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2915: -1- AC_DEFUN([AC_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LD' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:2906: -1- AU_DEFUN([AC_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:2906: -1- AC_DEFUN([AC_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LD' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3179: -1- AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl
m4trace:/usr/share/aclocal/libtool.m4:3170: -1- AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl
AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
@ -785,15 +785,15 @@ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
fi
rm -f conftest*])
])
m4trace:/usr/share/aclocal/libtool.m4:3257: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3257: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:3248: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3248: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3258: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3258: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:3249: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3249: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3267: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl
m4trace:/usr/share/aclocal/libtool.m4:3258: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
@ -809,28 +809,28 @@ case $host in
esac
AC_SUBST([LIBM])
])
m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:3277: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])])
m4trace:/usr/share/aclocal/libtool.m4:3277: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])])
m4trace:/usr/share/aclocal/libtool.m4:6987: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
m4trace:/usr/share/aclocal/libtool.m4:6970: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
[m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
[AC_CHECK_TOOL(GCJ, gcj,)
test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)])])[]dnl
])
m4trace:/usr/share/aclocal/libtool.m4:6996: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])])
m4trace:/usr/share/aclocal/libtool.m4:6996: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:6979: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])])
m4trace:/usr/share/aclocal/libtool.m4:6979: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])])
m4trace:/usr/share/aclocal/libtool.m4:7003: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,)
m4trace:/usr/share/aclocal/libtool.m4:6986: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,)
])
m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])])
m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:6991: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])])
m4trace:/usr/share/aclocal/libtool.m4:6991: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])])
m4trace:/usr/share/aclocal/libtool.m4:7119: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])])
m4trace:/usr/share/aclocal/libtool.m4:7119: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete.
m4trace:/usr/share/aclocal/libtool.m4:7102: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])])
m4trace:/usr/share/aclocal/libtool.m4:7102: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete.
You should run autoupdate.])dnl
m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])])
m4trace:/usr/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT])
@ -1085,7 +1085,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
freebsd* | dragonfly*)
lt_cv_sys_dlopen_deplibs=yes
;;
gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
gnu* | linux* | k*bsd*-gnu)
# GNU and its variants, using gnu ld.so (Glibc)
lt_cv_sys_dlopen_deplibs=yes
;;
@ -1105,7 +1105,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
# at 6.2 and later dlopen does load deplibs.
lt_cv_sys_dlopen_deplibs=yes
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
lt_cv_sys_dlopen_deplibs=yes
;;
openbsd*)
@ -2116,7 +2116,6 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$])
@ -2144,7 +2143,6 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$])
@ -2169,7 +2167,7 @@ m4trace:configure.ac:5: -1- AM_INIT_AUTOMAKE([1.10 -Wall no-define foreign])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
m4trace:configure.ac:5: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
m4trace:configure.ac:5: -1- AM_AUTOMAKE_VERSION([1.11.1])
m4trace:configure.ac:5: -1- _AM_AUTOCONF_VERSION([2.67])
m4trace:configure.ac:5: -1- _AM_AUTOCONF_VERSION([2.63])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_DATA$])
@ -2347,7 +2345,6 @@ m4trace:configure.ac:9: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:9: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:9: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:9: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:9: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
m4trace:configure.ac:9: -1- LT_LANG([CXX])
m4trace:configure.ac:9: -1- LT_SUPPORTED_TAG([CXX])
m4trace:configure.ac:9: -1- m4_pattern_allow([^CXX$])

View File

@ -1,4 +1,4 @@
m4trace:configure.ac:1: -1- AC_INIT([libpit], [1.3], [bug-report@glassechidna.com.au], [libpit], [http://www.glassechidna.com.au/])
m4trace:configure.ac:1: -1- AC_INIT([libpit], [1.4], [bug-report@glassechidna.com.au], [libpit], [http://www.glassechidna.com.au/])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
@ -6,7 +6,7 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:1: -1- AC_SUBST([SHELL])
m4trace:configure.ac:1: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR])
@ -27,9 +27,6 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$])
@ -101,27 +98,23 @@ m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
#undef PACKAGE_NAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
#undef PACKAGE_TARNAME])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
#undef PACKAGE_VERSION])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
#undef PACKAGE_STRING])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
#undef PACKAGE_BUGREPORT])
m4trace:configure.ac:1: -1- AC_SUBST([DEFS])
m4trace:configure.ac:1: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$])
@ -431,7 +424,7 @@ m4trace:configure.ac:9: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
m4trace:configure.ac:9: -1- m4_pattern_allow([^LT_OBJDIR$])
m4trace:configure.ac:9: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
@%:@undef LT_OBJDIR])
#undef LT_OBJDIR])
m4trace:configure.ac:9: -1- AC_SUBST([lt_ECHO])
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([lt_ECHO])
m4trace:configure.ac:9: -1- m4_pattern_allow([^lt_ECHO$])
@ -452,7 +445,7 @@ m4trace:configure.ac:9: -1- AC_SUBST([OTOOL64])
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([OTOOL64])
m4trace:configure.ac:9: -1- m4_pattern_allow([^OTOOL64$])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
#undef HAVE_DLFCN_H])
m4trace:configure.ac:9: -1- AC_SUBST([CPP])
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:9: -1- m4_pattern_allow([^CPP$])
@ -465,27 +458,25 @@ m4trace:configure.ac:9: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:9: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:9: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:9: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
#undef STDC_HEADERS])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
#undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
#undef HAVE_SYS_STAT_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
#undef HAVE_STDLIB_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
#undef HAVE_STRING_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
#undef HAVE_MEMORY_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
#undef HAVE_STRINGS_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
#undef HAVE_INTTYPES_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
#undef HAVE_STDINT_H])
m4trace:configure.ac:9: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:9: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:9: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
#undef HAVE_UNISTD_H])
m4trace:configure.ac:9: -1- LT_SUPPORTED_TAG([CXX])
m4trace:configure.ac:9: -1- AC_SUBST([CXX])
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([CXX])
@ -534,7 +525,7 @@ m4trace:configure.ac:9: -1- m4_pattern_allow([^CXXCPP$])
m4trace:configure.ac:9: -1- AC_SUBST([LD])
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([LD])
m4trace:configure.ac:9: -1- m4_pattern_allow([^LD$])
m4trace:configure.ac:11: -1- AC_SUBST([LIBPIT_API_VERSION], [1.3])
m4trace:configure.ac:11: -1- AC_SUBST([LIBPIT_API_VERSION], [1.4])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LIBPIT_API_VERSION])
m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBPIT_API_VERSION$])
m4trace:configure.ac:12: -1- AC_CONFIG_FILES([Makefile])
@ -554,19 +545,19 @@ m4trace:configure.ac:14: -1- m4_pattern_allow([^MAINT$])
m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([OS_LINUX])
m4trace:configure.ac:19: -1- m4_pattern_allow([^OS_LINUX$])
m4trace:configure.ac:19: -1- AH_OUTPUT([OS_LINUX], [/* Linux backend */
@%:@undef OS_LINUX])
#undef OS_LINUX])
m4trace:configure.ac:23: -1- AC_DEFINE_TRACE_LITERAL([OS_DARWIN])
m4trace:configure.ac:23: -1- m4_pattern_allow([^OS_DARWIN$])
m4trace:configure.ac:23: -1- AH_OUTPUT([OS_DARWIN], [/* Darwin backend */
@%:@undef OS_DARWIN])
#undef OS_DARWIN])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([OS_WINDOWS])
m4trace:configure.ac:27: -1- m4_pattern_allow([^OS_WINDOWS$])
m4trace:configure.ac:27: -1- AH_OUTPUT([OS_WINDOWS], [/* Windows backend */
@%:@undef OS_WINDOWS])
#undef OS_WINDOWS])
m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([OS_WINDOWS])
m4trace:configure.ac:31: -1- m4_pattern_allow([^OS_WINDOWS$])
m4trace:configure.ac:31: -1- AH_OUTPUT([OS_WINDOWS], [/* Windows backend */
@%:@undef OS_WINDOWS])
#undef OS_WINDOWS])
m4trace:configure.ac:38: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@ -583,7 +574,7 @@ m4trace:configure.ac:38: -1- m4_pattern_allow([^WORDS_BIGENDIAN$])
m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD])
m4trace:configure.ac:38: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$])
m4trace:configure.ac:38: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */
@%:@undef AC_APPLE_UNIVERSAL_BUILD])
#undef AC_APPLE_UNIVERSAL_BUILD])
m4trace:configure.ac:40: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:40: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:40: -1- m4_pattern_allow([^LIB@&t@OBJS$])

9
libpit/config.guess vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2009-12-30'
timestamp='2009-11-20'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -56,9 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

View File

@ -58,9 +58,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

19
libpit/config.sub vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2010-01-22'
timestamp='2009-11-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -75,9 +75,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -381,8 +380,7 @@ case $basic_machine in
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \
@ -1087,11 +1085,6 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
@ -1442,8 +1435,6 @@ case $os in
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)

5477
libpit/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
AC_INIT([libpit], [1.3], [bug-report@glassechidna.com.au], [libpit], [http://www.glassechidna.com.au/])
AC_INIT([libpit], [1.4], [bug-report@glassechidna.com.au], [libpit], [http://www.glassechidna.com.au/])
AC_PREREQ([2.59])
AC_CANONICAL_TARGET
AC_CONFIG_MACRO_DIR([m4])
@ -8,7 +8,7 @@ AC_PROG_CXX
LT_INIT()
AC_SUBST([LIBPIT_API_VERSION], [1.3])
AC_SUBST([LIBPIT_API_VERSION], [1.4])
AC_CONFIG_FILES([Makefile])
AM_MAINTAINER_MODE

View File

@ -65,7 +65,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
# $progname: (GNU libtool) 2.2.6b
# automake: $automake_version
# autoconf: $autoconf_version
#
@ -73,7 +73,7 @@
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
VERSION=2.2.6b
TIMESTAMP=""
package_revision=1.3017
@ -5033,10 +5033,7 @@ func_mode_link ()
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test "$linkmode,$pass" = "lib,dlpreopen"; then
@ -5347,19 +5344,19 @@ func_mode_link ()
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
continue
fi # $pass = conv
@ -5896,7 +5893,6 @@ func_mode_link ()
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
-L*) path="$deplib" ;;
*.la)
@ -6210,9 +6206,6 @@ func_mode_link ()
revision="$number_minor"
lt_irix_increment=no
;;
*)
func_fatal_configuration "$modename: unknown library version type \`$version_type'"
;;
esac
;;
no)

45
libpit/m4/libtool.m4 vendored
View File

@ -2445,7 +2445,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@ -2470,10 +2470,13 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -2485,18 +2488,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -3084,11 +3075,11 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@ -3705,7 +3696,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@ -3769,7 +3760,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -3989,7 +3980,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@ -4194,9 +4185,6 @@ m4_if([$1], [CXX], [
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -4261,9 +4249,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -4285,7 +4270,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@ -4377,7 +4361,7 @@ _LT_EOF
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
gnu* | linux* | tpf* | k*bsd*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@ -4447,7 +4431,7 @@ _LT_EOF
fi
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -4622,7 +4606,6 @@ _LT_EOF
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
@ -4861,7 +4844,7 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -5861,7 +5844,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler