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.
I am switching over to the generic kernel (4.19.79 at present). Read the README.initrd but it only covers configuring LILO and I use GRUB2. I've built the kernel, modules, firmware, headers and have run the mkinitrd command to create the initrd-tree and initrd.gz in /boot. Ran grub-mkconfig -o /boot/grub/grub.cfg. Is there any other config that I need so that when I reboot the initrd can be found and booting will happen without a problem ??? Thanks in advance.
It looks to me as if you have done everything necessary. If you're not sure, you can look at the grub.cfg file and check that the new Slackware stanza contains everything it should and that you still have the old one as a fallback.
If the default entry isn't the one you want to boot, edit /etc/default/grub and rerun grub-mkconfig, so the the entry you want to use will boot by default.
Another way, which is what I do is create a /etc/grub.d/05_custom with the following entries similar to these, edit the ? to match your system, will put the said entries first in your grub menu.
The system has had grub installed from the get go. The only thing I have changed is moving from the huge kernel to the generic version. After building the kernel and associated bits like modules, firmware and headers I had run mkinitrd and then grub-mkconfig. Why the need to reinstall grub?
/mnt/fstab looks weird. I've never seen that before; it should be /etc/fstab. The only thing I can think of is that grub has been given the wrong root partition. Again check your grub.cfg.
I agree Hazel. For now I am building the huge kernel again so I will have a running machine. I'll do further searching as time permits. Thanks to all so far.
It assumes that you name your initrd to match the kernel version, i.e. initrd-4.19.79.gz for the 4.19.79 kernel. I use it myself, for what that's worth.
The default util/grub.d/10-linux.in in the source archive includes this code snippet:
Code:
initrd_real=
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${dirname}/${i}" ; then
initrd_real="${i}"
break
fi
done
But in Slackware the initrd is usually just named initrd.gz so inird_real is not set and the line initrd= not fed by grub-mkconfig.
This patch solves that when building grub:
Code:
diff -Naur grub-2.00.orig/util/grub.d/10_linux.in grub-2.00/util/grub.d/10_linux.in
--- grub-2.00.orig/util/grub.d/10_linux.in 2012-04-18 23:24:38.000000000 +0200
+++ grub-2.00/util/grub.d/10_linux.in 2012-06-30 07:53:03.765625589 +0200
@@ -198,7 +198,8 @@
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
- "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "initrd.gz"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
Alternatively, you can patch directly /etc/grub.d/10_linux to avoid rebuilding grub just for that.
Last edited by Didier Spaier; 10-14-2019 at 02:18 PM.
The only thing that should differ going from huge to generic kernel is initrd.
If you have problems creating an initrd then /usr/share/mkinitrd/mkinitrd_command_generator.sh might help (it can also be run interactive -i).
You don't need to patch anything /boot/initrd.gz should work by default.
Last edited by Nille_kungen; 10-17-2019 at 04:42 AM.
No, I had no problems creating the initrd. It was found at boot and loaded several modules (see above). It was only after that booting gave up apparently looking for an fstab in /mnt/fstab which obviously doesn't exist. I'll get back to trying the generic kernel again in a few days when I have some time.
( I have added echo so these scripts will only show what is to be done )
Code:
#!/bin/bash
Kernel=(/boot/vmlinuz*-*-*)
for version in ${Kernel[@]}
do
[[ -e /boot/initrd-${version##*-}.gz ]] || \
echo mkinitrd \
-c \
-k ${version##*-} \
-f ext4 \
-r /dev/vg_slackware/lv_root \
-m usb-storage:ehci-hcd:ehci-pci:uhci-hcd:jbd2:mbcache:crc32c-intel:ext4 \
-L -l uk -u \
-o /boot/initrd-${version##*-}.gz
done
echo grub-mkconfig -o /boot/grub/grub.cfg
obviously you will need to adapt it for your setup
The important part is -o /boot.... , this will generate an initrd for each kernel version you have, grub-mkconfig will then happily generate a grub.cfg using the correct initrd for each kernel.
to get multiple kernels. you need to blacklist, and install manually
you can grab the latest kernel packages with this script ( after updating pkg lists )
Code:
#!/bin/bash
mirror="$(grep -m1 -v ^# /etc/slackpkg/mirrors)"
while read pkg
do
for ext in .txt .txz.asc .txz
do
[[ -e ./${pkg#./}${ext} ]] && continue
GetList+=(${pkg#./}${ext})
[[ ${ext} != \.txz ]] && continue
Install+=(${pkg##*/})
done
done < <(awk '/kernel-[gmh][eo]/{print $7"/"$6}' /var/lib/slackpkg/pkglist)
echo wget -c ${GetList[@]/#/ ${mirror}}
you then install manually, e.g.
Code:
installpkg kernel*79*txz
( or finish my script and use the Install array )
Last edited by Firerat; 10-17-2019 at 07:44 AM.
Reason: typos
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.