[syslinux] initramfs_init() changes in 6.04

Ferenc Wágner wferi at niif.hu
Thu Aug 2 10:06:53 PDT 2018


David Woodhouse <dwmw2 at infradead.org> writes:

> Commit 73fb321a5d56b ("lua: make initramfs structures full userdata
> objects with methods") broke my boot script, requiring a workaround
> along the lines of the patch below:
>
> Is this an intentional user-visible change? I note the documentation at
> https://www.syslinux.org/wiki/index.php?title=Lua.c32#Example:_Print_kernel.2Finitramfs_information_and_load_them
> hasn't been updated and still shows what to do for 6.03 without any
> hint that it won't be compatible with 6.04.

Hi!

Please accept my apologies.  This was an intentional API change, but it
wasn't intended to be user visible on the basis that nobody used it yet.
Frankly, I didn't expect anybody come after me almost four years after I
committed it...

> Also... if we are doing this, then why do we need to pass the first
> 'initramfs' argument into the initramfs.load() function? Surely it
> should have access to 'self' without the caller having to explicitly
> pass it in? Isn't that kind of the point?

Yes it is.  You have to use the Lua method syntax to achieve that as
shown in com32/lua/doc/syslinux.asc:

local sl = require "syslinux"

kernel = sl.loadfile "/SuSE-11.1/x86_64/linux"
print("File name: " .. kernel:name() .. " size: " .. kernel:size())

initrd1 = "/SuSE-11.1/x86_64/initrd"

initrd = sl.initramfs()
initrd:load(initrd1)
print ("File name: " .. initrd1 .. " size: " .. initrd:size())

sl.boot_it(kernel, initrd, "init=/bin/bash")

Please refer to the in-tree documentation in preference to the online
one.
-- 
Regards,
Feri



More information about the Syslinux mailing list