blob: 8fe9897c9b9bf48f9770ae3152d32eb1d1068ef2 [file] [log] [blame]
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ifeq ($(ROOTDIR),)
$(error $$ROOTDIR IS NOT DEFINED -- don\'t forget to source setup.sh)
endif
include $(ROOTDIR)/build/preamble.mk
fetch-bootloader:
$(LOG) bootloader fetch
wget -P $(PRODUCT_OUT)/packages \
-e robots=off -nv -A deb -r -np -nd \
https://mendel-linux.org/apt/$(RELEASE_NAME)-bsp-excelsior/pool/main/l/lk-bootloader/
wget -P $(PRODUCT_OUT)/packages \
-e robots=off -nv -A deb -r -np -nd \
https://mendel-linux.org/apt/$(RELEASE_NAME)-bsp-excelsior/pool/main/e/excelsior-bootloader/
$(LOG) bootloader fetch finished
bootloader: $(PRODUCT_OUT)/lk_2G.bin $(PRODUCT_OUT)/bl2_2G.img $(PRODUCT_OUT)/fip.bin $(PRODUCT_OUT)/u-boot-env.bin
fip-bin: $(PRODUCT_OUT)/fip.bin
u-boot-env-bin: $(PRODUCT_OUT)/u-boot-env.bin
$(PRODUCT_OUT)/lk_2G.bin: extract-lk
$(PRODUCT_OUT)/lk_1G.bin: extract-lk
ifeq ($(IS_JENKINS),)
extract-lk: lk-bootloader | out-dirs
else
extract-lk: fetch-bootloader | out-dirs
endif
$(LOG) lk.bin extract
find $(PRODUCT_OUT)/packages -name 'lk-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - --wildcards ./boot/lk_*.bin
$(LOG) lk.bin finished
ifeq ($(IS_JENKINS),)
$(PRODUCT_OUT)/fip.bin: excelsior-bootloader | out-dirs
else
$(PRODUCT_OUT)/fip.bin: fetch-bootloader | out-dirs
endif
$(LOG) fip.bin extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/fip.bin
$(LOG) fip.bin finished
$(PRODUCT_OUT)/bl2_2G.img: extract-bl2
$(PRODUCT_OUT)/bl2_1G.img: extract-bl2
ifeq ($(IS_JENKINS),)
extract-bl2: excelsior-bootloader | out-dirs
else
extract-bl2: fetch-bootloader | out-dirs
endif
$(LOG) bl2.img extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - --wildcards ./boot/bl2_*.img
$(LOG) bl2.img finished
ifeq ($(IS_JENKINS),)
$(PRODUCT_OUT)/u-boot-env.bin: excelsior-bootloader | out-dirs
else
$(PRODUCT_OUT)/u-boot-env.bin: fetch-bootloader | out-dirs
endif
$(LOG) u-boot-env.bin extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/u-boot-env.bin
$(LOG) u-boot-env.bin finished
.PHONY:: bootloader fip-bin u-boot-env-bin fetch-bootloader extract-bl2 extract-lk