LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-29-2023, 01:29 PM   #3046
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315

baldzhang,

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 ?
 
Old 10-29-2023, 01:50 PM   #3047
baldzhang
Member
 
Registered: Aug 2012
Posts: 58

Rep: Reputation: Disabled
Quote:
Originally Posted by glennmcc View Post
baldzhang,

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
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20231029_144231_com.android.gallery3d.jpg
Views:	57
Size:	246.8 KB
ID:	41953   Click image for larger version

Name:	Screenshot_20231029_144356_com.android.gallery3d.jpg
Views:	47
Size:	134.1 KB
ID:	41954  
 
Old 10-29-2023, 02:01 PM   #3048
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
http://glennmcc.dynu.com/never_mind.web
 
Old 10-29-2023, 04:08 PM   #3049
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Well, our BDFL agrees with your point of view

Sun Oct 29 19:21:20 UTC 2023
xfce/xfconf-4.18.2-x86_64-2.txz: Rebuilt.
[PATCH] cache: Fix uncached value.
Thanks to baldzhang.
 
Old 10-29-2023, 05:20 PM   #3050
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Quote:
Originally Posted by glennmcc View Post
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...

initrd = /boot/initrd.gz
 
Old 10-29-2023, 06:04 PM   #3051
BrianW
Member
 
Registered: Jul 2003
Location: Montana
Posts: 297

Rep: Reputation: Disabled
Quote:
Originally Posted by glennmcc View Post
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.
 
Old 10-29-2023, 06:21 PM   #3052
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,032

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
Quote:
Originally Posted by BrianW View Post
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.
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.
 
3 members found this post helpful.
Old 10-29-2023, 06:55 PM   #3053
baldzhang
Member
 
Registered: Aug 2012
Posts: 58

Rep: Reputation: Disabled
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.
 
Old 10-29-2023, 11:01 PM   #3054
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,183

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by baldzhang View Post
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.
 
Old 10-30-2023, 01:06 AM   #3055
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Quote:
Originally Posted by baldzhang View Post
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
 
Old 10-30-2023, 01:53 AM   #3056
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,854

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by baldzhang View Post
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.
 
Old 10-30-2023, 02:04 AM   #3057
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,854

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by glennmcc View Post
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.
 
Old 10-30-2023, 03:29 AM   #3058
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,854

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by baldzhang View Post
how about a universal initramfs file?
it contain all modules
OK. I tried it with 6.1.59, the last slimmer generic kernel:
Code:
wget https://slackware.uk/cumulative/slackware64-current/slackware64/a/kernel-generic-6.1.59-x86_64-1.txz
wget https://slackware.uk/cumulative/slackware64-current/slackware64/a/kernel-modules-6.1.59-x86_64-1.txz
installpkg kernel-generic-6.1.59-x86_64-1.txz kernel-modules-6.1.59-x86_64-1.txz
mkinitrd -c -k 6.1.59
cp -rp /lib/modules/6.1.59/kernel /boot/initrd-tree/lib/modules/6.1.59
find /boot/initrd-tree/lib/modules/6.1.59/kernel -name '*.ko' -exec xz {} \;
depmod -b /boot/initrd-tree 6.1.59
mkinitrd
What I have now:
Code:
-rw-r--r-- 1 root root  71M 2023-10-30 10:18 /boot/initrd.gz
-rw-r--r-- 1 root root 8.0M 2023-10-20 03:19 /boot/vmlinuz-generic-6.1.59
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.
Code:
# dmesg |grep Freeing
[    0.135932] Freeing SMP alternatives memory: 44K
[    0.721693] Freeing initrd memory: 72412K
[    4.127666] Freeing unused decrypted memory: 2036K
[    4.128228] Freeing unused kernel image (initmem) memory: 1944K
[    4.130909] Freeing unused kernel image (text/rodata gap) memory: 2036K
[    4.131391] Freeing unused kernel image (rodata/data gap) memory: 1252K
 
1 members found this post helpful.
Old 10-30-2023, 05:01 AM   #3059
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 556

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
What baldzhang suggested was an initramfs
 
Old 10-30-2023, 08:49 AM   #3060
baldzhang
Member
 
Registered: Aug 2012
Posts: 58

Rep: Reputation: Disabled
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.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2.4 requests to non-SSL site with "Upgrade-Insecure-Requests: 1" and no trailing / get redirected to default site owendelong Linux - Server 2 06-22-2021 02:08 PM
[SOLVED] Requests for -current (20151216) rworkman Slackware 3441 12-28-2017 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:47 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