Bug 1187594 - Can no longer use XInclude in autoyast
Can no longer use XInclude in autoyast
Status: NEW
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: AutoYaST
Leap 15.3
Other openSUSE Leap 15.3
: P5 - None : Normal (vote)
: ---
Assigned To: Imobach Gonzalez Sosa
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-22 12:36 UTC by Jarrod Johnson
Modified: 2022-10-27 07:41 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarrod Johnson 2021-06-22 12:36:45 UTC
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0
Build Identifier: 

In previous versions, I've been using xinclude, e.g.:
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns" xmlns:xi="http://www.w3.org/2001/XInclude">
      <timezone>
        <hwclock>UTC</hwclock>
        <xi:include href="file:///tmp/timezone"/>
      </timezone>
...

However, now that fails the xml validation now and the installer refuses to take it


Reproducible: Always

Steps to Reproduce:
1.Try to use Xinclude
2.
3.
Actual Results:  
Autoyast refuses to accept it
/root/autoyast.xml:11:50: error: element "xi:include" not allowed here; expected the element end-tag or element "timezone"


Expected Results:  
Able to include xml files as was used earlier

Not applicable
Comment 1 Imobach Gonzalez Sosa 2021-06-22 13:46:46 UTC
Hi Jarrod,

Sorry, but it looks like the validation is getting in your way. You can disable it by setting YAST_SKIP_XML_VALIDATION to 1 as a boot parameter.

We will have a deeper look into the bug report (actually the use of xi:include is not event documented in the manual, and it should).

Regards,
Imo
Comment 2 Jarrod Johnson 2021-06-22 13:49:16 UTC
Thanks, also the 'interepreter' tag under a script entry (which is half-documented, it's shown in example and mentioned, though it didn't have a specific tag itself) is also flagged by the validation.
Comment 3 Imobach Gonzalez Sosa 2021-06-23 05:17:28 UTC
(In reply to Jarrod Johnson from comment #2)
> Thanks, also the 'interepreter' tag under a script entry (which is
> half-documented, it's shown in example and mentioned, though it didn't have
> a specific tag itself) is also flagged by the validation.

Bear in mind that in case of "init-scripts", the "interpreter" is not allowed[1].

[1] https://documentation.suse.com/sles/15-SP3/single-html/SLES-autoyast/#init-scripts
Comment 4 Jarrod Johnson 2021-06-23 11:26:52 UTC
Ah, not sure why it was defined in our init-scripts section, particularly since all it did was specify the default.

Also, fyi, I have moved away from using xinclude.

Sorry about going off-topic again, but I was wondering what processes the xml before it arrives in /tmp/profile/autoinst.xml? It seems to have some processing done including discard of all comments. This isn't new, but it was a first thought when I considered an alternative to xinclude since all my include content was handled in a pre script. Let me know an alternative preferred channel, like a chat system if you want me to stop cluttering bugs with comments.
Comment 5 Jarrod Johnson 2021-06-23 12:27:57 UTC
Also note, disabling validation didn't cause the include to resolve, they became <include/> tag literals rather than including now. Hence me going to replace xinclude with something else.
Comment 6 Imobach Gonzalez Sosa 2021-06-23 14:39:12 UTC
Hi Jarrod,

Yes, I think xi:include is simply not supported. In order to have "dynamic" profiles you have several mechanisms. Check the "Managing mass installations with dynamic profiles" section: https://documentation.suse.com/sles/15-SP3/single-html/SLES-autoyast/#part-dynamic-profiles

About the profile mangling, you are right: it is processed (imported to an internal representation) and written again. So comments are gone and some elements (like typing attributes) are added.

If you want to have a conversation about this, feel free to join us in IRC (libera.chat server, channel #yast). Or, if you prefer, you can reach us on Discord.

https://en.opensuse.org/openSUSE:Communication_channels

I will keep the bug open by now.
Comment 7 Stefan Schubert 2022-10-27 07:41:43 UTC
Just a hint. I have had the same issue around docbook. I have fixed it by using
docbookxi.rng instead of the "normal" docbook.rng for the checks. Maybe some parts of docbookxi.rng are missed in the autoyast RNG file.