Skip to content

Commit

Permalink
add option for legacy toolchain build on hudson
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Tester committed Dec 17, 2024
1 parent a1357e1 commit c24b764
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions hudson_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,29 +218,33 @@ def set_platform_args(self):
if os_platform == 'linux' and arch == 'armel':
os.environ['CROSS_COMPILE'] = '/usr/local/arm-2011.09/bin/arm-none-linux-gnueabi-'
if os_platform == 'linux' and arch == 'armhf':
# get built SDK from our AWS storage
# print("working dir is " + os.getcwd())
# print("running as " + os.getlogin())
# resource = boto3.resource('s3')
# bucket = resource.Bucket("linn-artifacts-private")
# fetched_path = "/home/hudson-smarties/yocto_sdk.sh"
# with open(fetched_path, "wb") as sdk_file:
# bucket.download_fileobj("yocto_core4_sdk/linn-fb-glibc-x86_64-linn-image-core-cortexa9t2hf-neon-linn-imx6dl-toolchain-5.15-kirkstone-0.0.24.sh", sdk_file)
# st = os.stat(fetched_path)
# os.chmod(fetched_path, st.st_mode | stat.S_IXUSR)

# subprocess.check_output(fetched_path + " -y -d /home/hudson-smarties/linn-fb/5.15-kirkstone", shell=True)

# Parse yocto environment file, set up for build
env_string = subprocess.check_output(". /opt/linn-fb/5.15-kirkstone/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi && env", shell=True)
for el in env_string.decode("utf-8").split("\n"):
if "=" in el:
os.environ[el.split("=")[0]] = el.split("=", 1)[1]
if os.environ.get("CC", None):
os.environ["CFLAGS"] = " ".join(os.environ["CC"].split(" ")[1:])
if os.environ.get("CXX", None):
os.environ["CXXFLAGS"] = " ".join(os.environ["CXX"].split(" ")[1:])
os.environ["LDFLAGS"] = '--sysroot=%s' % os.environ["SDKTARGETSYSROOT"]
if os.environ['LEGACY_BUILD'].lower() in ['true', 'yes', '1']:
# os.environ['CROSS_COMPILE'] = '/opt/gcc-linaro-5.3.1-2016.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-'
os.environ['CROSS_COMPILE'] = '/opt/gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-'
else:
# get built SDK from our AWS storage
# print("working dir is " + os.getcwd())
# print("running as " + os.getlogin())
# resource = boto3.resource('s3')
# bucket = resource.Bucket("linn-artifacts-private")
# fetched_path = "/home/hudson-smarties/yocto_sdk.sh"
# with open(fetched_path, "wb") as sdk_file:
# bucket.download_fileobj("yocto_core4_sdk/linn-fb-glibc-x86_64-linn-image-core-cortexa9t2hf-neon-linn-imx6dl-toolchain-5.15-kirkstone-0.0.24.sh", sdk_file)
# st = os.stat(fetched_path)
# os.chmod(fetched_path, st.st_mode | stat.S_IXUSR)

# subprocess.check_output(fetched_path + " -y -d /home/hudson-smarties/linn-fb/5.15-kirkstone", shell=True)

# Parse yocto environment file, set up for build
env_string = subprocess.check_output(". /opt/linn-fb/5.15-kirkstone/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi && env", shell=True)
for el in env_string.decode("utf-8").split("\n"):
if "=" in el:
os.environ[el.split("=")[0]] = el.split("=", 1)[1]
if os.environ.get("CC", None):
os.environ["CFLAGS"] = " ".join(os.environ["CC"].split(" ")[1:])
if os.environ.get("CXX", None):
os.environ["CXXFLAGS"] = " ".join(os.environ["CXX"].split(" ")[1:])
os.environ["LDFLAGS"] = '--sysroot=%s' % os.environ["SDKTARGETSYSROOT"]
if os_platform == 'linux' and arch == 'rpi':
os.environ['CROSS_COMPILE'] = '/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-'
if os_platform == 'linux' and arch == 'mipsel':
Expand Down

0 comments on commit c24b764

Please sign in to comment.