I'm using github.com/mendersoftware/meta-mender in my yocto build. I want to edit /etc/fstab using sed
with a bbappend file in my own layer. Specifically, meta-mender is currently supplying their own fstab file and editing it with a base-files_3.%.bbappend
, and I just want to remove the auto
keyword from the generated /etc/fstab.
The problem is that when I supply my own bbappend (my layer has a higher priority than meta-mender) in my layer for base-files_3.%.bbappend, the meta-mender fstab doesn't seem to be created at all, and the stock one from open-embedded is instead.
Here is my meta-layer/recipes-core/base-files/base-files_3.%.bbappend:
do_install_append(){
sed -i -e 's$.*@MENDER_BOOT_PART@.*$@MENDER_BOOT_PART@ /uboot @MENDER_BOOT_PART_FSTYPE@ defaults,sync 0 0$' ${D}${sysconfdir}/fstab
sed -i -e 's$.*@MENDER_DATA_PART@.*$@MENDER_DATA_PART@ /data @MENDER_DATA_PART_FSTYPE@ defaults 0 0$' ${D}${sysconfdir}/fstab
}
If I run bitbake -e base-files
, then look for the do_install function, you can clearly see that my sed
commands are correctly being appended to meta-mender/meta-mender-core/recipes-core/base-files/base-files_3:
do_install() {
for d in /boot /dev /bin /sbin /lib /etc /etc/default /etc/skel /lib /mnt /proc /home/root /run /usr /usr/bin /usr/share/doc/base-files-3.0.14 /usr/games /usr/include /usr/lib /usr/sbin /usr/share /usr/share/common-licenses /usr/share/dict /usr/share/info /usr/share/man /usr/share/misc /var /var/backups /var/lib /sys /var/lib/misc /var/spool /var/volatile /var/volatile/log /home /usr/src /var/local /media; do
install -m 0755 -d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image$d
done
for d in /tmp /var/volatile/tmp; do
install -m 1777 -d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image$d
done
for d in ; do
install -m 2775 -d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image$d
done
for d in log tmp; do
ln -sf volatile/$d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/var/$d
done
ln -snf ../run /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/var/run
ln -snf ../run/lock /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/var/lock
do_install_basefilesissue
rotation=`cat /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/rotation`
if [ "$rotation" != "0" ]; then
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/rotation /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/rotation
fi
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/fstab /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/fstab
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/filesystems /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/filesystems
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/usbd /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/default/usbd
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/profile /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/profile
sed -i 's#ROOTHOME#/home/root#' /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/profile
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/shells /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/shells
install -m 0755 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/share/dot.profile /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/skel/.profile
install -m 0755 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/share/dot.bashrc /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/skel/.bashrc
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/nsswitch.conf /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/nsswitch.conf
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/host.conf /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/host.conf
install -m 0644 /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/motd /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/motd
ln -sf /proc/mounts /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/mtab
install -d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/uboot
install -d /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/data
sed -i -e 's$.*@MENDER_BOOT_PART@.*$@MENDER_BOOT_PART@ /uboot @MENDER_BOOT_PART_FSTYPE@ defaults,sync 0 0$' /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/fstab
sed -i -e 's$.*@MENDER_DATA_PART@.*$@MENDER_DATA_PART@ /data @MENDER_DATA_PART_FSTYPE@ defaults 0 0$' /home/user/Desktop/yocto/build/tmp/work/raspberrypi3-poky-linux-gnueabi/base-files/3.0.14-r89/image/etc/fstab
}
And yet, my /etc/fstab looks like this:
# stock fstab - you probably want to override this with a machine specific one
/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs
mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
As you can see, it's completely skipping meta-menders' /etc/fstab file and just writing a stock one.
Well, what does .*@MENDER_BOOT_PART@.*
in your sed-expression evaluate to?
As far as I can see, you don't have anything matching either one of .*@MENDER_BOOT_PART@.*
nor.*@MENDER_DATA_PART@.*
in you fstab.
If my understanding is correct, you could just as use something similar to
echo "data" >> ${D}${sysconfdir}/fstab