#!/bin/bash ## src2pkg script for: kernel-modules ## Auto-generated by src2pkg-1.9.6 ## src2pkg Copyright 2005-2011 Gilbert Ashley # KNAME gets appended to the name of the package (like 'kernel-$KNAME ') # in order to avoid that installpkg or upgradepkg overwrite your existing kernel(s), # you should give this kernel-modules build a unique KNAME like 'my_modules' KNAME='kiss' # The package build number. See ChangeLog at the end of this file BUILD='4' # if you want to build a kernel for architecture other than ix86, change this # the most likely alternatives are: ia64, ppc or x86_64 # this needs to be set so that the script can find the finished bzImage file # under $SRC_DIR/arch/$KARCH/boot/bzImage KARCH='x86' # edit to change this to the correct kernel version SOURCE_NAME='linux-2.6.31.11.tar.bz2' # you shouldn't need to change anything below ALT_NAME and ALT_VERSION # reset the default package name(which would be 'linux' in this case) ALT_NAME="kernel-source-$KNAME" # uncomment and edit this to reset the default VERSION (needed if using kernel version patches) ALT_VERSION=2.6.31.11 PATCHLIST='4310_aufs2-31.11.patch' # don't split anything out SPLIT_PACKAGE= # packaging options # MAKE_IMG creates a mountable file-system image of the sources directory (sfs) # our init scripts include code to mount these early during bootup MAKE_IMG=sfs SOURCES_DIR=$PWD/../../kernel # Normally you shouldn't need to change anything below here # Get the functions and configs . /usr/libexec/src2pkg/FUNCTIONS ; # do_all_processes can substitute these 16 steps: pre_process find_source make_dirs unpack_source fix_source_perms #configure_source #compile_source #fake_install if [[ -r $CWD/config-$KNAME-$VERSION ]] ; then cp $CWD/config-$KNAME-$VERSION $SRC_DIR/.config elif [[ -r $CWD/config-$KNAME ]] ; then cp $CWD/config-$KNAME $SRC_DIR/.config elif [[ -r $CWD/config ]] ; then cp $CWD/config $SRC_DIR/.config elif [[ -r $CWD/config* ]] ; then cp $CWD/config* $SRC_DIR/.config else echo "" echo $RED"Error!"$NORMAL" No kernel configuration file found!" echo "To build the kernel-modules, place a copy of your" echo "kernel-modules configuration file in the current directory" echo "and name it config-$KNAME-$VERSION, config-$KNAME or 'config'." echo "Exiting..." exit 0 fi # update the config file ?? # cd $SRC_DIR && make oldconfig cd $SRC_DIR && make prepare clean # copy any patches into the sources for PATCH in $PATCHLIST ; do cp $CWD/$PATCH $SRC_DIR done mkdir -p $PKG_DIR/usr/src/linux-$VERSION case $MAKE_IMG in sfs) # create a squashfs image of the contents of the modules directory echo "Creating a squashfs image of the sources." ( cd $SRC_DIR && \ { mksquashfs . $PKG_DIR/usr/src/linux-$VERSION/kernel-source-kiss-$VERSION.sfs -comp gzip } ) ;; # other possibilities iso, extX *) mv $SRC_DIR/* $PKG_DIR/usr/src/linux-$VERSION ;; esac mkdir -p $PKG_DIR/install cat > $PKG_DIR/install/doinst.sh < # Build 2 adds the aufs patch with aufs built-in, adds mtd/jffs2 modules, # makes creation of fs image optional # aufs maybe the best choice for a union mount. It came closer than any # other to getting in the mainline kernel. Even the code is pretty large, # it only patches a few lines in a couple of existing files, so the patch should # be fairly easy to maintain. # Build 3 adds a whole slew of modules mostly for network devices # lowers HZ to 300, uses gzip instead of lzma, turns on optimization # Build 4 uses a nearly fully modular configuration for a generic kernel, but with # ext2/3/4 built in plus iso9660, FAT/NTFS and others