Git Product home page Git Product logo

Comments (10)

dtasupport avatar dtasupport commented on July 18, 2024

Not sure where the issue is but I don't usually build with a target just
the CONF. I use XUbuntu 14.x to develop and build the Linux variant.

On Wed, Feb 24, 2016 at 3:53 AM, rookierks [email protected] wrote:

Building release 1.12 on current Arch Linux is not working. I'm probably
not doing something that is needed or doing something wrong but this was
working as expected before.

I'm changing directory into linux/CLI/ and then doing 'make
CONF=Release_x86_64 build'. I'm getting the following error(s):

../DtaDevLinuxNvme.cpp: In member function ‘virtual uint8_t
DtaDevLinuxNvme::sendCmd(ATACOMMAND, uint8_t, uint16_t, void
, uint16_t)’: ../DtaDevLinuxNvme.cpp:68:27: error: aggregate
‘DtaDevLinuxNvme::sendCmd(ATACOMMAND, uint8_t, uint16_t, void
,
uint16_t)::nvme_admin_cmd nvme_cmd’ has incomplete type and cannot be
defined
struct nvme_admin_cmd nvme_cmd;
^
../DtaDevLinuxNvme.cpp:92:18: error: ‘NVME_IOCTL_ADMIN_CMD’ was not
declared in this scope
err = ioctl(fd, NVME_IOCTL_ADMIN_CMD, &nvme_cmd);
^
../DtaDevLinuxNvme.cpp: In member function ‘virtual void
DtaDevLinuxNvme::identify(OPAL_DiskInfo&)’:
../DtaDevLinuxNvme.cpp:112:24: error: aggregate
‘DtaDevLinuxNvme::identify(OPAL_DiskInfo&)::nvme_admin_cmd cmd’ has
incomplete type and cannot be defined
struct nvme_admin_cmd cmd;
^
../DtaDevLinuxNvme.cpp:122:18: error: ‘NVME_IOCTL_ADMIN_CMD’ was not
declared in this scope
err = ioctl(fd, NVME_IOCTL_ADMIN_CMD, &cmd);
^
nbproject/Makefile-Release_x86_64.mk:182: recipe for target
'build/Release_x86_64/GNU-Linux/_ext/5c0/DtaDevLinuxNvme.o' failed
make[2]: *** [build/Release_x86_64/GNU-Linux/_ext/5c0/DtaDevLinuxNvme.o]
Error 1


Reply to this email directly or view it on GitHub
#25.

Mike

from sedutil.

rookierks avatar rookierks commented on July 18, 2024

It doesn't make a difference given that the target "build" is the first one in the makefile so it is used by default.

Using just 'make' without target or CONF also fails. I don't know what is the current version of gcc/cpp for xubuntu, but for Arch Linux it is 5.3, might this be the reason why it fails? Maybe due to more stringent checks or something that is not included by default anymore?

from sedutil.

konstmonst avatar konstmonst commented on July 18, 2024

I think thats because of the change to 4.4 Kernel.
You have to paste the following at the beginning of DtaDevLinuxNvme.h to fix that:

#include <stdint.h>
struct nvme_user_io {
uint8_t opcode;
uint8_t flags;
uint16_t control;
uint16_t nblocks;
uint16_t rsvd;
uint64_t metadata;
uint64_t addr;
uint64_t slba;
uint32_t dsmgmt;
uint32_t reftag;
uint16_t apptag;
uint16_t appmask;
};

struct nvme_passthru_cmd {
uint8_t opcode;
uint8_t flags;
uint16_t rsvd1;
uint32_t nsid;
uint32_t cdw2;
uint32_t cdw3;
uint64_t metadata;
uint64_t addr;
uint32_t metadata_len;
uint32_t data_len;
uint32_t cdw10;
uint32_t cdw11;
uint32_t cdw12;
uint32_t cdw13;
uint32_t cdw14;
uint32_t cdw15;
uint32_t timeout_ms;
uint32_t result;
};

#define nvme_admin_cmd nvme_passthru_cmd

#define NVME_IOCTL_ID _IO('N', 0x40)
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
#define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
#define NVME_IOCTL_RESET _IO('N', 0x44)
#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)

from sedutil.

rookierks avatar rookierks commented on July 18, 2024

Thanks for the tip.

I haven't tested it yet but if that is the problem then I suppose it would be easier to just add
#include <uapi/linux/nvme_ioctl.h>

from sedutil.

konstmonst avatar konstmonst commented on July 18, 2024

@rookierks I've tried, but the header is not there on my arch linux system. I currently made a Makefile that builds an arch linux based PBA Image, it works and I am using it on my laptop. I will twe
ak it and post it on github.

from sedutil.

konstmonst avatar konstmonst commented on July 18, 2024

I pushed my work here https://github.com/konstmonst/arch_opal_pba if anyone is interested. Still have to clean it up a bit.

from sedutil.

rookierks avatar rookierks commented on July 18, 2024

@konstmonst
You are correct, that file is part of kernel-headers and it will change location with every kernel release or it could also depend on the kernel you will use in the PBA image. If this doesn't get fixed here I will try to get a (as much as possible) generic patch, but from what I see it might not be straight forward.

On another note, have you looked at https://aur.archlinux.org/packages/sedutil ? I know it doesn't have documentation (yet) but it might be providing something similar to what you are doing.

from sedutil.

konstmonst avatar konstmonst commented on July 18, 2024

That package doesn't seem to support 64 bit UEFI and that is the only case I am really interested in.
Ideally I'd just use an .img file I can flash on OPAL drive to be able to unlock it before booting.
Also linuxpba also doesn't seem to work for me in its current state when started from initrd: it complains about the terminal and then exits, so I edited the source a bit and removed ncurses dependency.

from sedutil.

rookierks avatar rookierks commented on July 18, 2024

linuxpba needs (or used to need) one file included in the initrd for it to work, but I haven't tested the latest one yet as I haven't fixed the compile error in a way that I like.

Regarding the package on the AUR you are right, it doesn't support UEFI as it might be tricky to get it to work for most cases and the author doesn't have a machine with UEFI to test with so it's better not to have half baked support.

In your case do you have any helper scripts to (help) generate any uploadable PBA images?

from sedutil.

konstmonst avatar konstmonst commented on July 18, 2024

Well, assuming you've got updated Arch Linux, you just call make and you get a PBA image (pba.img in build directory). This image contains an EFI System partition (also found at build/efiboot.img) and has a 1 menu grub configuration which boots it and starts linuxpba. You can then dd if=pba.img of=/dev/usbstick and test it if it works. I test it both on my PC and my Laptop.

from sedutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.