Closed rmetrich closed 2 years ago
cc @martinezjavier
@rmetrich did you try adding the target
keyword to the defaultboot
section ? i.e:
[defaultboot]
defaultmenu=blsmenu
target=/boot
:blsmenu
1="bls1"
prompt=1
timeout=5
secure=auto
Yep, fails because of incompatible keywords:
# zipl -V -b . -c zipl.conf.menu --dry-run
Using config file 'zipl.conf.menu' (from command line)
Using BLS config file './bls1.conf'
Error: Config file 'zipl.conf.menu': Line 3: Only one of keywords 'default', 'defaultmenu' and 'target' allowed in section 'defaultboot'
Yep, fails because of incompatible keywords:
Sigh, I'll investigate. Wonder if this is a corner case that's not correctly handled by BLS.
I see this code:
1803 static int
1804 get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
1805 {
:
1871 rc = scan_check(scan);
1872 if (rc) {
1873 error_text("Config file '%s'", filename);
1874 scan_free(scan);
1875 return rc;
1876 }
1877 rc = scan_check_bls(scan);
1878 if (rc) {
1879 error_text("BLS parsing '%s'", blsdir);
1880 scan_free(scan);
1881 return rc;
1882 }
Adding a breakpoint at the time the error occurs shows we have the following backtrace:
(gdb) bt
#0 scan_check_section_data (keyword=<optimized out>, line=0x3ffffffeb40, name=0x2aa00032e00 "bls1",
section_line=<optimized out>, type=0x3ffffffeb3c) at scan.c:1047
#1 0x000002aa00007936 in check_section (scan=<optimized out>, index=<optimized out>) at scan.c:1419
#2 0x000002aa00007ed2 in scan_check (scan=scan@entry=0x2aa000328a0) at scan.c:1639
#3 0x000002aa0000b27a in get_job_from_config_file (job=0x2aa000322a0, cmdline=0x3ffffffedb8) at job.c:1871
#4 job_get (argc=<optimized out>, argv=<optimized out>, data=<optimized out>) at job.c:1936
#5 0x000002aa00003746 in main (argc=<optimized out>, argv=0x3fffffff2f8) at zipl.c:144
So clearly the scan_check_bls() which apparently sets the target keyword doesn't even run (it's on line 1877 and we die returning from line 1871).
So the problem is that when using the following:
[defaultboot]
defaultauto
target=/boot
the IPL sections inherit the target
field but that's not the case when using a menu, like in your example:
[defaultboot]
defaultmenu=blsmenu
:blsmenu
1="bls1"
target=/boot
I think the correct thing to do would be to not make the target
field a requirement for IPL sections but instead making it optional and fill with the default section target
if is not present.
Ok, I looked a little bit more to this today and probably what we should do is to make the IPL sections created from BLS snippets to inherit the target
field defined in either the defaultmenu
or defaultboot
sections. By doing that, we can keep this field to be required when checking the sections.
I'll work on a patch for this.
@stefan-haberland could you please take a look to the mentioned pull-request #113 ?
@martinezjavier Thanks for the code. I am just back at work and noticed your pull request. I already had a quick look but I will have a closer look this week.
@stefan-haberland great, thanks a lot!
Trying to create a menu sourcing one of more BLS entries, zipl fails to generate the configuration and reports this:
The official documentation https://www.ibm.com/docs/en/linux-on-systems?topic=loader-bls-files has been followed.
Reproducer
bls1.conf
zipl.conf.menu
Source code (scan.c)
Executing the command under GDB shows that type is section_ipl, which indeed requires the target keyword:
The command fails as soon as BLS entries are read.