Check for multiarch on linux/chrome OS? - linux

I'm making a hotfix for AROC on the Chromebook Plux V2 (which has a x86_64 architecture, but no multiarch support) and I want to run a test in his script that checks for it. What command can I use to check for multiarch on a linux x86_64 system?
(Just to reference the original issue) when deploying AROC on that chromebook, the device could not run the i686 busybox binary that the script installs.
The author insists on the i686 binary, because the android containers that he tests deployments on are 32 bit on a host system with multiarch.
My goal is to fix his script and add support for the device I was testing on.
I plan to do this, by checking for multiarch and installing the i686 binary if a 32 bit runtime exists or installing the x86_64 binary if it doesn't. What command can I use to check for multiarch?

you're asking about multilib support, not multiarch.
you can simply check to see if the 32-bit ldso exists: test -e /lib/ld-linux.so.2.

Related

I need a way to change Msys2 configuration to use Arch Linux AUR server mirrors instead of Msys2 ones

Because Msys2 sucks,
as mentioned above, I need to change its default server mirrors to point to Arch Linux Mingw-w64 AUR ones, and make it as the default one.
So when I issue some pacman -S mingw-w64-* it will download the package from Arch Linux Repository and not Msys2.
I need to use Msys2 only as a shell.
Msys2 Minwg-32/64 builds use Dwarf instead of SJLJ as exception model, and this is a very bad choice, because they don't catch exceptions from other DLLs that are built with other tool-chains, and the application will crash (For example Firebird 2).
Arch Linux is smart, and has chosen to use SJLJ as exception model for its Minwg-32/64 builds.
This seems very unlikely to work. pacman for MSYS2 will download Windows PE binaries for your MSYS2 environment. pacman for Arch Linux is going to download Linux ELF binaries. You won't be able to run these on your Windows device.
You may be able to get what you want if you use Windows Subsystem for Linux (WSL).

Arch Linux installation: This kernel requires an x86-64 CPU, but only detected an i686 CPU

I want to install Arch Linux on my old HP Pavilion zv5000 (which should have a Pentium 4 CPU).
I was not sure about which version was right for me, between x86-64 and i686, so I chose the archlinux-2017.03.01-dual.iso file on the download page of one of the Arch Linux mirror sites (for example, this mirror). I tried the "dual" version because I was not able to extract archlinux-bootstrap-2017.03.01-i686.tar.gz nor archlinux-bootstrap-2017.03.01-x86_64.tar.gz.
But now, after I burned the ISO image on a CD, booting from the live CD and trying to install Arch gives me:
This kernel requires an x86-64 CPU, but only detected an i686 CPU.
Unable to boot - please use a kernel appropriate for your CPU.
Why is it impossible to extract the .tar.gz files? I tried from two or three mirrors but trying to extract it with tar xzf gives me write permission errors.
Also, what is the "dual" ISO image really? Maybe my mistake was here.
[*] Yes, I am totally noob :)
I faced the same problem. Actually dual iso means you can choose either 64 or i86 when booting. And it was true until March 2017. Starting from March i686 version is not supported anymore.
When I downloaded iso of 2016 everything worked fine.

make-kpkg not working in Fedora 20

I have been working with Linux kernel, compiling and inserting modules, in my custom kernels. Previously I had Ubuntu where I had been working with my custom kernel and all the commands for compiling and installing kernel worked like a charm once I had installed all the required libraries.
Now I have switched over to Fedora 20, here I want to install my custom kernel and for that I downloaded all possible kernel tools, namely, Kernel Development Kernel Tools these are group installs and other libraries that I downloaded were ia32 libraries (as I am working on 64-bit OS), kernel-devel package. Still I am not able to work with make-kpkg command. It says bash: make-kpkg: command not found....
I googled out and did everything I could.
Can anyone get me out of this trouble?
make-kpkg is a Debian kernel packaging tool. It does not exist on RHEL family distributions, such as Fedora.
Please refer to the Fedora documentation page "Building a custom kernel" for the correct procedure. (I have not reproduced it here as it is rather long, and I'm not sure how far you may have gotten.)
The make-kpkg tool is part of the 'kernel-package' package on Debian systems. It is a Debian tool to produce debian package files. Ubuntu is based on Debian and has this tool. However, Fedora uses a different system to manage packages. So, make-kpkg would not be available on Fedora.

Configure X11R6 source cross-compilation for ARM

I am trying to cross build X11R6.6 for ARM architecture.
I am using Ubuntu 10.04 LTS as the build system. And yes, I do understand X11R6 is pretty much outdated, but its a client requirement.
The target/host is (uname -a) :
Linux freescale 2.6.31-207-g7286c01 #1617 PREEMPT Wed Aug 7 10:45:59 IST 2013 armv5tejl GNU/Linux
The toolchain used :
arm-none-linux-gnueabi-4.1.2 glibc-2.5 nptl-3
The problem is that after make install I can't find any server binaries (X, Xorg, XFree86, Xfbdev, etc.) in the install binaries directory, although there are other binaries getting built & installed (xinit, xclock, twm, xconsole, etc.). Checked the source after build, these server binaries are not getting built.
I am pretty sure it must be something to do with the source configuration (X11R6 build system is a headache...apparently).
The build system consists of different .cf & .def files (site.def, host.def, linux.cf, xf86site.def, etc.) , which we have to edit according to our configuration. I do have a general idea about these, But I have not completely understood all details of it. I ahve enabled Serverbuild options wherever applicable. I have also googled a lot...but haven't found anything solid yet.
So is there any resource/sample tutorial/blog which can guide me as how exactly to configure X11R6 ? Or if anyone has built X11R6 for ARM, or has any suggestions...kindly oblige...thanks.
EDIT:
Very sorry, forgot to mention an important point. The sources wer downloaded through LTIB (Linux Target Image Builder) tool for Freescale. The package name is XFree86-4.4.0. Links follow :
http://bitshrine.org/gpp//XFree86-4.4.0-src-1.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-2.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-3.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-4.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-5.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-6.tgz
http://bitshrine.org/gpp//XFree86-4.4.0-src-7.tgz
EDIT :
LTIB version is 9.1.1 (i think so because ltib script has "App version : 9.1.1"), and it was given by Freescale.
Output of the ./ltib -m listpkgs | grep xorg
xorg-server-1.6.1-2 --------- xorg-server ----------- y -- X11 -- X.Org server

Why doesn't a 32bit .deb package install on 64bit Ubuntu?

My .deb package, built on 32-bit Ubuntu and containing executables compiled with gcc, won't install on the 64-bit version of the OS (the error message says 'Wrong architecture i386'). This is confusing to me because I thought that in general 32-bit software worked on 64-bit hardware, but not vice-versa.
Will it be possible for me to produce a .deb file that I can install on a 64-bit OS, using my 32-bit machine? Is it just a matter of using the appropriate compiler flags to produce the executables (and if so what are they), or is the .deb file itself somehow specific to one processor architecture?
The deb installer is probably refusing to install your package because it was (correctly) labeled with a conflicting Architecture: field. i386 code can be executed on an amd64 machine, but it requires that all the appropriate dependencies (32-bit libraries, etc.) be present. It's better to build separate packages for each architecture.
Yes, you can build for 64-bit on your 32-bit machine. It's called cross-compiling, and it requires that you create a build environment for that purpose. To get started, you might want to look up the dpkg-cross and apt-cross tools.
Alternatively, you can just install a virtual machine running a 64-bit OS, and build for your secondary architecture there.
The architecture is just an option in the config file of debian package. By default it uses those from uname. You can override it but there is an easier way.
In general, most 32-bit programs will run fine on 64-bit. However, unless you have a very old PC, it is also very easy to install a mini 64-bit debian in a virtualbox virtual machine. You probably only need base + build essentials + dev libraries. This will not take a lot of diskspace. If you can spare 2G diskspace, just install a desktop debian.
There are more options to do crosscompilation, with various degrees of automation.
I use the virtualbox method regularly. It is easy and fast.
If you run 64-bit linux making a 32-bit environment is as easy as mkdebootstrap + linux32 + chroot.

Resources