c9979f4 kata-osbuilder: Fix distro detection os CentOS

Authored and Committed by Fabiano FidĂȘncio 3 years ago
    kata-osbuilder: Fix distro detection os CentOS
    
    In order to detect the distro the script is running on, the following
    command is used: `grep '^ID' /etc/os-release | awk '{print $2}' FS='='`.
    
    Although it works quite well with Fedora, RHEL, RHCOS, it just breaks on
    CentOS, and the reason is that the CentOS' os-release file has an
    ID_LIKE field, as show below:
    ```
    [root@centos8 kata-osbuilder]# grep '^ID' /etc/os-release
    ID="centos"
    ID_LIKE="rhel fedora"
    ```
    
    A simple way to avoid this grep to also return the ID_LIKE content is to
    be a little bit more specific and grep by '^ID='.
    
    Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
    
        
file modified
+1 -1