Code Monkey home page Code Monkey logo

Comments (17)

gitbls avatar gitbls commented on September 7, 2024

sdm does not provide an integrated function to rename the pi user. You can, however, create a new user with the --user switch, which creates a user that you can customize as you desire.

In recent RasPiOS builds and all builds going forward, the Pi user comes without a password, and is thus unusable unless you change the password.

If you really want to rename the pi user for some specific reason, you can do so in a custom phase script or a plugin. Something like this in the Phase 1 code should work:

usermod --login myusername --home /home/myusername pi

Alternatively, you can use the sdm --user switch to create a new user, and then simply userdel pi, or just leave it, since the account can't be used, as I mentioned above. Personally, I always create a new user, and leave the pi user as is, and have never had an issue.

If you set up the user (using either method) as you'd like, and also set the localization settings (using either --l10n, or --keyboard, --locale, --timezeone, and --wifi-country) you can also add --disable piwiz, which will disable the stuff that RasPiOS runs at first boot to query you for all of these settings. Why do something manually that can be automated? 🤔

EDIT: Thinking about this further...it's easy enough to add a switch to rename the Pi user. If you feel that it would improve your experience and usage with sdm, please let me know and I'll drop it in the next update.

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

This would help. Thank you.

I've use the pi-gen & rp-imageri feature to simplify nfs share permissions across different systems.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

I've implemented a --rename-pi switch, and it will be in the next version...coming next week.

I do have a couple of questions for you. These will help me understand what you're doing, and I may be able to offer you other sdm-usage suggestions, or you may enlighten me on some useful sdm ideas.

  • Sounds like you've been using pi-gen? if that's the case, what is your interest in sdm? Is this instead of pi-gen, or in addition to? What can you do in sdm that you can't do in pi-gen?
  • Could you expand on how you "simplify nfs share permissions?" I'm curious because I use nfs on my network but basically have all shares open to all systems on my LAN. That's really easy to do with sdm, including setting up common UID/GIDs across all the systems. Is that what you're doing, or are you doing something more complex?

Thanks!

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

This is instead of pi-gen. My intention is to build multiple images for a PI cluster. The cluster will comprise of 4 Raspberry PI4s and a Raspberry CM4. The CM4 will act as a switch, firewall, router and network boot host.

I wish to make the setup & config automated across Debian updates, while maintaining as few files as i can.

sdm seem like it will help me to achieve this.

"including setting up common UID/GIDs across all the systems. Is that what you're doing,"
Yes and with ssh / gpg key management.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Thanks for that! I believe that sdm will help you reduce the config file maintenance. My own personal stuff for sdm consists of:

  • A bash script to run the sdm customize. I'll be updating the wiki with a newer example in the next few days, incorporating plugins, which made several things easier
  • A personal plugin to do all the customizations that sdm doesn't directly support, such as copying my login files and configuring my NFS shares. This will be updated on the wiki as well

Yep, just two files for my own customized sdm usage.

Several of the plugins included with sdm started out in my personal customizations, but once plugins were implemented, I migrated them to plugins so they can be more easily used by others (e.g., apt-cacher-ng, apt-file, and others coming in the next version).

I encourage you to use plugins liberally, as they provide the ability to easily add/remove capabilities in a modular fashion. Also, they can be used both when customizing the IMG (so all burn targets get the common features) or when burning (for only specific targets). This is handy, for instance when setting up servers with different functionality.

Your use case sounds interesting! If you run into situations where an addition to sdm would be helpful, let me know. I'm always looking for good ideas to incorporate, or maybe the capability is already there! 🤔

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

The next feature I expect to be looking for is to output a output/${rootfs},${bootfs}/ directory structure with the --burn parameter to facilitate network booting.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

hmm...I've done tftp network booting with x64 systems, but never with the Pi. Are you thinking of a single directory structure for all Pis, or one tree per pi? If the former, how are the per-system items, such as the hostname, applied?

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

I am testing by using sdm --mount and copying the files.

my tree currently looks like :-

/srv/tftp/${pi-mac-address}/bootfs/
&
/srv/ntfs/${pi-hostname}/rootfs/

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Ah, cool. I was going to suggest that. There's also the --directory switch that lets sdm operate directly on a directory tree. Full disclosure: I haven't tested it in a while, but it should work. If you give it a go and it falls over, LMK that I broke it 🙄

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

this is my fork that I'm experimenting in my fork https://github.com/1stcall/sdm
take a look at my customize.sh, burnfile.sh & sdm-customphase for my current tests.

very much a WIP!

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Looks like you'll be explaining to me how this all works fairly soon!

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

lol. Have a look at my repo https://github.com/1stcall/build-kernel

I'm working on including a custom kernel and packaging it as a .deb
I then intend to use sdm to install it on my images.

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

I like the look of the plugins. I'll play around with them soon.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

sdm is updated with a --rename-pi switch, which renames the pi user. Please validate that it works for you.

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

I can confirm this works well. Thank you.

from sdm.

1stcall avatar 1stcall commented on September 7, 2024

Also, I'm loving the plugins. They have significantly simplified things for me and work very well.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Great, thanks for confirming. I'm loving the plugins as well. Glad you find them helpful and simplifying also!

from sdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.