Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 >

lundi 31 août 2015

Build lighttpd 1.4.36 static build for x86 - 32 bits

My main idea...

As quoted from " https://sites.google.com/a/droboports.com/www/app-repository/lighttpd-1-4-30" lighttpd could be build "statically" for ARM. I dont own any hardware material for this architecture

You can do almost the same for arch=i386. By "almost the same" I mean that lighttpd 1.4.36 will be built with

Package Version
Zlib1.2.8
Bzip21.0.6
Pcre8.37
OpenSSL1.0.1p
Lua5.1.5
LibXML22.9.2
SQLite3081101
UUID library (from e2fsprogs)1.42.13
and using ldd you will get
root@amdgaming:~# ldd /opt/lighttpd/1.4.36/sbin/lighttpd
        linux-gate.so.1 =>  (0xb7794000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7764000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7747000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7599000)
        /lib/ld-linux.so.2 (0x8001e000)

Recent kernel/Old kernel for a deployment ?

Let suppose that you want to build lighttpd somewhere on on machine with a recent kernel and you want to deploy it on a machine with a kernel older

Before going ahead if your main goal is to deploy this on a machine and if all packages listed above are enough for your own uses then use file before

In my case lighttpd was built on a Kernel 4.1.6 with gcc-4.9.1 on Ubuntu 14.10 32 Bits

root@amdgaming:~# file /opt/lighttpd/1.4.36/sbin/lighttpd
/opt/lighttpd/1.4.36/sbin/lighttpd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9f2b11764c80ecfb2063116eae0e8c5f6a6ab5bb, stripped
As shown above lighttpd binary can work only with any kernel greater than 2.6.32. If your kernel on -- which lighttpd binary will be deployed -- is older than 2.6.32 then you will get the well-known error
FATAL: Kernel too old

So it means that for my own uses I can deploy it only on a machine with kernel >= 2.6.32.

Example: For a machine with a kernel like 2.6.20 on which lighttpd is supposed to be deployed then

  1. set up a VM with Ubuntu Lucid 10.04 or Ubuntu 8.04 -- Use a tool like Qemu or VMWare -- your favorite tool
  2. Build lighttpd on this VM.

Have a look on this page for binary deployement " https://sites.google.com/a/droboports.com/www/app-repository/lighttpd-1-4-30"

Build lighttpd

Here are my own commands for lighttpd 1.4.36 with the latest packages I could find. Commands are taken from " https://sites.google.com/a/droboports.com/www/app-repository/lighttpd-1-4-30"

export DEST=/opt/lighttpd/1.4.36/

export SRC=/opt/Sources/All_sources_for_lighttpd
# Create folders
mkdir -pv $DEST
mkdir -pv $DEST $SRC


# Build zlib
cd $SRC
wget wget http://zlib.net/zlib-1.2.8.tar.gz
tar xvzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
CFLAGS=" -O3" ./configure --prefix=$DEST --static
make clean
make
ZLIB=`pwd`
cd ..

# Build bzip2
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar zxf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
make clean
make libbz2.a CFLAGS=" -Wall -Winline -O3 -g -D_FILE_OFFSET_BITS=64"
BZIP=`pwd`
cd ..

# Build pcre
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.bz2
tar xvjf pcre-8.37.tar.bz2
cd pcre-8.37
CFLAGS=" -O3 -I$ZLIB -I$BZIP" CXXFLAGS="$CFLAGS" LDFLAGS="-L$ZLIB -L$BZIP" ./configure  \
--prefix=$DEST --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-unicode-properties --disable-shared
make clean
make
PCRE=`pwd`
cd ..

# Build OpenSSL
wget http://openssl.org/source/openssl-1.0.1p.tar.gz
tar xvzf openssl-1.0.1p.tar.gz
cd openssl-1.0.1p
./Configure linux-generic32 -DL_ENDIAN --prefix=$DEST \
--openssldir=$DEST/etc/ssl no-shared no-zlib-dynamic --with-zlib-include=$ZLIB --with-zlib-lib=$ZLIB
sed -i -e "s/CFLAG= /CFLAG=${CFLAGS} /g" Makefile
make clean && make && make install_sw
rm -fr $DEST/include
rm -fr $DEST/lib
OPENSSL=`pwd`
cd ..

# Build Lua
wget http://www.lua.org/ftp/lua-5.1.5.tar.gz
tar xvzf lua-5.1.5.tar.gz
cd lua-5.1.5
make clean
make PLAT=linux INSTALL_TOP=$DEST  CFLAGS=" -O3 -Wall " LIBS="-lm "
LUA=`pwd`
cd ..

# Build LibXML2
wget ftp://xmlsoft.org/libxml2/libxml2-2.9.2.tar.gz
tar xvzf libxml2-2.9.2.tar.gz
cd libxml2-2.9.2
CFLAGS=" -O3 -I$ZLIB" LDFLAGS=" -L$ZLIB -lz -lm" ./configure  --prefix=$DEST --with-zlib --without-python --disable-shared
make clean && make
LIBXML=`pwd`
cd ..

# Build SQLite
wget http://www.sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
tar xvzf sqlite-autoconf-3081101.tar.gz
cd sqlite-autoconf-3081101
CFLAGS=" -O3" LIBS="-ldl -lpthread" ./configure --prefix=$DEST --enable-shared=no
make clean && make
SQLITE=`pwd`
cd ..

# Build UUID 
wget http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.42.13.tar.gz
tar xvzf e2fsprogs-1.42.13.tar.gz
cd e2fsprogs-1.42.13
CFLAGS=" -O3" ./configure --prefix=$DEST --disable-elf-shlibs
cd lib/uuid/
make clean && make
LIBUUID=`pwd`
cd ../../..

# Build and install lighttpd 1.4.36
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.36.tar.gz
tar xvzf lighttpd-1.4.36.tar.gz
cd lighttpd-1.4.36
CFLAGS=" -O3 -I$ZLIB -I$BZIP -I$PCRE -DPCRE_STATIC -I$OPENSSL/include -I$LIBUUID/.." \
LDFLAGS=" -L$ZLIB -L$BZIP -L$PCRE/.libs -L$OPENSSL -L$LIBUUID" LIBS="-lz -lbz2 -lpcre -luuid -lssl -lcrypto -ldl -lm -lpthread" \
LUA_CFLAGS="-I$LUA/src" LUA_LIBS="-L$LUA/src" XML_CFLAGS="-I$LIBXML/include" XML_LIBS="-L$LIBXML/.libs -lxml2 -lm" \
SQLITE_CFLAGS="-I$SQLITE" SQLITE_LIBS="-L$SQLITE/.libs -lsqlite3" ac_cv_path_PCRECONFIG=$PCRE/pcre-config \
./configure --prefix=$DEST --with-openssl --with-pcre --with-zlib --with-bzip2 --with-lua --with-webdav-props --with-webdav-locks 
make clean
make
make install
Remember that strip is your friend :)
strip $DEST/sbin/lighttpd

vendredi 28 août 2015

Salaire from shell

david@amdgaming:~$ for i in $(seq 35 90);do echo -n "$i k€/an -- ";expr ${i}00000 / 12 '*' 75 / 10000;done
35 k€/an -- 2187
36 k€/an -- 2250
37 k€/an -- 2312
38 k€/an -- 2374
39 k€/an -- 2437
40 k€/an -- 2499
41 k€/an -- 2562
42 k€/an -- 2625
43 k€/an -- 2687
44 k€/an -- 2749
45 k€/an -- 2812
46 k€/an -- 2874
47 k€/an -- 2937
48 k€/an -- 3000
49 k€/an -- 3062
50 k€/an -- 3124
51 k€/an -- 3187
52 k€/an -- 3249
53 k€/an -- 3312
54 k€/an -- 3375
55 k€/an -- 3437
56 k€/an -- 3499
57 k€/an -- 3562
58 k€/an -- 3624
59 k€/an -- 3687
60 k€/an -- 3750
61 k€/an -- 3812
62 k€/an -- 3874
63 k€/an -- 3937
64 k€/an -- 3999
65 k€/an -- 4062
66 k€/an -- 4125
67 k€/an -- 4187
68 k€/an -- 4249
69 k€/an -- 4312
70 k€/an -- 4374
71 k€/an -- 4437
72 k€/an -- 4500
73 k€/an -- 4562
74 k€/an -- 4624
75 k€/an -- 4687
76 k€/an -- 4749
77 k€/an -- 4812
78 k€/an -- 4875
79 k€/an -- 4937
80 k€/an -- 4999
81 k€/an -- 5062
82 k€/an -- 5124
83 k€/an -- 5187
84 k€/an -- 5250
85 k€/an -- 5312
86 k€/an -- 5374
87 k€/an -- 5437
88 k€/an -- 5499
89 k€/an -- 5562
90 k€/an -- 5625

mercredi 26 août 2015

Linux from Scratch - Version fr

mardi 25 août 2015

Vanessa Carlton - A thousand miles