MLED installation script as a proof-of-concept
Dear MLED users,
The MLED installation guide has been criticized by some as being too complex/user-unfriendly. Having an installation script was deemed by those critics as a more appropriate solution for a professional-level project. My opinion is that the MLED installation guide (http://www.microlinux.eu/installation_guide.php) is quite good. It is a bit long because Niki (the MLED founder) provides lots of explanations. I found nothing in this guide that would deter a person who is able to install Slackware. For me, end of the story. But out of curiosity, I wrote a proof-of-concept script to help identify any blocking point/pitfall/risk and maybe some areas for improvement when automating the set of MLED installation commands. You may consider such an exercice a moot point. If so, please stop reading. For a start, I assume that the user will have an internet connection and that the installation steps would be: 1) Install Slackware by tag or full installation (OK full installation is not efficient but it would work thanks to trim.sh later) 2) Run the MLED installation script 3) Configure MLED My focus here is on step 2. So we assume that we are using a running slackware machine with internet connection after step 1. My scripting skills are quite basic, please forgive me for bad programming/errors. I didn't run the full script, it's just a proof-of-concept. What I found out: - First pitfall: the script can download slackpkg+ using wget but a mirror must be selected for slackpkg+. Either a default mirror could be used or the script may request the user to enter the mirror. In my script, I played with defining a default mirror based on the continent where the machine is located. - Second pitfall: after upgrading the base installation using slackpkg+, there is a need to check .new config files. At this point, the user will have to decide whether or not to update the configuration files. I find it dangerous for a script to automatically force the replacement of all configuration files with the new ones (or to keep all the old ones). - Third pitfall: the update of the base installation may result in a new kernel being installed. This should be OK if the MLED installation just follows the default Slackware installation (which uses the huge kernel). But if the Slackware base installation is already running the generic kernel, a new generic kernel would require specific actions: create a new initrd file, update lilo.conf (if needed) and run lilo. This case is not treated in the script. I don't know how slackpkg+ would handle this case in batch mode (I guess that lilo would be run). Anyhow the topic of the generic kernel is addressed in the configuration step of MLED. - Risk: error management needs to be carefully thought out to handle errors during each of the installation steps. Based on the above, I have a better understanding why Niki only provided an installation guide rather than an installation script. Anyhow, I like my script ;) So I will most probably use it the next time I install MLED just for the fun of it :) Finally here's the script. Your comments are welcome: Code:
#!/bin/sh |
Quote:
First of all, thanks very much for your contribution to MLED. The script actually looks quite good. Early versions of MLED (called "Slick" at the time) had such an installer, and there was even a time when they came on a separate installation ISO. As far as I'm concerned, I've come to prefer the manual installation method, along with a step-by-step documentation. Different ways lead to Saint-Bauzille-de-Putois (my favourite climbing spot, for those who wonder). Let's just say my own installation script always ended up to work like this: https://www.youtube.com/watch?v=E2evC2xTNWg :) One technical detail: if you don't want to use the tagfiles at install time, the best solution is to go for a full install minus E, KDE and KDEI. Afterwards, the trim.sh script can take care of removing the handful of unnecessary packages from X and XAP. I'll give your script a spin as soon as I find some time and my never-ending TODO list gets slightly shorter. Of course, I'll encourage everyone to fiddle with this script and report back to gegechris99. If it works well, I'll happily include it as an "official" installation script alongside the traditional installation method. Cheers from the sunny South of France, Niki |
This looks nice, thanks. I'll give this a spin as well. I have an extra hard drive laying around and I'll try this script out and see how it goes.
|
Your script seems to be a time saver. What about adding virtualbox since its another step to do in the configure section of MLED? It would be one less command we have to do. I have created packages for Windows, so I know the difference between laziness and convenience. Here is my site http://www.htasoft.com/u98sesp/
I'm triple booting Win98/XP/Slackware MLED. I have done some reading, and a lot of unix/dos uses some of the same commands. I might have some feedback/input in the future for ya. Code:
# Install extra packages Quote:
Thank you for your contribution.:hattip::cool: |
Quote:
These files contain information about login and passwd of your existing users including the root user. So even during an initial installation, this script will run after Slackware has been installed and the root password is set (selection of root password is part of the Slackware installation process). There might be other cases where config files are modified during the Slackware installation process after the packages have been installed (ex: /etc/lilo.conf). This script is focused on installing the MLED add-on and could therefore also be used with an existing Slackware installation and in this case, you definitely don't want to automatically overwrite existing config files. However the script is a proof-of-concept for now so there is room for further improvement but first I'd like to run it once for real which I haven't. [EDIT] Anyway slackpkg new-config allows you to mass-overwrite all config files with .new ones if you don't want to check individually each .new file: press "O" when asked the first question. [/EDIT] |
Quote:
|
Any input/comment on this draft script is welcome. It's just that in the case of .new config files, I find it dangerous to automatically overwrite old config files (see my reason in my previous post).
I do not doubt your computer skills. More generally I would not comment in this forum on such a matter. Not being a native english speaker, I may appear to be patronizing in my explanations (which could be shorter) but that's not the purpose. Finally I will look into how to add a step for optionally installing virtualbox. I don't use this software but I understand that it needs multilib in a 64bit machine. So the scnript will have to make some basic checks like if I want to install virtualbox on a 64bit machine, I need to force the installation of multilib (it's not that difficult). I will try to publish something later this week-end. |
If you were to add to the script, something like this, it would get rid of pitfall 1.
Code:
sed -i 's/# UNITED STATES (US)/UNITED STATES (US)/g' exact location/mirrors Code:
What is your location, or the nearest to your location? The script would then go to the first HTTP mirror and use it. If the link is dead, the script would go to the next HTTP mirror and so on and so forth. If all HTTP mirrors have dead links, then we would use ftp mirrors. Using the same method above. Or you can give users the option of choosing a default between ftp and http. I thought http was faster is why it was suggested as the first and default option. # UNITED STATES (US) # fxp://carroll.aset.psu.edu/pub/linux/distributions/slackware/slackware-14.1 # hxxp://carroll.aset.psu.edu/pub/linux/distributions/slackware/slackware-14.1 # FRANCE (FR) # fxp://mirror.ovh.net/mirrors/ftp.slackware.com/slackware-14.1 # hxxp://mirror.ovh.net/mirrors/ftp.slackware.com/slackware-14.1 This is what I have. Hope you understand where I'm coming from. |
Quote:
Code:
slackpkg -batch=on -default_answer=y install mplayerplug-in recordmydesktop #virtualbox Code:
# Detect system architecture |
Thanks PROBLEMCHYLD for the error reporting. I corrected it.
I wanted to edit my original post to put back the correction but there is no EDIT button on this post even though it's available in my other posts in this thread. Anyway, here's below the updated script with an option to install virtualbox. Note on virtualbox: the syntax you proposed with the "#" returns an error with slackpkg. Anyway I wanted the installation of virtualbox to be an option (I don't use it for example). So installation is managed via a flag VBOX that defaults to "no". To install vbox, you'll run the script as this: Code:
VBOX="yes" myscript.sh Also regarding your post about managing the mirrors, I admit that it's a bit difficult for me to see where you want to go. Some more thinking is needed on my part before going further on this mirror topic. But if you fell like explaining further, don't hesitate as I may be slow to understand sometimes :) Code:
#!/bin/sh |
I just ran the updated script and everything went smoothly. I named it mledauto.sh and just let it flow on a clean install. All I had to do was answer a few prompts, which isn't so bad. No errors at all. When I click (O) to overwrite the old config files, nothing was changed as far as password settings. I'm not sure I understand where you coming from on the config files. But anyway, everything is working lovely. Thank you very much. I will report back later.
|
Quote:
Quote:
The part in the script that deals with .new config files comes after you have upgraded the packages of the base Slackware installation. Package a/etc (that contains files /etc/group, /etc/passwd and /etc/shadow) has not been upgraded since the release of 14.1. No update of this package means no /etc/shadow.new, etc to deal with hence no change in your password. Upgrading to Slackware 14.2 will be a different matter (new users and groups have been added in 14.2). In fact, you can safely use the "O" option with "slackpkg new-config", if you have looked closely into the Changelog to make sure that package a/etc has not been updated. If you tinker with another config file (ex: /etc/slackpkg/mirrors), you similarly have to check that the package containing it has not been updated. Otherwise it's preferable to deal manually with this .new config file. The update of the 3 /etc files mentioned earlier is better managed manually. You can see in Slackware UPGRADE.TXT step 5 that even Patrick Volkerding doesn't want his script to deal automatically with these files (and two others as a matter of fact - see part highlighted in blue below) leaving their update up to the user. Quote:
|
Some more screenshots from the fruits of your labor.
Updated with your script. http://s7.postimg.org/wg632r3fr/Scre...3_20_39_14.pnghttp://s7.postimg.org/4hbxbw1t3/Scre...3_20_41_03.png http://s7.postimg.org/cpduwvtpj/Scre...3_20_42_02.pnghttp://s7.postimg.org/koi7ry8tj/Scre...3_20_42_56.png http://s7.postimg.org/vclyqsisn/Scre...3_20_44_43.pnghttp://s7.postimg.org/jva7d2s6f/Scre...3_20_47_49.png |
Last version of the installation script
1 Attachment(s)
Thanks PROBLEMCHYLD for taking the time/risk to test the script on an actual installation and for reporting back on how it performed.
Most of the credit goes to Niki, the MLED founder who took great pains to provide quality documentation. This script is just an automation of the steps described in the MLED installation guide. The script might not be bulletproof (for ex: adequate error management is missing) but at least it does the job when the conditions are normal (i.e. no break in internet connection, no change of package location). It's too bad that I cannot edit my original post to include the latest version of the script. So I attach it to this post (file mledauto.txt is to be renamed mledauto.sh). At the very least, I will try to add in the script a help section to show how flags MIRROR, MULTILIB, VBOX can be used to customize the installation. |
Shall we proceed with this enhancement-automation endeavor?
Here are some of the remaining tasks we or you could automate. We should start with the first obstacle Mirrors Quote:
The script would ask, What is your location? user would enter (US) or (DE) The script then shows a list of US mirrors or DE mirrors, or pick one automatically based on the location. It could ping and select the fastest one for you. It would start with http and if a link is broken, it goes to the next http mirror. If all http mirrors are broken, then we use ftp mirrors. We do this until one is found that we can use. After that, the script runs and users can sit back and relax. hxxp://carroll.cac.psu.edu/pub/linux/distributions/slackware hxxp://dfw.mirror.rackspace.com/slackware/ hxxp://fxp.gtlib.gatech.edu/pub/slackware/ hxxp://fxp.slackware.com/pub/slackware/ hxxp://lug.mtu.edu/slackware/ hxxp://mirror.lug.udel.edu/pub/slackware/ hxxp://mirror.metrocast.net/slackware/ hxxp://mirror.nexcess.net/slackware/ hxxp://mirrors.kingrst.com/slackware/ hxxp://mirrors.xmission.com/slackware/ hxxp://mirrors1.kernel.org/slackware/ hxxp://mirrors2.kernel.org/slackware/ hxxp://mirrors3.kernel.org/slackware/ hxxp://mirrors4.kernel.org/slackware/ hxxp://reflect.cs.princeton.edu/slackware/ hxxp://slackblog.com/slackware/ hxxp://slackbuilds.org/mirror/slackware/ hxxp://slackware.cs.utah.edu/pub/slackware/ hxxp://slackware.mirrors.tds.net/pub/slackware/ hxxp://taper.alienbase.nl/mirrors/slackware/ fxp://carroll.cac.psu.edu/pub/linux/distributions/slackware fxp://dfw.mirror.rackspace.com/slackware/ fxp://fxp.gtlib.gatech.edu/pub/slackware fxp://fxp.lug.udel.edu/pub/slackware/ fxp://fxp.slackware.com/pub/slackware/ fxp://lug.mtu.edu/slackware/ fxp://mirror.nexcess.net/slackware/ fxp://mirrors.xmission.com/slackware/ fxp://mirrors1.kernel.org/slackware/ fxp://mirrors2.kernel.org/slackware/ fxp://mirrors3.kernel.org/slackware/ fxp://mirrors4.kernel.org/slackware/ fxp://slackware.cs.utah.edu/slackware/ fxp://slackware.mirrors.tds.net/pub/slackware fxp://taper.alienbase.nl/ |
All times are GMT -5. The time now is 05:21 AM. |