Microlinux / MLEDThis forum is for the discussion of MLED (Microlinux Enterprise Desktop).
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Everything went well with the script and I finally got the generic kernel working. I would like to start testing the config script if you have anything ready.
Here's a first test version of the configuration script. It includes selection of language and addition of user.
The set of languages to choose from is taken from the lang.sh shipped with MLED so it's very limited. To expand the list will require more work (nothing impossible I believe) but, at that point, the principle would be to decide on a restricted list rather than choose among all the locales reported by "locale -a".
This script is for testing purpose only. It will use a copy of lang.sh stored in the $HOME/tmp directory of the user. I highly recommend that you test on a copy of lang.sh first even though my testing showed no issue.
If you want to test the script in real environment, uncomment the first line of the script and comment the next one as follows:
The option to add a new user (it's a simple call to "adduser" after you enter the login name) was tested up to the actual creation of the new user (I control-C before approving the new user).
By default en_US.utf8 does not exist on a clean install. The script only detects once it has been set to en_US.utf8. It detects en_US.UTF-8 ok. The script will have to write or replace a section for en_US.utf8, because it's not the same as en_US.UTF-8. I know you know the difference. lol
Is it possible to add the removeuser feature?
I usually use mledauto.sh to keep my Slackware updated. The script will not run a second time if the microlinux folder and slackpkg+-1.3.2-noarch-2_microlinux.txz are present in the root directory. After the cleanmenu.sh has ran, do you think it's possible to delete the two. I manually do it all the time. Just pointing it out in case others come across it. When the two items are deleted, there are no issues.
The adduser ran and successfully created an account for me. No problems there.
Thanks for your interest and dedication to Slackware and MLED. I can't wait to become a Slackware/Linux power user. Looking forward to more testing.
The problem with en_US.UTF-8 being displayed in the list of choices by the script comes from this line in the stock lang.sh
Code:
# export LANG=en_US.UTF-8
Well, I'll have to change the logic of the script to display the list of installed locales and the way it updates lang.sh.
I can add an option for removing a user but the intent of the config script is to configure the system just after the installation and removing a user doesn't come naturally as an option at this stage. Anyway, I will add this option in the next update.
The script mledauto.sh is not meant to be run to manage update of Slackware (more on that later). But it doesn't hurt to clean up the installation process by removing the microlinux directory and slackpkg+ package. I'll do it in next update.
Quote:
Originally Posted by PROBLEMCHYLD
I can't wait to become a Slackware/Linux power user. Looking forward to more testing.
So let's just get started To update your Slackware/MLED system, don't use mledauto.sh but run as root user:
Code:
slackpkg update
slackpkg upgrade-all
You'll get prompted with a list of updated packages (both standard Slackware and MLED) to be installed.
I shall play with this command and get familiar with it.
The reason for the removeusr is for convenience. Let's say I create 10 users and need to remove some while adding new ones in the future. The scripts helps me do that.
I'm still working on an update of script mledconfig.sh but here's a bug-fix update of script mledauto.sh.
Main changes vs. previous version:
- Bug fix: xargs error message when exiting the dialog using ESC key in option #3 of the mirror selection menu (refer part in bold characters in the output of diff command below)
- Delete MLED files downloaded during installation: microlinux git repository and slackpkg+ package
- Various cosmetic changes
Code:
$diff mledauto.sh.txt.old mledauto.sh.txt
18a19
> BOLD="\033[01m"
36c37
< # Temporary files - they will be deleted at end of script
---
> # Temporary files - they will be deleted at end of function
76a78,80
> # Open file descriptor
> exec 3>$INPUT
>
84c88,93
< 2>"${INPUT}"
---
> --output-fd 3 \
> 2>/dev/null
>
> # Close file descriptor
> exec 3>&-
>
87a97,98
> clear
>
120c131
< VERSION=${VERSION:-`cat /etc/slackware-version | cut -f 2 -d " "`}
---
> VERSION=${VERSION:-`cat /etc/slackware-version | cut -f2 -d" "`}
195c206
< MIRROR=$MIRROR$SLACKDIR-$VERSION"/"
---
> MIRROR=$MIRROR$SLACKDIR"-"$VERSION"/"
199,201c210,212
< echo -e "\n\tOperating system: Slackware "$VERSION" "$ARCH
< echo -e "\n\tMultilib installation: "$MULTILIB
< echo -e "\n\tMirror for slackpkg+: "$MIRROR"\n"
---
> echo -e "\n\tOperating system: "$BOLD"Slackware "$VERSION" "$ARCH$RESET
> echo -e "\n\tMultilib installation: "$BOLD$MULTILIB$RESET
> echo -e "\n\tMirror for slackpkg+: "$BOLD$MIRROR$RESET"\n"
282a294,297
>
> # Remove downloaded files used during installation
> rm -rf $HOME/microlinux
> rm -f $HOME/slackpkg+*.txz
Bug-fix update of script mledauto.sh + Beta version of script mledconfig.sh
Here are updated mledauto.sh and mledconfig.sh scripts.
mledconfig.sh is a first beta and its features are:
- Set language by selecting one of the locales installed in the system
- Add a user (simple call to script adduser)
- Remove a user-defined user (i.e. not a system user). After selecting the user, you'll be prompted to confirm the removal. If you answer "y" or "Y", the user will be deleted as well as her home directory and mail spool ("userdel -r" is called). This feature should be tested only on a test installation not a production one as only unitary tests have been done (no actual removal was performed).
I'm personally not yet convinced/comfortable that the user removal feature should be included in the script as it's a powerful feature that can have irreversible impacts (maybe it would be safer to not use the -r option to remove the home directory and mail spool). Also removing a user at the command line is quite easy to do: refer to Slackware configuration section Users.
Anyway, it was fun to develop as I learned to use command awk
mleauto.sh main changes:
- Bug-fix: check for missing trailing / in the mirror name when selecting a mirror from the online mirror list (some of them don't end with a /).
- Improved performance to display the list of mirrors from the online mirror list (thanks to awk)
- Prepare the code for updating slackpkgplus.conf when multilib will no longer be installed by default in MLED.
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
30a31,33
> # Mirror for multilib packages
> MULTILIB_MIRROR="http://bear.alienbase.nl/mirrors/people/alien/multilib/14.1/"
>
38c41
< INPUT=${INPUT-$TMP_DIR/menu_mirrors.tmp}
---
> INPUT=${INPUT:-$TMP_DIR/menu_mirrors.tmp}
41d43
< TMP_MIRRORS1=${TMP_MIRRORS1:-$TMP_DIR/mirrors1.tmp}
63,64c65
< sed -r -n '/http\:|ftp\:/ p' <$TMP_MIRRORS >$TMP_MIRRORS1
< if [ ! -s "$TMP_MIRRORS1" ]; then
---
> if [ ! -s "$TMP_MIRRORS" ]; then
68,76c69,72
< while read line; do
< COUNTRY=$(echo $line | cut -f1 -d"=" | cut -f1 -d" " | \
< tr [:lower:] [:upper:])
< SITE=$(echo $line | cut -f2 -d"=" | cut -f1 -d">")
< if [ "${COUNTRY:0:1}" = "<" ]; then
< continue
< fi
< echo "\""$COUNTRY" - "$SITE"\"" >> $TMP_DIALOG
< done < $TMP_MIRRORS1
---
>
> sed -r -n '/http\:|ftp\:/ p' <$TMP_MIRRORS | sed -n '/^</ !p' | \
> awk -F'=' '{printf "\"%.2s - %s\"\n",$1,substr($2,0,index($2,">")-1)}'\
> >$TMP_DIALOG
103d98
< [ -f $TMP_MIRRORS1 ] && rm -f $TMP_MIRRORS1
205a201,203
> # Check if missing trailing /
> [ "${MIRROR: -1}" != "/" ] && MIRROR=$MIRROR"/"
>
242a241,252
>
> # =================================================================
> # Prepare code when multilib will no longer be installed by default
> # =================================================================
> # Update slackpkg+ configuration file if multilib is installed
> #if [ "$MULTILIB" = "yes" ]; then
> if [ "$MULTILIB" = "test" ]; then
> sed -i.orig -e 's/^PKGS_PRIORITY=(/PKGS_PRIORITY=( multilib:.*/' \
> -e 's/^REPOPLUS=(/REPOPLUS=( multilib/' \
> -e '/# Define mirrors/ a MIRRORPLUS['\''multilib'\'']='$MULTILIB_MIRROR \
> /etc/slackpkg/slackpkgplus.conf
> fi
Here's an update of script mledauto.sh following the deactivation of multilib in the default configuration of 64-bit edition.
Main changes:
- Update /etc/slackpkg/slackpkgplus.conf with multilib info if installation of multilib is selected (applicable only on a 64-bit system)
- Improved performance to display the list of mirrors from the online mirror list (don't use temporary file)
- Correction of reference to online documentation in welcome message
- Updated code to add trailing / to mirror name if it's missing.I find the new formula ${MIRROR:${#MIRROR}-1:1} easier to read
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
42d41
< TMP_DIALOG=${TMP_DIALOG:-$TMP_DIR/dialog.tmp}
57,59d55
< # Check that file does not exist to avoid appending to an existing one
< [ -f $TMP_DIALOG ] && rm -f $TMP_DIALOG
<
70,73d65
< sed -r -n '/http\:|ftp\:/ p' <$TMP_MIRRORS | sed -n '/^</ !p' | \
< awk -F'=' '{printf "\"%.2s - %s\"\n",$1,substr($2,0,index($2,">")-1)}'\
< >$TMP_DIALOG
<
78,85c70,79
< cat $TMP_DIALOG | sort | xargs dialog --clear \
< --no-items \
< --cancel-label "Cancel" \
< --ok-label "Select" \
< --title " Download mirrors for Slackware packages " \
< --menu "\nSelect a site:\n" 0 0 0 \
< --output-fd 3 \
< 2>/dev/null
---
> sed -r -n '/http\:|ftp\:/ p' <$TMP_MIRRORS | sed -n '/^</ !p' | awk -F'=' \
> '{printf "\"%.2s - %s\"\n",toupper($1),substr($2,0,index($2,">")-1)}'\
> | sort | xargs dialog --clear \
> --no-items \
> --cancel-label "Cancel" \
> --ok-label "Select" \
> --title " Download mirrors for Slackware packages " \
> --menu "\nSelect a site:\n" 0 0 0 \
> --output-fd 3 \
> 2>/dev/null
94c88
<
---
>
97d90
< [ -f $TMP_DIALOG ] && rm -f $TMP_DIALOG
115,117c108
< echo "http://www.microlinux.eu/installation_guide.php"
< echo "or"
< echo "http://www.microlinux.eu/downloads/mled-14.1-documentation-english.pdf"
---
> echo "http://www.microlinux.eu/docs.php"
138d128
< #MULTILIB=${MULTILIB:-yes}
142c132
< read -p "Do you want to install multilib packages [Y|n]? " ANSWER
---
> read -p "Do you want to install multilib packages [y|N]? " ANSWER
144c134
< y|Y|"")
---
> y|Y)
147c137
< n|N)
---
> n|N|"")
202c192
< [ "${MIRROR: -1}" != "/" ] && MIRROR=$MIRROR"/"
---
> [ "${MIRROR:${#MIRROR}-1:1}" != "/" ] && MIRROR=$MIRROR"/"
242,244d231
< # =================================================================
< # Prepare code when multilib will no longer be installed by default
< # =================================================================
246,247c233
< #if [ "$MULTILIB" = "yes" ]; then
< if [ "$MULTILIB" = "test" ]; then
---
> if [ "$MULTILIB" = "yes" ]; then
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.