Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-4966

Sanitize the content of First boot configuration to avoid having any carriage-return characters

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • None
    • Image Builder
    • None
    • Moderate
    • None

      Describe the problem

      If in a windows or dos environment someone created a shell script and then imported it as the first boot script, That may end up having one or more unwanted characters in it e.g. ^M and will fail the execution of custom-first-boot.service as well

      Steps to reproduce

      1.
      2.
      3.
      ...

      Actual Behavior:

       

      Manual execution looks something like this:

       

      # /usr/local/sbin/custom-first-boot 
      -bash: /usr/local/sbin/custom-first-boot: /bin/bash^M: bad interpreter: No such file or directory

       

      We can fix it by hand using dos2unix but that's not something really acceptable here.

      # dos2unix /usr/local/sbin/custom-first-boot
      dos2unix: converting file /usr/local/sbin/custom-first-boot to Unix format...
      # /usr/local/sbin/custom-first-boot
      + useradd -G wheel rhel-admin
      + /usr/sbin/chpasswd
      + echo rhel-admin:password@123
      + echo 'execution done and user rhel-admin has been created'
      + date
      #

      Request:

      The "First boot configuration" UI or IDE or the Image Builder service itself somehow do this dos2unix thing at the backend for any and every firstboot script before embedding it into an image.

       

       

              Unassigned Unassigned
              sraymaek Sanne Raymaekers
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: