LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Microlinux / MLED
User Name
Password
Microlinux / MLED This forum is for the discussion of MLED (Microlinux Enterprise Desktop).

Notices


Reply
  Search this Thread
Old 03-21-2016, 12:54 PM   #46
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled

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.
 
Old 03-22-2016, 01:31 AM   #47
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Thank you PROBLEMCHYLD for feedback.

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:
Code:
LANG_FILE="/etc/profile.d/lang.sh"
#LANG_FILE=$HOME"/tmp/lang.sh"
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).
Attached Files
File Type: txt mledconfig.sh.txt (1.4 KB, 25 views)
 
Old 03-22-2016, 11:38 AM   #48
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
I just ran a few tests and here are my results.

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.
 
Old 03-22-2016, 01:43 PM   #49
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
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 View Post
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.
 
Old 03-22-2016, 01:56 PM   #50
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Well, thanks for the tip

slackpkg update
slackpkg upgrade-all

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.
 
Old 03-24-2016, 04:11 PM   #51
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Bug-fix update of script mledauto.sh

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
Attached Files
File Type: txt mledauto.sh.txt (8.8 KB, 38 views)
 
Old 03-26-2016, 05:27 PM   #52
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
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
Attached Files
File Type: txt mledauto.sh.txt (9.3 KB, 37 views)
File Type: txt mledconfig.sh.txt (4.1 KB, 25 views)
 
1 members found this post helpful.
Old 03-29-2016, 08:30 PM   #53
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Will be testing this weekend, got some things to do. Thanks for the update, will report back.
 
Old 04-03-2016, 03:18 PM   #54
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Update of script mledconfig.sh

Hello,

Here's an update of script mledconfig.sh.

Main change is improved speed to create the locale menu

Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt     
9a10,11
> # The script should be run as root on a x86 or x86_64 Slackware system.
> #
27,37d28
<   TMP_DIALOG=${TMP_DIALOG:-$TMP_DIR/dialog.tmp}
< 
<   declare -a LANG_SET
< 
<   LANG_SET=($(locale -av | sed -n '/locale:/ p' | cut -f2 -d" "))
<   i=0
<   for j in $(locale -av | sed -n '/title/ p' | cut -f2 -d"|" | \
<     sed -e 's/ /=/g'); do
<     echo ${LANG_SET[$i]} "\""${j//=/ }"\"" >> $TMP_DIALOG
<     i=$((i+1))
<   done
42,49c33,45
<   # Display menu to show list of locales
<   cat $TMP_DIALOG | xargs dialog --clear \
<     --cancel-label "Cancel" \
<     --ok-label "Select" \
<     --title " List of installed locales " \
<     --menu "\nSelect a locale:\n" 0 0 0 \
<     --output-fd 3 \
<     2>/dev/null
---
>   echo $(locale -av | \
>     sed -n '/locale:/ {N;N;
>       s/^locale: //
>       s/ *directory.*\n.*\n.*| / \"/
>       s/$/\"/
>       p}') | \
>     xargs dialog --clear \
>       --cancel-label "Cancel" \
>       --ok-label "Select" \
>       --title " List of installed locales " \
>       --menu "\nSelect a locale:\n" 0 0 0 \
>       --output-fd 3 \
>       2>/dev/null
59d54
<   [ -f $TMP_DIALOG ] && rm -f $TMP_DIALOG
173c168
<   echo -e $RED"This script must be run as root"$RESET 1>&2
---
>   echo "This script must be run as root"
Attached Files
File Type: txt mledconfig.sh.txt (3.9 KB, 23 views)
 
Old 04-04-2016, 02:49 PM   #55
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Update of script mledauto.sh

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
Attached Files
File Type: txt mledauto.sh.txt (8.6 KB, 27 views)
 
Old 04-04-2016, 02:52 PM   #56
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Man.... You are hot with the scripts. Thanks for another update.
 
Old 04-05-2016, 06:05 AM   #57
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
I get this error message on the new script

Quote:
Install slackpkg+ package:
cd: received redirection to `http://www.microlinux.fr/microlinux/...bit/slackware/'
mget: slackpkg+*.txz: no files found
 
Old 04-05-2016, 06:48 AM   #58
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Thanks for the bug report.

Indeed, I forgot to update the URL after the creation of package categories.

Here's the corrected script in which I appended '/ap' to the URL
Attached Files
File Type: txt mledauto.sh.txt (8.9 KB, 26 views)
 
Old 04-05-2016, 12:10 PM   #59
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Another error

Quote:
[root@darkstar:~] # ./mledauto.sh
bash: ./mledauto.sh: /bin/sh^M: bad interpreter: No such file or directory
[root@darkstar:~] #
P.S

Just tested the mledconfig script, it works lovely. I deleted my old account and created a new/different one. All works well.

Last edited by PROBLEMCHYLD; 04-05-2016 at 12:52 PM.
 
Old 04-05-2016, 01:38 PM   #60
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161

Original Poster
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Sorry, I updated the script on MS Windows.

Here's a version corrected on my Slackware machine.
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
225c225
<   http://www.microlinux.fr/microlinux/desktop-'$VERSION'-'$ARCH'/'$SLACKDIR
---
>   http://www.microlinux.fr/microlinux/desktop-'$VERSION'-'$ARCH'/'$SLACKDIR'/ap'
Attached Files
File Type: txt mledauto.sh.txt (8.7 KB, 48 views)

Last edited by gegechris99; 04-05-2016 at 01:40 PM. Reason: typo
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming a proof of concept ramzi.kahil Linux - Kernel 2 04-14-2014 11:04 AM
[SOLVED] Proof of concept required business_kid Linux - Software 19 12-26-2012 01:30 PM
Md5 spoof - Proof of concept with sample files! peter1234 General 10 09-25-2010 07:39 AM
New Cross-Platform Virus Proof of Concept win32sux Linux - Security 19 04-18-2006 11:24 PM
LDAP + Proof Of Concept damicatz Linux - Networking 5 11-27-2004 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Microlinux / MLED

All times are GMT -5. The time now is 01:05 PM.

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