Jump to content

Recommended Posts

Posted

Hi everyone, I'm new to creating my own images and I'm learning this just because I'm interested in it. 

I am trying to build ubuntu 24.04 for my rpi3b using the build configuration for rpi4b. 

Now I'm trying to automate the process of the first launch (skip the selection of bash, zsh, creating a password for root, creating a regular user, etc.). In one of the topics, I found out that I can delete
"rm -rf/root/.not_logged_in_yet" 

And the system will not ask for the initial setup, but to make all the necessary changes for me, I wrote a small function in customize-image.sh:


SettingSystemFirtsRun() {

    #disable defaut script
    sudo rm -rf /root/.not_logged_in_yet

    #setting regul user
    echo "add user $_userName"
    sudo useradd -m -c -s /bin/bash "$_userName" "$_userName" -p "$_userPass"

    #change root pass
    echo 'change root passssss'
    echo "root:$_rootPass" | sudo chpasswd

    # Set hostname permanently
    echo "Setting hostname to $_Hostname"
    echo "$_Hostname" > /etc/hostname
    hostname -b "$_Hostname"

    # Update hosts file
    sed -i "s/127.0.1.1.*/127.0.1.1\t$_Hostname/g" /etc/hosts

}

But when the system starts, I still do not see the directory of the user I am creating in /home, while the user himself is being created.

The most important thing is that I really want to implement user creation at the assembly stage, although I am less and less convinced that this is even possible...

I do not rule out that there are more concise ways to solve this problem, so I will be glad of any advice, good luck to all.

P.S. I read the documentation, but I couldn't find a solution there.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines