THIS STUDY IS IN PROGRESS
Author: Edmondas Girkantas
Interested parties: Veli Kaksonen
The developer shall be able to extend the sysroot with additional libraries.
See http://bugs.meego.com/show_bug.cgi?id=9427
Main assets are:
Sysroots can be in a form of:
Libraries can be in a form of:
Possible environments (that can be used to build sysroot and install library):
For RPM packages
For source tarballs:
Copying options:
Implement extra rpm package (mad-admin xrpm) installation/removal interface (like existing xdpkg)
It is possible to download single rpm package and extract content to sysroot:
rpm2cpio LIBRARY.rpm | cpio -idmv
Note: probably need to create symlinks from /usr/lib to /lib
If package has other dependencies then it is possible to use QEMU/device:
zypper install --download-only <package_name>
Packages will be placed (on device/vm) in
/var/cache/zypp/packages/
Download existing library (rpm) and put it to sysroot, then use mic-chroot to enter sysroot environment.
Note: this is only for meege-core-* sysroots, because zypper is available on other sysroots
Fetch prebuilt package (on MeeGo emulator/device):
# zypper install --download-only <package_name>
The package and all dependencies will be stored (on Linux) in this directory:
/var/cache/zypp/packages/
copy all files to sysroot, e.g.
/usr/lib/madde/linux-i686/sysroots/meego-core-ia32-madde-sysroot-1.1-fs/
enter sysroot environment:
$ sudo mic-chroot <path_to_sysroot>
install package manually:
$ sudo rpm -i <package>
exit from chrooted environment:
$ exit
Use ssh protocol and rsync to copy files from QEMU to host system.
Idea: Maybe we don't need to sync full filesystem, in most cases /usr/lib and /usr/include are enough
Note: Perhaps it's possible to improve rsync performance by changing buffer size, e.g.:
$ rsync -a --sockopts=SO_SNDBUF=2000000,SO_RCVBUF=2000000 ...
Note: rsync exists by default only on handset qemu image
file has vanished: "/home/meego/.cache/tracker/fulltext.db-journal" file has vanished: "/home/meego/.cache/tracker/meta.db-journal" rsync warning: some files vanished before they could be transferred (code 24) at main.c(1526) [generator=3.0.7]
Use madde cross compilation target and installation prefix.
An example:
$ wget http://sqlite.org/sqlite-autoconf-3070500.tar.gz $ tar xvzf sqlite-autoconf-3070500.tar.gz $ cd sqlite-autoconf-3070500/ $ mad -t meego-handset-ia32-1.1.2 ./configure --prefix \ /usr/lib/madde/linux-i686/sysroots/meego-handset-ia32-madde-sysroot-1.1.20110106.1204-fs/ $ mad -t meego-handset-ia32-1.1.2 make $ sudo mad -t meego-handset-ia32-1.1.2 make install
Other interesting way:
mad -t <target> bash --noprofile --norc
Fetch library source-code and build it in chrooted environment.
An example:
$ sudo mic-chroot /usr/lib/madde/linux-i686/sysroots/meego-core-ia32-madde-sysroot-1.1-fs # cd /root # curl -o sqlite-autoconf-3070500.tar.gz http://sqlite.org/sqlite-autoconf-3070500.tar.gz # tar xvzf sqlite-autoconf-3070500.tar.gz # cd sqlite-autoconf-3070500 # ./configure --prefix /usr # make && make install # exit
Same as for RPM
Testing plan - install 5 different libraries, measure installation and synchronisation time.
List of libraries used in this test:
Note: packages are listed without dependencies
Results table for netbook vm (without stopping vm every time before installing new library, install/sync times is better because of os caching):
| Library | RPMs count | Used space | 1 test: install time | 1 test: sync time | 2 test: install time | 2 test: sync time | 3 test: install time | 3 test: sync time | Average install time | Average sync time |
| Initial sync | - | 1414 mb | - | 164 s | - | 180 s | - | 165 s | - | 169 s (2m49s) |
| json-glib | 11 | 1455 mb (+41) | 60 s | 6 s | 113 s | 6 s | 77 s | 6 s | 83 s (1m23s) | 6 s |
| wx | 35 | 1537 mb (+82) | 152 s | 7 s | 293 s | 8 s | 177 s | 7 s | 207s (3m27s) | 7 s |
| boost | 18 | 1758 mb (+221) | 275 s | 22 s | 269 s | 23 s | 262 s | 19 s | 268 s (4m28s) | 21 s |
| apr | 13 | 1771 mb (+13) | 52 s | 3 s | 59 s | 3 s | 67 s | 4 s | 59 s | 3 s |
| uuid | 6 | 1771 mb (<+1) | 13 s | 2 s | 12 s | 1 s | 17 s | 2 s | 14 s | 2 s |
Note: rpm installation time depends on network connectivity
Note: vm startup & shutdown time is not counted
Results table for netbook vm (stopping and starting vm before each installation):
| Library | Used space | 1 test: install time | 1 test: sync time | 2 test: install time | 2 test: sync time | 3 test: install time | 3 test: sync time | Average install time | Average sync time | sync speed mb/s |
| Initial sync | 1414 mb | - | 181 s | - | 170 s | - | 181 s | - | 177 s (2m57s) | ~8.0 |
| json-glib | 1455 mb (+41) | 80 s | 10 s | 50 s | 10 s | 80 s | 10 s | 70 s (1m10s) | 10 s | ~4.1 |
| wx | 1537 mb (+82) | 181 s | 11 s | 116 s | 14 s | 181 s | 11 s | 159 s (2m39s) | 12 s | ~6.8 |
| boost | 1758 mb (+221) | 219 s | 31 s | 141 s | 27 s | 219 s | 31 s | 193 s (3m13s) | 29 s | ~7.6 |
| apr | 1771 mb (+13) | 50 s | 6 s | 38 s | 7 s | 50 s | 6 s | 46 s | 6 s | ~2.2 |
| uuid | 1771 mb (<+1) | 15 s | 5 s | 11 s | 5 s | 15 s | 5 s | 13 s | 5 s | - |
Note: vm startup & shutdown time is not counted
Results table for netbook vm (stopping and starting vm before each installation):
| Library | Used space | 1 test: install time | 1 test: sync time | 2 test: install time | 2 test: sync time | 3 test: install time | 3 test: sync time | Average install time | Average sync time | sync speed mb/s |
| Initial sync | 1414 mb | - | 172 s | - | 202 s | - | 193 s | - | 189 s (3m9s) | ~7.5 |
| json-glib | 1455 mb (+41) | 64 s | 13 s | 54 s | 12 s | 62 s | 13 s | 60 s | 13 s | ~3 |
| wx | 1537 mb (+82) | 125 s | 11 s | 139 s | 17 s | 141 s | 10 s | 135 s | 13 s | ~6.3 |
| boost | 1758 mb (+221) | 127 s | 28 s | 170 s | 29 s | 160 s | 29 s | 152 s | 29 s | ~7.6 |
| apr | 1771 mb (+13) | 36 s | 6 s | 55 s | 7 s | 41 s | 7 s | 44 s | 7 s | ~1.9 |
| uuid | 1771 mb | 12 s | 5 s | 21 s | 6 s | 12 s | 6 s | 15 s | 6 s | - |
Note: vm startup & shutdown time is not counted
Untested
There is rsync version for Windows (uses cygwin libs) - cwrsync
Another option is to install full cygwin environment, which has rsync package
Performance of rsync on Windows OS is really bad (from cygwin):
time rsync --exclude '/proc' --exclude '/dev' --exclude '/sys' \ -a -e 'ssh -p 6666' root@127.0.0.1:/ sysroot real 20m43.933s user 1m23.660s sys 4m26.541s
du -h --max-depth=0 sysroot 1.6G sysroot/
sync speed is only ~1.4 MB/s
Question: why it is so slow? Possible answers: Antivirus / SSH protocol / Cygwin / Other?
Use rsync (TCP/873) protocol (rsync --daemon) to copy files from QEMU to host system.
Used commands:
rsync -a \
--exclude '/proc' \
--exclude '/dev' \
--exclude '/sys' \
rsync://root@127.0.0.1:1873/rsync sysroot
du -h --max-depth=0 ./sysroot/
Initial copy time:
$ time ./rsync-rsyncd.sh real 4m56.249s user 0m8.997s sys 0m23.113s
1.7G ./sysroot/
I found that initial copying of files using rsync protocol is slower than using ssh protocol.
rsync + ssh ~3m 20s rsync + rsyncd ~4m 56s diff ~1m 36s
Mount existing QEMU image (with installed library) then copy files (changes) to selected sysroot.
Options to install library - in a running QEMU machine or using chroot.
Tools for mounting QEMU images (ext3 is used):
There are different tools to mount remote file system (e.g. using ssh protocol)
Tools for mounting remote file systems via ssh:
Cygwin simulates POSIX-compliant symbolic links in the Microsoft Windows file system. It uses identical programming and user utility interfaces as Unix (see above), but creates Windows shortcuts (.lnk files) with additional information used by Cygwin at the time of symlink resolution. Cygwin symlinks are compliant with both Windows and POSIX standards. Some differences exist, however. Cygwin has no way to specify shortcut-related information - such as working directory or icon - as there is no place for such parameters in ln -s command. To create standard Microsoft .lnk files Cygwin provides the mkshortcut and readshortcut utilities.
Tools to create symlinks on Windows file system:
TBD
unison - a file-synchronization tool for Unix and Windows
zsync - rsync over HTTP
idea: install & configure samba on QEMU machine then try to mount this share and use as sysroot
TBD
Idea: Try to mount QEMU image using filedisk and then map partition using ext2 driver
It's pretty simple to mount QEMU image:
filedisk /mount 0 "FULL_PATH_TO_DISK_IMAGE" LETTER:
But then it's impossible to map this partition to drive, because Ext2 Volume Manager doesn't see it as a physical disk (volume).
List of tools for accessing Ext2 file systems on Windows:
Tools to access qcow2 format images:
TODO: check availability on different OS and test performance
time utility was used to measure performance, e.g.:
$ time sudo mad-admin create -e -f meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime Extracting QEMU runtime meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime .....9....8....7....6....5....4....3....2....1....0 Creating missing links... done. real 2m54.520s user 2m15.132s sys 0m4.608s
rsync has --stats option, which gives information about copying speed and etc.
Description of hardware used in this study
Linux machine:
Windows machine:
IN PROGRESS
Because there are different types of libraries (RPM or source tarball), therefore real implementation of this sysroot extension could differ.
TBD
At the moment there is no target milestone for this feature.