Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
E-build for LILO
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
Bigun
Veteran
Veteran


Joined: 21 Sep 2003
Posts: 1974

PostPosted: Fri Feb 04, 2005 4:14 pm    Post subject: E-build for LILO Reply with quote

I e-mailed the project leader for LILO and asked if the sources for LILO for 64 systems could be developed, here's what he said:

Code:
At 07:39 AM 2/4/2005, you wrote:

> I have an AMD64 bit laptop.  There are quite a few people who have 64 bit processors who would like to use LILO as well:
> http://forums.gentoo.org/viewtopic.php?p=2055546#2055546
>
> Is there anything I can do to help you develop 64 bit sources for LILO?


1.  The 32-bit version executes fine on 64-bit systems, I've been told.
2.  The current source code should compile fine on 64-bit systems.  About two versions ago I had a correspondent who checked this for me, after extensive edits of declarations to get all the data sizes correct on 64-bit 'gcc'.

See the links below for the current source code.

--John

        PGP KeyID: 6781C9C8  (good until 31-Dec-2008)
        Keyserver at ldap://keyserver.pgp.com
        LILO links at http://freshmeat.net/projects/lilo
        and Help link at http://lilo.go.dyndns.org


So there's no reason we shouldn't be able to create an e-build. Should I ask about the GCC flags? Or does someone here wanna volunteer the time to experiment?
Back to top
View user's profile Send private message
Bigun
Veteran
Veteran


Joined: 21 Sep 2003
Posts: 1974

PostPosted: Fri Feb 04, 2005 5:30 pm    Post subject: Reply with quote

Here's the content of the latest e-build file for Gentoo on the 32 bit system (/usr/portage/lilo/lilo-22.6.1.ebuild):

Code:

# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/lilo-22.6.1.ebuild,v 1.2 2004/12/17 14:31:02 chainsaw Exp $

inherit eutils flag-o-matic toolchain-funcs

DOLILO_V="0.3"
IUSE="devmap static"

DESCRIPTION="Standard Linux boot loader"
HOMEPAGE="http://lilo.go.dyndns.org/pub/linux/lilo/"
DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
MY_P=${P}.src

SRC_URI="http://home.san.rr.com/johninsd/pub/linux/lilo/${MY_P}.tar.gz
   ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/${MY_P}.tar.gz
   ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/obsolete/${MY_P}.tar.gz
   mirror://gentoo/${DOLILO_TAR}"

SLOT="0"
LICENSE="BSD GPL-2"
KEYWORDS="-* x86"

RDEPEND=">=sys-apps/sed-4
   devmap? ( >=sys-libs/device-mapper-1.00.08 )"
DEPEND="${RDEPEND}
   >=sys-devel/bin86-0.15.5"

PROVIDE="virtual/bootloader"

src_unpack() {
   einfo "If you want to use lilo with device mapper, please enable the"
   einfo "\"devmap\" USE flag."

   unpack ${MY_P}.tar.gz

   # Do not try and build the dos crap.
   sed -i -e 's|^all:.*$|all: lilo|' ${S}/Makefile

   # The bootlogo patch from SuSE linux, which was originally in
   # here, has been dropped because it's no longer compatible
   # with lilo since the 22.5.x series.
   # Quequero has done a good attempt to port the patch in bug
   # #19397, but unfortunately that breaks the timeout at boot.
   # If you can overcome these problems, a patch is very welcome.

   if use devmap; then
      # devmapper-patch (boot on evms/lvm2)
      cd ${S}; epatch ${FILESDIR}/${P}-devmapper_gentoo.patch
   fi

   cd ${S}

   # Fix creating install dirs, bug #39405
   epatch ${FILESDIR}/${P}-create-install-dirs.patch
   # Correctly document commandline options -v and -V, bug #43554
   epatch ${FILESDIR}/${P}-correct-usage-info.patch
   # Get the manpage path right
   sed -i -e s,usr/man,usr/share/man,g ${S}/Makefile

   unpack ${DOLILO_TAR}
}

src_compile() {
   # hardened automatic PIC plus PIE building should be suppressed
   # because of assembler instructions that cannot be compiled PIC
   HARDENED_CFLAGS="`test_flag -fno-pic` `test_flag -nopie`"

   # we explicitly prevent the custom CFLAGS for stability reasons
   if use static; then
      emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo-static || die
      mv lilo-static lilo || die
   else
      emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo || die
   fi
}

src_install() {
   keepdir /boot
   make ROOT=${D} install || die

   into /
   dosbin ${S}/dolilo/dolilo

   into /usr
   dosbin keytab-lilo.pl

   insinto /etc
   newins ${FILESDIR}/lilo.conf lilo.conf.example

   insinto /etc/conf.d
   newins ${S}/dolilo/dolilo.conf.d dolilo.example

   doman manPages/*.[5-8]
   dodoc CHANGES COPYING INCOMPAT README*
   docinto samples ; dodoc sample/*
}

# Check whether LILO is installed
# This function is from /usr/sbin/mkboot from debianutils, with copyright:
#
#   Debian GNU/Linux
#   Copyright 1996-1997 Guy Maor <maor@debian.org>
#
# Modified for Gentoo for use with the lilo ebuild by:
#   Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
#
lilocheck () {
   local bootpart=
   local rootpart="$(rdev 2> /dev/null | cut -d ' ' -f 1 2> /dev/null)"

   echo
   einfon "Checking for LILO ..."

   if [ "$(whoami)" != "root" ]
   then
      echo; echo
      eerror "Only root can check for LILO!"
      return 1
   fi

   if [ -z "${rootpart}" ]
   then
      echo; echo
      eerror "Could not determine root partition!"
      return 1
   fi

   if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
   then
      echo " No"
      return 1
   fi

   bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"

   if [ -z "${bootpart}" ]
   then
      # lilo defaults to current root when 'boot=' is not present
      bootpart="${rootpart}"
   fi

   if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
   then
      echo; echo
      ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
      ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
      return 1
   fi

   echo " Yes, on ${bootpart}"

   return 0
}


pkg_postinst() {
   if [ ! -e ${ROOT}/boot/boot.b -a ! -L ${ROOT}/boot/boot.b ]
   then
      [ -f "${ROOT}/boot/boot-menu.b" ] && \
         ln -snf boot-menu.b ${ROOT}/boot/boot.b
   fi

   if [ "${ROOT}" = "/" ]
   then
      if lilocheck
      then
         einfo "Running DOLILO to complete the install ..."
         # do not redirect to /dev/null because it may display some input
         # prompt
         /sbin/dolilo
         if [ "$?" -ne 0 ]
         then
            echo
            ewarn "Running /sbin/dolilo failed!  Please check what the problem is"
            ewarn "before your next reboot."

            ebeep 5
            epause 5
         fi
      fi
      echo
   fi

   echo
   einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
   einfo "handles mounting and unmounting /boot for you. It can do more then"
   einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
   ebeep 5
   epause 3
   echo
}


I'm at work ATM, when I get home I can try this e-build on my system, but if anyone else wants to try this on their 64-bit system and let us know how it turns out, that would be great. Change the keywords to athlon64 or whatever, and give er a go.
Back to top
View user's profile Send private message
wbreeze
n00b
n00b


Joined: 06 Aug 2003
Posts: 53
Location: Langley, BC

PostPosted: Sat Feb 12, 2005 7:29 pm    Post subject: Reply with quote

First Off, I've never created, modified, or to the best of my knowledge even looked at an an ebuild before, so keep that in mind before blindly following what I've done.

edited /usr/portage/sys-boot/lilo/lilo-22.6.1.ebuild
Code:

changed
KEYWORDS="-* x86"

to
KEYWORDS="-* x86 amd64"


edited /usr/portage/sys-devel/bin86/bin86-0.16.17.ebuild

Code:

changed
KEYWORDS="-* ~x86"

to
KEYWORDS="-* ~x86 amd64"


emerge lilo

and it seemed to install fine
I have no idea if it will boot yet, because this PC is at work and I'm at home.

One question: Was it a bad idea to install bin86 in 64bit mode?
Back to top
View user's profile Send private message
wbreeze
n00b
n00b


Joined: 06 Aug 2003
Posts: 53
Location: Langley, BC

PostPosted: Tue Feb 15, 2005 5:24 am    Post subject: Reply with quote

!!!! My amd64 workstation now boots Gentoo and WinXP using lilo on a VIA raid0 !!!!

My only problems using lilo on this 64bit system were because of raid0
Back to top
View user's profile Send private message
Bigun
Veteran
Veteran


Joined: 21 Sep 2003
Posts: 1974

PostPosted: Thu Feb 17, 2005 2:03 pm    Post subject: Reply with quote

Sounds like a winner.... anyway we can get a dev to try this to verify?
Back to top
View user's profile Send private message
H3g3m0n
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2002
Posts: 97

PostPosted: Mon Mar 14, 2005 5:11 am    Post subject: Reply with quote

bin86 won't compile for me :(
Code:
install: cannot stat 'ld/objdump86': No such file or directory
Back to top
View user's profile Send private message
LordArthas
Guru
Guru


Joined: 01 Nov 2004
Posts: 493
Location: Maniago, Friûl, Italia

PostPosted: Mon Mar 14, 2005 10:55 am    Post subject: Reply with quote

Hi!

H3g3m0n wrote:
bin86 won't compile for me :(
Code:
install: cannot stat 'ld/objdump86': No such file or directory


I'm experiencing exactly this same error.

At the moment I'm using a lilo excutable I "stole" from a x86 Slackware Linux, as with GRUB I'm unable to boot on this motherboard. It would be nice if a working LILO ebuild was avaialble. ;-)

Michele.
Back to top
View user's profile Send private message
wbreeze
n00b
n00b


Joined: 06 Aug 2003
Posts: 53
Location: Langley, BC

PostPosted: Tue Mar 15, 2005 6:34 am    Post subject: Reply with quote

Hey, could one of you post a larger sample of the bin86 error?

I think that the same thing happened to me, but I dont fully remember. I'm hoping that seeing more might jog my memory.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Wed Mar 16, 2005 10:03 am    Post subject: Reply with quote

Here is my take on this. lilo is something you only use to run when you first install and when you rebuild the kernel or make changes to the boot options. So, the gentoo optimization would mean very little to this utility. Of course, getting it to build native on amd64 is beneficial in terms of skipping some extra step to get lilo to work on this platform but until then, an easy solution would be to use a bin-static package. So, that brings me to the question, why try to build it on your own and post it up for download when lilo's homepage already have a static-bin version available?

Get it here: http://home.san.rr.com/johninsd/pub/linux/lilo/lilo-22.6.1.binary-static.tar.gz :wink:

Works just fine for me. Just unpack at / should do the trick.

One thing I have notice on the bin86 error is that it looks like it is complaining about the wrong data size. Now that long int is 64bit I think in order to fix bin86 build is to port it to 64bit or compile it as 32bit apps. I have a feeling it is just a simple tweak to force it to build as 32bit. wbreeze, is that enough to jog your memory?
_________________
Han.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Wed Mar 16, 2005 6:00 pm    Post subject: Reply with quote

After reading the Gentoo/AMD64 Installation Technotes again, I think the trick is to run the emerge as such:
Code:
CFLAGS="-m32" emerge lilo
I can't try this now though because I am emerging world for a bunch of new useflag. Can someone try and verify?

I think in order for the lilo e-build to be accepted for AMD64, a section should be added to check if it is amd64 platform and add the '-m32' CFLAGS. Any takers? :wink:
_________________
Han.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Thu Mar 17, 2005 4:23 pm    Post subject: Reply with quote

I have tried my own suggestion and it does not work. Further investigation indicates that at some point (way up) in the emerge bin86 output, there is an error complaining that ld can't find libc. It seems that there is a new problem with binutils.

wbreeze, which version of binutils/gcc you use to compile lilo? I have a hunch that the newer tools might have a bug that the version you use to build bin86 does not have.

Yes, I know I have said just use the static bin available from the lilo homepage. However, I do like a good challenge. Unfortunately, I am also not going anywhere fast with this.
_________________
Han.
Back to top
View user's profile Send private message
platinumviper
l33t
l33t


Joined: 12 Feb 2004
Posts: 619
Location: Munich, Germany

PostPosted: Fri Mar 18, 2005 2:05 am    Post subject: Reply with quote

H3g3m0n wrote:
bin86 won't compile for me :(
Code:
install: cannot stat 'ld/objdump86': No such file or directory

In november 2004 it worked, but I think it was an error in a former portage-version. As objdump86 isn't needed to compile lilo, here is a very, very dirty workaround:
Emerge bin86, when you get the above error, as86 and ld86 are already compiled successfully, copy them to /usr/local/bin
Code:
cp /var/tmp/portage/bin86-0.16.17/work/bin86-0.16.17/as/as86 /usr/local/bin
cp /var/tmp/portage/bin86-0.16.17/work/bin86-0.16.17/ld/ld86 /usr/local/bin

Remove the bin86-dependency from the lilo-ebuild (line 26), emerge lilo.

platinumviper
_________________
No money back garantee. In case of problems, don't call us, we call you.
Back to top
View user's profile Send private message
wbreeze
n00b
n00b


Joined: 06 Aug 2003
Posts: 53
Location: Langley, BC

PostPosted: Fri Mar 18, 2005 2:36 am    Post subject: Reply with quote

I didn't read the new posts until I got home, and my amd is at work sitting in windows :oops: so I'll have to try and remember to check those versions for you tomorrow. I still dont remember how I managed it, but it certainly wasn't anything like what Platinumviper suggested (as you can see i'm only a noob)
Code:

install: cannot stat 'ld/objdump86': No such file or directory


that bit looks familiar, but, I think if I had to do anything weird to get it going I would have posted it... I must have thought that it was too simple. Weyhan, you are probably on to something with the versions, so I'll get those tomorrow
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Fri Mar 18, 2005 3:46 am    Post subject: Reply with quote

platinumviper wrote:
H3g3m0n wrote:
bin86 won't compile for me :(
Code:
install: cannot stat 'ld/objdump86': No such file or directory

In november 2004 it worked, but I think it was an error in a former portage-version. As objdump86 isn't needed to compile lilo, here is a very, very dirty workaround:
...

Platinumviper,

I think your workaround is a really bad idea. For people who can't wait for a fix, a better workaround would be to install the static bin package from lilo's homepage -> Here. And for people who like to see what they download before downloading go -> Here.

Why bother building it yourself when there is a pre-build version that works and the workaround does not contribute to fixing the bin86 build issue?

Here is one idea though, if someone create an ebuild for the static-bin package, I think that would be great. :wink:
_________________
Han.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Fri Mar 18, 2005 10:07 am    Post subject: Reply with quote

wbreeze wrote:
... Weyhan, you are probably on to something with the versions, so I'll get those tomorrow

Either that or there is something in the ebuild and/or multilib thingy. I have been getting the same error emerging gcc.
_________________
Han.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Fri Mar 18, 2005 7:41 pm    Post subject: Reply with quote

wbreeze,
Is this what you did to fix the problem?
Code:
emerge emul-linux-x86-glibc emul-linux-x86-compat emul-linux-x86-baselibs


In my other post, (here), this is suggested to me how to fix the problem with 32bit apps. It looks like it is working but gcc is still building at this time, so, can't say for sure it will work. Check out here for a more detail explanation.
_________________
Han.
Back to top
View user's profile Send private message
faldore
n00b
n00b


Joined: 03 May 2004
Posts: 17

PostPosted: Tue Mar 29, 2005 5:05 pm    Post subject: lilo... please....... Reply with quote

I can't use grub because I am using reiserfs and grub won't read it; also grub hates my video card, I can barely read the font its all messed up, and it won't boot my windows drive either. Lilo has none of these problems with my hardware. Grub is too picky. And the Gentoo Handbook don't tell me how to download "static binary" from "lilo's webpage" it just says "emerge" Why why why did gentoo do this to me? Please make lilo work... :-( Don't care if it's a 32-bit emulation or whatever, I just want lilo to work.

Seems to me it's like openoffice moving to java, it's a matter of convenience instead of following their code of making gentoo be whatever the user needs it to be.
Back to top
View user's profile Send private message
weyhan
Apprentice
Apprentice


Joined: 27 May 2003
Posts: 245

PostPosted: Tue Mar 29, 2005 5:15 pm    Post subject: Re: lilo... please....... Reply with quote

faldore wrote:
I can't use grub because I am using reiserfs and grub won't read it; also grub hates my video card, I can barely read the font its all messed up, and it won't boot my windows drive either. Lilo has none of these problems with my hardware. Grub is too picky. And the Gentoo Handbook don't tell me how to download "static binary" from "lilo's webpage" it just says "emerge" Why why why did gentoo do this to me? Please make lilo work... :-( Don't care if it's a 32-bit emulation or whatever, I just want lilo to work.

Seems to me it's like openoffice moving to java, it's a matter of convenience instead of following their code of making gentoo be whatever the user needs it to be.


I feel your pain. :wink:

Just incase you did not read the post above, download from here and gzip untar to / :wink:
_________________
Han.
Back to top
View user's profile Send private message
faldore
n00b
n00b


Joined: 03 May 2004
Posts: 17

PostPosted: Tue Mar 29, 2005 7:19 pm    Post subject: Re: lilo... please....... Reply with quote

Thanke weyhan, I will try that.
Back to top
View user's profile Send private message
imon fyre
n00b
n00b


Joined: 18 Dec 2003
Posts: 20
Location: sudbury on

PostPosted: Sat Apr 09, 2005 11:04 pm    Post subject: Reply with quote

just want to say that i did the editing method, and so far my install has not borked yet.

will post later on about the outcome, but this looks like it might be a viable method to add ~amd64 to the ebuilds for now
_________________
for truth, love and gentoo
Back to top
View user's profile Send private message
imon fyre
n00b
n00b


Joined: 18 Dec 2003
Posts: 20
Location: sudbury on

PostPosted: Sun Apr 10, 2005 12:55 am    Post subject: Reply with quote

system is so far stable, so adding these words to the above mentioned packages works, at least for me.
_________________
for truth, love and gentoo
Back to top
View user's profile Send private message
platinumviper
l33t
l33t


Joined: 12 Feb 2004
Posts: 619
Location: Munich, Germany

PostPosted: Wed Apr 13, 2005 1:24 am    Post subject: Reply with quote

weyhan wrote:
I think your workaround is a really bad idea.

ACK, so I created a patch and ebuild for a amd64-lilo-special-edition of bin86 which kicks off unneeded stuff. So everybody should be able to compile lilo. Error/success-reports and beer are welcome.8)

platinumviper
_________________
No money back garantee. In case of problems, don't call us, we call you.
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2769
Location: Pittsburgh, PA, USA

PostPosted: Thu Apr 28, 2005 7:54 pm    Post subject: Reply with quote

Thanks, platinumviper. That sloved my booting issue. As I was unable to get grub to boot my kernel with 4GB of memory installed. Lilo worked like a charm.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
Bigun
Veteran
Veteran


Joined: 21 Sep 2003
Posts: 1974

PostPosted: Fri Apr 29, 2005 2:15 pm    Post subject: Reply with quote

If the patch works, anyway we can get an e-build going?
Back to top
View user's profile Send private message
LordArthas
Guru
Guru


Joined: 01 Nov 2004
Posts: 493
Location: Maniago, Friûl, Italia

PostPosted: Fri Apr 29, 2005 10:00 pm    Post subject: Reply with quote

Hi!

bigun89 wrote:
If the patch works, anyway we can get an e-build going?


For a working AMD64 ebuild in portage, we need to wait for the lilo maintainer to create it I guess... in the meantime my old 32bit lilo executable does his job well. ;-)

Michele.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum