Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I would like to install some packages on an ARM image before flashing it to an SD card. So far, I have loop mounted the image

sudo mount -o loop,offset=99614720 archlinuxarm-13-06-2012.img /mnt

and added the ARM mirrors to my /etc/pacman.d/mirrorlist. I've then tried to run

sudo pacman --root /mnt --arch arm --conf /mnt/etc/pacman.conf -S curl

But it fails with the following output...

warning: curl-7.26.0-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (1): curl-7.26.0-1

Total Download Size:    0.48 MiB
Total Installed Size:   1.50 MiB
Net Upgrade Size:       0.00 MiB

Proceed with installation? [Y/n] Y
:: Retrieving packages from core...
error: failed retrieving file 'curl-7.26.0-1-arm.pkg.tar.xz' from mirror.lividpenguin.com : The requested URL returned error: 404
 curl-7.26.0-1-arm                   492.9 KiB   293K/s 00:02 [##################################] 100%
(1/1) checking package integrity                              [##################################] 100%
(1/1) loading package files                                   [##################################] 100%
(1/1) checking for file conflicts                             [##################################] 100%
(1/1) checking available disk space                           [##################################] 100%
(1/1) upgrading curl                                          [##################################] 100%
call to execv failed (Exec format error)
error: command failed to execute correctly

Any ideas on how to get this to work without emulation? Any idea what is being execv-d?

Update

I have discovered it is trying to run ldconfig, which is obviously failing. Luckily, I don't need that to be run!

share|improve this question

2 Answers 2

Most Linux distributions do not support installing packages for a target system on an incompatible host system. Arch is no exception. ldconfig is just one among many programs of the target system that may need to be run during the package installation.

Perform the installation on the ARM device itself, or in an emulator such as QEmu.

Alternatively, download the tar.xz file, modify the archive to remove the .INSTALL file, and run pacman again on the modified archive. Then deal with the breakage caused by not having run the installation script manually.

share|improve this answer
    
I've done a bit of research and ldconfig runs separately to the INSTALL scripts. We, of course, don't need to run ldconfig, so I've submitted a patch to add a flag to stop this running. We're still deciding how to run the INSTALL script - using an emulator or on first boot. –  Alex Chamberlain Jul 7 '12 at 7:52

I tried patching pacman so it now has a --no-ldconfig option, and it solves the problem. There's also another solution with a tool made by Alex Chamberlain, piimg, but it's not tested yet.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.