[PATCH] Add virtio-scsi support to febootstrap.
by Richard W.M. Jones
This patch is the minimum possible to add virtio-scsi support to
febootstrap.
Problem: SCSI devices are detected asynchronously after the Linux
kernel module is loaded.
The usual solutions to this involve scsi_wait_scan (deprecated
apparently) or udev. However febootstrap doesn't use udev, and adding
it is a ton of work with a very uncertain outcome.
So the minimum possible change is to have libguestfs pass in the
appliance device on the Linux command line (eg. root=/dev/sdb) and
then busy-wait until it becomes available in the initramfs.
Rich.
12 years, 6 months
[hivex][PATCH] OS X, bootstrap: Locate pkg.m4
by Alex Nelson
OS X does not include pkg-config by default. When installed, pkg.m4 tends
to end up in some place that is not the autotool-expected /usr/share/aclocal/.
Add to bootstrap a path check so pkg.m4 can be found, so ./configure does
not fail invoking PKG_CHECK_MODULES.
Signed-off-by: Alex Nelson <ajnelson(a)cs.ucsc.edu>
---
bootstrap | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/bootstrap b/bootstrap
index b2960c1..8e4cb86 100755
--- a/bootstrap
+++ b/bootstrap
@@ -85,5 +85,10 @@ $gnulib_tool \
--tests-base=gnulib/tests \
--import $modules
+# Locate pkg.m4 (installed in non-default location in OS X)
+# (Passing non-existent paths with -I causes aclocal, invoked by autoreconf, to die.)
+pkgm4dir=$(test -f /opt/local/share/aclocal/pkg.m4 && dirname /opt/local/share/aclocal/pkg.m4) || \
+ $(test -f /usr/local/share/aclocal/pkg.m4 && dirname /usr/local/share/aclocal/pkg.m4) || \
+ $(test -f /usr/share/aclocal/pkg.m4 && dirname /usr/share/aclocal/pkg.m4)
+
# Disable autopoint and libtoolize, since they were already done above.
-AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install
+AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose -I $pkgm4dir --install
--
1.7.3.1
12 years, 6 months
[hivex] OS X: Augment pkg-config search path
by Alex Nelson
Hello all,
I found OS X still has one remaining issue in the autotools. OS X does not include pkg-config by default, and whatever mechanism installs it places pkg.m4 in some location among:
/opt/local/share/aclocal/pkg.m4
/usr/local/share/aclocal/pkg.m4
PKG_CHECK_MODULES isn't defined if pkg.m4 isn't in /usr/share/aclocal, so ./configure dies without augmenting aclocal's search path.
My question: What is the proper way to augment this path? I see two options available, one at the top of hivex/Makefile.am:
ACLOCAL_AMFLAGS = -I m4 -I /opt/local/share/aclocal
And one at the bottom of hivex/bootstrap:
AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose -I /opt/local/share/aclocal --install
I just hard-coded one path into those example lines, as I'm simply not sure what the PATH variable I should use is. aclocal dies if a non-existent path component is passed with -I. If I understand correctly, PKG_CONFIG_PATH doesn't appear to be used for finding the base pkg-config macros.
I can somewhat find the path in bootstrap with this clunky line:
pkgm4dir=$(test -f /opt/local/share/aclocal/pkg.m4 && dirname /opt/local/share/aclocal/pkg.m4)||$(test -f /usr/local/share/aclocal/pkg.m4 && dirname /usr/local/share/aclocal/pkg.m4)||$(test -f /usr/share/aclocal/pkg.m4 && dirname /usr/share/aclocal/pkg.m4)
But I suspect there's a better way. Can someone help with what this would be?
--Alex
12 years, 6 months
guestmount -i and xattrs
by Pádraig Brady
I tried to run chcon to set SELinux labels on a guestmounted dir and got:
chcon: failed to change context of `authorized_keys' to
`system_u:object_r:ssh_home_t:s0': Operation not supported
I'm guessing that you need to pass 'seclabel' or 'user_xattr'
or some such mount option to guestmount to support this.
I notice you can pass such options through the -m option
to guestmount, but not -i which we need to use.
Is there a way to support -i and a subsequent chcon(1)?
cheers,
Pádraig.
12 years, 6 months
Re: [Libguestfs] [virt-tools-list] virt-make-fs: Partition 1 has different physical/logical beginnings and endings
by Richard W.M. Jones
On Thu, Jun 07, 2012 at 02:49:14PM +0200, Sebastien Douche wrote:
> On Ubuntu 12.04, I'm trying to create a second disk for a VM. The disk
> seems work well (and mounted) but I don't like the cfdisk / fdisk
> message.
>
> # virt-make-fs --partition --size=+300M --type=ext3 --format=qcow2
> srv-2912.tar.gz datadisk-test.qcow2
> Formatting 'datadisk-test.qcow2', fmt=qcow2 size=393837568
> encryption=off cluster_size=65536
>
> # virt-filesystems -a datadisk-test.qcow2
> /dev/sda1
>
> I add the disk on the VM:
>
> <disk type='file' device='disk'>
> <driver name='qemu' type='qcow2' cache='none'/>
> <source file='/srv/kvm/lib/datadisk-test.qcow2'/>
> <target dev='hdb' bus='ide'/>
> <address type='drive' controller='0' bus='1' unit='0'/>
> </disk>
>
>
> The dmesg seems good :
>
> [ 1.404447] scsi 1:0:0:0: Direct-Access ATA QEMU HARDDISK
> 1.0 PQ: 0 ANSI: 5
> [ 1.545945] sd 0:0:0:0: [sda] 8388608 512-byte logical blocks:
> (4.29 GB/4.00 GiB)
> [ 1.554467] sd 1:0:0:0: [sdb] 769214 512-byte logical blocks: (393
> MB/375 MiB)
> [ 1.555975] sd 1:0:0:0: [sdb] Write Protect is off
> [ 1.556943] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
> [ 1.556969] sd 1:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [ 1.559923] sdb:
> [ 1.560603] sd 0:0:0:0: [sda] Write Protect is off
> [ 1.561837] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> [ 1.561864] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [ 1.563637] sda: sdb1
>
> But fdisk said :
>
> Command (m for help): p
>
> Disk /dev/sdb: 393 MB, 393837568 bytes
> 223 heads, 46 sectors/track, 74 cylinders
> Units = cylinders of 10258 * 512 = 5252096 bytes
> Disk identifier: 0x0002345e
>
> Device Boot Start End Blocks Id System
> /dev/sdb1 1 75 384479+ 83 Linux
> Partition 1 has different physical/logical beginnings (non-Linux?):
> phys=(0, 2, 3) logical=(0, 2, 37)
> Partition 1 has different physical/logical endings:
> phys=(47, 222, 46) logical=(74, 217, 13)
>
> And cfdisk:
> FATAL ERROR: Bad primary partition 0: Partition ends in the final
> partial cylinder
>
> Have I missed something? Any ideas?
This is caused because virtio (used by libguestfs) and the IDE
emulation (used by your VM) guess different CHS values for this disk.
To be honest I would simply ignore this warning, since CHS values
don't matter for virtual machine disks. If you really want to fix it,
you could modify your guest to use virtio-blk, which will also make
the guest run much faster.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
12 years, 6 months
Re: [Libguestfs] Ocaml and pthread_atfork()
by Richard W.M. Jones
On Thu, May 03, 2012 at 02:00:27PM +1000, Tony Breeds wrote:
> Hi All,
> Firstly I apologize if this is noise. I elected to not file a
> bugzilla as the problem seems to be powerpc specific and with the limited
> resources for Fedora developers it would seem unfair.
>
> I was recently trying to build a "current" libguestfs from the f16
> branch[1]. During the build I hit:
>
> (extracted from rpmbuild)
>
> [tony@sneetch ~]$ bash -x tmp/ocaml-test.sh
> + cd rpmbuild/BUILD/libguestfs-1.16.9/ocaml/
> + LD_LIBRARY_PATH=../src/.libs
> + ocamlfind ocamlc -g -warn-error CDEFLMPSUVYZX -I . -package unix,threads -thread -linkpkg mlguestfs.cma t/guestfs_070_threads.cmo -o t/guestfs_070_threads.bc
> File "_none_", line 1, characters 0-1:
> Error: Error on dynamically loaded library: /usr/lib64/ocaml/stublibs/dllthreads.so: /usr/lib64/ocaml/stublibs/dllthreads.so: undefined symbol: pthread_atfork
>
> I did a quick bit of googling and found:
> http://ryanarn.blogspot.com.au/2011/07/curious-case-of-pthreadatfork-on.html
>
> which seems to explain what's going on to my naive eye anyway.
>
> I've tried a few different CFLAGS/patches to
> otherlibs/systhreads/Makefile to try and induce pthreads_atfork() to be
> resolved and linked during the ocaml build. Nothing I try works.
>
> Does anyone have any ideas on how to solve this?
>
> I'm happy to do the heavy lifting I just don't have the background in
> ocaml to solve this by myself.
>
> Yours Tony
>
> [1] I suspects that as a result of the demotion to secondary and things
> languishing there we skipped a few builds.
It looks like the PPC64 OCaml package is buggy. Can you compile any
threaded program at all, eg:
echo 'print_endline "hello"' > test.ml
ocamlfind c -package threads -thread test.ml -linkpkg -o test
./test
Unfortunately I don't have access to ppc64, so there's no way I can
even look at bugs in this area, let alone fix them.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
12 years, 6 months