Can I make a bootable usb that directly runs a arch install script?
What I want is to boot a usb and then it directly runs a script,nothing else.
So that it doesn't have any other software,just the script.
And that it doesn't have that arch boot menu that asks if you wanna boot in arch or whatever.
So I just plug the usb in,then boot it,then wait until it's installed.
About this post
- Posted
- Archived
- Score
- 2 · 60% up
- Kind
- Text
- ID
- mc8aly
3 comments
You could probably do this with systemd using the correct 'After' and 'Requires' conditions. Give this page a read.
I'll also note that this may be a bad idea if your install script has the potential to overwrite whatever is already on your system.
I'll also add that your "auto installer" may quickly become out of date leaving you with a totally unusable system if you don't have any kind of error catching in your script.
Thanks,but I still don't get how I can do that.
I am not good at scripting,I just edited a arch install script from someone else slightly.
Then how can I prevent it?
I mean is there a way that at the beginning of the script it shows a tui partition manager where I can select if I want to erase a drive and install arch on it or if I wanna install it alongside another os?
What do you mean by "error catching"?
Is there ways to update parts of a script with a error catcher or what?
The types of questions you're asking lead me to believe you have a lot of research ahead of you before you have a cohesive plan of approach, let alone a usable product that you'll need to then continually maintain as the rolling-release nature of Arch inevitably changes. But, this could be a fun coding project if you want to learn a variety of things all in one go.
This will likely cause you headaches. If you want to create a package of code that installs your system how you want it, you should use the official installation guide as your base and start from the ground-up. Trust me it will be easier than reading through someone else's project and adding/removing features, especially if you aren't good at scripting to begin with.
There are many ways to approach this problem, primarily dependent on the way your code will act on the target system over time as each step completes (or fails).
Yes. Check out dialog, for starters.
I mean, if something goes wrong..what happens? Does the script carry on even though a previous step failed, possibly until the whole installation implodes on itself? Does it instead just stop, or maybe prompt the user for some corrective action? If you want to make corrective action, do you have to exit the script and do the rest manually, or will your script have the ability to wrap back on itself, then resume properly once you've fixed the issue (if it's even fixable)? If it stops, do you have a way to start it again from a certain step, or can it only be run front-to-back in one continuous set of commands?
Maybe? It depends on the rest of the script or collection of files and how it all comes together to bring your system to the desired state.
Rather than writing a script to do this, I'd look into Ansible since it is explicitly designed for this sort of application.
What you may (probably) find at the end of all this research is that once you have a good understanding of the install process, which will be required to make all of the above function correctly, an 'auto installer' is just not worth the effort. It may be a fun project, but the amount of time you'll spend getting it functional you could have installed a multitude of Arch systems (more than you're ever likely to install in the future). So from a pragmatic standpoint there's not much purpose, but I certainly wouldn't stop you from having a good time if you just want a fun project.