#### # Copyright 2021 Intel Corporation # # Add a class to support serving license info through bmcweb. # # bmcweb serves static content from the /usr/share/www folder, so this class # copies the license info from /usr/share/common-licenses to # /usr/share/www/common-licenses so it will be statically served by bmcweb. # # Requires 'COPY_LIC_DIRS' to be enabled to create /usr/share/common-licenses. # # Class can be inherited in a project bbclass to copy the license info. # # Example: # inherit license_static #### STATIC_LICENSE_DIR = "${IMAGE_ROOTFS}${datadir}/www/common-licenses" def add_index_html_header(f): f.write("") f.write("") f.write("
") f.write("") def add_index_html_footer(f): f.write("
") f.write("") f.write("") def create_index_files(d): import os static_license_dir = d.getVar('STATIC_LICENSE_DIR') for dirpath, dirnames, filenames in os.walk(static_license_dir): with open(os.path.join(dirpath, "index.html"), "w") as f: add_index_html_header(f) full_list = filenames+dirnames full_list.sort() f.write("