LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   Grub2 in my own distribution (https://www.linuxquestions.org/questions/linux-distributions-5/grub2-in-my-own-distribution-776842/)

artal 12-19-2009 04:54 AM

Grub2 in my own distribution
 
I try to make my own distribution with grub2. So I want to install file system on hard drive and also install grub2 from my cd.
However, when I try to run grub-setup from my cd, sh tells me:
Code:

/bin/sh: ./grub-setup: not found
Maybe I should configure grub with needed options? Does anybody know what options there must be?

carltm 12-19-2009 05:54 AM

I'm guessing that you're running ./grub-setup from a script on the
cd during the installation process. Is that right?

If so, put the commands "mount", "pwd", "echo $PATH" and "set | more"
in that script temporarily. When you run it, you might be able to
figure out why ./grub-setup is not found.

artal 12-19-2009 06:05 AM

Quote:

Originally Posted by carltm (Post 3797762)
I'm guessing that you're running ./grub-setup from a script on the
cd during the installation process. Is that right?

If so, put the commands "mount", "pwd", "echo $PATH" and "set | more"
in that script temporarily. When you run it, you might be able to
figure out why ./grub-setup is not found.

No, I run ./grub-setup manually, because I only try to write installation script. When sh-terminal is loaded, I move to the folder "/sbin" and try to execute "./grub-setup --directory=/mnt/boot/grub --device-map=device.map /dev/sda". And sh replies me "... not found". I have same problems with busybox, when I try to build it not as a static library.

carltm 12-19-2009 06:11 AM

Okay, then run these commands after booting from the cd at the point
where you would run ./grub.conf and post the results.

pwd
ls

linus72 12-19-2009 06:11 AM

its grub-install isnt it?

grub-install --root-directory=/media/disk /dev/sda

artal 12-19-2009 06:24 AM

Quote:

Originally Posted by carltm (Post 3797773)
Okay, then run these commands after booting from the cd at the point
where you would run ./grub.conf and post the results.

pwd
ls

Code:

/sbin # pwd
/sbin
/sbin # ls
grub-dumpbios grub-mkconfig    grub-setup
grub-emu      grub-mkdevicemap
grub-install  grub-probe

And I mean grub-setup, because script grub-install run grub-setup in its code. So when I get an error with grub-install I try to run grub-setup manually.

carltm 12-19-2009 06:27 AM

Okay, the files are there. Try running "ls -l" this time so
we can see if they are executable.

artal 12-19-2009 06:33 AM

Quote:

Originally Posted by carltm (Post 3797786)
Okay, the files are there. Try running "ls -l" this time so
we can see if they are executable.

Of course, I try it
Code:

-r-xr-xr-x
near all of the items

carltm 12-19-2009 06:50 AM

Okay, let's try one more thing. Instead of "./grub-setup" try
"/sbin/grub-setup".

artal 12-19-2009 07:02 AM

I try, but this didn't help. And tab-completion see this file. I think that problems are in libraries, required by this program.

carltm 12-19-2009 07:05 AM

One other thought, maybe it will work if you run the executable that
is on the cd, rather than the copy in /sbin. Or is there some reason
that you don't want to do it that way?

artal 12-19-2009 07:16 AM

Quote:

Originally Posted by carltm (Post 3797811)
One other thought, maybe it will work if you run the executable that
is on the cd, rather than the copy in /sbin. Or is there some reason
that you don't want to do it that way?

I run it from cd, there are livecd and root file system is the system on the cd. There is iso image to be more exact, and machine is vmware.

carltm 12-19-2009 07:26 AM

Then it might be a problem with that cd. Try a different distribution
or a different version of the cd. Out of curiosity, which cd are you
using?

artal 12-19-2009 07:31 AM

In first post I wrote that it is distribution, that I had been trying to create myself

carltm 12-19-2009 07:52 AM

Okay, now that we know more about your environment, we know several things
that are not causing the problem.

You might want to describe how you're designing the cd and what sources
you are using for the executables and libraries.


All times are GMT -5. The time now is 12:56 AM.