Hello community, here is the log from the commit of package firmwarekit checked in at Thu Oct 26 20:41:30 CEST 2006. -------- --- arch/i386/firmwarekit/firmwarekit.changes 2006-10-09 16:38:31.000000000 +0200 +++ /mounts/work_src_done/STABLE/firmwarekit/firmwarekit.changes 2006-10-26 16:54:35.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Oct 26 16:51:55 CEST 2006 - trenn@suse.de + +- Added manpage + moved to svn repository and cleaned up patches + added svn version to package version + use /var/log/boot.msg to gain dmesg output + +------------------------------------------------------------------- Old: ---- add_scp_save_results adjust_makefiles.patch ext_boot_param_parse_allow_all_serial_speeds.patch firmwarekit-r0.tar.gz fix_compile_warn.patch fix_up_unused_nameclash.patch free_encoded_strings param_save_via_ssh_and_exit.patch use_acpidump.patch New: ---- adjust_paths.patch dmesg_adjust.patch firmwarekit-r0.52.tar.bz2 fix_hpet_base_addr.patch own_params.patch path_environment.patch scp_save_results.patch series use_external_pmtool_bins.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ firmwarekit.spec ++++++ --- /var/tmp/diff_new_pack.rd66p0/_old 2006-10-26 20:41:16.000000000 +0200 +++ /var/tmp/diff_new_pack.rd66p0/_new 2006-10-26 20:41:16.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package firmwarekit (Version r0) +# spec file for package firmwarekit (Version r0.52) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,27 +13,27 @@ BuildRequires: bash coreutils dhclient dhcp-client findutils gawk gdb glib2 glib2-devel glibc grep iproute2 libacl libattr module-init-tools ncurses newt newt-devel pciutils pcre perl pkgconfig pmtools sed sharutils slang slang-devel sysvinit termcap util-linux wget xorg-x11-util-devel URL: http://www.linuxfirmwarekit.org Summary: BIOS checker that validates ACPI and other parts for x86 and x86_64 machines -Version: r0 -Release: 6 -License: LGPL +Version: r0.52 +Release: 1 +License: GNU Library General Public License v. 2.0 and 2.1 (LGPL) Group: System/Boot Autoreqprov: on +PreReq: gzip Requires: pmtools hwinfo util-linux Summary: BIOS checker that validates ACPI and other parts for x86 and x86_64 machines BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 x86_64 -Source0: %{name}-%{version}.tar.gz -Patch0: fix_up_unused_nameclash.patch -Patch1: adjust_doc.patch -Patch2: ext_boot_param_parse_allow_all_serial_speeds.patch -Patch3: fix_compile_warn.patch -Patch4: adjust_makefiles.patch -Patch5: rip_out_unneeded_stuff.patch -Patch6: use_acpidump.patch -Patch7: biostest_sh.patch -Patch8: hwinfo_integration.patch -Patch9: add_scp_save_results -Patch10: free_encoded_strings +Source0: %{name}-%{version}.tar.bz2 +Patch0: adjust_paths.patch +Patch1: biostest_sh.patch +Patch2: rip_out_unneeded_stuff.patch +Patch3: adjust_doc.patch +Patch4: own_params.patch +Patch5: scp_save_results.patch +Patch6: use_external_pmtool_bins.patch +Patch7: path_environment.patch +Patch8: dmesg_adjust.patch +Patch9: fix_hpet_base_addr.patch %description This tool, developed by Intel, is meant for vendors to validate and @@ -59,7 +59,9 @@ %patch7 -p1 %patch8 -p1 %patch9 -p1 -%patch10 -p1 +#%patch10 -p1 +#%patch11 -p1 +#%patch12 -p1 %build make -e CFLAGS="$RPM_OPT_FLAGS" @@ -70,10 +72,18 @@ install -D -m 644 initramfs/results.css %{buildroot}/var/log/%{name}/results.css install -D -m 644 initramfs/resources.css %{buildroot}/var/log/%{name}/resources.css install -D -m 744 biostest %{buildroot}/usr/share/%{name}/biostest +install -D -m 755 shelltools/start_test %{buildroot}/usr/share/%{name}/bin/start_test +ln -s start_test %{buildroot}/usr/share/%{name}/bin/announce_resource +ln -s start_test %{buildroot}/usr/share/%{name}/bin/finish_test +ln -s start_test %{buildroot}/usr/share/%{name}/bin/report_result +ln -s start_test %{buildroot}/usr/share/%{name}/bin/report_testrun_progress install -D -m 755 libstandalone.so %{buildroot}/%{_libdir}/libstandalone.so cp -a plugins %{buildroot}/usr/share/%{name}/plugins install -D -m 644 Documentation/QUICKSTART.txt %{buildroot}/%{_docdir}/%{name}/QUICKSTART.txt -install -D -m 644 Documentation/USERGUIDE.txt %{buildroot}/%{_docdir}/%{name}/USERGUIDE.txt +install -D -m 644 Documentation/USERGUIDE.txt %{buildroot}/%{_docdir}/%{name}/USERGUIDE.tx +gzip biostest.1 +install -D -m 644 biostest.1.gz %{buildroot}/%{_mandir}/man1/biostest.1.gz +chmod 644 %{buildroot}/%{_mandir}/man1/biostest.1.gz %files %defattr(-,root,root) @@ -82,8 +92,14 @@ /var/log/%{name} /%{_libdir}/libstandalone.so %{_docdir}/%{name} +%{_mandir}/man1/biostest.1.gz %changelog -n firmwarekit +* Thu Oct 26 2006 - trenn@suse.de +- Added manpage + moved to svn repository and cleaned up patches + added svn version to package version + use /var/log/boot.msg to gain dmesg output * Mon Oct 09 2006 - trenn@suse.de - moved output to /var/log/firmwarekit fixed double free in SSDT test ++++++ adjust_doc.patch ++++++ --- /var/tmp/diff_new_pack.rd66p0/_old 2006-10-26 20:41:16.000000000 +0200 +++ /var/tmp/diff_new_pack.rd66p0/_new 2006-10-26 20:41:16.000000000 +0200 @@ -1,3 +1,8 @@ +--- + Documentation/QUICKSTART.txt | 24 +++++++++---- + biostest.1 | 79 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 96 insertions(+), 7 deletions(-) + Index: firmwarekit/Documentation/QUICKSTART.txt =================================================================== --- firmwarekit.orig/Documentation/QUICKSTART.txt @@ -42,3 +47,87 @@ Contributer: Rolla Selbak (rolla.n.selbak@intel.com) +Index: firmwarekit/biostest.1 +=================================================================== +--- /dev/null ++++ firmwarekit/biostest.1 +@@ -0,0 +1,79 @@ ++.TH BIOSTEST 8 "Oct 2006" "Version r0" ++ ++.SH NAME ++biostest.sh \- starts the linux firmwarekit which checks the BIOS for linux compatiblity ++.SH SYNOPSIS ++.B biostest.sh [ do_not_block ] [ ssh_save=host:/dir ] [ console=ttySx,speed ] [ safemode ] ++.SH DESCRIPTION ++.BI biostest.sh ++Biostest checks your firmware for linux compatibility. ++It mainly works by parsing dmesg output and by making use of ACPICA tools ++(part of pmtools package) to check ACPI parts of the BIOS. ++Therefore you should only use this test with the appropriate kernel booted. ++If kernel output syntax changed, biostest will not work reliable. ++The pmtools package may also have syntax dependencies, but if you ++find an ACPI related BIOS bug you may want to try to run the biostest with an ++upgraded pmtools package and have a look whether the bug got fixed in recent ++ACPI kernel code or whether the bug now gets workarounded. ++ ++.SH OPTIONS ++ ++Be aware that the biostest binary checks /proc/cmdline for kernel boot ++params. That means you can also pass one of following options as kernel ++boot parameter and biostest will make use of it. Because of that a kernel boot ++parameter will always be used and you cannot revert it, better use normal ++parameters. Also the syntax is not linux conform and options do not start with ++\-. ++ ++.TP ++.I do_not_block ++Biostest will exit after checks have been performed and results have been ++written ++.TP ++.I ssh_save=host:/dir ++Specify a destinition in scp syntax to save the results to. This might break ++a bit the ncurses/newt windows as scp requires a password from stdin. ++If you want to automate the test you can use ssh keys (so that you don't have ++to pass a password to save the results away via scp) and also use the ++do_not_block option. This is only recommended in a trusted network environment, ++see ssh and ssh-keygen manpages. ++.TP ++.I console=ttySx,speed ++Use serial console for output/input. The parameter has the same syntax than the ++kernel parameter (only supports ttyS), but does not support the flow control ++, parity and number of bits extension (default is ttySx,speedn8) ++.TP ++.I safemode ++Start in safemode ++ ++.SH EXTEND THE KIT WITH SELFWRITTEN TESTS ++The tool is plugin based and it's easy to extend with selfwritten tests. ++Following programming/scripting languages are supported to add additional ++plugins: ++.P ++\- Shell ++.P ++\- Perl ++.P ++\- C library that gets dynamically loaded ++.P ++\- C standalone executable ++.P ++See online documentation for further details. ++ ++.SH BUGS ++The linuxfirmwarekit has been released recently. If you find any bugs please ++report to the linuxfirmwarekit mailinglist which you find at the link below. ++.PP ++If a plugin segfaults, it's not caught by the main program and the test may be ++shown as passed even if it's not (that may get fixed soon, possibly already ++is). ++ ++.SH AUTHOR ++.B linuxfirmwarekit ++has been written by Intel and is published under the GPL and LGPL (see below ++link for details). ++.PP ++This manpage has been written by Thomas Renninger <trenn@suse.de> ++.SH SEE ALSO ++http://www.linuxfirmwarekit.org ++++++ adjust_paths.patch ++++++ --- tests.c | 4 ++-- usb.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) Index: firmwarekit/usb.c =================================================================== --- firmwarekit.orig/usb.c +++ firmwarekit/usb.c @@ -82,8 +82,7 @@ void save_on_usb(void) if (system(buffer)!=0) continue; } - system("/bin/cp results/* /usbkey &> /dev/null"); - system("/bin/cp acpidump /usbkey &> /dev/null"); + system("/bin/cp -rf /var/log/firmwarekit /usbkey &> /dev/null"); system("/bin/umount /usbkey &> /dev/null"); devcount ++; } while (entry); Index: firmwarekit/tests.c =================================================================== --- firmwarekit.orig/tests.c +++ firmwarekit/tests.c @@ -194,8 +194,8 @@ void sort_results(void) void dump_results(void) { - dump_xml(all_tests, "results/results.xml"); - dump_xml_resources("results/resources.xml"); + dump_xml(all_tests, "/var/log/firmwarekit/results.xml"); + dump_xml_resources("/var/log/firmwarekit/resources.xml"); show_results_ui(all_tests); } ++++++ biostest_sh.patch ++++++ --- /var/tmp/diff_new_pack.rd66p0/_old 2006-10-26 20:41:16.000000000 +0200 +++ /var/tmp/diff_new_pack.rd66p0/_new 2006-10-26 20:41:16.000000000 +0200 @@ -1,12 +1,12 @@ --- - biostest.sh | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) + biostest.sh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) Index: firmwarekit/biostest.sh =================================================================== --- /dev/null +++ firmwarekit/biostest.sh -@@ -0,0 +1,21 @@ +@@ -0,0 +1,14 @@ +#!/bin/bash + +DIR="/usr/share/firmwarekit" @@ -20,11 +20,4 @@ + +pushd "$DIR" +./biostest "$*" -+RET=$? -+if [ $RET = 0 ];then -+ echo "biostest run successfully, output stored in $OUTPUT_DIR" -+ exit 0 -+else -+ echo "biostest returned error: $RET, parts of output stored in $OUTPUT_DIR" -+ exit 1 -+fi ++ ++++++ dmesg_adjust.patch ++++++ --- chk_hpet/chk_hpet.c | 6 ++-- dmesg.c | 71 ++++++++++++++++++++++++++++++++-------------------- libstandalone.c | 9 +++++- 3 files changed, 55 insertions(+), 31 deletions(-) Index: firmwarekit/dmesg.c =================================================================== --- firmwarekit.orig/dmesg.c +++ firmwarekit/dmesg.c @@ -68,47 +68,64 @@ static void check_this_line(gpointer dat } - - void get_dmesg_buffer(void) { char *dmesg; - char *c1, *c2; - int linecount = 0; + char *c1,*c2; + int linecount = 0, ret; + dmesg = malloc(DMESG_SIZE); - assert(dmesg!=NULL); + c1 = malloc(4096); + assert(dmesg!=NULL && c1!=NULL); - system("/bin/dmesg -s 256000 > /tmp/boot_dmesg"); + FILE *f_dmesg; - /* don't printk to the console; newt hates that */ - klogctl (6, NULL, 0); + if (access("/var/log/boot.msg", R_OK)){ + system("/bin/dmesg -s 256000 > /var/log/boot.msg"); + } - memset(dmesg, 0, DMESG_SIZE); - klogctl (4, dmesg, DMESG_SIZE); + /* don't printk to the console; newt hates that */ - announce_resource("dmesg://", dmesg, NULL); + /* We don't get ring buffer directly, we get it from + /var/log/boot.msg. linuxrc empties ring buffer and writes + stuff there, so this should work in ordinary booted and + BiosTest booted environment + */ + + f_dmesg = fopen ("/var/log/boot.msg", "r"); + if (f_dmesg == NULL){ + fprintf (stderr, "WARN: Could not open /var/log/boot.msg"); + free(dmesg); + free(c1); + return; + } + /* Clear ring buffer, we only want to get up to date messages + in further calls... */ - c1 = dmesg; - while (c1) { - c2 = strchr(c1, '\n'); - if (c2==NULL) - break; - *c2 = 0; - c2++; - /* skip the <4> that is in front of each line */ - if (strlen(c1)>3 && c1[0]=='<') - c1+=3; + klogctl (5, NULL, 0); - boot_dmesg = g_list_append(boot_dmesg, strdup(c1)); - linecount ++; + ret = fread(dmesg, 1, DMESG_SIZE-1, f_dmesg); + dmesg[ret]='\0'; + announce_resource("dmesg://", dmesg, NULL); - c1 = c2; + rewind(f_dmesg); + while (fgets(c1, 4095, f_dmesg)) { + /* skip the <4> that is in front of each line + We only need lines with <4>, rest is later appended stuff in + ordinary booted system + */ + c2=c1; + if (strlen(c1)>3 && c1[0]=='<' && c1[2]=='>'){ +// c2+=3; + boot_dmesg = g_list_append(boot_dmesg, strdup(c2)); + linecount ++; + } } - - g_list_foreach(boot_dmesg, check_this_line, NULL); + fclose(f_dmesg); + free(c1); free(dmesg); + g_list_foreach(boot_dmesg, check_this_line, NULL); e820_register_resource(); - } Index: firmwarekit/libstandalone.c =================================================================== --- firmwarekit.orig/libstandalone.c +++ firmwarekit/libstandalone.c @@ -36,17 +36,22 @@ GList *boot_dmesg = NULL; static void local_get_dmesg_buffer(void) { char line [4096]; +/* char *tmp; */ FILE *file; memset(line, 0, 4096); - file = fopen("/tmp/boot_dmesg", "r"); + file = fopen("/var/log/boot.msg", "r"); if (!file) return; while (!feof(file)) { if (fgets(line, 4095, file)==NULL) break; - boot_dmesg = g_list_append(boot_dmesg, strdup(line)); + /* only add real kernel messages in <4>msg format */ + if (line[0] == '<' && line[2] == '>'){ +/* tmp = &line[3]; */ + boot_dmesg = g_list_append(boot_dmesg, strdup(line)); + } } fclose(file); } Index: firmwarekit/chk_hpet/chk_hpet.c =================================================================== --- firmwarekit.orig/chk_hpet/chk_hpet.c +++ firmwarekit/chk_hpet/chk_hpet.c @@ -113,7 +113,7 @@ static void check_hpet_base(gpointer dat char *line = (char *) data; char *val; if ((val = strstr(line, "ACPI: HPET id:")) != NULL) { - hpet_base_p = strtoul(strstr(val, "0xfed"), NULL, 0x10); + hpet_base_p = strtoul(strstr(val, "0xfec"), NULL, 0x10); fprintf(stderr, "HPET base = 0x%08X\n", (unsigned int) hpet_base_p); *(unsigned int *) user_data = DMESG_BASE; @@ -152,6 +152,7 @@ int main(int argc, char ** argv) "This test checks the HPET PCI BAR for each timer block in the timer." "The base address is passed by the firmware via an ACPI table." "IRQ routing and initialization is also verified by the test.\n"); +/* ret = system("cat /proc/acpi/dsdt > dsdt.dat"); if (ret != EXIT_SUCCESS) return ret; @@ -159,9 +160,10 @@ int main(int argc, char ** argv) if (ret) printf("iasl returns %i \n", ret); report_testrun_progress(30); +*/ memset(uri, 0, 1024); - load_boot_dmesg_buffer(); +/* load_boot_dmesg_buffer(); */ if (boot_dmesg != NULL) g_list_foreach(boot_dmesg, check_hpet_base, &hpet_status); ++++++ fix_hpet_base_addr.patch ++++++ --- chk_hpet/chk_hpet.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) Index: tmp/chk_hpet/chk_hpet.c =================================================================== --- tmp.orig/chk_hpet/chk_hpet.c +++ tmp/chk_hpet/chk_hpet.c @@ -112,12 +112,20 @@ static void check_hpet_base(gpointer dat { char *line = (char *) data; char *val; + int id, ret; if ((val = strstr(line, "ACPI: HPET id:")) != NULL) { - hpet_base_p = strtoul(strstr(val, "0xfec"), NULL, 0x10); - fprintf(stderr, "HPET base = 0x%08X\n", - (unsigned int) hpet_base_p); - *(unsigned int *) user_data = DMESG_BASE; - return; + ret = sscanf(val, "ACPI: HPET id: %x base: %lx", + &id, &hpet_base_p); + if (ret != 2){ + fprintf (stderr, "FATAL: Hpet kernel syntax " + "changed\n"); + hpet_base_p = 0; + } + else{ + fprintf(stderr, "HPET base = 0x%08X\n", + (unsigned int) hpet_base_p); + *(unsigned int *) user_data = DMESG_BASE; + } } } ++++++ hwinfo_integration.patch ++++++ --- /var/tmp/diff_new_pack.rd66p0/_old 2006-10-26 20:41:17.000000000 +0200 +++ /var/tmp/diff_new_pack.rd66p0/_new 2006-10-26 20:41:17.000000000 +0200 @@ -1,21 +1,13 @@ --- - main.c | 9 +++++++++ + main.c | 8 ++++++++ usb.c | 5 +++++ - 2 files changed, 14 insertions(+) + 2 files changed, 13 insertions(+) Index: firmwarekit/main.c =================================================================== --- firmwarekit.orig/main.c +++ firmwarekit/main.c -@@ -33,6 +33,7 @@ - - #include "biostest.h" - -+#include <sys/stat.h> - - int use_serial; - static unsigned long serial_speed; -@@ -73,6 +74,10 @@ static void parse_kernel_param(const cha +@@ -72,6 +72,10 @@ static void parse_kernel_param(const cha /* parse safemode boot param */ if (strstr(buffer, "safemode")) safe_mode=1; @@ -26,9 +18,9 @@ return; bad_param: -@@ -154,6 +159,10 @@ int main(int __is_unused argc, char __is +@@ -133,6 +137,10 @@ int main(int __is_unused argc, char __is - extract_dsdt_ssdts(); + init_serial(use_serial, tty, serial_speed); + fprintf (stdout, "Processing hwinfo...\n"); + system ("/usr/sbin/hwinfo --bios --pci --block --usb --log=/var/log/firmwarekit/hwinfo.txt"); ++++++ own_params.patch ++++++ --- main.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) Index: firmwarekit/main.c =================================================================== --- firmwarekit.orig/main.c +++ firmwarekit/main.c @@ -37,6 +37,9 @@ int use_serial; static unsigned long serial_speed; static int tty; +static int do_not_block; +char ssh_dest[MAX_SSH_DEST_LEN] = ""; + int safe_mode; int finished_tests = 0; @@ -79,6 +82,32 @@ static void parse_kernel_param(const cha /* parse safemode boot param */ if (strstr(buffer, "safemode")) safe_mode=1; + /* Biostest got booted -> setup sshd */ + if (strstr(buffer, "install=exec:run_biostest")){ + } + + if (strstr(buffer, "ssh_save=")){ + ret = strlen(buffer) - strlen("ssh_save=") + 1; + if (ret > MAX_SSH_DEST_LEN){ + fprintf(stderr, "FATAL: ssh destination string to" + " long (%d > %d). Parameter ignored.\n", + ret, MAX_SSH_DEST_LEN); + } + else{ + ret = sscanf(buffer, "ssh_save=%s", ssh_dest); + fprintf(stdout, "ssh destination string set to: %s", + ssh_dest); + } + } + if (strstr(buffer, "do_not_block")) + do_not_block=1; + + if (strstr(buffer, "-h") || strstr(buffer, "--help")){ + fprintf(stdout, "biostest [ -h ] [ safemode ] [ do_not_block ]" + " [ ssh_save=host:/dest ]\n"); + exit(EXIT_SUCCESS); + } + return; bad_param: ++++++ path_environment.patch ++++++ --- main.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) Index: firmwarekit/main.c =================================================================== --- firmwarekit.orig/main.c +++ firmwarekit/main.c @@ -45,6 +45,7 @@ int safe_mode; int finished_tests = 0; +static char* path_env; static void extract_dsdt_ssdts() { @@ -159,6 +160,27 @@ static void parse_kernel_cmdline(void) } } +static void set_path_env(void) +{ + int ret; + char new_path_env[8192]; + path_env = getenv("PATH"); + ret = snprintf(new_path_env, 8192, "PATH=%s:" + "/usr/share/firmwarekit/bin", path_env); + if (ret >= 8192){ + fprintf(stderr, "FATAL: PATH environment variable too big," + " increase string array -> that's a bug\n"); + exit (EXIT_FAILURE); + } + ret = putenv(new_path_env); + if (ret){ + fprintf(stderr, "FATAL: Could not set PATH environment" + "variable to %s\n", new_path_env); + exit (EXIT_FAILURE); + } + printf ("PATH set to: %s", getenv("PATH")); +} + int main(int argc, char **argv) { /* initialisation of core support routines */ @@ -174,6 +196,8 @@ int main(int argc, char **argv) get_dmesg_buffer(); + set_path_env(); + init_results_ui(); execute_plugins("plugins/"); @@ -204,6 +228,5 @@ int main(int argc, char **argv) dump_xml_results(); show_results(); } - return EXIT_SUCCESS; } ++++++ rip_out_unneeded_stuff.patch ++++++ --- /var/tmp/diff_new_pack.rd66p0/_old 2006-10-26 20:41:17.000000000 +0200 +++ /var/tmp/diff_new_pack.rd66p0/_new 2006-10-26 20:41:17.000000000 +0200 @@ -1,40 +1,59 @@ --- - Makefile | 4 ++-- + Makefile | 16 ++++++++-------- acpicompile/Makefile | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) + 2 files changed, 9 insertions(+), 9 deletions(-) +Index: firmwarekit/acpicompile/Makefile +=================================================================== +--- firmwarekit.orig/acpicompile/Makefile ++++ firmwarekit/acpicompile/Makefile +@@ -2,7 +2,7 @@ override CFLAGS += -I.. `pkg-config --cf + LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone + + +-all: acpicompile.exe iasl acpixtract acpidump ++all: acpicompile.exe + + acpicompile.exe: acpicompile.o .depend + gcc acpicompile.o $(LDFLAGS) -o acpicompile.exe Index: firmwarekit/Makefile =================================================================== --- firmwarekit.orig/Makefile +++ firmwarekit/Makefile -@@ -2,7 +2,7 @@ override CFLAGS += `pkg-config --cflags - LDFLAGS = -ldl -export-dynamic `pkg-config --libs glib-2.0` -lnewt +@@ -4,14 +4,14 @@ override CFLAGS += `pkg-config --cflags + LDFLAGS = -nostdlibs -Linitramfs/data/lib -Linitramfs/data/usr/lib -export-dynamic -lc -ldl `pkg-config --libs glib-2.0` -lnewt -lslang --SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg lmbench mtrr shelltools shelltests amlpoke fan fadt chk_hpet suspend -+SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg mtrr shelltools shelltests amlpoke fan fadt chk_hpet suspend +-SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg lmbench mtrr shelltools shelltests amlpoke fan fadt chk_hpet suspend thermal_trip ++SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg mtrr shelltools shelltests amlpoke fan fadt chk_hpet suspend thermal_trip LIBS = dmesg.o main.o tests.o plugins.o ui.o uri.o dumpxml.o usb.o serial.o lib.o acpitable.o e820.o all: libstandalone.so biostest subdirs -@@ -14,7 +14,7 @@ subdirs: $(SUBDIRS) + +-ifeq ($(shell uname -m),i386) +-LIBC = initramfs/data/usr/lib/libc.so +-endif ++#ifeq ($(shell uname -m),i386) ++#LIBC = initramfs/data/usr/lib/libc.so ++#endif + + .PHONY: subdirs $(SUBDIRS) + +@@ -20,13 +20,13 @@ subdirs: $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ cd shelltests ; make install - cd initramfs/kernel ; make +# cd initramfs/kernel ; make - biostest: $(LIBS) biostest.h .depend +-biostest: $(LIBS) biostest.h .depend $(LIBC) ++biostest: $(LIBS) biostest.h .depend gcc $(LIBS) $(LDFLAGS) -o biostest -Index: firmwarekit/acpicompile/Makefile -=================================================================== ---- firmwarekit.orig/acpicompile/Makefile -+++ firmwarekit/acpicompile/Makefile -@@ -2,7 +2,7 @@ override CFLAGS += -I.. `pkg-config --cf - LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone - --all: acpicompile.exe iasl -+all: acpicompile.exe +-initramfs/data/usr/lib/libc.so: +- cd initramfs ; sh create_initramfs.sh ++#initramfs/data/usr/lib/libc.so: ++# cd initramfs ; sh create_initramfs.sh - acpicompile.exe: acpicompile.o .depend - gcc acpicompile.o $(LDFLAGS) -o acpicompile.exe + libstandalone.so: $(LIBS) biostest.h .depend libstandalone.o + gcc --shared libstandalone.o lib.o -o libstandalone.so ++++++ scp_save_results.patch ++++++ --- Makefile | 2 - biostest.h | 9 ++++ main.c | 26 +++++++++++++ ssh.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests.c | 7 ++- ui.c | 34 +++++++++++++---- 6 files changed, 182 insertions(+), 13 deletions(-) Index: firmwarekit/ssh.c =================================================================== --- /dev/null +++ firmwarekit/ssh.c @@ -0,0 +1,117 @@ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <time.h> + +#include <newt.h> + +#include "biostest.h" + +#define MAX_SSH_COMMAND_LEN MAX_SSH_DEST_LEN + 512 + HOST_NAME_MAX + +void setup_result_dir(char *result_dir, size_t string_sz){ + + char host_name[HOST_NAME_MAX + 1]; + int ret; + + char date_str[128]; + const time_t cur_time = time(NULL); + + struct tm *loc_time = localtime(&cur_time); + + if (loc_time == NULL) + strcpy (date_str, ""); + else + sprintf(date_str, "%.2d_%.2d__%.2d_%.2d_%.2d", loc_time->tm_hour, + loc_time->tm_min, loc_time->tm_mday, loc_time->tm_mon + 1, + loc_time->tm_year % 100); + + ret = gethostname(host_name, HOST_NAME_MAX); + host_name[HOST_NAME_MAX] = '\0'; + + /* gethostname may return "(none)" and no error return value in + some cases? There might be other invalid fs character used as host + name? I don't care for that now... + -> handle it + */ + if (ret || strstr(host_name, "(") || strstr(host_name, ")")){ + snprintf(result_dir, string_sz-1, "results_%s", date_str); + result_dir[string_sz-1] = '\n'; + } + else{ + snprintf(result_dir, string_sz-1, "results_%s_%s", host_name, date_str); + result_dir[string_sz-1] = '\n'; + } + return; +} + +int copy_via_ssh(const char *dest) +{ + char command[4096]; + char result_dir[1024]; + int ret; + setup_result_dir(result_dir, 1024); + + ret = snprintf (command, 4096, + "mkdir /var/log/firmwarekit/%s;cp " + "/var/log/firmwarekit/* /var/log/firmwarekit/%s/*;" + "scp -r -o CheckHostIP=no -o StrictHostKeyChecking=no " + "/var/log/firmwarekit %s/results &>/dev/null", dest, dest, dest); + + if (ret >= 4096){ + fprintf (stderr, "WARN: ssh command succeeds max" + " string length (%d > %d)\n", ret, + MAX_SSH_COMMAND_LEN); + return -1; + } + return system(command); +} + +void save_via_ssh(void) +{ + int myWin; + newtComponent myForm; + + newtComponent mySave, myBack, mySCPDest, resu; + + const char *destination; + int ret; + + int W,H; + + newtGetScreenSize(&W,&H); + + myWin = newtOpenWindow(1+(W-80)/2,1+(H-10)/2,80,10, "Provide" + "destination where to copy results" + " in scp syntax"); + myForm = newtForm(NULL,NULL,0); + + newtFormAddComponent(myForm, newtLabel(2,2, "Destination")); + mySCPDest = newtEntry(15, 2, "host:/target_dir", MAX_SSH_DEST_LEN, &destination, 0); + newtFormAddComponent(myForm, mySCPDest); + +/* Password passing is not possible via scp... + mySCPDest = newtEntry(20, 4, "host:/target_dir", 20, &pass, NEWT_FLAG_HIDDEN); + newtFormAddComponent(myForm, mySCPDest); +*/ + mySave = newtButton(2, 4, "Save"); + newtFormAddComponent(myForm, mySave); + + myBack = newtButton(27, 4, "Back"); + newtFormAddComponent(myForm, myBack); + + resu = newtRunForm(myForm); + if (resu == mySave) { + newtCls(); + ret = copy_via_ssh(destination); + if (ret) + simple_ok_dialog("SCP result", "ERROR: scp command did" + " not succeed"); + else + simple_ok_dialog("SCP result", "Copying data was " + "successfull"); + } + newtPopWindow(); +} Index: firmwarekit/biostest.h =================================================================== --- firmwarekit.orig/biostest.h +++ firmwarekit/biostest.h @@ -81,7 +81,8 @@ extern void check_dmesg_updates(char *ur /* tests.c */ -extern void dump_results(void); +extern void dump_xml_results(void); +extern void show_results(void); extern void sort_results(void); extern void register_interactive_test(char *name, voidvoidfunc *func); @@ -115,6 +116,12 @@ extern void dump_xml(GList *all_tests, c /* usb.c */ extern void save_on_usb(void); +/* ssh.c */ +#define MAX_SSH_DEST_LEN 64 + +extern void save_via_ssh(void); +extern int copy_via_ssh(const char *dest); + /* serial.c */ extern void init_serial(int enable, int tty, unsigned long speed); Index: firmwarekit/main.c =================================================================== --- firmwarekit.orig/main.c +++ firmwarekit/main.c @@ -27,6 +27,7 @@ #include <slang.h> +#include <newt.h> #include <glib.h> @@ -179,7 +180,30 @@ int main(int argc, char **argv) finished_tests = 1; - dump_results(); + if (do_not_block){ + dump_xml_results(); + if (ssh_dest[0] != '\0'){ + int x; + x = copy_via_ssh(ssh_dest); + if (x){ + fprintf(stderr, "ERROR: scp copy to %s did" + " not succeed\n", ssh_dest); + return EXIT_FAILURE; + } + else{ + fprintf(stdout, "Copying data to %s " + "successfull\n", ssh_dest); + } + /* try to exit graphic stuff gracefully */ + } + newtRefresh(); + newtPopWindow(); + newtFinished(); + } + else{ + dump_xml_results(); + show_results(); + } return EXIT_SUCCESS; } Index: firmwarekit/ui.c =================================================================== --- firmwarekit.orig/ui.c +++ firmwarekit/ui.c @@ -34,6 +34,19 @@ static int myProgressWin=-1; static newtComponent myProgressText, myProgressForm, myScales; +static GList *save_pokes; + +static void register_save_poke(char *name, voidvoidfunc *func) +{ + struct interactive_test *test; + test = malloc(sizeof(struct interactive_test)); + assert(test!=NULL); + memset(test, 0, sizeof(struct interactive_test)); + test->shortname = strdup(name); + test->execute = func; + save_pokes = g_list_append(save_pokes, test); +} + static int longest_string(char *str) { char *c; @@ -615,7 +628,7 @@ void show_results_ui(GList *all_tests) int win; newtComponent myForm; newtComponent myOkButton; - newtComponent myUSBButton; + newtComponent mySaveButton; newtComponent myIntButton; newtComponent myPokeButton; newtComponent myHelpButton; @@ -654,18 +667,23 @@ void show_results_ui(GList *all_tests) myOkButton = newtButton(2,H-8, "Exit"); newtFormAddComponent(myForm, myOkButton); - myUSBButton = newtButton(12,H-8, "Save to USB"); - newtFormAddComponent(myForm, myUSBButton); + mySaveButton = newtButton(12,H-8, "Save"); + newtFormAddComponent(myForm, mySaveButton); + + /* Setup save options */ + + register_save_poke("Save to USB", save_on_usb); + register_save_poke("Save via SSH", save_via_ssh); - myIntButton = newtButton(29,H-8, "Manual Tests"); + myIntButton = newtButton(22,H-8, "Manual Tests"); if (interactive_tests) newtFormAddComponent(myForm, myIntButton); - myPokeButton = newtButton(47,H-8, "Poke HW"); + myPokeButton = newtButton(40,H-8, "Poke HW"); if (hardware_pokes) newtFormAddComponent(myForm, myPokeButton); - myHelpButton = newtButton(61,H-8, "Help"); + myHelpButton = newtButton(54,H-8, "Help"); newtFormAddComponent(myForm, myHelpButton); while (1) { @@ -678,8 +696,8 @@ void show_results_ui(GList *all_tests) show_resource_info(result->devuri); else show_result(result); - } else if (resu == myUSBButton) { - save_on_usb(); + } else if (resu == mySaveButton) { + int_poke_dialog("Save results", save_pokes); } else if (resu == myPokeButton) { int_poke_dialog("Poke hardware", hardware_pokes); } else if (resu == myIntButton) { Index: firmwarekit/tests.c =================================================================== --- firmwarekit.orig/tests.c +++ firmwarekit/tests.c @@ -192,13 +192,16 @@ void sort_results(void) } -void dump_results(void) +void dump_xml_results(void) { dump_xml(all_tests, "/var/log/firmwarekit/results.xml"); dump_xml_resources("/var/log/firmwarekit/resources.xml"); - show_results_ui(all_tests); } +void show_results(void) +{ + show_results_ui(all_tests); +} void register_hw_poke(char *name, voidvoidfunc *func) { Index: firmwarekit/Makefile =================================================================== --- firmwarekit.orig/Makefile +++ firmwarekit/Makefile @@ -5,7 +5,7 @@ LDFLAGS = -nostdlibs -Linitramfs/data/li SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg mtrr shelltools shelltests amlpoke fan fadt chk_hpet suspend thermal_trip -LIBS = dmesg.o main.o tests.o plugins.o ui.o uri.o dumpxml.o usb.o serial.o lib.o acpitable.o e820.o +LIBS = dmesg.o main.o tests.o plugins.o ui.o uri.o dumpxml.o usb.o serial.o lib.o acpitable.o e820.o ssh.o all: libstandalone.so biostest subdirs ++++++ use_external_pmtool_bins.patch ++++++ --- acpicompile/acpicompile.c | 22 +++++++++++----------- main.c | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) Index: firmwarekit/acpicompile/acpicompile.c =================================================================== --- firmwarekit.orig/acpicompile/acpicompile.c +++ firmwarekit/acpicompile/acpicompile.c @@ -339,7 +339,7 @@ static void do_table(char *filename) char uri[4096]; char command[4096]; - sprintf(command, "plugins/iasl -vi -vs -w3 %s", filename); + sprintf(command, "/usr/bin/iasl -vi -vs -w3 %s", filename); file = popen(command,"r"); while (!feof(file)) { @@ -465,19 +465,19 @@ static void do_test(void) if (ret != EXIT_SUCCESS) return; } - ret = system("plugins/iasl -d DSDT.dat &>/dev/null"); + ret = system("/usr/bin/iasl -d DSDT.dat &>/dev/null"); if (ret) printf("iasl returns %i \n", ret); - system("plugins/iasl -d -e DSDT.dat SSDT1.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT2.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT3.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT4.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT5.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT6.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT7.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT8.dat &>/dev/null"); - system("plugins/iasl -d -e DSDT.dat SSDT9.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT1.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT2.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT3.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT4.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT5.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT6.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT7.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT8.dat &>/dev/null"); + system("/usr/bin/iasl -d -e DSDT.dat SSDT9.dat &>/dev/null"); /* current iasl has an issue with arugment counts in SSDT's, work around this */ system("sed -i -e \"s/^ACPI Error.*Argument count mismatch for method.*//g\" SSDT*.dsl &> /dev/null"); Index: firmwarekit/main.c =================================================================== --- firmwarekit.orig/main.c +++ firmwarekit/main.c @@ -48,8 +48,8 @@ int finished_tests = 0; static void extract_dsdt_ssdts() { - system("plugins/acpidump > acpidump &> /dev/null"); - system("plugins/acpixtract acpidump &> /dev/null"); + system("/usr/sbin/acpidump > acpidump &> /dev/null"); + system("/usr/bin/acpixtract acpidump &> /dev/null"); } static void parse_kernel_param(const char *buffer) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org