litex-hub / linux-on-litex-vexriscv

Linux on LiteX-VexRiscv
BSD 2-Clause "Simplified" License
553 stars 174 forks source link

Buildroot: Add python script to build Linux images. #232

Open enjoy-digital opened 3 years ago

enjoy-digital commented 3 years ago

Could be used to generate the Linux images daily?/weekly?/monthly? on a local machine or on CI.

enjoy-digital commented 2 years ago

This has been done for a client and could be integrated here:

# Linux Build --------------------------------------------------------------------------------------

def linux_clean():
    if os.path.exists("third_party/buildroot"):
        os.chdir("third_party/buildroot")
        os.system("make clean")

def linux_build():
    # Be sure third_party dir is present and switch to it.
    create_third_party_dir()
    os.chdir("third_party")

    # Get Buildroot.
    if not os.path.exists("buildroot"):
        os.system("git clone http://github.com/buildroot/buildroot")
    os.chdir("buildroot")

    # Configure Buildroot.
    os.system("make BR2_EXTERNAL=../../buildroot/ litex_vexriscv_defconfig")

    # Build Linux Images.
    os.system("make")

    # Copy Linux Images.
    os.system("cp output/images/* ../../images/")