Comments (6)
Thanks. I'm considering using buildroot to replace tinycore for the rescue system, right now I'm not exploiting it to it's fullest. I think that if I created a board or packages for the PBA's and sedutil I could do a complete and consistent build to avoid these types of issues.
Modifying the makefiles directly will not work, Netbeans will overwrite them on a whim. I'll have to modify the project properties in netbeans.
from sedutil.
Sure. I compile on the command line and that's why I'm patching the makefiles :)
from sedutil.
I'm facing similar problem, this time while booting from the shadow UEFI64 PBA.
/sbin/linuxpba: error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
The first problem is that LinuxPBA depends on ncurses (-lcurses while linking) which probably is different version than the one available in syslinux.
The second problem is that my Arch Linux packages doesn't include statically linked ncurses, so I can't even statically link as I did for sedutil-cli. That makes building process for me blocker :(
from sedutil.
Here is a simplifed linux PBA with ncurses removed, which can be compiled staticly.
This one also properly enumerates avalible block devices. I am using getpass() so you can remove everything from GetPassPhrase.cpp. I refactored UnlockSEDs a bit so I can read it better.
Here is the code, feel free to use it under the License of this project.
main.cpp:
`
using namespace std;
#include <unistd.h>
#include <sys/reboot.h>
#include "log.h"
#include "UnlockSEDs.h"
#include <unistd.h>
int main(int argc, char** argv)
{
char* pw = getpass("Please enter pass-phrase to unlock OPAL drives: ");
if (pw)
{
if (UnlockSEDs(pw) == 0)
{
sync();
reboot(RB_AUTOBOOT);
return EXIT_SUCCESS;
}
}
return EXIT_FAILURE;
} `
UnlockSED.cpp:
`
#include "UnlockSEDs.h"
#include "DtaDevGeneric.h"
#include "DtaDevOpal1.h"
#include "DtaDevOpal2.h"
#include <unistd.h>
#include <dirent.h>
#include <stdio.h>
static int UnlockDevice(DtaDev& d, const char* devref, char* password)
{
d.no_hash_passwords = false;
printf("Unlocking %s\n", devref);
int result = -1;
if (d.MBREnabled())
{
if (d.setMBRDone(1, password) == 0)
{
if (d.setLockingRange(0, OPAL_LOCKINGSTATE::READWRITE, password) == 0)
{
result = 0;
}
else
{
LOG(E) << "Unlock failed - unable to set LockingRange 0 RW";
}
}
else
{
LOG(E) << "Unlock failed - unable to set MBRDone";
}
}
else
{
LOG(I) << "MBR not enabled";
result = 0;
}
return result;
}
uint8_t UnlockSEDs(char * password)
{
int result = -1;
DIR* d;
struct dirent* dir;
d = opendir("/sys/block/");
if (d)
{
LOG(D4) << "Enter UnlockSEDs";
printf("Scanning...\n");
while ((dir = readdir(d)) != NULL)
{
char devref[16];
if (dir->d_name[0] != '.')
{
snprintf(devref, sizeof(devref), "/dev/%s", dir->d_name);
DtaDevGeneric tempDev(devref);
if (tempDev.isPresent())
{
if (tempDev.isOpal2())
{
DtaDevOpal2 d(devref);
result = UnlockDevice(d, devref, password);
}
else if (tempDev.isOpal1())
{
DtaDevOpal1 d(devref);
result = UnlockDevice(d, devref, password);
}
else
{
printf("Drive %s not supported\n", devref);
}
}
}
}
}
closedir(d);
return result;
}
`
from sedutil.
Thanks for sharing.
My current workaround is to compile the ncurses aside of the sedutil project and later modify the makefile to use the generated ncurses.a (object code archive file for static linking). That's way I have LinuxPBA and sedutil-cli statically linked, BUT that is just workaround, nothing more.
from sedutil.
This should be resolved with V1.15
from sedutil.
Related Issues (20)
- Solidigm P44 Pro - According to sedutil it has OPAL 2? HOT 8
- Micron 5400 Shows No for Opal compliant HOT 5
- Non-boot drive prompts password on startup and fails. HOT 14
- How to add a package to the PBA? (libusb-1.0-0)
- Drive remains unlocked after reset HOT 2
- Test the PBA results scroll too fast and most exit display to be out of view. HOT 8
- Locked SED drives and linux errors HOT 13
- TCG-Ruby support HOT 2
- The Kernel flag libata.allow_tpm is not set correctly HOT 1
- revertnoerase can't be run due to SP_BUSY HOT 4
- Problem after installing a NVIDIA GPU
- NVME pass through HOT 12
- Query: TCG Pyrite/Opal/Enterprise and IEEE 2883-2022 HOT 1
- Why isn't the main branch being updated anymore?
- Samsung PM981 NVMe: PSID revert does not work HOT 1
- RevertLockingSP on TCG Enterprise doesn't work HOT 2
- version 1.49 unbuildable on linux HOT 2
- WD PC SN740 NOT_AUTHORIZED when performing initialstup HOT 2
- How to unlock with one locked disk after reboot HOT 2
- NVME Security Command Error:16386, no support for GAMMIX S70 BLADE SSD. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sedutil.