Fail to get exact Centos kernel version - centos

uname -a tells the "kernel version" is 3.10.0
[root#iZbp16uggk8lf3x949ewxiZ ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root#iZbp16uggk8lf3x949ewxiZ ~]# uname -a
Linux iZbp16uggk8lf3x949ewxiZ 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
LINUX_VERSION_CODE also says current kernel version is 3.10.0
[root#iZbp16uggk8lf3x949ewxiZ ~]# grep -rni "LINUX_VERSION_CODE" /usr/include/
/usr/include/linux/version.h:1:#define LINUX_VERSION_CODE 199168
But When I find a kernel function tcp_rtx_synack exist
[root#iZbp16uggk8lf3x949ewxiZ ~]# cat /proc/kallsyms | grep tcp_rtx_synack
ffffffff952a0700 t tcp_rtx_synack.part.26
ffffffff952a0730 T tcp_rtx_synack
ffffffff95721f90 r __ksymtab_tcp_rtx_synack
ffffffff95739e78 r __kcrctab_tcp_rtx_synack
ffffffff95765c36 r __kstrtab_tcp_rtx_synack
3.17 https://elixir.bootlin.com/linux/v3.17/A/ident/tcp_rtx_synack func tcp_rtx_synack exist
3.16 https://elixir.bootlin.com/linux/v3.17/A/ident/tcp_rtx_synack func tcp_rtx_synack not exist
Which means my centos kernel version is at least 3.17 not 3.10
I'm writting the eBPF which need more exact kernel version info because function and data struct are different from each kernel version.
I have buy two VMs on different Cloud provisioner and both VMs show like above.

CentOS, like RHEL, contains backports of various patches (features, fixes, etc.) to older kernel versions. So you can't rely on the kernel version to know which features or functions are available.
Instead, you can either probe for the available features from userspace (e.g., with bpftool feature probe) or use CO-RE to detect it with BTF.

Related

Flutter on Chromebook

I tried to get flutter running on my Lenovo Duet Chromebook. Unfortunately, I got
$ flutter doctor -v
~/apps/flutter/bin/internal/shared.sh: line 228: ~/apps/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
$ uname -a
Linux penguin 5.4.119-14945-gafc97d54f809 #1 SMP PREEMPT Tue Aug 10 21:44:33 PDT 2021 aarch64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
How is it possible to flutter running?
Thank you in advance,

comand "lspci" does not show the the IVSHMEM device

I met a problem when I tried to use IVSHMEM.
Below is the configuration from my side:
vm xml configuration for IVSHMEM device:
<shmem name='ivshmem'>
<model type='ivshmem-plain'/>
<size unit='M'>2</size>
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
</shmem>
after the booting up and I found the qemu commandline ideedly have the device option:
ps aux | grep ivshmem
/usr/bin/qemu-system-x86_64
.......(ignore other options)
-object memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/hostmem,size=4194304,share=yes -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,bus=pcie.0,addr=0x10
lspci command not shown the device.
lshw command indeedly show the device:
*-memory UNCLAIMED
description: RAM memory
product: Inter-VM shared memory
vendor: Red Hat, Inc.
physical id: 10
bus info: pci#0000:00:10.0
version: 01
width: 64 bits
clock: 33MHz (30.3ns)
configuration: latency=0
resources: memory:fcc1c000-fcc1c0ff memory:fdc00000-fdffffff
My host os and gust vm os is ubuntu 20.04 and version is:
uname -a
5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Anything input on this one?
You first need to load the generic driver:
modprobe uio_pci_generic
Then you will see the PCI device.
Afterwards you can load your own kernel module by using
insmod uio_ivshmem.ko
Note that you probably need to build the module first.

Emulating Solaris 10 SPARC on QEMU

I have an old Solaris SPARC application that I'm trying to get running.
I learned from this question that x86 Solaris won't cut it. I recently learned that VM virtualbox can't emulate SPARC architecture. Therefore, I am currently trying to emulate Solaris 10 SPARC using QEMU.
I have acquired a Solaris 10 SPARC iso (sol-10-u11-ga-sparc-dvd.iso) from here.
I have Qemu 3.1.50 installed.
However, when I try to run, it gives me:
C:\Users\xxxx\Documents\CMARPS>"C:\Program Files\qemu\qemu-system-sparc64" -m 512 -cdrom "sol-10-u11-ga-sparc-dvd.iso" -boot d -nographic
OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Feb 15 2019 10:05
Type 'help' for detailed information
Trying cdrom:f...
Not a bootable ELF image
Not a bootable a.out image
Loading FCode image...
Loaded 7420 bytes
entry point is 0x4000
Evaluating FCode...
Evaluating FCode...
Ignoring failed claim for va 1000000 memsz af6d6!
Ignoring failed claim for va 1402000 memsz 4dcc8!
Ignoring failed claim for va 1800000 memsz 510c8!
SunOS Release 5.10 Version Generic_147147-26 64-bit
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
could not find debugger-vocabulary-hook>threads:interpret: exception -13 caught
interpret \ Copyright (c) 1995-1999 by Sun Microsystems, Inc.
\ All rights reserved.
\
\ ident "#(#)data64.fth 1.3 00/07/17 SMI"
hex
only forth also definitions
vocabulary kdbg-words
also kdbg-words definitions
defer p#
defer p!
['] x# is p#
['] x! is p!
8 constant ptrsize
d# 32 constant nbitsminor
h# ffffffff constant maxmin
\
\ Copyright 2008 Sun Microsystems, Inc. All rights reserved.
\ Use is subject to license terms.
\
\ #pragma ident "#(#)kdbg.fth 1.20 08/06/06 SMI"
h# 7ff constant v9bias
h# panic - kernel: no nucleus hblk8 to allocate
EXIT
Trying to boot gives me:
0 > boot
boot Not a Linux kernel image
Not a bootable ELF image
Not a bootable a.out image
Loading FCode image...
Unhandled Exception 0x00000000ffeb6080
PC = 0x00000000ffd27954 NPC = 0x00000000ffd27958
Stopping execution
Either there is something causing a kernel panic or my iso isn't actually booting correctly(?)
I thought that maybe the iso was actually a 32 bit SPARC iso so I tried that:
C:\Users\xxxx\Documents\CMARPS>"C:\Program Files\qemu\qemu-system-sparc" -m 256 -cdrom "sol-10-u11-ga-sparc-dvd.iso" -boot d -nographic
Configuration device id QEMU version 1 machine id 32
Probing SBus slot 0 offset 0
Probing SBus slot 1 offset 0
Probing SBus slot 2 offset 0
Probing SBus slot 3 offset 0
Probing SBus slot 4 offset 0
Probing SBus slot 5 offset 0
Invalid FCode start byte
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Feb 15 2019 10:04
Type 'help' for detailed information
Trying cdrom:d...
Not a bootable ELF image
Not a bootable a.out image
No valid state has been set by load or init-program
0 > boot
boot Trying cdrom:d...
Not a bootable ELF image
Not a bootable a.out image
No valid state has been set by load or init-program
ok
0 >
What am I doing wrong here?
You're trying to run with only 512 mb of RAM:
...qemu-system-sparc64" -m 512 ...
Per the Oracle Solaris 10 1/13 Installation Guide: Planning for Installation and Upgrade page on System Requirements and Recommendations:
For UFS or ZFS root file systems, 1.5 GB is the minimum memory required for installation. However, note that some optional installation features are enabled only when sufficient memory is present. For example, if your system has insufficient memory and you install from a DVD, you install through the Oracle Solaris installation program's text installer, not through the GUI.
The current version of QEMU (I last tested with 4.1) does not support SPARC64 systems well yet. While the instruction set is supported, to run OpenSolaris the rest of the hardware needs to be emulated too. The system emulation code is not finished yet, but I have seen some slow progress on Git.

mongod: error while loading shared libraries: libnetsnmpmibs.so.31: cannot open shared object file: No such file or directory

Sharing below the output of my server info.
[root#HBAPIPUATAP13 mongodb-linux-x86_64-enterprise-rhel70-4.0.1]# uname -a
Linux HBAPIPUATAP13 3.10.0-862.14.4.el7.x86_64 #1 SMP Fri Sep 21 09:07:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root#HBAPIPUATAP13 mongodb-linux-x86_64-enterprise-rhel70-4.0.1]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
The below packages need to be installed before starting mongod process.
yum install cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl libpcap lm_sensors-libs net-snmp net-snmp-agent-libs openldap openssl rpm-libs tcp_wrappers-libs
Ref: https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/

Determine features provided by Unix system - autoconf

I downloaded the autoconf-2.69 from http://ftp.gnu.org/gnu/autoconf and I ran the "autoheader".
After that I copied "AC_CONFIG_HEADER(config.h)" to "configure.in" after the "AC_INIT" line. Ran "autoconf" than again ran "autoheader" and "./configure".
The "configure.h" is generated by it does not give me information about my Unix system.
Am I doing something wrong here?
How can I get information about my Unix system, "Are datalink socket structure are supported?", "Does socket address structure have len field or not?"
Edit: as requested output of uname -a
Linux ubuntu 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux