Leandro Becker
2016-Feb-19 20:07 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
Hello folks, There is a way to get the system serial number from SMBIOS and pass it as HTTP query string to get the kernel and initrd? Something like this: LABEL OS Download MENU LABEL Clonezilla MENU INDENT 1 KERNEL http://192.168.10.10/kernel.php?type=kernel ( http://myserver/kernel.php?SN=SMBIOS_SERIAL_NUMBER&type=kernel )&SN=SMBIOS_SERIAL_NUMBER APPEND initrd=http://192.168.10.10/kernel.php?type=initrd&SN=SMBIOS_SERIAL_NUMBER boot=live ... I found that SYSAPPEND is able to get info from SMBIOS, but there is a way to accomplish what I'm trying to do, i.e. replace SMBIOS_SERIAL_NUMBER somehow with the real serial number? Maybe Menu.c32 have a feature to do something like this? Best regards, Leandro Becker
Geert Stappers
2016-Feb-19 20:40 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
On Fri, Feb 19, 2016 at 06:07:15PM -0200, Leandro Becker via Syslinux wrote:> Hello folks, > > There is a way to get the system serial number from SMBIOS and pass it > as HTTP query string to get the kernel and initrd? > Something like this: > > LABEL OS Download > MENU LABEL Clonezilla > MENU INDENT 1 > KERNEL http://192.168.10.10/kernel.php?type=kernel ( > http://myserver/kernel.php?SN=SMBIOS_SERIAL_NUMBER&type=kernel > )&SN=SMBIOS_SERIAL_NUMBER > APPEND > initrd=http://192.168.10.10/kernel.php?type=initrd&SN=SMBIOS_SERIAL_NUMBER > boot=live ... > > I found that SYSAPPEND is able to get info from SMBIOS, but there is a > way to accomplish what I'm trying to do, i.e. replace > SMBIOS_SERIAL_NUMBER somehow with the real serial number? > Maybe Menu.c32 have a feature to do something like this?I don't know. This E-mail is to that Syslinux has lua.c32 That Lua intpreter can get SMBIOS information and boot a Linux kernel Groeten Geert Stappers -- Leven en laten leven
Gene Cumm
2016-Feb-20 01:25 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
On Fri, Feb 19, 2016 at 3:40 PM, Geert Stappers via Syslinux <syslinux at zytor.com> wrote:> On Fri, Feb 19, 2016 at 06:07:15PM -0200, Leandro Becker via Syslinux wrote: >> Hello folks, >> >> There is a way to get the system serial number from SMBIOS and pass it >> as HTTP query string to get the kernel and initrd? >> Something like this: >> >> LABEL OS Download >> MENU LABEL Clonezilla >> MENU INDENT 1 >> KERNEL http://192.168.10.10/kernel.php?type=kernel ( >> http://myserver/kernel.php?SN=SMBIOS_SERIAL_NUMBER&type=kernel >> )&SN=SMBIOS_SERIAL_NUMBER >> APPEND >> initrd=http://192.168.10.10/kernel.php?type=initrd&SN=SMBIOS_SERIAL_NUMBER >> boot=live ... >> >> I found that SYSAPPEND is able to get info from SMBIOS, but there is a >> way to accomplish what I'm trying to do, i.e. replace >> SMBIOS_SERIAL_NUMBER somehow with the real serial number? >> Maybe Menu.c32 have a feature to do something like this? > > I don't know. > This E-mail is to that Syslinux has lua.c32 > That Lua intpreter can get SMBIOS information and boot a Linux kernelmenu.c32 (and vesamenu.c32) are documented in doc/menu.txt and no such feature exists at this time. A more universal answer would be enhancing linux.c32 to provide this function. Consider adding it as a feature-request bug in http://bugzilla.syslinux.org/ -- -Gene
Ferenc Wágner
2016-Feb-22 13:27 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
Leandro Becker via Syslinux <syslinux at zytor.com> writes:> There is a way to get the system serial number from SMBIOS and pass it > as HTTP query string to get the kernel and initrd? > Something like this: > > LABEL OS Download > MENU LABEL Clonezilla > MENU INDENT 1 > KERNEL http://192.168.10.10/kernel.php?type=kernel (http://myserver/kernel.php?SN=SMBIOS_SERIAL_NUMBER&type=kernel)&SN=SMBIOS_SERIAL_NUMBER > APPEND initrd=http://192.168.10.10/kernel.php?type=initrd&SN=SMBIOS_SERIAL_NUMBER boot=live ... > > I found that SYSAPPEND is able to get info from SMBIOS, but there is a > way to accomplish what I'm trying to do, i.e. replace > SMBIOS_SERIAL_NUMBER somehow with the real serial number? > Maybe Menu.c32 have a feature to do something like this?You can script it in Lua. Try something like LABEL OS Download COM32 lua.c32 APPEND down.lua where down.lua is something like local sl = require "syslinux" local dmi = require "dmi" local dmi_table = dmi.gettable() local serial = dmi_table.system.serial sl.run_command ("http://192.168.10.10/kernel.php?SN=" . serial . "...") (untested) -- Regards, Feri.
Ferenc Wágner
2016-Feb-22 16:44 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
"Leandro Becker" <Lbecker at positivo.com.br> writes:> Tryied, but seems that command line does not support loading kernel > using http :( > Thanks anyway.Works fine for me with lpxelinux.0. String concatenation is .. though, so fix that mistake of mine like sl.run_command ("http://192.168.10.10/kernel.php?SN=" . serial . "...") -- Regards, Feri.
Leandro Becker
2016-Feb-23 18:36 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
On Mon, Feb 22, 2016 at 05:44:43PM +0100, Ferenc W?gner wrote:> > Works fine for me with lpxelinux.0. String concatenation is .. though, > so fix that mistake of mine like > > sl.run_command ("http://192.168.10.10/kernel.php?SN=" . serial . "...") > -- > Regards, > Feri.My mistake :( I was using pxelinux.0 instead of lpxelinux.0 Is now working fine. For reference, this is my lua script: ------------------------------------------------------------------- syslinux = require ("syslinux") dmi = require ("dmi") --get nice output printf = function(s,...) return io.write(s:format(...)) end -- function printf ("Getting SN from SMBIOS...\n") dmi_table = dmi.gettable() printf ("SN: %s\n", dmi_table.system.serial) printf ("Loading kernel...\n") kernel syslinux.loadfile("http://192.168.10.10/boot.php?type=kernel&NS="..dmi_table.system.serial ( 'http://192.168.10.10/boot.php?type=kernel&NS="..dmi_table.system.serial') ) printf("Ok. Kernel file size %d\n", syslinux.filesize(kernel)) printf ("Loading initrd...\n") initrdPath "http://192.168.10.10/boot.php?type=initrd&NS="..dmi_table.system.serial ( 'http://192.168.10.10/boot.php?type=initrd&NS="..dmi_table.system.serial') initrd = syslinux.loadfile(initrdPath) printf("Ok. Initrd file size %d\n", syslinux.filesize(initrd)) printf ("Booting...\n") initramfs = syslinux.initramfs_init() syslinux.initramfs_load_archive(initramfs, initrdPath) syslinux.boot_it(kernel, initramfs, "boot=live config union=overlayfs noswap edd=on nomodeset keyboard-model=abnt2 keyboard-layouts=br locales=en_US.UTF-8 nosplash noeject video=uvesafb:mode_option=800x600-16 i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=no fetch=ftp://192.168.10.10/filesystem.squashfs ocs_live_batch=\"no\" ocs_prerun1=\"mount -t cifs //192.168.10.10/Clonezilla /home/partimag -o user=cifsuser,password=cifspwd,sec=ntlm\" ocs_live_run=\"ocs-sr -g auto -e1 auto -e2 -j2 -p true -batch restoredisk ask_user sda\" ocs_live_extra_param=\"\"") ------------------------------------------------------------------------------ Thank you and my best regards to all! Leandro Becker
H. Peter Anvin
2016-Mar-02 22:24 UTC
[syslinux] Building a http query string including SMBIOS Serial Number to load a specific kernel
On 02/19/16 12:07, Leandro Becker via Syslinux wrote:> Hello folks, > > There is a way to get the system serial number from SMBIOS and pass it > as HTTP query string to get the kernel and initrd? > Something like this: > > LABEL OS Download > MENU LABEL Clonezilla > MENU INDENT 1 > KERNEL http://192.168.10.10/kernel.php?type=kernel ( > http://myserver/kernel.php?SN=SMBIOS_SERIAL_NUMBER&type=kernel > )&SN=SMBIOS_SERIAL_NUMBER > APPEND > initrd=http://192.168.10.10/kernel.php?type=initrd&SN=SMBIOS_SERIAL_NUMBER > boot=live ... > > I found that SYSAPPEND is able to get info from SMBIOS, but there is a > way to accomplish what I'm trying to do, i.e. replace > SMBIOS_SERIAL_NUMBER somehow with the real serial number? > Maybe Menu.c32 have a feature to do something like this? >We already pass this information as http cookies. -hpa
Apparently Analagous Threads
- Building a http query string including SMBIOS Serial Number to load a specific kernel
- Building a http query string including SMBIOS Serial Number to load a specific kernel
- Building a http query string including SMBIOS Serial Number to load a specific kernel
- Opus Audio Codec
- [PATCH 0/3] SMBIOS table passthrough support