-
|
Hello, thanks for maintaining this useful script! I'm trying to use this to provision ~200 SD cards to run Alpine Linux 3.22 on Raspberry Pi Zero 2 W devices. On first boot, I want
All of this config works fine on an interactive run of setup-alpine with no ALHB files on the SD card. When I copy the following files:
This gets the device started up and connected to Wifi with DHCP, which is already great. I'm getting stuck on the last step, running into a dead end because I can't find examples in this repo or the Alpine wiki that contain working examples of a sys install to the SD card. If I configure If I configure If I configure Sometimes there is a prior error, with the APK Mirror step failing with: I wonder if a small sleep between the steps would help here, it seems maybe the system time is set incorrectly, or network interface gets reset by setup-alpine? What is a good value for DISKOPTS that installs the sys to disk and then reboots the system when finished, so it comes up from the SD card? Why does it work in interactive mode, but not headless? It would be great to include an example file for this common use case. Also why is there a Thanks for help in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 16 replies
-
|
Hi, thanks for the note: glad you find it useful. There's quite a lot of stuff in your message: will try to clarify some key points. Indeed starting with interactive setup is key to get the right things to put forth into ANSWERFILE. About various snippets within As you seem to want to run setup-alpine with ANSWERFILE, then that part may be a more valuable sample for you. I have not personally tried to make ANSWERFILE for |
Beta Was this translation helpful? Give feedback.
-
If I remember correctly, in interactive mode that question should be answered If not possible, then an alternative could be to configure as diskless with ANSWERFILE, and then convert diskless to sys mode with remaining of the Hope this helps. PS: do not forget to copy |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, yes that helped a lot! I messed around this for another day and came to the conclusion that the setup-disk script fundamentally cannot handle the case of setting up the boot partition in automated mode in the same way it does in interactive mode. Also, the setup-alpine script steps through the modules too quickly, so on a device with wifi connectivity, the wifi will not be up yet after the INTERFACESOPTS step, so by the time it comes to set up the APKREPOSOPTS, this step will always fail with the following error: I tried to hack around these two issues and ended up with the following modified script: This works, but its obviously not optimal because we are re-running a lot of the stuff that should run in setup-alpine. I think setup-disk is flawed because it is not possible to reach the
The "Try boot media?" prompt only appears when no disks are found and The wpa_supplicant.conf copy step is also not working yet, I can't find the file on the system after setup-disk unmounts the sd card to write sys to it. Maybe I'll need to store this as a variable or temp file somewhere? I'll keep leaving notes here as I continue next week, and would appreciate any comments you have while I work through these issues, thanks again! |
Beta Was this translation helpful? Give feedback.
-
|
Good to hear you are making progress.
You will find a lot of useful info out of wiki: https://wiki.alpinelinux.org/wiki/Raspberry_Pi and embedded links.
Yes, while interfaces/network services are not restarted (
You may want to save it to On the overall PS:
Do you intend to run the script 200 times? It may be quicker to do just once, then image the resulting device SD, and |
Beta Was this translation helpful? Give feedback.
-
You've mentioned a few times that setting this will result in no changes to network interfaces while setup-alpine runs, but that has not been my experience. I've tried setting I tried to move waiting for network init before the setup-alpine step, which required adding an I also think I won't go with diskless this time, I will need some local storage for photos, logs from Docker, etc., but thanks for the general information on diskless mode, it's really helpful. I've successfully found the
I need to find a way to image the SD card after the script has finished. I tried this with Gnome Disks and it resulted in a 32GB file, so I need to find a way to do it that doesn't copy all the empty blocks into the image. Maybe Thanks for the ongoing help, I'll definitely open an issue on the alpine-conf repo as I get more understanding of the possible pitfalls here. |
Beta Was this translation helpful? Give feedback.
-
It's a bit more subtle than that...
I'm a bit surprised wifi taking so long to come-up (never saw that with my PiZeroW): you may just do a
Have not checked whether it unmounts disk, but you can certainly remount it: it should be |
Beta Was this translation helpful? Give feedback.
-
You're absolutely right, the issue is not the network service! I added sleep and network debugging statements around the |
Beta Was this translation helpful? Give feedback.
-
|
I managed to get the script into a minimum working state that works with wifi, no interaction or keyboard required, only power connection: There were three key changes needed:
All three of these feel like useful features that could/should be handled by alpine-conf, so I'll open issues there in a couple of days once I get more familiar with the steps and try to scale it. Thanks very much @macmpi for your excellent tool and generous prompt support! |
Beta Was this translation helpful? Give feedback.
-
|
Congrats, and thanks for feedback. You could replace the Feel free to close issue when finished: I may move it to discussion tab if your are ok. |
Beta Was this translation helpful? Give feedback.
-
|
on another note:
You may not be able to login with |
Beta Was this translation helpful? Give feedback.
-
I tried
Thanks, I did that and the experience is much smoother now. I made the following changes to users in the script, just sharing in case anyone else finds this useful: |
Beta Was this translation helpful? Give feedback.
-
Do you have sth like this, or some missing? |
Beta Was this translation helpful? Give feedback.
-
|
What issues do you think are good candidates for issues to open on the scripts repo? The most obvious one to me is to give NTP time to run after its config changes, to prevent anything requiring use of |
Beta Was this translation helpful? Give feedback.
Yes, posted here, thanks for the reminder! 🙈