Device is unable to BOOT or INSTALL with generated .hddimg - intel

I have device which has following configuration:
Chipset architecture - Intel NM10 express
Processor - Atom D2550 Dual Core
Display - DVI
Volatile Memory - 2GB DDR3
Storage - 16GB
Objective: Device should run yocto embededded OS successfully
What I have done,
Downloaded three required yocto layers for warrior branch i.e. 1. poky 2. meta-openembedded 3. meta-intel
Modified local.conf with MACHINE ??= "intel-core2-32"
Ran source poky/oe-init-build-env
Generated .hddimg by bitbake core-image-minimal
Flashed .hddimg to thumb drive through dd command
Attached thumb drive to device and I could see BOOT and INSTALL option, upon clicking any of them nothing happens(not even logs) i.e. Blank screen
Troubleshooting I tried out are,
Tried to boot lubuntu and it was successful
Replaced kernel & initrd of lubuntu with yocto's one and booting was successful which indicates there is no issue with kernel or initrd in .hddimg generated by yocto
Tried some experiment with syslinux as well but didn't work out

The .hddimg types are quite outdated these days, and meta-intel has also switched to wic Their README includes very good information on how to create boot- and installable images here and here.
Short summary of it:
for booting, use the .wic-file
for building an installer, setup image and bootlader config according to documentation, then use .wic-file

Related

How is it that an arm-none-eabi-gcc code program runs on x86 machine?

Many questions in this forum start with "why does my code not run..." For a change, this one is "why does my code run..."
I develop on Ubuntu 18.04 running as a VM machine on a laptop (windows x86).
The following program compiled and linked with gcc runs fine and displays a 64 bit address.
char *s = "Hello\n"; printf ("Hello at address: %p\n", s);
My assumption is that arm-none-eabi targets a system bare metal. Of course I am not trying to run the above program on a bare metal. But I am trying to understand how cross compilation works.
The same program compiled and linked with arm-none-eabi-gcc (installed from Ubuntu) indicates a lot of missing references (_exit ...etc.) - normal. The code created is ARM assembly language, I verified with arm-none-eabi-objdump.
Adding the option --specs=nosys.specs at load time solves the missing references - as expected. When I run it on Ubuntu, QEMU is automatically called and has a segmentation fault. I am not surprised about the segmentation fault but the automatic launch of QEMU was unexpected.
Changing the option to --spec=rdimon.specs also solves the missing references - as expected. But despite the assembly code created is arm, it runs on Ubuntu (x86). The address displayed is 32 bits.
I know that rdimon.specs relates to semi-hosting, but I thought this was only activated when the program runs on the target (arm processor) and communicates with the host running gdb. Apparently I am wrong.
Sorry about this long preamble...simple question: how is it that my arm code runs on x86?
This is a result of the binfmt mechanism. When qemu is installed, it registers itself to run non-native executables, and is transparently invoked when a non-native ELF is executed. When semihosting is enabled using rdimon specs, it links a suitable set of libc stubs which cooperate with the host environment.

install SQLite on a USB stick attached to a Linux/Debian box

I need my application to run from a USB stick and perform the installation from there.
The application is eventually installed on a Linux/Debian.
For the application installation I need a DB to be installed on that USB. I also need the DB data (tables, etc.) to be kept on that USB stick.
I read that SQLite is a good candidate to be used for such a purpose. However, I could no find the steps needed for installing it on the USB stick.
I did download the sqlite-snapshot-202002271621.tar.gz from the sqlite.org site, placed it in one of my Debian directories and used the 3 commands to install it (./configure,make,make install).
That installed SQLite on my hard disk.
What should I do in order to achieve the same on the USB stick?
Mount the USB to the Debian box, place the tar.gz file there, and run the commands from there?
Will that install SQLite on the USB?
Thanks
So the answer is indeed:
Mount the USB to the Debian box
Place the sqlite-snapshot-202002271621.tar.gz file there
Run the commands from there
./configure
make
make install
Notice just that I had to tar the sqlite-snapshot-202002271621.tar.gz file using:
tar -zvxf sqlite-snapshot-202002271621.tar.gz -C /media/usbstick/ --no-same-owner
In order to avoid the error:
"Cannot change ownership to uid 1000, gid 1000: Operation not permitted"

How to install xv6 on virtualbox or vmware?

I'm trying to run xv6 operating system on VirtualBox or VMWare in a Linux host. The official instructions said how to run the OS on qemu only. However, the official page (https://pdos.csail.mit.edu/6.828/2014/xv6.html) mentioned that xv6 can be booted directly on hardware also, but it's not clear how.
I want to boot xv6 on VirtualBox or VMware first. I extracted the following command from the Makefile, which runs xv6 from the command line after it's compiled using make command.
/usr/bin/qemu-system-i386 -serial mon:stdio -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512
Please help me how to proceed. If the procedure is already documented some reference will be helpful.
The instructions are here which is linked (via 6.828 tools page) from your link though they are a bit terse:
Using a Virtual Machine
Otherwise, the easiest way to get a compatible toolchain is to install
a modern Linux distribution on your computer. With platform
virtualization, Linux can cohabitate with your normal computing
environment. Installing a Linux virtual machine is a two step process.
First, you download the virtualization platform.
VirtualBox (free for Mac, Linux, Windows) — Download page
VMware Player (free for Linux and Windows, registration required)
VMware Fusion (Downloadable from IS&T for free).
VirtualBox is a little slower and less flexible, but free!
Once the virtualization platform is installed, download a boot disk
image for the Linux distribution of your choice.
Ubuntu Desktop is what we use.
This will download a file named something like
ubuntu-10.04.1-desktop-i386.iso. Start up your virtualization platform
and create a new (32-bit) virtual machine. Use the downloaded Ubuntu
image as a boot disk; the procedure differs among VMs but is pretty
simple. Type objdump -i, as above, to verify that your toolchain is
now set up. You will do your work inside the VM.
I can see how one could read that and not see the answer.
After the virtual machine is installed, download the Ubuntu Desktop .iso. Install that into the VM and fire it up. Presumably the Desktop will provide a clear mechanism for loading your OS. (Wait, I'm giving it a try. Will update with the result.)
Turns out that is simply a Ubuntu client desktop, and isn't anything special for running a sub-operating system.
Looking around some more, I found the commentary to be the best potential clue. It contains this (head scratcher) phrase:
To run xv6, install the QEMU PC simulators. To run in QEMU, run "make qemu".
If only it specified the context to get to that point! (Sorry I am not more help.)
I see that you want to boot it on VirtualBox or VMware, but another option would be to using docker to run xv6. A great guide for getting started with xv6 through docker is here.
The full guide is elaborate and can help you with getting started.
It is an alternative option, but one that can get you going fast hopefully.
It will only take 4 steps to get going with the xv6:
Step 1
Download and set up docker here
Step 2
- Run this command in PowerShell or bash to pull the ubuntu image with xv6 docker pull grantbot/xv6
Step 3
- To run the docker image and get going with xv6 run this command docker run -it grantbot/xv6
Step 4
- Now inside the shell in the ubuntu image run cd /home/a/xv6-public/ to enter the root folder of the xv6.
Done
- Now you can compile and run the xv6 with make qemu-nox
Step 1.Compile xv6
Download the code, unzip it and enter the directory, compile the operating system image and root file system, the command is as follows:
make xv6.img&&make fs.img
Step 2. Write image to disk
Create two disks in a existed vmware virtual machine(my vmware version is 15.2.2, linux version is Centos7.8), the operation steps are: virtual machine settings -> add -> disk -> SCSI -> create a new virtual disk -> size 0.005 (allocate immediately, single file) -> name the disk "os", which means this disk is the operating system.
Create another disk named "fs" in the same way to put the root file system.
At this time, there should be "sdb" and "sdc" in the /dev/ directory (sda is the current operating system itself). If you do not see the "sdb" and "sdc", restart the guest operating system.
Write the operating system and root file system to the disk with the following command:
dd if=./xv6.img of=/dev/sdb bs=4k count=1000
dd if=./fs.img of=/dev/sdc bs=4k count=1000
shutdown the current virtual machine to ensure that the file has sync to the disk. At this time, the two images have been written to the disk, vmware saves the disk as a file, the location is in the directory of the current virtual machine, named os.vmdk, fs.vmdk, the next step will load these two files into the new virtual machine.
Step 3. Create xv6 virtual machine
To create an empty virtual machine, the operation steps are: customize (advanced) -> next -> install the operating system later -> choose other operating system type (choose other versions) -> take the virtual machine name as xv6 (name depend on you) ) -> Then use the default configuration all the way to "Next" to completion.
Right-click the created virtual machine and delete the disk created by default. Add the disk file created in the previous step to the current virtual machine. The operation steps are: add -> "disk" -> ide (note that this is an IDE instead of a SCSI disk, because xv6 reads an IDE format disk) -> use an existing virtual disk -> select the os.vmdk generate in the step 2->complete
Add fs.vmdk in the same way. Note that you must add os.vmdk first. Because os.vmdk is the operating system, it needs to be the first hard disk.
Now, you create a virtual machine which has two disk. one is os disk, another is root file system disk, all is ready.
Start the virtual machine, and the xv6 will start successfully.

Compiling Dolphin emulator beta

Moved from here, because it's about compiling software.
My original problem: I want to play Super Mario Galaxy 2 with another player. But whatever keys I assign to move the cursor, it instead moves it all the way to the corner (or edge) of the screen. Linux theoretically has the ability to have multiple cursors (at least the display system "X" allows it), but from a research it looks like I would have to make major changes to the system to actually use it. And even then I doubt that Dolphin would support it.
My current problem: Relative motion of a cursor from keys is present in the current betas of Dolphin, but I can't get it installed. There are no regular installers for it, instead there are source downloads and this tutorial.
I installed the dependencies, downloaded the beta, created and entered the "Build" directory, but when I try cmake .., I get this output:
-- Detected architecture: x86_64
-- X11 support enabled
-- Xrandr found
-- Found avcodec: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavcodec.so
-- Found avformat: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavformat.so
-- Found avutil: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavutil.so
-- Found swresample: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswresample.so
-- Found swscale: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswscale.so
-- libav/ffmpeg found, enabling AVI frame dumps
-- libevdev/libudev found, enabling evdev controller backend
-- Using named pipes as controller inputs
-- Watching game memory for changes
-- Enabling analytics collection (subject to end-user opt-in)
-- Using static enet from Externals
-- Using static xxhash from Externals
-- Using shared zlib
-- Using static lzo from Externals
-- Using shared libpng
-- Using shared LibUSB
-- Found SFML 2.4 in /usr/include
-- Using shared SFML
-- Using shared miniupnpc
-- Could NOT find MBEDTLS (missing: MBEDTLS_VERSION_OK)
-- Using static mbed TLS from Externals
-- Using shared libcurl
-- Using static DiscordRPC from Externals
-- libsystemd found, enabling traversal server watchdog support
-- Using static gtest from Externals
-- Could NOT find OpenSLES (missing: OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
-- ALSA found, enabling ALSA sound backend
-- PulseAudio found, enabling PulseAudio sound backend
-- BlueZ found, enabling bluetooth support
CMake Error at Source/Core/DolphinQt/CMakeLists.txt:1 (find_package):
Could not find a configuration file for package "Qt5" that is compatible
with requested version "5.9".
The following configuration files were considered but not accepted:
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.7.1
-- Configuring incomplete, errors occurred!
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeOutput.log".
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeError.log".
The output of apt-file search Qt5Config.cmake is:
libaccounts-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/AccountsQt5/AccountsQt5Config.cmake
libphonon4qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/phonon4qt5/Phonon4Qt5Config.cmake
libsignon-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/SignOnQt5/SignOnQt5Config.cmake
libtelepathy-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/TelepathyQt5/TelepathyQt5Config.cmake
qtbase5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake
To be safe I installed all five of these packages. I also installed version 5.10 of Qt5-default from here, later also 5.11. I also installed qtbase5-private-dev, libreadline-dev and tried to install libpolarssl-dev, but the page gave error messages for all four servers (the Taiwanian one just loads forever, the others give 404). Then I tried the Qt installer and selected the latest stable version (5.11 I think) once and 5.9 once.
None of these steps helped, I still get the same output as at the beginning.
Here is a copy of CMakeOutput.log from when I last tried installing: https://pastebin.com/EP5qDGE9
Here is a copy of CMakeError.log from when I last tried installing: https://pastebin.com/9p4Ni0jE
My specs:
Debian 9.5
Cinnamon 3.2.7
Linux Kernel 4.9.0-8-amd64
Installed packages: https://pastebin.com/DeYAvJtu
Many thanks to the user dugan on linuxquestions.org! He solved my problem here.
I just had to install Qt from a different source (I used the Qt installer, as mentioned in the question), to have a different version of it in another location. The reason for that is that many programs on Debian rely on an earlier version of Qt, so just updating it would break a lot, that's also why Synaptic&Co. don't update it.
Then I had to add the binary to the PATH variable, like so:
export PATH=/home/fabian/Qt/5.11.2/gcc_64/bin:$PATH
Then I was able to just install Dolphin beta regularly, like the tutorial says it.

Error -1001 in clGetPlatformIDs Call !

I am trying to start working with OpenCL. I have two NVidia graphics card, I installed "developer driver" as well as SDK from NVidia website. I compiled the demos but when I run
./oclDeviceQuery
I see:
OpenCL SW Info:
Error -1001 in clGetPlatformIDs Call
!!!
How can I fix it? Does it mean my nvidia cards cannot be detected? I am running Ubuntu 10.10 and X server works properly with nvidia driver.
I am pretty sure the problem is not related to file permissions as it doesn't work with sudo either.
In my case I have solved it by installing nvidia-modprobe package available in ubuntu (utopic/multiverse). And the driver itself (v346) was installed from https://launchpad.net/~mamarley/+archive/ubuntu/nvidia
Concretely, I have installed nvidia-opencl-icd-346, nvidia-libopencl1-346, nvidia-346-uvm, nvidia-346 and libcuda1-346. Not sure if they are all needed for OpenCL.
This is a result of not installing the ICD portion of Nvidia's openCL runtime. The ICD profile will instruct your application of the different openCL implementations installed on the system as multiple implementations from different vendors can coexist. Whe your application does not find the ICD information it gives the Error -1001.
Run your program as root. In case of success: you have trouble with cl_khr_icd- extension to load the vendor driver.
If you not running X11, you have to create device files manually or by (boot-)script:
ERROR: clGetPlatformIDs -1001 when running OpenCL code (Linux)
Same problem for me on a Linux system. Solution is to add the user to the video group:
# sudo usermod -aG video your-user-name
Since I just spend a couple of hours on this, I thought I would share:
I got the error because I was connected to the machine per remote desktop (mstsc). On the machine itself everything worked fine.
I have been told that it should work with TeamViewer by the way.
Dont know if you ever solved this problem, but I had the same issue and solved it in this post: ERROR: clGetPlatformIDs -1001 when running OpenCL code (Linux)
Hope it helps!
I have solved it in Ubuntu 13.10 saucy for intel opencl by created link:
sudo ln -s /opt/intel/opencl-1.2-3.2.1.16712/etc/intel64.icd /etc/OpenCL/vendors/nvidia.icd
I just ran into this problem on ubuntu 14.04 and I could not find ANY working answers anywhere online including this thread (though this was the first to show up on google). What ended up working for me was to remove ALL previous nvidia software and then to reinstall it using the .run file provided on the nvidia website. Installing the components through apt-get seems to fail for some reason.
1) Download CUDA .run file: https://developer.nvidia.com/cuda-downloads
2) Purge all previous nvidia packages
sudo apt-get purge nvidia-*
3) Install all run file components (you will likely have to stop X or restart in recovery mode to run this)
sudo sh cuda_X.X.XX_linux.run
This is because OpenCL has the same brain damaged one library per vendor setup that OpenGL has. A likely reason for the -1001 error is that you have compiled with a different library than the linker is trying to dynamically load.
So see if this is the problem run:
$ ldd oclDeviceQuery
...
libOpenCL.so.1 => important path here (0x00007fe2c17fb000)
...
Does the path point towards the NVidia-provided libOpenCL.so.1 file? If it doesn't, you should recompile the program with an -L parameter pointing towards the directory containing NVidia's libOpenCL.so.1. If you can't do that, you can override the linker's path like this:
$ LD_LIBRARY_PATH=/path/to/nvidias/lib ./oclDeviceQuery
For me, I was missing the CUDA OpenCL library, Running sudo apt install cuda-opencl-dev-12-0 solved it.
You should get number of platforms, allocate the memory for platforms, again get this platforms and then create context from this platform. There is good example:
http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71
This might be due to querying clGetPlatformIDs by multiple threads at the same time

Resources