SlackwareThis Forum is for the discussion of Slackware Linux.
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.
What happens if you burn the LiveSlak ISO onto DVD and then boot the computer directly to that DVD
instead of booting the LiveSlack ISO from within a virtualbox ?
What happens if you burn the LiveSlak ISO onto DVD and then boot the computer directly to that DVD
instead of booting the LiveSlack ISO from within a virtualbox ?
laptop: xps 15z
usb-disk: initialized with ventoy boot solution 1.0.96
dvd: alien's livecd 2023-10-29, copied to usb-disk
Heck, during an install from DVD, if the generic kernel is installed
the setup system automatically generates that intitrd.
So, since it can be done automatically during initial install...
it shouldn't be too darned difficult to do it manually each time the kernel gets upgraded.
Sheesh !
That is so easy I don't see why I stayed with the huge kernel all these years.
Upon kernel upgrade, execute /usr/sbin/geninitrd and the new initrd is generated for the new kernel.
Have not looked into GRUB as of yet, but for lilo, simply add this one line...
Have not looked into GRUB as of yet, but for lilo, simply add this one line...
initrd = /boot/initrd.gz
Code:
menuentry 'Slackware-15.0+ GNU/Linux, with Linux generic' --class slackware_15_0_ --class gnu-linux --class gnu --class os $menuentry>
savedefault
load_video
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 048d2c3b-1a06-4218-b5bf-6ee404164ce8
echo 'Loading Linux generic ...'
linux /boot/vmlinuz-generic root=UUID=048d2c3b-1a06-4218-b5bf-6ee404164ce8 ro ipv6.disable=1
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.gz
}
I haven't touched making an initrd in ages, so its picking up an outdated initrd during boot. But apparently it had been even with the huge kernel also as all my autogenerated entries include initrd /boot/initrd.gz. I need to do some more reading on GRUB to clean up my grub.cfg so its proper.
menuentry 'Slackware-15.0+ GNU/Linux, with Linux generic' --class slackware_15_0_ --class gnu-linux --class gnu --class os $menuentry>
savedefault
load_video
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 048d2c3b-1a06-4218-b5bf-6ee404164ce8
echo 'Loading Linux generic ...'
linux /boot/vmlinuz-generic root=UUID=048d2c3b-1a06-4218-b5bf-6ee404164ce8 ro ipv6.disable=1
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.gz
}
I haven't touched making an initrd in ages, so its picking up an outdated initrd during boot. But apparently it had been even with the huge kernel also as all my autogenerated entries include initrd /boot/initrd.gz. I need to do some more reading on GRUB to clean up my grub.cfg so its proper.
No need to do the work of a Bash script.
Below you have a patch for /etc/grub.d/10_linux that makes grub-mkconfig correctly process kernels with specific Slackware names.
This patch was made by me according to an idea of LuckyCyborg, after which he improved it, after which I improved it too, and this is what I use now.
Code:
--- 10_linux.new 2021-09-10 21:45:00.000000000 +0300
+++ 10_linux 2023-09-22 10:51:25.658346996 +0300
@@ -47,6 +47,9 @@
# older kernels.
GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
+# Default to disabling the initrd support for the Slackware's huge kernels.
+GRUB_DISABLE_INITRD_FOR_HUGE_KERNELS=${GRUB_DISABLE_INITRD_FOR_HUGE_KERNELS-true}
+
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
@@ -84,17 +87,22 @@
os="$1"
version="$2"
type="$3"
- args="$4"
+ flavor="$4"
+ args="$5"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
+ niceflavor=""
+ if [ "x${flavor}" != xdefault ]; then
+ niceflavor="${flavor^} "
+ fi
case $type in
recovery)
- title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
+ title="$(gettext_printf "%s, with Linux %s%s (recovery mode)" "${os}" "${niceflavor}" "${version}")" ;;
*)
- title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
+ title="$(gettext_printf "%s, with Linux %s%s" "${os}" "${niceflavor}" "${version}")" ;;
esac
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
@@ -102,7 +110,7 @@
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
- echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$flavor-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
@@ -194,7 +202,6 @@
is_top_level=true
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
- gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
@@ -202,6 +209,13 @@
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ # We will skip the vmlinuz-generic and and vmlinuz-huge which are symlinks
+ if [ "x${version}" = xgeneric ] || [ "x${version}" = xhuge ]; then
+ list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
+ continue
+ fi
+ gettext_printf "Found linux image: %s\n" "$linux" >&2
+
initrd_early=
for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \
${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
@@ -219,6 +233,7 @@
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "initrd-generic-${version}.gz" "initrd-generic-${version}.img" \
"initrd.gz"; do
if test -e "${dirname}/${i}" ; then
initrd_real="${i}"
@@ -226,6 +241,36 @@
fi
done
+ # Backup the value of GRUB_CMDLINE_LINUX, because it may be altered for the huge kernels.
+ GRUB_CMDLINE_LINUX_ORIGINAL="${GRUB_CMDLINE_LINUX}"
+
+ flavor="default"
+ if echo "${basename}" | grep -wq vmlinuz-huge ; then
+ flavor="huge"
+ if [ "x${GRUB_DISABLE_INITRD_FOR_HUGE_KERNELS}" = xtrue ]; then
+ initrd_real=""
+ # We will parse the command line, replacing the resume device when it's specified as
+ # UUID or PARTUUID, because this way is supported only with an initrd. Also, we will
+ # remove the rootflags parameter, because the huge kernel has issues on handling it.
+ parsed_cmdline=""
+ while read parameter; do
+ if echo "${parameter}" | grep -wq -E "resume=UUID=*|resume=PARTUUID=*" ; then
+ value=$(echo "${parameter}" | cut -d= -f3)
+ if blkid | grep -wq "${value}" ; then
+ swap_device=$(blkid | grep "${value}" | cut -d: -f1)
+ parameter="resume=${swap_device}"
+ fi
+ elif echo "${parameter}" | grep -wq -E "rootflags=*" ; then
+ continue
+ fi
+ parsed_cmdline="${parsed_cmdline} ${parameter}"
+ done <<< $(echo -n "${GRUB_CMDLINE_LINUX}" | tr -s "[:blank:]" | tr ' ' '\n')
+ GRUB_CMDLINE_LINUX=$(echo "${parsed_cmdline}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
+ fi
+ elif echo "${basename}" | grep -wq vmlinuz-generic ; then
+ flavor="generic"
+ fi
+
initrd=
if test -n "${initrd_early}" || test -n "${initrd_real}"; then
initrd="${initrd_early} ${initrd_real}"
@@ -271,26 +316,29 @@
fi
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then
- linux_entry "${OS}" "${version}" simple \
+ linux_entry "${OS}" "${version}" simple "$flavor" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
submenu_indentation="$grub_tab"
-
+
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
# TRANSLATORS: %s is replaced with an OS name
- echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
+ echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$flavor-$boot_device_id' {"
is_top_level=false
fi
- linux_entry "${OS}" "${version}" advanced \
+ linux_entry "${OS}" "${version}" advanced "$flavor" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
- linux_entry "${OS}" "${version}" recovery \
+ linux_entry "${OS}" "${version}" recovery "$flavor" \
"single ${GRUB_CMDLINE_LINUX}"
fi
+ # Restore the original value of GRUB_CMDLINE_LINUX.
+ GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_ORIGINAL}"
+
list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
done
Last edited by ZhaoLin1457; 10-29-2023 at 06:24 PM.
since talking about kernel/huge/initrd, let me said something of my thinking
how about a universal initramfs file?
it contain all modules, or at least all disk/blockdev modules
then will never care about which module to load to find root filesystem, when something wrong we could get a more complete rescue environments.
and yes, it will big, maybe 100MB+ but should less than 200MB in my estimate, in a system less than 10 years old, should not be a big delay when loading from disk.
since talking about kernel/huge/initrd, let me said something of my thinking
how about a universal initramfs file?
it contain all modules, or at least all disk/blockdev modules
then will never care about which module to load to find root filesystem, when something wrong we could get a more complete rescue environments.
and yes, it will big, maybe 100MB+ but should less than 200MB in my estimate, in a system less than 10 years old, should not be a big delay when loading from disk.
That should be ok if one can opt-out AND mkinitrd could use, or better defaults to zstd compression.
since talking about kernel/huge/initrd, let me said something of my thinking
how about a universal initramfs file?
it contain all modules, or at least all disk/blockdev modules
then will never care about which module to load to find root filesystem, when something wrong we could get a more complete rescue environments.
and yes, it will big, maybe 100MB+ but should less than 200MB in my estimate, in a system less than 10 years old, should not be a big delay when loading from disk.
That's overkill and would be tantamount to going from a huge kernel to a GARGANTUAN kernel
how about a universal initramfs file?
it contain all modules, or at least all disk/blockdev modules
then will never care about which module to load to find root filesystem, when something wrong we could get a more complete rescue environments.
and yes, it will big, maybe 100MB+ but should less than 200MB in my estimate, in a system less than 10 years old, should not be a big delay when loading from disk.
The initrd of the install disk has modules compressed with xz. If you compress all the modules of kernel-modules-6.1.59-x86_64-1 with xz, they need only 70MB.
That's overkill and would be tantamount to going from a huge kernel to a GARGANTUAN kernel
The difference is that built-in drivers stay in the memory but initrd memory is freed after the real root fs is mounted. So it's possible to have all the drivers as modules but you don't want to have them all built in even in the huge kernel.
Yes, it booted. No '-m' command given which would write explicit modprobe commands in /boot/initrd-tree/load_kernel_modules to load certain modules. udevd found everything needed, for example my root file system driver.
1) for the size/speed balance, xz/zstd could be compared
2) current kernel-modules 6.1.60 is 48M, can be a estimate base
3) in my laptop, /boot/initrd-tree is 25M(include 300k .ko files), it not included *fdisk mkfs.* fsck.*, etc.
4) firmware files not calculated yet, kernel-firmware package is 270M, if we assuming 30% was required by selected kernel...
just prefer the word "initramfs", no different with initrd.
all about this just thinking/discussing, far away to a "suggestion", also not sure it's violate the K.I.S.S principle.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.