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.
Rather strange error. It seems to indicate that slackpkg package was not installed. Can you check if this package has been installed by running (as root at least for the second command):
Just did a clean install, everything is running smooth again. Sorry for the misunderstanding. I will report any new findings. Thanks for a wonderful script.
Main changes:
- Improved behavior of the script after a restart: deletion of directory "microlinux" before git, use upgradepkg instead of installpkg to (re)install slackpkg+ package
- Selection of the mirror transfer protocol (http or ftp) before displaying the list of mirrors from the online mirror list
- Added bear.alienbase.nl to the list of suggested mirrors
- Various code cleaning (mainly for echo command)
Unitary tests were OK.
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
27a28
> "http://bear.alienbase.nl/mirrors/slackware/" "GB"
56,57c57,82
< echo -e "\nGetting list of mirrors from "$MIRRORLIST \
< "\nPlease wait...\n"
---
> while true ; do
> echo
> echo "Selection of the mirror transfer protocol:"
> echo " 1) http"
> echo " 2) ftp"
> echo
> read -p "Your choice [1]: " ANSWER
>
> case "$ANSWER" in
> 1|"")
> P="http"
> break
> ;;
> 2)
> P="ftp"
> break
> ;;
> *)
> continue
> ;;
> esac
> done
> echo
> echo "Getting list of mirrors from "$MIRRORLIST
> echo "Please wait..."
> echo
70,73c95,97
< 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 \
---
> sed -n '/href='$P'/ p' $TMP_MIRRORS | awk -F'=' \
> '{printf "%s %.2s\n",substr($2,0,index($2,">")-1),toupper($1)}' | \
> xargs dialog --clear \
84c108
< MIRROR=$(cat $INPUT | cut -f3 -d" ")
---
> MIRROR=$(cat $INPUT)
86d109
<
88d110
<
101c123
< echo ""
---
> echo
103c125
< echo ""
---
> echo
106a129
> echo
108c131
< echo "http://www.microlinux.eu/docs.php"
---
> echo " http://www.microlinux.eu/docs.php"
110,111c133,134
< echo -e $BLUE$"\nIMPORTANT NOTE: the script should be executed on a machine" \
< "\nrunning Slackware Linux version 14.1\n"$RESET
---
> echo -e $BLUE"\nIMPORTANT NOTE:\nThe script should be executed on" \
> "a machine running Slackware Linux version 14.1\n"$RESET
131c154
< echo -e "\n"
---
> echo
161,165c184,190
< echo -e "\nSelection of a download mirror:\n" \
< "1) Use default mirror "$DEFAULT_MIRROR"\n" \
< "2) Select a mirror from our suggested list\n" \
< "3) Select a mirror from "$MIRRORLIST"\n" \
< "4) Enter manually a mirror\n"
---
> echo
> echo "Selection of a download mirror:"
> echo " 1) Use default mirror "$DEFAULT_MIRROR
> echo " 2) Select a mirror from our suggested list"
> echo " 3) Select a mirror from "$MIRRORLIST
> echo " 4) Enter manually a mirror"
> echo
179c204
< echo -e "\n"
---
> echo
197,201c222,231
< echo -e "\nMLED installation parameters:"
< 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"
<
---
> clear
> echo
> echo "MLED installation parameters:"
> echo
> echo -e " Operating system: "$BOLD"Slackware "$VERSION" "$ARCH$RESET
> echo
> echo -e " Multilib installation: "$BOLD$MULTILIB$RESET
> echo
> echo -e " Mirror for slackpkg+: "$BOLD$MIRROR$RESET
> echo
205c235,238
< echo -e "\nMLED installation is cancelled\n\nGoodbye :)\n"
---
> echo
> echo "MLED installation is cancelled"
> echo "Goodbye :)"
> echo
218a252
> [ -d $HOME/microlinux ] && rm -rf $HOME/microlinux
224,226c258,262
< lftp -c 'open -e "mget slackpkg+*.txz" \
< http://www.microlinux.fr/microlinux/desktop-'$VERSION'-'$ARCH'/'$SLACKDIR'/ap'
< installpkg slackpkg+*.txz
---
> URL="http://www.microlinux.fr/microlinux/desktop-"$VERSION"-"$ARCH"/"$SLACKDIR"/ap"
> lftp -c 'open -e "mget slackpkg+*.txz" '$URL
> SPLUSPKG=$(echo `ls slackpkg+*.txz`)
> upgradepkg --reinstall --install-new $SPLUSPKG
>
234,237c270,274
< 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
---
> sed -i.orig '{
> s/^PKGS_PRIORITY=(/PKGS_PRIORITY=( multilib:.*/
> s/^REPOPLUS=(/REPOPLUS=( multilib/
> /# Define mirrors/ a MIRRORPLUS['\''multilib'\'']='$MULTILIB_MIRROR'
> }' /etc/slackpkg/slackpkgplus.conf
292,293c329,330
< rm -rf $HOME/microlinux
< rm -f $HOME/slackpkg+*.txz
---
> [ -d $HOME/microlinux ] && rm -rf $HOME/microlinux
> [ -f $HOME/$SPLUSPKG ] && rm -f $HOME/$SPLUSPKG
295,296c332,333
< echo -e $GREEN"\n\nMLED installation is now completed" \
< "\n\nYou can now proceed with MLED configuration"$RESET
---
> echo -e $GREEN"\n\nMLED installation is completed" \
> "\n\nYou can now proceed with MLED configuration"$RESET
I made some code cleaning and some small optimization in both the mledauto.sh and mledconfig.sh scripts. No new features in these updates.
I made a small change of behavior in mledauto.sh. The script will no longer delete the slackpkg+ package and microlinux git repository when the installation is completed. Instead, it will delete any existing slackpkg+ package and microlinux git repository before downloading and installing them. So relaunching the script after an error (ex: breakdown in internet connection) should go smoothly, no more complaint about existing file/directory at least during my unitary tests
For the curious, I provide the diff between these updates and their previous versions.
mledauto.sh
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
18c18
< RESET="\033[00m"
---
> NC="\033[00m"
20a21,26
> # Mirror file of slackpkg
> SLACKPKG_MIRRORFILE="/etc/slackpkg/mirrors"
>
> # Configuration file of slackpkg+
> SPLUSCONF="/etc/slackpkg/slackpkgplus.conf"
>
31a38,44
> # URL of MLED git repository
> MLEDGIT="https://github.com/kikinovak/microlinux"
>
> # Mirror to download MLED slackpkg+ package
> SITE="http://www.microlinux.fr"
> #SITE="http://slackware.uk"
>
36,37c49,51
< # or from our local mirror list
< mirror_menu() {
---
> # or from our list of suggested mirrors
> mirror_menu()
> {
42d55
< INPUT=${INPUT:-$TMP_DIR/menu_mirrors.tmp}
47c60
< dialog --clear \
---
> MIRROR=$(dialog --clear \
53,55c66,67
< 2>"${INPUT}"
<
< MIRROR=$(cat $INPUT)
---
> --output-fd 1 \
> 2>/dev/null)
61a74
> echo " 3) http or ftp"
73a87,90
> 3)
> P="(http|ftp)"
> break
> ;;
87c104,106
< echo -e $RED"Error: no mirror list available at "$MIRRORLIST$RESET
---
> echo -e $RED
> echo "Error: no mirror list available at "$MIRRORLIST 1>&2
> echo -e $NC
91,93d109
< # Open file descriptor
< exec 3>$INPUT
<
95,97c111,114
< sed -n '/href='$P'/ p' $TMP_MIRRORS | awk -F'=' \
< '{printf "%s %.2s\n",substr($2,0,index($2,">")-1),toupper($1)}' | \
< xargs dialog --clear \
---
> MIRROR=$(sed -r -n '/href='$P'/ p' $TMP_MIRRORS \
> | awk -F'=' \
> '{printf "%s %.2s\n",substr($2,0,index($2,">")-1),toupper($1)}' \
> | xargs dialog --clear \
102,108c119,120
< --output-fd 3 \
< 2>/dev/null
<
< # Close file descriptor
< exec 3>&-
<
< MIRROR=$(cat $INPUT)
---
> --output-fd 1 \
> 2>/dev/null)
112d123
< [ -f $INPUT ] && rm -f $INPUT
118c129,131
< echo -e $RED"This script must be run as root"$RESET 1>&2
---
> echo -e $RED
> echo "This script must be run as root" 1>&2
> echo -e $NC
122a136
> clear
128d141
< echo "This script will automate many of the steps of the MLED installation."
130,135c143,149
< echo "The MLED installation guide is available at:"
< echo " http://www.microlinux.eu/docs.php"
<
< echo -e $BLUE"\nIMPORTANT NOTE:\nThe script should be executed on" \
< "a machine running Slackware Linux version 14.1\n"$RESET
<
---
> echo "This script automates many of the steps of the MLED installation."
> echo
> echo "MLED installation guide is available at http://www.microlinux.eu/docs.php"
> echo -e $BLUE
> echo "IMPORTANT NOTE:"
> echo "The script must be executed on a machine running Slackware Linux version 14.1"
> echo -e $NC
142,143c156,159
< echo -e $RED"\nYou are not running Slackware" \
< "\n\nMLED installation is cancelled\n\nGoodbye"$RESET
---
> echo -e $RED
> echo "You are not running Slackware" 1>&2
> echo "MLED installation is cancelled" 1>&2
> echo -e $NC
176,177c192,195
< echo -e $RED"\nUnsupported system architecture: "$(uname -m) \
< "\n\nMLED installation is cancelled\n\nGoodbye"$RESET
---
> echo -e $RED
> echo "Unsupported system architecture: "$(uname -m) 1>&2
> echo "MLED installation is cancelled" 1>&2
> echo -e $NC
182c200
< # Menu to select method for getting a mirror
---
> # Menu to select method for getting a mirror to download Slackware packages
185c203
< echo "Selection of a download mirror:"
---
> echo "Selection of the mirror to download Slackware packages:"
187c205
< echo " 2) Select a mirror from our suggested list"
---
> echo " 2) Select a mirror from our list of suggested mirrors"
226c244
< echo -e " Operating system: "$BOLD"Slackware "$VERSION" "$ARCH$RESET
---
> echo -e " Operating system: "$BOLD"Slackware "$VERSION" "$ARCH$NC
228c246
< echo -e " Multilib installation: "$BOLD$MULTILIB$RESET
---
> echo -e " Multilib installation: "$BOLD$MULTILIB$NC
230c248
< echo -e " Mirror for slackpkg+: "$BOLD$MIRROR$RESET
---
> echo -e " Mirror to download Slackware packages: "$BOLD$MIRROR$NC
234c252
< if [ ! "$ANSWER" = "y" ]; then
---
> if [ ! "$ANSWER" = "y" ] && [ ! "$ANSWER" = "Y" ]; then
242c260,262
< echo -e $BLUE"\nStarting MLED installation..."$RESET
---
> echo -e $BLUE
> echo "Starting MLED installation..."
> echo
246d265
<
249a269,281
> # Variables dependent on the type of MLED installation: 32-bit or 64-bit
> # Directory for MLED scripts trim.sh and cleanmenu.sh
> TOOLSDIR=$HOME"/microlinux/desktop-"$VERSION"-"$ARCH"/tools/"
> # URL to download slackpkg+ package
> SPLUSURL=$SITE"/microlinux/desktop-"$VERSION"-"$ARCH"/"$SLACKDIR"/ap"
>
> # Add the selected mirror at end of /etc/slackpkg/mirrors
> echo "Configure slackpkg to use selected mirror"
> ADD_MIRROR="# Mirror selected during MLED installation:\n"$MIRROR
> sed -i.orig '$ a '"$ADD_MIRROR" $SLACKPKG_MIRRORFILE
> echo -e $GREEN
> echo $SLACKPKG_MIRRORFILE" has been configured"
>
251c283,285
< echo -e $BLUE"\n\nDownload MLED installation tools:"$RESET
---
> echo -e $BLUE
> echo "Download MLED installation tools"
> echo -e $NC
253,254c287,289
< git clone https://github.com/kikinovak/microlinux
< echo -e $GREEN"\nMLED installation tools have been downloaded"$RESET
---
> git clone $MLEDGIT
> echo -e $GREEN
> echo "MLED installation tools have been downloaded"
257,259c292,299
< echo -e $BLUE"\n\nInstall slackpkg+ package:"$RESET
< URL="http://www.microlinux.fr/microlinux/desktop-"$VERSION"-"$ARCH"/"$SLACKDIR"/ap"
< lftp -c 'open -e "mget slackpkg+*.txz" '$URL
---
> echo -e $BLUE
> echo "Install slackpkg+ package"
> echo -e $NC
> # Delete any existing slackpkg+ package in working directory
> rm -f $HOME/slackpkg+*.txz
> # Download slackpkg+ package
> lftp -c 'open -e "mget slackpkg+*.txz" '$SPLUSURL
> # Install slackpkg+ package
262,266c302,303
<
< # Add the default mirror at end of /etc/slackpkg/mirrors
< ADD_MIRROR="# Mirror selected during MLED installation:\n"$MIRROR
< sed -i.orig '$ a '"$ADD_MIRROR" /etc/slackpkg/mirrors
< echo -e $GREEN"\nslackpkg+ package has been installed"$RESET
---
> echo -e $GREEN
> echo "slackpkg+ package has been installed"
269a307,308
> echo -e $BLUE
> echo "Configure slackpkg+ to install multilib"
274c313,315
< }' /etc/slackpkg/slackpkgplus.conf
---
> }' $SPLUSCONF
> echo -e $GREEN
> echo $SPLUSCONF" has been configured"
278c319,321
< echo -e $BLUE"\n\nUpdate slackpkg package list:"$RESET
---
> echo -e $BLUE
> echo "Update slackpkg package list"
> echo -e $NC
281c324,325
< echo -e $GREEN"\nslackpkg package list has been updated"$RESET
---
> echo -e $GREEN
> echo "slackpkg package list has been updated"
284,285c328,331
< echo -e $BLUE"\n\nTrim the base installation:"$RESET
< cd $HOME/microlinux/desktop-$VERSION-$ARCH/tools/
---
> echo -e $BLUE
> echo "Trim the base installation"
> echo -e $NC
> cd $TOOLSDIR
287c333,334
< echo -e $GREEN"\nThe base installation has been trimmed"$RESET
---
> echo -e $GREEN
> echo "The base installation has been trimmed"
290c337,339
< echo -e $BLUE"\n\nInstall extra Slackware packages:"$RESET
---
> echo -e $BLUE
> echo "Install extra Slackware packages"
> echo -e $NC
292c341,342
< echo -e $GREEN"\nExtra Slackware packages have been installed"$RESET
---
> echo -e $GREEN
> echo "Extra Slackware packages have been installed"
295c345,347
< echo -e $BLUE"\n\nUpgrade the base installation:"$RESET
---
> echo -e $BLUE
> echo "Upgrade the base installation"
> echo -e $NC
300c352,353
< echo -e $GREEN"\nThe base installation has been upgraded"$RESET
---
> echo -e $GREEN
> echo "The base installation has been upgraded"
304c357,359
< echo -e $BLUE"\n\nInstall the multilib packages:"$RESET
---
> echo -e $BLUE
> echo "Install the multilib packages"
> echo -e $NC
306c361,362
< echo -e $GREEN"\nMultilib packages have been installed"$RESET
---
> echo -e $GREEN
> echo "Multilib packages have been installed"
310c366,368
< echo -e $BLUE"\n\nInstall the MLED packages:"$RESET
---
> echo -e $BLUE
> echo "Install the MLED packages"
> echo -e $NC
314c372,374
< echo -e $GREEN"\nMLED packages have been installed\n"$RESET
---
> echo -e $GREEN
> echo "MLED packages have been installed"
> echo -e $NC
323,324c383,386
< echo -e $BLUE"\n\nCleaning up the applications menu:"$RESET
< cd $HOME/microlinux/desktop-$VERSION-$ARCH/tools/
---
> echo -e $BLUE
> echo "Cleaning up the applications menu"
> echo -e $NC
> cd $TOOLSDIR
326,333c388,394
< echo -e $GREEN"\nApplications menu has been cleaned up"$RESET
<
< # Remove downloaded files used during installation
< [ -d $HOME/microlinux ] && rm -rf $HOME/microlinux
< [ -f $HOME/$SPLUSPKG ] && rm -f $HOME/$SPLUSPKG
<
< echo -e $GREEN"\n\nMLED installation is completed" \
< "\n\nYou can now proceed with MLED configuration"$RESET
---
> echo -e $GREEN
> echo "Applications menu has been cleaned up"
> echo
> echo "MLED installation is completed"
> echo
> echo "You can now proceed with MLED configuration"
> echo -e $NC
mledconfig.sh
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
21,22d20
< #LANG_FILE=$HOME"/tmp/lang.sh"
< #USER_FILE=$HOME"/tmp/passwd-test"
25,34c23,28
< locale_menu() {
<
< # Temporary files - they will be deleted at end of function
< INPUT=${INPUT:-$TMP_DIR/menu_locale.tmp}
<
< # Open file descriptor
< exec 3>$INPUT
<
< echo $(locale -av | \
< sed -n '/locale:/ {N;N;
---
> locale_menu()
> {
> NLANG=$(echo $(locale -av | \
> sed -n '/locale:/ {
> N
> N
36c30
< s/ *directory.*\n.*\n.*| / \"/
---
> s/ *.*\n.*\n.*| / \"/
38,39c32,34
< p}') | \
< xargs dialog --clear \
---
> p
> }') \
> | xargs dialog --clear \
44,49c39,40
< --output-fd 3 \
< 2>/dev/null
<
< # Close file descriptor
< exec 3>&-
<
---
> --output-fd 1 \
> 2>/dev/null)
51,54d41
< NLANG=$(cat $INPUT)
<
< # if temp files found, delete them
< [ -f $INPUT ] && rm -f $INPUT
57d43
<
59c45,46
< set_locale() {
---
> set_locale()
> {
64,65c51,53
< echo -e "\nGetting list of installed locales" \
< "\nPlease wait...\n"
---
> echo
> echo "Getting list of installed locales"
> echo "Please wait..."
67d54
<
70c57,58
< echo -e "\nNo language selected. Keep current language: "$CLANG
---
> echo
> echo "No language selected. Keep current language: "$CLANG
81c69,70
< echo -e "\nSelected language: "$NLANG
---
> echo
> echo "Selected language: "$NLANG
83d71
<
87c75,76
< remove_user() {
---
> remove_user()
> {
96,98d84
< # Temporary files - they will be deleted at end of function
< INPUT1=${INPUT1:-$TMP_DIR/menu_users.tmp}
<
108c94
< dialog --clear \
---
> SELECTED_USER=$(dialog --clear \
115,117c101,102
< 2>"${INPUT1}"
<
< SELECTED_USER=$(cat $INPUT1)
---
> --output-fd 1 \
> 2>/dev/null)
131,133d115
<
< # if temp files found, delete them
< [ -f $INPUT1 ] && rm -f $INPUT1
137c119,120
< config_menu() {
---
> config_menu()
> {
139,143c122,128
< echo -e "\nConfiguration menu:"
< echo -e " 1) Set language"
< echo -e " 2) Add a user"
< echo -e " 3) Remove a user"
< echo -e " 4) Exit"
---
> echo
> echo "Configuration menu:"
> echo " 1) Set language"
> echo " 2) Add a user"
> echo " 3) Remove a user"
> echo " 4) Exit"
> echo
168c153
< echo "This script must be run as root"
---
> echo "This script must be run as root" 1>&2
Update of script mledconfig.sh (new feature: select keyboard for Xorg)
Herewith an update of script mledconfig.sh that comes with a new feature: "Select keyboard for Xorg".
Unitary tests are OK here.
At this point, mledauto.sh and mledconfig.sh cover most of the steps described in the MLED installation guide.
What is left out from the scripts:
- Installation of Slackware (for obvious reason)
- Switching to generic kernel
- Install VirtualBox Guest Additions
- X11 in a nutshell except for keyboard configuration
- Basic maintenance (not applicable to installation scripts)
For now, I do not intend to add new features to the scripts and will only update the scripts based on feedbacks (bug report, advice on code cleaning...) or after my own code cleaning (these scripts are a good opportunity to improve my scripting skills).
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
5,8c5,9
< # 1) Set language
< # 2) Add a user
< # 3) Remove a user
< # 4) Exit
---
> # 1) Select language
> # 2) Select keyboard for Xorg
> # 3) Add a user
> # 4) Remove a user
> # 5) Exit
21a23,28
> # parameters for setting keyboard for Xorg
> XKB_BASE_LIST="/usr/share/X11/xkb/rules/base.lst"
> XORG_SRCDIR="/usr/share/X11/xorg.conf.d"
> XORG_TGTDIR="/etc/X11/xorg.conf.d"
> XORG_XKB_CONF="90-keyboard-layout.conf"
>
45c52
< set_locale()
---
> select_locale()
73a81,170
> # Select a keyboard layout for Xorg
> select_xkb_layout()
> {
> local BEGIN="! layout"
> local END="! variant"
>
> XKBL=$(sed -n ' /'"$BEGIN"'/,/'"$END"'/ {
> /'"$BEGIN"'/n
> /^$/ d
> /'"$END"'/ !{
> s/^ *//
> s/ */ \"/
> s/$/\"/
> p
> }
> }' $XKB_BASE_LIST \
> | sort \
> | xargs dialog --clear \
> --cancel-label "Cancel" \
> --ok-label "Select" \
> --title " Keyboard layouts " \
> --menu "\nSelect a keyboard layout:\n" 0 0 0 \
> --output-fd 1 \
> 2>/dev/null)
> }
>
> # Select variant of a keyboard layout for Xorg
> select_xkb_variant()
> {
> local BEGIN="! variant"
> local END="! option"
> local P=" "$1":"
>
> XKBV=$(sed -n ' /'"$BEGIN"'/,/'"$END"'/ {
> /'"$BEGIN"'/n
> /^$/ d
> /'"$END"'/ !{
> /'"$P"'/ {
> s/^ *//
> s/ *'"$P"'/ \"/
> s/$/\"/
> p
> }
> }
> }' $XKB_BASE_LIST \
> | xargs dialog --clear \
> --cancel-label "Cancel" \
> --ok-label "Select" \
> --title " Keyboard variants for ""$XKBL" \
> --menu "\nSelect a variant for keyboard layout ""$XKBL"":\n" 0 0 0 \
> --output-fd 1 \
> 2>/dev/null)
> }
>
> # Update with selected keyboard parameters
> update_xorg_conf()
> {
> # Copy template file for Xorg keyboard configuration
> cp -f $XORG_SRCDIR"/"$XORG_XKB_CONF $XORG_TGTDIR"/"$XORG_XKB_CONF
> XKBL_CONF="XkbLayout\" \""$1"\""
> sed -i ' /^#/ ! {
> s|XkbLayout.*$|'"$XKBL_CONF"'|
> }' $XORG_TGTDIR"/"$XORG_XKB_CONF
> if [ -n "$2" ]; then
> XKBV_CONF="Option \"XkbVariant\" \""$2"\""
> sed -i ' /^#/ ! {
> s|#Option "XkbVariant.*$|'"$XKBV_CONF"'|
> }' $XORG_TGTDIR"/"$XORG_XKB_CONF
> fi
> }
>
> # Select keyboard layout and variant for Xorg
> select_xkb()
> {
> select_xkb_layout
> clear
> if [ -n "$XKBL" ]; then
> select_xkb_variant $XKBL
> clear
> update_xorg_conf $XKBL $XKBV
> echo "Selected keyboard parameters for Xorg:"
> echo " Keyboard layout: "$XKBL
> if [ -n "$XKBV" ]; then
> echo " Keyboard variant: "$XKBV
> else
> echo " No keyboard variant"
> fi
> fi
> }
>
124,127c221,225
< echo " 1) Set language"
< echo " 2) Add a user"
< echo " 3) Remove a user"
< echo " 4) Exit"
---
> echo " 1) Select language"
> echo " 2) Select keyboard for Xorg"
> echo " 3) Add a user"
> echo " 4) Remove a user"
> echo " 5) Exit"
129c227
< read -p "Your choice [4]: " ANSWER
---
> read -p "Your choice [5]: " ANSWER
133c231
< set_locale
---
> select_locale
136c234
< adduser
---
> select_xkb
138a237,239
> adduser
> ;;
> 4)
141c242
< 4|"")
---
> 5|"")
# /etc/inittab
...
# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:
...
I also believe having the Generic Kernel as an option may be a good idea.
Have something like
Would you like to switch to Generic Kernel? [Y|N]
Users having the option wouldn't hurt the system at all. I can afford some format and clean installs. I'm still building my app database for Slackware. I do a lot of networking, so I am testing apps I like. You have done a great deal and if this is where you get off, its still gratitude. Thanks for making my Slack experience a breeze. Enjoy.
/etc/inittab: no problem, I will add the change to level 4 at the end of mledauto.sh. It's quite easy to do.
Switch to generic kernel: I have a logic in mind to provide such an option using the great mkinitrd_command_generator.sh script. If you're willing to test it (and from you post I assume you are), I will try to provide an option in mledconfig.sh.
Herewith the requested update of mledauto.sh and mledconfig.sh.
mledauto.sh changelog:
- Added a step at end of the script to switch to runlevel 4 in /etc/inittab
Unitary tests are OK.
mledconfig.sh changelog:
- Added option "Use generic kernel". This option will automatically switch to the generic kernel installed on the system instead of the currently running kernel.
The option will disable the boot menu so that the system will boot directly with the generic kernel. As such, it is not advised to use this option if you have a multi-boot system (ex: Slackware + Windows).
The option was devised to not mess up lilo.conf if it is run multiple times (each time, the previous version of lilo.conf is saved as lilo.conf.orig). For example, if you run it twice in a row, lilo.conf will not change. You can check this by comparing /etc/lilo.conf and /etc/lilo.conf.orig
This option could also be used after a kernel upgrade to install the upgraded generic kernel. However I didn't test this use case. But it explains why I named it "Use generic kernel" instead of "Switch to generic kernel". Any advise on a proper naming of the option is welcome.
I tested this new option on my main machine and it worked
mledauto.sh diff
Code:
$ diff mledauto.sh.txt.old mledauto.sh.txt
26a27,30
> # Inittab file to change runlevel
> INITTAB="/etc/inittab"
> RUNLEVEL4="id:4:initdefault:"
>
389a394,402
>
> # Switch to runlevel 4 by editing /etc/inittab
> echo -e $BLUE
> echo "Switching to runlevel 4 by editing /etc/inittab"
> sed -i ' /initdefault/ c '"$RUNLEVEL4" $INITTAB
> echo -e $GREEN
> echo "/etc/inittab has been edited"
>
> echo -e $BOLD
mledconfig.sh diff
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
9c9,10
< # 5) Exit
---
> # 5) Use generic kernel
> # 6) Exit
16a18,21
> # Syntax highlighting
> NC="\033[00m"
> BOLD="\033[01m"
>
214a220,293
> # Use the generic kernel
> use_generic_kernel()
> {
> local MKINITRD_CMD_GEN="/usr/share/mkinitrd/mkinitrd_command_generator.sh"
> local LILO_CONF_FILE="/etc/lilo.conf"
> local LILO_BEGIN="# Linux bootable partition config begins"
> local LILO_END="# Linux bootable partition config ends"
> local MLED_BEGIN="# Section added by MLED configuration script begins"
> local MLED_END="# Section added by MLED configuration script ends"
> local GENERIC_KFILE="/boot/vmlinuz-generic-"$(echo `uname -r`)
> local MKINITRD_CMD=$($MKINITRD_CMD_GEN -r)
>
> clear
> echo
> echo -e "You are about to use generic kernel "$BOLD$GENERIC_KFILE$NC
> echo
> echo "1) The script will create the initrd.gz file using command:"
> echo -e $BOLD
> echo "$MKINITRD_CMD"
> echo -e $NC
> echo "2) It will then add this section to /etc/lilo.conf:"
> echo -e $BOLD
> $MKINITRD_CMD_GEN -l $GENERIC_KFILE
> echo -e $NC
> echo "3) It will disable the boot menu"
> echo
> echo -e "4) And it will run "$BOLD"lilo"$NC
> echo
> echo "5) When done, you will have to reboot your system to use this kernel"
> echo
> read -p "Do you want to continue [y|N]? " ANSWER
>
> if [ "$ANSWER" = "y" ] || [ "$ANSWER" = "Y" ]; then
> # Create initrd.gz file
> echo -e $BOLD
> echo "$MKINITRD_CMD"
> echo -e $NC
> $MKINITRD_CMD
>
> echo -e $BOLD
> echo "Edit "$LILO_CONF_FILE
> echo -e $NC
> # Delete any section previously added by the script in lilo.conf
> sed -i.orig '/'"$MLED_BEGIN"'/,/'"$MLED_END"'/ d' $LILO_CONF_FILE
>
> # Edit lilo.conf: disable boot menu and any existing boot menu entry
> sed -i ' {
> s/^prompt/#prompt/
> s/^timeout/#timeout/
> /'"$LILO_BEGIN"'/,/'"$LILO_END"'/ s/^[^#]/#&/
> }' $LILO_CONF_FILE
>
> # Add a new section at end of lilo.conf
> sed 's/label = /&generic_/' >>$LILO_CONF_FILE <<EndofLilo
> $MLED_BEGIN
> $($MKINITRD_CMD_GEN -l $GENERIC_KFILE)
> $MLED_END
> EndofLilo
>
> # Run lilo
> echo -e $BOLD
> echo "Run lilo"
> echo -e $NC
> lilo
>
> # Reminder
> echo -e $BOLD
> echo "Switch to generic kernel completed"
> echo
> echo "Don't forget to reboot your system to use this kernel"
> echo -e $NC
> fi
> }
>
225c304,305
< echo " 5) Exit"
---
> echo " 5) Use generic kernel"
> echo " 6) Exit"
227c307
< read -p "Your choice [5]: " ANSWER
---
> read -p "Your choice [6]: " ANSWER
242c322,325
< 5|"")
---
> 5)
> use_generic_kernel
> ;;
> 6|"")
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.