2013-07-20 19:48:08 +03:00

76 lines
3.0 KiB
Bash
Executable File

#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
LINUX=`ls -d $PKG_BUILD`
if [ -f $PROJECT_DIR/$PROJECT/$1/$1.$TARGET_ARCH.conf ]; then
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$1/$1.$TARGET_ARCH.conf
else
KERNEL_CFG_FILE=$PKG_DIR/config/$1.$TARGET_ARCH.conf
fi
sed -i -e "s|^HOSTCC[[:space:]]*=.*$|HOSTCC = $HOST_CC|" \
-e "s|^HOSTCXX[[:space:]]*=.*$|HOSTCXX = $HOST_CXX|" \
-e "s|^ARCH[[:space:]]*?=.*$|ARCH = $TARGET_ARCH|" \
-e "s|^CROSS_COMPILE[[:space:]]*?=.*$|CROSS_COMPILE = $TARGET_PREFIX|" \
$LINUX/Makefile
cp $KERNEL_CFG_FILE $LINUX/.config
sed -i -e "s|^CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"$ROOT/$BUILD/image/initramfs.cpio\"|" \
$LINUX/.config
# disable PPP support if not enabled
if [ ! "$PPTP_SUPPORT" = yes ]; then
sed -i -e "s|^CONFIG_PPP=.*$|# CONFIG_PPP is not set|" $LINUX/.config
fi
# disable swap support if not enabled
if [ ! "$SWAP_SUPPORT" = yes ]; then
sed -i -e "s|^CONFIG_SWAP=.*$|# CONFIG_SWAP is not set|" $LINUX/.config
fi
# disable nfs support if not enabled
if [ ! "$NFS_SUPPORT" = yes ]; then
sed -i -e "s|^CONFIG_NFS_FS=.*$|# CONFIG_NFS_FS is not set|" $LINUX/.config
fi
# disable cifs support if not enabled
if [ ! "$SAMBA_SUPPORT" = yes ]; then
sed -i -e "s|^CONFIG_CIFS=.*$|# CONFIG_CIFS is not set|" $LINUX/.config
fi
# disable iscsi support if not enabled
if [ ! "$ISCSI_SUPPORT" = yes ]; then
sed -i -e "s|^CONFIG_SCSI_ISCSI_ATTRS=.*$|# CONFIG_SCSI_ISCSI_ATTRS is not set|" $LINUX/.config
sed -i -e "s|^CONFIG_ISCSI_TCP=.*$|# CONFIG_ISCSI_TCP is not set|" $LINUX/.config
sed -i -e "s|^CONFIG_ISCSI_BOOT_SYSFS=.*$|# CONFIG_ISCSI_BOOT_SYSFS is not set|" $LINUX/.config
sed -i -e "s|^CONFIG_ISCSI_IBFT_FIND=.*$|# CONFIG_ISCSI_IBFT_FIND is not set|" $LINUX/.config
sed -i -e "s|^CONFIG_ISCSI_IBFT=.*$|# CONFIG_ISCSI_IBFT is not set|" $LINUX/.config
fi
# copy some extra firmware to linux tree
cp -R $PKG_DIR/firmware/* $LINUX/firmware
make -C $LINUX oldconfig