You are not logged in.

#1 2010-11-14 19:17:39

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

[Request] Haveged

Hi, I tried to make  haveged (a simple entropy daemon) package, but got into some segfault problems. Event posted my problem here, but got no replies. So, my last solution is to seek help, and to ask you guys to please create (or help me create) PKGBUILD for haveged.


here is my prototype pkgbuild

# Maintainer: pootzko <pootzko@gmail.com>

pkgname=haveged
pkgver=0.9
pkgrel=1
pkgdesc="A simple entropy daemon."
arch=('i686' 'x86_64')
url="http://www.issihosts.com/haveged/"
license="GPL"
depends=()
source=($url/$pkgname-$pkgver.tar.gz)
md5sums=('1830eae20c45f6b5d48790a1160392e5')


build() {
    cd $srcdir/$pkgname-$pkgver

    ./configure --prefix=/usr
    make || return 1
    make DESTDIR=$pkgdir install
} 

and this is the output I get from makepkg -s

==> Making package: haveged 0.9-1 (Wed Oct 27 18:39:35 CEST 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Downloading haveged-0.9.tar.gz...
--2010-10-27 18:39:36--  http://www.issihosts.com/haveged//haveged-0.9.tar.gz
Resolving www.issihosts.com... 66.36.243.129
Connecting to www.issihosts.com|66.36.243.129|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 193969 (189K) [application/x-gzip]
Saving to: "haveged-0.9.tar.gz.part"

100%[============================================================================>] 193,969      131K/s   in 1.5s    

2010-10-27 18:39:37 (131 KB/s) - "haveged-0.9.tar.gz.part" saved [193969/193969]

==> Validating source files with md5sums...
    haveged-0.9.tar.gz ... Passed
==> Extracting Sources...
  -> Extracting haveged-0.9.tar.gz with bsdtar
==> Entering fakeroot environment...
==> Starting build()...
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for floor... no
checking for gettimeofday... yes
checking for memset... yes
checking for pow... no
checking for select... yes
checking for sqrt... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating ent/Makefile
config.status: creating nist/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
Making all in src
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
gcc -DHAVE_CONFIG_H -I. -I..  -DHAVE_ISA_X86  -Wall -march=i686 -mtune=generic -O2 -pipe -MT haveged.o -MD -MP -MF .deps/haveged.Tpo -c -o haveged.o haveged.c
mv -f .deps/haveged.Tpo .deps/haveged.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DHAVE_ISA_X86  -Wall -march=i686 -mtune=generic -O2 -pipe -MT havege.o -MD -MP -MF .deps/havege.Tpo -c -o havege.o havege.c
mv -f .deps/havege.Tpo .deps/havege.Po
gcc -Wall -march=i686 -mtune=generic -O2 -pipe  -Wl,--hash-style=gnu -Wl,--as-needed -o haveged haveged.o havege.o  
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
Making all in man
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
Making all in ent
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
Making all in nist
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
Making install in src
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
test -z "/usr/sbin" || /bin/mkdir -p "/home/pootzko/Downloads/jaurt/pkg/usr/sbin"
  /bin/install -c 'haveged' '/home/pootzko/Downloads/jaurt/pkg/usr/sbin/haveged'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/src'
Making install in man
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/man/man8" || /bin/mkdir -p "/home/pootzko/Downloads/jaurt/pkg/usr/share/man/man8"
 /bin/install -c -m 644 'haveged.8' '/home/pootzko/Downloads/jaurt/pkg/usr/share/man/man8/haveged.8'
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/man'
Making install in ent
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/ent'
Making install in nist
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9/nist'
make[1]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
make[2]: Entering directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/etc/init.d" || /bin/mkdir -p "/home/pootzko/Downloads/jaurt/pkg/etc/init.d"
 /bin/install -c 'init.d/haveged' '/home/pootzko/Downloads/jaurt/pkg/etc/init.d/haveged'
make[2]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
make[1]: Leaving directory `/home/pootzko/Downloads/jaurt/src/haveged-0.9'
==> Tidying install...
  -> Purging other files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package...
  -> Generating .PKGINFO file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: haveged 0.9-1 (Wed Oct 27 18:39:46 CEST 2010)

and this is what I get when I try to run haveged after I install it with pacman -U

$ haveged start
Segmentation fault

I'll be happy to provide any more info on this

thank you smile


...I put on my robe and a wizard hat...

Offline

#2 2010-11-14 22:31:07

kfgz
Member
From: Supraśl, Poland
Registered: 2009-03-02
Posts: 114

Re: [Request] Haveged

It's probably gcc 4.5 fault: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563938

You can install gcc43 from AUR and use export CC=/usr/bin/gcc-4.3 (??) in PKGBUILD before make.

EDIT

Nvm, you don't have to install gcc43, just use this PKGBUILD

# Maintainer: pootzko <pootzko@gmail.com>

pkgname=haveged
pkgver=0.9
pkgrel=1
pkgdesc="A simple entropy daemon."
arch=('i686' 'x86_64')
url="http://www.issihosts.com/haveged/"
license="GPL"
depends=()
source=(${url}/${pkgname}-${pkgver}.tar.gz)
md5sums=('1830eae20c45f6b5d48790a1160392e5')

build() {
    cd ${srcdir}/${pkgname}-${pkgver}
     export CFLAGS="-march=native -O0 -pipe"
    ./configure --prefix=/usr
    make || return 1
    make DESTDIR=${pkgdir} install
}

Of course you should create/modify deamon script to conform Arch Linux standards and daemon location (/etc/rc.d instead of /etc/init.d).

Last edited by kfgz (2010-11-14 22:40:55)

Offline

#3 2010-11-14 23:45:43

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Re: [Request] Haveged

thank you very much smile

one more question though: should I modify haveged source files with for example sed in every place I see it contains init.d or should I somehow change the installation dir after the package is already compiled?


...I put on my robe and a wizard hat...

Offline

#4 2010-11-15 00:53:04

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Re: [Request] Haveged

ok, I made this one

# Maintainer: pootzko <pootzko@gmail.com>

pkgname=haveged
pkgver=0.9
pkgrel=1
pkgdesc="A simple entropy daemon."
arch=('i686' 'x86_64')
url="http://www.issihosts.com/haveged/"
license="GPL"
depends=()
source=(${url}/${pkgname}-${pkgver}.tar.gz)
md5sums=('1830eae20c45f6b5d48790a1160392e5')

build() {
    cd ${srcdir}/${pkgname}-${pkgver}
    export CFLAGS="-march=native -O0 -pipe"
    
    mv init.d rc.d    
    
    sed -i 's/rc.d\/init.d/rc.d/g' rc.d/haveged
    sed -i s/init.d/rc.d/g Makefile.am
    sed -i s/init.d/rc.d/g Makefile.in    
    sed -i s/init.d/rc.d/g haveged.spec        
    sed -i s/init.d/rc.d/g README        

    sed -i 's/usr\/local/usr/g' configure
    sed -i 's/usr\/local/usr/g' haveged.spec
    sed -i 's/usr\/local/usr/g' INSTALL
    sed -i 's/usr\/local/usr/g' rc.d/haveged
    sed -i 's/usr\/local/usr/g' README
        
    ./configure --prefix=/usr
    make || return 1
    make DESTDIR=${pkgdir} install
}

it seems to work fine when I start it as daemon with "/etc/rc.d/haveged start" except that I get this weird error:

 # /etc/rc.d/haveged start
Starting haveged: /etc/rc.d/haveged: line 15: success: command not found
/etc/rc.d/haveged: line 15: failure: command not found

when I check if the daemon is running - it is... so I guess this is just some problem in haveged it self, not recognizing it actually found the command so it outputs the error?

if you think it is haveged error, I could contact the developer and ask him to fix it..

Last edited by pootzko (2010-11-15 00:59:25)


...I put on my robe and a wizard hat...

Offline

#5 2010-11-15 10:08:35

kfgz
Member
From: Supraśl, Poland
Registered: 2009-03-02
Posts: 114

Re: [Request] Haveged

Proper haveged dameon script should look like this

#!/bin/bash
#
# chkconfig: 2345 75 25
# description: havege entropy daemon
#
# source function library
. /etc/rc.conf
. /etc/rc.d/functions

prog="haveged"

case "$1" in
start)
  stat_busy $"Starting $prog"
  /usr/sbin/$prog -w 1024 -v 1
  if [ $? -gt 0 ]; then
    stat_fail
  else
    add_daemon $prog
    stat_done
  fi
  ;;

stop)
  stat_busy $"Stopping $prog"
  kill `cat /var/run/$prog.pid`
  if [ $? -gt 0 ]; then
    stat_fail
  else
    rm_daemon $prog
    stat_done
    rm -f /var/lock/$prog
  fi
  ;;
  
restart)
  $0 stop
  $0 start
  ;;

*)
  echo "usage: $prog [start|stop|restart]"
esac

IMHO it's better to add this as a file, rather than playing with sed.

Last edited by kfgz (2010-11-15 10:09:39)

Offline

Board footer

Powered by FluxBB