[PATCH] recipe-core/images: Disable LUV_NETCONSOLE parameter by default in luv.cfg
by Gayatri Kammela
LUV_NETCONSOLE in luv.cfg has a default value which meant to
indicate the format of this parameter to be given by user. However, when
this feature is not in use, it complains about netconsole not being
configured and it kind of misleading that luv_netconsole feature is
absolute necessary.
Thus, it makes sense to disable this parameter by default value "none",
leaving the script run only if user provides the netconsole parameters.
luv_netconsole feature can be configured by simply changing the none
to <ipaddress, port> format when the user wishes to use this feature.
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/recipes-core/images/luv-live-image.bb | 2 +-
meta-luv/recipes-core/images/luv-netboot-image.bb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta-luv/recipes-core/images/luv-live-image.bb b/meta-luv/recipes-core/images/luv-live-image.bb
index f39b4319857e..957ad7a0f67e 100644
--- a/meta-luv/recipes-core/images/luv-live-image.bb
+++ b/meta-luv/recipes-core/images/luv-live-image.bb
@@ -30,7 +30,7 @@ CMDLINE_append_aarch64 = " acpi=on"
CMDLINE_append_x86 = "${COMMON_CMDLINE_x86}"
CMDLINE_append_x86-64 = "${COMMON_CMDLINE_x86}"
-LUVCFG_netconsole = "LUV_NETCONSOLE=10.11.12.13,64001"
+LUVCFG_netconsole = "LUV_NETCONSOLE=none"
LUVCFG_storage_url = "LUV_STORAGE_URL=none"
python() {
diff --git a/meta-luv/recipes-core/images/luv-netboot-image.bb b/meta-luv/recipes-core/images/luv-netboot-image.bb
index 84f3883dc82b..351441efcb9e 100644
--- a/meta-luv/recipes-core/images/luv-netboot-image.bb
+++ b/meta-luv/recipes-core/images/luv-netboot-image.bb
@@ -32,7 +32,7 @@ CMDLINE_append_aarch64 = " acpi=on"
CMDLINE_append_x86 = "${COMMON_CMDLINE_x86}"
CMDLINE_append_x86-64 = "${COMMON_CMDLINE_x86}"
-LUVCFG_netconsole = "LUV_NETCONSOLE=10.11.12.13,64001"
+LUVCFG_netconsole = "LUV_NETCONSOLE=none"
LUVCFG_storage_url = "LUV_STORAGE_URL=none"
HDDDIR = "${S}/hddimg"
--
2.7.4
5 years, 2 months
[RESULTS] [2.1-rc1] Dell Inspiron 14R 5420, A19
by Mateus Rodrigues Costa
So, I discovered about this project in 2014 and sent some results of it for
my laptop at that time.
Today, I remembered about it and decided to test luv again and send the new
results.
The results are from a Dell Inspiron 14R 5420, BIOS version is A19 (same
laptop as before).
luv version is 2.1-rc1.
The Legacy Boot Option to load from the USB device didn't work this time
too (got a Operating System Not Found message), Matt Fleming did send me a
fix for that when I reported this a long time ago, which I'm not sure if I
tested. So, I had to manually add a UEFI boot option again.
Thanks,
Mateus Rodrigues Costa
5 years, 2 months
[v1 PATCH 0/3] Automate retrieval of Linux defconfig
by Naresh Bhat
The set of patches fix the issue github.com/01org/luv-yocto/issues/116
The first patch use KBUILD_DEFCONFIG variable to set default kernel
defconfig from kernel source path arch/TARGET_ARCH/config
Other 2 patches remove the x86, arm64 defconfig which were created/copied
manually under file/arch directory.
I did a build for x86/x86-64 and ARM64 architectures and tested for ARM64.
You can clone and extract the patches from below git repository link
https://git.linaro.org/people/naresh.bhat/luvOS/luv-yocto.git/log/?h=issu...
Changes v0->v1
* Set KBUILD_DEFCONFIG variable for x86/x86-64 and remove defconfig.
* Remove kernel-yocto.bbclass changes.
* Add do_kernel_configme_append() function in yocto linux kernel recipe
to merge kernel fragments.
Naresh Bhat (3):
linux-yocto-efi-test: Automate retrieval of Linux defconfig
linux-yocto-efi-test: Remove ARM64 defconfig
linux-yocto-efi-test: Remove x86/x86-64 defconfig
.../linux/linux-yocto-efi-test/qemuarm64/defconfig | 519 ---
.../linux-yocto-efi-test/qemux86-64/defconfig | 4148 --------------------
.../linux/linux-yocto-efi-test/qemux86/defconfig | 4114 -------------------
.../linux/linux-yocto-efi-test_4.10.bb | 26 +-
4 files changed, 20 insertions(+), 8787 deletions(-)
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemuarm64/defconfig
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemux86-64/defconfig
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemux86/defconfig
--
1.7.9.5
5 years, 2 months
[PATCH v4 2/2] README: Update README for netconsole usage in Bits
by Gayatri Kammela
Usage of netconsole in LUV varies from Bits. Update README
accordingly.
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/README | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/meta-luv/README b/meta-luv/README
index 59a00d63b2e4..694d29240a68 100644
--- a/meta-luv/README
+++ b/meta-luv/README
@@ -168,6 +168,21 @@ that are being sent:
example:
$ netcat -l -u 64001
+Usage in Bits
+------------
+Implementation of luv_netconsole in BITS helps us capture the BITS log, thus
+achieving fully automated network debugging support in LUV. However, the usage
+of netconsole in BITS varies slightly as luv-netconsole in LUV provides the
+support by sending the messages via UDP, whereas BITS only
+supports sending the debug info via TCP socket.
+
+on the remote machine, use netcat as usual and since UDP is not supported, get
+rid of '-u' option.
+
+ $ netcat -l <port number> (or) nc -l <port number>
+example:
+ $ netcat -l 64001
+
Steps on how to get IP address and choose port number
-----------------------------------------------------
On your terminal do
--
2.7.4
5 years, 2 months
[PATCH v4 1/2] bits_git.bb: Add patch that enables network debug in BITS
by Gayatri Kammela
Include a patch that enables the debugging via network feature using
TCP/IP protocol in the bits recipe.
The luv_netconsole feature is utilized only to get kernel logs leaving
BITS alone. With this patch, it is possible to collect BITS logs as
well, thus LUV will have fully functional network debugging feature.
The usage of netconsole in BITS is similar to netconsole in luv except,
that BITS does not have UDP support yet.
example(on the remote side): $ netcat -l <port number>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
Changes since v3:
1)Initilaized/imported netconsole module before importing luv so as to capture
every time stamp on the remote side.
2) Updated the README according to the comments
Changes since v2:
1)Renamed and modified luv_netconsole_log.py to be more readable
Changes since v1:
1) Included the patch that actually enables the netconsole in bits in one single patch.
2) Updated the README to include the steps to use netconsole in bits.
...y-Enable-logging-debugging-in-bits-via-ne.patch | 132 +++++++++++++++++++++
meta-luv/recipes-bsp/bits/bits_git.bb | 1 +
2 files changed, 133 insertions(+)
create mode 100644 meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
diff --git a/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch b/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
new file mode 100644
index 000000000000..aab1274da544
--- /dev/null
+++ b/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
@@ -0,0 +1,132 @@
+From 8c712a8e7a777a14437dbe813f1269694e5c7ee4 Mon Sep 17 00:00:00 2001
+From: Gayatri Kammela <gayatri.kammela(a)intel.com>
+Date: Fri, 12 May 2017 14:27:39 -0700
+Subject: [PATCH] Bits-init.py: Enable logging/debugging in bits via network
+
+BITS has socket module implemented, with which the host machine(where
+the BITS testsuite is running) can now, able to communicate with the
+remote machine via TCP/IP protocol.
+
+Leveraging the feature of communication with the remote machine for our
+debugging purposes can be useful especially, when there is no serial
+cable available.
+
+Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
+---
+ python/init.py | 1 +
+ python/luv_netconsole_log.py | 91 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 92 insertions(+)
+ create mode 100644 python/luv_netconsole_log.py
+
+diff --git a/python/init.py b/python/init.py
+index bcd147bdbbdf..ea408b48d41c 100644
+--- a/python/init.py
++++ b/python/init.py
+@@ -28,6 +28,7 @@
+
+ """Python initialization, to run at BITS startup."""
+
++import luv_netconsole_log
+ import _bits
+
+ start = _bits._time()
+diff --git a/python/luv_netconsole_log.py b/python/luv_netconsole_log.py
+new file mode 100644
+index 000000000000..4f57c90dd20f
+--- /dev/null
++++ b/python/luv_netconsole_log.py
+@@ -0,0 +1,91 @@
++"""
++Copyright(c) 2017 Intel Corporation; author Gayatri Kammela
++
++This module will enable the network logging/debugging via netcat using TCP
++server. To use this feature do $netcat -l <port number> on the remote machine
++
++"""
++
++""" log bits via network."""
++
++import socket
++import re
++import sys
++import redirect
++
++file = "/luv.cfg"
++buffer_stdout = sys.stdout
++""" create a socket to send out the stdout to TCP server """
++sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
++
++def get_netconsole_params():
++ """ read the luv.cfg file and retrieve netconsole parameters """
++ f = open(file, "r")
++ s = f.read()
++ f.close()
++ line = s.split('\n')
++
++ if re.search('LUV_NETCONSOLE=none', s):
++ """ check if luv_netconsole is disabled """
++ return
++
++ for i in line:
++ """ search for the LUV_NETCONSOLE in luv.cfg to retrieve the values """
++ if re.search('LUV_NETCONSOLE=', i):
++ p = i.split('=',1)[1]
++ break
++
++ return p
++
++def check_valid_params(p):
++ """ check if the retrieved parameters are valid """
++ ipaddress = p.split(',',1)[0]
++ """ check if the ip address is valid using inet_aton() """
++ try:
++ socket.inet_aton(ipaddress)
++ """ if valid ipaddress then timeout for 10 seconds """
++ sock.settimeout(10)
++ print ("Waiting for user to listen to BITS in remote server ..."
++ " 10 seconds remaining .. use netcat -l <port> ")
++ except socket.error:
++ print("no valid ipaddress is given, provide a valid one!")
++
++ port_num = p.split(',',1)[1]
++ """ check if the given port is an integer and if it is valid/unreserved """
++ if (len(port_num) >= 4):
++ try:
++ port = int(p.split(',',1)[1])
++ except ValueError:
++ print ("invalid port number!")
++ else:
++ print("Port number should be intergers, not characters!")
++
++ return ipaddress, port
++
++def establish_connection(ipaddress, port):
++ """ check if the remote is able to connect to the host using ipaddress """
++ try:
++ check_remote = socket.gethostbyname( ipaddress )
++ """ connect to the remote server using the ipaddress and port given """
++ sock.connect((check_remote, port))
++ """ Send a note to the remote machine that netconsole has started """
++ sock.send("Starting BITS ...\n")
++ """ create a file at the socket using makefile() and tee the stdout """
++ """ to the file. makefile() accepts arguments just like open() """
++ """ makefile([mode, [bufsize]]) -- return a file object for the"""
++ """ socket [*] - from _socket.py module"""
++ file = sock.makefile('w', 0)
++ sys.stdout = redirect.Tee(buffer_stdout, file)
++ except socket.error:
++ sock.close()
++ print ("Could not connect to the remote machine! "
++ "Please verify the connectivity on both sides")
++
++def enable_netconsole():
++ """ enable the netconsole in bits """
++ p = get_netconsole_params()
++ if p :
++ ipaddress, port = check_valid_params(p)
++ establish_connection(ipaddress, port)
++
++enable_netconsole()
+--
+2.7.4
+
diff --git a/meta-luv/recipes-bsp/bits/bits_git.bb b/meta-luv/recipes-bsp/bits/bits_git.bb
index cd4e261c9984..b847567201f9 100644
--- a/meta-luv/recipes-bsp/bits/bits_git.bb
+++ b/meta-luv/recipes-bsp/bits/bits_git.bb
@@ -51,6 +51,7 @@ SRC_URI = "gitsm://github.com/biosbits/bits.git;protocol=http \
file://luv-test-bits \
file://luv-parser-bits \
file://0001-only-output-to-log.patch;apply=no \
+ file://Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch \
"
S = "${WORKDIR}/git"
--
2.7.4
5 years, 2 months
[PATCH] fwts: bump to v17.05.00
by Gayatri Kammela
Update FWTS to version v17.05.00
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/recipes-core/fwts/fwts_git.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta-luv/recipes-core/fwts/fwts_git.bb b/meta-luv/recipes-core/fwts/fwts_git.bb
index fd8a8f882fad..54a5893c84a3 100644
--- a/meta-luv/recipes-core/fwts/fwts_git.bb
+++ b/meta-luv/recipes-core/fwts/fwts_git.bb
@@ -4,9 +4,9 @@ HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"
-PV = "V17.03.00+git${SRCPV}"
+PV = "V17.05.00+git${SRCPV}"
-SRCREV = "e3e9d1442b4cc70f5b30199f584cec8e25aeaad4"
+SRCREV = "f4d8710dc55923de438fba912addea14bf5449ee"
SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \
file://luv-parser-fwts \
"
--
2.7.4
5 years, 2 months
Firmware Test Suite 17.05.00 is released
by ivanhu
FWTS 17.05.00 is released.
It is available from:
Tar: http://fwts.ubuntu.com/release/fwts-V17.05.00.tar.gz
PPA:
https://launchpad.net/~firmware-testing-team/+archive/ubuntu/ppa-fwts-stable
Release notes:
https://wiki.ubuntu.com/FirmwareTestSuite/ReleaseNotes/17.05.00
= New Features =
* Support SMBIOS 3.1.1 tests
* dmi: dmicheck: check new offset in spec 3.11
* dmi: dmicheck: check reserved bits of Type 7 offset 0x5
* dmi: dmicheck: check reserved bits of Type 7 offset 0xd
* dmi: dmicheck: add a function to verify reserved bits
* dmi: dmicheck: add a helper function to check word min/max value
* dmi: dmicheck: check pci(e) slot and segment, bus and dev/func
* dmi: dmicheck: check reserved bits of offset 0x5 in type 13
* dmi: dmicheck: add a helper function to check a reserved offset
* dmi: dmicheck: check reserved bits in type 15 & type 17
* dmi: dmicheck: check reserved fields in type 22, 23, 30, 32, 38 and 39
* dmi: dmicheck: add 64-bit integer to dmi_reserved_bits_check
* dmi: dmicheck: add checks for new type 43
* dmi: dmicheck: check reserved bits in Type 0
* fwts/opal: Power management DT Validation tests.
* fwts/opal: Reserved memory DT validation tests.
* Add snapcraft rules to build a fwts snap
= Fixed Bugs =
* acpi: method: make _PTS & _WAK optional
* dmi: dmicheck: add type 9 to dmi_used_by_kernel_table
* dmi: dmicheck: fix a typo in a type 15's error message
* klog.json: remove unnecessary comma and trailing spaces
* klog.json: add an ACPI warning message "SysmtemMemory conflicts
* acpi: method: check _WAK & _PTS for supported sleep states only
* dmi: dmicheck: type 22 offset 9 is an enum from 1 to 8
* lib: fwts_pm_method: clean up formatting and remove extraneous log
message
* acpi: gpedump: fix spelling mistake
* acpica: add some extra run time verification to FACP (FADT)
* lib: fwts_acpi_tables: Add extra fix-up for FACS and DSDT table
addresses
* acpi: wmi: add and re-order WMI GUIDs
* lib: fwts_pipeio: fix incorrect size of command being passed
* lib: fwts_summary: move statement into previous if block
* lib: fwts_stringextras: free original string on failed realloc
* compiler: fwts_iasl_interface: free original string on failed realloc
* uefi: uefidump: free original string on failed realloc
* kernelscan: ensure parse_kernel_message returns PARSER_OK
* lib: fwts_gpe: free original gpe buffer on failed realloc
* lib: fwts_cpu: The string "flags" is 5 chars, fix incorrect strncmp
size
* dmi: dmicheck: remove redundant check on boolean advice_given
* acpi: einj: fix incorrect addition on cast
* lib: fwts_log: fix spelling mistake on LOG_UNKOWN_FIELD
* lib: fwts_log: add LOG_NO_FIELD and use this to indicate an unfound
field
* debian/control: Update description, fwts no longer is just for x86
systems
* lib: fwts_gpe: fix double free on gpe buffer
* opal: prd_info: NULLify output after free
* debian/control: update standards version to 3.9.8
* debian/control: remove ${shlibs:Depends} for fwts-frontend and
fwts-efi-runtime-dkms
* acpi: method: work around some gcc madness (LP: #1687056)
* Reduce the sysfs path to 2K to work around a gcc warning
* data: klog.json: make missing EINJ table message an INFO message
* cpu: cpufreq: make small one-line helper functions inline
* Snapcraft: fix typo in path
* debian: fwts.install: add missing olog.json file
* debian: changelog: fix some debian warnings
* New script to generate a Debian orig tarball from source
* data: klog.json: Fix spelling mistake "cound" -> "could"
* opal: reserve_mem: fix 32 bit build issues
* lib: fwts_acpi_tables: remove dead assignment of facs
* acpica/fwts_acpica: remove debug message on FADT/FACS
* acpica/fwts_acpica: cast to uintptr_t before casting to
ACPI_PHYSICAL_ADDRESS
* uefi: securebootcert: warnings for secure boot variables not exist
instead of failures
* uefi: securebootcert: specify the failure reason for the variable
not found
* README: Fix missing libfdt-dev dependency in README
= Detail Changelog =
To check /usr/share/doc/fwts/changelog.Debian.gz or
fwts_17.05.00-0ubuntu1.debian.tar.gz from
https://launchpad.net/ubuntu/+source/fwts
5 years, 2 months
[v0 PATCH 0/3] Automate retrieval of Linux defconfig
by Naresh Bhat
The set of patches fix the issue github.com/01org/luv-yocto/issues/116
2 patches(first and last) remove the defconfig and one patch to automate retrieval of
linux defconfig from kernel source path arch/TARGET_ARCH/config/
I have't build or tested for x86/x86-64 architecture. I am assuming it should work
without any issues. Can you guys have a look into it and test the same for x86/x86-64 ?
You can clone and extract the patches from below git repository link
https://git.linaro.org/people/naresh.bhat/luvOS/luv-yocto.git/log/?h=next
Naresh Bhat (3):
linux-yocto-efi-test: Remove ARM64 defconfig
linux-yocto-efi-test: Automate retrieval of Linux defconfig
linux-yocto-efi-test: Remove x86/x86-64 defconfig
.../linux/linux-yocto-efi-test/qemuarm64/defconfig | 519 ---
.../linux-yocto-efi-test/qemux86-64/defconfig | 4148 --------------------
.../linux/linux-yocto-efi-test/qemux86/defconfig | 4114 -------------------
.../linux/linux-yocto-efi-test_4.10.bb | 16 +-
meta/classes/kernel-yocto.bbclass | 2 +-
5 files changed, 11 insertions(+), 8788 deletions(-)
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemuarm64/defconfig
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemux86-64/defconfig
delete mode 100644 meta-luv/recipes-kernel/linux/linux-yocto-efi-test/qemux86/defconfig
--
1.7.9.5
5 years, 3 months
[PATCH] pmtools: Add recipe for pmtools, so that we get acpidump working
by Sai Praneeth Prakhya
From: Sai Praneeth <sai.praneeth.prakhya(a)intel.com>
LUV runs FWTS and usually FWTS reports numerous failures related to
ACPI. To debug these failures, a BIOS engineer will most probably want
to look at contents in the ACPI tables and hence we should support
acpidump tool. "acpidump", dumps a system's ACPI tables to an ASCII file
and typically this ASCII acpidump output is converted to raw binary
tables using "acpixtract". Both these tools are part of pmtools, so
let's include pmtools in LUV.
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya(a)intel.com>
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
---
.../images/core-image-efi-initramfs.bb | 2 +-
meta-luv/recipes-core/pmtools/pmtools-git.bb | 33 ++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 meta-luv/recipes-core/pmtools/pmtools-git.bb
diff --git a/meta-luv/recipes-core/images/core-image-efi-initramfs.bb b/meta-luv/recipes-core/images/core-image-efi-initramfs.bb
index 82a9cb881c1f..e020964af955 100644
--- a/meta-luv/recipes-core/images/core-image-efi-initramfs.bb
+++ b/meta-luv/recipes-core/images/core-image-efi-initramfs.bb
@@ -7,7 +7,7 @@ IMAGE_INSTALL = "\
luv-test-crash luv-test-netconsole luv-test keymaps \
kernel-image fwts bash coreutils gawk grep util-linux-agetty \
util-linux-mount util-linux-umount kmod sed tar net-tools \
- shadow util-linux procps efivarfs-test \
+ shadow util-linux procps efivarfs-test pmtools \
plymouth plymouth-set-default-theme kernel-efi-warnings linux-firmware kexec \
"
diff --git a/meta-luv/recipes-core/pmtools/pmtools-git.bb b/meta-luv/recipes-core/pmtools/pmtools-git.bb
new file mode 100644
index 000000000000..3764d8f4c2c8
--- /dev/null
+++ b/meta-luv/recipes-core/pmtools/pmtools-git.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Collection of power management test and investigation tools"
+
+DESCRIPTION = "This tool suite consists of \
+1. acpidump: Dumps a system's ACPI tables to an ASCII file. Typically \
+used to dump all the ACPI tables and attach to a bug report for later \
+examination. \
+2. acpixtract: Convert ASCII acpidump output to raw binary tables. \
+3. pmtest: Used by Linux kernel developers to test power management \
+support in their drivers. \
+4. madt: User utility to parse the ACPI MADT. \
+"
+
+HOMEPAGE = "https://github.com/anyc/pmtools"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI = "git://github.com/anyc/pmtools"
+
+SRCREV="3ebe0e54c54061b4c627236cbe35d820de2e1168"
+
+COMPATIBLE_HOST='(i.86|x86_64).*'
+
+S = "${WORKDIR}/git"
+
+do_compile() {
+ oe_runmake
+}
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/pmtools ${D}${bindir}
+}
--
2.1.4
5 years, 3 months
[PATCH v3 1/2] bits_git.bb: Add patch that enables network debug in BITS
by Gayatri Kammela
Include a patch that enables the debugging via network feature using
TCP/IP protocol in the bits recipe.
The testsuites that run after the kernel boots have debug via network
feature(also known as netconsole)already, leaving BITS alone. With this
patch LUV will have fully functional network debugging feature.
The usage of netconsole in BITS is similar to netconsole in luv except,
that BITS does not have UDP support yet.
example(on the remote side): $ netcat -l <port number>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
Changes since v2:
1)Renamed and modified luv_netconsole_log.py to be more readable
Changes since v1:
1) Included the patch that actually enables the netconsole in bits in one single patch.
2) Updated the README to include the steps to use netconsole in bits.
...y-Enable-logging-debugging-in-bits-via-ne.patch | 125 +++++++++++++++++++++
meta-luv/recipes-bsp/bits/bits_git.bb | 1 +
2 files changed, 126 insertions(+)
create mode 100644 meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
diff --git a/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch b/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
new file mode 100644
index 000000000000..218814794ede
--- /dev/null
+++ b/meta-luv/recipes-bsp/bits/bits/Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch
@@ -0,0 +1,125 @@
+From 8338ffd85be0d82231b609b48ee27751a9c8a6da Mon Sep 17 00:00:00 2001
+From: Gayatri Kammela <gayatri.kammela(a)intel.com>
+Date: Wed, 19 Apr 2017 15:21:10 -0700
+Subject: [PATCH] Bits-init.py: Enable logging/debugging in bits via network
+
+BITS has socket module implemented, with which the host machine(where
+the BITS testsuite is running) can now, able to communicate with the
+remote machine via TCP/IP protocol.
+
+Leveraging the feature of communication with the remote machine for our
+debugging purposes can be useful especially, when there is no serial
+cable available.
+
+Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
+---
+ python/init.py | 2 ++
+ python/luv_netconsole_log.py | 83 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 85 insertions(+)
+ create mode 100644 python/luv_netconsole_log.py
+
+diff --git a/python/init.py b/python/init.py
+index b2a97b2ed80b..e2a63c5df0cf 100644
+--- a/python/init.py
++++ b/python/init.py
+@@ -28,6 +28,8 @@
+
+ """Python initialization, to run at BITS startup."""
+
++import luv_netconsole_log
++luv_netconsole_log.enable_netconsole()
+ import _bits
+
+ start = _bits._time()
+diff --git a/python/luv_netconsole_log.py b/python/luv_netconsole_log.py
+new file mode 100644
+index 000000000000..4fe42f015e29
+--- /dev/null
++++ b/python/luv_netconsole_log.py
+@@ -0,0 +1,83 @@
++"""
++Copyright(c) 2017 Intel Corporation; author Gayatri Kammela
++
++This module will enable the network logging/debugging via netcat using TCP
++server. To use this feature do $netcat -l <port number> on the remote machine
++
++"""
++
++""" log bits via network."""
++
++import socket
++import re
++import sys
++import redirect
++
++file = "/luv.cfg"
++buffer_stdout = sys.stdout
++""" create a socket to send out the stdout to TCP server """
++sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
++""" timeout 10 seconds """
++sock.settimeout(10)
++print ("Waiting for user to listen to BITS in remote server ..."
++ " 10 seconds remaining .. use netcat -l <port> ")
++
++def get_netconsole_params():
++ """ read the luv.cfg file and retrieve netconsole parameters """
++ f = open(file, "r")
++ s = f.read()
++ f.close()
++ line = s.split('\n')
++
++ for i in line:
++ """ search for the LUV_NETCONSOLE in luv.cfg to retrieve the values """
++ if re.search('LUV_NETCONSOLE=', i):
++ p = i.split('=',1)[1]
++ break
++
++ return p
++
++def check_valid_params(p):
++ """ check if the retrieved parameters are valid """
++ ipaddress = p.split(',',1)[0]
++ """ check if the ip address is valid using inet_aton() """
++ try:
++ socket.inet_aton(ipaddress)
++ except socket.error:
++ print("no valid ipaddress is given, provide a valid one!")
++
++ port_num = p.split(',',1)[1]
++ """ check if the given port is an integer and if it is valid/unreserved """
++ if (len(port_num) >= 4):
++ try:
++ port = int(p.split(',',1)[1])
++ except ValueError:
++ print ("invalid port number!")
++ else:
++ print("Port number should be intergers, not characters!")
++
++ return ipaddress, port
++
++def check_connection(ipaddress, port):
++ """ check if the remote is able to connect to the host using ipaddress """
++ try:
++ check_remote = socket.gethostbyname( ipaddress )
++ """ connect to the remote server using the ipaddress and port given """
++ sock.connect((check_remote, port))
++ sock.send("Starting BITS ...\n")
++ """ create a file at the socket using makefile() and tee the stdout """
++ """ to the file. makefile() accepts arguments just like open() """
++ """ makefile([mode, [bufsize]]) -- return a file object for the"""
++ """ socket [*] - from _socket.py module"""
++ file = sock.makefile('w', 0)
++ sys.stdout = redirect.Tee(buffer_stdout, file)
++ except socket.error:
++ sock.close()
++ print ("Could not connect to the remote machine! "
++ "Please verify the connectivity on both sides")
++
++def enable_netconsole():
++ """ enable the netconsole in bits """
++ p = get_netconsole_params()
++ ipaddress, port = check_valid_params(p)
++ check_connection(ipaddress, port)
+--
+2.7.4
+
diff --git a/meta-luv/recipes-bsp/bits/bits_git.bb b/meta-luv/recipes-bsp/bits/bits_git.bb
index cd4e261c9984..b847567201f9 100644
--- a/meta-luv/recipes-bsp/bits/bits_git.bb
+++ b/meta-luv/recipes-bsp/bits/bits_git.bb
@@ -51,6 +51,7 @@ SRC_URI = "gitsm://github.com/biosbits/bits.git;protocol=http \
file://luv-test-bits \
file://luv-parser-bits \
file://0001-only-output-to-log.patch;apply=no \
+ file://Bits-init.py-Enable-logging-debugging-in-bits-via-ne.patch \
"
S = "${WORKDIR}/git"
--
2.7.4
5 years, 3 months