radxa-repo / rbuild

Radxa Image Builder
https://radxa-repo.github.io/rbuild/
GNU General Public License v3.0
53 stars 44 forks source link

File not copying from build machine to image #62

Open ManavAChauhan opened 2 weeks ago

ManavAChauhan commented 2 weeks ago

Hi,

I want to copy file to the /home directory of image. I executed cp command in image.yaml but not working. Please share if you have any document for copying file or guide me how to achieve this.

RadxaYuntian commented 2 weeks ago

You need to learn debos usage. If your file is in an archive you can use unpack action. If you have some loose file in the rbuild directory you can use overlay action. There are examples of both actions in our source code.

ManavAChauhan commented 2 weeks ago

Hi, I can copy the file from my local machine to /etc/ directory. but if i try to copy file to the /home/radxa then it fails during compilation

RadxaYuntian commented 2 weeks ago

Yes this is because the radxa account is only created on boot by our first-boot script.

You can mkdir -p /home/radxa && chown 1000:1000 /home/radxa to create the directory first before copying files to it. Or you can save your file to /etc/skel, so those files will be copied to the home directory whenever new account is created.

Be mindful about file permissions though, since those commands are run by root.

ManavAChauhan commented 2 weeks ago

Hi, I am able to copy files to the /home/radxa directory but if i change the username and password in before.txt then i am not be able to access the SSH console.

RadxaYuntian commented 2 weeks ago

If you changed user name then you also need to change the home directory path.

SSH is disabled by default, and only enabled for headless first boot. You can remove the disable_service in before.txt.

ManavAChauhan commented 2 weeks ago

I removed the disable_service ssh & disable_service ssh.socket from before.txt but still not be able to take ssh.

RadxaYuntian commented 2 weeks ago

Oh I think probably because the host key was changed while ssh was running. You probably will need to remove that line as well.

ManavAChauhan commented 2 weeks ago

If I add user with name of root then it's not adding it else it's working.

On Mon, 24 Jun 2024, 12:54 pm ZHANG Yuntian, @.***> wrote:

Oh I think probably because the host key was changed while ssh was running. You probably will need to remove that line as well.

— Reply to this email directly, view it on GitHub https://github.com/radxa-repo/rbuild/issues/62#issuecomment-2185794206, or unsubscribe https://github.com/notifications/unsubscribe-auth/A47YKUUD7IFIJKUCENIVV7LZI7CRRAVCNFSM6AAAAABJTVRVA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVG44TIMRQGY . You are receiving this because you authored the thread.Message ID: @.***>

RadxaYuntian commented 2 weeks ago

You can't add root user because it is there already, and unlocking root user is discouraged since you can use sudo -i to switch to it.

You can just chpasswd in your image building yaml if you have to use root account.