Hi Richard

   To fix this issue, I also have another method. To touch empty .vimrc to 
avoid "Failed to source defaults.vim" error

   And the patch will like this
diff --git a/meta/recipes-support/vim/vim-tiny_9.2.bb 
b/meta/recipes-support/vim/vim-tiny_9.2.bb
index e4c26d23f6..33cc481271 100644
--- a/meta/recipes-support/vim/vim-tiny_9.2.bb
+++ b/meta/recipes-support/vim/vim-tiny_9.2.bb
@@ -6,6 +6,15 @@ PACKAGECONFIG += "tiny"

 do_install() {
     install -D -m 0755 ${S}/src/vim ${D}/${bindir}/vim.tiny
+
+    # Add ".vimrc" file to avoid "Failed to source defaults.vim" error
+    # For root user
+    touch ${D}/root/.vimrc
+
+    # For non-root user
+    install -d ${D}/etc/skel
+    touch ${D}/etc/skel/.vimrc
+
 }

Is this method OK?

Zheng

________________________________
From: Richard Purdie <[email protected]>
Sent: Monday, June 1, 2026 1:26
To: Zheng, Ruoqin/郑 若钦 <[email protected]>; 
[email protected] 
<[email protected]>
Subject: Re: [OE-core][PATCH] vim-tiny: bugfix lack of defaults.vim

On Thu, 2026-05-28 at 10:06 +0800, zhengruoqin via lists.openembedded.org wrote:
> When vim-tiny was used in image, it lacks defaults.vim file which will cause 
> following error
> root@qemux86-64:~# vi
> E1187: Failed to source defaults.vim
> Press ENTER or type command to continue
>
> So add vim-common as RDEPENDS to provide defaults.vim file to fix this issue.
>
> Signed-off-by: Zheng Ruoqin <[email protected]>
> ---
>  meta/recipes-support/vim/vim-tiny_9.2.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-support/vim/vim-tiny_9.2.bb 
> b/meta/recipes-support/vim/vim-tiny_9.2.bb
> index e4c26d23f6..b6ddded381 100644
> --- a/meta/recipes-support/vim/vim-tiny_9.2.bb
> +++ b/meta/recipes-support/vim/vim-tiny_9.2.bb
> @@ -8,5 +8,7 @@ do_install() {
>      install -D -m 0755 ${S}/src/vim ${D}/${bindir}/vim.tiny
>  }
>
> +RDEPENDS:${PN} += "vim-common"
> +
>  ALTERNATIVE_PRIORITY = "90"
>  ALTERNATIVE_TARGET = "${bindir}/vim.tiny"

Doesn't adding dependencies like this defeat the point of vim-tiny in the first 
place?

Can we configure that out instead?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#237807): 
https://lists.openembedded.org/g/openembedded-core/message/237807
Mute This Topic: https://lists.openembedded.org/mt/119524274/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to