From a1a0f6bf4890ddedf30fdd629c495c0a82b4c23c Mon Sep 17 00:00:00 2001 From: Skip Hansen Date: Tue, 12 May 2020 19:32:36 -0700 Subject: [PATCH 1/3] Optionally allow checkout commits and BR2_EXTERNAL to be specified. --- scripts/build-linux.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index ef9cf5db9..4a3b6feab 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -235,6 +235,10 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then cd $(dirname $BD_SRC) echo "Downloading Buildroot code." git clone $BD_REMOTE $BD_SRC + cd $BD_SRC + if [ x$BD_COMMIT != x ]; then + git checkout $BD_COMMIT + fi ) fi @@ -243,6 +247,9 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then cd $(dirname $LLV_SRC) echo "Downloading Linux on LiteX-VexRiscv code." git clone $LLV_REMOTE $LLV_SRC + if [ x$LLV_COMMIT != x ]; then + (cd $LLV_SRC; git checkout $LLV_COMMIT) + fi ) fi @@ -258,7 +265,11 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then dtc -I dts -O dtb -o $TARGET_LINUX_BUILD_DIR/rv32.dtb $TARGET_LINUX_BUILD_DIR/rv32.dts cd $BD_SRC - make BR2_EXTERNAL=$LLV_SRC/buildroot/ litex_vexriscv_defconfig + if [ "x$BR2_EXTERNAL" = "x" ]; then + make BR2_EXTERNAL=$LLV_SRC/buildroot/ litex_vexriscv_defconfig + else + make litex_vexriscv_defconfig + fi time make ls -l $BD_SRC/output/images/ ln -sf $BD_SRC/output/images/Image $TOP_DIR/$FIRMWARE_FILEBASE.bin From db0b3de2a23d7464531e61cc52fd5bd0fac2daf2 Mon Sep 17 00:00:00 2001 From: Skip Hansen Date: Thu, 14 May 2020 10:35:34 -0700 Subject: [PATCH 2/3] Incorporate review comments. --- scripts/build-linux.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 4a3b6feab..16db2e0ec 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -235,9 +235,8 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then cd $(dirname $BD_SRC) echo "Downloading Buildroot code." git clone $BD_REMOTE $BD_SRC - cd $BD_SRC if [ x$BD_COMMIT != x ]; then - git checkout $BD_COMMIT + (cd $BD_SRC; git checkout $BD_COMMIT) fi ) fi @@ -265,10 +264,10 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then dtc -I dts -O dtb -o $TARGET_LINUX_BUILD_DIR/rv32.dtb $TARGET_LINUX_BUILD_DIR/rv32.dts cd $BD_SRC - if [ "x$BR2_EXTERNAL" = "x" ]; then - make BR2_EXTERNAL=$LLV_SRC/buildroot/ litex_vexriscv_defconfig - else + if [ "$(bash -c 'echo ${x$BR2_EXTERNAL}')" ]; then make litex_vexriscv_defconfig + else + make BR2_EXTERNAL=$LLV_SRC/buildroot/ litex_vexriscv_defconfig fi time make ls -l $BD_SRC/output/images/ From ff7e47a980cce5d1241a3a314956156cace3856a Mon Sep 17 00:00:00 2001 From: Skip Hansen Date: Fri, 15 May 2020 07:04:24 -0700 Subject: [PATCH 3/3] Incorporate more review comments. --- scripts/build-linux.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 16db2e0ec..0ac712769 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -264,11 +264,7 @@ if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT:-0} = 1 ]; then dtc -I dts -O dtb -o $TARGET_LINUX_BUILD_DIR/rv32.dtb $TARGET_LINUX_BUILD_DIR/rv32.dts cd $BD_SRC - if [ "$(bash -c 'echo ${x$BR2_EXTERNAL}')" ]; then - make litex_vexriscv_defconfig - else - make BR2_EXTERNAL=$LLV_SRC/buildroot/ litex_vexriscv_defconfig - fi + make BR2_EXTERNAL=${BR2_EXTERNAL:-$LLV_SRC/buildroot} litex_vexriscv_defconfig time make ls -l $BD_SRC/output/images/ ln -sf $BD_SRC/output/images/Image $TOP_DIR/$FIRMWARE_FILEBASE.bin