Re: [yocto] Setting the nodatacow flag on a BTRFS directory
On Mon, Jun 5, 2023 at 4:30 AM Ross Burton wrote: > On 26 May 2023, at 16:23, James Puderer via lists.yoctoproject.org > wrote: > > > > Hello all, > > > > I'm trying to figure out how to set the `nodatacow` flag on a directory > in a BTRFS image at build time. Normally this is done by running 'chattr > +c '. Unfortunately, this doesn't seem to be something supported by > fakeroot/pseudo. I would really like to avoid doing it at runtime, or > mounting the filesystem in loopback mode (requires root). > > > > This seems like something that Yocto *should* be able to do. Am I > missing something? If not, what would be the correct place to implement > something like this? > > When and how are you trying to do this? If it’s at rootfs time then the > rootfs isn’t yet in the target btrfs format but simply a directory on in > your build tree, and you’ll need to test that the attrs survive the > transition from a directory to a btrfs image. > Right, I'm *trying* doing this at image build time. I've tried doing it by adding file named base-files_%.bbappend to one of my layers: DEPENDS:append = " e2fsprogs-native" do_install:append() { # Disable COW on journal mkdir -p ${D}${localstatedir}/log/journal chattr.e2fsprogs +C ${D}/var/log/journal } Now, as I said, this doesn't work, since this chattr flag isn't captured by pseudo, and my underlying ext4 file system doesn't support this flag either (so it results in an error). chattr.e2fsprogs: Operation not supported while setting flags on /home/jpuderer/target/build/tmp-glibc/work/nxp_s32g-wrs-linux/base-files/3.0.14-r89/image/var/log/journal I would *like* it if there was a way to make pseudo capture the chattr flag in the way similar to how pseudo currently captures extended file attributes (which is used by things like SELinux and IMA). Failing that, I'm hoping for some guidance on what the best way to accomplish something like this at build time would be. Doing it at first boot is not a great solution IMHO, since you're really just pushing part of your build process into the first boot. -- James -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#60183): https://lists.yoctoproject.org/g/yocto/message/60183 Mute This Topic: https://lists.yoctoproject.org/mt/99151943/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[yocto] Setting the nodatacow flag on a BTRFS directory
Hello all, I'm trying to figure out how to set the `nodatacow` flag on a directory in a BTRFS image at build time. Normally this is done by running 'chattr +c '. Unfortunately, this doesn't seem to be something supported by fakeroot/pseudo. I would really like to avoid doing it at runtime, or mounting the filesystem in loopback mode (requires root). This seems like something that Yocto *should* be able to do. Am I missing something? If not, what would be the correct place to implement something like this? Thanks, James -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#60130): https://lists.yoctoproject.org/g/yocto/message/60130 Mute This Topic: https://lists.yoctoproject.org/mt/99151943/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[yocto] How to enable and disable device tree node at runtime from linux userspace #dunfell
Hai All, I wanted to use a GPIO to put the SOM into sleep mode and again use it to wake it up from the sleep. I used the below node to configure the SOM to use the GPIO1 18 to wake up from sleep. keys { compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <_gpio_userkeys> ; wakeup { gpios = < 18 GPIO_ACTIVE_LOW>; linux,code = ; gpio-key,wakeup; }; } But again to put into sleep I am unable to read the GPIO state from linux userspace as it is used by driver. I am using libgpiod to read the gpio status for which I am getting device or resource busy error # gpioget gpiochip0 18 gpioget: error reading GPIO values: Device or resource busy How to disable the device tree node from linux user space so it is possible to read the GPIO staus. And onces the button is pressed enable the device tree node and enter the sleep mode so the driver will take care of waking of the SOM. Or Any other way to force read the status of GPIO status Regards, James A -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#54923): https://lists.yoctoproject.org/g/yocto/message/54923 Mute This Topic: https://lists.yoctoproject.org/mt/85992941/21656 Mute #dunfell:https://lists.yoctoproject.org/g/yocto/mutehashtag/dunfell Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-