모듈 포함하도록 수정
This commit is contained in:
parent
5510415b51
commit
e952eeece7
622
PKGBUILD
622
PKGBUILD
|
@ -7,7 +7,7 @@ pkgname=$pkgbase
|
||||||
# comment the following line to build a single package containing the kernel and the headers
|
# comment the following line to build a single package containing the kernel and the headers
|
||||||
(( 1 )) && pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
|
(( 1 )) && pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
|
||||||
pkgdesc="The Linux Kernel and modules from Linus' git tree"
|
pkgdesc="The Linux Kernel and modules from Linus' git tree"
|
||||||
depends=('coreutils' 'linux-firmware' 'mkinitcpio')
|
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio')
|
||||||
|
|
||||||
pkgver=4.9.rc7
|
pkgver=4.9.rc7
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
|
@ -32,9 +32,9 @@ _gitrev="v4.8.12"
|
||||||
# This PKGBUILD searches for config files in the current directory
|
# This PKGBUILD searches for config files in the current directory
|
||||||
# and will use the first one it finds from the following
|
# and will use the first one it finds from the following
|
||||||
# list as base configuration:
|
# list as base configuration:
|
||||||
# config.local
|
# config.local
|
||||||
# config.saved.$CARCH
|
# config.saved.$CARCH
|
||||||
# config.$CARCH
|
# config.$CARCH
|
||||||
#
|
#
|
||||||
####################################################################
|
####################################################################
|
||||||
|
|
||||||
|
@ -61,7 +61,15 @@ _gitrev="v4.8.12"
|
||||||
#
|
#
|
||||||
# Uncomment desired options
|
# Uncomment desired options
|
||||||
#############################
|
#############################
|
||||||
#_make_modules=0
|
_make_modules=1
|
||||||
|
|
||||||
|
|
||||||
|
#######
|
||||||
|
# Skip the merge of Linus's kernel tree
|
||||||
|
#
|
||||||
|
# _skip_merge=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MAKEFLAGS="-j $(expr $(cat /proc/cpuinfo |grep processor |wc -l) \* 2)"
|
MAKEFLAGS="-j $(expr $(cat /proc/cpuinfo |grep processor |wc -l) \* 2)"
|
||||||
#######
|
#######
|
||||||
|
@ -87,12 +95,29 @@ _config_cmd="${_config_cmd:-menuconfig}"
|
||||||
# _configure_only=1
|
# _configure_only=1
|
||||||
|
|
||||||
|
|
||||||
|
#######
|
||||||
|
# The directory where the kernel should be built
|
||||||
|
#
|
||||||
|
# Can be useful, for example, if you want to compile on a
|
||||||
|
# tmpfs mount, which can speed up the compilation process
|
||||||
|
#
|
||||||
|
#_build_dir="${_build_dir:-$srcdir}"
|
||||||
|
|
||||||
|
|
||||||
#######
|
#######
|
||||||
# Append the date to the localversion
|
# Append the date to the localversion
|
||||||
#
|
#
|
||||||
# e.g. -ARCH -> -ARCH-20090422
|
# e.g. -ARCH -> -ARCH-20090422
|
||||||
#
|
#
|
||||||
# _date_localversion=1
|
_date_localversion=0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#######
|
||||||
|
# Set the pkgver to the kernel version
|
||||||
|
# rather than the build date
|
||||||
|
#
|
||||||
|
# _kernel_pkgver=1
|
||||||
|
|
||||||
|
|
||||||
#######
|
#######
|
||||||
|
@ -105,7 +130,7 @@ _save_config=1
|
||||||
#######
|
#######
|
||||||
# Do not compress kernel modules
|
# Do not compress kernel modules
|
||||||
#
|
#
|
||||||
# _no_modules_compression=1
|
_no_modules_compression=0
|
||||||
|
|
||||||
|
|
||||||
#######
|
#######
|
||||||
|
@ -117,245 +142,250 @@ _save_config=1
|
||||||
# internal variables
|
# internal variables
|
||||||
(( 1 )) && _kernel_src="$pkgname"
|
(( 1 )) && _kernel_src="$pkgname"
|
||||||
#(( 1 )) && _kernel_src="$BUILDDIR/$(find . -maxdepth 1 -type d -name "linux-*" -printf "%f\n" | head -1)"
|
#(( 1 )) && _kernel_src="$BUILDDIR/$(find . -maxdepth 1 -type d -name "linux-*" -printf "%f\n" | head -1)"
|
||||||
|
#(( 1 )) && _kernel_src="$_build_dir/$pkgname_$"
|
||||||
|
|
||||||
|
|
||||||
#######
|
#######
|
||||||
# define required functions
|
# define required functions
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "$_kernel_src"
|
cd "$_kernel_src"
|
||||||
git describe --always | sed 's/^v//;s/-/./g'
|
git describe --always | sed 's/^v//;s/-/./g'
|
||||||
}
|
}
|
||||||
|
|
||||||
# single package
|
# single package
|
||||||
package() {
|
package() {
|
||||||
eval package_$pkgbase-headers
|
eval package_$pkgbase-headers
|
||||||
eval package_$pkgbase
|
eval package_$pkgbase
|
||||||
}
|
}
|
||||||
|
|
||||||
# split package functions
|
# split package functions
|
||||||
eval "package_$pkgbase() { _generic_package_linux; }"
|
eval "package_$pkgbase() { _generic_package_kernel; }"
|
||||||
eval "package_$pkgbase-headers() { _generic_package_linux-headers; }"
|
eval "package_$pkgbase-headers() { _generic_package_kernel-headers; }"
|
||||||
eval "package_$pkgbase-docs() { _generic_package_linux-docs; }"
|
eval "package_$pkgbase-docs() { _generic_package_kernel-docs; }"
|
||||||
|
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# where the magic happens...
|
# where the magic happens...
|
||||||
##############################
|
##############################
|
||||||
build() {
|
build() {
|
||||||
cd "$_kernel_src"
|
cd "$_kernel_src"
|
||||||
msg "Sanitizing source tree.."
|
msg "Sanitizing source tree.."
|
||||||
[[ -n $_gitrev ]] && git reset --hard "$_gitrev"
|
[[ -n $_gitrev ]] && git reset --hard "$_gitrev"
|
||||||
# cleaning source trees
|
# cleaning source trees
|
||||||
git clean -f
|
git clean -f
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# Apply patches
|
# Apply patches
|
||||||
#################
|
#################
|
||||||
msg "Applying patches..."
|
msg "Applying patches..."
|
||||||
local i patches
|
local i patches
|
||||||
for i in "${source[@]}"; do
|
for i in "${source[@]}"; do
|
||||||
i=${i##*/}
|
i=${i##*/}
|
||||||
[[ $i =~ .*\.patch$ ]] && patches=("${patches[@]}" "$srcdir/$i")
|
[[ $i =~ .*\.patch$ ]] && patches=("${patches[@]}" "$srcdir/$i")
|
||||||
[[ ${i%.*} =~ .*\.patch$ ]] && patches=("${patches[@]}" "$srcdir/${i%.*}")
|
[[ ${i%.*} =~ .*\.patch$ ]] && patches=("${patches[@]}" "$srcdir/${i%.*}")
|
||||||
done
|
done
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
for i in "${patches[@]}" "$startdir/patches/"*; do
|
for i in "${patches[@]}" "$startdir/patches/"*; do
|
||||||
msg2 "Applying ${i##*/}..."
|
msg2 "Applying ${i##*/}..."
|
||||||
patch -Np1 -i "$i" || (error "Applying ${i##*/} failed" && return 1)
|
patch -Np1 -i "$i" || (error "Applying ${i##*/} failed" && return 1)
|
||||||
done
|
done
|
||||||
shopt -u nullglob
|
shopt -u nullglob
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
#################
|
#################
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Loading configuration
|
# Loading configuration
|
||||||
#########################
|
#########################
|
||||||
msg "Loading configuration..."
|
msg "Loading configuration..."
|
||||||
for i in local "saved.$CARCH" "$CARCH"; do
|
for i in local "saved.$CARCH" "$CARCH"; do
|
||||||
if [[ -e $startdir/config.$i ]]; then
|
if [[ -e $startdir/config.$i ]]; then
|
||||||
msg2 "Using kernel config file config.$i..."
|
msg2 "Using kernel config file config.$i..."
|
||||||
cp -f "$startdir/config.$i" .config
|
cp -f "$startdir/config.$i" .config
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ ! -e .config ]] &&
|
[[ ! -e .config ]] &&
|
||||||
warning "No suitable kernel config file was found. You'll have to configure the kernel from scratch."
|
warning "No suitable kernel config file was found. You'll have to configure the kernel from scratch."
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Start the configuration
|
# Start the configuration
|
||||||
###########################
|
###########################
|
||||||
msg "Updating configuration..."
|
msg "Updating configuration..."
|
||||||
yes "" | make config > /dev/null
|
yes "" | make config > /dev/null
|
||||||
|
|
||||||
if [[ -f "$startdir/config.saved.$CARCH" ]]; then
|
if [[ -f "$startdir/config.saved.$CARCH" ]]; then
|
||||||
msg2 "migrating previous config..."
|
msg2 "migrating previous config..."
|
||||||
cp "$startdir/config.saved.$CARCH" .config
|
cp "$startdir/config.saved.$CARCH" .config
|
||||||
make oldconfig
|
make oldconfig
|
||||||
else
|
else
|
||||||
msg2 "migrating default config..."
|
msg2 "migrating default config..."
|
||||||
cp "$startdir/config.$CARCH" .config
|
cp "$startdir/config.$CARCH" .config
|
||||||
make oldconfig
|
make oldconfig
|
||||||
fi
|
fi
|
||||||
if [[ -n ${_config_cmd// /} ]]; then
|
if [[ -n ${_config_cmd// /} ]]; then
|
||||||
msg2 "Running make $_config_cmd..."
|
msg2 "Running make $_config_cmd..."
|
||||||
make $_config_cmd
|
make $_config_cmd
|
||||||
else
|
else
|
||||||
warning "Unknown config command: $_config_cmd"
|
warning "Unknown config command: $_config_cmd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# Save the config file the package directory
|
# Save the config file the package directory
|
||||||
##############################################
|
##############################################
|
||||||
if [[ -n $_save_config || -n $_configure_only ]]; then
|
if [[ -n $_save_config || -n $_configure_only ]]; then
|
||||||
msg "Saving configuration..."
|
msg "Saving configuration..."
|
||||||
msg2 "Saving $_kernel_src/.config as $startdir/config.saved.$CARCH"
|
msg2 "Saving $_kernel_src/.config as $startdir/config.saved.$CARCH"
|
||||||
cp .config "$startdir/config.saved.$CARCH"
|
cp .config "$startdir/config.saved.$CARCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Stop after configuration if desired
|
# Stop after configuration if desired
|
||||||
#######################################
|
#######################################
|
||||||
if [[ -n $_configure_only ]]; then
|
if [[ -n $_configure_only ]]; then
|
||||||
rm -rf "$srcdir" "$pkgdir"
|
rm -rf "$_kernel_src" "$srcdir" "$pkgdir"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Append date to localversion
|
# Append date to localversion
|
||||||
###############################
|
###############################
|
||||||
if [[ -n $_date_localversion ]]; then
|
if [[ -n $_date_localversion ]]; then
|
||||||
local _localversion="$(sed -rn 's/^CONFIG_LOCALVERSION="([^"]*)"$/\1/p' .config)"
|
local _localversion="$(sed -rn 's/^CONFIG_LOCALVERSION="([^"]*)"$/\1/p' .config)"
|
||||||
[[ -n $_localversion ]] && msg2 "CONFIG_LOCALVERSION is set to: $_localversion"
|
[[ -n $_localversion ]] && msg2 "CONFIG_LOCALVERSION is set to: $_localversion"
|
||||||
|
|
||||||
# since this is a git package, the $pkgver is equal to $(date +%Y%m%d)
|
# since this is a git package, the $pkgver is equal to $(date +%Y%m%d)
|
||||||
msg2 "Appending $pkgver to CONFIG_LOCALVERSION..."
|
msg2 "Appending $pkgver to CONFIG_LOCALVERSION..."
|
||||||
sed -ri "s/^(CONFIG_LOCALVERSION=).*$/\1\"$_localversion-$pkgver\"/" .config
|
sed -ri "s/^(CONFIG_LOCALVERSION=).*$/\1\"$_localversion-$pkgver\"/" .config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
####################################
|
|
||||||
# Append pkgrel to kernel version
|
|
||||||
####################################
|
|
||||||
sed -ri "s/^(EXTRAVERSION =).*$/\1 -$pkgrel/" Makefile
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
# BUILD PROCESS
|
||||||
|
#################
|
||||||
|
|
||||||
####################################
|
################################
|
||||||
# don't run depmod on 'make install'
|
# Build the kernel and modules
|
||||||
####################################
|
################################
|
||||||
sed -i '2iexit 0' scripts/depmod.sh
|
msg "Building kernel and modules..."
|
||||||
git update-index --assume-unchanged scripts/depmod.sh
|
if [[ -n $_make_modules ]]; then
|
||||||
|
make $MAKEFLAGS V="$_verbose" bzImage modules
|
||||||
|
else
|
||||||
|
make $MAKEFLAGS V="$_verbose" bzImage
|
||||||
|
fi
|
||||||
|
|
||||||
|
############
|
||||||
|
# CLEANUP
|
||||||
|
############
|
||||||
|
|
||||||
#################
|
###################################
|
||||||
# BUILD PROCESS
|
# Copy files from build directory
|
||||||
#################
|
####################################
|
||||||
|
# if (( ! CLEANUP )) && [[ $_build_dir != $srcdir ]]; then
|
||||||
################################
|
# msg "Saving $_kernel_src to $srcdir/${_kernel_src##*/}..."
|
||||||
# Build the kernel and modules
|
# mv "$_kernel_src" "$srcdir"
|
||||||
################################
|
# rm -rf "$_kernel_src"
|
||||||
msg "Building kernel and modules..."
|
# fi
|
||||||
if [[ -n $_make_modules ]]; then
|
|
||||||
make $MAKEFLAGS V="$_verbose" bzImage modules
|
|
||||||
else
|
|
||||||
make $MAKEFLAGS V="$_verbose" bzImage
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_generic_package_initialization() {
|
_generic_package_initialization() {
|
||||||
cd "$srcdir/${_kernel_src##*/}"
|
cd "$_kernel_src"
|
||||||
|
|
||||||
_karch="x86"
|
_karch="x86"
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Get kernel version
|
||||||
|
######################
|
||||||
|
_kernver=$(make kernelrelease)
|
||||||
|
_basekernel=${_kernver%%-*}
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
# Use kernel version instead of the current date as pkgver
|
||||||
|
############################################################
|
||||||
|
if [[ -n $_kernel_pkgver ]]; then
|
||||||
|
pkgver=${_kernver//-/_}
|
||||||
|
msg "Setting pkgver to kernel version: $pkgver"
|
||||||
|
fi
|
||||||
|
|
||||||
######################
|
|
||||||
# Get kernel version
|
|
||||||
######################
|
|
||||||
_kernver=$(make kernelrelease)
|
|
||||||
_basekernver=${_kernver%%-*}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_generic_package_linux() {
|
_generic_package_kernel() {
|
||||||
pkgdesc="The Linux Kernel and modules from Linus' git tree"
|
pkgdesc="The Linux Kernel and modules from Linus' git tree"
|
||||||
backup=(etc/mkinitcpio.d/$pkgname.preset)
|
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio')
|
||||||
install=$pkgname.install
|
backup=(etc/mkinitcpio.d/$pkgname.preset)
|
||||||
changelog=$pkgname.changelog
|
install=$pkgname.install
|
||||||
|
changelog=$pkgname.changelog
|
||||||
|
|
||||||
# set required variables
|
# set required variables
|
||||||
_generic_package_initialization
|
_generic_package_initialization
|
||||||
|
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
# Provide linux
|
# Provide linux
|
||||||
# (probably someone wants to use this kernel exclusively?)
|
# (probably someone wants to use this kernel exclusively?)
|
||||||
#############################################################
|
#############################################################
|
||||||
provides=("${provides[@]}" "linux=${_kernver//-/_}")
|
provides=("${provides[@]}" "linux=${_kernver//-/_}")
|
||||||
|
|
||||||
################
|
################
|
||||||
# INSTALLATION
|
# INSTALLATION
|
||||||
################
|
################
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Install the image
|
# Install the image
|
||||||
#####################
|
#####################
|
||||||
msg "Installing kernel image..."
|
msg "Installing kernel image..."
|
||||||
install -Dm644 arch/$_karch/boot/bzImage "$pkgdir/boot/vmlinuz-$pkgname"
|
install -Dm644 arch/$_karch/boot/bzImage "$pkgdir/boot/vmlinuz-$pkgname"
|
||||||
|
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Install kernel modules
|
# Install kernel modules
|
||||||
##########################
|
##########################
|
||||||
msg "Installing kernel modules..."
|
msg "Installing kernel modules..."
|
||||||
if [[ -n $_make_modules ]]; then
|
if [[ -n $_make_modules ]]; then
|
||||||
# force -j1 to work around make 3.82 bug
|
make INSTALL_MOD_PATH="$pkgdir" modules_install
|
||||||
make -j1 INSTALL_MOD_PATH="$pkgdir/usr" modules_install
|
fi
|
||||||
[[ -z $_no_modules_compression ]] && find "$pkgdir" -name "*.ko" -exec gzip -9 {} +
|
[[ -z $_no_modules_compression ]] && find "$pkgdir" -name "*.ko" -exec gzip -9 {} +
|
||||||
|
|
||||||
#########################################################
|
|
||||||
# Set up extramodules directory (for external modules)
|
|
||||||
#########################################################
|
|
||||||
local extramodules="$pkgdir/usr/lib/modules/extramodules-$(cut -d. -f1,2 <<<$_basekernver)"
|
|
||||||
local modversion=$(grep '^CONFIG_LOCALVERSION=' .config | cut -d'"' -f2)
|
|
||||||
[[ -n $modversion ]] && extramodules+=$modversion
|
|
||||||
install -dm755 "${extramodules}${_pkgext}"
|
|
||||||
echo $_kernver > "${extramodules}${_pkgext}/version"
|
|
||||||
ln -s "../${extramodules##*/}${_pkgext}" "$pkgdir/usr/lib/modules/$_kernver/extramodules"
|
|
||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# Create important symlinks
|
# Create important symlinks
|
||||||
##################################
|
##################################
|
||||||
msg "Creating important symlinks..."
|
msg "Creating important symlinks..."
|
||||||
|
|
||||||
# Create generic modules symlink
|
# Create generic modules symlink
|
||||||
if [[ $_kernver != ${_basekernver}${_pkgext} ]]; then
|
|
||||||
cd "$pkgdir/usr/lib/modules"
|
|
||||||
ln -s "$_kernver" "${_basekernver}${_pkgext}"
|
|
||||||
cd "$OLDPWD"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove header symlinks
|
if [[ $_kernver != ${_basekernel}${_pkgext} ]]; then
|
||||||
cd "$pkgdir/usr/lib/modules/$_kernver"
|
cd "$pkgdir/lib/modules"
|
||||||
rm -rf source build
|
ln -s "$_kernver" "${_basekernel}${_pkgext}"
|
||||||
cd "$OLDPWD"
|
cd "$OLDPWD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
############################
|
# remove header symlinks
|
||||||
# Install mkinitcpio files
|
cd "$pkgdir/lib/modules/$_kernver"
|
||||||
############################
|
rm -rf source build
|
||||||
install -d "$pkgdir/etc/mkinitcpio.d"
|
cd "$OLDPWD"
|
||||||
|
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Install mkinitcpio files
|
||||||
|
############################
|
||||||
|
install -d "$pkgdir/etc/mkinitcpio.d"
|
||||||
|
|
||||||
|
msg "Generating $pkgname.preset..."
|
||||||
|
cat > "$pkgdir/etc/mkinitcpio.d/$pkgname.preset" <<EOF
|
||||||
|
# mkinitcpio preset file for $pkgname
|
||||||
|
|
||||||
msg "Generating $pkgname.preset..."
|
|
||||||
cat > "$pkgdir/etc/mkinitcpio.d/$pkgname.preset" <<EOF
|
|
||||||
# mkinitcpio preset file for the '$pkgname' package
|
|
||||||
|
|
||||||
ALL_config="/etc/mkinitcpio.conf"
|
ALL_config="/etc/mkinitcpio.conf"
|
||||||
ALL_kver="/boot/vmlinuz-$pkgname"
|
ALL_kver="/boot/vmlinuz-$pkgname"
|
||||||
|
@ -368,149 +398,155 @@ COMPRESSION="lz4" # since kernel 2.6.34
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
msg "Generating $pkgname.kver..."
|
||||||
#######################
|
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" \
|
||||||
# Update install file
|
> "$pkgdir/etc/mkinitcpio.d/$pkgname.kver"
|
||||||
#######################
|
|
||||||
msg "Updating install file..."
|
|
||||||
sed -ri "s/^(pkgname=).*$/\1$pkgname/" "$startdir/$pkgname.install"
|
|
||||||
sed -ri "s/^(kernver=).*$/\1$_kernver/" "$startdir/$pkgname.install"
|
|
||||||
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# Remove the firmware
|
#######################
|
||||||
#######################
|
# Update install file
|
||||||
rm -rf "$pkgdir/usr/lib/firmware"
|
#######################
|
||||||
|
msg "Updating install file..."
|
||||||
|
sed -ri "s/^(pkgname=).*$/\1$pkgname/" "$startdir/$pkgname.install"
|
||||||
|
sed -ri "s/^(kernver=).*$/\1$_kernver/" "$startdir/$pkgname.install"
|
||||||
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# Run depmod
|
#######################
|
||||||
#######################
|
# Remove the firmware
|
||||||
if [[ -n $_make_modules ]]; then
|
#######################
|
||||||
depmod -a "$pkgdir/usr"
|
|
||||||
depmod -b "$pkgdir/usr" -F System.map "$_kernver"
|
# remove the firmware
|
||||||
fi
|
rm -rf "${pkgdir}/lib/firmware"
|
||||||
|
# Now we call depmod...
|
||||||
|
depmod -b "${pkgdir}" -F System.map "${_kernver}"
|
||||||
|
|
||||||
|
# move module tree /lib -> /usr/lib
|
||||||
|
mkdir -p "${pkgdir}/usr"
|
||||||
|
mv "${pkgdir}/lib" "${pkgdir}/usr/"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_generic_package_kernel-headers() {
|
||||||
|
pkgdesc="Header files and scripts for building modules for $pkgbase"
|
||||||
|
depends=("$pkgbase")
|
||||||
|
|
||||||
_generic_package_linux-headers() {
|
# set required variables
|
||||||
pkgdesc="Header files and scripts for building modules for $pkgbase"
|
_generic_package_initialization
|
||||||
depends=("$pkgbase")
|
|
||||||
|
|
||||||
# set required variables
|
#############################################################
|
||||||
_generic_package_initialization
|
# Provide linux-headers
|
||||||
|
# (probably someone wants to use this kernel exclusively?)
|
||||||
#############################################################
|
#############################################################
|
||||||
# Provide linux-headers
|
provides=("${provides[@]}" "linux-headers=${_kernver//-/_}")
|
||||||
# (probably someone wants to use this kernel exclusively?)
|
|
||||||
#############################################################
|
|
||||||
provides=("${provides[@]}" "linux-headers=${_kernver//-/_}")
|
|
||||||
|
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# Install fake kernel source
|
# Install fake kernel source
|
||||||
##############################
|
##############################
|
||||||
install -Dm644 Module.symvers "$pkgdir/usr/src/linux-$_kernver/Module.symvers"
|
install -Dm644 Module.symvers "$pkgdir/usr/src/linux-$_kernver/Module.symvers"
|
||||||
install -Dm644 Makefile "$pkgdir/usr/src/linux-$_kernver/Makefile"
|
install -Dm644 Makefile "$pkgdir/usr/src/linux-$_kernver/Makefile"
|
||||||
install -Dm644 kernel/Makefile "$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
|
install -Dm644 kernel/Makefile "$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
|
||||||
install -Dm644 .config "$pkgdir/usr/src/linux-$_kernver/.config"
|
install -Dm644 .config "$pkgdir/usr/lib/modules/$_kernver/.config"
|
||||||
install -Dm644 .config "$pkgdir/usr/lib/modules/$_kernver/.config"
|
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
|
||||||
# Install scripts directory and fix permissions on it
|
#######################################################
|
||||||
#######################################################
|
# Install scripts directory and fix permissions on it
|
||||||
cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
|
#######################################################
|
||||||
|
cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
|
||||||
|
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Install header files
|
# Install header files
|
||||||
##########################
|
##########################
|
||||||
msg "Installing header files..."
|
msg "Installing header files..."
|
||||||
|
|
||||||
for i in net/ipv4/netfilter/ipt_CLUSTERIP.c \
|
for i in net/ipv4/netfilter/ipt_CLUSTERIP.c \
|
||||||
$(find include/ net/mac80211/ drivers/md -iname "*.h") \
|
$(find include/ net/mac80211/ drivers/{md,media/video/} -iname "*.h") \
|
||||||
$(find include/config/ -type f) \
|
$(find include/config/ -type f) \
|
||||||
$(find . -name "Kconfig*")
|
$(find . -name "Kconfig*")
|
||||||
do
|
do
|
||||||
mkdir -p "$pkgdir/usr/src/linux-$_kernver/${i%/*}"
|
mkdir -p "$pkgdir/usr/src/linux-$_kernver/${i%/*}"
|
||||||
cp -af "$i" "$pkgdir/usr/src/linux-$_kernver/$i"
|
cp -af "$i" "$pkgdir/usr/src/linux-$_kernver/$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
# required by virtualbox and probably others
|
# required by virtualbox and probably others
|
||||||
ln -s "../generated/autoconf.h" "$pkgdir/usr/src/linux-$_kernver/include/linux/"
|
ln -s "../generated/autoconf.h" "$pkgdir/usr/src/linux-$_kernver/include/linux/"
|
||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Install architecture dependent files
|
# Install architecture dependent files
|
||||||
########################################
|
########################################
|
||||||
msg "Installing architecture files..."
|
msg "Installing architecture files..."
|
||||||
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/kernel"
|
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/kernel"
|
||||||
cp -a arch/$_karch/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/kernel/"
|
cp -a arch/$_karch/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/kernel/"
|
||||||
|
|
||||||
cp -a arch/$_karch/Makefile* "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
cp -a arch/$_karch/Makefile* "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
||||||
cp -a arch/$_karch/configs "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
cp -a arch/$_karch/configs "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
||||||
|
|
||||||
# copy arch includes for external modules and fix the nVidia issue
|
# copy arch includes for external modules and fix the nVidia issue
|
||||||
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$_karch"
|
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$_karch"
|
||||||
cp -a "arch/$_karch/include" "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
cp -a "arch/$_karch/include" "$pkgdir/usr/src/linux-$_kernver/arch/$_karch/"
|
||||||
|
|
||||||
# create a necessary symlink to the arch folder
|
# create a necessary symlink to the arch folder
|
||||||
cd "$pkgdir/usr/src/linux-$_kernver/arch"
|
cd "$pkgdir/usr/src/linux-$_kernver/arch"
|
||||||
|
|
||||||
if [[ $CARCH = "x86_64" ]]; then
|
if [[ $CARCH = "x86_64" ]]; then
|
||||||
ln -s $_karch x86_64
|
ln -s $_karch x86_64
|
||||||
else
|
else
|
||||||
ln -s $_karch i386
|
ln -s $_karch i386
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$OLDPWD"
|
cd "$OLDPWD"
|
||||||
|
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# Remove unneeded architecures
|
# Remove unneeded architecures
|
||||||
################################
|
################################
|
||||||
msg "Removing unneeded architectures..."
|
msg "Removing unneeded architectures..."
|
||||||
for i in "$pkgdir/usr/src/linux-$_kernver/arch/"*; do
|
for i in "$pkgdir/usr/src/linux-$_kernver/arch/"*; do
|
||||||
[[ ${i##*/} =~ ($_karch|Kconfig) ]] || rm -rf "$i"
|
[[ ${i##*/} =~ ($_karch|Kconfig) ]] || rm -rf "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Remove .gitignore files
|
# Remove .gitignore files
|
||||||
############################
|
############################
|
||||||
msg "Removing .gitignore files from kernel source..."
|
msg "Removing .gitignore files from kernel source..."
|
||||||
find "$pkgdir/usr/src/linux-$_kernver/" -name ".gitignore" -delete
|
find "$pkgdir/usr/src/linux-$_kernver/" -name ".gitignore" -delete
|
||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# Create important symlinks
|
# Create important symlinks
|
||||||
##################################
|
##################################
|
||||||
msg "Creating important symlinks..."
|
msg "Creating important symlinks..."
|
||||||
|
|
||||||
# the build symlink needs to be relative
|
# the build symlink needs to be relative
|
||||||
cd "$pkgdir/usr/lib/modules/$_kernver"
|
cd "$pkgdir/usr/lib/modules/$_kernver"
|
||||||
rm -rf source build
|
rm -rf source build
|
||||||
ln -s "/usr/src/linux-$_kernver" build
|
ln -s "/usr/src/linux-$_kernver" build
|
||||||
cd "$OLDPWD"
|
cd "$OLDPWD"
|
||||||
|
|
||||||
if [[ $_kernver != ${_basekernver}${_pkgext} ]]; then
|
if [[ $_kernver != ${_basekernver}${_pkgext} ]]; then
|
||||||
cd "$pkgdir/usr/src"
|
cd "$pkgdir/usr/src"
|
||||||
ln -s "linux-$_kernver" "linux-${_basekernver}${_pkgext}"
|
ln -s "linux-$_kernver" "linux-${_basekernel}${_pkgext}"
|
||||||
cd "$OLDPWD"
|
cd "$OLDPWD"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_generic_package_linux-docs() {
|
_generic_package_kernel-docs() {
|
||||||
pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
|
pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
|
||||||
depends=("$pkgbase")
|
depends=("$pkgbase")
|
||||||
|
|
||||||
# set required variables
|
# set required variables
|
||||||
_generic_package_initialization
|
_generic_package_initialization
|
||||||
|
|
||||||
mkdir -p "$pkgdir/usr/src/linux-$_kernver"
|
mkdir -p "$pkgdir/usr/src/linux-$_kernver"
|
||||||
cp -aL Documentation "$pkgdir/usr/src/linux-$_kernver/"
|
cp -a Documentation "$pkgdir/usr/src/linux-$_kernver/"
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: set fenc=utf-8 ts=2 sw=2 noet:
|
# vim: set fenc=utf-8 ts=2 sw=2 noet:
|
||||||
|
|
||||||
|
|
1415
config.saved.x86_64
1415
config.saved.x86_64
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
pkgname=linux-spica
|
pkgname=linux-spica
|
||||||
kernver=4.8.12-1spica-dirty
|
kernver=4.8.12spica-4.9.rc7-dirty
|
||||||
#bootdevice="BOOT_IMAGE=/boot/vmlinuz-$pkgname root=UUID=d670564f-2cb3-4981-9d51-6ed9c1327d47"
|
#bootdevice="BOOT_IMAGE=/boot/vmlinuz-$pkgname root=UUID=d670564f-2cb3-4981-9d51-6ed9c1327d47"
|
||||||
#option="rw quiet clocksource=hpet initrd=EFI/spi-ca/initrd intel_iommu=on pci-stub.ids=1002:683f,1002:aab0 vfio_iommu_type1.allow_unsafe_interrupts=1,kvm.ignore_msrs=1"
|
#option="rw quiet clocksource=hpet initrd=EFI/spi-ca/initrd intel_iommu=on pci-stub.ids=1002:683f,1002:aab0 vfio_iommu_type1.allow_unsafe_interrupts=1,kvm.ignore_msrs=1"
|
||||||
#option="rw quiet clocksource=hpet initrd=EFI/spi-ca/initrd quiet intremap=no_x2apic_optout zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4"
|
#option="rw quiet clocksource=hpet initrd=EFI/spi-ca/initrd quiet intremap=no_x2apic_optout zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4"
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
--- a/drivers/platform/x86/apple-gmux.c
|
||||||
|
+++ a/drivers/platform/x86/apple-gmux.c
|
||||||
|
@@ -419,6 +419,7 @@ static int gmux_resume(struct device *dev)
|
||||||
|
|
||||||
|
static struct pci_dev *gmux_get_io_pdev(void)
|
||||||
|
{
|
||||||
|
+ struct pci_dev *igp = NULL, *dgp = NULL;
|
||||||
|
struct pci_dev *pdev = NULL;
|
||||||
|
|
||||||
|
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev))) {
|
||||||
|
@@ -428,10 +429,18 @@ static struct pci_dev *gmux_get_io_pdev(void)
|
||||||
|
if (!(cmd & PCI_COMMAND_IO))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- return pdev;
|
||||||
|
+ if (pdev->bus && pdev->bus->number > 0 && !dgp)
|
||||||
|
+ dgp = pci_dev_get(pdev);
|
||||||
|
+ else if (pdev->bus && pdev->bus->number == 0 && !igp)
|
||||||
|
+ igp = pci_dev_get(pdev);
|
||||||
|
}
|
||||||
|
|
||||||
|
- return NULL;
|
||||||
|
+ if (dgp && !igp)
|
||||||
|
+ pr_warn("Found only discrete GPU %s, integrated GPU is hidden,"
|
||||||
|
+ " unable to protect backlight behind VGA IO",
|
||||||
|
+ pci_name(dgp));
|
||||||
|
+ pci_dev_put(dgp);
|
||||||
|
+ return igp;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- linux-3.16/include/linux/printk.h.old 2014-08-04 18:48:30.686043266 +0200
|
||||||
|
+++ linux-3.16/include/linux/printk.h 2014-08-04 18:48:47.706218528 +0200
|
||||||
|
@@ -37,7 +37,7 @@
|
||||||
|
#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
|
||||||
|
#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
|
||||||
|
#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
|
||||||
|
-#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
|
||||||
|
+#define CONSOLE_LOGLEVEL_DEFAULT 4 /* anything MORE serious than KERN_DEBUG */
|
||||||
|
#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
|
||||||
|
#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
--- linux-4.8/drivers/cpufreq/intel_pstate.c.orig 2016-10-02 19:24:33.000000000 -0400
|
||||||
|
+++ linux-4.8/drivers/cpufreq/intel_pstate.c 2016-10-09 19:32:01.073141319 -0400
|
||||||
|
@@ -181,6 +181,8 @@
|
||||||
|
* @cpu: CPU number for this instance data
|
||||||
|
* @update_util: CPUFreq utility callback information
|
||||||
|
* @update_util_set: CPUFreq utility callback is set
|
||||||
|
+ * @iowait_boost: iowait-related boost fraction
|
||||||
|
+ * @last_update: Time of the last update.
|
||||||
|
* @pstate: Stores P state limits for this CPU
|
||||||
|
* @vid: Stores VID limits for this CPU
|
||||||
|
* @pid: Stores PID parameters for this CPU
|
||||||
|
@@ -206,6 +208,7 @@
|
||||||
|
struct vid_data vid;
|
||||||
|
struct _pid pid;
|
||||||
|
|
||||||
|
+ u64 last_update;
|
||||||
|
u64 last_sample_time;
|
||||||
|
u64 prev_aperf;
|
||||||
|
u64 prev_mperf;
|
||||||
|
@@ -216,6 +219,7 @@
|
||||||
|
struct acpi_processor_performance acpi_perf_data;
|
||||||
|
bool valid_pss_table;
|
||||||
|
#endif
|
||||||
|
+ unsigned int iowait_boost;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct cpudata **all_cpu_data;
|
||||||
|
@@ -229,6 +233,7 @@
|
||||||
|
* @p_gain_pct: PID proportional gain
|
||||||
|
* @i_gain_pct: PID integral gain
|
||||||
|
* @d_gain_pct: PID derivative gain
|
||||||
|
+ * @boost_iowait: Whether or not to use iowait boosting.
|
||||||
|
*
|
||||||
|
* Stores per CPU model static PID configuration data.
|
||||||
|
*/
|
||||||
|
@@ -240,6 +245,7 @@
|
||||||
|
int p_gain_pct;
|
||||||
|
int d_gain_pct;
|
||||||
|
int i_gain_pct;
|
||||||
|
+ bool boost_iowait;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -1029,7 +1035,7 @@
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct cpu_defaults silvermont_params = {
|
||||||
|
+static const struct cpu_defaults silvermont_params = {
|
||||||
|
.pid_policy = {
|
||||||
|
.sample_rate_ms = 10,
|
||||||
|
.deadband = 0,
|
||||||
|
@@ -1037,6 +1043,7 @@
|
||||||
|
.p_gain_pct = 14,
|
||||||
|
.d_gain_pct = 0,
|
||||||
|
.i_gain_pct = 4,
|
||||||
|
+ .boost_iowait = true,
|
||||||
|
},
|
||||||
|
.funcs = {
|
||||||
|
.get_max = atom_get_max_pstate,
|
||||||
|
@@ -1050,7 +1057,7 @@
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct cpu_defaults airmont_params = {
|
||||||
|
+static const struct cpu_defaults airmont_params = {
|
||||||
|
.pid_policy = {
|
||||||
|
.sample_rate_ms = 10,
|
||||||
|
.deadband = 0,
|
||||||
|
@@ -1058,6 +1065,7 @@
|
||||||
|
.p_gain_pct = 14,
|
||||||
|
.d_gain_pct = 0,
|
||||||
|
.i_gain_pct = 4,
|
||||||
|
+ .boost_iowait = true,
|
||||||
|
},
|
||||||
|
.funcs = {
|
||||||
|
.get_max = atom_get_max_pstate,
|
||||||
|
@@ -1071,7 +1079,7 @@
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct cpu_defaults knl_params = {
|
||||||
|
+static const struct cpu_defaults knl_params = {
|
||||||
|
.pid_policy = {
|
||||||
|
.sample_rate_ms = 10,
|
||||||
|
.deadband = 0,
|
||||||
|
@@ -1091,7 +1099,7 @@
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct cpu_defaults bxt_params = {
|
||||||
|
+static const struct cpu_defaults bxt_params = {
|
||||||
|
.pid_policy = {
|
||||||
|
.sample_rate_ms = 10,
|
||||||
|
.deadband = 0,
|
||||||
|
@@ -1099,6 +1107,7 @@
|
||||||
|
.p_gain_pct = 14,
|
||||||
|
.d_gain_pct = 0,
|
||||||
|
.i_gain_pct = 4,
|
||||||
|
+ .boost_iowait = true,
|
||||||
|
},
|
||||||
|
.funcs = {
|
||||||
|
.get_max = core_get_max_pstate,
|
||||||
|
@@ -1222,36 +1231,18 @@
|
||||||
|
static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
|
||||||
|
{
|
||||||
|
struct sample *sample = &cpu->sample;
|
||||||
|
- u64 cummulative_iowait, delta_iowait_us;
|
||||||
|
- u64 delta_iowait_mperf;
|
||||||
|
- u64 mperf, now;
|
||||||
|
- int32_t cpu_load;
|
||||||
|
+ int32_t busy_frac, boost;
|
||||||
|
|
||||||
|
- cummulative_iowait = get_cpu_iowait_time_us(cpu->cpu, &now);
|
||||||
|
+ busy_frac = div_fp(sample->mperf, sample->tsc);
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * Convert iowait time into number of IO cycles spent at max_freq.
|
||||||
|
- * IO is considered as busy only for the cpu_load algorithm. For
|
||||||
|
- * performance this is not needed since we always try to reach the
|
||||||
|
- * maximum P-State, so we are already boosting the IOs.
|
||||||
|
- */
|
||||||
|
- delta_iowait_us = cummulative_iowait - cpu->prev_cummulative_iowait;
|
||||||
|
- delta_iowait_mperf = div64_u64(delta_iowait_us * cpu->pstate.scaling *
|
||||||
|
- cpu->pstate.max_pstate, MSEC_PER_SEC);
|
||||||
|
-
|
||||||
|
- mperf = cpu->sample.mperf + delta_iowait_mperf;
|
||||||
|
- cpu->prev_cummulative_iowait = cummulative_iowait;
|
||||||
|
+ boost = cpu->iowait_boost;
|
||||||
|
+ cpu->iowait_boost >>= 1;
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * The load can be estimated as the ratio of the mperf counter
|
||||||
|
- * running at a constant frequency during active periods
|
||||||
|
- * (C0) and the time stamp counter running at the same frequency
|
||||||
|
- * also during C-states.
|
||||||
|
- */
|
||||||
|
- cpu_load = div64_u64(int_tofp(100) * mperf, sample->tsc);
|
||||||
|
- cpu->sample.busy_scaled = cpu_load;
|
||||||
|
+ if (busy_frac < boost)
|
||||||
|
+ busy_frac = boost;
|
||||||
|
|
||||||
|
- return get_avg_pstate(cpu) - pid_calc(&cpu->pid, cpu_load);
|
||||||
|
+ sample->busy_scaled = busy_frac * 100;
|
||||||
|
+ return get_avg_pstate(cpu) - pid_calc(&cpu->pid, sample->busy_scaled);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
|
|
@ -0,0 +1,123 @@
|
||||||
|
--- linux_for_test.orig/scripts/mod/modpost.c 2016-04-21 17:01:42.917757676 +0800
|
||||||
|
+++ linux_for_test.orig/scripts/mod/modpost.c 2016-05-29 13:32:41.266916072 +0800
|
||||||
|
@@ -877,6 +877,7 @@
|
||||||
|
|
||||||
|
#define ALL_PCI_INIT_SECTIONS \
|
||||||
|
".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \
|
||||||
|
+ ".pci_fixup_assign", \
|
||||||
|
".pci_fixup_enable", ".pci_fixup_resume", \
|
||||||
|
".pci_fixup_resume_early", ".pci_fixup_suspend"
|
||||||
|
|
||||||
|
--- linux_for_test.orig/include/asm-generic/vmlinux.lds.h 2016-05-18 13:14:13.970951863 +0800
|
||||||
|
+++ linux_for_test.orig/include/asm-generic/vmlinux.lds.h 2016-05-29 13:32:24.870916334 +0800
|
||||||
|
@@ -283,6 +283,9 @@
|
||||||
|
VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
|
||||||
|
*(.pci_fixup_final) \
|
||||||
|
VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
|
||||||
|
+ VMLINUX_SYMBOL(__start_pci_fixups_assign) = .; \
|
||||||
|
+ *(.pci_fixup_assign) \
|
||||||
|
+ VMLINUX_SYMBOL(__end_pci_fixups_assign) = .; \
|
||||||
|
VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
|
||||||
|
*(.pci_fixup_enable) \
|
||||||
|
VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
|
||||||
|
--- linux_for_test.orig/include/linux/pci.h 2016-05-29 12:51:02.000000000 +0800
|
||||||
|
+++ linux_for_test.orig/include/linux/pci.h 2016-05-29 13:39:20.926909684 +0800
|
||||||
|
@@ -1584,6 +1584,7 @@
|
||||||
|
pci_fixup_early, /* Before probing BARs */
|
||||||
|
pci_fixup_header, /* After reading configuration header */
|
||||||
|
pci_fixup_final, /* Final phase of device fixups */
|
||||||
|
+ pci_fixup_assign, /* Before resource assignment */
|
||||||
|
pci_fixup_enable, /* pci_enable_device() time */
|
||||||
|
pci_fixup_resume, /* pci_device_resume() */
|
||||||
|
pci_fixup_suspend, /* pci_device_suspend() */
|
||||||
|
@@ -1644,6 +1645,9 @@
|
||||||
|
#define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \
|
||||||
|
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \
|
||||||
|
hook, vendor, device, PCI_ANY_ID, 0, hook)
|
||||||
|
+#define DECLARE_PCI_FIXUP_ASSIGN(vendor, device, hook) \
|
||||||
|
+ DECLARE_PCI_FIXUP_SECTION(.pci_fixup_assign, \
|
||||||
|
+ hook, vendor, device, PCI_ANY_ID, 0, hook)
|
||||||
|
#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \
|
||||||
|
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
|
||||||
|
hook, vendor, device, PCI_ANY_ID, 0, hook)
|
||||||
|
--- linux_for_test.orig/drivers/pci/quirks.c 2016-05-27 13:20:01.114516646 +0800
|
||||||
|
+++ linux_for_test.orig/drivers/pci/quirks.c 2016-05-29 16:07:58.230767144 +0800
|
||||||
|
@@ -3370,6 +3370,8 @@
|
||||||
|
extern struct pci_fixup __end_pci_fixups_header[];
|
||||||
|
extern struct pci_fixup __start_pci_fixups_final[];
|
||||||
|
extern struct pci_fixup __end_pci_fixups_final[];
|
||||||
|
+extern struct pci_fixup __start_pci_fixups_assign[];
|
||||||
|
+extern struct pci_fixup __end_pci_fixups_assign[];
|
||||||
|
extern struct pci_fixup __start_pci_fixups_enable[];
|
||||||
|
extern struct pci_fixup __end_pci_fixups_enable[];
|
||||||
|
extern struct pci_fixup __start_pci_fixups_resume[];
|
||||||
|
@@ -3405,6 +3407,11 @@
|
||||||
|
end = __end_pci_fixups_final;
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case pci_fixup_assign:
|
||||||
|
+ start = __start_pci_fixups_assign;
|
||||||
|
+ end = __end_pci_fixups_assign;
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case pci_fixup_enable:
|
||||||
|
start = __start_pci_fixups_enable;
|
||||||
|
end = __end_pci_fixups_enable;
|
||||||
|
@@ -4419,3 +4426,30 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x443, quirk_intel_qat_vf_cap);
|
||||||
|
+
|
||||||
|
+static int disable_mode;
|
||||||
|
+/* On Mac Pro 11, mem allocation broke ACPI Sleep Type register region. */
|
||||||
|
+static void quirk_disable_mmio_bar(struct pci_dev *dev)
|
||||||
|
+{
|
||||||
|
+ struct resource *b_res;
|
||||||
|
+
|
||||||
|
+ dev_info(&dev->dev, "[Quirk] Disable mmio regions for Mac Pro 11\n");
|
||||||
|
+ if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ b_res = &dev->resource[PCI_BRIDGE_RESOURCES];
|
||||||
|
+ b_res[1].flags = 0;
|
||||||
|
+
|
||||||
|
+ if (disable_mode & 1) {
|
||||||
|
+ b_res[2].flags = 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
+DECLARE_PCI_FIXUP_ASSIGN(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_disable_mmio_bar);
|
||||||
|
+
|
||||||
|
+static int __init parse_disable_mode(char *str)
|
||||||
|
+{
|
||||||
|
+ get_option(&str, &disable_mode);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+early_param("disable_mode", parse_disable_mode);
|
||||||
|
--- linux_for_test.orig/drivers/pci/setup-bus.c 2016-05-29 12:26:08.000000000 +0800
|
||||||
|
+++ linux_for_test.orig/drivers/pci/setup-bus.c 2016-05-29 13:58:36.086891219 +0800
|
||||||
|
@@ -1256,6 +1256,8 @@
|
||||||
|
additional_io_size = pci_hotplug_io_size;
|
||||||
|
additional_mem_size = pci_hotplug_mem_size;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ pci_fixup_device(pci_fixup_assign, bus->self);
|
||||||
|
/* Fall through */
|
||||||
|
default:
|
||||||
|
pbus_size_io(bus, realloc_head ? 0 : additional_io_size,
|
||||||
|
--- a/drivers/pci/quirks.c
|
||||||
|
+++ b/drivers/pci/quirks.c
|
||||||
|
@@ -2775,6 +2775,13 @@ static void quirk_hotplug_bridge(struct pci_dev *dev)
|
||||||
|
|
||||||
|
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HINT, 0x0020, quirk_hotplug_bridge);
|
||||||
|
|
||||||
|
+static void quirk_hotplug_bridge_skip(struct pci_dev *dev)
|
||||||
|
+{
|
||||||
|
+ dev->is_hotplug_bridge = 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_hotplug_bridge_skip);
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* This is a quirk for the Ricoh MMC controller found as a part of
|
||||||
|
* some mulifunction chips.
|
|
@ -0,0 +1,32 @@
|
||||||
|
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|
||||||
|
index 37ff015..47b303a 100644
|
||||||
|
--- a/drivers/pci/quirks.c
|
||||||
|
+++ b/drivers/pci/quirks.c
|
||||||
|
@@ -2776,6 +2776,27 @@ static void quirk_hotplug_bridge(struct pci_dev *dev)
|
||||||
|
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HINT, 0x0020, quirk_hotplug_bridge);
|
||||||
|
|
||||||
|
/*
|
||||||
|
+ * Apple: Avoid programming the memory/io aperture of 00:1c.0
|
||||||
|
+ *
|
||||||
|
+ * BIOS does not declare any resource for 00:1c.0, but with
|
||||||
|
+ * hotplug flag set, thus OS allocate:
|
||||||
|
+ * [mem 0x7fa00000 - 0x7fbfffff]
|
||||||
|
+ * [mem 0x7fc00000-0x7fdfffff 64bit pref]
|
||||||
|
+ * which is conflict with an unreported device, which
|
||||||
|
+ * causes unpredictable result such as accessing io port.
|
||||||
|
+ * So clear the hotplug flag to work around it.
|
||||||
|
+ */
|
||||||
|
+static void quirk_apple_mbp_poweroff(struct pci_dev *dev)
|
||||||
|
+{
|
||||||
|
+ if (dmi_match(DMI_BOARD_VENDOR, "Apple Inc.") &&
|
||||||
|
+ dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,4") ||
|
||||||
|
+ dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,5"))
|
||||||
|
+ dev->is_hotplug_bridge = 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_apple_mbp_poweroff);
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
* This is a quirk for the Ricoh MMC controller found as a part of
|
||||||
|
* some mulifunction chips.
|
||||||
|
|
Loading…
Reference in New Issue