rpmbuild Requires(rpmlib) - custom rpm - linux

I was trying to build an rpm of some scripts and settings we would to easily distribute internally. I was able to build an RPM just file with a test file and jboss but when doing it with this set of files I am getting a Requires(rpmlib) error (full output below) ; I've tried searching for any missing dependencies but the files in the folders to be placed in the root doesn't require anything. Any suggestions?
rpmbuild -bb siscripts.spec
Processing files: SIScripts-1-1.noarch
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
perl(File::stat) perl(HTML::Template) perl(MIME::Lite) perl(Net::Ping) perl(String::MkPasswd) perl(Term::ANSIScreen) perl(Term::ReadLine) perl(Unix::PasswdFile) perl(strict)
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/SIScripts-1-1.x86_64
warning: Could not canonicalize hostname: repo.local
Wrote: /root/rpmbuild/RPMS/noarch/SIScripts-1-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.QUQOX3
+ umask 022
+ cd /root/rpmbuild/BUILD
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/SIScripts-1-1.x86_64
+ exit 0

The message
warning: Could not canonicalize hostname: repo.local
just means that the host name could not be looked up.
RPM adds a tag with the host FQDN and a time stamp to every package.
Simply adding an entry in /etc/hosts for "repo.local" will eliminate
the warning.
All the rpm lib dependencies look correct.

Related

How to build libXrender

I get an error when configuring the libXrender package
checking for RENDER... configure: error: Package requirements (x11 renderproto >= 0.9) were not met:
No package 'x11' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables RENDER_CFLAGS
and RENDER_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
my configure is
./configure --prefix=/tmp/instigate-software/gnu_system/3.2/x86_64/
but when I write echo $PKG_CONFIG_PATH I get
/tmp/instigate-software/gnu_system/3.2/x86_64/lib/pkgconfig
this is what is contained in the pkgconfig folder
ls /tmp/instigate-software/gnu_system/3.2/x86_64/lib/pkgconfig/
bigreqsproto.pc freetype2.pc libpng16.pc mpfr.pc recordproto.pc videoproto.pc xcb-proto.pc xcb-sync.pc xcb-xv.pc
binutils.pc gettext.pc libpng.pc ncurses.pc renderproto.pc xau.pc xcb-randr.pc xcb-xevie.pc xcmiscproto.pc
bison.pc glproto.pc libtiff-4.pc pciaccess.pc resourceproto.pc xcb-composite.pc xcb-record.pc xcb-xf86dri.pc xdmcp.pc
compositeproto.pc gmp.pc libxcb.pc pixman-1.pc scrnsaverproto.pc xcb-damage.pc xcb-render.pc xcb-xfixes.pc xextproto.pc
damageproto.pc ice.pc libXdmcp.pc pthread-stubs.pc sigc++-2.0.pc xcb-dpms.pc xcb-res.pc xcb-xinerama.pc xf86driproto.pc
expat.pc inputproto.pc libxml-2.0.pc python-2.7.pc sm.pc xcb-dri2.pc xcb-screensaver.pc xcb-xprint.pc xineramaproto.pc
fixesproto.pc kbproto.pc libxslt.pc python.pc stdc++.pc xcb-glx.pc xcb-shape.pc xcb-xtest.pc xproto.pc
fontsproto.pc libexslt.pc m4.pc randrproto.pc tiff.pc xcb.pc xcb-shm.pc xcb-xvmc.pc zlib.pc
and this is what is contained in the renderproto.pc file
prefix=/tmp/instigate-software/gnu_system/3.2/x86_64
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: RenderProto
Description: Render extension headers
Version: 0.11
Cflags: -I${includedir}
from what can it be ?

Kernel Build Caching/Nondeterminism

I run a CI server which I use to build a custom linux kernel. The CI server is not powerful and has a time limit of 3h per build. To work within this limit, I had the idea to cache kernel builds using ccache. My hope was that I could create a cache once every minor version release and reuse it for the patch releases e.g. I have a cache I made for 4.18 which I want to use for all 4.18.x kernels.
After removing the build timestamps, this works great for the exact kernel version I am building for. For the 4.18 kernel referenced above, building that on the CI gives the following statistics:
$ ccache -s
cache directory
primary config
secondary config (readonly) /etc/ccache.conf
stats zero time Thu Aug 16 14:36:22 2018
cache hit (direct) 17812
cache hit (preprocessed) 38
cache miss 0
cache hit rate 100.00 %
called for link 3
called for preprocessing 29039
unsupported code directive 4
no input file 2207
cleanups performed 0
files in cache 53652
cache size 1.4 GB
max cache size 5.0 GB
Cache hit rate of 100% and an hour to complete the build, fantastic stats and as expected.
Unfortunately, when I try to build 4.18.1, I get
cache directory
primary config
secondary config (readonly) /etc/ccache.conf
stats zero time Thu Aug 16 10:36:22 2018
cache hit (direct) 0
cache hit (preprocessed) 233
cache miss 17658
cache hit rate 1.30 %
called for link 3
called for preprocessing 29039
unsupported code directive 4
no input file 2207
cleanups performed 0
files in cache 90418
cache size 2.4 GB
max cache size 5.0 GB
That's a 1.30% hit rate and the build time reflects this poor performance. That from only a single patch version change.
I would have expected the caching performance to degrade over time but not to this extent, so my only thought is that there is more non-determinism than simply the timestamp. For example, are most/all of the source files including the full kernel version string? My understanding is that something like that would break the caching completely. Is there a way to make the caching work as I'd like it to or is it impossible?
There is include/generated/uapi/linux/version.h header (generated in the top Makefile https://elixir.bootlin.com/linux/v4.16.18/source/Makefile)
which includes exact kernel version as macro:
version_h := include/generated/uapi/linux/version.h
old_version_h := include/linux/version.h
define filechk_version.h
(echo \#define LINUX_VERSION_CODE $(shell \
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
$(version_h): $(srctree)/Makefile FORCE
$(call filechk,version.h)
$(Q)rm -f $(old_version_h)
So, version.h for linux 4.16.18 will be generated like (266258 is (4 << 16) + (16 << 8) + 18 = 0x41012)
#define LINUX_VERSION_CODE 266258
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Later, for example in module building there should be way to read LINUX_VERSION_CODE macro value https://www.tldp.org/LDP/lkmpg/2.4/html/lkmpg.html (4.1.6. Writing Modules for Multiple Kernel Versions)
The way to do this to compare the macro LINUX_VERSION_CODE to the macro KERNEL_VERSION. In version a.b.c of the kernel, the value of this macro would be 2^{16}a+2^{8}b+c. Be aware that this macro is not defined for kernel 2.0.35 and earlier, so if you want to write modules that support really old kernels
How version.h is included? The sample module includes <linux/kernel.h> <linux/module.h> and <linux/modversions.h>, and one of these files probably indirectly includes global version.h. And most or even all kernel sources will include version.h.
When your build timestamps were compared, version.h may be regenerated and disables ccache. When timestamps are ignored, LINUX_VERSION_CODE is same only for exactly same linux kernel version, and it is changed for next patchlevel.
Update: Check gcc -H output of some kernel object compilation, there will be another header with full kernel version macro definition. For example: include/generated/utsrelease.h (UTS_RELEASE macro), include/generated/autoconf.h (CONFIG_VERSION_SIGNATURE).
Or even do gcc -E preprocessing of same kernel object compilation between two patchlevels and compare the generated text. With simplest linux module I have -include ./include/linux/kconfig.h directly in gcc command line, and its includes include/generated/autoconf.h (but this is not visible in -H output, is it bug or feature of gcc?).
https://patchwork.kernel.org/patch/9326051/
... because the top Makefile forces to include it with:
-include $(srctree)/include/linux/kconfig.h
It actually does: https://elixir.bootlin.com/linux/v4.16.18/source/Makefile
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := \
-I$(srctree)/arch/$(SRCARCH)/include/uapi \
-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
-I$(srctree)/include/uapi \
-I$(objtree)/include/generated/uapi \
-include $(srctree)/include/linux/kconfig.h
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := \
-I$(srctree)/arch/$(SRCARCH)/include \
-I$(objtree)/arch/$(SRCARCH)/include/generated \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(objtree)/include \
$(USERINCLUDE)
LINUXINCLUDE is exported to env and used in source/scripts/Makefile.lib to define compiler flags https://elixir.bootlin.com/linux/v4.16.18/source/scripts/Makefile.lib
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)

How to put an extra file in the kernel image by yocto

I have a trouble of putting my initramfs.cpio in my kernel image by yocto.
I have two bb files, one is used to build an initramfs, and the other one is used to build a fitimage.
I successful to build the fitimage bundled with my initramfs image.
But it always failed to build a fitImage that has an initramfs.cpio.gz in the /usr directory in the fitImage.
( I mean, I want to see a file named initramfs.cpio in the /usr when I use my fitImage booting to console )
====================================================================
Here are my error message..
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: QA Issue: linux-mine: Files/directories were installed but not shipped in any package:
/usr
/usr/initramfs-mine-qemu.cpio
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
linux-mine: 2 installed and not shipped files. [installed-vs-shipped]
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Fatal QA errors found, failing task.
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/paul/projects/Test/yocto/build/tmp/work/mine-poky-linux-gnueabi/linux-mine/1_4.9.27+gitAUTOINC+d87116e608-r0/temp/log.do_package.26149
ERROR: Task (/home/paul/projects/Test/yocto/yocto-2.2/poky/../meta-mine/recipes-kernel/linux/linux-mine_4.9.bb:do_package) failed with exit code '1'
====================================================================
Here is my kernel image bb file
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
LINUX_VERSION ?= "4.9.27"
SRCREV = "d87116e608e94ad684b5e94d46c892e33b9e2d78"
SRC_URI = "git://local/kernel;protocol=ssh;branch=master"
#FILES_${PN} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#FILES_${PN}-${PV} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#IMAGE_INSTALL = "initramfs-mine"
do_install_append () {
echo "WangPaul : S=[${S}]"
echo "WangPaul : B=[${B}]"
echo "WangPaul : D=[${D}]"
install -d ${D}/usr/
install -m 0444 ${B}/usr/initramfs-mine-${MACHINE_ARCH}.cpio ${D}/usr/
}
====================================================================
Here is my initramfs bb file
LICENSE = "GPLv2"
PACKAGE_INSTALL = "initramfs-live-boot ${VIRTUAL-RUNTIME_base-utils} udev ${ROOTFS_BOOTSTRAP_INSTALL}"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
inherit core-image
====================================================================
I have found similar questions:
Ship extra files in kernel module recipe and
An example of using FILES_${PN}
The way in aboves discussion are not work...
Any information would be appreciate !!
Thanks !!
The error seems to QA issues it means the source is compiled but not adding to rootfs. Add below line to yourkernel-image.bb. it will solve the issue.
FILES_${PN} += "${exec_prefix}/*"
Note: may be In your kernel.bb file you have given wrong format

make oldconfig overwriting value in .config

I'm attempting to compile the linux kernel and use a custom .config file.
So I copy the .config to my folder where the kernel source is, and run "make oldconfig" on the file to see if I'm missing anything. However, it appears that doing so modifies a few of my values back to what they were before I edited them:
< CONFIG_TRACEPOINTS=y
---
> CONFIG_TRACEPOINTS=n
< # CONFIG_DEBUG_RODATA is not set
< # CONFIG_DEBUG_SET_MODULE_RONX is not set
---
> CONFIG_DEBUG_RODATA=n
> CONFIG_DEBUG_SET_MODULE_RONX=n
How can I get oldconfig to keep the values as they were modified?
Thanks
Usually kernel config options are dependent on other config options. So even if you disable one config option, as its enabled by some other config option it will fall back to its original value after you do make oldconfig
In case of CONFIG_TRACEPOINTS it depends on or set by several other flags TRACING [=y] || BLK_DEV_IO_TRACE [=y] && TRACING_SUPPORT [=y] && FTRACE [=y] && SYSFS [=y] && BLOCK [=y]
Try setting one by one of them to =n along with CONFIG_TRACEPOINTS=n and see if its persistent after doing make oldconfig. For me setting CONFIG_FTRACE=n worked
How to find dependency. Run make menuconfig. Press / to search the config option and see the Selected by. Those are the config flags who are also setting your config option. See their current value next to them. For e.g. above you can see that TRACING_SUPPORT is set to y

freebsd customized port tree can not build ports from category level

Freebsd 9.1 RC3
just for clarification first: the top level is at /usr/ports, the category level is at /usr/ports/devel
I am working on customized ports tree. Basically, just trim the original whole ports tree to what we need. And, for the most part, it is the same, like GIDs, UIDs, Mk/, Tools/, Templates, and in term of Makefile, I just change SUBDIR to what we need.
General Problem: for each individual ports, like running 'make install clean' at /usr/ports/devel/protobuf, everything works. But, the thing is that running 'make install clean' at category level, it breaks.
Actual Problem:
run 'make install clean -DBATCH' at usr/ports/devel
....
Usage: ./help2man.h2m.PL [--quiet] [--stdout|--output=FILE] [--locale=STRING] [--message-
dir=DIR]
gmake[1]: *** [help2man.el.h2m] Error 255
gmake[1]: Leaving directory `/usr/ports/misc/help2man/work/help2man-1.40.12'
Option include requires an argument
`help2man' generates a man page out of `--help' and `--version' output.
Usage: help2man [OPTION]... EXECUTABLE
-n, --name=STRING description for the NAME paragraph
-s, --section=SECTION section number for manual page (1, 6, 8)
-m, --manual=TEXT name of manual (User Commands, ...)
-S, --source=TEXT source of program (FSF, Debian, ...)
-L, --locale=STRING select locale (default "C")
-i, --include=FILE include material from `FILE'
-I, --opt-include=FILE include material from `FILE' if it exists
-o, --output=FILE send output to `FILE'
-p, --info-page=TEXT name of Texinfo manual
-N, --no-info suppress pointer to Texinfo manual
-l, --libtool exclude the `lt-' from the program name
--help print this help, then exit
--version print version number, then exit
EXECUTABLE should accept `--help' and `--version' options and produce output on
stdout although alternatives may be specified using:
-h, --help-option=STRING help option string
-v, --version-option=STRING version option string
--version-string=STRING version string
--no-discard-stderr include stderr when parsing option output
Report bugs to <bug-help2man#gnu.org>.
gmake: *** [help2man.el.1] Error 255
*** [do-build] Error code 1
Stop in /usr/ports/misc/help2man.
*** [/usr/ports/misc/help2man/work/.build_done.help2man._usr_local] Error code 1
Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/autoconf.
*** [/usr/ports/devel/autoconf/work/.configure_done.autoconf._usr_local] Error code 1
Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/automake.
*** [/usr/ports/devel/automake/work/.configure_done.automake._usr_local] Error code 1
Stop in /usr/ports/devel/automake.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/apr1.
*** [/usr/ports/devel/apr1/work/.configure_done.apr._usr_local] Error code 1
Stop in /usr/ports/devel/apr1.
*** [_apr1.realinstall] Error code 1
Stop in /usr/ports/devel.
structure of customized ports tree
# ls
GIDs Tools distfiles net xxxxxxxxxx x11-fonts KNOBS UIDs doc net-mgmt print Makefile bin graphics xxxxxxx security Makefile.inc converters xxxx.sh xxxxxxxxx textproc Mk databases lang xxxxxxxxx www Templates devel misc xxxxxxxxxxxx x11
# ls devel
autoconf-wrapper libevent makedepend py-asn1 py-setuptools automake libltdl p5-Locale-gettext py-asn1-modules swig13 Makefile automake-wrapper libpthread-stubs pcre py-dateutil zmq apr1 gettext libtool pkgconf py-protobuf autoconf gmake m4 protobuf py-pyzmq
By referring http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
Note: You can build all the ports in a category or as a whole by running make in the top level directory, just like the aforementioned make fetch method. This is dangerous, however, as some ports cannot co-exist. In other cases, some ports can install two different files with the same filename.
Hope someone can help me out, thanks !
I hope you've resolved this by now. If not, freebsd-ports#freebsd.org or hackers#freebsd.org would be the best places to get answer to such questions.
It looks like at the time the help2man port was out of date/broken. Additionally, when adding or removing categories and directories from ports, you need to edit Mk/bsd.port.mk to update the relevant list.
It's also possible that some ports have dependencies on ports that were removed. You can try running make index and see if it can cleanly build the index or not. This is a good clue on stability of at least default options in ports. (conditional dependencies wont' get tested) Running portlint can also help validate a port and it's dependencies look OK.

Resources