[PATCH 0/5] Luv: Add netconsole feature
by Gayatri Kammela
Hi,
This is about adding a Linux feature called Netconsole in Linux* UEFI Validation.
In LUV netconsole feature is enabled only for the test suites that run once
the Linux takes control over and BITS test suite will be excluded from
having this kind of support.
Why this feature:
Netconsole in LUV help us debug the kernel panics or system hangs by
sending not only kernel messages but also information regarding the running tests
simultaneously on to the remote machine via ethernet. Now the remote machine can
be on same subnet or different subnet with respective to the local machine
( machine you are trying to boot LUV).
To enable netconsole feature in LUV, changes are made in various files to include
kernel modules like netconsole and different network utilites that can send messages
via ethernet.Besides these changes are made to luv-test-manger to make all the
running tests information sent to dmesg to make the debugging more easy.
How this feature works:
Liberty is given to user to choose the ip address and port number where he/she wants
all messages to sent to. once decided , user can replace the dummy ip address given
in grub.cfg as @,64001@10.11.12.13/ with the destined address and port number.
The same information is mentioned in README file , so that user can get
to know the usage of netconsole.
Requirements for this feature:
Not many changes are required for this feature , except enabling some of the
kernel config options. Luv kernel has config optons enabled that are
obsolutely necessary for the image and to keep the kernel size as low as possible.
Since netconsole require lot of options enabled related to TCP/IP , IPV4 , IPV6 and
filesystem related options. These information can be overwhelming and just for the
sake of clarity some of the important options that needs to enabled are given below
1)CONFIG_NETCONSOLE=m
2)CONFIG_NETCONSOLE_DYNAMIC=y
3)CONFIG_IP_MULTICAST=y
4)CONFIG_NET_IPGRE_BROADCAST=y
5)CONFIG_NET_TEAM_MODE_BROADCAST=y
6)CONFIG_IPVLAN=y
7)CONFIG_NETDEVICES=y
8)CONFIG_ETHERNET=y
9)CONFIG_VT_CONSOLE=y
10)CONFIG_CONFIGFS_FS=y
The rest of the config options which are included in luv kernel will be taken care by Megha Dey
The goal of this feature is to help us debug the issues we face while booting different
platforms with LUV
Gayatri Kammela (5):
core-image-efi-initramfs.bb: Add network utilites to support
netconsole in LUV
luv-live-image.bb: Kernel parameters for netconsole support
luv: Add a new file 'luv-netconsole' to the initscripts
LUV: initscripts_1.0.bbappend : Create runlevel link for the
luv-netconsole
luv-test-manager : Redirect the test results to the dmesg buffer
.../images/core-image-efi-initramfs.bb | 4 +-
meta-luv/recipes-core/images/luv-live-image.bb | 2 +-
.../initscripts/initscripts/luv-netconsole | 53 ++++++++++++++++++++++
.../initscripts/initscripts/luv-test-manager | 13 +++---
.../initscripts/initscripts_1.0.bbappend | 8 +++-
5 files changed, 70 insertions(+), 10 deletions(-)
create mode 100644 meta-luv/recipes-core/initscripts/initscripts/luv-netconsole
--
1.9.1
6 years, 4 months
[PATCH 4/6] LUV: initscripts_1.0.bbappend : Create runlevel link for the luv-netconsole
by Gayatri Kammela
Modify the initscripts_1.0.bbappend to include the luv-netconsole
file and then create a runlevel link for it.
By creating runlevel link , luv-netconsole will show up as one of the
start up scripts and runs at all levels ( 2, 3, 4, 5). Running
luv-netconsole at all levels will help netconsole to capture messages
generated at all levels and sends them to a remote machine so that user
will not miss any important detail of it
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/recipes-core/initscripts/initscripts_1.0.bbappend | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meta-luv/recipes-core/initscripts/initscripts_1.0.bbappend b/meta-luv/recipes-core/initscripts/initscripts_1.0.bbappend
index 871fadb3e483..79f24926771b 100644
--- a/meta-luv/recipes-core/initscripts/initscripts_1.0.bbappend
+++ b/meta-luv/recipes-core/initscripts/initscripts_1.0.bbappend
@@ -1,7 +1,8 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://luv-test-manager file://luv-test-parser \
- file://luv-crash-handler"
+ file://luv-crash-handler \
+ file://luv-netconsole"
do_install_append() {
install -m 755 ${WORKDIR}/luv-test-manager ${D}${sysconfdir}/init.d/
@@ -19,4 +20,9 @@ do_install_append() {
# Create runlevel link for the crash handler
update-rc.d -r ${D} luv-crash-handler start 98 3 5 .
+
+ install -m 755 ${WORKDIR}/luv-netconsole ${D}${sysconfdir}/init.d/
+
+ # Create runlevel link for the luv-netconsole
+ update-rc.d -r ${D} luv-netconsole start 98 2 3 4 5 .
}
--
1.9.1
6 years, 4 months
[PATCH 6/6] meta-luv- README file: Add information on usage of netconsole in LUV
by Gayatri Kammela
Update the README file to let users aware of the usage of netconsole
feature in LUV.
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/README | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta-luv/README b/meta-luv/README
index b640ee9cadfe..c5bae5eb2831 100644
--- a/meta-luv/README
+++ b/meta-luv/README
@@ -58,3 +58,21 @@ Then it is necessary to specify the luv distribution in local.conf.
e.g.:
DISTRO = "luv"
+
+
+Usage of Netconsole within LUV
+===============================
+
+In order to make use of the netconsole feature that is added in LUV
+user must aware of its usage. Assuming users know how to get ip address and
+port number (typically from 6000 ports are not assigned to specific tasks so
+they can be used) , instructions are given below to follow
+
+Choose the ip address and port number where you want all messages to sent to.
+once decided , you can replace the dummy ip address and port number given
+in grub.cfg as netconsole=@,64001@10.11.12.13/ with the port number and ipaddress
+respectively.
+
+The grub.cfg file is located in boot partition. The location is
+EFI/BOOT/grub.cfg. Edit the file to replace the numbers and notation should be
+preserved for identifying the difference between ipaddress and port number.
--
1.9.1
6 years, 4 months
[PATCH 5/6] luv-test-manager : Redirect the test results to the dmesg buffer
by Gayatri Kammela
Netconsole will only send kernel messages that are in dmesg buffer and
userspace messages are not redirected to the dmesg buffer as they can
be overwhelmingly large
In LUV it would be good to have userspace messages
(messages from running tests) included in dmesg buffer for the sake of
the debugging.
Modify luv-test-manager to redirect the test results to /dev/kmsg
which will inturn inject them back to dmesg buffer. Every test result
will be provided with a timestamp which makes the job of debugging
easy in case of a system hang or panic while booting luv.
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
.../recipes-core/initscripts/initscripts/luv-test-manager | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
index 15deca5feacd..efc340b618af 100644
--- a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
+++ b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
@@ -88,7 +88,7 @@ psplash_write "MSG Running tests..."
luv_version=$(cut -d\\ -f1 /etc/issue)
-cat <<EOF
+cat <<EOF | tee /dev/kmsg
Welcome to ${luv_version}
Running tests...
@@ -116,7 +116,7 @@ mkdir -p ${LUV_LOG_DIR}
psplash_write "PROGRESS 0"
# Begin the results files by stating the version of luv
-cat <<EOF | tee ${LUV_SAVE_RESULTS_DIR}/luv.results > /tmp/luv.results
+cat <<EOF | tee /dev/kmsg | tee ${LUV_SAVE_RESULTS_DIR}/luv.results > /tmp/luv.results
$luv_version
Date and time of the system :$tstamp
@@ -145,17 +145,18 @@ for r in $runner_list; do
$runner | tee ${LUV_LOG_DIR}/$r | tee ${LUV_SAVE_RAW_DIR}/$r | $parser | \
tee ${LUV_SAVE_PARSED_DIR}/$r | ${LUV_PARSER_DIR}/test-manager | \
- tee /dev/console | \
+ tee /dev/console | while read line ; do case $line in *+* ) \
+ echo ' ' $line ;; * ) echo $line ;; esac done | tee /dev/kmsg | \
tee -a /tmp/luv.results | tee -a ${LUV_SAVE_RESULTS_DIR}/luv.results
sync
-done | awk '/ \[\+/ { units += 1 }
- / \[\-/ { suites += 1 }
+done | awk '/+/ { units += 1 }
+ /-/ { suites += 1 }
/pass/ { passes += 1 }
/fail/ { fails += $3 }
/skip/ { skips += 1 }
END {
printf("\nRan %d testsuites and %d unittests, %d passes, %d fails, %d skipped.\n", suites, units, passes, fails, skips)
- }' | tee -a /tmp/luv.results | tee -a ${LUV_SAVE_RESULTS_DIR}/luv.results
+ }' | tee /dev/kmsg | tee -a /tmp/luv.results | tee -a ${LUV_SAVE_RESULTS_DIR}/luv.results
file=${LUV_SAVE_RESULTS_DIR}/luv.results
html=$(echo $file | sed 's/\.results$/\.html/i')
--
1.9.1
6 years, 4 months
[PATCH 3/6] luv: Add a new file 'luv-netconsole' to the initscripts
by Gayatri Kammela
Netconsole is a linux feature that sends the kernel messages
to a remote machine via ethernet. The kernel messages sent over
to remote machine are useful for debugging in case of a kernel
panic.
Netconsole support in luv help debug platforms that luv couldn't
boot. It sends all the information to the remote machine that is
in the ring buffer which includes all kernel messages and luv.results
too. In this way , user can figure out what is causing the hang with
the help of the last message sent along with the timestamp provided
on the remote side
luv-netconsole is capable of sending kernel messages to the remote
machine which belongs to the same subnet and machines that are
not on the same subnet as local machine.
luv-netconsole script is made run at all levels to capture each detail
of the system's boot and continuously sends messages until interrupted
by the user at remote side
luv-netconsole takes the ip address and port number given by the user and
send the kernel messages to the destined ip address provided that remote
machine listens to local machine with the port number given by user
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
.../initscripts/initscripts/luv-netconsole | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 meta-luv/recipes-core/initscripts/initscripts/luv-netconsole
diff --git a/meta-luv/recipes-core/initscripts/initscripts/luv-netconsole b/meta-luv/recipes-core/initscripts/initscripts/luv-netconsole
new file mode 100644
index 000000000000..5bc2a5db0f14
--- /dev/null
+++ b/meta-luv/recipes-core/initscripts/initscripts/luv-netconsole
@@ -0,0 +1,53 @@
+#! /bin/sh
+
+###
+#Netconsole script
+##
+#Get the port number given by the user
+#from the kernel command line using grep
+
+NETCONSOLE_PORT=$(cat /proc/cmdline | grep -Eo "[0.0-9.0]+" | tail -2 | head -1)
+
+#Get the ipaddress provided by the user
+#from the kernel command line using grep
+
+REC_IP=$(cat /proc/cmdline | grep -Eo "[0.0-9.0]+" | tail -1)
+
+#Refresh the arp buffer
+
+$(cat /proc/net/arp > /dev/null)
+
+#If reciever is in the same subnet then
+#Get the reciever HW MAC Address
+#using the reciever's ip address
+
+$(ping -rc 1 $REC_IP > /dev/null)
+if [ $? -eq 0 ] ; then
+ REC_MAC_EX=$(arp -n $REC_IP | awk '{ print $3 }')
+ REC_MAC=$(echo $REC_MAC_EX | awk '{ print $2 }')
+else
+
+#determine the default gateway and then
+#Get the reciever HW MAC Address
+#using the reciever's ip address
+
+ DEF_GATE=$(netstat -rn | grep ^0.0.0.0 | awk '{print $2}')
+ $(ping -c 1 $DEF_GATE > /dev/null)
+ REC_MAC_EX=$(arp -n $DEF_GATE | awk '{ print $3 }')
+ REC_MAC=$(echo $REC_MAC_EX | awk '{ print $2 }')
+fi
+
+# Get local IP and Interface
+
+SEND_IF=$(ip -o -4 r s to default | grep ^default | awk '{print $5}')
+SEND_IP=$(ifconfig | grep eth -A1 | grep inet | awk -F: '{print $2}' | awk '{print $1}')
+
+#Disable helper by default
+
+echo 0 > /proc/sys/net/netfilter/nf_conntrack_helper
+
+# Install netconsole
+
+modprobe -r netconsole
+modprobe netconsole netconsole=$NETCONSOLE_PORT@$SEND_IP/$SEND_IF,$NETCONSOLE_PORT@$REC_IP/$REC_MAC
+
--
1.9.1
6 years, 4 months
[PATCH 2/6] luv-live-image.bb: Kernel parameters for netconsole support
by Gayatri Kammela
Modify luv-live-image.bb to pass all the required kernel
parameters via APPEND line that support netconsole feature
in LUV
Parameters include declaring system console and the size of
the ring buffer to accommodate more messages that might
be useful to debug in case of a kernel panic while you run LUV
Other parameters include changing ip address settings so
that it sets to dhcp and an option that helps user to provide
remote ip address and port of user's choice
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 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta-luv/recipes-core/images/luv-live-image.bb b/meta-luv/recipes-core/images/luv-live-image.bb
index 722926275f96..69fdc869847a 100644
--- a/meta-luv/recipes-core/images/luv-live-image.bb
+++ b/meta-luv/recipes-core/images/luv-live-image.bb
@@ -10,7 +10,7 @@ LABELS = "luv"
INITRD_IMAGE = "core-image-efi-initramfs"
INITRD = "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.gz"
MACHINE_FEATURES += "efi"
-APPEND = "crashkernel=256M console=ttyS0,115200 console=ttyPCH0,115200"
+APPEND = "debug crashkernel=256M console=ttyS0,115200 console=ttyPCH0,115200 console=tty0,115200 ip=dhcp log_buf_len=1M netconsole=@,64001@10.11.12.13/"
APPEND_aarch64 = "crashkernel=256M console=ttyAMA0 uefi_debug acpi=force"
SPLASH_IMAGE = "blue-luv.jpg"
--
1.9.1
6 years, 4 months
[PATCH 1/6] core-image-efi-initramfs.bb: Add network utilites to support netconsole in LUV
by Gayatri Kammela
Modify core-image-efi-initramfs.bb to include ntework utilites
like iproute2 and iputils to provide netconsole support
Also include kernel-modules utility to support loadable kernel
modules in LUV (for example netconsole module here)
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/core-image-efi-initramfs.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 4e8ca3ff3a84..fdb9add6e36c 100644
--- a/meta-luv/recipes-core/images/core-image-efi-initramfs.bb
+++ b/meta-luv/recipes-core/images/core-image-efi-initramfs.bb
@@ -4,8 +4,8 @@ EFI tests."
IMAGE_INSTALL = "\
base-files base-passwd netbase udev sysvinit initscripts keymaps \
- kernel-image fwts bash coreutils gawk grep util-linux-agetty \
- util-linux-mount util-linux-umount kmod sed tar net-tools \
+ kernel-image kernel-modules fwts bash coreutils gawk grep util-linux-agetty \
+ util-linux-mount iputils iproute2 util-linux-umount kmod sed tar net-tools \
shadow util-linux procps efivarfs-test \
psplash kernel-efi-warnings \
"
--
1.9.1
6 years, 4 months
[PATCH v3] luv-test-manager: Add a warning message when removable disk is full
by Gayatri Kammela
Luv supports multiple runs and saves results back on to the
removable disk. At some point the disk should be full and
luv will not be able to save the results.
Modify luv-test-manager to add a threshold level of 2MB and warn
user when the disk reaches its threshold limit by displaying
"Removable disk space is running low , please backup and empty the
disk to try again !!" on the splash screen.
Also to correct the luv-storage mount point(where luv-results are being saved)
to be able to get detected through df command
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
Changes since v2:
1)Adding information about change in mount point of luv-storage
Changes since v1:
1)Updated the documentation about when the waring message is likely to occur
2)Made the threshold value a constant to compare the space available on the disk
3)Indentation of the code and readability
.../initscripts/initscripts/luv-test-manager | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
index f216802a57ff..15deca5feacd 100644
--- a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
+++ b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
@@ -23,14 +23,16 @@ psplash_write() {
# Save test results to a disk. In order to reliable identify the
# correct partition, mount using the disk's UUID. If the partition
# cannot be mounted, test results are not saved.
+# also mark the disk space threshold as 2MB
LUV_SAVE_RAW_DIR=/dev/null
LUV_SAVE_PARSED_DIR=/dev/null
LUV_SAVE_RESULTS_DIR=/dev/null
-LUV_STORAGE=/mnt/luv-storage/
+LUV_STORAGE=/mnt/luv-storage
LUV_PARTITION_UUID=05D6-1523
LUV_DISK_DEVICE=/dev/disk/by-uuid/${LUV_PARTITION_UUID}
+LUV_STORAGE_MIN_AVAIL=2000
## checking if the partiton is matched , else results
## cannot be saved in the removable media after tests are done
@@ -49,11 +51,21 @@ mkdir -p ${LUV_STORAGE}
if [ $? -eq 0 ]; then
mount ${LUV_DISK_DEVICE} ${LUV_STORAGE}
if [ $? -eq 0 ]; then
+
+ m=$(df | grep ${LUV_STORAGE} | awk '{print $4}')
+ if [ $m -le ${LUV_STORAGE_MIN_AVAIL} ] ; then
+ psplash_write " MSG $Disk_space_alert "
+ if [ -e $FIFO ]; then
+ umount -l /mnt/.psplash
+ fi
+ exit
+ fi
+
n=$(ls ${LUV_STORAGE}/ | grep $tstamp | wc -l)
if [ $n -ge 1 ]; then
- LUV_SAVE_RESULTS_DIR=${LUV_STORAGE}luv-results-$tstamp-$n/
+ LUV_SAVE_RESULTS_DIR=${LUV_STORAGE}/luv-results-$tstamp-$n/
else
- LUV_SAVE_RESULTS_DIR=${LUV_STORAGE}luv-results-$tstamp/
+ LUV_SAVE_RESULTS_DIR=${LUV_STORAGE}/luv-results-$tstamp/
fi
mkdir -p ${LUV_SAVE_RESULTS_DIR}raw/
--
1.9.1
6 years, 5 months
[PATCH] luv-test-manager: Group all the warning messages together for readability and maintainability
by Gayatri Kammela
Luv has different warning messages to be displayed depending
on the situation. Giving the proper names for the warning messages
improves readability and grouping them together improves maintainability.
Cc: Ricardo Neri <ricardo.neri-calderon(a)linux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela(a)intel.com>
---
meta-luv/recipes-core/initscripts/initscripts/luv-test-manager | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
index 6c11ae537cbb..f216802a57ff 100644
--- a/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
+++ b/meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
@@ -2,6 +2,12 @@
# Copyright 2014 Intel Corporation; author Matt Fleming
#
+#warn the user when no partition is found
+Missing_partition_alert="STOP! No partition found to store the results..please report to luv(a)lists.01.org"
+
+#warn the user when the disk is nearly full
+Disk_space_alert="Removable disk space is running low , please backup and empty the disk to try again !!"
+
grep -q noluv /proc/cmdline
if [ $? -ne 1 ]; then
exit 0
@@ -29,10 +35,9 @@ LUV_DISK_DEVICE=/dev/disk/by-uuid/${LUV_PARTITION_UUID}
## checking if the partiton is matched , else results
## cannot be saved in the removable media after tests are done
-warning="STOP! No partition found to store the results..please report to luv(a)lists.01.org"
ls /dev/disk/by-uuid | grep -q ${LUV_PARTITION_UUID}
if [ $? -eq 1 ] ; then
- psplash_write " MSG $warning "
+ psplash_write " MSG $Missing_partition_alert"
if [ -e $FIFO ]; then
umount -l /mnt/.psplash
fi
--
1.9.1
6 years, 5 months
[PATCH] luv-live-image.bb: Change the size of the luv-results partition
by Gayatri Kammela
Modify luv-live-image.bb to increase the capacity of luv-results
partition from 8MB to 16 MB capacity to accommodate more number
of test results
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 | 4 ++--
1 file 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 722926275f96..c7abe9eecaa9 100644
--- a/meta-luv/recipes-core/images/luv-live-image.bb
+++ b/meta-luv/recipes-core/images/luv-live-image.bb
@@ -31,8 +31,8 @@ build_img() {
# Sectors: 512 bytes
# Blocks: 1024 bytes
VFAT_RESULTS=${DEPLOY_DIR_IMAGE}/${PN}-results.hddimg
- # 8MB of space for test results
- VFAT_RESULTS_SPACE=8388608
+ # 16MB of space for test results
+ VFAT_RESULTS_SPACE=16777216
VFAT_RESULTS_BLOCKS=$(expr $VFAT_RESULTS_SPACE / 1024)
# TODO: do we need to dynamically generate the UUID?
# For now, every time this UUID changes, the file etc/init.d/luv-test-manager
--
1.9.1
6 years, 5 months