I have made some progress but still have an issue. First to create an user we need expect. I add it to my local.conf. Under the script that work (tested on the card) :

     #!/usr/bin/expect -f
     spawn echo script for create samba user
     spawn smbpasswd -a sambaUser
     expect "New SMB password:"
     send "myPassword\n"
     expect "Retype new SMB password:"
     send "myPassword\n"
     interact
     spawn echo end of script
Then i have modified my recipe to add this script and launch it at first boot :

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

# Add custom smb.conf file to samba recipe
SRC_URI += "file://22-samba-conf.patch \
file://createUserSamba.sh \
  "

do_install_append () {
install -m 0755 ${WORKDIR}/createUserSamba.sh ${D}${sysconfdir}/samba
}

pkg_postinst_samba () {
/etc/samba/createUserSamba.sh
}

But this don't work ! Do you have some advices to resolve this please ?

regards

Mickael.

Le Mon, 12 Jun 2017 21:30:55 +0200, idealsim <ideal...@laposte.net> a écrit:


Hi, i'm trying to configure a samba server from yocto for my card. I have a working server (add samba in local.conf), but i would like to add the user >with password to samba at yocto build step. For this i add this recipe (samba_%.bbappend)
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

# Replace default smb.conf file to /etc/samba with my custom
SRC_URI += "file://22-samba-conf.patch"

pkg_postinst_${PN} () {
   smbpasswd -a sambaUser -s
   echo Password
   echo Password
   echo
}


For that i use pkg_postinst () but i don't know if i use it correctly (for the moment this won't work) ! At first boot time i need to execute #smbpasswd in >shell to activate the user in Samba. If someone can help to configure it in yocto recipe ?

regards

Mickael



--
Utilisant le logiciel de courrier d'Opera : http://www.opera.com/mail/
-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to