How to add users at build time via Yocto?
Your question seems to consists of two parts:
How to add a user
The
useradd
part in your example is doing this already; look into the/etc/passwd
file and you will find theuser1
How to set the password
You have to specify the password with the
-p
option and ensure that a login shell (and e.g. not/bin/false
) has been given:
USERADD_PARAM_${PN} = "-s /bin/bash -p '$1$HzRkQcjT$/jV0VB4GJd1b3DTXfCYNo.' user1"
But in most cases you do not need step 2 because there are usually only service users but no ordinary users on embedded systems.
yocto kernel module recipe
You have
inherit module
in your recipe. This means you do have both do_compile() and do_install(): see meta/classes/module.bbclass.You have not actually explained what your issue is?
module class inherits kernel-module-split class: this will create one package per built module, generating package names from module names, and setting FILES_* variables as needed. The RPROVIDES line seems to be just saying that one of the generated packages ("kernel-module-foo") can also be referred to with the name "${PN}".
See https://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules for more details
Where is cups-pdf.ppd file?
I found it in directory /etc/cups/ppd
.
Home directory not created by useradd-example.bb
I'm not sure if it's a clean way but I ended up creating the home directories as follows:
do_install () {
install -d -m 711 ${D}/home/user1
chown -R user1 ${D}/home/user1
chgrp -R user1 ${D}/home/user1
}
Important lesson learned: If you plan to move files into the created home directory from another recipe, make sure that the directories you create there match the permissions as they are set here. Otherwise you will get an error saying that there are conflicting directories.
Related Topics
Opening New Gnome-Terminal (V3.28+) with Multiple Tabs and Different Commands
Export_Symbol in Kernel Module | Undefined Symbol During Insmod
Differentiate Between Exit and Session Timeout
R Package Installation in Linux
Comparison of Cat Pipe Awk Operation to Awk Command on a File
In Bash How to Split a Column in Several Column of Fixed Dimension
Gnu Assembler .Data Section Value Corrupted After Syscall
Copying Files from Multiple Directories into a Single Destination Directory
Sed,Awk.Grep - Add a Line to the End of a Configuration Section If the Line Doesn't Already Exist
How to Read from User in Rpm Install Script
Movdqu Instruction + Page Boundary
Changing the Owner of an Existing Process in Linux
Sed Find and Replace Between Two Tags with Multi Line
Unix How to Block Unix/Linux 'Wall' Messaging
How to Move First Column to Last Column in Unix
Redirect Stdout and Stderr to File and Stderr to Stdout