You are not logged in.

#1 2004-09-10 13:21:31

TheBashar
Member
Registered: 2004-09-07
Posts: 11

pacman lost my pkg

Hi, I could really use some help.  I'm stumped.

I made an ABS script to make a kernel package.  The resulting file that was made is called:

kernel-ck_acpi_no_r4-2.6.8.1-ck7-1.pkg.tar.gz

(long name I know!)

Reading the embedded .PKGINFO file I can see (among others):

pkgname = kernel-ck_acpi_no_r4
pkgver = 2.6.8.1-ck7-1

I added this to my system with:

pacman -Uf kernel-ck_acpi_no_r4-2.6.8.1-ck7-1.pkg.tar.gz

I can see that it worked by the files it installed as well as having the directory:

/var/lib/pacman/local/kernel-ck_acpi_no_r4-2.6.8.1-ck7-1

In that directory, the desc file has (among other things):

%NAME%
kernel-ck_acpi_no_r4

%VERSION%
2.6.8.1-ck7-1

So, I'm stumped as to why I can't remove this package.

I run the command:

pacman -R kernel-ck_acpi_no_r4

and I get the message:

error: could not find kernel-ck_acpi_no_r4 in database

Can anybody help me cause I'm sure spinning my wheels on this one.

Thanks!

Offline

#2 2004-09-10 18:03:45

orelien
Forum Fellow
From: France
Registered: 2002-12-05
Posts: 220
Website

Re: pacman lost my pkg

pacman assumes there's only one hyphen in the pkgver field.
I don't know how you managed to build your package, because makepkg usually rejects ones with hyphens in pkgver and pkgrel fields wink

Anyway, you should be able to remove your package by modifying the desc file as follows :

%NAME%
kernel-ck_acpi_no_r4-2.6.8.1

%VERSION%
ck7-1

and by running:

pacman -R kernel-ck_acpi_no_r4-2.6.8.1

Offline

#3 2004-09-10 22:27:49

TheBashar
Member
Registered: 2004-09-07
Posts: 11

Re: pacman lost my pkg

orelien wrote:

pacman assumes there's only one hyphen in the pkgver field.
I don't know how you managed to build your package, because makepkg usually rejects ones with hyphens in pkgver and pkgrel fields wink

Oh, I didn't realize that.  The wiki said don't put any hyphens in the pkgname field, but I saw a lot of packages with one so I thought it would be okay.  I had no idea there was a restriction on pkgver field instead.

I could show you the PKGBUILD I used, but there's little point in that.  I'll be happy to share it though once I fix it to use something besides hyphens to separate all the version informaiton.

orelien wrote:

%NAME%
kernel-ck_acpi_no_r4-2.6.8.1

%VERSION%
ck7-1

Hey that did the trick!  Thanks so much for your help!

Offline

#4 2004-09-11 00:03:05

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: pacman lost my pkg

I didn't think makepkg let you build packages with hyphens in the pkgver or pkgrel... how did you build this package?


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#5 2004-09-11 00:25:13

TheBashar
Member
Registered: 2004-09-07
Posts: 11

Re: pacman lost my pkg

I made the package with a custom PKGBUILD I've been working on for building/managing kernels.  I used the kernel with ABS wiki page examplpe as a start, but made it more flexible because I need a more sophisticated script to handle more complex tree names and versions.

For example, I want to manage the kernel v 2.6.8.1 with Con Kolivas' ck7 patchset but with ACPI patches added and Reiser4 support removed.  Then I want the original scripts ability to have a custom revision indicator in the pkgname so I can keep separate different .config results.

I wanted:
pkgname: kernel-patchset-cfgname
pkgver: kernver-extraver-pkgrel

So, for my example:
pkgname: kernel-ck_acpi_no_r4-sn45g
pkgver: 2.6.8.1-ck7-1
(or even pkgver: 2.6.9-rc1-bk16-1)

As I'm sure someone will suggest moving the extra version information into the pkgname, let me say upfront that is contrary to my needs/wants.

I specifically _want_ different patchset combinations (ck_acpi_no_r4) in different (coexistant) packages, and i specifically _want_ consecutive ck, or mm, rc, or even kernel version release to be treated as upgrades to the same package.

Not being able to use the hypen as the version information seperator really is inconvient since it is the kernel standard (as much as there is such a thing) for the Makefile EXTRAVERSION information.  The PKGBUILD I used to build the package in question, since I was asked twice, is:

######################
#
# _patchset = Name given to distinguish set of patches being applied: ck, mm, ac, ck_no_fbtng
#
# _cfgname = Name given to denote choices made in .config; default "", example: "sn45g"
#
# 
pkgname=kernel
_patchset="ck_acpi_no_r4"
_cfgname=""
pkgver=2.6.8.1
pkgrel=1
pkgdesc="Custom Linux Kernel and Modules"
url="http://www.kernel.org"
license="GPL"
depends=('module-init-tools')
makedepends=('bzip2' 'gcc')
###### Add a default config file and any patches to be applied to source array
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2
  config
  config.stock
  [url]http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/release/26-stable-release/acpi-20040715-2.6.8.diff.bz2[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/1g_change_config.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/1g_lowmem_i386.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/2.6.8.1-ck7-version.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/9000-SuSE-117-writeback-lat.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/akpm-latency-fix.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/back_journal_clean_checkpoint_list-latency-fix.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/bio_uncopy_user-mem-leak.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/bio_uncopy_user2.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/cddvd-cmdfilter-drop.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/cfq_iosched_v2.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/config_hz.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/cool-spinlocks-i386.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/defaultcfq.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/fbsplash-0.9-r5-2.6.8-rc3.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/from_2.6.8.1_to_staircase8.0[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/invalidate_inodes-speedup.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/ioport-latency-fix-2.6.8.1.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/lenient_uw.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/make-tree_lock-an-rwlock.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/mapped_watermark.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/mapped_watermark_fix.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/s8.0_s8.1[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/s8.1_s8.2[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/s8.1_smtfix[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/s8.1_test1[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/s8.1test1_test2[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/sc_mw.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/sched-adjust-p4gain[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/schedbatch2.4.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/schediso2.5.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/schedrange.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/supermount-ng205.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/vesafb-tng-0.9-rc4-r2-2.6.8.1.patch[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/vesafb_change_config.diff[/url]
  [url]http://ck.kolivas.org/patches/2.6/2.6.8.1/2.6.8.1-ck7/split-out/write-barriers.patch[/url]
  )

###### Add md5 checksums here:


getvar() {
  old=$(cat Makefile | grep "^$1")
  echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*(.*)[ ]*/1/g")
  return 0
}

build() {
  cd $startdir/src/linux-$pkgver

  ###### apply patches here
  # patch -p1 < ../patch1 || return 1
  patch -Np1 -i ../from_2.6.8.1_to_staircase8.0 || return 1
  patch -Np1 -i ../schedrange.diff || return 1
  patch -Np1 -i ../schedbatch2.4.diff || return 1
  patch -Np1 -i ../schediso2.5.diff || return 1
  patch -Np1 -i ../sched-adjust-p4gain || return 1
  patch -Np1 -i ../mapped_watermark.diff || return 1
  patch -Np1 -i ../defaultcfq.diff || return 1
  patch -Np1 -i ../config_hz.diff || return 1
  patch -Np1 -i ../1g_lowmem_i386.diff || return 1
  patch -Np1 -i ../akpm-latency-fix.patch || return 1
  patch -Np1 -i ../9000-SuSE-117-writeback-lat.patch || return 1
  patch -Np1 -i ../cddvd-cmdfilter-drop.patch || return 1
  patch -Np1 -i ../cool-spinlocks-i386.diff || return 1
  patch -Np1 -i ../bio_uncopy_user-mem-leak.patch || return 1
  patch -Np1 -i ../bio_uncopy_user2.diff || return 1
  patch -Np1 -i ../ioport-latency-fix-2.6.8.1.patch || return 1
  patch -Np1 -i ../supermount-ng205.diff || return 1
  patch -Np1 -i ../fbsplash-0.9-r5-2.6.8-rc3.patch || return 1
  patch -Np1 -i ../make-tree_lock-an-rwlock.patch || return 1
  patch -Np1 -i ../invalidate_inodes-speedup.patch || return 1
  patch -Np1 -i ../s8.0_s8.1 || return 1
  patch -Np1 -i ../mapped_watermark_fix.diff || return 1
  patch -Np1 -i ../sc_mw.diff || return 1
  patch -Np1 -i ../1g_change_config.diff || return 1
  patch -Np1 -i ../lenient_uw.diff || return 1
  patch -Np1 -i ../s8.1_test1 || return 1
  patch -Np1 -i ../s8.1test1_test2 || return 1
  patch -Np1 -i ../s8.1_smtfix || return 1
  patch -Np1 -i ../write-barriers.patch || return 1
  patch -Np1 -i ../cfq_iosched_v2.patch || return 1
  patch -Np1 -i ../vesafb-tng-0.9-rc4-r2-2.6.8.1.patch || return 1
  patch -Np1 -i ../vesafb_change_config.diff || return 1
  patch -Np1 -i ../back_journal_clean_checkpoint_list-latency-fix.patch || return 1
  patch -Np1 -i ../2.6.8.1-ck7-version.diff || return 1
  patch -Np1 -i ../acpi-20040715-2.6.8.diff || return 1

  #get rid of i in i686 in default config
  carch=`echo $CARCH | sed 's|i||'`
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config

  ###### Choose one of the following configuration types
  #make oldconfig || return 1
  #make menuconfig || return 1
  #make xconfig || return 1
  make gconfig || return 1

  ##### No user changes below here
  
  if [ ! -z "$_patchset" ]; then
    _patchset="-$_patchset"
  fi
  
  if [ ! -z "$_cfgname" ]; then
    _cfgname="-$_cfgname"
  fi
  
  # save the configuration with today's date
  cp ./.config ../../config$_cfgname.bak

  # set EXTRAVERSION to help use unique /lib/modules/ subdirectories
  _ker_extraver=$(getvar "EXTRAVERSION")


  # update EXTRAVERSION in the Makefile by adding our (for modules location)
  _oldline=$(cat Makefile | grep "^EXTRAVERSION")
  cat Makefile | sed "s|$_oldline|EXTRAVERSION = $_ker_extraver$_patchset$_cfgname|" > tmpMake
  mv tmpMake Makefile

  kerver=$(getvar "VERSION").$(getvar "PATCHLEVEL").$(getvar "SUBLEVEL")
  pkgname=$pkgname$_patchset$_cfgname
  pkgver=$kerver$_ker_extraver

  pkgdesc="Custom Linux Kernel and Modules; ver: $kerver$_ker_extraver pset: `echo $_patchset | sed -e 's|^-||'` cfg: $_cfgname bld: $pkgrel"

  make clean bzImage modules || return 1
  mkdir -p $startdir/pkg/{lib/modules,boot}
  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1

  _idstr="$pkgver$_patchset$_cfgname"
  
  # create unique names in /boot/
  cp System.map $startdir/pkg/boot/System.map-$_idstr
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz-$_idstr

  install -D -m644 Makefile $startdir/pkg/usr/src/linux-$_idstr/Makefile
  install -D -m644 .config $startdir/pkg/usr/src/linux-$_idstr/.config
  install -D -m644 ../config.stock $startdir/pkg/usr/src/linux-$_idstr/config.stock
  install -D -m644 .config $startdir/pkg/boot/kconfig-$_idstr
  mkdir -p $startdir/pkg/usr/src/linux-$_idstr/include
  mkdir -p $startdir/pkg/usr/src/linux-$_idstr/arch/i386/kernel
  for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-$_idstr/include/
  done
  # copy files necessary for later builds, like nvidia and vmware
  cp -a scripts $startdir/pkg/usr/src/linux-$_idstr/
  mkdir -p $startdir/pkg/usr/src/linux-$_idstr/.tmp_versions
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$_idstr/arch/i386/
  cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$_idstr/arch/i386/kernel/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do
    mkdir -p $startdir/pkg/usr/src/linux-$_idstr/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-$_idstr/$i
  done
  cd $startdir/pkg/usr/src/linux-$_idstr/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-$_idstr
  
  cd $startdir/pkg/lib/modules/$_idstr && 
    (rm -f build; ln -sf /usr/src/linux-$_idstr build)
    
  ln -sf /usr/src/linux-$_idstr $startdir/pkg/usr/src/linux
}

[/code]

Offline

#6 2004-09-11 00:39:08

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: pacman lost my pkg

pkgname=$pkgname$_patchset$_cfgname
  pkgver=$kerver$_ker_extraver

Bingo.  You're modifying the pkgname and pkgver from within the build function.  If the build function isn't run (or before it's run), like when makepkg checks the pkgver for hyphens, the pkgver hasn't been modified.

If you ask me, I think it's really bad practice to modify pkgname and pkgver inside a build function.  Do it if you want to, but it hinders things like namcap and gensync (so the package could never go into a repo).


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#7 2004-09-11 01:41:32

TheBashar
Member
Registered: 2004-09-07
Posts: 11

Re: pacman lost my pkg

Xentac wrote:

If you ask me, I think it's really bad practice to modify pkgname and pkgver inside a build function.  Do it if you want to, but it hinders things like namcap and gensync (so the package could never go into a repo).

Oh, well I can understand that.  I wasn't keen on it either.  It was in the PKGBUILD prototype in the wiki and I found that it used this "feature" to detect changes to the kernel version made by the patches.

I kept it because I thought it nice not to have to update all the rcX, mmX, ckX type stuff by hand if makepkg could do it automagically.  But, really, doing it by hand is much less of a problem than the fact that I cant have hyphens where I want them.

Sure, my package version is going to be:
2.6.9_pre2_bk16-1
but I would prefer to keep the actual kernel names
vmlinuz-blah-2.6.9-pre2-bk16-1
cause that is how the devs refer to it.  And I'm a little disappointed that all the places where the version shows up (pkg, modules dir, usr/src, vmlinuz, etc) can't have the same verion identifier format.

Offline

Board footer

Powered by FluxBB