mkarchroot on arm results in bad mirrorlist.

Development on core packages and the distribution goes on in here.

mkarchroot on arm results in bad mirrorlist.

Postby starfry » Tue Oct 02, 2012 10:37 am

Hi, just noticed this wierd happening... (sorry, long post as per my thought process :lol: )

If I make a root using "mkarchroot", I notice the mirrorlist in that root contains this:

$this->bbcode_second_pass_code('', 'Server = http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz')

which is clearly wrong. This is despite pacman-mirrorlist being included in the package list given to mkarchroot.

I looked in /usr/sbin/mkarchroot and there is this at line 266 that rewrites the mirrorlist file:

$this->bbcode_second_pass_code('', 'echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist')

The value host_mirror gets set at line 199:

$this->bbcode_second_pass_code('', 'host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')')

Executing that on the command line gives the bad output found in the mirrorlist:

$this->bbcode_second_pass_code('', '$ pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#'
http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz')

The "sed" part of the command has no effect . This construct works fine on x86_64, so I did some tests:

on x86_64:

$this->bbcode_second_pass_code('', '$ pacman -Sddp extra/devtools
http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz')

I copied that output and ran the sed part on on arm:

$this->bbcode_second_pass_code('', '$ echo http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#'
http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
')

That works, so the difference between the pacman output on x86 and arm is not being picked up by the sed part:

$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz
http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz')

The reason is that the sed part expects to find "extra/os" in its input but, on arm, the "os" part of the path isn't there.

The correct path on arm is:
$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/$repo')

and on x86 it is
$this->bbcode_second_pass_code('', 'http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch')

I've tried to make a modified sed and it appears to almost work in both places:

$this->bbcode_second_pass_code('', '
pacman -Sddp extra/devtools 2>/dev/null | sed -E -e 's#(.*/)extra/os/.*#\1$repo/os/$arch#' -e 's#(.*/)extra/.*#\1$repo#'
')

returns on x86:
$this->bbcode_second_pass_code('', 'http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch')

returns on arm:
$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/$repo')

I ought to raise this as a bug but not sure where to do that. Presumably the location of the problem is something that would need to be agreed between the ArchLinux and the ArchLinuxARM folks as to whether this is a mkarchroot issue or a directory issue on the arm side.

Let me know and I'll raise an appropriate bug report.

Here is a patch for mkarchroot:
$this->bbcode_second_pass_code('', '
--- /usr/sbin/mkarchroot 2012-07-21 18:08:16.000000000 +0100
+++ mkarchroot 2012-10-02 11:17:48.496579764 +0100
@@ -196,7 +196,7 @@
cache_dirs=(${cache_dir})
fi

-host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
+host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E -e 's#(.*/)extra/os/.*#\1$repo/os/$arch#' -e 's#(.*/)extra/.*#\1$repo#')
if echo "${host_mirror}" | grep -q 'file://'; then
host_mirror_path=$(echo "${host_mirror}" | sed -E 's#file://(/.*)/\$repo/os/\$arch#\1#g')
fi
')
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm

Re: mkarchroot on arm results in bad mirrorlist.

Postby kmihelich » Tue Oct 02, 2012 1:43 pm

Yes, it's because our directory structure is different from upstream. I don't even know how it crossed your mind to report this as a bug upstream, DO NOT DO THAT.

I also don't intend to maintain a fix on our side, as it's one more thing for me to look after and I assume people using that script also have the ability to fix the script locally.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: mkarchroot on arm results in bad mirrorlist.

Postby starfry » Tue Oct 02, 2012 2:54 pm

I wasn't going to report upstream unless it was suggested here that I should - I assumed that would not be the right thing to do. At least it's a known issue, thanks for letting me know. I'll just patch locally when I need to. cheers.
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm

Re: mkarchroot on arm results in bad mirrorlist.

Postby slycat » Tue Oct 02, 2012 3:34 pm

Probably silly question: why go through the hassle of fixing mkarchroot if making a chroot environment can be done like this? I am sure I am missing something that mkarchroot does.
Pogoplug Pro w/ Wireless User -> decomm.
Cubox-i4pro User
4TB eSATA HDD (8g/3700+ Sw/Storage)
Kodi / Transmission / Minidlna / Samba / Batch-audio-conversions / Lighttpd
------------------------------
Rollback Machine - Thanks to impatt
slycat
 
Posts: 169
Joined: Wed Feb 09, 2011 3:07 am
Location: Miami, FL


Return to Arch Linux ARM

Who is online

Users browsing this forum: No registered users and 8 guests