Skip to contentSkip to conversation

install: cannot create regular file Permission denied #dunfell

DISCUSSION Mahendra Sondagar 3 participants 4 messages Sep 14, 2022 – Sep 18, 2022

lore
Share & tools
lore
#0 lore raw

Hi.. there

Hope all are doing well

I'm working with the Yocto dunfell branch with the STM32MP1
My goal is to add the test.sh script in to the rootfs of the Yocto custom image (in to the bindir)

That's how, i have created the recipes file called "recipes-support" Inside that, i have created "net-cfg" file
the files under net-cfg file at where, i have kept test.sh file here is the tree structure

.

└── net-cfg
├── files
│   └── test.sh
└── net-cfg_1.0.bb

I have installed the image with the custom-image.bb file as a IMAGE_INSTALL += "net-cfg"

The content of the net-cfg_1.0.bb are as follows
--------------------------------------------------------------------------------------
SUMMARY= "Script files for the testing"
SRC_URI = " file://test.sh"

LICENSE = "CLOSED"

do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/test.sh ${D}${bindir} / }

FILES_${PN} += "${bindir}/test.sh"

--------------------------------------------------------------------------------------

During the baking the image, i got the error like *| install: cannot create regular file '/test.sh': Permission denied*

I have attached the full error logs here

Can any one help me here to figure out the issue ?

Thanks
Mahendra

Log data follows:

| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', '/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-core/glibc/glibc_2.31.bb:do_populate_sysroot', 'virtual:native:/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-devtools/gcc/gcc-runtime_9.3.bb:do_populate_sysroot', 'virtual:native:/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/meta/recipes-devtools/gcc/gcc-cross_9.3.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['quilt-native', 'glibc', 'patch-native', 'gcc-runtime', 'pseudo-native', 'gcc-cross-arm', 'automake-native', 'libtool-native', 'attr-native', 'autoconf-native', 'gnu-config-native', 'libgcc', 'linux-libc-headers', 'libmpc-native', 'mpfr-native', 'binutils-cross-arm', 'xz-native', 'texinfo-dummy-native', 'zlib-native', 'gmp-native', 'flex-native', 'gettext-minimal-native', 'm4-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: cannot create regular file '/test.sh': Permission denied
| install: omitting directory '/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/net-cfg/1.0-r0/image/usr/bin'
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/net-cfg/1.0-r0/temp/run.do_install.18252' failed with exit code 1

ERROR: Task (/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-custom/recipes-support/net-cfg/net-cfg_1.0.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3711 tasks of which 3710 didn't need to be rerun and 1 failed.
NOTE: The errors for this build are stored in /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/tmp/log/error-report/error_report_20220914181359.txt You can send the errors to a reports server by running:
send-error-report /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/tmp/log/error-report/error_report_20220914181359.txt [-s server]
NOTE: The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.

Summary: 1 task failed:
/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-custom/recipes-support/net-cfg/net-cfg_1.0.bb:do_install
Summary: There were 2 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

real 0m19.681s
user 0m1.373s
sys 0m0.199s

#1 lore raw
Quoted 27 lines · Mahendra Sondagar

Hi.. there

Hope all are doing well

I'm working with the Yocto dunfell branch with the STM32MP1
My goal is to add the test.sh script in to the rootfs of the Yocto custom image (in to the bindir)

That's how, i have created the recipes file called "recipes-support" Inside that, i have created "net-cfg" file
the files under net-cfg file at where, i have kept test.sh file here is the tree structure

.

└── net-cfg
    ├── files
    │   └── test.sh
    └── net-cfg_1.0.bb

I have installed the image with the custom-image.bb file as a IMAGE_INSTALL += "net-cfg"

The content of the net-cfg_1.0.bb are as follows
--------------------------------------------------------------------------------------
SUMMARY= "Script files for the testing"
SRC_URI = " file://test.sh"

Quoted 5 lines

LICENSE = "CLOSED"

do_install() {
        install -d ${D}${bindir}
        install -m 0755 ${WORKDIR}/test.sh ${D}${bindir} /

I don't think you intended to have this space here ^

That's why it is attempting to install test.sh to /

Steve

Quoted 25 lines

}

FILES_${PN} += "${bindir}/test.sh"

--------------------------------------------------------------------------------------

During the baking the image, i got the error like | install: cannot create regular file '/test.sh': Permission denied

I have attached the full error logs here

Can any one help me here to figure out the issue ?

Thanks
Mahendra

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#58042): https://lists.yoctoproject.org/g/yocto/message/58042
Mute This Topic: https://lists.yoctoproject.org/mt/93683834/3620601
Mute #dunfell:https://lists.yoctoproject.org/g/yocto/mutehashtag/dunfell Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
In reply to Mahendra Sondagar

Hi Mahendra,

Quoted 26 lines · Mahendra Sondagar

Hi.. there

Hope all are doing well

I'm working with the Yocto dunfell branch with the STM32MP1
My goal is to add the test.sh script in to the rootfs of the Yocto custom image (in to the bindir)

That's how, i have created the recipes file called "recipes-support" Inside that, i have created "net-cfg" file
the files under net-cfg file at where, i have kept test.sh file here is the tree structure

.

└── net-cfg
├── files
│   └── test.sh
└── net-cfg_1.0.bb

I have installed the image with the custom-image.bb file as a IMAGE_INSTALL += "net-cfg"

The content of the net-cfg_1.0.bb are as follows
--------------------------------------------------------------------------------------
SUMMARY= "Script files for the testing"
SRC_URI = " file://test.sh"

Quoted 5 lines

LICENSE = "CLOSED"

do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/test.sh ${D}${bindir} /

Spurious slash at the end of the line, it tries to install ${WORKDIR}/test.sh and ${D}${bindir} to / (root directory of your build machine).

Just remove it.

Cheers,
Quentin

#3 lore raw

Hi...Quentin Schulz

Thanks a lot!
It's solved my issue

Many thanks again :)

Regards
Mahendra

Quoted 46 lines · Quentin Schulz

Hi Mahendra,

Quoted 6 lines · Mahendra Sondagar

Hi.. there

Hope all are doing well

I'm working with the Yocto dunfell branch with the STM32MP1 My goal is to add the test.sh script in to the rootfs of the Yocto

custom image (in to the bindir)

Quoted 12 lines

That's how, i have created the recipes file called "recipes-support" Inside that, i have created "net-cfg" file
the files under net-cfg file at where, i have kept test.sh file here is the tree structure

.

└── net-cfg
├── files
│   └── test.sh
└── net-cfg_1.0.bb
Quoted 5 lines

I have installed the image with the custom-image.bb file as a IMAGE_INSTALL += "net-cfg"

The content of the net-cfg_1.0.bb are as follows

--------------------------------------------------------------------------------------

Quoted 8 lines

SUMMARY= "Script files for the testing"
SRC_URI = " file://test.sh"

LICENSE = "CLOSED"

do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/test.sh ${D}${bindir} /

Spurious slash at the end of the line, it tries to install ${WORKDIR}/test.sh and ${D}${bindir} to / (root directory of your build machine).

Just remove it.

Cheers,
Quentin