LAT: kickstart ordering is broken for > 10 '%post' sections

Bug #2012447 reported by Li Zhou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Li Zhou

Bug Description

Brief Description
Kickstart section ordering is broken when there are more than 10 '%post' sections in the kickstart.cfg.

The `ks_parse_hook` function (defined in `lat-installer.hook`) uses sed to chop up the kickstart.cfg by the given section, creating a separate file for each section. There is an index variable that increments for each section it finds, and it creates a file based on that index.
And we end up with this structure:
     lat_post_nochroot_script/
      * 10_script
      * 3_script
      * 4_script
      * 5_script
      * 7_script
      * 8_script
      * 9_script
     lat_post_script/
      * 0_script
      * 1_script
      * 2_script
      * 6_script
The issue is that in lat-installer.sh, where it executes these scripts, the string '10' is lexicographically ahead of '1', '2,', ... etc. So the 10_script is executed ahead of the other lat_post_nochroot_script files.

Severity
Minor-to-Major. Unexpected ordering, Could cause unexpected breakage.

Steps to Reproduce
Use more than 10 '%post' sections inside the kickstart.

Expected Behavior
The scripts should be executed by order of appearance inside the kickstart.cfg

Actual Behavior
Sections are executed out of order.

Reproducibility
Reproducible

System Configuration
All

Last Pass
No

Timestamp/Logs
n/a

Alarms
n/a

Test Activity
Sanity,Regression Testing

Workaround
Use < 10 %post sections

Li Zhou (lzhou2)
Changed in starlingx:
assignee: nobody → Li Zhou (lzhou2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to integ (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/integ/+/878184

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to integ (master)

Reviewed: https://review.opendev.org/c/starlingx/integ/+/878184
Committed: https://opendev.org/starlingx/integ/commit/e02268a95d0cde46d365209f712cb9ff75261fec
Submitter: "Zuul (22348)"
Branch: master

commit e02268a95d0cde46d365209f712cb9ff75261fec
Author: Li Zhou <email address hidden>
Date: Tue Mar 21 09:27:11 2023 +0800

    installer: inc number of digits in scripts' names

    The sections in kickstart cfg file are chopped up into scripts
    named with number increased.
    They are executed in the default sequence of 'ls' output, which
    aren't aligned with the number in names when the number in name
    is 10 and above.
    To make the scripts run in sequence according to their names,
    increase the number of digits in the names, so that 'ls' can list
    them in number sequence.

    Test plan:
     - PASS: Check about the installation log that "hook script"/"pre
       install script"/"post install script"/"post install nochroot script"
       run in right number sequence.
     - PASS: AIO-DX lib installation succeeds.

    Closes-bug: 2012447

    Signed-off-by: Li Zhou <email address hidden>
    Change-Id: I80801d4c53dbb1867028f64d9bf51a774b8e12e7

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.9.0 stx.integ
Changed in starlingx:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.