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.
I think I know the issue. It's because the naming of generic kernel file is different between 32-bit and 63-bit edition. I tested on 64-bit edition only.
Can you please post the result of:
Code:
ls -l /boot/vmlinuz*
[EDIT]
Also provide result of:
Code:
uname -r
Thanks
[/EDIT]
Sorry for the inconvenience.
Last edited by gegechris99; 04-18-2016 at 04:47 PM.
Reason: please also provide "uname -r"
[root@darkstar:Desktop] # cat /etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# Append any additional kernel parameters:
append=" vt.default_utf8=1"
boot = /dev/sda
#compact # faster, but won't work on all systems.
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
#prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
#timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=787
# VESA framebuffer console @ 800x600x256
#vga=771
# VESA framebuffer console @ 640x480x64k
#vga=785
# VESA framebuffer console @ 640x480x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
# End LILO global section
# Linux bootable partition config begins
#image = /boot/vmlinuz
# root = /dev/sda1
# label = Linux
# read-only
# Linux bootable partition config ends
# Section added by MLED configuration script begins
File /boot/vmlinuz-generic-3.10.17-smp not found!
# Section added by MLED configuration script ends
[root@darkstar:Desktop] #
Thanks for the data. It confirmed that the error was the wrong kernel filename.
Here's a quick fix. I will have to work out a long-term solution as I also found out that the script will not work after an upgrade of the kernel contrary to what I assumed in a previous post. Basically, I will show a menu with all the generic kernels installed (in 32-bit edition, there would be at least the SMP one and the non-SMP one).
mledconfig.sh diff
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
229d228
< local GENERIC_KFILE="/boot/vmlinuz-generic-"$(echo `uname -r`)
230a230,244
> # Detect system architecture
> case "$(uname -m)" in
> x86_64)
> SMP=""
> ;;
> i?86)
> SMP="smp-"
> ;;
> *)
> echo "Unsupported system architecture: "$(uname -m) 1>&2
> echo "Configuration is cancelled" 1>&2
> exit 1
> ;;
> esac
> local GENERIC_KFILE="/boot/vmlinuz-generic-"$SMP$(echo `uname -r`)
[root@darkstar:Desktop] # cat /etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# Append any additional kernel parameters:
append=" vt.default_utf8=1"
boot = /dev/sda
#compact # faster, but won't work on all systems.
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
#prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
#timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=787
# VESA framebuffer console @ 800x600x256
#vga=771
# VESA framebuffer console @ 640x480x64k
#vga=785
# VESA framebuffer console @ 640x480x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
# End LILO global section
# Linux bootable partition config begins
#image = /boot/vmlinuz
# root = /dev/sda1
# label = Linux
# read-only
# Linux bootable partition config ends
# Section added by MLED configuration script begins
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sda1 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-smp-3.10.17-smp
initrd = /boot/initrd.gz
root = /dev/sda1
label = generic_3.10.17-smp
read-only
# Linux bootable partition config ends
# Section added by MLED configuration script ends
[root@darkstar:Desktop] #
# Section added by MLED configuration script begins
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sda1 -m mbcache:jbd2:ext4 -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-smp-3.10.17-smp
initrd = /boot/initrd.gz
root = /dev/sda1
label = generic_3.10.17-smp
read-only
# Linux bootable partition config ends
# Section added by MLED configuration script ends
The highlighted needs to read generic instead of generic_3.10.17-smp. When I made the change, the generic booted up with no problem. The error is in the screenshot below
Last edited by PROBLEMCHYLD; 12-28-2016 at 05:40 PM.
Great work It ran with no errors. The generic kernel loaded and all is good. Do one have to use the name generic, is it hardcoded? Ethier way both scripts are running well. Will do some tests, the next couple days. I do have a couple request if you have some free time. You been working hard so I'll leave you alone to enjoy your vacation. Thanks for the amazing scripts.
I developed those scripts as a hobby and as a way to improve my scripting skills, so do not hesitate to ask for more features. Scripts will be released when they're ready and as always they will come without any guarantee and it'll be up to you to test them
Quote:
Originally Posted by PROBLEMCHYLD
Do one have to use the name generic, is it hardcoded?
The label in /etc/lilo.conf is the name that would appear in the boot menu if it is displayed. My script deactivates this boot menu (.ie the one with the Slackware picture when you reboot the system after installing Slackware) so that the system boots directly using the kernel whose label = generic but is in fact the kernel image contained in image = /boot/vmlinuz-generic-smp-3.10.17-smp in your example.
So label can be whatever name except that there is a limited number of characters as we have found out
In fact the split generic/huge is only a Slackware terminology as explained here.
Last edited by gegechris99; 04-19-2016 at 03:53 PM.
Reason: typo
I like the fact boot menu disabled, system loads faster. One of my request would be, can you add a change password option to the config script? When I set up computers, I use a default. User would like to change it to their own password. As long as they're the Administrator, it shouldn't be a problem. Can you make it so the list of accounts menu is displayed? Like how you did it with the Remove User option. Thanks
Last edited by PROBLEMCHYLD; 04-20-2016 at 07:02 AM.
Let's say there is a family computer with 3 user accounts A, B, C.
Case #1:
user A has access to root account and she wants to be able to change password of users A, B or C using root account (or su).
Case #2:
user A has no access to root account and she wants to be able to change password of users A, B or C. For me, this is not a desirable case.
Case #3:
You want each user A, B or C to be able to change her own password only. In this case, she just has to open a terminal and type "passwd" to change her account password. Type "man passwd" in the terminal for further info on this tool.
I understand that you'd like a new entry in the config menu to deal with case #1. Am I correct?
Last edited by gegechris99; 04-20-2016 at 01:14 PM.
No one would have the root password, but the Administrator. The Admin would decide to remove and add whatever he or she wants. So in order to run the script, you would need the admin/root password. Which pretty much means ownership of the device.
Yes option 1
Last edited by PROBLEMCHYLD; 04-20-2016 at 01:36 PM.
Update of script mledconfig.sh - new feature: change of user password
Here's the update of mledconfig.sh
Main changes:
- new feature: change password of a user-defined user (no possibility to change password of system users)
- modified way of selecting the generic kernel. In 32-bit system, there are two generic kernels (SMP and not smp). Even though SMP generic kernel is preferred, I added a menu to prepare the script to be able in the future to manage upgrade of generic kernel (this feature is not yet implemented and there is no guarantee that it will be). This menu will not appear if there is only one generic kernel file installed (ex: 64-bit edition).
To implement the new feature (change password), I modified the logic of the "remove user" option. Testing for non-regression of removal of user is strongly advised. Here unitary tests are OK.
Happy testing
mledconfig.sh diff
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
8,10c8,11
< # 4) Remove a user
< # 5) Use generic kernel
< # 6) Exit
---
> # 4) Change user password
> # 5) Remove a user
> # 6) Use generic kernel
> # 7) Exit
176,177c177,178
< # Remove a user-defined user
< remove_user()
---
> # Select a user-defined user
> select_user()
187,206c188,217
< if [ "${#MYUSERS[@]}" -eq "0" ]; then
< echo
< echo "There is no user-defined user"
< SELECTED_USER=""
< elif [ "${#MYUSERS[@]}" -eq "1" ]; then
< # No need for menu display if only one user-defined user
< SELECTED_USER=${MYUSERS[*]}
< else
< # Display menu to show list of users
< SELECTED_USER=$(dialog --clear \
< --no-items \
< --cancel-label "Cancel" \
< --ok-label "Select" \
< --title " List of user-defined users " \
< --menu "\nSelect user to be removed:\n" 0 0 0 \
< ${MYUSERS[*]} \
< --output-fd 1 \
< 2>/dev/null)
< clear
< fi
---
> case "${#MYUSERS[@]}" in
> 0)
> echo
> echo "There is no user-defined user"
> SELECTED_USER=""
> ;;
> 1)
> # No need for menu display if only one user-defined user
> SELECTED_USER="${MYUSERS[*]}"
> ;;
> *)
> # Display menu to show list of users
> SELECTED_USER=$(dialog --clear \
> --no-items \
> --cancel-label "Cancel" \
> --ok-label "Select" \
> --title " List of user-defined users " \
> --menu "\n$1\n" 0 0 0 \
> ${MYUSERS[*]} \
> --output-fd 1 \
> 2>/dev/null)
> clear
> ;;
> esac
> }
>
> # Remove a user-defined user
> remove_user()
> {
> select_user "Select user to be removed:"
219a231,238
> # Change password of a user-defined user
> change_password()
> {
> select_user "Select user for change of password:"
> echo
> [ -n "$SELECTED_USER" ] && passwd $SELECTED_USER
> }
>
230,233c249,256
< # Detect system architecture
< case "$(uname -m)" in
< x86_64)
< SMP=""
---
>
> # List of available generic kernels
> VMLINUZ_GENERIC=($(echo `ls /boot/vmlinuz-generic* 2>/dev/null | sort -r`))
> case "${#VMLINUZ_GENERIC[@]}" in
> 0)
> echo
> echo "There is no generic kernel installed on the system"
> GENERIC_KFILE=""
235,236c258,260
< i?86)
< SMP="smp-"
---
> 1)
> # No need for menu display if only one generic kernel
> GENERIC_KFILE=${VMLINUZ_GENERIC[*]}
239,241c263,272
< echo "Unsupported system architecture: "$(uname -m) 1>&2
< echo "Configuration is cancelled" 1>&2
< exit 1
---
> # Display menu to show list of generic kernels
> GENERIC_KFILE=$(dialog --clear \
> --no-items \
> --cancel-label "Cancel" \
> --ok-label "Select" \
> --title " Generic kernels " \
> --menu "\nSelect a generic kernel:\n" 0 0 0 \
> --output-fd 1 \
> ${VMLINUZ_GENERIC[*]} \
> 2>/dev/null)
244c275,276
< local GENERIC_KFILE="/boot/vmlinuz-generic-"$SMP$(echo `uname -r`)
---
>
> [ -z "$GENERIC_KFILE" ] && return
321,323c353,356
< echo " 4) Remove a user"
< echo " 5) Use generic kernel"
< echo " 6) Exit"
---
> echo " 4) Change user password"
> echo " 5) Remove a user"
> echo " 6) Use generic kernel"
> echo " 7) Exit"
325c358
< read -p "Your choice [6]: " ANSWER
---
> read -p "Your choice [7]: " ANSWER
338c371
< remove_user
---
> change_password
340a374,376
> remove_user
> ;;
> 6)
343c379
< 6|"")
---
> 7|"")
It fixes an issue when the generic kernel to be used has a version different from the running kernel. This is not a problem when user is switching from the Huge kernel to the Generic kernel after MLED installation. But it will not work after a kernel upgrade. With this update, installing the generic kernel after a kernel upgrade should work. However this use case was not tested.
Main changes:
- Bug-fix in "Use generic kernel": make sure that the initrd file is created using the proper kernel version
- Enhancement in "Use generic kernel": use a custom initrd filename: initrd_<kernel version>.gz
- Cosmetic changes in "remove a user": warn that home directory and mail spool will be deleted
mledconfig.sh diff
Code:
$ diff mledconfig.sh.txt.old mledconfig.sh.txt
185,186c185,193
< MYUSERS=($(awk -F':' -v "limit=${l##UID_MIN}" \
< '{if ( $3 >= limit ) print $1}' $USER_FILE))
---
> MYUSERS=($(awk '
> BEGIN {
> FS=":";
> limit='"${l##UID_MIN}"';
> }
> {
> if ( $3 >= limit ) print $1;
> }
> ' $USER_FILE))
219a227,230
> echo
> echo -e "User "$BOLD$SELECTED_USER$NC" is about to be deleted."
> echo "Home directory and mail spool of the user will also be deleted."
> echo
248d258
< local MKINITRD_CMD=$($MKINITRD_CMD_GEN -r)
277a288,294
> # Same method as in mkinitrd_command_generator.sh to find kernel version
> KVERSION="$(strings $GENERIC_KFILE | grep '(.*@.*) #' | cut -f1 -d' ')"
>
> # Use a custom name for the initrd file
> ADD_PARAM="-o /boot/initrd_$KVERSION.gz"
>
> MKINITRD_CMD=$($MKINITRD_CMD_GEN --run $GENERIC_KFILE -a "$ADD_PARAM")
286c303,305
< echo "2) It will then add this section to /etc/lilo.conf:"
---
> echo -e "2) It will "$BOLD"disable the boot menu"
> echo -e $NC
> echo "3) It will then add this section to /etc/lilo.conf:"
288c307
< sed '/label/ c\ label = generic' <<EndofConf
---
> MLED_LILO_CONF=$(cat <<EndofConf
290c309
< $($MKINITRD_CMD_GEN -l $GENERIC_KFILE)
---
> $($MKINITRD_CMD_GEN --lilo $GENERIC_KFILE -a "$ADD_PARAM")
292a312,313
> )
> echo "$MLED_LILO_CONF"
294,295d314
< echo "3) It will disable the boot menu"
< echo
302a322
>
314d333
<
321d339
<
323,327c341
< sed '/label/ c\ label = generic' >>$LILO_CONF_FILE <<EndofLilo
< $MLED_BEGIN
< $($MKINITRD_CMD_GEN -l $GENERIC_KFILE)
< $MLED_END
< EndofLilo
---
> echo "$MLED_LILO_CONF" >>$LILO_CONF_FILE
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.