You are not logged in.

#1 2010-09-27 19:27:33

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

(SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

I'm trying to add my own Live kernel to AUR
it is kernel 2.6.35.6 patched with Tuxonice, BFS, BFQ, Aufs2 and squashfs-lzma

however, when I do  "makepkg --source"
it fails saying

PKGBUILD: line 34: syntax error near unexpected token `('

heres my PKGBUILD; mostly taken from the AUR's kernel26-pf PKGBUILD

# Original PKGBUILD from kernel26-pf
# Maintainer: <thepenandpaper at gmail dot com>

_basekernel=2.6.35
_pkgname=kernel26-livez
_pfrel=1
pkgname=kernel26-livez
pkgver=${_basekernel}
pkgrel=${_pfrel}
_kernelname=-livez
arch=(i686 x86_64)
_pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
pkgdesc=${_pkgdesc}
license=('GPL2')
groups=('base')
backup=(etc/mkinitcpio.d/${_pkgname}.preset)
depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country'
        'pm-utils: utilities and scripts for suspend and hibernate power management'
        'tuxonice-userui: TuxOnIce userspace user interface'
        'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
          'alsa-driver' 'ieee80211' 'hostap-driver26'
          'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
          'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
          'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
install='kernel26.install'
source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset            # standard config files for mkinitcpio ramdisk
sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e'
provides=(${_pkgname}=${_basekernel})            # for $pkgname-optimized
#provides=('kernel26-headers' 'kernel26=$pkgver')    # for when you have no other kernel (which is a bad idea anyway)

build() {
   KARCH=x86
   cd ${srcdir}/linux-${_basekernel}
   bzip2 -dk ${startdir}/logo_linux_*.bz2
   mv -f ${startdir}/logo_linux_*.p?m drivers/video/logo/
   bzip2 -dc ${srcdir}/${_pfpatchname} | patch -Np1
   patch -Np1 < ${srcdir}/aufs2-sqlzma.patch
   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
   if [ "$CARCH" = "x86_64" ]; then
      cat ../config.x86_64 >./.config
   else
      cat ../config >./.config
   fi
   _arch=$CARCH
   echo
   echo "==================================================="
   echo "You might be prompted below for some config options"
   echo "==================================================="
   echo
   echo "Do you want to use your running kernel's config? (y/N)"
   echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
   echo " as root before hitting <Y>, if uncertain)"
   read answer
   shopt -s nocasematch
   if [[ "$answer" = "y" ]]; then
      if [[ -s /proc/config.gz ]]; then
         echo "Extracting config from /proc/config.gz..."
         modprobe configs
         zcat /proc/config.gz > ./.config
      else
         echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
      fi
   fi
   if [ "${_kernelname}" != "" ]; then
      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
   fi
   # Make some good use of MAKEFLAGS
   MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
   # get kernel version
   make ${MAKEFLAGS} prepare

   # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
   # make localmodconfig

   # allows you to edit config
   # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"

   # load configuration
   # yes "" | make config

   # This allows building cpu-optimized packages with according package names.
   # Useful for repo maintainers.
   CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
   case $CPU in
    CORE2)
        pkgname="${_pkgname}-core2"
        pkgdesc="${_pkgdesc} Intel Core2 optimized."
        ;;
    K8)
        pkgname="${_pkgname}-k8"
        pkgdesc="${_pkgdesc} AMD K8 optimized."
        ;;
    PSC)
        pkgname="${_pkgname}-psc"
        pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
        ;;
    ATOM)
        pkgname="${_pkgname}-atom"
        pkgdesc="${_pkgdesc} Intel Atom optimized."
        ;;
    K7)
        pkgname="${_pkgname}-k7"
        pkgdesc="${_pkgdesc} AMD K7 optimized."
        ;;
    PENTIUMII)
        pkgname="${_pkgname}-p3"
        pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
        ;;
    PENTIUMIII)
        pkgname="${_pkgname}-p2"
        pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
        ;;
    PENTIUMM)
        pkgname="${_pkgname}-pm"
        pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
        ;;
    PENTIUM4)
        pkgname="${_pkgname}-p4"
        pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
        ;;
    default)
        pkgname="${_pkgname}"
        pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
        ;;
  esac

   # build!
   _kernver="$(make kernelrelease)"
   make ${MAKEFLAGS} bzImage modules

   ### package_kernel26
   mkdir -p ${pkgdir}/{lib/modules,boot}
   make INSTALL_MOD_PATH=${pkgdir} modules_install

   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}

   # add vmlinux
   # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux

   # install fallback mkinitcpio.conf file and preset file for kernel
   install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   # set correct depmod command for install
   sed \
      -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
      -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
      -i ${startdir}/kernel26.install
   sed \
      -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
      -e "s|default_image=.*|default_image=\"/boot/${_pkgname}.img\"|g" \
      -e "s|fallback_image=.*|fallback_image=\"/boot/${_pkgname}-fallback.img\"|g" \
      -i ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.kver

   ### package_kernel26-headers

   install -D -m644 Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Makefile
   install -D -m644 kernel/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
   install -D -m644 .config \
      ${pkgdir}/usr/src/linux-${_kernver}/.config

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
      cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
   done

   # copy arch includes for external modules
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/

   # copy files necessary for later builds, like nvidia and vmware
   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}

   # fix permissions on scripts dir
   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel

   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   if [ "$CARCH" = "i686" ]; then
      cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   fi
   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/

   # add headers for lirc package
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
      cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
   done

   # add docbook makefile
   install -D -m644 Documentation/DocBook/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile

   # add dm headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md

   # add inotify.h
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/

   # add wireless headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/9912
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/11194
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
   [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/

   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
   # in reference to:
   # http://bugs.archlinux.org/task/13146
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/

   # add xfs and shmem for aufs building
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h

   # add headers for virtualbox
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/

   # add headers for broadcom wl
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/

   # copy in Kconfig files
   for i in `find . -name "Kconfig*"`; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
      cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
   done

   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
   cd ${pkgdir}/lib/modules/${_kernver} && \
      (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)

   # remove unneeded architectures
   rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
   # remove the firmware
   rm -rf ${pkgdir}/lib/firmware
}

# eof

line #34 is the sha256sum line

heres the contents of the source folder "kernel26-livez"
config
config.x86_64
kernel26.install
kernel26.preset
PKGBUILD

can anyone tell me whats wrong,etc?
I reall hate the syntax error issues as no matter how I have edited it, the same error?
thanks

Last edited by 72linus (2010-09-30 00:08:28)

Offline

#2 2010-09-27 19:33:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

Are you sure you've closed all the parens?

I think the source and sha256sums are missing theirs.

Last edited by karol (2010-09-27 19:35:16)

Offline

#3 2010-09-27 19:55:48

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

ok
you mean put a ) at the end,etc?
after doing that it says

[bryan@nflux kernel26-livez]$ makepkg --source
/kernel26-livez/PKGBUILD: line 32: config: command not found

==> ERROR: An unknown error has occurred. Exiting...

what is the issue?
the kernel26-pf, which this PKGBUILD is based off of
doesnt have these issues...

Offline

#4 2010-09-27 19:59:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

72linus wrote:

ok
you mean put a ) at the end,etc?
after doing that it says

[bryan@nflux kernel26-livez]$ makepkg --source
/kernel26-livez/PKGBUILD: line 32: config: command not found

==> ERROR: An unknown error has occurred. Exiting...

what is the issue?
the kernel26-pf, which this PKGBUILD is based off of
doesnt have these issues...

Have you put a closing parenthesis at line 33? Double check (preferably with vim or some other great editor) and post that PKGBUILD again.
The kernel26-pf PKGBUILD is well-formated.

Last edited by karol (2010-09-27 20:01:30)

Offline

#5 2010-09-27 20:10:23

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,071

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset            # standard config files for mkinitcpio ramdisk
sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e'

That's your problem right there. You need to close the parentheses on both the source and sha256sums lines.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2010-09-27 20:12:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

Inxsible wrote:
sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e'

That's your problem right there. You need to close the parentheses

I think he already fixed it, but needs another one

source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset            # standard config files for mkinitcpio ramdisk

after 'kernel26.preset'.

Edit: Inxsible, I don't love you anymore ;P

Last edited by karol (2010-09-27 20:13:03)

Offline

#7 2010-09-27 20:24:04

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

yep
thanks guys I got it!

PKGBUILD

# Original PKGBUILD from kernel26-pf
# Maintainer: <thepenandpaper at gmail dot com>

_basekernel=2.6.35
_pkgname=kernel26-livez
_pfrel=1
pkgname=kernel26-livez
pkgver=${_basekernel}
pkgrel=${_pfrel}
_kernelname=-livez
arch=(i686 x86_64)
_pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
pkgdesc=${_pkgdesc}
license=('GPL2')
groups=('base')
backup=(etc/mkinitcpio.d/${_pkgname}.preset)
depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country'
        'pm-utils: utilities and scripts for suspend and hibernate power management'
        'tuxonice-userui: TuxOnIce userspace user interface'
        'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
          'alsa-driver' 'ieee80211' 'hostap-driver26'
          'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
          'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
          'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
install='kernel26.install'
source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset)            # standard config files for mkinitcpio ramdisk
sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e')
provides=(${_pkgname}=${_basekernel})            # for $pkgname-optimized
#provides=('kernel26-headers' 'kernel26=$pkgver')    # for when you have no other kernel (which is a bad idea anyway)

build() {
   KARCH=x86
   cd ${srcdir}/linux-${_basekernel}
   bzip2 -dk ${startdir}/logo_linux_*.bz2
   mv -f ${startdir}/logo_linux_*.p?m drivers/video/logo/
   bzip2 -dc ${srcdir}/${_pfpatchname} | patch -Np1
   patch -Np1 < ${srcdir}/aufs2-sqlzma.patch
   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
   if [ "$CARCH" = "x86_64" ]; then
      cat ../config.x86_64 >./.config
   else
      cat ../config >./.config
   fi
   _arch=$CARCH
   echo
   echo "==================================================="
   echo "You might be prompted below for some config options"
   echo "==================================================="
   echo
   echo "Do you want to use your running kernel's config? (y/N)"
   echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
   echo " as root before hitting <Y>, if uncertain)"
   read answer
   shopt -s nocasematch
   if [[ "$answer" = "y" ]]; then
      if [[ -s /proc/config.gz ]]; then
         echo "Extracting config from /proc/config.gz..."
         modprobe configs
         zcat /proc/config.gz > ./.config
      else
         echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
      fi
   fi
   if [ "${_kernelname}" != "" ]; then
      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
   fi
   # Make some good use of MAKEFLAGS
   MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
   # get kernel version
   make ${MAKEFLAGS} prepare

   # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
   # make localmodconfig

   # allows you to edit config
   # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"

   # load configuration
   # yes "" | make config

   # This allows building cpu-optimized packages with according package names.
   # Useful for repo maintainers.
   CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
   case $CPU in
    CORE2)
        pkgname="${_pkgname}-core2"
        pkgdesc="${_pkgdesc} Intel Core2 optimized."
        ;;
    K8)
        pkgname="${_pkgname}-k8"
        pkgdesc="${_pkgdesc} AMD K8 optimized."
        ;;
    PSC)
        pkgname="${_pkgname}-psc"
        pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
        ;;
    ATOM)
        pkgname="${_pkgname}-atom"
        pkgdesc="${_pkgdesc} Intel Atom optimized."
        ;;
    K7)
        pkgname="${_pkgname}-k7"
        pkgdesc="${_pkgdesc} AMD K7 optimized."
        ;;
    PENTIUMII)
        pkgname="${_pkgname}-p3"
        pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
        ;;
    PENTIUMIII)
        pkgname="${_pkgname}-p2"
        pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
        ;;
    PENTIUMM)
        pkgname="${_pkgname}-pm"
        pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
        ;;
    PENTIUM4)
        pkgname="${_pkgname}-p4"
        pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
        ;;
    default)
        pkgname="${_pkgname}"
        pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
        ;;
  esac

   # build!
   _kernver="$(make kernelrelease)"
   make ${MAKEFLAGS} bzImage modules

   ### package_kernel26
   mkdir -p ${pkgdir}/{lib/modules,boot}
   make INSTALL_MOD_PATH=${pkgdir} modules_install

   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}

   # add vmlinux
   # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux

   # install fallback mkinitcpio.conf file and preset file for kernel
   install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   # set correct depmod command for install
   sed \
      -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
      -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
      -i ${startdir}/kernel26.install
   sed \
      -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
      -e "s|default_image=.*|default_image=\"/boot/${_pkgname}.img\"|g" \
      -e "s|fallback_image=.*|fallback_image=\"/boot/${_pkgname}-fallback.img\"|g" \
      -i ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.kver

   ### package_kernel26-headers

   install -D -m644 Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Makefile
   install -D -m644 kernel/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
   install -D -m644 .config \
      ${pkgdir}/usr/src/linux-${_kernver}/.config

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
      cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
   done

   # copy arch includes for external modules
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/

   # copy files necessary for later builds, like nvidia and vmware
   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}

   # fix permissions on scripts dir
   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel

   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   if [ "$CARCH" = "i686" ]; then
      cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   fi
   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/

   # add headers for lirc package
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
      cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
   done

   # add docbook makefile
   install -D -m644 Documentation/DocBook/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile

   # add dm headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md

   # add inotify.h
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/

   # add wireless headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/9912
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/11194
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
   [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/

   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
   # in reference to:
   # http://bugs.archlinux.org/task/13146
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/

   # add xfs and shmem for aufs building
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h

   # add headers for virtualbox
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/

   # add headers for broadcom wl
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/

   # copy in Kconfig files
   for i in `find . -name "Kconfig*"`; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
      cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
   done

   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
   cd ${pkgdir}/lib/modules/${_kernver} && \
      (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)

   # remove unneeded architectures
   rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
   # remove the firmware
   rm -rf ${pkgdir}/lib/firmware
}

# eof

kernel26.preset

# mkinitcpio preset file for kernel26

########################################
# DO NOT EDIT THIS LINE:
source /etc/mkinitcpio.d/kernel26-livez.kver
########################################
ALL_config="/etc/mkinitcpio.conf"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/kernel26-livez.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/kernel26-livez-fallback.img"
fallback_options="-S autodetect"

kernel26.install

# arg 1:  the new package version
# arg 2:  the old package version

KERNEL_NAME=-livez
KERNEL_VERSION=2.6.35-livez

post_install () {
  # updating module dependencies
  echo ">>> Updating module dependencies. Please wait ..."
  depmod $KERNEL_VERSION 
  # generate init ramdisks
  echo ">>> MKINITCPIO SETUP"
  echo ">>> ----------------"
  echo ">>> If you use LVM2, Encrypted root or software RAID,"
  echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
  echo ">>> More information about mkinitcpio setup can be found here:"
  echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
  echo ""
  echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
  /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
}

post_upgrade() {
  pacman -Q grub &>/dev/null
  hasgrub=$?
  pacman -Q grub2 &>/dev/null
  hasgrub2=$?
  pacman -Q lilo &>/dev/null
  haslilo=$?
  # reminder notices
  if [ $haslilo -eq 0 ]; then
    echo ">>>"
    if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
      echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
    else
      echo ">>> You appear to be using the LILO bootloader. You should run"
      echo ">>> 'lilo' before rebooting."
    fi
    echo ">>>"
  fi

  if grep "^[^#]*/boot" /etc/fstab 2>&1 >/dev/null; then
    if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
      echo "WARNING: /boot appears to be a seperate partition but is not mounted"
      echo "         This is most likely not what you want.  Please mount your /boot"
      echo "         partition and reinstall the kernel unless you are sure this is OK"
    fi
  fi

  if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
    # important upgrade notice
    echo ">>>"
    echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
    echo ">>> -------------------------------"
    echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
    echo ">>> If you still use DevFS, please make the transition to uDev before"
    echo ">>> rebooting.  If you really need to stay with DevFS for some reason,"
    echo ">>> then you can manually downgrade to an older version:"
    echo ">>>"
    echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
    echo ">>>"
    echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
    echo ">>> IgnorePkg list in /etc/pacman.conf"
    echo ">>>"
    echo ">>> (NOTE: The following portion applies to uDev users as well!)"
    echo ">>>"
    echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
    echo ">>> be able to boot!  Change your root= parameter to use the classic"
    echo ">>> naming scheme."
    echo ">>>"
    echo ">>> EXAMPLES:"
    echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
    echo ">>> - change root=/dev/md/0 to root=/dev/md0"
    echo ">>>"
  fi
  # generate new init ramdisk
  if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> --------------------------------------------------------------"
    echo ">>> |                          WARNING:                          |"
    echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
    echo ">>> |              Please change to Mkinitcpio setup.            |"
    echo ">>> --------------------------------------------------------------"
    echo ">>>"
  fi
  # updating module dependencies
  echo ">>> Updating module dependencies. Please wait ..."
  depmod $KERNEL_VERSION
  echo ">>> MKINITCPIO SETUP"
  echo ">>> ----------------"
  if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> Please change your bootloader config files:"
    echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
    echo "------------------------------------------------"
    echo "| - initrd26.img to kernel26${KERNEL_NAME}.img               |"
    echo "| - initrd26-full.img to kernel26${KERNEL_NAME}-fallback.img |"
    echo "------------------------------------------------"
  fi
  if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    echo ""
    echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
    echo ">>> ----------"
    echo ">>> To use the new pata drivers, change the 'ide' hook "
    echo ">>> to 'pata' in /etc/mkinicpio.conf HOOKS="
    echo ">>> The new system changes: /dev/hd? to /dev/sd?"
    echo ">>> Don't forget to modify GRUB, LILO and fstab to the"
    echo ">>> new naming system. "
    echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
    echo ""
    echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
    echo "----------"
    echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf" 
    echo ">>> the 'ata_piix' module will be used."
    echo ">>> This may cause your devices to shift names, eg:"
    echo ">>> - IDE: devices from hd? to sd?"
    echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
    echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix"
    echo ""
  fi

  echo ">>> If you use LVM2, Encrypted root or software RAID,"
  echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
  echo ">>> More information about mkinitcpio setup can be found here:"
  echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
  echo ""
  echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
  /sbin/mkinitcpio -p kernel26${KERNEL_NAME} -m "ATTENTION:\nIf you get a kernel panic below
and are using an Intel chipset, append 'earlymodules=piix' to the
kernel commandline"
else
  /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
fi
if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
  echo ""
  echo "Important ACPI Information:"
  echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
  echo ">>> The modules are located at:"
  echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
  echo ">>> For more information about ACPI modules check this wiki page:"
  echo ">>> 'http://wiki.archlinux.org/index.php/ACPI_modules'"
fi
}

post_remove() {
  rm -f /boot/kernel26${KERNEL_NAME}.img
  rm -f /boot/kernel26${KERNEL_NAME}-fallback.img
}

so, I just tar.gz the kernel26-livez folder which contains

config
config.x86_64
kernel26.install
kernel26.preset
PKGBUILD

and submit to AUR??

first, I'm going to run it thru the motions on my 32bit and x86_64 arch installs to test it
as I already have compiled it successfully, and now want to package it,etc

thanks for all your help!

PS
I also have to make a AUR package for the linux-live-6.30_x86 and linux-live-6.3.0x86_64 remaster kits which this kernel is meant for
and gotta figure out how to do that too...

Last edited by 72linus (2010-09-27 20:26:04)

Offline

#8 2010-09-27 21:02:28

gtklocker
Member
Registered: 2009-09-01
Posts: 460

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

You just cd into the folder which contains the PKGBUILD and then you makepkg --source.

This will create a .tar.gz file, which you'll upload to AUR. wink

Offline

#9 2010-09-27 21:08:38

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

ok
but it tries to download the kernel source too
thats not supposed to be in there is it?

Offline

#10 2010-09-27 21:15:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

       --source
           Do not actually build the package, but build a source-only tarball that does not include sources that can
           be fetched via a download URL. This is useful for passing a single tarball to another program such as a
           chroot, remote builder, or a tarball upload. Because integrity checks are verified, all source files of
           the package need to be present or downloadable.

I think you can't check the sha256sums if you don't download it.

Offline

#11 2010-09-27 21:17:55

gtklocker
Member
Registered: 2009-09-01
Posts: 460

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

karol wrote:
       --source
           Do not actually build the package, but build a source-only tarball that does not include sources that can
           be fetched via a download URL. This is useful for passing a single tarball to another program such as a
           chroot, remote builder, or a tarball upload. Because integrity checks are verified, all source files of
           the package need to be present or downloadable.

I think you can't check the sha256sums if you don't download it.

Indeed. It happens.

But I always do makepkg -g before anything, so I hadn't noticed it before. tongue

Last edited by gtklocker (2010-09-27 21:18:38)

Offline

#12 2010-09-27 21:25:57

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

I found 2 errors so far in PKGBUILD,etc
fixed them and now attempting..
the shasum is different after I uploaded it...

it's supposed to be
# sha256sum name_of_archive.tar.bz2

right?

Offline

#13 2010-09-27 21:31:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

There needs to be a checksum for every file you have in the source array.

What exactly is the problem, how is the sum different?

Offline

#14 2010-09-27 21:44:47

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

not sure why it became different after upload?
I'm still debugging it all

so what is the tarball I upload to AUR
kernel26-pf tarball contains exactly what mine contains sans patches

I dont think the tarball I upload to AUR is supposed to have the source kernel too?

Offline

#15 2010-09-27 21:48:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

Could you, pretty please, post some examples? I have no idea what are you talking about - post some code.
"I run this and got that, but I though I should get something else" is fine, but unless you get specific, I won't be able to help you.

Offline

#16 2010-09-27 23:19:49

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

thanks karol
sorry, as I am not familiar yet with bash,etc

anyway, the PKGBUILD completed successfully for my x86_64 install so now I have a new kernel

however; I had to use the --skipinteg in doing makepkg -i

heres the edited PKGBUILD

# Original PKGBUILD from kernel26-pf
# Maintainer: <thepenandpaper at gmail dot com>

_basekernel=2.6.35.6
_pkgname=kernel26-livez
_pfrel=1
pkgname=kernel26-livez
pkgver=${_basekernel}
pkgrel=${_pfrel}
_kernelname=-livez
arch=(i686 x86_64)
_pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
pkgdesc=${_pkgdesc}
license=('GPL2')
groups=('base')
backup=(etc/mkinitcpio.d/${_pkgname}.preset)
depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country'
        'pm-utils: utilities and scripts for suspend and hibernate power management'
        'tuxonice-userui: TuxOnIce userspace user interface'
        'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
          'alsa-driver' 'ieee80211' 'hostap-driver26'
          'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
          'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
          'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
install='kernel26.install'
source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset)            # standard config files for mkinitcpio ramdisk
sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e')
provides=(${_pkgname}=${_basekernel})            # for $pkgname-optimized
#provides=('kernel26-headers' 'kernel26=$pkgver')    # for when you have no other kernel (which is a bad idea anyway)

build() {
   KARCH=x86
   cd ${srcdir}/linux-${_basekernel}
   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
   if [ "$CARCH" = "x86_64" ]; then
      cat ../config.x86_64 >./.config
   else
      cat ../config >./.config
   fi
   _arch=$CARCH
   echo
   echo "==================================================="
   echo "You might be prompted below for some config options"
   echo "==================================================="
   echo
   echo "Do you want to use your running kernel's config? (y/N)"
   echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
   echo " as root before hitting <Y>, if uncertain)"
   read answer
   shopt -s nocasematch
   if [[ "$answer" = "y" ]]; then
      if [[ -s /proc/config.gz ]]; then
         echo "Extracting config from /proc/config.gz..."
         modprobe configs
         zcat /proc/config.gz > ./.config
      else
         echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
      fi
   fi
   if [ "${_kernelname}" != "" ]; then
      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
   fi
   # Make some good use of MAKEFLAGS
   MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
   # get kernel version
   make ${MAKEFLAGS} prepare

   # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
   # make localmodconfig

   # allows you to edit config
   # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"

   # load configuration
   # yes "" | make config

   # This allows building cpu-optimized packages with according package names.
   # Useful for repo maintainers.
   CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
   case $CPU in
    CORE2)
        pkgname="${_pkgname}-core2"
        pkgdesc="${_pkgdesc} Intel Core2 optimized."
        ;;
    K8)
        pkgname="${_pkgname}-k8"
        pkgdesc="${_pkgdesc} AMD K8 optimized."
        ;;
    PSC)
        pkgname="${_pkgname}-psc"
        pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
        ;;
    ATOM)
        pkgname="${_pkgname}-atom"
        pkgdesc="${_pkgdesc} Intel Atom optimized."
        ;;
    K7)
        pkgname="${_pkgname}-k7"
        pkgdesc="${_pkgdesc} AMD K7 optimized."
        ;;
    PENTIUMII)
        pkgname="${_pkgname}-p3"
        pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
        ;;
    PENTIUMIII)
        pkgname="${_pkgname}-p2"
        pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
        ;;
    PENTIUMM)
        pkgname="${_pkgname}-pm"
        pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
        ;;
    PENTIUM4)
        pkgname="${_pkgname}-p4"
        pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
        ;;
    default)
        pkgname="${_pkgname}"
        pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
        ;;
  esac

   # build!
   _kernver="$(make kernelrelease)"
   make ${MAKEFLAGS} bzImage modules

   ### package_kernel26
   mkdir -p ${pkgdir}/{lib/modules,boot}
   make INSTALL_MOD_PATH=${pkgdir} modules_install

   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}

   # add vmlinux
   # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux

   # install fallback mkinitcpio.conf file and preset file for kernel
   install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   # set correct depmod command for install
   sed \
      -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
      -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
      -i ${startdir}/kernel26.install
   sed \
      -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
      -e "s|default_image=.*|default_image=\"/boot/${_pkgname}.img\"|g" \
      -e "s|fallback_image=.*|fallback_image=\"/boot/${_pkgname}-fallback.img\"|g" \
      -i ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.kver

   ### package_kernel26-headers

   install -D -m644 Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Makefile
   install -D -m644 kernel/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
   install -D -m644 .config \
      ${pkgdir}/usr/src/linux-${_kernver}/.config

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
      cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
   done

   # copy arch includes for external modules
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/

   # copy files necessary for later builds, like nvidia and vmware
   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}

   # fix permissions on scripts dir
   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel

   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   if [ "$CARCH" = "i686" ]; then
      cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   fi
   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/

   # add headers for lirc package
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
      cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
   done

   # add docbook makefile
   install -D -m644 Documentation/DocBook/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile

   # add dm headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md

   # add inotify.h
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/

   # add wireless headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/9912
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/11194
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
   [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/

   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
   # in reference to:
   # http://bugs.archlinux.org/task/13146
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/

   # add xfs and shmem for aufs building
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h

   # add headers for virtualbox
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/

   # add headers for broadcom wl
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/

   # copy in Kconfig files
   for i in `find . -name "Kconfig*"`; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
      cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
   done

   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
   cd ${pkgdir}/lib/modules/${_kernver} && \
      (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)

   # remove unneeded architectures
   rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
   # remove the firmware
   rm -rf ${pkgdir}/lib/firmware
}

# eof

so, the sha256sum matches the linux-2.6.35.6.tar.bz2 I uploaded to my site
but it says it doesnt match when trying to do makepkg -i on it

sha256sum linux-2.6.35.6.tar.bz2

e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e

note above the sha256sum in the PKGBUILD is same...

and should I do sha256sum for config config.x86_64 and kernel26.preset?

Offline

#17 2010-09-27 23:27:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

72linus wrote:

note above the sha256sum in the PKGBUILD is same...

and should I do sha256sum for config config.x86_64 and kernel26.preset?

Yes, I think every file needs a checksum, see http://aur.archlinux.org/packages/kerne … f/PKGBUILD
Maybe makepkg is complaining that the other files don't have the corresponding sha256sums. What's the exact error message?

Offline

#18 2010-09-27 23:33:49

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

heres the error

[bryan@nflux kernel26-livez]$ makepkg -i
==> Making package: kernel26-livez 2.6.35.6-1 (Mon Sep 27 19:32:36 EDT 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found linux-2.6.35.6.tar.bz2
  -> Found config
  -> Found config.x86_64
  -> Found kernel26.preset
==> ERROR: Integrity checks (sha256) differ in size from the source array.

Offline

#19 2010-09-28 00:17:26

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

You have four source files and only one checksum. Read man makepkg, look for the -g/--geninteg option.

Offline

#20 2010-09-28 00:27:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

Your pkgbuild:

sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e')

Four files, but only one sum.

kernel26-pf:

sha256sums=('18b2e2c336032e366c942622b77302cb05fc034fb19018f086a4ebc9ed41bfcf'
            'a236d4a7143618bfbbd9e118bf0a314972182467fd806c7f9de2b779952b25cb'
            '81aa037edf1d56c454c48cc5b5eb11e9b5a2495338f9189844ee652e01a7c6eb'
            '3b0aeb055c560acc804fff2eebfb71a64ebd5a535d046e53781f89b5cfba035b'
            'cb4a24cfb9ad4e6b6ddd3d21d624966bde6971bb65fc2faa57efd95bc1f7cc5f'
            '03ed4eb4a35d42ae6beaaa5e6fdbada4244ed6c343944bba6462defaa6fed0bf'
            '51ea665cfec42d9f9c7796af2b060b7edbdeb367e42811f8c02667ad729f6b19'
            '9e1e81d80afac6f316e53947e1b081017090081cd30e6c4c473420b77af4b52b'
            'c81d92619ef166c0f1f5c7bdf948bd273fc4bc7a2ffe6d34e532eca3c10c21d4')

There are nine files in the taurball and nine sha256sums.

Offline

#21 2010-09-28 01:03:03

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

ok
I did that but now I get this

[bryan@nflux kernel26-livez]$ makepkg -i
==> Making package: kernel26-livez 2.6.35.6-1 (Mon Sep 27 20:59:56 EDT 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found linux-2.6.35.6.tar.bz2
  -> Found config
  -> Found config.x86_64
  -> Found kernel26.preset
  -> Found kernel26.install
==> Validating source files with sha256sums...
    linux-2.6.35.6.tar.bz2 ... Passed
    config ... Passed
    config.x86_64 ... Passed
    kernel26.preset ... Passed
    kernel26.install ... Passed
==> Extracting Sources...
  -> Extracting linux-2.6.35.6.tar.bz2 with bsdtar
==> Entering fakeroot environment...
==> Starting build()...

===================================================
You might be prompted below for some config options
===================================================

Do you want to use your running kernel's config? (y/N)
(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'
 as root before hitting <Y>, if uncertain)
n
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/x86/Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
    Aborting...

it does this whether I choose to use to use my own config or not??

Offline

#22 2010-09-28 12:06:51

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

well, the PKGBUILD works great on my x86_64 install
but when I try to build the i686 kernel it fails as above

why does it stop at

 CALL    scripts/checksyscalls.sh
    Aborting...

is something missing?

note that if I just do "make all" the build will complete??!

and the script does

   # build!
   _kernver="$(make kernelrelease)"
   make ${MAKEFLAGS} bzImage modules

I even changed my /etc/makepkg.conf and uncommented -j2
but no dice

what could be the issue?

heres the current PKGBUILD

# Original PKGBUILD from kernel26-pf
# Maintainer: <thepenandpaper at gmail dot com>

_basekernel=2.6.35.6
_pkgname=kernel26-livez
_pfrel=1
pkgname=kernel26-livez
pkgver=${_basekernel}
pkgrel=${_pfrel}
_kernelname=-livez
arch=(i686 x86_64)
_pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
pkgdesc=${_pkgdesc}
license=('GPL2')
groups=('base')
backup=(etc/mkinitcpio.d/${_pkgname}.preset)
depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country'
        'pm-utils: utilities and scripts for suspend and hibernate power management'
        'tuxonice-userui: TuxOnIce userspace user interface'
        'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
# pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
          'alsa-driver' 'ieee80211' 'hostap-driver26'
          'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
          'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
          'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
install='kernel26.install'
source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset)        # standard config files for mkinitcpio ramdisk
        #kernel26.install               # standard install script
sha256sums=('1badcb5a68d1819381161f1e3e090acd4e7684e52b7881ae6216af59c538cd74'
            'a6a365c5e19deb0cddf8902c533fcea0566e8fb23a4a4838a2f734bab281d503'
            '494daf2371f4d580bef3ae653102f614d2422be2741b8b2019480dde098dae6c'
            'fa87b172659fbf5e7dcbd6cd34f2f3604c0b57e42bcfad1b27e6808281193e5a')
            #'265960b8f6c0fedc6a081dd567ed72bf65a30a0ab6da324280a4459a2ab4bf6c'
provides=(${_pkgname}=${_basekernel})            # for $pkgname-optimized
provides=('kernel26-headers' 'kernel26=$pkgver')    # for when you have no other kernel (which is a bad idea anyway)

build() {
   KARCH=x86
   cd ${srcdir}/linux-${_basekernel}
   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
   if [ "$CARCH" = "x86_64" ]; then
      cat ../config.x86_64 >./.config
   else
      cat ../config >./.config
   fi
   _arch=$CARCH
   echo
   echo "==================================================="
   echo "You might be prompted below for some config options"
   echo "==================================================="
   echo
   echo "Do you want to use your running kernel's config? (y/N)"
   echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
   echo " as root before hitting <Y>, if uncertain)"
   read answer
   shopt -s nocasematch
   if [[ "$answer" = "y" ]]; then
      if [[ -s /proc/config.gz ]]; then
         echo "Extracting config from /proc/config.gz..."
         modprobe configs
         zcat /proc/config.gz > ./.config
      else
         echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
      fi
   fi
   if [ "${_kernelname}" != "" ]; then
      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
   fi
   # Make some good use of MAKEFLAGS
   MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
   # get kernel version
   make ${MAKEFLAGS} prepare

   # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
   # make localmodconfig

   # allows you to edit config
   # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"

   # load configuration
   # yes "" | make config

   # This allows building cpu-optimized packages with according package names.
   # Useful for repo maintainers.
   CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
   case $CPU in
    CORE2)
        pkgname="${_pkgname}-core2"
        pkgdesc="${_pkgdesc} Intel Core2 optimized."
        ;;
    K8)
        pkgname="${_pkgname}-k8"
        pkgdesc="${_pkgdesc} AMD K8 optimized."
        ;;
    PSC)
        pkgname="${_pkgname}-psc"
        pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
        ;;
    ATOM)
        pkgname="${_pkgname}-atom"
        pkgdesc="${_pkgdesc} Intel Atom optimized."
        ;;
    K7)
        pkgname="${_pkgname}-k7"
        pkgdesc="${_pkgdesc} AMD K7 optimized."
        ;;
    PENTIUMII)
        pkgname="${_pkgname}-p3"
        pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
        ;;
    PENTIUMIII)
        pkgname="${_pkgname}-p2"
        pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
        ;;
    PENTIUMM)
        pkgname="${_pkgname}-pm"
        pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
        ;;
    PENTIUM4)
        pkgname="${_pkgname}-p4"
        pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
        ;;
    default)
        pkgname="${_pkgname}"
        pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
        ;;
  esac

   # build!
   _kernver="$(make kernelrelease)"
   make bzImage modules #${MAKEFLAGS}

   ### package_kernel26
   mkdir -p ${pkgdir}/{lib/modules,boot}
   make INSTALL_MOD_PATH=${pkgdir} modules_install

   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}

   # add vmlinux
   # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux

   # install fallback mkinitcpio.conf file and preset file for kernel
   install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   # set correct depmod command for install
   sed \
      -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
      -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
      -i ${startdir}/kernel26.install
   sed \
      -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
      -e "s|default_image=.*|default_image=\"/boot/${_pkgname}.img\"|g" \
      -e "s|fallback_image=.*|fallback_image=\"/boot/${_pkgname}-fallback.img\"|g" \
      -i ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.preset

   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${_pkgname}.kver

   ### package_kernel26-headers

   install -D -m644 Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Makefile
   install -D -m644 kernel/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
   install -D -m644 .config \
      ${pkgdir}/usr/src/linux-${_kernver}/.config

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
      cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
   done

   # copy arch includes for external modules
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/

   # copy files necessary for later builds, like nvidia and vmware
   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}

   # fix permissions on scripts dir
   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts

   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel

   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   if [ "$CARCH" = "i686" ]; then
      cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
   fi
   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/

   # add headers for lirc package
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
      cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
   done

   # add docbook makefile
   install -D -m644 Documentation/DocBook/Makefile \
      ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile

   # add dm headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md

   # add inotify.h
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/

   # add wireless headers
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/9912
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/

   # add dvb headers for external modules
   # in reference to:
   # http://bugs.archlinux.org/task/11194
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
   [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/

   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
   # in reference to:
   # http://bugs.archlinux.org/task/13146
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/

   # add xfs and shmem for aufs building
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h

   # add headers for virtualbox
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/

   # add headers for broadcom wl
   # in reference to:
   # http://bugs.archlinux.org/task/14568
   cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/

   # copy in Kconfig files
   for i in `find . -name "Kconfig*"`; do
      mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
      cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
   done

   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
   cd ${pkgdir}/lib/modules/${_kernver} && \
      (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)

   # remove unneeded architectures
   rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
   # remove the firmware
   rm -rf ${pkgdir}/lib/firmware
}

# eof

Last edited by 72linus (2010-09-28 13:09:48)

Offline

#23 2010-09-28 15:35:24

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

this is even weirder

if I edit and use the kernel26-source PKGBUILD it works?!

# Contributor: Lex Rivera aka x-demon <aur@x-demon.org>
# Maintainer: Lex Rivera aka x-demon <aur@x-demon.org>

pkgname=kernel26-livez
pkgver=2.6.35.6
_basever=2.6.35.6
pkgrel=1
pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
arch=('i686' 'x86_64')
license=('GPL2')
provides=(kernel26=${pkgver})
backup=('etc/mkinitcpio.d/${pkgname}.preset' 'etc/mkinitcpio.d/${pkgname}-fallback.conf' 'etc/mkinitcpio-zen.conf')
depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio')
makedepends=('xz-utils')
optdepends=('crda: to set the correct wireless channels of your country')
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
          'alsa-driver' 'ieee80211' 'hostap-driver26'
          'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
          'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
          'gspcav1' 'atl2' 'wlan-ng26' 'rt2500')
install=kernel26.install

### User defined variables ####
_menuconfig="1"                  #
_keep_source_code="0"          #
###############################

source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64        # the main kernel config files
    kernel26.preset)        # standard config files for mkinitcpio ramdisk
sha256sums=('1badcb5a68d1819381161f1e3e090acd4e7684e52b7881ae6216af59c538cd74'
            'a6a365c5e19deb0cddf8902c533fcea0566e8fb23a4a4838a2f734bab281d503'
            '494daf2371f4d580bef3ae653102f614d2422be2741b8b2019480dde098dae6c'
            'fa87b172659fbf5e7dcbd6cd34f2f3604c0b57e42bcfad1b27e6808281193e5a')

build() {
  KARCH=x86

  cd ${srcdir}/linux-${_basever} || return 1

  # remove extraversion
  sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile

  # load configuration for i686 or x86_64
  if [ "$CARCH" = "x86_64" ]; then
     cat ../config.x86_64 > ./.config
  else
     cat ../config > ./.config
  fi

  # get kernel version
  make prepare
  _kernver="$(make kernelrelease)"

  # configure kernel    
  if [ "$_menuconfig" = "1" ]; then
     make menuconfig
  fi
  yes "" | make config

  # fuck CONFIG_LOCALVERSION_AUTO!
  sed -i 's|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|' .config

  if [ "$_keep_source_code" = "1" ]; then
     echo -n "Copying source code..."
     # Keep the source code   
     cd ${startdir} || return 1
     mkdir -p ${pkgdir}/usr/src || return 1
     cp -a ${srcdir}/linux-${_basever} ${pkgdir}/usr/src/linux-${_kernver} || return 1
    
     #Add a link from the modules directory
     mkdir -p ${pkgdir}/lib/modules/${_kernver} || return 1
     cd ${pkgdir}/lib/modules/${_kernver} || return 1
     rm -Rf source
     ln -s ../../../usr/src/linux-${_kernver} source || return 1
     echo "OK"
  fi

  cd ${srcdir}/linux-${_basever}
  # build kernel
  make bzImage modules || return 1
  mkdir -p ${pkgdir}/{lib/modules,boot}
  make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
  install -D -m644 System.map ${pkgdir}/boot/System.map26-zen
  install -D -m644 arch/${KARCH}/boot/bzImage ${pkgdir}/boot/vmlinuz26-zen
  install -D -m644 Makefile ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  install -D -m644 kernel/Makefile ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  install -D -m644 .config ${pkgdir}/usr/src/linux-${_kernver}/.config
  install -D -m644 .config ${pkgdir}/boot/kconfig26-zen
  install -D -m644 vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux

  #install teh headers!

  mkdir -p ${pkgdir}/lib/modules/${_kernver}
  cd ${pkgdir}/lib/modules/${_kernver}
  rm -f source build
  ln -sf ../../../usr/src/linux-${_kernver} build
  cd ${srcdir}/linux-$_basever
  install -D -m644 Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  install -D -m644 kernel/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  install -D -m644 .config \
    ${pkgdir}/usr/src/linux-${_kernver}/.config
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include

  for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
  done

  # copy arch includes for external modules
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
  cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/

  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
  cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
  # fix permissions on scripts dir
  chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions

  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel

  cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  fi
  cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/

  # add headers for lirc package
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
   cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  done
  # add docbook makefile
  install -D -m644 Documentation/DocBook/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
  # add dm headers
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  # add inotify.h
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
  cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
  # add wireless headers
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/9912
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
  cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/11194
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  # in reference to:
  # http://bugs.archlinux.org/task/13146
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  # add xfs and shmem for aufs building
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
  cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
  # add headers vor virtualbox
  # in reference to:
  # http://bugs.archlinux.org/task/14568
  cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
  # add headers for broadcom wl
  # in reference to:
  # http://bugs.archlinux.org/task/14568
  cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do 
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
  done

  chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
  find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
  # remove unneeded architectures
  rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}

  # install fallback mkinitcpio-kernel26-livez.conf file and preset file for kernel
  install -m644 -D ${srcdir}/${pkgname}.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1

  # set correct depmod command for install
  sed \
     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${pkgname}/g" \
     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
     -i ${startdir}/${pkgname}.install
  sed \
     -e "s|source .*|source /etc/mkinitcpio.d/${pkgname}.kver|g" \
     -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
     -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
     -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset

  echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver

  if [ "$_keep_source_code" = "0" ]; then
     # remove unneeded architectures   
     rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
  fi

  # Delete firmware directory
   rm -rf ${pkgdir}/lib/firmware
}

so it seems this part of the original PKGBUILD has something to do with it

build() {
   KARCH=x86
   cd ${srcdir}/linux-${_basekernel}
   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
   if [ "$CARCH" = "x86_64" ]; then
      cat ../config.x86_64 >./.config
   else
      cat ../config >./.config
   fi
   _arch=$CARCH
   echo
   echo "==================================================="
   echo "You might be prompted below for some config options"
   echo "==================================================="
   echo
   echo "Do you want to use your running kernel's config? (y/N)"
  echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
  echo " as root before hitting <Y>, if uncertain)"
  read answer
  shopt -s nocasematch
  if [[ "$answer" = "y" ]]; then
     if [[ -s /proc/config.gz ]]; then
        echo "Extracting config from /proc/config.gz..."
        modprobe configs
        zcat /proc/config.gz > ./.config
     else
        echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
     fi
  fi
  if [ "${_kernelname}" != "" ]; then
     sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
  fi
   # Make some good use of MAKEFLAGS
   # MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
   # get kernel version
   # make ${MAKEFLAGS} prepare

we'll see how it goes...

Offline

#24 2010-09-28 15:37:17

karol
Archivist
Registered: 2009-05-06
Posts: 25,430

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

I was curious when will you figure it out :-)

Offline

#25 2010-09-28 15:45:27

72linus
Member
From: gordonsville,va
Registered: 2009-03-14
Posts: 144
Website

Re: (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

oh
could you explain it karol??

I have no scripting,etc experience?!

why does it build for x86_64 but no i686?

what part of the first PKGBUILD is bad or incorrect?

Offline

Board footer

Powered by FluxBB