From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 182AEE00D63; Wed, 4 Oct 2017 13:40:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [209.85.220.195 listed in list.dnswl.org] * 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source * [209.85.220.195 listed in dnsbl.sorbs.net] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 541C1E00BE8 for ; Wed, 4 Oct 2017 13:40:58 -0700 (PDT) Received: by mail-qk0-f195.google.com with SMTP id 17so1851707qkq.5 for ; Wed, 04 Oct 2017 13:40:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization; bh=MALydtCeo0tJ8JefxQrqW1zlfR6L63yG+avnthxf+uk=; b=uRf1Ge/7i72ruEfanK4kNW4DE7tn1pZy7H+f2v0iGdRN3fJRcoLj7xtrzcwj9VhNP0 L1LP/2HYHJOM/XeZ2ChG9EZ9/mhL4a7Z17X1zEHV4XmAeAC8oqQUAzyCIxpGCnFAgZKL u8lV6x3TcDwcABmydf02ljuTXB+BHiXvcsGes638N0tb8MqT9DsqQbLj6Fg4DKnxvem9 kHUu5MunbzqynTDrkwQXiPotDPBpk0S2xKqICSAU2S0NCE+6GLubUMkCngrM30N+6m7k 72EI8H0XuB39VRaWHVtDj7KmC6pZ6I4wmur+lkQlE9pDxIawPoCMx2hX1aKPGN9QL143 yECg== X-Gm-Message-State: AMCzsaUkHHglCtXCE356xW7PZ4maInKTeURcycF0hloMlpkpZsyc/gvx x1Ze4b0lbdOXZNORy+029qlfBQ== X-Google-Smtp-Source: AOwi7QBk7+Ggrq7Voz6Sv9myOmWiYBpuYgltXo7fmb8eESaSJxOd5zFXPOrqLtuU59sLrIX3sU//Yw== X-Received: by 10.55.197.9 with SMTP id p9mr1688246qki.113.1507149657139; Wed, 04 Oct 2017 13:40:57 -0700 (PDT) Received: from localhost.localdomain ([181.220.79.73]) by smtp.gmail.com with ESMTPSA id y10sm10291486qkl.5.2017.10.04.13.40.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2017 13:40:56 -0700 (PDT) Received: by localhost.localdomain (sSMTP sendmail emulation); Wed, 04 Oct 2017 17:40:48 -0300 From: Otavio Salvador To: meta-freescale Mailing List Date: Wed, 4 Oct 2017 17:40:48 -0300 Message-Id: <20171004204048.5246-1-otavio@ossystems.com.br> X-Mailer: git-send-email 2.14.2 Organization: O.S. Systems Software LTDA. Cc: Otavio Salvador Subject: [PATCH] imx-base.inc: Generate a default IMAGE_BOOT_FILES X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 20:40:59 -0000 When the machine requires a boot partition, it needs to define the IMAGE_BOOT_FILES to include the device tree files and Linux kernel image. This is essentially a generic solution so instead of defining it for all machines we are providing a default value for them. To implement that, we borrowed an utility function from Raspberry Pi BSP. It is copied as is at conf/machine/include/utilities.inc file. Signed-off-by: Otavio Salvador --- conf/machine/include/imx-base.inc | 7 +++++++ conf/machine/include/utilities.inc | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 conf/machine/include/utilities.inc diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 06f93fcb..c96216de 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -3,6 +3,8 @@ include conf/machine/include/fsl-default-settings.inc include conf/machine/include/fsl-default-versions.inc +require conf/machine/include/utilities.inc + # Set specific make target and binary suffix PREFERRED_PROVIDER_u-boot ??= "u-boot-fslc" PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-fslc" @@ -226,6 +228,11 @@ SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot-mxsboot-sdcard sdcard.gz" SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4" IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" +IMAGE_BOOT_FILES ?= " \ + ${KERNEL_IMAGETYPE} \ + ${@make_dtb_boot_files(d)} \ +" + ### wic default support WKS_FILE_DEPENDS ?= " \ virtual/bootloader \ diff --git a/conf/machine/include/utilities.inc b/conf/machine/include/utilities.inc new file mode 100644 index 00000000..bcb1c2a7 --- /dev/null +++ b/conf/machine/include/utilities.inc @@ -0,0 +1,28 @@ +### Machine definition file utilities + +def make_dtb_boot_files(d): + # Generate IMAGE_BOOT_FILES entries for device tree files listed in + # KERNEL_DEVICETREE. + alldtbs = d.getVar('KERNEL_DEVICETREE') + imgtyp = d.getVar('KERNEL_IMAGETYPE') + + def transform(dtb): + if dtb.endswith('dtb'): + # eg: whatever/bcm2708-rpi-b.dtb has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb + # destination: bcm2708-rpi-b.dtb + base = os.path.basename(dtb) + src = '{}-{}'.format(imgtyp, base) + dst = base + return '{};{}'.format(src, dst) + elif dtb.endswith('dtbo'): + # overlay dtb: + # eg: overlays/hifiberry-amp.dtbo has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo + # destination: overlays/hifiberry-amp.dtbo + base = os.path.basename(dtb) + src = '{}-{}'.format(imgtyp, base) + dst = dtb + return '{};{}'.format(src, dtb) + + return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) -- 2.14.2