About this list Date view Thread view Subject view Author view Attachment view

From: Enrico Scholz (enrico.scholz_at_informatik.tu-chemnitz.de)
Date: Sun 20 Feb 2005 - 20:03:54 GMT


Velu Erwan <erwan_at_seanodes.com> writes:

> Velu Erwan a écrit :
>
>> Here come the patch I've made to be able to use the urpmi (an apt
>> like tool) and the mandrakelinux distribution.
>> This is the first version, I still have some work todo to add
>> options to urpmi but this version has been tested with success.
>>
> Works better with the attachement :b

Thx, I will apply the main idea to CVS; but there are some issues:

> diff -Nrub usr/lib/util-vserver/distributions/mandrakelinux//initpost /usr/lib/util-vserver/distributions/mandrakelinux//initpost
> --- distrib/mandrakelinux/initpost 1970-01-01 01:00:00.000000000 +0100
> +++ distrib/mandrakelinux/initpost 2005-02-19 10:01:35.000000000 +0100
              ~~~~~~~~~~~~~

I would prefer a shorter 'mandrake' here ;)

I do not know if urpmi supports this, but it should be possible to
specify the version of Mandrake Linux. E.g.

| vserver ... build -m urpmi -- -d mdk10

> --- distrib/mandrakelinux/pubkeys/pubkey 1970-01-01 01:00:00.000000000 +0100
> +++ distrib/mandrakelinux/pubkeys/pubkey 2005-02-19 17:38:49.000000000 +0100

I am not sure if I should ship foreign gpg keys in my package. Copying
the keys from existing pacakges at %post time would be probably the
better solution.

> diff -Nrub usr/lib/util-vserver/functions /usr/lib/util-vserver/functions
> --- scripts/functions 2005-02-19 17:54:19.038580040 +0100
> +++ scripts/functions 2005-02-19 17:51:22.203463064 +0100
> @@ -236,7 +236,7 @@
> if test -z "$WORKAROUND_106057"; then
> _rpmdb_mntpoint=/dev
> else
> - _rpmdb_mntpoint=/.rpmdb
> + _rpmdb_mntpoint=$BASEDIR/.rpmdb

This does not look sane. The rpm-database mountpoint MUST be at the / of
the vserver.

> diff -Nrub usr/lib/util-vserver/pkgmgmt /usr/lib/util-vserver/pkgmgmt
> --- scripts/pkgmgmt 2005-02-19 17:54:19.166560584 +0100
> +++ scripts/pkgmgmt 2005-02-19 15:11:20.000000000 +0100
> @@ -52,7 +52,7 @@
> if test -z "$WORKAROUND_106057"; then
> rpmdb_mntpoint=/dev
> else
> - rpmdb_mntpoint=/.rpmdb
> + rpmdb_mntpoint=$RPMDB_PATH

ditto... (note for me: remove redundancy)

> +_VURPMI="$SBINDIR/urpmi"

path should be determined in %configure. And the variable should be
named '_URPMI', not '_VURPMI'.

> --- scripts/vserver-build.functions.urpmi 1970-01-01 01:00:00.000000000 +0100
> +++ scripts/vserver-build.functions.urpmi 2005-02-19
> 18:01:25.569737448 +0100
> ....
> +function urpmi.initVariables
> +{
> + RPMDB_PATH=$SETUP_CONFDIR/.rpmdb
> + findDir URPMIREPOSDEFAULT \
> + "$CONFDIR/.distributions/$DISTRIBUTION/rpm.repos.d" \
> + "$DISTRIBDIR/$DISTRIBUTION/rpm.repos.d" \
                                   ~~~~~~~~~~~
This does not seem to be used consistently; below you have 'urpmi.repos.d'

> +function urpmi.initDB
> +{
> + rm -rf $1/var/lib/rpm
> + mkdir -p $1/var/lib/rpm
> + rpm --root "$1" --initdb
> + rpm --root "$1" --rebuilddb
> +}

see above; rpm-db MUST NOT be under /.../. Using the 'rpm.initDB'
function should suffice.

> +function urpmi.initFilesystem
> +...
> + ## workaround for yum's automatism to search the configuration in the chroot
> + local prefix='/../../../../../../../../../../../../'

are you really sure, that you need this hack for urpmi also?

> + test -z "$URPMIREPOSDEFAULT" -o -e "$PKGCFGDIR/urpmi/etc/urpmi.repos.d" || \
> + $_LN_S "$UPMIREPOSDEFAULT" "$PKGCFGDIR/urpmi/etc/urpmi.repos.d"
                                                           ~~~~~~~~~~~~~
see note above regarding 'rpm.repos.d'

> diff -Nrub usr/lib/util-vserver/vserver-build.urpmi /usr/lib/util-vserver/vserver-build.urpmi
> --- scripts/vserver-build.urpmi 1970-01-01 01:00:00.000000000 +0100
> +++ scripts/vserver-build.urpmi 2005-02-19 18:02:40.343370128 +0100
> ...
> +urpmi.initDB "$VDIR"

see above; 'rpm.initDB' should suffice.

> diff -Nrub usr/lib/util-vserver/vserver-setup.functions /usr/lib/util-vserver/vserver-setup.functions
> --- scripts/vserver-setup.functions 2005-02-19 17:54:19.173559520 +0100
> +++ scripts/vserver-setup.functions 2005-02-19 11:56:44.000000000 +0100
> @@ -169,6 +169,25 @@
> cat "$SETUP_FSTAB" >"$SETUP_CONFDIR"/fstab
> }
>
> +function setup_writeHostFile
> +{
> + tmp=${SETUP_INTERFACES[0]};

ok; let's do this at another time... This introduces redundant code and
should be solved in another way.

Btw... is this really needed? DNS should carry information about your
hostname so an extra /etc/hosts entry seems to be superfluously (except
for the DNS server).

> --- scripts/vserver-build~ 2005-02-19 18:31:29.202699861 +0100
> +++ scripts/vserver-build 2005-02-19 18:37:36.595585034 +0100
> @@ -56,6 +56,9 @@
> yum ... -- -d <distribution>
> ... installs the base-packages of the given distribution with
> help of 'vyum'
> + urpmi ... -- -d <distribution>
> + ... installs the base-packages of the given distribution with
> + help of 'vurpmi'
                              ~~~~~~
This program is not part of your patch, right?

Thx for the patch
Enrico


_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sun 20 Feb 2005 - 20:06:55 GMT by hypermail 2.1.3