[lxc-devel] patch lxc-archlinux so base_packages is built using the pacman.conf given with -c option
Peter Maloney
peter.maloney at yahoo.ca
Fri Jun 26 16:09:36 UTC 2015
Konsole output I guess the only difference seems to be "Architecture =
i686" instead of auto. And then I removed the multilib section (which I
think might only be relevant in Manjaro; also the 2 packages I listed as
examples are only in multilib; so I don't have an example where this
patch is necessary in plain Arch)
> root at peter:~#diff -u /etc/pacman.conf /opt/arch32/pacman.conf
> --- /etc/pacman.conf 2015-02-21 17:53:33.000000000 +0100
> +++ /opt/arch32/pacman.conf 2015-06-20 09:44:52.939178697 +0200
> @@ -21,7 +21,8 @@
> #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
> #CleanMethod = KeepInstalled
> #UseDelta = 0.7
> -Architecture = auto
> +#Architecture = auto
> +Architecture = i686
>
> # Pacman won't upgrade packages listed in IgnorePkg and members of
> IgnoreGroup
> #IgnorePkg =
> @@ -81,9 +82,9 @@
> # If you want to run 32 bit applications on your x86_64 system,
> # enable the multilib repositories as required here.
>
> -[multilib]
> -SigLevel = PackageRequired
> -Include = /etc/pacman.d/mirrorlist
> +#[multilib]
> +#SigLevel = PackageRequired
> +#Include = /etc/pacman.d/mirrorlist
>
> # An example of a custom package repository. See the pacman manpage for
> # tips on creating your own repositories.
>
On 06/26/2015 03:07 PM, Serge Hallyn wrote:
> Quoting Peter Maloney (peter.maloney at yahoo.ca):
>> Hi,
>>
>> Here is a simple patch that makes sure the "base" is resolved for the
>> given ${pacman_conf}, so it won't have nonexistent packages, like when
>> building a 32 bit lxc, you don't want 32 bit support packages that are
>> for 64 bit only.
>>
>> To do that, I just added "${pacman_config"} in the options for when
>> generating base_packages, and I also moved the generation to after the
>> -c option is handled, so the pacman_config is known.
>>
>> I needed to do this to build a 32 bit LXC container. Without it, some
>> packages found in the base_package array do not exist in the
>> repositories actually used to download ( Konsole output lib32-glibc and
>> Konsole output lib32-tcp_wrappers are 2 examples) . I used the
>> "/opt/arch32/pacman.conf" file created by "pacman -S devtools
>> arch-install-scripts", (which I modified also to have no "multilib"
>> section, which also doesn't belong on a 32 bit system, and makes the
>> script fail when refreshing repositories... not sure whether or not to
>> report that somewhere)
>>
>> I tested the following 2 cases:
>>
>>
>> # ./lxc-archlinux -n arch32 -a i686 -c /opt/arch32/pacman.conf
>>
>> # ./lxc-archlinux -n arch32
>> Konsole output
> Hi - The lxc-archlinux file is a generated one, lxc-archlinux.in is
> the one which needs to be patched.
>
> Is there a way for the template to automatically determine the file
> to use when building for 32-bit, so the user doesn't need to know where
> it is?
>
>> *I am not on the list, so be sure to CC me when replying.
>>
>> *
>> Peter*
>> *
>> --- /usr/share/lxc/templates/lxc-archlinux.orig 2015-06-20 09:51:02.778719562 +0200
>> +++ /usr/share/lxc/templates/lxc-archlinux 2015-06-20 09:57:09.849332795 +0200
>> @@ -50,9 +50,6 @@
>> # by default, install 'base' except the kernel
>> pkg_blacklist="linux"
>> base_packages=()
>> -for pkg in $(pacman -Sqg base); do
>> - [ "${pkg_blacklist#*$pkg}" = "$pkg_blacklist" ] && base_packages+=($pkg)
>> -done
>> declare -a additional_packages
>>
>> # split comma-separated string into an array
>> @@ -231,6 +228,11 @@
>> esac
>> done
>>
>> +# generate base_packages only after the -c option is handled
>> +for pkg in $(pacman --config "${pacman_config}" -Sqg base); do
>> + [ "${pkg_blacklist#*$pkg}" = "$pkg_blacklist" ] && base_packages+=($pkg)
>> +done
>> +
>> if [ -z "${name}" ]; then
>> echo "missing required 'name' parameter"
>> exit 1
>> _______________________________________________
>> lxc-devel mailing list
>> lxc-devel at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150626/d3d89ce6/attachment.html>
More information about the lxc-devel
mailing list