PDA

View Full Version : Skip regenerate ld.so.cache and modules.dep by cheat code



onemyndseye
07-21-2006, 08:13 AM
Hi everyone,

I've learned alot from this forum so I thought it time for me to conribute... I have seen this come up from time to time. .... On HD-Install systems knoppix-autoconfig regenerates ld.so.cache and modules.dep and each startup adding a fair amount of time to your boot sequence. If the hardware in the machine has not been changed since last boot then ld.so.cache and modules.dep doesnt HAVE to be regenerated..... SOooo...

1st backup your knoppix-autoconfig as root like so:



cp /etc/init.d/knoppix-autoconfig /etc/init.d/knoppix-autoconfig.BACKUP




Find this section in /etc/init.d/knoppix-autoconfig:


if [ -n "$INSTALLED" ]; then
echo -n "${BLUE}Running from HD, regenerate ld.so.cache and modules.dep...${NORMAL}"
# Regenerate ld.so.cache and module dependencies on HD
ldconfig ; depmod -a 2>/dev/null
# knoppix-installer bug workaround
chmod 1777 /tmp 2>/dev/null
echo ""
fi



Edit this section as follows:


if [ -n "$INSTALLED" ]; then
if ! checkbootparam "nomodregen"; then
echo -n "${BLUE}Running from HD, regenerate ld.so.cache and modules.dep...${NORMAL}"
# Regenerate ld.so.cache and module dependencies on HD
ldconfig ; depmod -a 2>/dev/null
# knoppix-installer bug workaround
chmod 1777 /tmp 2>/dev/null
echo ""
else chmod 1777 /tmp 2>/dev/null ; echo -n "${BLUE}Not regenerating ld.so.cache and modules.dep as per your request...${NORMAL}" ; echo ""
fi
fi


Then issuing the "nomodregen" cheat-code will allow you to skip this regeneration process.... Even on a static machine this should probably be done from time to time....so if you need to Regenerate ld.so.cache and module dependencies the following commads may be issued:



ldconfig
depmod -a





This ofcoarse may be added to a script like /usr/bin/knx-mod-regen


#!/bin/bash

echo Regenerating ld.so.cache and module dependencies.....
ldconfig ; depmod -a





I almost made a diff to patch knoppix-autoconfig but I figured showing it the long way might be helpfull to someone :) ...

Anyway, enjoy :)
-onemyndseye

chris_startx
07-30-2006, 09:56 AM
Hi, thanx for your post. Indeed, this trick is very useful. I did it myself about one year ago on a Knoppix 3.6 HD install which I continuously updated and improved. One of the first improvements was this new boot parameter, which I called "fastboot" and which saves a lot of time at boot.
It's a "nice to have"

matinciel
11-01-2006, 12:00 PM
Hi,
this works great except for one littre thing, probably you can help me (or probably it's normal :lol: )

when i do a "flash boot" my network card isn't configured (insn't find), then no more internet :cry:

Is it normal? is there a way to pass throught?

Thanks.

Matinciel

Using Compact presario 700
Damn small linux - N

onemyndseye
12-19-2006, 10:52 AM
It looks like something has changed with the installer since I made that patch. Ill get back to you with a fix (If now possible)


Thanks,
-Justin
One Mynds Eye

onemyndseye
12-27-2006, 09:36 AM
Well.... I spoke too soon :). Looks like something may infact have changed with the installer but it shouldnt affect that cheatcode.

Double check your code againts mine.... could be just a screwy typo or something :)

Some things I will add is: If the system was booted on a different machine the last time you booted you will need to regen the modules cache (dont use the cheatcode) so that hwsetup can process your hardware detection correctly... Also - if you use `pico` or `nano` to edit this file it may cause it to break if not supplied with the command-line option to NOT CONVERT FROM MAC FORMAT. Use kwrite, it had nifty highlighting :)

Take care,
-Justin
One Mynds Eye

Uncle Stinky
12-18-2007, 10:25 AM
I can't get your procedure to work with Knoppix 5.1.1 after installing Knoppix 5.1.1 to my hda2 from live CD with the command "sudo knoppix-installer" I did NOT use the command "knoppix tohd=/dev/hda2" at the boot up prompt to install Knoppix 5.1.1 from live CD but, rather, used the command "sudo knoppix-installer" while being completely booted up and within the Knoppix 5.1.1 operating system that is on the Knoppix 5.1.1 live CD only!

Any further help will be delightful!

Blessings

US

hal8000
12-22-2007, 05:10 PM
I can't get your procedure to work with Knoppix 5.1.1 after installing Knoppix 5.1.1 to my hda2 from live CD with the command "sudo knoppix-installer" I did NOT use the command "knoppix tohd=/dev/hda2" at the boot up prompt to install Knoppix 5.1.1 from live CD but, rather, used the command "sudo knoppix-installer" while being completely booted up and within the Knoppix 5.1.1 operating system that is on the Knoppix 5.1.1 live CD only!

Any further help will be delightful!

Blessings

US


It does work with Knoppix 5.11, I used the same install procedure as you. Modify knoppix-autoconfig as per Justin's notes.

In your /boot/grub/menu.lst file dont forget to append

nomodregen to the end of the line that boots knoppix.

Uncle Stinky
12-27-2007, 09:42 AM
I can't get your procedure to work with Knoppix 5.1.1 after installing Knoppix 5.1.1 to my hda2 from live CD with the command "sudo knoppix-installer" I did NOT use the command "knoppix tohd=/dev/hda2" at the boot up prompt to install Knoppix 5.1.1 from live CD but, rather, used the command "sudo knoppix-installer" while being completely booted up and within the Knoppix 5.1.1 operating system that is on the Knoppix 5.1.1 live CD only!

Any further help will be delightful!

Blessings

US


It does work with Knoppix 5.11, I used the same install procedure as you. Modify knoppix-autoconfig as per Justin's notes.

In your /boot/grub/menu.lst file dont forget to append

nomodregen to the end of the line that boots knoppix.

I do not know where to (or how to get to) "append 'nomodrgen' to the end of the line that boots knoppix." Give me a clue about what that line looks like? Then, please remind me how to edit that particular line in my "/boot/grub/menu.lst file? I did the procedure exactly as Justin suggested and it doesn't work on my HP SR1103WM computer. I've also done the procedure on three other computers and I have the same probglem with them. Thanks for your I/O in the matter!

US

Uncle Stinky
12-29-2007, 09:22 PM
I can't get your procedure to work with Knoppix 5.1.1 after installing Knoppix 5.1.1 to my hda2 from live CD with the command "sudo knoppix-installer" I did NOT use the command "knoppix tohd=/dev/hda2" at the boot up prompt to install Knoppix 5.1.1 from live CD but, rather, used the command "sudo knoppix-installer" while being completely booted up and within the Knoppix 5.1.1 operating system that is on the Knoppix 5.1.1 live CD only!

Any further help will be delightful!

Blessings

US


It does work with Knoppix 5.11, I used the same install procedure as you. Modify knoppix-autoconfig as per Justin's notes.

In your /boot/grub/menu.lst file dont forget to append

nomodregen to the end of the line that boots knoppix.

Here is how I completed the procedure;

I have Hewlett Packard model number SR1103WM computer.

I start with an empty hard drive.

I boot with Knoppix 5.1.1 live CD by pressing the F-1 key when I start my computer. It takes me to the setup
screen and I change my boot options in there so that my computer will boot from my CD ROM first, instead of
booting from my hard drive first.

Then, when I get to the Knoppix boot up screen, I must enter the cheat code "knoppix acpi=off" (without the
quotation marks) at the Knoppix boot up screen or my computer will not boot otherwise.

Then, when I see my desktop, I go to the Linux Penguin on the bottom of the page and left click on it.

Then, I click on the "Root Shell" option.

Then, I type "passwd" (without the quotation marks).

Then, I click the "Enter" key on my keyboard.

Then, I type in whatever password that I want to use and click the "Enter" key on my keyboard.

Then, I type it in again and click the "Enter" key on my keyboard again.

Then, I go to my desktop and right click onto the hard drive icon and then left click onto the "Mount"
option.The hard drive must be mounted before you can install Knoppix onto it. And I had to previously
do the root password procedure in the Root Shell before I could "Mount" my hard drive.

So then, back into the Root Shell, I type in "sudo knoppix-installer" (without the quotation marks) and click
the "Enter" key on my keyboard.

Then the installation starts.

Then, I keep clicking the "OK" buttons until the installation asks me which hard
drive it is that I would like to use to install Knoppix onto.

Then,I click on the hard drive that I would like to install Knoppix onto and then I click on the
"Next" button.

Then, I click on another "OK" button and that starts the "QTParted" program.

Then, in the "QTParted" dialog box I will maximize the dialog box so that I can see my hard drive. Mine
happens to be "/dev/hdc"....yours may have a different name on it.

Then, I left click on the "/dev/hdc" that is located on the left side of that dialog box.

Then, in the very large dialog box, I right click on the "/dev/hdc1" and chose the "format" option.

Then, a new box will open and I chose the "ext2" partition type. The default will be "ext3" but I needed to
change it to "ext2" so that the Knoppix operating system would install on my hard drive without any error
messages. The "ext3" partition type would not work for me so I used "ext2".

After the hard drive was programmed to be formatted with the "ext2" partition type, I needed to "unmount"
my hard drive before closing the "QTParted" software. So I went back to my desktop and right clicked onto
my "hdc" (or hdc1) icon and then left clicked onto the "Unmount" option.

Then, I went back into the "QTParted" program and I left clicked the "File" menu, then, left clicked the
"Commit"option.

Then the QTParted software began to format my hard drive with the "ext2" partition type.

When it was through, I closed the QTParted software.

Then, the knoppix installer continued onto the next screen that stated the following
message "The installer detected that the installation requirements are not fullfilled yet." (And, there were
two more paragraphs on this screen that I will not include here, but you will see them when you install
Knoppix this way.) So I read the messages and clicked the "OK" button.

Then, the next screen asked me if I wanted to "partition the hard disk" and I left clicked the "OK" button.

Then, a new window opened and I chose my hard disk again and clicked the "Next" button.

Then, a new window opened and I chose line # 2 that read "Template 1 1 GB swap, the remaining space for
root". And then I clicked the "OK" button.

Then a screen appeared that asked me, "Are you really sure that you want to partition the hard disk?" And I
clicked the "Yes" button.

Then, another screen appeared that asked me, "Are you really, really sure that you want to partition the hard
disk?" And I clicked the "Yes" button.

After the hard disk is partitioned, another screen will appear and one of the options will be "Start The
Installation" and I chose to start the installation.

Next, the installation will start and this will take about 10 minutes or more to complete. You will be asked
if you want to create a floppy disk to use to boot your computer. I chose "No". It's optional. The computer
will boot from your hard drive after the installation so you may or may not want to create a floppy disk to
boot your computer.

After the installation is complete, you can restart your computer and take the Knoppix live CD out of the CD
ROM drive. The knoppix operating system will boot from your hard drive now.

When you see your Knoppix desktop again, go to the Penguin and start a Root Shell again.

Then, type "passwd" (without the quotation marks).

Then, click the "Enter" key on your keyboard.

Then, type in whatever password that you want to use and click the "Enter" key on your keyboard.

Then, type your password in again and click the "Enter" key on your keyboard.

Now I type in "cd /etc/init.d" (without the quotation marks) and click the "Enter" key on my keyboard.

Then, I type in "chmod u+rw,g+rw,o+rw knoppix-autoconfig" (without the quotation marks) and click the "Enter"
key on my keyboard. This will give me permission to read and write to that "knoppix-autoconfig" file.

Then, I type in "cd /boot/grub" (without the quotation marks) and click the "Enter"
key on my keyboard.

Then I type in "chmod u+rw,g+rw,o+rw menu.lst" (without the quotation marks) and click the "Enter"
key on my keyboard. This will give me permission to read and write to that "menu.lst" file.

Then, I type in "chmod u+rw,g+rw,o+rw menu.lst~" (without the quotation marks) and click the "Enter"
key on my keyboard. This will give me permission to read and write to that "menu.lst~" file.

Then, I type in "cp /etc/init.d/knoppix-autoconfig /etc/init.d/knoppix-autoconfig.BACKUP" (without the
quotation marks) and click the "Enter" key on my keyboard. This will BACKUP the "knoppix-autoconfig" file
that is located in the /etc/init.d directory.

Then I go to the big blue square that is called the "K Menu" and I click on it and then I choose the "Find
Files/Folders" option and click on it.

Then I click on the "Browse..." button.

Then I click on the "etc" folder.

Then I scroll down to the "init.d" folder (that is within the "etc" folder) and I click on that "init.d"
folder.

Then I click on the "OK" button.

Then I type in "knoppix-autoconfig" (without the quotation marks) in the dialog box and click the "Find"
button. This will tell the "Find Files/Folders" software which file I am searching for and it will find it
and it will display its file name in the very large dialog box that you will see there.

Then, in that very large dialog box, I right click on the "knoppix-autoconfig" file and then left click
on the "Open With" option. Then I left click on the "Editors" option. Then I left click on the "NEdit"
option. Then I left click on the "OK" button.

Then I scroll down to the section that is listed in Step 2 of Justin's post and I edit that section exactly
as suggested by Justin's notes in Step 3.

Then, I go back to the "Browse..." button and left click on it.

Then I left click on the "boot" folder.

Then I scroll down to the "grub" folder (that is within the "boot" folder) and I left click on that "grub"
folder.

Then I left click on the "OK" button.

Then I type in "menu.lst" (without the quotation marks) in the dialog box and click the "Find"
button. This will tell the "Find Files/Folders" software which file I am searching for and it will find it
and it will display its file name in the very large dialog box that you will see there.

Then, in that very large dialog box, I right click on the "menu.lst" file and then left click
on the "Open With" option. Then I left click on the "Editors" option. Then I left click on the "NEdit"
option. Then I left click on the "OK" button.

Then I scroll down to the line that reads "## ## Start Default Options ##" (without the quotation marks).
And in that particular section named "Start Default Options" I replace the text that reads
"# kopt=root=/dev/hdc2 rw ramdisk_size=100000 init=/etc/init lang=us
apm=power-off nomce loglevel=0 quiet acpi=off vga=791" (without the quotation marks) with the following
"# kopt=root=/dev/hdc2 rw ramdisk_size=100000 init=/etc/init lang=us
apm=power-off nomce loglevel=0 quiet acpi=off vga=791 nomodregen=true" (without the quotation marks).

Then I scroll down to the section that reads

"## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true" (without the quotation marks).

And I add four more additional lines underneath that section so that it looks like this when I'm done
"## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub create nomodregen boot option
## e.g. nomodregen=true
## nomodregen=false
# nomodregen=true" (without the quotation marks)

Then, I click the "File" menu.
Then, I click the "Save" option.
Then, I click the "File" menu again.
Then, I click the "Exit" option.

Then I close everything and restart the computer.

Then, on the blue boot command screen, I arrow down and highlight the 2nd line that has the
Kernel 2.6.19 and do NOT highlight the 1st line that has the Kernel 2.6.19 Default.

When I have the 2nd line highlighted, then I click the "e" key on my keyboard to edit the commands
before the final boot screen initializes.

Then a new screen will appear and I arrow down and highlight the 2nd command line. When I have the
2nd command line highlighted, I click on the "e" key on my keyboard again.

Then, I type in "nomodregen=true" (without the quotation marks) after the command "vga=791" so
that it reads "vga=791 nomodregen=true" (without the quotation marks)

Then I click the "Enter" key on my keyboard.

Then I click the "b" key on my keyboard and the computer will boot entirely without going
through the lengthy "regeneration of ld.so.cache and modules.dependencies" process.

Uncle Stinky
01-08-2008, 06:51 AM
Sometimes, it may be necessary to allow this "regeneration of ld.so.cache and modules.dependencies" process to take as much time as it needs to complete without our hacking the process at all, except for adding a command named "dma".

And, if you don't want to go through the complete procedure that is described in my previous post that is dated Sat Dec 29, 2007 3:22 pm, you can type "dma" (without the quotation marks) after the "vga=791" (without the quotation marks) command so that it looks like this "vga=791 dma" (without the quotation marks) and then do not type in the command "nomodregen=true" (without the quotation marks) after the command "vga=791" (without the quotation marks) and this will very significantly shorten the time that it takes for the "regeneration of ld.so.cache and modules.dependencies" process to complete.

This "regeneration of ld.so.cache and modules.dependencies" process takes about 15 seconds to complete when I type in the "dma" command as described above, without going through ALL of that long procedure that is described in my previous post that was dated Sat Dec 29, 2007 3:22 pm.

I did previously load knoppix onto my hard drive after booting up to the KDE desktop while using the Knoppix 5.1.1 live CD by entering the "sudo knoppix-installer" command in the "Shell-Konsole" . Then, after the install was completed, I rebooted, and then, on the blue boot command screen, I arrowed down and highlighted the 2nd line that had the Kernel 2.6.19 and did NOT highlight the 1st line that has the Kernel 2.6.19 Default on it.

When I have the 2nd line highlighted, then I click the "e" key on my keyboard to edit the commands before the final boot screen initializes.

Then a new screen will appear and I arrow down and highlight the 2nd command line. When I have the 2nd command line highlighted, I click on the "e" key on my keyboard again.

Then, I type in "dma" (without the quotation marks) after the command "vga=791" so
that it reads "vga=791 dma" (without the quotation marks)

Then I click the "Enter" key on my keyboard.

Then I click the "b" key on my keyboard and the computer booted up much faster, indeed, without going through the remaining long process that I described in my previous post that was dated Sat Dec 29, 2007 3:22 pm.

I believe that this will significantly shorten the " ld.so.cache and modules.dependencies" process time without taking away any of the benefits that the "ld.so.cache and modules dependencies" process provides to our Knoppix 5.1.1 operating system.

US

maxIT
01-13-2008, 09:33 AM
Removing all the "..regenerate ld.so.cache and modules.dep.." stuff seems not to be enough to avoid the '/etc/modules file being regenerating again.
I've completely erased that lines from 'knoppix-autoconfig' file, but after trying to edit the '/etc/modules' file (removing or commenting out some entry) it reappears as 'the_same_before' after reooting.

Uncle Stinky
01-15-2008, 10:47 AM
Removing all the "..regenerate ld.so.cache and modules.dep.." stuff seems not to be enough to avoid the '/etc/modules file being regenerating again.
I've completely erased that lines from 'knoppix-autoconfig' file, but after trying to edit the '/etc/modules' file (removing or commenting out some entry) it reappears as 'the_same_before' after reooting.

I have discovered that when I add the dma command to the kernel on the initial boot up screen, this significantly makes the "regenerate ld.so.cache and modules.dep.." process much faster!