Loading ...
Sorry, an error occurred while loading the content.
 

compiling kernel under Red Hat 8.0

Expand Messages
  • David Carlton
    Any tips for compiling the kernel under Red Hat 8.0? I reinstalled Linux on my laptop this weekend, for various reasons, and compiling the kernel under Red
    Message 1 of 11 , Mar 9, 2003
      Any tips for compiling the kernel under Red Hat 8.0? I reinstalled
      Linux on my laptop this weekend, for various reasons, and compiling
      the kernel under Red Hat 8.0 seems a _lot_ more annoying than under
      7.3. (I also switched from LILO to GRUB, which might make a
      difference.) I've solved some of my problems with compiling, but not
      all: my current kernel is too big and takes too long to compile. And
      if I try to strip it down to what I used under 7.3 (mutatis mutandem)
      then the machine won't boot: it first seems to start okay but then,
      after a screen or two, complains about not being able to find the root
      volume.

      So if that rings any bells, I'm all ears; I also wouldn't mind seeing
      a working .config file.

      Incidentally, I'm sure there are many web pages out there about this:
      could those of you with web pages add them to the 'links' section on
      the mailing list's web site? (In the 'installation' folder, perhaps,
      or wherever seems appropriate.) It would have been useful for me this
      weekend: there's so much traffic in the mailing list that searching
      the archives isn't so easy to do.

      (The GNOME 2 key bindings were annoying, too, but it got better once I
      rebound Alt-F4 back to its old meaning...)

      I'll try to update my web page in a few weeks to cover Red Hat 8.0
      once I've got all this sorted out.

      Thanks,
      David Carlton | <http://math.stanford.edu/~carlton/>
      carlton@... | I8200: <http://math.stanford.edu/~carlton/i8200/>
    • Randy Perkins
      ... i use rh8 and have recompiled using rh sources and kernel.org sources when i recompiled i had trouble cause i was using ext3 / filesystem, but had
      Message 2 of 11 , Mar 9, 2003
        On Sun, 2003-03-09 at 21:57, David Carlton wrote:
        Any tips for compiling the kernel under Red Hat 8.0?  I reinstalled

        then the machine won't boot: it first seems to start okay but then,
        after a screen or two, complains about not being able to find the root
        volume.

        i use rh8 and have recompiled using rh sources and kernel.org sources

        when i recompiled i had trouble cause i was using ext3 / filesystem,
        but had compliled ext3 support as a module,
        i recompiled with ext3 support built in

        i think rh has ext3 support in initrd, but i am not knowledgable about initrd

        another problem i had involved grub and the LABEL section
        i replaced the label with the actual hard drive partiton in the grub config file

        so if it looked like this:
        kernel /boot/vmlinuz-2.4.x ro root=LABEL=/
        i changed it to this:
        kernel /boot/vmlinuz-2.4.x ro root=/dev/hda2

        hope this helps
        randy



        Your use of Yahoo! Groups is subject to the
        Yahoo! Terms of Service.
        --
        Randy Perkins <randyperkins@...>
      • David Carlton
        ... I _think_ I compiled ext3 built in, but I m not sure; I ll double check. I m a little surprised that ext2 built in + ext3 module wouldn t work, but who
        Message 3 of 11 , Mar 9, 2003
          On 09 Mar 2003 22:58:31 -0500, Randy Perkins <randyperkins@...> said:

          > when i recompiled i had trouble cause i was using ext3 / filesystem,
          > but had compliled ext3 support as a module,
          > i recompiled with ext3 support built in

          I _think_ I compiled ext3 built in, but I'm not sure; I'll double
          check. I'm a little surprised that ext2 built in + ext3 module
          wouldn't work, but who knows.

          > i think rh has ext3 support in initrd, but i am not knowledgable about
          > initrd

          Yeah, me neither. I'm actually kind of tempted to leave initrd out
          entirely...

          > another problem i had involved grub and the LABEL section
          > i replaced the label with the actual hard drive partiton in the grub
          > config file

          > so if it looked like this:
          > kernel /boot/vmlinuz-2.4.x ro root=LABEL=/
          > i changed it to this:
          > kernel /boot/vmlinuz-2.4.x ro root=/dev/hda2

          That must be it; I'll give that a try.

          Thanks!

          David Carlton | <http://math.stanford.edu/~carlton/>
          carlton@... | I8200: <http://math.stanford.edu/~carlton/i8200/>
        • Randy Perkins
          ... i guess the problem is if you dont have ext3 builtin, and are trying to use an ext3 partition as your / (root) partition. i think the errror i got said
          Message 4 of 11 , Mar 9, 2003
            On Sun, 2003-03-09 at 23:23, David Carlton wrote:

            I _think_ I compiled ext3 built in, but I'm not sure; I'll double
            check.  I'm a little surprised that ext2 built in + ext3 module
            wouldn't work, but who knows.

            David Carlton             | <http://math.stanford.edu/~carlton/>
            carlton@... | I8200: <
            http://math.stanford.edu/~carlton/i8200/>
            i guess the problem is if you dont have ext3 builtin, and are trying to use
            an ext3 partition as your / (root) partition.
            i think the errror i got said cant find inittab
            ( not exactly that but something like it)

            this is where redhat uses the initrd to hold the ext3 module
            ( i think)

            hope i havent confused you ( and me) more ,
            randy

            --
            Randy Perkins <randyperkins@...>
          • Peter Hayes
            ... If you have ext3 support compiled as a module, the kernel will need to load the module, but it needs ext3 support to be able to read the partition the
            Message 5 of 11 , Mar 10, 2003
              On Monday 10 March 2003 04:36, Randy Perkins wrote:
              > On Sun, 2003-03-09 at 23:23, David Carlton wrote:
              > > I _think_ I compiled ext3 built in, but I'm not sure; I'll double
              > > check. I'm a little surprised that ext2 built in + ext3 module
              > > wouldn't work, but who knows.
              > >
              > >
              > >
              > > David Carlton | <http://math.stanford.edu/~carlton/>
              > > carlton@... | I8200:
              > > <http://math.stanford.edu/~carlton/i8200/>
              >
              > i guess the problem is if you dont have ext3 builtin, and are trying to
              > use
              > an ext3 partition as your / (root) partition.
              > i think the errror i got said cant find inittab
              > ( not exactly that but something like it)
              >
              > this is where redhat uses the initrd to hold the ext3 module
              > ( i think)

              If you have ext3 support compiled as a module, the kernel will need to load
              the module, but it needs ext3 support to be able to read the partition the
              module is on in able to load the module. Chicken and egg situation (I think).

              Peter
            • Eric Bourque
              ... Not entirely true, at least according to my understanding. If you make ext2 builtin, and ext3 as a module there will be no problem. ext3 is the exact same
              Message 6 of 11 , Mar 10, 2003
                > If you have ext3 support compiled as a module, the kernel will need to load
                > the module, but it needs ext3 support to be able to read the partition the

                Not entirely true, at least according to my understanding. If you make
                ext2 builtin, and ext3 as a module there will be no problem. ext3 is the
                exact same as ext2 with the exception of journaling support; i.e., the
                ext2 driver can read all of the ext3 filesystems. Having the module in
                the initrd is also good, but a make install on a RH box does this
                automatically.

                That is the setup I have on my i8200 anyway, and it works like a charm.

                Cheers,

                Eric
              • Peter Hayes
                ... I m sure you re right. I was remembering that when ext3 and reiserfs first appeared we were advised to make the boot partition ext2. Peter
                Message 7 of 11 , Mar 11, 2003
                  On Monday 10 March 2003 16:06, Eric Bourque wrote:
                  > > If you have ext3 support compiled as a module, the kernel will need to
                  > > load the module, but it needs ext3 support to be able to read the
                  > > partition the
                  >
                  > Not entirely true, at least according to my understanding. If you make
                  > ext2 builtin, and ext3 as a module there will be no problem. ext3 is the
                  > exact same as ext2 with the exception of journaling support; i.e., the
                  > ext2 driver can read all of the ext3 filesystems. Having the module in
                  > the initrd is also good, but a make install on a RH box does this
                  > automatically.

                  I'm sure you're right. I was remembering that when ext3 and reiserfs first
                  appeared we were advised to make the boot partition ext2.

                  Peter
                • ronin2@bellatlantic.net
                  On 09 Mar 2003 20:23:34 -0800 ... If you want to use the configuration that worked for you earlier, the easiest way is to copy the config file for the earlier
                  Message 8 of 11 , Mar 11, 2003
                    On 09 Mar 2003 20:23:34 -0800
                    David Carlton <carlton@...> wrote:

                    > Yeah, me neither. I'm actually kind of tempted to leave initrd out
                    > entirely...

                    If you want to use the configuration that worked for you earlier, the easiest way is to copy the config file for the earlier kernel to <top_of_kernel_tree>/.config (overwriting the one that's there, if there is one.

                    Then do "make oldconfig", and all of your old configuration will be used. You'll be asked questions about all the "new" options; you can generally answer those "no".

                    You can then do "make menuconfig" to browse around and change your answers if you wish.

                    If you're recompiling your own kernel, there's no reason (unless, "I like pain" counts as a reason) to use initrd. Just compile support for your hard drive and root filesystem into the kernel (not as modules) and you can say goodbye to initrd.

                    Building a kernel from kernel.org sources and the default configuration results in a kernel about 1072Kb. My own kernel is ~749Kb.

                    Kevin
                  • David Carlton
                    ... Excellent! Thanks, I didn t know about that option. ... Great, will do. I think the root of my problem was a difference between GRUB and LILO: randy
                    Message 9 of 11 , Mar 11, 2003
                      On Tue, 11 Mar 2003 17:14:39 -0500, ronin2@... said:
                      > On 09 Mar 2003 20:23:34 -0800
                      > David Carlton <carlton@...> wrote:

                      >> Yeah, me neither. I'm actually kind of tempted to leave initrd out
                      >> entirely...

                      > If you want to use the configuration that worked for you earlier,
                      > the easiest way is to copy the config file for the earlier kernel to
                      > <top_of_kernel_tree>/.config (overwriting the one that's there, if
                      > there is one.

                      > Then do "make oldconfig", and all of your old configuration will be
                      > used. You'll be asked questions about all the "new" options; you can
                      > generally answer those "no".

                      Excellent! Thanks, I didn't know about that option.

                      > If you're recompiling your own kernel, there's no reason (unless, "I
                      > like pain" counts as a reason) to use initrd. Just compile support
                      > for your hard drive and root filesystem into the kernel (not as
                      > modules) and you can say goodbye to initrd.

                      Great, will do.

                      I think the root of my problem was a difference between GRUB and LILO:
                      randy suggested that, for GRUB, I replace 'ro root=LABEL=/' by 'ro
                      root=/dev/hdaN' (where N = 2 for him, 7 for me). (Well, there were
                      other problems, but I solved those.) Hopefully, with your and his
                      suggestions, I'll be able to get a delightfully svelte kernel tonight.

                      David Carlton
                      carlton@...
                    • ronin2@bellatlantic.net
                      On 11 Mar 2003 15:19:45 -0800 ... Great! If you re using kernel-package with grub I recommend the following: 1. Run update-grub. Review the
                      Message 10 of 11 , Mar 11, 2003
                        On 11 Mar 2003 15:19:45 -0800
                        David Carlton <carlton@...> wrote:

                        > I think the root of my problem was a difference between GRUB and LILO:
                        > randy suggested that, for GRUB, I replace 'ro root=LABEL=/' by 'ro
                        > root=/dev/hdaN' (where N = 2 for him, 7 for me). (Well, there were
                        > other problems, but I solved those.) Hopefully, with your and his
                        > suggestions, I'll be able to get a delightfully svelte kernel tonight.

                        Great!

                        If you're using kernel-package with grub I recommend the following:

                        1. Run update-grub. Review the automatically-generated menu.lst, and change the defaults to suit your system and taste. Re-run update-grub, and again examine menu.lst to make sure it works the way you want it.

                        2. Copy /usr/share/doc/kernel-package/sample.kernel-img.conf to /etc/kernel-img.conf.

                        3. Add the following to the end of /etc/kernel-img.conf:

                        postinst_hook=/sbin/update-grub
                        postrm_hook=/sbin/update-grub


                        With those changes, installing or removing a kernel deb will also update grub's boot menu.

                        Kevin
                      • David Carlton
                        ... That worked pretty well. It turns out that, in this situation, there was one option I should have answered yes to (SOCKET_FILTER, or something like
                        Message 11 of 11 , Mar 11, 2003
                          On 11 Mar 2003 15:19:45 -0800, David Carlton <carlton@...> said:

                          > On Tue, 11 Mar 2003 17:14:39 -0500, ronin2@... said:
                          >> On 09 Mar 2003 20:23:34 -0800
                          >> David Carlton <carlton@...> wrote:

                          >>> Yeah, me neither. I'm actually kind of tempted to leave initrd out
                          >>> entirely...

                          >> If you want to use the configuration that worked for you earlier,
                          >> the easiest way is to copy the config file for the earlier kernel to
                          >> <top_of_kernel_tree>/.config (overwriting the one that's there, if
                          >> there is one.

                          >> Then do "make oldconfig", and all of your old configuration will be
                          >> used. You'll be asked questions about all the "new" options; you can
                          >> generally answer those "no".

                          > Excellent! Thanks, I didn't know about that option.

                          That worked pretty well. It turns out that, in this situation, there
                          was one option I should have answered 'yes' to (SOCKET_FILTER, or
                          something like that), but fortunately a helpful error message got put
                          in /var/log/messages directing me to look at that. And Red Hat 8.0
                          really seems to want me to use iptables instead of ipchains; times
                          change, I have to change with them, I suppose.

                          >> If you're recompiling your own kernel, there's no reason (unless, "I
                          >> like pain" counts as a reason) to use initrd. Just compile support
                          >> for your hard drive and root filesystem into the kernel (not as
                          >> modules) and you can say goodbye to initrd.

                          > Great, will do.

                          When I tried that, it didn't work: it complained about missing some
                          modules. So I think I have to compile a little more into the kernel.
                          Also, right now, with the kernel that I'm using, 'make install' from
                          within /usr/src/linux-2.4 doesn't work: the last step complains about
                          loopback devices all being in use; does that happen to ring any bells?
                          But an older initrd works fine; I'll tinker with kernel stuff more
                          eventually.

                          > I think the root of my problem was a difference between GRUB and LILO:
                          > randy suggested that, for GRUB, I replace 'ro root=LABEL=/' by 'ro
                          > root=/dev/hdaN' (where N = 2 for him, 7 for me).

                          And that did indeed work very well.

                          Anyways, now I'm using a kernel that I compiled myself that works
                          fine; many thanks to Randy and Kevin for the help. Now I can get back
                          to other things for the time being.

                          David Carlton | <http://math.stanford.edu/~carlton/>
                          carlton@... | I8200: <http://math.stanford.edu/~carlton/i8200/>
                        Your message has been successfully submitted and would be delivered to recipients shortly.