md.jamal
md.jamal

Reputation: 4517

Updating the script present in Poky Source code

meta/recipes-core/initrdscripts/files/init-install-efi.sh is used for formatting and creating partitions.

I have modified this file to create one more partition for software update.

Can I copy the newly updated script file in my own custom layer recipes-core/initrdscripts/files/init-install-efi.sh.

Will it update the init-install-efi.sh. If not how to achieve this, I don't want to touch the poky source code, as that is fetched using repo utility

$ tree meta-ncr/
meta-ncr/
├── conf
│   ├── bblayers.conf
│   ├── layer.conf
│   └── machine
│       └── panther2.conf
├── recipes-core
│   └── initrdscripts
│       ├── files
│       │   └── init-install-efi.sh
│       └── initramfs-live-install-efi_1.0.bbappend
└── scripts
    └── setup-environment


$ cat meta-ncr/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"  
SRC_URI = "file://init-install-efi.sh"

After debugging, I found that it is copying the script present in the meta-intel layer and not of my layer.

This is from the output of bitbake-layers show-appends

initramfs-live-install-efi_1.0.bb:
  /home/jamal/repo_test/sources/meta-intel/recipes-core/initrdscripts/initramfs-live-install-efi_%.bbappend
  /home/jamal/repo_test/sources/meta-ncr/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend

Can you please tell me what changes are required for my bbappend to work instead of meta-intel

Upvotes: 0

Views: 579

Answers (1)

lukaszgard
lukaszgard

Reputation: 1011

Yocto provides bbappend mechanism to archive Your case without touching metadata from poky, please follow these few steps to archive this:

  1. create new layer or use Your existing one,
  2. in this layer create bbappend file for initramfs-module-install-efi_1.0.bb or initramfs-live-install-efi_1.0.bb (I found that this recipes are based on this script), with content:

    $ cat meta-test/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"  
    SRC_URI = "file://init-install-efi.sh"
    
  3. move modified script file under files directory, Your meta layer structure should look like:

    $ tree meta-test/
    meta-test/
    ├── conf
    │   └── layer.conf
    ├── COPYING.MIT
    ├── README
    └── recipes-core
        └── initrdscripts
            ├── files
            │   └── init-install-efi.sh
            └── initramfs-live-install-efi_1.0.bbappend
    

    4 directories, 5 files

Then finally after running do_unpack task on initramfs-live-install-efi recipe in working directory You will find Your modified file in recipe workspace,

    $ bitbake -c unpack initramfs-live-install-efi

Test:

    $ cat tmp/work/i586-poky-linux/initramfs-live-install-efi/1.0-r1/init-install-efi.sh 
    #!/bin/bash

    echo "hello"

FILESEXTRAPATHS - is used to extend search path for do_fetch and do_patch tasks.

Upvotes: 1

Related Questions