How to build NixOS/nixpkgs manuals? - nix

How to build manuals for NixOS and nixpkgs?
I also get an error sometimes:
error: a 'aarch64-linux' with features {} is required to build '...options.xml.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

For NixOS:
$ nix-build nixos/release.nix -A manualHTML.x86_64-linux
For Nixpkgs:
$ nix-build doc
When building NixOS manual you get an error
error: a 'aarch64-linux' with features {} is required to build '...options.xml.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}
it means you forgot to specify .x86_64-linux attribute.

Related

Issue: Porting Docker to a new platform (Tizen 4.0 + ARM64)

I have been trying to port Docker CE on a new platform (Tizen 4.0 + ARM64) using static binaries as described here
However, even though I meet all the pre-requisites described in above link, I keep getting this error while trying to run docker daemon :
WARN[2018-10-04T14:14:57.890120101+09:00] Running modprobe bridge br_netfilter failed with message: modprobe: WARNING: Module bridge not found in directory /lib/modules/4.9.59-g70b545c-dirty modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/4.9.59-g70b545c-dirty, error: exit status 1
WARN[2018-10-04T14:14:57.905153370+09:00] Running modprobe nf_nat failed with message: modprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.9.59-g70b545c-dirty, error: exit status 1
WARN[2018-10-04T14:14:57.920222485+09:00] Running modprobe xt_conntrack failed with message: modprobe: WARNING: Module xt_conntrack not found in directory /lib/modules/4.9.59-g70b545c-dirty, error: exit status 1
Error starting daemon: Error initializing network controller: Error creating default "bridge" network: package not installed
Is there anyway to fix this?
Otherwise, Is there some alternative way to port docker onto a new platform (In this case: Tizen 4.0 + ARM64).
Key note: The platform uses a linux kernel but doesn't support many typical Linux Platform features like apt-get commands.
Any help would be greatly appreciated. Thanks in advance :)
From your error message, your system is missing a number of networking related kernel modules, from the look of it, it's looking for at least: bridge, br_netfilter, nf_nat, xt_conntrack. You'll need to port these missing kernel modules or recompile the kernel to include the relevant modules.
Docker, by itself, requires a lot of pre-requesites to run on a new platform. Some of them are mentioned here.
Apart from meeting the pre-requisites, one has to meet specific kernel requirements and in case, the kernel doesn't meet all those requirements, one has to patch the kernel accordingly to get the things running.
Here are the kernel defconfigs, one must enable to get docker running -
CONFIG_CGROUP_DEVICE=y, CONFIG_CPUSETS=y, CONFIG_BLK_CGROUP=y, CONFIG_CGROUPS=y, CONFIG_CGROUP_CPUACCT=y, CONFIG_CGROUP_DEVICE=y, CONFIG_CGROUP_FREEZER=y, CONFIG_CGROUP_SCHED=y, - CONFIG_CGROUP_PERF=y, CONFIG_CGROUP_HUGETLB=y, CONFIG_NET_CLS_CGROUP=y, CONFIG_CGROUP_NET_PRIO=y, CONFIG_CFS_BANDWIDTH=y, CONFIG_CGROUP_PIDS=y, CONFIG_BLK_CGROUP=y, CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y, CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y, CONFIG_NETFILTER_XT_MATCH_IPVS=y, CONFIG_NF_NAT_IPV4=y, CONFIG_IP_NF_FILTER=y, CONFIG_IP_NF_TARGET_MASQUERADE=y, CONFIG_IP_NF_NAT=y, CONFIG_NF_NAT=y, CONFIG_NF_NAT_NEEDED=y, CONFIG_POSIX_MQUEUE=y, CONFIG_MEMCG=y, CONFIG_MEMCG_SWAP=y, CONFIG_MEMCG_KMEM=y, CONFIG_MEMCG_SWAP_ENABLED=y, CONFIG_BRIDGE=y, CONFIG_BRIDGE_NETFILTER=y, CONFIG_VXLAN=y, CONFIG_CRYPTO=y, CONFIG_CRYPTO_AEAD=y, CONFIG_CRYPTO_GCM=y, CONFIG_CRYPTO_SEQIV=y, CONFIG_CRYPTO_GHASH=y, CONFIG_XFRM=y, CONFIG_XFRM_USER=y, CONFIG_XFRM_ALGO=y, CONFIG_INET_ESP=y, CONFIG_INET_XFRM_MODE_TRANSPORT=y, CONFIG_IPVLAN=y, CONFIG_MACVLAN=y, CONFIG_DUMMY=y, ": CONFIG_NF_NAT_FTP=y, CONFIG_NF_CONNTRACK_FTP=y, CONFIG_NF_NAT_TFTP=y, CONFIG_NF_CONNTRACK_TFTP=y, CONFIG_OVERLAY_FS=y, CONG_AUFS_FS=y, CONFIG_BTRFS_FS=y, CONFIG_BTRFS_FS_POSIX_ACL=y, CONFIG_BLK_DEV_DM=y, CONFIG_DM_THIN_PROVISIONING=y, CONFIG_NAMESPACES=y, CONFIG_NET_NS=y, CONFIG_PID_NS=y, CONFIG_IPC_NS=y, CONFIG_UTS_NS=y, CONFIG_KEYS=y, CONFIG_VETH=y, CONFIG_USER_NS=y, CONFIG_SECCOMP=y, CONFIG_BLK_DEV_THROTTLING=y, CONFIG_IOSCHED_CFQ=y, CONFIG_CFQ_GROUP_IOSCHED=y, CONFIG_FAIR_GROUP_SCHED=y, CONFIG_RT_GROUP_SCHED=y, CONFIG_IP_VS=y, CONFIG_IP_VS_NFCT=y, CONFIG_IP_VS_RR=y, CONFIG_EXT4_FS=y, CONFIG_EXT4_FS_POSIX_ACL=y, CONFIG_EXT4_FS_SECURITY=y
P.S. - Some of the above defconfigs may not be necessary to get the docker running. However, enabling all of them ensures you have extended support for all the features that docker offers.

How to add do_populate_sdk task to avro-c BitBake recipe?

This question is specific to avro-c, but the solution may be generalized to other packages in the OpenEmbedded BitBake system.
How do I create a do_populate_sdk task for avro-c?
I want to generate a Yocto SDK which includes avro-c. The avro-c layer in meta-openembedded is very small:
avro
├── avro-c
│   └── 0001-avro-c-Fix-build-with-clang-compiler.patch
└── avro-c_1.8.1.bb
The avro-c_1.8.1.bb recipe is only 20 lines:
SUMMARY = "Apache Avro data serialization system."
HOMEPAGE = "http://apr.apache.org/"
SECTION = "libs"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=73bdf70f268f0b3b9c5a83dd7a6f3324"
DEPENDS = "jansson zlib xz"
PV .= "+git${SRCPV}"
SRCREV = "4b3677c32b879e0e7f717eb95f9135ac654da760"
SRC_URI = "git://github.com/apache/avro \
file://0001-avro-c-Fix-build-with-clang-compiler.patch;patchdir=../../ \
"
S = "${WORKDIR}/git/lang/c"
LDFLAGS_append_libc-uclibc = " -lm"
inherit cmake
A target image which includes avro-c builds successfully, and ls /usr/bin/avro* lists the Avro functions.
However, avro-c is not included in the host SDK build. One way to troubleshoot this is to try the two commands:
$ bitbake avro-c
$ bitbake avro-c -c populate_sdk
The first command completes successfully. The second command fails with the following error messages:
ERROR: Task do_populate_sdk does not exist for target avro-c (/home/rdepew/workspace/clean1/build/../layers/meta-sporian/recipes-support/avro/avro-c_1.8.1.bb:do_populate_sdk). Close matches:
do_populate_lic
do_populate_sysroot
ERROR: Command execution failed: 1
I looked for clues in the other layers in my build system. It appeared that creating the file avro-c_%.bbappend, containing the single line
inherit nativesdk
might do the trick, but that generated two more BitBake error messages:
ERROR: Nothing PROVIDES 'virtual/x86_64-pokysdk-linux-compilerlibs' (but /home/rdepew/workspace/clean1/build/../layers/meta-sporian/recipes-support/avro/avro-c_1.8.1.bb DEPENDS on or otherwise requires it). Close matches:
virtual/nativesdk-x86_64-pokysdk-linux-compilerlibs
virtual/x86_64-pokysdk-linux-go-crosssdk
virtual/x86_64-pokysdk-linux-gcc-crosssdk
ERROR: Required build target 'avro-c' has no buildable providers.
Missing or unbuildable dependency chain was: ['avro-c', 'virtual/x86_64-pokysdk-linux-compilerlibs']
... and that's where I'm stuck. I'm not sure where to go from here.
Online places that I have researched:
I don't know if it's appropriate to list the URLS of places where I have looked for the answer. They include the GitHub repository for Avro, the Yocto Project ADT manual, and four related questions on StackOverflow. If it's appropriate, I will edit this question to include the URLs.
The right way to add something to SDK (or eSDK - Extended SDK) is via the image of your choice. So, the steps are:
Add a package to the image:
IMAGE_INSTALL_append = " avro-c"
Create Yocto SDK for an image of your choice:
bitbake core-image-full-cmdline -c populate_sdk
Create Yocto eSDK for an image of your choice:
bitbake core-image-full-cmdline -c populate_sdk_ext
Have fun! :-)
You need the following line in your recipe
BBCLASSEXTEND = "nativesdk"
This extends the same recipe to build for sdk as well. See here for more details.
EDIT:
do_populate_sdk: This task applies only for the image recipe. This handles two operations.
Target part: Compiles and installs the header and libraries for the target platform.
Host part: Installs the host part of the library and header based on SDKMACHINE
During these operations, it finds the list of packages needed for the SDK by examining the BBCLASSEXTEND variable and builds the nativesdk-<recipe_name> for combines them together in SDK.
So you have do_populate_sdk for image recipe which bundles the packages together.
See yocto manual here for more details.

Unable to clone the repository in git_repository in bazel with ubuntu 15.10

I am trying to compile the following heron branch
https://github.com/twitter/heron/tree/karthik/pexbuild
using bazel 0.3.1 in ubuntu 15.10. In the workspace, I refer to another repo containing the pex bazel rules at
https://github.com/streamlio/bazel_rules_pex
I am getting the following error (interestingly it does not occur in ubuntu14.04, ubuntu16.10, centos7 and mac). Any help will be appreciated?
bazel build --config=ubuntu --verbose_failures heron/...
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'pex/pex_rules.bzl': no such package '#io_bazel_rules_pex//pex': Error cloning repository: https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by the trustAnchors parameter must be non-empty.
There were many fixes and improvements in remote repositories, I'd advice you to upgrade bazel before trying anything else.

Printer on Raspberry pi : Yaourt can't build the driver

I'm trying to use my hp laserjet p1006 printer with my raspberry pi (archlinux, Linus 3.18.9).
I already set up the cups server, I can manage my printer through the web interface, and added my user to sys and lp groups.
I can "install" my printer through this interface, choose a "model" (driver?) amongst hpcups and hpijs (none works).
I can manage my printer, but when I try to print something with it, it ends with a "filter failed" error in my cups interface and my printer doesn't react.
I didn't find a PPD file (on openprinting.org, they say : "PPD files (and the Foomatic XML files to generate them) come with the driver (foo2xqx), therefore we do not supply PPDs here on the OpenPrinting site.").
I tried to install foo2xqx by installing foo2zjs (in which it's included) with yaourt.
I also edited each PKGBUILD to replace the architecture ('i686' or 'x86_64') with 'armv6h'.
But It fails to build and install a dependency : foomatic-db-foo2zjs.
Here is the output of yaourt :
==> ERROR: Failure while creating working copy of foomatic-db-foo2zjs bzr repo
Aborting...
==> ERROR: Makepkg was unable to build foomatic-db-foo2zjs.
I also tried to add more swap but it solved nothing.
What could I do?
Thank you for your help!
EDIT : I tried to add space to /tmp (as this tutorial explains : http://www.boxtutorials.com/how-to-increase-the-size-of-disk-space-tmp-usrtmpdsk-partition-in-linux-server.html) and it went further.
But I still have an issue :
If I try to build the package with yaourt :
I got an error with the PKGBUILD file :
pkgname=foomatic-db-foo2zjs
arch=('i686' 'x86_64' 'armv6h')
_snapdate=20141011
pkgver=${_snapdate}
pkgrel=1
epoch=3
license=('GPL' 'custom')
pkgdesc="Foomatic - The collected knowledge about printers, drivers, and driver options in XML files, used by foomat\
ic-db-engine to generate PPD files. Rebuilt for use with foo2zjs."
depends=('perl' 'libxml2')
conflicts=('foomatic-db-ppd' 'foomatic-db-hpijs' 'foomatic-db' 'foo2zjs-testing')
provides=('foomatic-db-hpijs' 'foomatic-db')
makedepends=('cups' 'perl' 'libxml2' 'enscript' 'perl' 'net-snmp' 'bash' 'bzr')
source=(foomatic-db-foo2zjs::bzr+http://bzr.linuxfoundation.org/openprinting/foomatic/foomatic-db/)
url="http://www.linuxprinting.org/foomatic.html"
md5sums=('SKIP')
package() {
cd ${srcdir}/${pkgname}
bzr revno
echo $pkgver
# here are the problems :
# I tried chmod calls both with and without "sudo"
# chmod 777 ./make_configure
./make_configure
# chmod 777 ./configure
./configure --prefix=/usr
make DESTDIR=${pkgdir} install
install -v -Dm644 ${srcdir}/${pkgname}/COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
# foo2zjs provides different versions of the following files
rm ${pkgdir}/usr/share/foomatic/db/source/driver/foo2hiperc.xml
# some other rm calls
rm ${pkgdir}/usr/share/foomatic/db/source/printer/HP-LaserJet_1005.xml
}
I got the following :
PKGBUILD: line 24: ./make_configure: Permission denied
==> ERROR: A failure occurred in package().
Aborting...
==> ERROR: Makepkg was unable to build foomatic-db-foo2zjs.
I tried to add a call to "sudo chmod" in this file to get permissions but it doesn't work.
And if I try to build myself the package (with makepkg) :
it returns :
-> Creating working copy of foomatic-db-foo2zjs bzr repo...
bzr: ERROR: Not a branch: "/home/vmonteco/build/foomatic-db-foo2zjs/foomatic-db-foo2zjs/.bzr/branch/": location is a repository.
==> ERROR: Failure while creating working copy of foomatic-db-foo2zjs bzr repo
Aborting...
Any idea?
By the way, I also found a tutorial (in French, sorry) that is exactly what I was searching for (same case, same devices, same package...), I put it here in case it could help somebody else, even a non-french speaker with just the commands.
http://www.azurs.net/carnet/2013/09/raspberry-pi-serveur-impression-imprimante-hp-laserjet-p1006/
I'm stuck (see the two errors above) at the two last steps "L’AUR sans peine, mais avec yaourt" ("AUR without troubles, but with yaourt") and "Empaquetage avec makepkg" ("packaging with makepkg"). I tried both but both failed when I tried.
I finally managed to fix it.
I'll recapitulate :
I added swap and made a larger /tmp to get rid off space issues. (The first problem I was encountering)..
But I also had to mount the /tmp without "noexec" option, to permit yaourt to run the PKGBUILD file (as suggested here : https://bbs.archlinux.org/viewtopic.php?id=189625).
I still have an issue (filter failed) with installing my printer with cups with the new drivers, so I'll wait to have a solution for this too before I mark this post as "solved". :)
EDIT:
I finally reinstalled my printer with the hp-setup tool (hp-lip package) and it worked. :)
I hope it could help anybody else!

compile vlc for android

I am trying to compile vlc for android in RHEL 6.4 (Santiago). I am following the instructions given in this page https://wiki.videolan.org/AndroidCompile. I am getting some errors.
First is when I build this, I get error in git.
error: unknown switch `B'. refer http://txt.do/6tjh for log
I changed the git checkout -B android ${TESTED_HASH} to git checkout -b android ${TESTED_HASH}. Then this error does not come
Then when I run sh compile.sh, I get following errors (refer http://tny.cz/bb552912 I have removed some part of log which had code to download packages like automake, protobuf, ragel etc)
rmdir: failed to remove /root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype/config': No such file or directory
make[1]: [install] Error 1 (ignored)
rmdir: failed to remove `/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype': No such file or directory
make[1]: [install] Error 1 (ignored)
Then if I again run sh compile.sh, weird things happen. I don't get this error again, but it builds some library and then stops.
First it build libdvdcss and then stops (refer http://tny.cz/5f3ab58f)
It ends like
Libraries have been installed in:
/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
use the `-Wl,-rpath -Wl,LIBDIR' linker flag
have your system administrator add LIBDIR to `/etc/ld.so.conf'
make[2]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
make[1]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
touch .dvdcss
Then each time I run "sh compile.sh" it build one more library and then stops.
it has build following libraries
libopenjpeg (http://tny.cz/86236e8b)
libgpg-error http://tny.cz/26c5626b)
ffmpeg (http://tny.cz/1f05aa0f)
gmp
libgcrypt
iconv
nettle
libjpeg
Finally I get an following error and I am not able to do any after that (http://tny.cz/ed7798ea)
autopoint: * The AM_GNU_GETTEXT_VERSION declaration in your configure.ac file requires the infrastructure from gettext-0.18 but this version is older. Please upgrade to gettext-0.18 or newer.
autopoint: * Stop.
autoreconf: autopoint failed with exit status: 1
configure.in:20: error: possibly undefined macro: AM_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /root/Documents/android/android/vlc/extras/tools/build/bin/autoconf failed with exit status: 1
make: *[.ogg] Error 1
I am not able to find gettext package with version > .18 for RHEL 6.4. Maximum available is .17 which is installed
Is not this weird. Should not doing "sh compile.sh" build all libraries and I should not have to do this again and again.
Also Is RHEL 6.4 (Santiago) compatible for building vlc android
Any help for these errors

Resources