Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/kernel/initrd/initrd.SlackBuild

    r5fedc40 rc5c522c  
    11#!/bin/bash
     2#Zet hier de dingen bij die je gerebuild wilt hebben bij een nieuwe kernel.
    23#NOBUILDROOT
    34#DEP:busybox
     
    2627#DEP:fping
    2728#DEP:network_scripts
    28 #DEP:kmod
    29 
    3029
    3130##DEP:drv_3w_sas
     
    4039
    4140CWD=`pwd`
    42 INITROOT=/tmp/initrd.tmp
     41INITROOT=/tmp/initrd.tmp.$$
    4342
    4443rm -r $INITROOT &>/dev/null
     
    7776#net WEL omdat we nf_conntrack nodig zijn voor drbd!
    7877#rm -r $INITROOT/lib/modules/*/kernel/net || exit 1
    79 rm -r `find $INITROOT/lib/modules/*/kernel/fs/* -type d -not -name '*fat*' -not -name '*cifs*' -not -name '*fscache*'`
     78rm -r `find $INITROOT/lib/modules/*/kernel/fs/* -type d -not -name '*fat*' -not -name '*cifs*' -not -name '*fscache*'` 
    8079#rm -r $INITROOT/lib/modules/*/kernel/drivers/usb/serial || exit 1
    8180#rm -r $INITROOT/lib/modules/*/kernel/drivers/usb/storage || exit 1
     
    119118installpkg `../../findpkg v86d` || exit 1
    120119#installpkg `../../findpkg gcc` || exit 1
    121 #only need S-theme:
    122 rm -rf $INITROOT/etc/splash/{B,A,H,E,P,V,K,X} || exit 1
    123 
    124 
    125120
    126121#installpkg `../../findpkg libtermcap` || exit 1
     
    130125
    131126#de echte modprobe ivm modaliassen
    132 TGZ=`../../findpkg kmod` || exit 1
     127#installpkg `../../findpkg module_init_tools` || exit 1
     128TGZ=`../../findpkg module_init_tools` || exit 1
    133129(
    134130        cd $INITROOT &&
    135         rm sbin/modprobe sbin/depmod &>/dev/null &&
    136         tar -xzf "$TGZ" 'sbin/kmod' &&
    137         ln -s /sbin/kmod sbin/modprobe &&
    138         ln -s /sbin/kmod sbin/depmod
     131        tar -xzf "$TGZ" 'sbin/modprobe'
    139132) || exit 1
    140133
     
    146139        mv etc/passwd.new etc/passwd &&
    147140        mv etc/group.new etc/group &&
    148         mv etc/shadow.new etc/shadow
     141        mv etc/shadow.new etc/shadow 
    149142) || exit 1
    150143
     
    170163#(
    171164#       cd $INITROOT
    172 #       tar -xzf $TGZ usr/bin/eject
     165#       tar -xzf $TGZ usr/bin/eject 
    173166#) || exit 1
    174167
     
    180173#(
    181174#       cd $INITROOT
    182 #       tar -xzf $TGZ usr/sbin/mount.cifs
     175#       tar -xzf $TGZ usr/sbin/mount.cifs 
    183176#) || exit 1
    184177
     
    196189echo "Version $VERSION"
    197190
    198 ####################depmod runnen
     191####################depmod runnen 
    199192#hiervoor moeten we ff tijdelijk depmod installen
    200193
    201194# workaround for bug or feature in modprobe. modprobe looks in the 'extra' dir first, but busyboxs modprobe doesnt:
    202 # pushd $INITROOT/lib/modules/$VERSION/extra || exit 1
    203 # for EMOD in *; do
    204 #     OMOD=`find $INITROOT/lib/modules/$VERSION -name $EMOD |grep -v extra`
    205 #     if [ "$OMOD" != "" ];then
    206 #         mv $EMOD $OMOD  || exit 1
    207 #     fi
    208 # done
    209 # popd
    210 
    211 
    212 #edwin: replaced by kmod, uses one binary for all
    213 # TGZ=`../../findpkg module_init_tools` || exit 1
    214 # (
    215 #       cd $INITROOT &&
    216 #       tar -xzf $TGZ --wildcards '*sbin/depmod*'
    217 # ) || exit 1
     195pushd $INITROOT/lib/modules/$VERSION/extra || exit 1
     196for EMOD in *; do
     197    OMOD=`find $INITROOT/lib/modules/$VERSION -name $EMOD |grep -v extra`
     198    if [ "$OMOD" != "" ];then
     199        mv $EMOD $OMOD  || exit 1
     200    fi
     201done
     202popd
     203
     204
     205TGZ=`../../findpkg module_init_tools` || exit 1
     206(
     207        cd $INITROOT &&
     208        tar -xzf $TGZ --wildcards '*sbin/depmod*'
     209) || exit 1
    218210echo "Running depmod..."
    219211chroot $INITROOT /sbin/depmod -e -a $VERSION  || exit 1
    220 # echo "done"
    221 #
    222 # #depmod kan weer weg
    223 # rm $INITROOT/sbin/depmod*
     212echo "done"
     213
     214#depmod kan weer weg
     215rm $INITROOT/sbin/depmod*
    224216
    225217#####################overbodige zooi eruit strippen
     
    235227rm `find $INITROOT -type f -name *.static` 2>/dev/null
    236228rm `find $INITROOT -name *.a` 2>/dev/null
    237 rm -r $INITROOT/usr/share/bash-completion
    238 rm -r $INITROOT/home
    239 rm -r $INITROOT/usr/src
     229
    240230
    241231
    242232####################binaries strippen voor als dit nog niet gebeurd is
    243233echo "stripping binaries"
    244 pushd $INITROOT
     234pushd $INITROOT 
    245235find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || exit 1
    246236find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || exit 1
     
    277267#SIZE=`du -s $INITROOT|cut -f 1` || exit 1
    278268
    279 #echo "Size van alles files: $SIZE"
     269#echo "Size van alles files: $SIZE" 
    280270#(( SIZE+=3000 ))
    281271#echo "* initrd fixen van $SIZE kbytes."
     
    326316cd $PKG
    327317/sbin/makepkg -l y -c n $CWD/$NAME.pkg >/dev/null &&
    328 echo $VERSION > $CWD/$NAME.version
     318echo $VERSION > $CWD/$NAME.version 
Note: See TracChangeset for help on using the changeset viewer.