Bug 1199014

Summary: Empty file support in <files>
Product: [openSUSE] openSUSE Distribution Reporter: Georg Pfuetzenreuter <georg.pfuetzenreuter>
Component: AutoYaSTAssignee: YaST Team <yast-internal>
Status: CONFIRMED --- QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P2 - High CC: jreidinger
Version: Leap 15.3   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Leap 15.3   
URL: https://trello.com/c/69mi5jJS
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Georg Pfuetzenreuter 2022-04-29 09:44:10 UTC
Hi,

an AutoYaST profile with the following block within a <files config:type="list"> section will not create the respective file on the installed system, making it not possible to create empty files during the first stage:

    <file>
      <file_contents><![CDATA[]]></file_contents>
      <file_owner>root:root</file_owner>
      <file_path>/var/adm/postfix.configured</file_path>
      <file_permissions>644</file_permissions>
    </file>

As confirmed in IRC,

22:20 <imobach> acidsys: reading the code, the reason might be that the file content is empty, hence it is not created at all
22:20 <imobach> acidsys: you might try to put some content on it (a comment, or just a blank line)

files with content are created with no issues:

    <file>
      <file_contents><![CDATA[### I am content!]]></file_contents>
      <file_owner>root:root</file_owner>
      <file_path>/var/adm/postfix.configured</file_path>
      <file_permissions>644</file_permissions>
    </file>

It's not a big issue for files which support arbitrary content or comments, but there may be cases empty files are wanted - in particular for installations which only utilize the first stage, and cannot run `touch` in a post script.

Thanks for checking!

Best,
Georg