LSI 1068 in Debian Etch (megasr.ko)

Hola a tothom,

Ja soc aquí amb un altre tema interesant a comentar sobre linux, i aquest cop es tracta de com treballar amb la controladora SAS (Serial Ata SCSI) LSI 1068 a GNU/Linux i més concretament a Debian Etch. Aquesta controladora, ja té actualment drivers per a gnu/linux, però només per a dos distribucions, en aquest cas de pagament, que són Red Hat i SLES però no per a Debian etch. Abans de començar amb els passos, vull agrair-li tota la ajuda que m’ha donat a l’Adam Cecile que es qui a “purtat” tota la interficie dels drivers de redhat a debian.

Per compilar i instalar aquest driver a debian etch seguirem els passos següents:

Instalem tots els paquetes necessaris per la compilació:

  • #> aptitude install linux-image-2.6.18-6-486 (la versió 486 o 686
    dependrà del vostre ordinador) linux-header-2.6.18-6-486
    module-assistant build-essential devscripts

Descarreguem el codi font del mòdul

  • #> dget -x http://mentors.debian.net/debian/pool/non-free/
    /m/megasr/megasr_09.21.0914.2007-1.dsc

Accedim al directori del codi font

  • #> cd megasr-09.21.0914.2007

Generem el paquet, l’instalem i el compilem

  • #>debuild -sa
  • #> dpkg -i ../megasr-source*.deb
  • #> m-a build megasr -l 2.6.18-4-486 (el 486 també
    depen del vostre kernel)

Instalem el mòdul resultant

  • #> dpkg -i /usr/src/megasr-modules-*

Arribats aquest punt, ja hauriem de ser capaços de ‘montar'(mount) cualsevol disk de la controladora. Per fer-ho, primer haurem de carregar el modul:

  • #> depmod
  • #> modprobe megasr

Ara a /dev ja tindrem els dispositius. Si no heu d’arrancar des del disc de la controladora, serà tan sencill com agefir al modul a /etc/modules per a que us carregui al iniciar. Si al contrari, el que voleu fer es carregar des del disk, haureu de generar un nou initrd amb la següent comanda:

  • #> echo "megasr" > /etc/initramfs-tools/initramfs.conf
  • #> mkinitramfs -o /boot/initrd.img-2.6.18-6-686 2.6.18-6-686

Arribats aquest punt ja hem conseguit tot el que ens haviem proposat.

Howto LSI 1068 in Debian Etch (megasr)

First we have to install the packages needed for compilation

  • #> aptitude install linux-image-2.6.18-6-486
    linux-header-2.6.18-6-486 module-assistant build-essential devscripts
We download the source code
  • #> dget -x http://mentors.debian.net/debian/pool/non-free/
    m/megasr/megasr_09.21.0914.2007-1.dsc

We go to the source directory

  • #> cd megasr-09.21.0914.2007

We make the package, we install it and we compile the module

  • #>debuild -sa
  • #> dpkg -i ../megasr-source*.deb
  • #> m-a build megasr -l 2.6.18-4-486

We install the compiled module

  • #> dpkg -i /usr/src/megasr-modules-*

Now we should be able to access to the attached disks. To do it we have to load the module:

  • #> depmod
  • #> modprobe megasr

Now in /dev we should see the disks. If you don’t want to boot from this drivers, you only will have to add ‘megasr’ in /etc/modules. If you want to boot from the disks make the following steps:

  • #> echo "megasr" > /etc/initramfs-tools/initramfs.conf
  • #> mkinitramfs -o /boot/initrd.img-2.6.18-6-686 2.6.18-6-686

So now we have finished!!! I want to thanks a lot to Adam Cecile who has help me a lot to be able to do this! THANKS

~ per akas84 a Juliol 27, 2008.

13 Respostes to “LSI 1068 in Debian Etch (megasr.ko)”

  1. Hello!
    this way doesn’t work with 2.6.26 kernel and most likely other versions higher than 2.6.18 😦
    are there any patches for newest kernels?

    Thanx!

  2. Hi,

    I’m the guy who made the package available on debian mentors.
    I worked on it today and found a new version that seems to build and load fine with lenny’s 2.6.26 kernel.
    However, I don’t have such (crap) hardware anymore, so I won’t be able to tell you if it really works!
    Here is the new package: http://mentors.debian.net/debian/pool/non-free/m/megasr/
    It has been tested with etch 2.6.18-6 x86 and x64, lenny 2.6.26-2 x86 and x64 and even sid 2.6.30-1-amd64 and it always build and load fine.

    I’d be happy to hear some feedbacks from you if you manage to get it running.

    Regards, Adam.

  3. The ‘debian/rules’ file contains a bash-ism at line 11, preventing the compilation on Ubuntu Server 9.10.

    s/==/=/ makes it work.

  4. Hello, source from link http://mentors.debian.net/debian/pool/non-free/m/megasr/ missing debian/rules, please help…

  5. # For lenny (¿ sid ?)

    # I’m root
    cd ~

    apt-get install module-assistant build-essential devscripts dpkg-dev dpatch fakeroot

    m-a prepare

    echo “deb-src http://ftp.de.debian.org/debian/ lenny main contrib non-free # Debian sources” > /etc/apt/sources.list.d/debian_sources.list

    echo “deb-src http://mentors.debian.net/debian/ unstable non-free #Mentors sources for Non-Free” > /etc/apt/sources.list.d/mentors_nonfree_sources.list

    apt-get update

    apt-get source megasr

    cd megasr-13.07.0318.2009 (today == 2010 04 14)

    debuild -sa

    and …

    ¡TACHANNNN!

    I have a new deb package with a nice megasr module 🙂

    Good lock!

  6. Sorry ….

    # Second part:

    # I’m root

    cd ~

    dpkg -i megasr-source_13.07.0318.2009-1_all.deb (today == 2004 04 14)

    m-a build megasr

    … (30seg….)

    dpkg -i megasr-modules-2.6.26-686_13.07.0318.2009-1+2.6.26-21lenny4_i386.deb

    That’s all!

    • dpkg-deb: building package `megasr-source’ in `../megasr-source_13.07.0318.2009-1_all.deb’.
      dpkg-genchanges >../megasr_13.07.0318.2009-1_amd64.changes
      dpkg-genchanges: including full source code in upload
      dpkg-buildpackage: full upload (original source is included)
      Now signing changes and any dsc files…
      signfile megasr_13.07.0318.2009-1.dsc Adam Cécile (Le_Vert)
      gpg: keyring `/root/.gnupg/secring.gpg’ created
      gpg: skipped “Adam Cécile (Le_Vert) “: secret key not available
      gpg: [stdin]: clearsign failed: secret key not available
      debsign: gpg error occurred! Aborting….
      debuild: fatal error at line 1240:
      running debsign failed

      What can you do with it?

  7. It’s true, the debsign fails, but you can continue and get the driver working.
    Now I’m trying this driver in Ubuntu Server AMD64 10.04 and it compiles and detects the disks, but after creating the image the server is not booting. Will keep trying.

  8. apt-get update
    apt-get upgrade
    aptitude install linux-image-2.6.26-2-686 linux-headers-2.6.26-2-686
    apt-get install module-assistant build-essential devscripts dpkg-dev dpatch fakeroot
    m-a prepare -l2.6.26-2-686
    echo “deb-src http://ftp.de.debian.org/debian/ lenny main contrib non-free # Debian sources” > /etc/apt/sources.list.d/debian_sources.list
    echo “deb-src http://mentors.debian.net/debian/ unstable non-free #Mentors sources for Non-Free” > /etc/apt/sources.list.d/mentors_nonfree_sources.list
    apt-get update
    apt-get source megasr
    cd megasr-13.07.0318.2009
    gpg –gen-key <- Create key (Write down your passphrase)
    gpg –list-secret-keys
    debuild -sa -kYOUR_KEY_HERE
    cd ..
    dpkg -i megasr-source_13.07.0318.2009-1_all.deb
    m-a build megasr -l2.6.26-2-686
    dpkg -i /usr/src/megasr-modules-2.6.26-686_13.07.0318.2009-1+2.6.26-21lenny4_i386.deb

  9. This method stiil works on debian squeeze.
    I started LSI1068 on debian squeeze, linux-image 2.6.32.5-686-bigmem.

    Need to change one command to

    dget -u -x http://mentors.debian.net/debian/pool/main/m/megasr/megasr_14.00.1203.2010-1.dsc

  10. Hello all,

    have some one testesd it with a 3.0 kernel under ubuntu oneiric? I do it and get this errors:

    find library/ -name ‘Module.symvers’ | xargs rm -f
    find library/ -name ‘*.ko’ | xargs rm -f
    find library/ -name ‘*.o’ | xargs rm -f
    find library/ -name ‘*.c’ | xargs rm -f
    /usr/bin/make -f debian/rules kdist_clean kdist_config binary-modules
    make[1]: Betrete Verzeichnis ‘/usr/src/modules/megasr’
    find library/ -name ‘Module.symvers’ | xargs rm -f
    find library/ -name ‘*.ko’ | xargs rm -f
    find library/ -name ‘*.o’ | xargs rm -f
    find library/ -name ‘*.c’ | xargs rm -f
    for templ in ; do \
    cp $templ `echo $templ | sed -e ‘s/_KVERS_/3.0.0-15-generic/g’` ; \
    done
    for templ in `ls debian/*.modules.in` ; do \
    test -e ${templ%.modules.in}.backup || cp ${templ%.modules.in} ${templ%.modules.in}.backup 2>/dev/null || true; \
    sed -e ‘s/##KVERS##/3.0.0-15-generic/g ;s/#KVERS#/3.0.0-15-generic/g ; s/_KVERS_/3.0.0-15-generic/g ; s/##KDREV##/3.0.0-15.26/g ; s/#KDREV#/3.0.0-15.26/g ; s/_KDREV_/3.0.0-15.26/g ‘ ${templ%.modul$
    done
    dh_testroot
    dh_clean -k
    dh_clean: dh_clean -k is deprecated; use dh_prep instead
    dh_installdirs lib/modules/3.0.0-15-generic/kernel/drivers/scsi/megaraid
    /usr/bin/make -C /usr/src/linux-headers-3.0.0-15-generic SUBDIRS=/usr/src/modules/megasr/library/sles11-64/ modules
    make[2]: Betrete Verzeichnis ‘/usr/src/linux-headers-3.0.0-15-generic’
    CC [M] /usr/src/modules/megasr/library/sles11-64/../../open_source/oss/lin/lin_oss.o
    CC [M] /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.o
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:41:8: Warnung: »int« ist Standardtyp in Deklaration von »DECLARE_MUTEX« [-Wimplicit-int]
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:41:1: Warnung: Parameternamen (ohne Typen) in Funktionsdeklaration [standardmäßig aktiviert]
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c: In Funktion »lsraid_mgmt_fasync«:
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:369:9: Fehler: »lsraid_async_queue_mutex« nicht deklariert (erste Benutzung in dieser Funktion)
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:369:9: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c: In Funktion »lsraid_load_ioctl_module«:
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:491:2: Fehler: Implizite Deklaration der Funktion »init_MUTEX« [-Werror=implicit-function-declaration]
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c: Auf höchster Ebene:
    /usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.c:41:8: Warnung: »DECLARE_MUTEX« als »static« deklariert, aber nirgendwo definiert [-Wunused-function]
    cc1: Einige Warnungen werden als Fehler behandelt

    make[3]: *** [/usr/src/modules/megasr/library/sles11-64/../../open_source/osl/lin/osl_char.o] Fehler 1
    make[2]: *** [_module_/usr/src/modules/megasr/library/sles11-64] Fehler 2
    make[2]: Verlasse Verzeichnis ‘/usr/src/linux-headers-3.0.0-15-generic’
    make[1]: *** [binary-modules] Fehler 2
    make[1]: Verlasse Verzeichnis ‘/usr/src/modules/megasr’
    make: *** [kdist_build] Fehler 2

    Does anyone know why?

  11. Does anyone know where http://mentors.debian.net/debian/pool/main/m/megasr went ? It returns 404.

    Thanks

  12. Hey very cool blog!! Man .. Excellent .. Amazing .. I’ll bookmark your web site and take the feeds also…I’m happy to find numerous useful information here in the post, we need develop more techniques in this regard, thanks for sharing. . . . . .

Deixa una resposta a Mal Cancel·la la resposta