LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-15-2022, 04:11 PM   #1
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Rep: Reputation: 20
How should I write an install script?


The Slackware installer works very well. However, if you want to install Slackware on several PCs it requires the same manual interaction for each system. Is there a guide on how to automate the install process? And is there an easy way to include such a script in the iso, so that it is directly available?
 
Old 08-16-2022, 10:14 AM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,395

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
These characteristics are never part of the distributions
You must have IT skills in deployment and automation to perform such actions
 
Old 08-16-2022, 01:06 PM   #3
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 980

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
I don't know of any guide, but I have done this customization of Slackware. My steps have been:
  1. A custom isolinux/initrd.img where a script is run to partition the HD and the scripts in /usr/lib/setup are modified to not ask questions.
  2. Some custom packages replacing the post install scripts in /var/log/log setup with scripts without questions.
  3. A whole bunch of custom packages, both applications and most of all custom settings.

regards Henrik
 
Old 08-17-2022, 11:28 PM   #4
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
It should not be that hard.

Everything that you need is to know how to configure a system manually. If you have configured parts of a system that you needed by using a text editor then you are probably ready.

Here are some key points that you need to follow:

* Custom initrd
* Create a custom image
* Boot up the installation image
* Create partitions
* Install packages
* Configure the system

Custom initrd: Creating an initrd could be the hard part for a beginner but do not be afraid. You only need to extract the contents of it, put what you want in it, and compress it again.

Creating custom ISO: You put your custom initrd and your custom Slackware Tree and create and custom ISO from it. The instructions to create the iso are in a README in the isonlinux folder of the Slackware Tree.

Creating partitions: I think you can create partitions by using fdisk without giving any input, just pass in a set of instructions from standard input.

Installing packages: You can use installpkg and loop over the packages in order to install them, it is pretty easy, there is even a flag called --root.

Configuring the system: Here is where a lot of work is done, or so little, it depends of the system's administrator. Setting up the hostname, network, service files (rc), users, locale, etc, certificates, etc.

You can use only: fdisk, cp, echo, cat, and installpkg in order to set up an entire installation automatically.

You just need to know about standard input and output in order to manipulate the necessary files and programs that you need for the installation. Because most of the things that you need to configure a Slackware system are just files.

Last edited by slac; 08-17-2022 at 11:33 PM. Reason: Answer corrected for the op. Edit 2: Adding more detail.
 
Old 08-17-2022, 11:44 PM   #5
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 980

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
Quote:
Originally Posted by slac View Post
Configuring the system: Here is where a lot of work is done, or so little, it depends of the system's administrator. Setting up the hostname, network, service files (rc), users, locale, etc, certificates, etc.
The custom rc files are easy to put in a package. If you have a network with many machines you probably don't have local users but get the user information from some catalog service like ldap or nis. On my custom installation media there are not many questions left, however there is still a dialog asking for IP address. That IP address is then used to query a DNS server in the network about which hostname it should use.

Quote:
Originally Posted by slac View Post
Because most of the things that you need to configure a Slackware system are just files.
Exactly, and it is easy to put files in a custom Slackware package which you then can deploy to many machines.

However, doing this kind of work takes time. If you are going to install less than 10 machines with your custom installation media you might save time by instead keeping a log of all the answers you are going to give during installation.

regards Henrik
 
2 members found this post helpful.
Old 08-18-2022, 07:30 AM   #6
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 165

Rep: Reputation: 156Reputation: 156
Something missing in the original question and discussion is whether the "several PCs" means several identical PCs, or several each-is-different PCs.

If all PCs are identical, there are options of disk cloning followed by individual modification for specific systems. If the PCs are different, then changing hardware, changing drivers, etc. may mean the setup either has to be customized or has to be very generic.

But as Henrik says, if "several" is a small number, it might be easier to bite the bullet and do it manually.

https://xkcd.com/1445/
 
1 members found this post helpful.
Old 08-18-2022, 01:46 PM   #7
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 980

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
Quote:
Originally Posted by dhalliwe View Post
If all PCs are identical, there are options of disk cloning followed by individual modification for specific systems.
Cloning might be an option even if the hardware is not very similar between machines. The important thing is how they boot, maybe you need two clones, one for UEFI and one for MBR.

Once an initial clone is up and running a few additional custom packages can be added for things like network configuration and graphics drivers.

The drawback of a cloning strategy is that you will be rather lost the day you need to reinstall from scratch (how did I create that master clone X years ago?). You will also get an increasing number of patch packages that you will need to apply to all installations after the initial cloning has been done. Maybe you want to update your master clone every now and then, but then, are you really sure that your master clone is pristine? Sometimes you might want to do a reinstall from scratch to get to a well known status.

regards Henrik
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
write a script hello.sh to display hello world. The script should be executed from a pritammt Linux - Newbie 5 05-30-2014 07:44 AM
[SOLVED] How to write a .sh script to read configuration file and write into .txt file ISStaras Linux - Newbie 8 09-06-2012 06:03 PM
read/write,write/write lock with smbclient fails swatidas11 Linux - Networking 1 03-10-2010 12:27 PM
What logging software do you recommend? Or should I just write a script? bskrakes Linux - Software 2 02-28-2008 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration