From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../recipes-core/base-files/base-files/filesystems | 8 + meta/recipes-core/base-files/base-files/fstab | 12 + meta/recipes-core/base-files/base-files/host.conf | 2 + meta/recipes-core/base-files/base-files/inputrc | 61 + meta/recipes-core/base-files/base-files/issue | 0 meta/recipes-core/base-files/base-files/issue.net | 0 .../base-files/base-files/licenses/GPL-2 | 340 ++ meta/recipes-core/base-files/base-files/motd | 0 .../base-files/base-files/nsswitch.conf | 19 + meta/recipes-core/base-files/base-files/profile | 32 + meta/recipes-core/base-files/base-files/rotation | 1 + .../base-files/base-files/share/dot.bashrc | 16 + .../base-files/base-files/share/dot.profile | 10 + meta/recipes-core/base-files/base-files/shells | 2 + meta/recipes-core/base-files/base-files/usbd | 0 meta/recipes-core/base-files/base-files_3.0.14.bb | 148 + .../base-passwd/base-passwd/add_shutdown.patch | 19 + .../base-passwd/base-passwd/disable-docs.patch | 24 + .../base-passwd/base-passwd/input.patch | 22 + .../base-passwd/base-passwd/nobash.patch | 15 + .../base-passwd/base-passwd/noshadow.patch | 14 + .../recipes-core/base-passwd/base-passwd_3.5.29.bb | 97 + meta/recipes-core/busybox/busybox.inc | 406 ++ ...m-Specify-nostldlib-when-linking-to-.o-fi.patch | 40 + .../busybox/busybox-appletlib-dependency.patch | 37 + .../busybox/busybox-udhcpc-no_deconfig.patch | 137 + meta/recipes-core/busybox/busybox/defconfig | 1020 ++++ .../busybox/busybox/fail_on_no_media.patch | 31 + .../busybox/busybox/get_header_tar.patch | 22 + .../busybox/busybox/login-utilities.cfg | 13 + meta/recipes-core/busybox/busybox_1.22.1.bb | 42 + meta/recipes-core/busybox/busybox_git.bb | 46 + meta/recipes-core/busybox/files/busybox-cron | 39 + meta/recipes-core/busybox/files/busybox-httpd | 44 + .../busybox/files/busybox-klogd.service.in | 8 + .../busybox/files/busybox-syslog.default | 25 + .../busybox/files/busybox-syslog.service.in | 13 + meta/recipes-core/busybox/files/busybox-udhcpd | 43 + meta/recipes-core/busybox/files/default.script | 4 + .../recipes-core/busybox/files/find-touchscreen.sh | 9 + meta/recipes-core/busybox/files/hwclock.sh | 83 + meta/recipes-core/busybox/files/inetd | 33 + meta/recipes-core/busybox/files/inetd.conf | 20 + meta/recipes-core/busybox/files/mdev | 7 + meta/recipes-core/busybox/files/mdev.conf | 37 + meta/recipes-core/busybox/files/mount.busybox | 3 + meta/recipes-core/busybox/files/run-ptest | 7 + meta/recipes-core/busybox/files/simple.script | 86 + meta/recipes-core/busybox/files/syslog | 77 + .../recipes-core/busybox/files/syslog-startup.conf | 13 + meta/recipes-core/busybox/files/syslog.conf | 1 + meta/recipes-core/busybox/files/umount.busybox | 3 + .../console-tools/console-tools-0.3.2/Makevars | 41 + .../console-tools-0.3.2/codepage.patch | 17 + .../console-tools-0.3.2/compile.patch | 12 + .../console-tools-0.3.2/configure.patch | 29 + .../fix-libconsole-linking.patch | 56 + .../console-tools-0.3.2/kbdrate.patch | 75 + .../console-tools/console-tools-0.3.2/lcmessage.m4 | 24 + .../console-tools/console-tools-0.3.2/nodocs.patch | 22 + .../console-tools-0.3.2/uclibc-fileno.patch | 49 + .../console-tools/console-tools_0.3.2.bb | 36 + .../coreutils-6.9/coreutils-6.9-cp-i-u.patch | 120 + .../coreutils-6.9/coreutils-build-with-acl.patch | 28 + .../coreutils-6.9/coreutils-fix-install.patch | 101 + .../coreutils-6.9/coreutils-fix-texinfo.patch | 375 ++ .../coreutils/coreutils-6.9/coreutils-i18n.patch | 4051 +++++++++++++++ .../coreutils/coreutils-6.9/coreutils-ls-x.patch | 117 + .../coreutils-6.9/coreutils-overflow.patch | 19 + .../coreutils_fix_for_automake-1.12.patch | 32 + .../coreutils-6.9/fix_for_manpage_building.patch | 85 + .../coreutils/coreutils-6.9/futimens.patch | 63 + .../coreutils/coreutils-6.9/gnulib_m4.patch | 21 + .../coreutils/coreutils-6.9/man-touch.patch | 24 + .../coreutils/coreutils-8.22/dummy_help2man.patch | 22 + .../coreutils-8.22/fix-for-dummy-man-usage.patch | 31 + .../remove-usr-local-lib-from-m4.patch | 31 + meta/recipes-core/coreutils/coreutils_6.9.bb | 106 + meta/recipes-core/coreutils/coreutils_8.22.bb | 101 + meta/recipes-core/dbus-wait/dbus-wait_git.bb | 17 + .../dbus/dbus-glib-0.100.2/no-examples.patch | 15 + .../obsolete_automake_macros.patch | 15 + .../dbus-glib-0.100.2/test-install-makefile.patch | 48 + meta/recipes-core/dbus/dbus-glib.inc | 44 + meta/recipes-core/dbus/dbus-glib_0.100.2.bb | 5 + meta/recipes-core/dbus/dbus-test_1.6.18.bb | 54 + meta/recipes-core/dbus/dbus.inc | 157 + ...orrect-address-when-using-address-systemd.patch | 193 + .../dbus/dbus/avoid_parallel_tests.patch | 19 + ...guid_from_server-if-send_negotiate_unix_f.patch | 104 + meta/recipes-core/dbus/dbus/dbus-1.init | 123 + ...y-freeing-if-error-during-listing-service.patch | 45 + meta/recipes-core/dbus/dbus/os-test.patch | 35 + meta/recipes-core/dbus/dbus/ptest.patch | 154 + meta/recipes-core/dbus/dbus/python-config.patch | 25 + meta/recipes-core/dbus/dbus/run-ptest | 3 + meta/recipes-core/dbus/dbus/tmpdir.patch | 44 + meta/recipes-core/dbus/dbus_1.6.18.bb | 4 + .../dropbear/dropbear-2013.58/build_test.patch | 229 + meta/recipes-core/dropbear/dropbear.inc | 99 + .../0001-urandom-xauth-changes-to-options.h.patch | 23 + .../dropbear/dropbear/0003-configure.patch | 40 + .../dropbear/dropbear/0004-fix-2kb-keys.patch | 22 + .../dropbear/0005-dropbear-enable-pam.patch | 28 + .../0006-dropbear-configuration-file.patch | 22 + .../dropbear/0007-dropbear-fix-for-x32-abi.patch | 140 + meta/recipes-core/dropbear/dropbear/dropbear | 4 + .../recipes-core/dropbear/dropbear/dropbear.socket | 10 + .../dropbear/dropbear/dropbear@.service | 11 + .../dropbear/dropbear/dropbearkey.service | 8 + meta/recipes-core/dropbear/dropbear/init | 113 + meta/recipes-core/dropbear/dropbear/run-ptest | 2 + meta/recipes-core/dropbear/dropbear_2014.63.bb | 4 + .../eglibc/cross-localedef-native_2.19.bb | 49 + .../eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch | 56 + .../0001-eglibc-menuconfig-support.patch | 912 ++++ ...n-libm-err-tab.pl-with-specific-dirs-in-S.patch | 36 + ...0002-eglibc-menuconfig-hex-string-options.patch | 169 + ...0003-eglibc-menuconfig-build-instructions.patch | 176 + .../eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch | 143 + .../eglibc/eglibc-2.19/IO-acquire-lock-fix.patch | 17 + .../eglibc-2.19/add_resource_h_to_wait_h.patch | 20 + .../eglibc-svn-arm-lowlevellock-include-tls.patch | 21 + .../eglibc_fix_findidx_parameters.patch | 38 + .../recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf | 0 .../eglibc-2.19/fileops-without-wchar-io.patch | 22 + .../eglibc/eglibc-2.19/fix-tibetian-locales.patch | 38 + .../eglibc/eglibc-2.19/fix_for_centos_5.8.patch | 18 + .../eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch | 100 + .../eglibc/eglibc-2.19/generate-supported.mk | 11 + .../eglibc/eglibc-2.19/glibc.fix_sqrt2.patch | 1516 ++++++ .../eglibc/eglibc-2.19/initgroups_keys.patch | 20 + .../eglibc/eglibc-2.19/ld-search-order.patch | 56 + .../eglibc/eglibc-2.19/mips-rld-map-check.patch | 26 + .../eglibc/eglibc-2.19/multilib_readlib.patch | 17 + .../eglibc/eglibc-2.19/ppc-sqrt_finite.patch | 184 + .../eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch | 365 ++ .../ppce6500-32b_slow_ieee754_sqrt.patch | 47 + .../eglibc/eglibc-2.19/relocatable_sdk.patch | 108 + .../eglibc-2.19/relocatable_sdk_fix_openpath.patch | 41 + meta/recipes-core/eglibc/eglibc-collateral.inc | 12 + meta/recipes-core/eglibc/eglibc-common.inc | 9 + meta/recipes-core/eglibc/eglibc-initial.inc | 78 + meta/recipes-core/eglibc/eglibc-initial_2.19.bb | 11 + meta/recipes-core/eglibc/eglibc-ld.inc | 56 + meta/recipes-core/eglibc/eglibc-locale.inc | 96 + meta/recipes-core/eglibc/eglibc-locale_2.19.bb | 1 + meta/recipes-core/eglibc/eglibc-mtrace.inc | 13 + meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb | 1 + meta/recipes-core/eglibc/eglibc-options.inc | 162 + meta/recipes-core/eglibc/eglibc-package.inc | 155 + meta/recipes-core/eglibc/eglibc-scripts.inc | 16 + meta/recipes-core/eglibc/eglibc-scripts_2.19.bb | 1 + meta/recipes-core/eglibc/eglibc-testing.inc | 79 + meta/recipes-core/eglibc/eglibc.inc | 84 + meta/recipes-core/eglibc/eglibc_2.19.bb | 146 + .../eglibc/ldconfig-native-2.12.1/32and64bit.patch | 331 ++ .../eglibc/ldconfig-native-2.12.1/README | 8 + .../endian-ness_handling.patch | 454 ++ .../ldconfig-native-2.12.1/endianess-header.patch | 113 + .../eglibc/ldconfig-native-2.12.1/flag_fix.patch | 24 + .../ldconfig-native-2.12.1.tar.bz2 | Bin 0 -> 21491 bytes .../eglibc/ldconfig-native-2.12.1/ldconfig.patch | 471 ++ .../ldconfig_aux-cache_path_fix.patch | 36 + meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb | 30 + meta/recipes-core/eglibc/site_config/funcs | 474 ++ meta/recipes-core/eglibc/site_config/headers | 156 + meta/recipes-core/eglibc/site_config/types | 21 + .../recipes-core/expat/expat-2.1.0/autotools.patch | 24 + meta/recipes-core/expat/expat.inc | 20 + meta/recipes-core/expat/expat_2.1.0.bb | 5 + .../feed-config/poky-feed-config-opkg_1.0.bb | 44 + .../gettext/gettext-0.16.1/disable_java.patch | 39 + .../gettext-0.16.1/fix_aclocal_version.patch | 110 + .../gettext-0.16.1/fix_gnu_source_circular.patch | 348 ++ .../gettext-autoconf-lib-link-no-L.patch | 19 + .../gettext-error_print_progname.patch | 19 + .../gettext/gettext-0.16.1/gettext-vpath.patch | 20 + .../gettext-0.16.1/hardcode_macro_version.patch | 51 + .../gettext/gettext-0.16.1/linklib_from_0.17.patch | 720 +++ .../gettext/gettext-0.18.3.2/parallel.patch | 36 + .../gettext/gettext-minimal-0.18.3.2/COPYING | 4 + .../gettext-minimal-0.18.3.2/Makefile.in.in | 454 ++ .../gettext-minimal-0.18.3.2/Makevars.template | 53 + .../gettext/gettext-minimal-0.18.3.2/aclocal.tgz | Bin 0 -> 37591 bytes .../gettext/gettext-minimal-0.18.3.2/config.rpath | 690 +++ ...conv-m4-remove-the-test-to-convert-euc-jp.patch | 43 + .../gettext-minimal-0.18.3.2/remove-potcdate.sin | 19 + .../gettext/gettext-minimal-native_0.18.3.2.bb | 32 + meta/recipes-core/gettext/gettext_0.16.1.bb | 109 + meta/recipes-core/gettext/gettext_0.18.3.2.bb | 106 + ...ror-format-string-errors-from-mismatched-.patch | 56 + .../add-march-i486-into-CFLAGS-automatically.patch | 39 + .../glib-2.0/glib-2.0/configure-libtool.patch | 60 + .../glib-2.0/glib-2.0/fix-conflicting-rand.patch | 35 + .../glib-2.0/glib-2.0/gio-test-race.patch | 54 + .../glib-2.0/glib-2.0-configure-readlink.patch | 29 + .../glib-2.0/glib-2.0/glib-gettextize-dir.patch | 24 + .../glib-2.0/glib-2.0/gtest-skip-fixes.patch | 197 + .../glib-2.0/glib-2.0/ptest-dbus.patch | 65 + .../glib-2.0/glib-2.0/ptest-paths.patch | 30 + meta/recipes-core/glib-2.0/glib-2.0/run-ptest | 3 + meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch | 20 + meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb | 24 + meta/recipes-core/glib-2.0/glib.inc | 98 + .../glib-networking/glib-networking_2.38.0.bb | 32 + .../Yocto_Build_Appliance.vmx | 52 + .../Yocto_Build_Appliance.vmxf | 8 + .../images/build-appliance-image_8.0.bb | 93 + meta/recipes-core/images/core-image-base.bb | 8 + meta/recipes-core/images/core-image-minimal-dev.bb | 7 + .../images/core-image-minimal-initramfs.bb | 21 + .../images/core-image-minimal-mtdutils.bb | 7 + meta/recipes-core/images/core-image-minimal.bb | 12 + .../init-ifupdown/init-ifupdown-1.0/copyright | 11 + .../init-ifupdown/init-ifupdown-1.0/init | 90 + .../init-ifupdown/init-ifupdown-1.0/interfaces | 31 + .../init-ifupdown/init-ifupdown-1.0/nfsroot | 39 + .../init-ifupdown-1.0/qemuarm/interfaces | 5 + .../init-ifupdown-1.0/qemuarmv6/interfaces | 5 + .../init-ifupdown-1.0/qemuarmv7/interfaces | 5 + .../init-ifupdown-1.0/qemumips/interfaces | 8 + .../init-ifupdown-1.0/qemumips64/interfaces | 8 + .../init-ifupdown-1.0/qemuppc/interfaces | 8 + .../init-ifupdown-1.0/qemush4/interfaces | 8 + .../init-ifupdown-1.0/qemux86-64/interfaces | 8 + .../init-ifupdown-1.0/qemux86/interfaces | 8 + .../init-ifupdown/init-ifupdown_1.0.bb | 39 + meta/recipes-core/initrdscripts/files/init-boot.sh | 10 + .../initrdscripts/files/init-install-efi-testfs.sh | 199 + .../initrdscripts/files/init-install-efi.sh | 197 + .../initrdscripts/files/init-install-testfs.sh | 211 + .../initrdscripts/files/init-install.sh | 208 + meta/recipes-core/initrdscripts/files/init-live.sh | 223 + .../initrdscripts/initramfs-boot_1.0.bb | 14 + .../initrdscripts/initramfs-framework/debug | 82 + .../initrdscripts/initramfs-framework/e2fs | 28 + .../initrdscripts/initramfs-framework/finish | 47 + .../initrdscripts/initramfs-framework/init | 140 + .../initrdscripts/initramfs-framework/mdev | 30 + .../initrdscripts/initramfs-framework/udev | 45 + .../initrdscripts/initramfs-framework_1.0.bb | 59 + .../initrdscripts/initramfs-live-boot_1.0.bb | 17 + .../initramfs-live-install-efi-testfs_1.0.bb | 14 + .../initramfs-live-install-efi_1.0.bb | 22 + .../initramfs-live-install-testfs_1.0.bb | 14 + .../initrdscripts/initramfs-live-install_1.0.bb | 22 + .../initscripts/initscripts-1.0/GPLv2.patch | 347 ++ .../initscripts/initscripts-1.0/arm/alignment.sh | 13 + .../initscripts/initscripts-1.0/banner.sh | 24 + .../initscripts/initscripts-1.0/bootmisc.sh | 71 + .../initscripts/initscripts-1.0/checkfs.sh | 50 + .../initscripts/initscripts-1.0/checkroot.sh | 148 + .../initscripts/initscripts-1.0/devpts | 5 + .../initscripts/initscripts-1.0/devpts.sh | 28 + .../initscripts/initscripts-1.0/dmesg.sh | 17 + .../initscripts/initscripts-1.0/functions | 91 + meta/recipes-core/initscripts/initscripts-1.0/halt | 29 + .../initscripts/initscripts-1.0/hostname.sh | 22 + .../initscripts-1.0/logrotate-dmesg.conf | 9 + .../initscripts/initscripts-1.0/mountall.sh | 39 + .../initscripts/initscripts-1.0/mountnfs.sh | 88 + .../initscripts-1.0/populate-volatile.sh | 220 + .../initscripts-1.0/read-only-rootfs-hook.sh | 38 + .../initscripts/initscripts-1.0/reboot | 15 + .../initscripts/initscripts-1.0/rmnologin.sh | 20 + .../initscripts/initscripts-1.0/save-rtc.sh | 13 + .../initscripts/initscripts-1.0/sendsigs | 21 + .../initscripts/initscripts-1.0/single | 24 + .../initscripts/initscripts-1.0/sysfs.sh | 23 + .../initscripts/initscripts-1.0/umountfs | 24 + .../initscripts/initscripts-1.0/umountnfs.sh | 33 + .../initscripts/initscripts-1.0/urandom | 46 + .../initscripts/initscripts-1.0/volatiles | 36 + meta/recipes-core/initscripts/initscripts_1.0.bb | 160 + .../jpeg/jpeg-8d/debian-libjpeg7_7-1.diff | 1070 ++++ .../jpeg/jpeg-8d/fix_for_automake_1.12.1.patch | 44 + meta/recipes-core/jpeg/jpeg_8d.bb | 51 + meta/recipes-core/kbd/kbd/uclibc-stdarg.patch | 36 + meta/recipes-core/kbd/kbd_2.0.1.bb | 35 + meta/recipes-core/libcgroup/libcgroup_0.41.bb | 41 + meta/recipes-core/libxml/libxml2.inc | 61 + meta/recipes-core/libxml/libxml2/ansidecl.patch | 25 + .../recipes-core/libxml/libxml2/libxml-64bit.patch | 22 + .../libxml/libxml2/libxml2-CVE-2014-0191-fix.patch | 37 + meta/recipes-core/libxml/libxml2/run-ptest | 3 + meta/recipes-core/libxml/libxml2/runtest.patch | 820 ++++ meta/recipes-core/libxml/libxml2_2.9.1.bb | 8 + meta/recipes-core/meta/buildtools-tarball.bb | 71 + meta/recipes-core/meta/meta-environment.bb | 51 + meta/recipes-core/meta/meta-ide-support.bb | 18 + meta/recipes-core/meta/meta-toolchain.bb | 9 + meta/recipes-core/meta/package-index.bb | 29 + meta/recipes-core/ncurses/ncurses-5.9/config.cache | 4 + .../ncurses/ncurses-5.9/tic-hang.patch | 27 + meta/recipes-core/ncurses/ncurses.inc | 292 ++ meta/recipes-core/ncurses/ncurses_5.9.bb | 10 + meta/recipes-core/ncurses/site_config/headers | 5 + meta/recipes-core/netbase/netbase/hosts | 2 + meta/recipes-core/netbase/netbase_5.2.bb | 23 + .../nativesdk-packagegroup-sdk-host.bb | 33 + .../packagegroups/packagegroup-base.bb | 373 ++ .../packagegroups/packagegroup-core-boot.bb | 52 + .../packagegroup-core-buildessential.bb | 29 + .../packagegroup-core-eclipse-debug.bb | 10 + .../packagegroups/packagegroup-core-nfs.bb | 22 + .../packagegroups/packagegroup-core-sdk.bb | 77 + .../packagegroup-core-ssh-dropbear.bb | 12 + .../packagegroups/packagegroup-core-ssh-openssh.bb | 12 + .../packagegroup-core-standalone-sdk-target.bb | 22 + .../packagegroups/packagegroup-core-tools-debug.bb | 27 + .../packagegroup-core-tools-profile.bb | 86 + .../packagegroup-core-tools-testapps.bb | 63 + .../packagegroups/packagegroup-cross-canadian.bb | 18 + .../packagegroups/packagegroup-self-hosted.bb | 229 + meta/recipes-core/psplash/files/psplash-init | 29 + meta/recipes-core/psplash/files/psplash-poky-img.h | 1259 +++++ meta/recipes-core/psplash/psplash_git.bb | 111 + meta/recipes-core/readline/files/acinclude.m4 | 1871 +++++++ meta/recipes-core/readline/files/norpath.patch | 21 + .../readline/readline-5.2/acinclude.m4 | 1815 +++++++ .../readline/readline-5.2/configure-fix.patch | 26 + .../readline-5.2/fix-redundant-rpath.patch | 21 + .../readline/readline-6.3/configure-fix.patch | 35 + meta/recipes-core/readline/readline.inc | 37 + meta/recipes-core/readline/readline_5.2.bb | 82 + meta/recipes-core/readline/readline_6.3.bb | 5 + .../obsolete_automake_macros.patch | 15 + .../sysfsutils-2.1.0/separatebuild.patch | 65 + .../sysfsutils-2.0.0-class-dup.patch | 23 + meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb | 29 + meta/recipes-core/systemd/systemd-compat-units.bb | 41 + meta/recipes-core/systemd/systemd-serialgetty.bb | 49 + .../systemd-serialgetty/serial-getty@.service | 36 + .../systemd/systemd-systemctl-native.bb | 15 + .../systemd/systemd-systemctl/systemctl | 153 + .../systemd/systemd/00-create-volatile.conf | 7 + ...1-uClibc-doesn-t-implement-pwritev-preadv.patch | 34 + .../systemd/systemd/binfmt-install.patch | 56 + meta/recipes-core/systemd/systemd/init | 104 + .../systemd/systemd/optional_secure_getenv.patch | 19 + meta/recipes-core/systemd/systemd/run-ptest | 3 + ...t-use-assert_return-to-check-for-disconne.patch | 513 ++ .../systemd-pam-configure-check-uclibc.patch | 32 + .../systemd/systemd/systemd-pam-fix-execvpe.patch | 29 + .../systemd/systemd-pam-fix-fallocate.patch | 84 + .../systemd/systemd-pam-fix-getty-unit.patch | 35 + .../systemd/systemd/systemd-pam-fix-mkostemp.patch | 30 + .../recipes-core/systemd/systemd/touchscreen.rules | 18 + .../systemd/systemd/uclibc-get-physmem.patch | 37 + .../systemd/systemd/uclibc-sysinfo_h.patch | 19 + meta/recipes-core/systemd/systemd_211.bb | 353 ++ .../sysvinit/sysvinit-2.88dsf/crypt-lib.patch | 25 + .../sysvinit/sysvinit-2.88dsf/install.patch | 83 + .../sysvinit-2.88dsf/pidof-add-m-option.patch | 189 + .../recipes-core/sysvinit/sysvinit-inittab/inittab | 30 + .../sysvinit/sysvinit-inittab_2.88dsf.bb | 82 + meta/recipes-core/sysvinit/sysvinit/bootlogd.init | 96 + meta/recipes-core/sysvinit/sysvinit/rc | 179 + meta/recipes-core/sysvinit/sysvinit/rcS | 34 + meta/recipes-core/sysvinit/sysvinit/rcS-default | 29 + meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 97 + meta/recipes-core/uclibc/site_config/funcs | 474 ++ meta/recipes-core/uclibc/site_config/headers | 156 + meta/recipes-core/uclibc/site_config/types | 21 + meta/recipes-core/uclibc/uclibc-config.inc | 142 + meta/recipes-core/uclibc/uclibc-git.inc | 29 + .../0001-Add-eventfd_read-and-eventfd_write.patch | 120 + ...nt.c-wtent.c-move-functions-from-utxent.c.patch | 319 ++ ...1-atexit_old-Do-not-add-it-to-shared-libc.patch | 44 + ...brt-Use-nodefaultlibs-instead-of-nostdlib.patch | 33 + ...-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch | 28 + ...rk-Hide-pthread_atfork-in-shared-versions.patch | 74 + .../uclibc-git/0002-wire-setns-syscall.patch | 68 + ...tl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch | 377 ++ .../0004-Add-clock_adjtime-syscall.patch | 73 + .../uclibc/uclibc-git/argp-headers.patch | 583 +++ .../uclibc/uclibc-git/argp-support.patch | 5192 ++++++++++++++++++++ .../uclibc-git/compile-arm-fork-with-O2.patch | 21 + meta/recipes-core/uclibc/uclibc-git/locale.cfg | 3 + meta/recipes-core/uclibc/uclibc-git/obstack.cfg | 1 + .../uclibc/uclibc-git/orign_path.patch | 186 + .../uclibc/uclibc-git/powerpc_copysignl.patch | 113 + .../uclibc-git/remove_attribute_optimize_Os.patch | 140 + meta/recipes-core/uclibc/uclibc-git/uClibc.distro | 192 + meta/recipes-core/uclibc/uclibc-git/uClibc.machine | 14 + .../uclibc-git/uclibc_enable_log2_test.patch | 35 + meta/recipes-core/uclibc/uclibc-initial_git.bb | 36 + meta/recipes-core/uclibc/uclibc-package.inc | 37 + meta/recipes-core/uclibc/uclibc.inc | 166 + meta/recipes-core/uclibc/uclibc_git.bb | 22 + .../udev/udev-extraconf/automount.rules | 19 + .../recipes-core/udev/udev-extraconf/autonet.rules | 19 + .../udev/udev-extraconf/localextra.rules | 23 + .../udev/udev-extraconf/mount.blacklist | 5 + meta/recipes-core/udev/udev-extraconf/mount.sh | 91 + meta/recipes-core/udev/udev-extraconf/network.sh | 54 + meta/recipes-core/udev/udev-extraconf_1.0.bb | 41 + meta/recipes-core/udev/udev.inc | 107 + ...yboard_force_release.sh-shell-script-path.patch | 35 + .../recipes-core/udev/udev/add-install-ptest.patch | 73 + .../udev/udev/avoid-mouse-autosuspend.patch | 25 + meta/recipes-core/udev/udev/devfs-udev.rules | 108 + meta/recipes-core/udev/udev/init | 133 + meta/recipes-core/udev/udev/links.conf | 21 + meta/recipes-core/udev/udev/local.rules | 22 + meta/recipes-core/udev/udev/permissions.rules | 131 + meta/recipes-core/udev/udev/run-ptest | 3 + meta/recipes-core/udev/udev/run.rules | 14 + meta/recipes-core/udev/udev/udev-cache | 32 + meta/recipes-core/udev/udev/udev-cache.default | 4 + meta/recipes-core/udev/udev/udev.rules | 116 + meta/recipes-core/udev/udev_182.bb | 9 + .../update-rc.d/update-rc.d/add-verbose.patch | 49 + .../update-rc.d/check-if-symlinks-are-valid.patch | 59 + meta/recipes-core/update-rc.d/update-rc.d_0.7.bb | 30 + meta/recipes-core/util-linux/util-linux.inc | 270 + meta/recipes-core/util-linux/util-linux/MCONFIG | 223 + .../util-linux/avoid_parallel_tests.patch | 18 + .../util-linux/avoid_unsupported_find_opts.patch | 38 + .../util-linux/avoid_unsupported_grep_opts.patch | 57 + .../util-linux/avoid_unsupported_sleep_param.patch | 20 + .../util-linux/util-linux/configure-sbindir.patch | 23 + meta/recipes-core/util-linux/util-linux/defines.h | 10 + .../util-linux/display_testname_for_subtest.patch | 17 + .../util-linux/util-linux/fix-configure.patch | 20 + .../util-linux/util-linux/fix-parallel-build.patch | 35 + .../util-linux/util-linux/make_include | 17 + .../recipes-core/util-linux/util-linux/ptest.patch | 16 + meta/recipes-core/util-linux/util-linux/run-ptest | 10 + meta/recipes-core/util-linux/util-linux/swapargs.h | 3 + .../util-linux/uclibc-__progname-conflict.patch | 32 + .../util-linux/util-linux-native-qsort.patch | 34 + .../util-linux/util-linux/util-linux-native.patch | 73 + .../util-linux-ng-2.16-mount_lock_path.patch | 27 + .../util-linux-ng-replace-siginterrupt.patch | 27 + meta/recipes-core/util-linux/util-linux_2.24.1.bb | 31 + meta/recipes-core/zlib/site_config/headers | 1 + .../zlib/zlib-1.2.8/Makefile-runtests.patch | 38 + .../zlib/zlib-1.2.8/remove.ldconfig.call.patch | 20 + meta/recipes-core/zlib/zlib-1.2.8/run-ptest | 2 + meta/recipes-core/zlib/zlib_1.2.8.bb | 60 + 442 files changed, 48288 insertions(+) create mode 100644 meta/recipes-core/base-files/base-files/filesystems create mode 100644 meta/recipes-core/base-files/base-files/fstab create mode 100644 meta/recipes-core/base-files/base-files/host.conf create mode 100644 meta/recipes-core/base-files/base-files/inputrc create mode 100644 meta/recipes-core/base-files/base-files/issue create mode 100644 meta/recipes-core/base-files/base-files/issue.net create mode 100644 meta/recipes-core/base-files/base-files/licenses/GPL-2 create mode 100644 meta/recipes-core/base-files/base-files/motd create mode 100644 meta/recipes-core/base-files/base-files/nsswitch.conf create mode 100644 meta/recipes-core/base-files/base-files/profile create mode 100644 meta/recipes-core/base-files/base-files/rotation create mode 100644 meta/recipes-core/base-files/base-files/share/dot.bashrc create mode 100644 meta/recipes-core/base-files/base-files/share/dot.profile create mode 100644 meta/recipes-core/base-files/base-files/shells create mode 100644 meta/recipes-core/base-files/base-files/usbd create mode 100644 meta/recipes-core/base-files/base-files_3.0.14.bb create mode 100644 meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch create mode 100644 meta/recipes-core/base-passwd/base-passwd/disable-docs.patch create mode 100644 meta/recipes-core/base-passwd/base-passwd/input.patch create mode 100644 meta/recipes-core/base-passwd/base-passwd/nobash.patch create mode 100644 meta/recipes-core/base-passwd/base-passwd/noshadow.patch create mode 100644 meta/recipes-core/base-passwd/base-passwd_3.5.29.bb create mode 100644 meta/recipes-core/busybox/busybox.inc create mode 100644 meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch create mode 100644 meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch create mode 100644 meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch create mode 100644 meta/recipes-core/busybox/busybox/defconfig create mode 100644 meta/recipes-core/busybox/busybox/fail_on_no_media.patch create mode 100644 meta/recipes-core/busybox/busybox/get_header_tar.patch create mode 100644 meta/recipes-core/busybox/busybox/login-utilities.cfg create mode 100644 meta/recipes-core/busybox/busybox_1.22.1.bb create mode 100644 meta/recipes-core/busybox/busybox_git.bb create mode 100755 meta/recipes-core/busybox/files/busybox-cron create mode 100755 meta/recipes-core/busybox/files/busybox-httpd create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.default create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in create mode 100755 meta/recipes-core/busybox/files/busybox-udhcpd create mode 100644 meta/recipes-core/busybox/files/default.script create mode 100644 meta/recipes-core/busybox/files/find-touchscreen.sh create mode 100644 meta/recipes-core/busybox/files/hwclock.sh create mode 100644 meta/recipes-core/busybox/files/inetd create mode 100644 meta/recipes-core/busybox/files/inetd.conf create mode 100755 meta/recipes-core/busybox/files/mdev create mode 100644 meta/recipes-core/busybox/files/mdev.conf create mode 100755 meta/recipes-core/busybox/files/mount.busybox create mode 100644 meta/recipes-core/busybox/files/run-ptest create mode 100644 meta/recipes-core/busybox/files/simple.script create mode 100644 meta/recipes-core/busybox/files/syslog create mode 100644 meta/recipes-core/busybox/files/syslog-startup.conf create mode 100644 meta/recipes-core/busybox/files/syslog.conf create mode 100755 meta/recipes-core/busybox/files/umount.busybox create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/Makevars create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch create mode 100644 meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch create mode 100644 meta/recipes-core/console-tools/console-tools_0.3.2.bb create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/futimens.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch create mode 100644 meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch create mode 100644 meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch create mode 100644 meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch create mode 100644 meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch create mode 100644 meta/recipes-core/coreutils/coreutils_6.9.bb create mode 100644 meta/recipes-core/coreutils/coreutils_8.22.bb create mode 100644 meta/recipes-core/dbus-wait/dbus-wait_git.bb create mode 100644 meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch create mode 100644 meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch create mode 100644 meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch create mode 100644 meta/recipes-core/dbus/dbus-glib.inc create mode 100644 meta/recipes-core/dbus/dbus-glib_0.100.2.bb create mode 100644 meta/recipes-core/dbus/dbus-test_1.6.18.bb create mode 100644 meta/recipes-core/dbus/dbus.inc create mode 100644 meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch create mode 100644 meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch create mode 100644 meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch create mode 100644 meta/recipes-core/dbus/dbus/dbus-1.init create mode 100644 meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch create mode 100644 meta/recipes-core/dbus/dbus/os-test.patch create mode 100644 meta/recipes-core/dbus/dbus/ptest.patch create mode 100644 meta/recipes-core/dbus/dbus/python-config.patch create mode 100755 meta/recipes-core/dbus/dbus/run-ptest create mode 100644 meta/recipes-core/dbus/dbus/tmpdir.patch create mode 100644 meta/recipes-core/dbus/dbus_1.6.18.bb create mode 100644 meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch create mode 100644 meta/recipes-core/dropbear/dropbear.inc create mode 100644 meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0003-configure.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch create mode 100644 meta/recipes-core/dropbear/dropbear/dropbear create mode 100644 meta/recipes-core/dropbear/dropbear/dropbear.socket create mode 100644 meta/recipes-core/dropbear/dropbear/dropbear@.service create mode 100644 meta/recipes-core/dropbear/dropbear/dropbearkey.service create mode 100755 meta/recipes-core/dropbear/dropbear/init create mode 100644 meta/recipes-core/dropbear/dropbear/run-ptest create mode 100644 meta/recipes-core/dropbear/dropbear_2014.63.bb create mode 100644 meta/recipes-core/eglibc/cross-localedef-native_2.19.bb create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch create mode 100644 meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch create mode 100644 meta/recipes-core/eglibc/eglibc-collateral.inc create mode 100644 meta/recipes-core/eglibc/eglibc-common.inc create mode 100644 meta/recipes-core/eglibc/eglibc-initial.inc create mode 100644 meta/recipes-core/eglibc/eglibc-initial_2.19.bb create mode 100644 meta/recipes-core/eglibc/eglibc-ld.inc create mode 100644 meta/recipes-core/eglibc/eglibc-locale.inc create mode 100644 meta/recipes-core/eglibc/eglibc-locale_2.19.bb create mode 100644 meta/recipes-core/eglibc/eglibc-mtrace.inc create mode 100644 meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb create mode 100644 meta/recipes-core/eglibc/eglibc-options.inc create mode 100644 meta/recipes-core/eglibc/eglibc-package.inc create mode 100644 meta/recipes-core/eglibc/eglibc-scripts.inc create mode 100644 meta/recipes-core/eglibc/eglibc-scripts_2.19.bb create mode 100644 meta/recipes-core/eglibc/eglibc-testing.inc create mode 100644 meta/recipes-core/eglibc/eglibc.inc create mode 100644 meta/recipes-core/eglibc/eglibc_2.19.bb create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/README create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch create mode 100644 meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb create mode 100644 meta/recipes-core/eglibc/site_config/funcs create mode 100644 meta/recipes-core/eglibc/site_config/headers create mode 100644 meta/recipes-core/eglibc/site_config/types create mode 100644 meta/recipes-core/expat/expat-2.1.0/autotools.patch create mode 100644 meta/recipes-core/expat/expat.inc create mode 100644 meta/recipes-core/expat/expat_2.1.0.bb create mode 100644 meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch create mode 100644 meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch create mode 100644 meta/recipes-core/gettext/gettext-0.18.3.2/parallel.patch create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz create mode 100755 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/iconv-m4-remove-the-test-to-convert-euc-jp.patch create mode 100644 meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin create mode 100644 meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb create mode 100644 meta/recipes-core/gettext/gettext_0.16.1.bb create mode 100644 meta/recipes-core/gettext/gettext_0.18.3.2.bb create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/run-ptest create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb create mode 100644 meta/recipes-core/glib-2.0/glib.inc create mode 100644 meta/recipes-core/glib-networking/glib-networking_2.38.0.bb create mode 100644 meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx create mode 100644 meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf create mode 100644 meta/recipes-core/images/build-appliance-image_8.0.bb create mode 100644 meta/recipes-core/images/core-image-base.bb create mode 100644 meta/recipes-core/images/core-image-minimal-dev.bb create mode 100644 meta/recipes-core/images/core-image-minimal-initramfs.bb create mode 100644 meta/recipes-core/images/core-image-minimal-mtdutils.bb create mode 100644 meta/recipes-core/images/core-image-minimal.bb create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/files/init-boot.sh create mode 100644 meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh create mode 100644 meta/recipes-core/initrdscripts/files/init-install-efi.sh create mode 100644 meta/recipes-core/initrdscripts/files/init-install-testfs.sh create mode 100644 meta/recipes-core/initrdscripts/files/init-install.sh create mode 100644 meta/recipes-core/initrdscripts/files/init-live.sh create mode 100644 meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-framework/debug create mode 100755 meta/recipes-core/initrdscripts/initramfs-framework/e2fs create mode 100755 meta/recipes-core/initrdscripts/initramfs-framework/finish create mode 100755 meta/recipes-core/initrdscripts/initramfs-framework/init create mode 100644 meta/recipes-core/initrdscripts/initramfs-framework/mdev create mode 100644 meta/recipes-core/initrdscripts/initramfs-framework/udev create mode 100644 meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb create mode 100644 meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/banner.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/devpts create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/devpts.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/functions create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/halt create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/hostname.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/mountall.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/reboot create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/sendsigs create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/single create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/umountfs create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/urandom create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/volatiles create mode 100644 meta/recipes-core/initscripts/initscripts_1.0.bb create mode 100644 meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff create mode 100644 meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch create mode 100644 meta/recipes-core/jpeg/jpeg_8d.bb create mode 100644 meta/recipes-core/kbd/kbd/uclibc-stdarg.patch create mode 100644 meta/recipes-core/kbd/kbd_2.0.1.bb create mode 100644 meta/recipes-core/libcgroup/libcgroup_0.41.bb create mode 100644 meta/recipes-core/libxml/libxml2.inc create mode 100644 meta/recipes-core/libxml/libxml2/ansidecl.patch create mode 100644 meta/recipes-core/libxml/libxml2/libxml-64bit.patch create mode 100644 meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch create mode 100644 meta/recipes-core/libxml/libxml2/run-ptest create mode 100644 meta/recipes-core/libxml/libxml2/runtest.patch create mode 100644 meta/recipes-core/libxml/libxml2_2.9.1.bb create mode 100644 meta/recipes-core/meta/buildtools-tarball.bb create mode 100644 meta/recipes-core/meta/meta-environment.bb create mode 100644 meta/recipes-core/meta/meta-ide-support.bb create mode 100644 meta/recipes-core/meta/meta-toolchain.bb create mode 100644 meta/recipes-core/meta/package-index.bb create mode 100644 meta/recipes-core/ncurses/ncurses-5.9/config.cache create mode 100644 meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch create mode 100644 meta/recipes-core/ncurses/ncurses.inc create mode 100644 meta/recipes-core/ncurses/ncurses_5.9.bb create mode 100644 meta/recipes-core/ncurses/site_config/headers create mode 100644 meta/recipes-core/netbase/netbase/hosts create mode 100644 meta/recipes-core/netbase/netbase_5.2.bb create mode 100644 meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-base.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-boot.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-nfs.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-sdk.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb create mode 100644 meta/recipes-core/packagegroups/packagegroup-self-hosted.bb create mode 100755 meta/recipes-core/psplash/files/psplash-init create mode 100644 meta/recipes-core/psplash/files/psplash-poky-img.h create mode 100644 meta/recipes-core/psplash/psplash_git.bb create mode 100644 meta/recipes-core/readline/files/acinclude.m4 create mode 100644 meta/recipes-core/readline/files/norpath.patch create mode 100644 meta/recipes-core/readline/readline-5.2/acinclude.m4 create mode 100644 meta/recipes-core/readline/readline-5.2/configure-fix.patch create mode 100644 meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch create mode 100644 meta/recipes-core/readline/readline-6.3/configure-fix.patch create mode 100644 meta/recipes-core/readline/readline.inc create mode 100644 meta/recipes-core/readline/readline_5.2.bb create mode 100644 meta/recipes-core/readline/readline_6.3.bb create mode 100644 meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch create mode 100644 meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch create mode 100644 meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch create mode 100644 meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb create mode 100644 meta/recipes-core/systemd/systemd-compat-units.bb create mode 100644 meta/recipes-core/systemd/systemd-serialgetty.bb create mode 100644 meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service create mode 100644 meta/recipes-core/systemd/systemd-systemctl-native.bb create mode 100755 meta/recipes-core/systemd/systemd-systemctl/systemctl create mode 100644 meta/recipes-core/systemd/systemd/00-create-volatile.conf create mode 100644 meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch create mode 100644 meta/recipes-core/systemd/systemd/binfmt-install.patch create mode 100644 meta/recipes-core/systemd/systemd/init create mode 100644 meta/recipes-core/systemd/systemd/optional_secure_getenv.patch create mode 100644 meta/recipes-core/systemd/systemd/run-ptest create mode 100644 meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch create mode 100644 meta/recipes-core/systemd/systemd/touchscreen.rules create mode 100644 meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch create mode 100644 meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch create mode 100644 meta/recipes-core/systemd/systemd_211.bb create mode 100644 meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch create mode 100644 meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch create mode 100644 meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch create mode 100644 meta/recipes-core/sysvinit/sysvinit-inittab/inittab create mode 100644 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb create mode 100755 meta/recipes-core/sysvinit/sysvinit/bootlogd.init create mode 100755 meta/recipes-core/sysvinit/sysvinit/rc create mode 100755 meta/recipes-core/sysvinit/sysvinit/rcS create mode 100644 meta/recipes-core/sysvinit/sysvinit/rcS-default create mode 100644 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb create mode 100644 meta/recipes-core/uclibc/site_config/funcs create mode 100644 meta/recipes-core/uclibc/site_config/headers create mode 100644 meta/recipes-core/uclibc/site_config/types create mode 100644 meta/recipes-core/uclibc/uclibc-config.inc create mode 100644 meta/recipes-core/uclibc/uclibc-git.inc create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/argp-headers.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/argp-support.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/locale.cfg create mode 100644 meta/recipes-core/uclibc/uclibc-git/obstack.cfg create mode 100644 meta/recipes-core/uclibc/uclibc-git/orign_path.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/uClibc.distro create mode 100644 meta/recipes-core/uclibc/uclibc-git/uClibc.machine create mode 100644 meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch create mode 100644 meta/recipes-core/uclibc/uclibc-initial_git.bb create mode 100644 meta/recipes-core/uclibc/uclibc-package.inc create mode 100644 meta/recipes-core/uclibc/uclibc.inc create mode 100644 meta/recipes-core/uclibc/uclibc_git.bb create mode 100644 meta/recipes-core/udev/udev-extraconf/automount.rules create mode 100644 meta/recipes-core/udev/udev-extraconf/autonet.rules create mode 100644 meta/recipes-core/udev/udev-extraconf/localextra.rules create mode 100644 meta/recipes-core/udev/udev-extraconf/mount.blacklist create mode 100644 meta/recipes-core/udev/udev-extraconf/mount.sh create mode 100644 meta/recipes-core/udev/udev-extraconf/network.sh create mode 100644 meta/recipes-core/udev/udev-extraconf_1.0.bb create mode 100644 meta/recipes-core/udev/udev.inc create mode 100644 meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch create mode 100644 meta/recipes-core/udev/udev/add-install-ptest.patch create mode 100644 meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch create mode 100644 meta/recipes-core/udev/udev/devfs-udev.rules create mode 100644 meta/recipes-core/udev/udev/init create mode 100644 meta/recipes-core/udev/udev/links.conf create mode 100644 meta/recipes-core/udev/udev/local.rules create mode 100644 meta/recipes-core/udev/udev/permissions.rules create mode 100644 meta/recipes-core/udev/udev/run-ptest create mode 100644 meta/recipes-core/udev/udev/run.rules create mode 100644 meta/recipes-core/udev/udev/udev-cache create mode 100644 meta/recipes-core/udev/udev/udev-cache.default create mode 100644 meta/recipes-core/udev/udev/udev.rules create mode 100644 meta/recipes-core/udev/udev_182.bb create mode 100644 meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch create mode 100644 meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch create mode 100644 meta/recipes-core/update-rc.d/update-rc.d_0.7.bb create mode 100644 meta/recipes-core/util-linux/util-linux.inc create mode 100644 meta/recipes-core/util-linux/util-linux/MCONFIG create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch create mode 100644 meta/recipes-core/util-linux/util-linux/configure-sbindir.patch create mode 100644 meta/recipes-core/util-linux/util-linux/defines.h create mode 100644 meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch create mode 100644 meta/recipes-core/util-linux/util-linux/fix-configure.patch create mode 100644 meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch create mode 100644 meta/recipes-core/util-linux/util-linux/make_include create mode 100644 meta/recipes-core/util-linux/util-linux/ptest.patch create mode 100644 meta/recipes-core/util-linux/util-linux/run-ptest create mode 100644 meta/recipes-core/util-linux/util-linux/swapargs.h create mode 100644 meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-native.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch create mode 100644 meta/recipes-core/util-linux/util-linux_2.24.1.bb create mode 100644 meta/recipes-core/zlib/site_config/headers create mode 100644 meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch create mode 100644 meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch create mode 100644 meta/recipes-core/zlib/zlib-1.2.8/run-ptest create mode 100644 meta/recipes-core/zlib/zlib_1.2.8.bb (limited to 'meta/recipes-core') diff --git a/meta/recipes-core/base-files/base-files/filesystems b/meta/recipes-core/base-files/base-files/filesystems new file mode 100644 index 0000000000..7e6c41c38f --- /dev/null +++ b/meta/recipes-core/base-files/base-files/filesystems @@ -0,0 +1,8 @@ +ext4 +ext3 +ext2 +vfat +fat +btrfs +minix +* diff --git a/meta/recipes-core/base-files/base-files/fstab b/meta/recipes-core/base-files/base-files/fstab new file mode 100644 index 0000000000..739b844bfc --- /dev/null +++ b/meta/recipes-core/base-files/base-files/fstab @@ -0,0 +1,12 @@ +# stock fstab - you probably want to override this with a machine specific one + +/dev/root / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +usbdevfs /proc/bus/usb usbdevfs noauto 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 + +# uncomment this if your device has a SD/MMC/Transflash slot +#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 + diff --git a/meta/recipes-core/base-files/base-files/host.conf b/meta/recipes-core/base-files/base-files/host.conf new file mode 100644 index 0000000000..1a8c1e1517 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/host.conf @@ -0,0 +1,2 @@ +order hosts,bind +multi on diff --git a/meta/recipes-core/base-files/base-files/inputrc b/meta/recipes-core/base-files/base-files/inputrc new file mode 100644 index 0000000000..b5c4c8af24 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/inputrc @@ -0,0 +1,61 @@ +# /etc/inputrc - global inputrc for libreadline +# See readline(3readline) and `info rluserman' for more information. + +# Be 8 bit clean. +set input-meta on +set output-meta on + +# To allow the use of 8bit-characters like the german umlauts, comment out +# the line below. However this makes the meta key not work as a meta key, +# which is annoying to those which don't need to type in 8-bit characters. + +# set convert-meta off + +# try to enable the application keypad when it is called. Some systems +# need this to enable the arrow keys. +# set enable-keypad on + +# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys + +# do not bell on tab-completion +# set bell-style none + +# some defaults / modifications for the emacs mode +$if mode=emacs + +# allow the use of the Home/End keys +# "\e[1~": beginning-of-line +# "\e[4~": end-of-line + +# allow the use of the Delete/Insert keys +# "\e[3~": delete-char +# "\e[2~": quoted-insert + +# mappings for "page up" and "page down" to step to the beginning/end +# of the history +# "\e[5~": beginning-of-history +# "\e[6~": end-of-history + +# alternate mappings for "page up" and "page down" to search the history +# "\e[5~": history-search-backward +# "\e[6~": history-search-forward + +# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving +# "\e[5C": forward-word +# "\e[5D": backward-word +# "\e\e[C": forward-word +# "\e\e[D": backward-word + +# $if term=rxvt +# "\e[8~": end-of-line +# $endif + +# for non RH/Debian xterm, can't hurt for RH/DEbian xterm +# "\eOH": beginning-of-line +# "\eOF": end-of-line + +# for freebsd console +# "\e[H": beginning-of-line +# "\e[F": end-of-line + +$endif diff --git a/meta/recipes-core/base-files/base-files/issue b/meta/recipes-core/base-files/base-files/issue new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-core/base-files/base-files/issue.net b/meta/recipes-core/base-files/base-files/issue.net new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/meta/recipes-core/base-files/base-files/licenses/GPL-2 new file mode 100644 index 0000000000..d60c31a97a --- /dev/null +++ b/meta/recipes-core/base-files/base-files/licenses/GPL-2 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/meta/recipes-core/base-files/base-files/motd b/meta/recipes-core/base-files/base-files/motd new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-core/base-files/base-files/nsswitch.conf b/meta/recipes-core/base-files/base-files/nsswitch.conf new file mode 100644 index 0000000000..06f03d22a6 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/nsswitch.conf @@ -0,0 +1,19 @@ +# /etc/nsswitch.conf +# +# Example configuration of GNU Name Service Switch functionality. +# If you have the `glibc-doc' and `info' packages installed, try: +# `info libc "Name Service Switch"' for information about this file. + +passwd: compat +group: compat +shadow: compat + +hosts: files dns +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: nis diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile new file mode 100644 index 0000000000..8eeaac3693 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/profile @@ -0,0 +1,32 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +PATH="/usr/local/bin:/usr/bin:/bin" +EDITOR="/bin/vi" # needed for packages like cron +test -z "$TERM" && TERM="vt100" # Basic terminal capab. For screen etc. + +if [ ! -e /etc/localtime ]; then + TZ="UTC" # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html + # for an explanation of how to set this to your local timezone. + export TZ +fi + +if [ "$HOME" = "ROOTHOME" ]; then + PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin +fi +if [ "$PS1" ]; then +# works for bash and ash (no other shells known to be in use here) + PS1='\u@\h:\w\$ ' +fi + +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/* ; do + . $i + done + unset i +fi + +export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM + +umask 022 + diff --git a/meta/recipes-core/base-files/base-files/rotation b/meta/recipes-core/base-files/base-files/rotation new file mode 100644 index 0000000000..c227083464 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/rotation @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/meta/recipes-core/base-files/base-files/share/dot.bashrc b/meta/recipes-core/base-files/base-files/share/dot.bashrc new file mode 100644 index 0000000000..4be63686c2 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/share/dot.bashrc @@ -0,0 +1,16 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +export PS1='\h:\w\$ ' +umask 022 + +# You may uncomment the following lines if you want `ls' to be colorized: +# export LS_OPTIONS='--color=auto' +# eval `dircolors` +# alias ls='ls $LS_OPTIONS' +# alias ll='ls $LS_OPTIONS -l' +# alias l='ls $LS_OPTIONS -lA' +# +# Some more alias to avoid making mistakes: +# alias rm='rm -i' +# alias cp='cp -i' +# alias mv='mv -i' diff --git a/meta/recipes-core/base-files/base-files/share/dot.profile b/meta/recipes-core/base-files/base-files/share/dot.profile new file mode 100644 index 0000000000..979793e8b5 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/share/dot.profile @@ -0,0 +1,10 @@ +# ~/.profile: executed by Bourne-compatible login shells. + +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + +# path set by /etc/profile +# export PATH + +mesg n diff --git a/meta/recipes-core/base-files/base-files/shells b/meta/recipes-core/base-files/base-files/shells new file mode 100644 index 0000000000..3f639874d8 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/shells @@ -0,0 +1,2 @@ +# /etc/shells: valid login shells +/bin/sh diff --git a/meta/recipes-core/base-files/base-files/usbd b/meta/recipes-core/base-files/base-files/usbd new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb new file mode 100644 index 0000000000..9699e31625 --- /dev/null +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb @@ -0,0 +1,148 @@ +SUMMARY = "Miscellaneous files for the base system" +DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system." +SECTION = "base" +PR = "r86" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f" +# Removed all license related tasks in this recipe as license.bbclass +# now deals with this. In order to get accurate licensing on to the image: +# Set COPY_LIC_MANIFEST to just copy just the license.manifest to the image +# For the manifest and the license text for each package: +# Set COPY_LIC_MANIFEST and COPY_LIC_DIRS + +SRC_URI = "file://rotation \ + file://nsswitch.conf \ + file://motd \ + file://inputrc \ + file://host.conf \ + file://profile \ + file://shells \ + file://fstab \ + file://filesystems \ + file://issue.net \ + file://issue \ + file://usbd \ + file://share/dot.bashrc \ + file://share/dot.profile \ + file://licenses/GPL-2 \ + " +S = "${WORKDIR}" + +INHIBIT_DEFAULT_DEPS = "1" + +docdir_append = "/${P}" +dirs1777 = "/tmp ${localstatedir}/volatile/tmp" +dirs2775 = "/home ${prefix}/src ${localstatedir}/local" +dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ + ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \ + ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \ + ${libdir} ${sbindir} ${datadir} \ + ${datadir}/common-licenses ${datadir}/dict ${infodir} \ + ${mandir} ${datadir}/misc ${localstatedir} \ + ${localstatedir}/backups ${localstatedir}/lib \ + /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ + ${localstatedir}/volatile \ + ${localstatedir}/volatile/log \ + /media" +dirs3755 = "/srv \ + ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \ + ${prefix}/local/include ${prefix}/local/lib ${prefix}/local/sbin \ + ${prefix}/local/share ${prefix}/local/src \ + ${prefix}/lib/locale" +dirs4775 = "/var/mail" + +volatiles = "log tmp" +conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ + ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \ + ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ + ${sysconfdir}/default" + +# +# set standard hostname, might be a candidate for a DISTRO variable? :M: +# +hostname = "openembedded" + +BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" + +do_install () { + for d in ${dirs755}; do + install -m 0755 -d ${D}$d + done + for d in ${dirs1777}; do + install -m 1777 -d ${D}$d + done + for d in ${dirs2775}; do + install -m 2755 -d ${D}$d + done + for d in ${volatiles}; do + ln -sf volatile/$d ${D}${localstatedir}/$d + done + ln -snf ../run ${D}${localstatedir}/run + ln -snf ../run/lock ${D}${localstatedir}/lock + + ${BASEFILESISSUEINSTALL} + + rotation=`cat ${WORKDIR}/rotation` + if [ "$rotation" != "0" ]; then + install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation + fi + + install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab + install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems + install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd + install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile + sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile + install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells + install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile + install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc + install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc + install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf + install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf + install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd + + ln -sf /proc/mounts ${D}${sysconfdir}/mtab +} + +DISTRO_VERSION[vardepsexclude] += "DATE" +do_install_basefilesissue () { + if [ "${hostname}" != "" ]; then + if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then + echo ${MACHINE} > ${D}${sysconfdir}/hostname + else + echo ${hostname} > ${D}${sysconfdir}/hostname + fi + fi + + install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} + if [ -n "${DISTRO_NAME}" ]; then + printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue + printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net + if [ -n "${DISTRO_VERSION}" ]; then + printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue + printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net + fi + printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue + echo >> ${D}${sysconfdir}/issue + echo "%h" >> ${D}${sysconfdir}/issue.net + echo >> ${D}${sysconfdir}/issue.net + fi +} + +do_install_append_linuxstdbase() { + for d in ${dirs3755}; do + install -m 0755 -d ${D}$d + done + + for d in ${dirs4775}; do + install -m 2755 -d ${D}$d + done +} + +PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg" +FILES_${PN} = "/" +FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells" + diff --git a/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch new file mode 100644 index 0000000000..eb75559c49 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch @@ -0,0 +1,19 @@ + +We need to have a shutdown group to allow the shutdown icon +to work correctly. Any users that want to use shutdown like +the xuser should be added to this group. + +Upstream-Status: Inapporpriate [Embedded] + +Signed-off-by: Saul Wold +Index: base-passwd-3.5.26/group.master +=================================================================== +--- base-passwd-3.5.26.orig/group.master ++++ base-passwd-3.5.26/group.master +@@ -36,5 +36,6 @@ sasl:*:45: + plugdev:*:46: + staff:*:50: + games:*:60: ++shutdown:*:70: + users:*:100: + nogroup:*:65534: diff --git a/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch new file mode 100644 index 0000000000..14c08b7484 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch @@ -0,0 +1,24 @@ +Disable documentation for now as it uses tools currently not supported +by OE-Core. It uses sgmltools and po4a. + +Upstream-Status: Inappropriate [OE-Core specific] +Signed-off-by: Saul Wold + +Index: base-passwd-3.5.28/Makefile.in +=================================================================== +--- base-passwd-3.5.28.orig/Makefile.in ++++ base-passwd-3.5.28/Makefile.in +@@ -25,13 +25,10 @@ gen_configure = config.cache config.stat + confdefhs.h config.h Makefile + + all: update-passwd +- $(MAKE) -C doc all +- $(MAKE) -C man all + + install: all + mkdir -p $(DESTDIR)$(sbindir) + $(INSTALL) update-passwd $(DESTDIR)$(sbindir)/ +- $(MAKE) -C man install + + update-passwd.o: version.h + diff --git a/meta/recipes-core/base-passwd/base-passwd/input.patch b/meta/recipes-core/base-passwd/base-passwd/input.patch new file mode 100644 index 0000000000..f1bfc2f604 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/input.patch @@ -0,0 +1,22 @@ +Add an input group for the /dev/input/* devices. + +Upstream-Status: Invalid [configuration] + +Signed-off-by: Darren Hart + +--- + group.master | 1 + + 1 file changed, 1 insertion(+) + +Index: base-passwd-3.5.26/group.master +=================================================================== +--- base-passwd-3.5.26.orig/group.master ++++ base-passwd-3.5.26/group.master +@@ -12,6 +12,7 @@ uucp:*:10: + man:*:12: + proxy:*:13: + kmem:*:15: ++input:*:19: + dialout:*:20: + fax:*:21: + voice:*:22: diff --git a/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/meta/recipes-core/base-passwd/base-passwd/nobash.patch new file mode 100644 index 0000000000..eed87db6cb --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/nobash.patch @@ -0,0 +1,15 @@ +use /bin/sh instead of /bin/bash, since the latter may not be included in +some images such as minimal + +Upstream-Status: Invalid [configuration] + +Signed-off-by: Scott Garman + +--- base-passwd/passwd.master~nobash ++++ base-passwd/passwd.master +@@ -1,4 +1,4 @@ +-root:*:0:0:root:/root:/bin/bash ++root:*:0:0:root:/root:/bin/sh + daemon:*:1:1:daemon:/usr/sbin:/bin/sh + bin:*:2:2:bin:/bin:/bin/sh + sys:*:3:3:sys:/dev:/bin/sh diff --git a/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch new file mode 100644 index 0000000000..e1cded61d6 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch @@ -0,0 +1,14 @@ +remove "*" for root since we don't have a /etc/shadow so far. + +Upstream-Status: Invalid [configuration] + +Signed-off-by: Scott Garman + +--- base-passwd/passwd.master~nobash ++++ base-passwd/passwd.master +@@ -1,4 +1,4 @@ +-root:*:0:0:root:/root:/bin/sh ++root::0:0:root:/root:/bin/sh + daemon:*:1:1:daemon:/usr/sbin:/bin/sh + bin:*:2:2:bin:/bin:/bin/sh + sys:*:3:3:sys:/dev:/bin/sh diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb new file mode 100644 index 0000000000..59bd413b49 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb @@ -0,0 +1,97 @@ +SUMMARY = "Base system master password/group files" +DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files." +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" + +SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \ + file://add_shutdown.patch \ + file://nobash.patch \ + file://noshadow.patch \ + file://input.patch \ + file://disable-docs.patch \ + " + +SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421" +SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36" + +inherit autotools + +SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst" + +do_install () { + install -d -m 755 ${D}${sbindir} + install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/ + install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8 + install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/ + install -p -m 644 ${S}/man/update-passwd.pl.8 \ + ${D}${mandir}/pl/man8/update-passwd.8 + gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/* + install -d -m 755 ${D}${datadir}/base-passwd + install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/ + sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master + install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/ + + install -d -m 755 ${D}${docdir}/${BPN} + install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/ + gzip -9 ${D}${docdir}/${BPN}/* + install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/ + install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/ +} + +base_passwd_sstate_postinst() { + if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] + then + # Staging does not copy ${sysconfdir} files into the + # target sysroot, so we need to do so manually. We + # put these files in the target sysroot so they can + # be used by recipes which use custom user/group + # permissions. + install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir} + install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd + install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group + fi +} + +python populate_packages_prepend() { + # Add in the preinst function for ${PN} + # We have to do this here as prior to this, passwd/group.master + # would be unavailable. We need to create these files at preinst + # time before the files from the package may be available, hence + # storing the data from the files in the preinst directly. + + f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r') + passwd = "".join(f.readlines()) + f.close() + f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r') + group = "".join(f.readlines()) + f.close() + + preinst = """#!/bin/sh +mkdir -p $D${sysconfdir} +if [ ! -e $D${sysconfdir}/passwd ]; then +\tcat << EOF > $D${sysconfdir}/passwd +""" + passwd + """EOF +fi +if [ ! -e $D${sysconfdir}/group ]; then +\tcat << EOF > $D${sysconfdir}/group +""" + group + """EOF +fi +""" + d.setVar('pkg_preinst_${PN}', preinst) +} + +addtask do_package after do_populate_sysroot + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES =+ "${PN}-update" +FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}" + +pkg_postinst_${PN}-update () { +#!/bin/sh +if [ -n "$D" ]; then + exit 0 +fi +${sbindir}/update-passwd +} diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc new file mode 100644 index 0000000000..e59afe67bc --- /dev/null +++ b/meta/recipes-core/busybox/busybox.inc @@ -0,0 +1,406 @@ +SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable" +DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system." +HOMEPAGE = "http://www.busybox.net" +BUGTRACKER = "https://bugs.busybox.net/" + +DEPENDS += "kern-tools-native" + +# bzip2 applet in busybox is based on lightly-modified bzip2 source +# the GPL is version 2 only +LICENSE = "GPLv2 & bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" + +SECTION = "base" + +# Whether to split the suid apps into a seperate binary +BUSYBOX_SPLIT_SUID ?= "1" + +export EXTRA_CFLAGS = "${CFLAGS}" +export EXTRA_LDFLAGS = "${LDFLAGS}" +export EXTRA_OEMAKE += "'LD=${CCLD}'" + +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" + +FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" +FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" +FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf" +FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" +FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" +FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" + +INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock" + +INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" +INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" +INITSCRIPT_NAME_${PN}-mdev = "mdev" +INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ." +INITSCRIPT_NAME_${PN}-syslog = "syslog" +INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" + +SYSTEMD_PACKAGES = "${PN}-syslog" +SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service" + +CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}" +CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf" + +RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc" + +inherit cml1 systemd update-rc.d ptest + +# internal helper +def busybox_cfg(feature, tokens, cnf, rem): + if type(tokens) == type(""): + tokens = [tokens] + rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens]) + if feature: + cnf.extend([token + '=y' for token in tokens]) + else: + cnf.extend(['# ' + token + ' is not set' for token in tokens]) + +# Map distro features to config settings +def features_to_busybox_settings(d): + cnf, rem = ([], []) + busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem) + busybox_cfg(base_contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem) + return "\n".join(cnf), "\n".join(rem) + +# X, Y = ${@features_to_uclibc_settings(d)} +# unfortunately doesn't seem to work with bitbake, workaround: +def features_to_busybox_conf(d): + cnf, rem = features_to_busybox_settings(d) + return cnf +def features_to_busybox_del(d): + cnf, rem = features_to_busybox_settings(d) + return rem + +configmangle = '/CROSS_COMPILER_PREFIX/d; \ + /CONFIG_EXTRA_CFLAGS/d; \ + ' +OE_FEATURES := "${@features_to_busybox_conf(d)}" +OE_DEL := "${@features_to_busybox_del(d)}" +DO_IPv4 := "${@base_contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}" +DO_IPv6 := "${@base_contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}" + +python () { + if "${OE_DEL}": + d.setVar('configmangle_append', "${OE_DEL}" + "\n") + if "${OE_FEATURES}": + d.setVar('configmangle_append', + "/^### DISTRO FEATURES$/a\\\n%s\n\n" % + ("\\n".join((d.expand("${OE_FEATURES}").split("\n"))))) + d.setVar('configmangle_append', + "/^### CROSS$/a\\\n%s\n" % + ("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"", + "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\" \"${HOST_CC_ARCH}\"" + ]) + )) +} + +do_prepare_config () { + sed -e 's#@DATADIR@#${datadir}#g' \ + < ${WORKDIR}/defconfig > ${S}/.config + sed -i -e '/CONFIG_STATIC/d' .config + echo "# CONFIG_STATIC is not set" >> .config + for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \ + ${S}/.config + sed -i -e '${configmangle}' ${S}/.config + if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then + # disable networking applets + mv ${S}/.config ${S}/.config.oe-tmp + awk 'BEGIN{net=0} + /^# Networking Utilities/{net=1} + /^#$/{if(net){net=net+1}} + {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \ + ${S}/.config.oe-tmp > ${S}/.config + fi +} + +# returns all the elements from the src uri that are .cfg files +def find_cfgs(d): + sources=src_patches(d, True) + sources_list=[] + for s in sources: + if s.endswith('.cfg'): + sources_list.append(s) + + return sources_list + +do_configure () { + do_prepare_config + merge_config.sh -m .config ${@" ".join(find_cfgs(d))} + cml1_do_configure +} + +do_compile() { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then + # split the .config into two parts, and make two busybox binaries + cp .config .config.orig + oe_runmake busybox.cfg.suid + oe_runmake busybox.cfg.nosuid + for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do + echo "# $i is not set" >> .config.disable.apps + done + merge_config.sh -m .config.orig .config.disable.apps + cp .config .config.nonapps + for s in suid nosuid; do + cat busybox.cfg.$s | while read item; do + grep -w "$item" .config.orig + done > .config.app.$s + merge_config.sh -m .config.nonapps .config.app.$s + oe_runmake busybox_unstripped + mv busybox_unstripped busybox.$s + oe_runmake busybox.links + mv busybox.links busybox.links.$s + done + # copy .config.orig back to .config, because the install process may check this file + cp .config.orig .config + # cleanup + rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps + else + oe_runmake busybox_unstripped + cp busybox_unstripped busybox + oe_runmake busybox.links + fi +} + +do_install () { + if [ "${prefix}" != "/usr" ]; then + sed -i "s:^/usr/:${prefix}/:" busybox.links* + fi + if [ "${base_sbindir}" != "/sbin" ]; then + sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links* + fi + + install -d ${D}${sysconfdir}/init.d + + if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then + # Install /bin/busybox, and the /bin/sh link so the postinst script + # can run. Let update-alternatives handle the rest. + install -d ${D}${base_bindir} + if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then + install -m 4755 ${B}/busybox.suid ${D}${base_bindir} + install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir} + install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir} + install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir} + if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then + ln -sf busybox.nosuid ${D}${base_bindir}/sh + fi + # Keep a default busybox for people who want to invoke busybox directly. + # This is also useful for the on device upgrade. Because we want + # to use the busybox command in postinst. + ln -sf busybox.nosuid ${D}${base_bindir}/busybox + else + if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then + install -m 4755 ${B}/busybox ${D}${base_bindir} + else + install -m 0755 ${B}/busybox ${D}${base_bindir} + fi + install -m 0644 ${S}/busybox.links ${D}${sysconfdir} + if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then + ln -sf busybox ${D}${base_bindir}/sh + fi + # We make this symlink here to eliminate the error when upgrading together + # with busybox-syslog. Without this symlink, the opkg may think of the + # busybox.nosuid as obsolete and remove it, resulting in dead links like + # /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail. + # This symlink will be safely deleted in postinst, thus no negative effect. + ln -sf busybox ${D}${base_bindir}/busybox.nosuid + fi + else + install -d ${D}${base_bindir} ${D}${base_sbindir} + install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir} + cat busybox.links | while read FILE; do + NAME=`basename "$FILE"` + install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}" + done + # add suid bit where needed + for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do + find ${D} -name $i.${BPN} -exec chmod a+s {} \; + done + install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV} + ln -sf sh.${BPN} ${D}${base_bindir}/sh + ln -sf ln.${BPN} ${D}${base_bindir}/ln + ln -sf test.${BPN} ${D}${bindir}/test + if [ -f ${D}/linuxrc.${BPN} ]; then + mv ${D}/linuxrc.${BPN} ${D}/linuxrc + fi + install -m 0644 ${S}/busybox.links ${D}${sysconfdir} + fi + + if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN} + install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN} + install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN} + fi + if grep "CONFIG_CROND=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ + fi + if grep "CONFIG_HTTPD=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ + install -d ${D}/srv/www + fi + if grep "CONFIG_UDHCPD=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ + fi + if grep "CONFIG_HWCLOCK=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ + fi + if grep "CONFIG_UDHCPC=y" ${B}/.config; then + install -d ${D}${sysconfdir}/udhcpc.d + install -d ${D}${datadir}/udhcpc + install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default + install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script + fi + if grep "CONFIG_INETD=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN} + sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN} + install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/ + fi + if grep "CONFIG_MDEV=y" ${B}/.config; then + install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev + if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then + install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf + fi + fi + + if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -d ${D}${systemd_unitdir}/system + sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \ + > ${D}${systemd_unitdir}/system/busybox-syslog.service + sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \ + > ${D}${systemd_unitdir}/system/busybox-klogd.service + + if [ -f ${WORKDIR}/busybox-syslog.default ] ; then + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog + fi + + ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service + fi + + # Remove the sysvinit specific configuration file for systemd systems to avoid confusion + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then + rm -f ${D}${sysconfdir}/syslog-startup.conf.${BPN} + fi +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "50" + +ALTERNATIVE_${PN}-syslog += "syslog-conf" +ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" + +python () { + if base_contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + pn = d.getVar('PN', True) + d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init') + d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True))) + d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True))) + d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf') + d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True))) + d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True))) +} + +python do_package_prepend () { + # We need to load the full set of busybox provides from the /etc/busybox.links + # Use this to see the update-alternatives with the right information + + dvar = d.getVar('D', True) + pn = d.getVar('PN', True) + def set_alternative_vars(links, target): + f = open('%s%s' % (dvar, links), 'r') + for alt_link_name in f: + alt_link_name = alt_link_name.strip() + alt_name = os.path.basename(alt_link_name) + # Match coreutils + if alt_name == '[': + alt_name = 'lbracket' + d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) + if os.path.exists('%s%s' % (dvar, target)): + d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) + f.close() + return + + if os.path.exists('%s/etc/busybox.links' % (dvar)): + set_alternative_vars("/etc/busybox.links", "/bin/busybox") + else: + set_alternative_vars("/etc/busybox.links.nosuid", "/bin/busybox.nosuid") + set_alternative_vars("/etc/busybox.links.suid", "/bin/busybox.suid") +} + +pkg_postinst_${PN} () { + # This part of code is dedicated to the on target upgrade problem. + # It's known that if we don't make appropriate symlinks before update-alternatives calls, + # there will be errors indicating missing commands such as 'sed'. + # These symlinks will later be updated by update-alternatives calls. + test -n 2 > /dev/null || alias test='busybox test' + if test "x$D" = "x"; then + # Remove busybox.nosuid if it's a symlink, because this situation indicates + # that we're installing or upgrading to a one-binary busybox. + if test -h /bin/busybox.nosuid; then + rm -f /bin/busybox.nosuid + fi + for suffix in "" ".nosuid" ".suid"; do + if test -e /etc/busybox.links$suffix; then + while read link; do + if test ! -e "$link"; then + case "$link" in + /*/*/*) + to="../../bin/busybox$suffix" + ;; + /bin/*) + to="busybox$suffix" + ;; + /*/*) + to="../bin/busybox$suffix" + ;; + esac + # we can use busybox here because even if we are using splitted busybox + # we've made a symlink from /bin/busybox to /bin/busybox.nosuid. + busybox rm -f $link + busybox ln -s $to $link + fi + done < /etc/busybox.links$suffix + fi + done + fi +} + +pkg_prerm_${PN} () { + # This is so you can make busybox commit suicide - removing busybox with no other packages + # providing its files, this will make update-alternatives work, but the update-rc.d part + # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh + tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX` + ln -s /bin/busybox $tmpdir/[ + ln -s /bin/busybox $tmpdir/test + ln -s /bin/busybox $tmpdir/head + ln -s /bin/busybox $tmpdir/sh + ln -s /bin/busybox $tmpdir/basename + ln -s /bin/busybox $tmpdir/echo + ln -s /bin/busybox $tmpdir/mv + ln -s /bin/busybox $tmpdir/ln + ln -s /bin/busybox $tmpdir/dirname + ln -s /bin/busybox $tmpdir/rm + ln -s /bin/busybox $tmpdir/sed + ln -s /bin/busybox $tmpdir/sort + ln -s /bin/busybox $tmpdir/grep + export PATH=$PATH:$tmpdir +} + +pkg_prerm_${PN}-syslog () { + # remove syslog + if test "x$D" = "x"; then + if test "$1" = "upgrade" -o "$1" = "remove"; then + /etc/init.d/syslog stop + fi + fi +} diff --git a/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch b/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch new file mode 100644 index 0000000000..3da38bb4ca --- /dev/null +++ b/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch @@ -0,0 +1,40 @@ +From 28389e59701c2408e87e886c358f8e1766c677f7 Mon Sep 17 00:00:00 2001 +From: Drew Moseley +Date: Sat, 29 Mar 2014 11:13:16 -0400 +Subject: [PATCH] build system: Specify '-nostldlib' when linking to .o files. + +For certain cross build scenarios the LD variable is overridden +to use the gcc executive to ensure all the target tuning parameters +are used. In these cases, the executive errors out as shown below +but since this step is only linking to a .o file the standard libs +are not needed. + + $ make LD=gcc applets/built-in.o + LD applets/built-in.o + /usr/bin/ld: cannot find -lgcc_s + /usr/bin/ld: cannot find -lgcc_s + collect2: ld returned 1 exit status + make[1]: *** [applets/built-in.o] Error 1 + make: *** [applets_dir] Error 2 + +Signed-off-by: Drew Moseley +--- + scripts/Makefile.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/Makefile.build b/scripts/Makefile.build +index 5685b5b..eba69f6 100644 +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -256,7 +256,7 @@ ifdef builtin-target + quiet_cmd_link_o_target = LD $@ + # If the list of objects to link is empty, just create an empty built-in.o + cmd_link_o_target = $(if $(strip $(obj-y)),\ +- $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ ++ $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ + rm -f $@; $(AR) rcs $@) + + $(builtin-target): $(obj-y) FORCE +-- +1.7.9.5 + diff --git a/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch new file mode 100644 index 0000000000..de2dbcceb1 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch @@ -0,0 +1,37 @@ +Upstream-Status: Pending + +# copy commit message from OE as the patch comment: +# commit 98c24291aa165f53423c27ae033831ce0b3bb676 +# Author: Roman I Khimov +# Date: Thu Mar 26 23:03:58 2009 +0000 +# +# busybox: update appletlib dependency patch +# +# Previous version still failed from time to time on clean-start builds +# with 4 bitbake threads and '-j16'. Building busybox as sole target worked +# well. +# +# The reason is that previous version introduced a race between applets make +# processes spawned from top-level Makefile and from libbb Makefile. +# +# Fix it with high-level dependency that doesn't create races. +# +# Signed-off-by: Koen Kooi +# +# above comment added by Kevin Tian , 2010-07-06 + +Index: busybox-1.13.2/Makefile +=================================================================== +--- busybox-1.13.2.orig/Makefile 2009-03-19 15:44:37.419270265 +0300 ++++ busybox-1.13.2/Makefile 2009-03-19 15:45:57.737521296 +0300 +@@ -471,6 +471,10 @@ + util-linux/ \ + util-linux/volume_id/ \ + ++# Lib interdeps ++# libbb uses headers generated in applets ++libbb: applets ++ + endif # KBUILD_EXTMOD + + ifeq ($(dot-config),1) diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch new file mode 100644 index 0000000000..4c9ce3b711 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch @@ -0,0 +1,137 @@ +From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001 +From: Anders Darander +Date: Thu, 3 Nov 2011 08:51:31 +0100 +Subject: [PATCH] busybox-udhcpc-no_deconfig.patch + +Upstream-Status: Pending + +Add a new option -D to the udhcpc client that allows for +dhcp renewal to occur without having to down the interface +in the process. + +Signed-off-by: Greg Moffatt + +Updated to latest Busybox 1.17.3 + +Signed-off-by: Mark Hatle + +Updated to Busybox 1.18.4 +option spec is changed + +Signed-off-by: Qing He + +Updated to Busybox 1.19.3 + +Signed-off-by: Anders Darander + +Fixed options -b, -a and -P. + +Signed-off-by: Andreas Oberritter +--- + networking/udhcp/dhcpc.c | 29 +++++++++++++++++++++-------- + 1 files changed, 21 insertions(+), 8 deletions(-) + +Index: busybox-1.20.2/networking/udhcp/dhcpc.c +=================================================================== +--- busybox-1.20.2.orig/networking/udhcp/dhcpc.c ++++ busybox-1.20.2/networking/udhcp/dhcpc.c +@@ -29,6 +29,9 @@ + #include + #include + ++/* option whether to down the interface when reconfiguring */ ++static int allow_deconfig = 1; ++ + /* "struct client_config_t client_config" is in bb_common_bufsiz1 */ + + +@@ -81,8 +84,9 @@ enum { + OPT_x = 1 << 18, + OPT_f = 1 << 19, + OPT_B = 1 << 20, ++ OPT_D = 1 << 21, + /* The rest has variable bit positions, need to be clever */ +- OPTBIT_B = 20, ++ OPTBIT_D = 21, + USE_FOR_MMU( OPTBIT_b,) + IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,) + IF_FEATURE_UDHCP_PORT( OPTBIT_P,) +@@ -1040,7 +1044,8 @@ static void perform_renew(void) + state = RENEW_REQUESTED; + break; + case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + case REQUESTING: + case RELEASED: + change_listen_mode(LISTEN_RAW); +@@ -1064,7 +1069,8 @@ static void perform_release(uint32_t ser + bb_info_msg("Unicasting a release of %s to %s", + inet_ntoa(temp_addr), buffer); + send_release(server_addr, requested_ip); /* unicast */ +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + } + bb_info_msg("Entering released state"); + +@@ -1215,7 +1221,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c + /* O,x: list; -T,-t,-A take numeric param */ + opt_complementary = "O::x::T+:t+:A+" IF_UDHCP_VERBOSE(":vv") ; + IF_LONG_OPTS(applet_long_options = udhcpc_longopts;) +- opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB" ++ opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD" + USE_FOR_MMU("b") + IF_FEATURE_UDHCPC_ARPING("a") + IF_FEATURE_UDHCP_PORT("P:") +@@ -1316,6 +1322,9 @@ int udhcpc_main(int argc UNUSED_PARAM, c + logmode |= LOGMODE_SYSLOG; + } + ++ if (opt & OPT_D) ++ allow_deconfig = 0; ++ + /* Make sure fd 0,1,2 are open */ + bb_sanitize_stdio(); + /* Equivalent of doing a fflush after every \n */ +@@ -1330,7 +1339,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c + srand(monotonic_us()); + + state = INIT_SELECTING; +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + change_listen_mode(LISTEN_RAW); + packet_num = 0; + timeout = 0; +@@ -1484,7 +1494,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c + } + /* Timed out, enter init state */ + bb_info_msg("Lease lost, entering init state"); +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + state = INIT_SELECTING; + client_config.first_secs = 0; /* make secs field count from 0 */ + /*timeout = 0; - already is */ +@@ -1667,7 +1678,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c + send_decline(/*xid,*/ server_addr, packet.yiaddr); + + if (state != REQUESTING) +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + change_listen_mode(LISTEN_RAW); + state = INIT_SELECTING; + client_config.first_secs = 0; /* make secs field count from 0 */ +@@ -1711,7 +1723,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c + bb_info_msg("Received DHCP NAK"); + udhcp_run_script(&packet, "nak"); + if (state != REQUESTING) +- udhcp_run_script(NULL, "deconfig"); ++ if (allow_deconfig) ++ udhcp_run_script(NULL, "deconfig"); + change_listen_mode(LISTEN_RAW); + sleep(3); /* avoid excessive network traffic */ + state = INIT_SELECTING; diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig new file mode 100644 index 0000000000..47eca212db --- /dev/null +++ b/meta/recipes-core/busybox/busybox/defconfig @@ -0,0 +1,1020 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.20.2 +# Mon Aug 20 17:01:45 2012 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_PLATFORM_LINUX=y +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +# CONFIG_FEATURE_VERBOSE_USAGE is not set +CONFIG_FEATURE_COMPRESS_USAGE=y +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_LONG_OPTS=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +# CONFIG_FEATURE_WTMP is not set +CONFIG_FEATURE_PIDFILE=y +CONFIG_FEATURE_SUID=y +CONFIG_FEATURE_SUID_CONFIG=y +CONFIG_FEATURE_SUID_CONFIG_QUIET=y +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +CONFIG_FEATURE_HAVE_RPC=y + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +# CONFIG_CROSS_COMPILER_PREFIX is not set +CONFIG_SYSROOT="" +# CONFIG_EXTRA_CFLAGS is not set +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_FEATURE_SYSTEMD=y +CONFIG_FEATURE_RTMINMAX=y +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +CONFIG_FEATURE_USE_TERMIOS=y +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=15 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_FEATURE_REVERSE_SEARCH is not set +CONFIG_FEATURE_TAB_COMPLETION=y +CONFIG_FEATURE_USERNAME_COMPLETION=y +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_FEATURE_SKIP_ROOTFS=y +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y +CONFIG_FEATURE_HWIB=y + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_FEATURE_SEAMLESS_XZ=y +CONFIG_FEATURE_SEAMLESS_LZMA=y +CONFIG_FEATURE_SEAMLESS_BZ2=y +CONFIG_FEATURE_SEAMLESS_GZ=y +CONFIG_FEATURE_SEAMLESS_Z=y +CONFIG_AR=y +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +CONFIG_BUNZIP2=y +# CONFIG_BZIP2 is not set +CONFIG_CPIO=y +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_GUNZIP=y +CONFIG_GZIP=y +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_GZIP_FAST=0 +# CONFIG_LZOP is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZ is not set +CONFIG_UNZIP=y + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_DATE=y +# CONFIG_FEATURE_DATE_ISOFMT is not set +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +# CONFIG_HOSTID is not set +CONFIG_ID=y +CONFIG_GROUPS=y +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +CONFIG_TOUCH=y +CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +# CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_BASE64 is not set +CONFIG_WHO=y +CONFIG_USERS=y +# CONFIG_CAL is not set +# CONFIG_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_CHROOT=y +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_CUT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +# CONFIG_FEATURE_DD_IBS_OBS is not set +CONFIG_DF=y +# CONFIG_FEATURE_DF_FANCY is not set +CONFIG_DIRNAME=y +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_FEATURE_ENV_LONG_OPTIONS=y +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +# CONFIG_FOLD is not set +# CONFIG_FSYNC is not set +CONFIG_HEAD=y +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_INSTALL is not set +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +# CONFIG_NICE is not set +CONFIG_NOHUP=y +CONFIG_OD=y +# CONFIG_PRINTENV is not set +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_SEQ=y +# CONFIG_SHA1SUM is not set +# CONFIG_SHA256SUM is not set +# CONFIG_SHA512SUM is not set +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +# CONFIG_FEATURE_FLOAT_SLEEP is not set +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_STTY=y +# CONFIG_SUM is not set +CONFIG_SYNC=y +# CONFIG_TAC is not set +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +CONFIG_UNIQ=y +CONFIG_USLEEP=y +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options for cp and mv +# +# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +CONFIG_CHVT=y +# CONFIG_FGCONSOLE is not set +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +# CONFIG_KBD_MODE is not set +CONFIG_LOADFONT=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +CONFIG_SETCONSOLE=y +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set + +# +# Common options for loadfont and setfont +# +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set + +# +# Debian Utilities +# +CONFIG_MKTEMP=y +# CONFIG_PIPE_PROGRESS is not set +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_WHICH=y + +# +# Editors +# +CONFIG_PATCH=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=1024 +CONFIG_FEATURE_VI_8BIT=y +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_FEATURE_VI_USE_SIGNALS=y +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +CONFIG_FEATURE_VI_WIN_RESIZE=y +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y +CONFIG_AWK=y +# CONFIG_FEATURE_AWK_LIBM is not set +CONFIG_CMP=y +CONFIG_DIFF=y +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +CONFIG_FEATURE_DIFF_DIR=y +# CONFIG_ED is not set +CONFIG_SED=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +# CONFIG_FEATURE_FIND_INUM is not set +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +# CONFIG_FEATURE_FIND_DELETE is not set +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set +# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_INITRD is not set +CONFIG_INIT_TERMINAL_TYPE="" +# CONFIG_MESG is not set +# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set + +# +# Login/Password Management Utilities +# +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +CONFIG_USE_BB_CRYPT=y +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_FIRST_SYSTEM_ID=100 +CONFIG_LAST_SYSTEM_ID=999 +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_DELUSER is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_PAM is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_CRYPTPW is not set +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +CONFIG_INSMOD=y +CONFIG_RMMOD=y +CONFIG_LSMOD=y +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +CONFIG_MODPROBE=y +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +CONFIG_DEPMOD=y + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +CONFIG_FEATURE_CHECK_TAINTED_MODULE=y +CONFIG_FEATURE_MODUTILS_ALIAS=y +CONFIG_FEATURE_MODUTILS_SYMBOLS=y +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +# CONFIG_BLOCKDEV is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +# CONFIG_REV is not set +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKID is not set +# CONFIG_FEATURE_BLKID_TYPE is not set +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +CONFIG_FDISK=y +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_GPT_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +CONFIG_FLOCK=y +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +CONFIG_HEXDUMP=y +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_HD is not set +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +CONFIG_LOSETUP=y +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +CONFIG_MKSWAP=y +# CONFIG_FEATURE_MKSWAP_UUID is not set +CONFIG_MORE=y +CONFIG_MOUNT=y +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +CONFIG_FEATURE_MOUNT_NFS=y +# CONFIG_FEATURE_MOUNT_CIFS is not set +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_PIVOT_ROOT=y +CONFIG_RDATE=y +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +CONFIG_SWAPONOFF=y +CONFIG_FEATURE_SWAPON_PRI=y +CONFIG_SWITCH_ROOT=y +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_NANDWRITE is not set +# CONFIG_NANDDUMP is not set +# CONFIG_SETSERIAL is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +# CONFIG_ADJTIMEX is not set +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CHRT is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_DIR="" +# CONFIG_CRONTAB is not set +CONFIG_DC=y +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_IONICE is not set +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_SMALL is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +CONFIG_MICROCOM=y +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +CONFIG_RFKILL=y +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SETSID is not set +CONFIG_STRINGS=y +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +CONFIG_TIME=y +# CONFIG_TIMEOUT is not set +# CONFIG_TTYSIZE is not set +# CONFIG_VOLNAME is not set +# CONFIG_WALL is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +CONFIG_NC=y +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +# CONFIG_WHOIS is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTP_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_HOSTNAME=y +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_FEATURE_IFCONFIG_HW=y +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +CONFIG_IFUPDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set +CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_TUNNEL=y +# CONFIG_FEATURE_IP_RULE is not set +# CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +CONFIG_NETSTAT=y +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +CONFIG_NSLOOKUP=y +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_PSCAN is not set +CONFIG_ROUTE=y +# CONFIG_SLATTACH is not set +# CONFIG_TCPSVD is not set +CONFIG_TELNET=y +# CONFIG_FEATURE_TELNET_TTYPE is not set +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +CONFIG_TFTP=y +# CONFIG_TFTPD is not set + +# +# Common options for tftp/tftpd +# +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_TFTP_DEBUG is not set +CONFIG_TRACEROUTE=y +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_UDHCPC6 is not set +CONFIG_UDHCPD=y +# CONFIG_DHCPRELAY is not set +CONFIG_DUMPLEASES=y +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases" +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +# CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" +# CONFIG_UDPSVD is not set +# CONFIG_VCONFIG is not set +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_FEATURE_WGET_TIMEOUT=y +# CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_IOSTAT is not set +# CONFIG_LSOF is not set +# CONFIG_MPSTAT is not set +# CONFIG_NMETER is not set +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +CONFIG_UPTIME=y +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_KILL=y +CONFIG_KILLALL=y +# CONFIG_KILLALL5 is not set +# CONFIG_PGREP is not set +CONFIG_PIDOF=y +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PKILL is not set +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +CONFIG_FEATURE_PS_LONG=y +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +CONFIG_RENICE=y +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +CONFIG_WATCH=y + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +# CONFIG_ASH_IDLE_TIMEOUT is not set +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +# CONFIG_ASH_CMDCMD is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_MSH is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +CONFIG_SH_MATH_SUPPORT=y +# CONFIG_SH_MATH_SUPPORT_64 is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_FEATURE_SH_HISTFILESIZE=y + +# +# System Logging Utilities +# +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +CONFIG_FEATURE_SYSLOGD_DUP=y +CONFIG_FEATURE_SYSLOGD_CFG=y +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +CONFIG_FEATURE_IPC_SYSLOG=y +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64 +CONFIG_LOGREAD=y +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y +CONFIG_KLOGD=y +CONFIG_FEATURE_KLOGD_KLOGCTL=y +CONFIG_LOGGER=y diff --git a/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch new file mode 100644 index 0000000000..6745f169fe --- /dev/null +++ b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch @@ -0,0 +1,31 @@ +Upstream-Status: Pending + +The current behaviour of busybox is to try all fstype when automounting +even when no media exists. The util-linux mount command bails when no +media exists, so change the behaviour of busybox to do the same. + +It could also be argued that the KERN_INFO message from btrfs could be +removed, but that would be harder to accomplish. + +Signed-off-by: Saul Wold + + +Index: busybox-1.20.2/util-linux/mount.c +=================================================================== +--- busybox-1.20.2.orig/util-linux/mount.c ++++ busybox-1.20.2/util-linux/mount.c +@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m + break; + errno = errno_save; + } +- ++ /* ++ * Break if there is no media, no point retrying for all ++ * fs types since there is no media available ++ */ ++ if (rc == -1 && errno == ENOMEDIUM) { ++ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir); ++ } + if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS)) + break; + if (!(vfsflags & MS_SILENT)) diff --git a/meta/recipes-core/busybox/busybox/get_header_tar.patch b/meta/recipes-core/busybox/busybox/get_header_tar.patch new file mode 100644 index 0000000000..0e528ff91f --- /dev/null +++ b/meta/recipes-core/busybox/busybox/get_header_tar.patch @@ -0,0 +1,22 @@ +Upstream-Status: Pending + +# copy commit message from OE as the patch comment: +# commit 5a0e1d473ca7aca5ffefffe9a2ec44ae7a1f35bc +# Author: Frans Meulenbroeks +# Date: Wed Feb 11 22:40:21 2009 +0100 +# +# busybox: fix tar problem with filenames that are exactly 100 bytes +# +# above comment added by Kevin Tian , 2010-07-06 + +--- busybox-1.13.2/archival/libarchive/get_header_tar.c.orig 2008-11-09 18:28:02.000000000 +0100 ++++ busybox-1.13.2/archival/libarchive/get_header_tar.c 2009-02-11 22:34:52.000000000 +0100 +@@ -252,6 +252,8 @@ + file_header->name = concat_path_file(tar.prefix, tar.name); + } else + file_header->name = xstrdup(tar.name); ++ if (strlen(file_header->name) > 100) ++ file_header->name[100] = 0; + } + + /* Set bits 12-15 of the files mode */ diff --git a/meta/recipes-core/busybox/busybox/login-utilities.cfg b/meta/recipes-core/busybox/busybox/login-utilities.cfg new file mode 100644 index 0000000000..cc9b2db502 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/login-utilities.cfg @@ -0,0 +1,13 @@ +CONFIG_FEATURE_SHADOWPASSWDS=y +CONFIG_ADDUSER=y +CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y +CONFIG_ADDGROUP=y +CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y +CONFIG_DELUSER=y +CONFIG_DELGROUP=y +CONFIG_GETTY=y +CONFIG_LOGIN=y +CONFIG_PASSWD=y +CONFIG_SU=y +CONFIG_SULOGIN=y +CONFIG_VLOCK=y diff --git a/meta/recipes-core/busybox/busybox_1.22.1.bb b/meta/recipes-core/busybox/busybox_1.22.1.bb new file mode 100644 index 0000000000..782752c2aa --- /dev/null +++ b/meta/recipes-core/busybox/busybox_1.22.1.bb @@ -0,0 +1,42 @@ +require busybox.inc + +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ + file://get_header_tar.patch \ + file://busybox-appletlib-dependency.patch \ + file://busybox-udhcpc-no_deconfig.patch \ + file://find-touchscreen.sh \ + file://busybox-cron \ + file://busybox-httpd \ + file://busybox-udhcpd \ + file://default.script \ + file://simple.script \ + file://hwclock.sh \ + file://mount.busybox \ + file://syslog \ + file://syslog-startup.conf \ + file://syslog.conf \ + file://busybox-syslog.default \ + file://mdev \ + file://mdev.conf \ + file://umount.busybox \ + file://defconfig \ + file://busybox-syslog.service.in \ + file://busybox-klogd.service.in \ + file://fail_on_no_media.patch \ + file://run-ptest \ + file://inetd.conf \ + file://inetd \ + file://login-utilities.cfg \ + file://0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch \ +" + +SRC_URI[tarball.md5sum] = "337d1a15ab1cb1d4ed423168b1eb7d7e" +SRC_URI[tarball.sha256sum] = "ae0b029d0a9e4dd71a077a790840e496dd838998e4571b87b60fed7462b6678b" + +EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y" + +do_install_ptest () { + cp -r ${B}/testsuite ${D}${PTEST_PATH}/ + cp ${B}/.config ${D}${PTEST_PATH}/ + ln -s /bin/busybox ${D}${PTEST_PATH}/busybox +} diff --git a/meta/recipes-core/busybox/busybox_git.bb b/meta/recipes-core/busybox/busybox_git.bb new file mode 100644 index 0000000000..f2cc119400 --- /dev/null +++ b/meta/recipes-core/busybox/busybox_git.bb @@ -0,0 +1,46 @@ +require busybox.inc + +SRCREV = "d9e0c438e10e2155513e5d26498af472c5137d65" +# Lookout for PV bump too when SRCREV is changed +PV = "1.22.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +SRC_URI = "git://busybox.net/busybox.git \ + file://get_header_tar.patch \ + file://busybox-appletlib-dependency.patch \ + file://busybox-udhcpc-no_deconfig.patch \ + file://find-touchscreen.sh \ + file://busybox-cron \ + file://busybox-httpd \ + file://busybox-udhcpd \ + file://default.script \ + file://simple.script \ + file://hwclock.sh \ + file://mount.busybox \ + file://syslog \ + file://syslog-startup.conf \ + file://syslog.conf \ + file://busybox-syslog.default \ + file://mdev \ + file://mdev.conf \ + file://umount.busybox \ + file://defconfig \ + file://busybox-syslog.service.in \ + file://busybox-klogd.service.in \ + file://fail_on_no_media.patch \ + file://run-ptest \ + file://inetd.conf \ + file://inetd \ + file://login-utilities.cfg \ +" + +EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y" + +do_install_ptest () { + cp -r ${B}/testsuite ${D}${PTEST_PATH}/ + cp ${B}/.config ${D}${PTEST_PATH}/ + ln -s /bin/busybox ${D}${PTEST_PATH}/busybox +} + +DEFAULT_PREFERENCE = "-1" diff --git a/meta/recipes-core/busybox/files/busybox-cron b/meta/recipes-core/busybox/files/busybox-cron new file mode 100755 index 0000000000..f0e6b15629 --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-cron @@ -0,0 +1,39 @@ +#!/bin/sh +DAEMON=/usr/sbin/crond +NAME=crond +DESC="Busybox Periodic Command Scheduler" +ARGS="-c /etc/cron/crontabs" + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo -n "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/busybox/files/busybox-httpd b/meta/recipes-core/busybox/files/busybox-httpd new file mode 100755 index 0000000000..c8348e54a7 --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-httpd @@ -0,0 +1,44 @@ +#!/bin/sh +DAEMON=/usr/sbin/httpd +NAME=httpd +DESC="Busybox HTTP Daemon" +HTTPROOT="/srv/www" +ARGS="-h $HTTPROOT" + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + if [ ! -d $HTTPROOT ]; then + echo "$HTTPROOT is missing." + exit 1 + fi + start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/busybox/files/busybox-klogd.service.in b/meta/recipes-core/busybox/files/busybox-klogd.service.in new file mode 100644 index 0000000000..d7c77558f3 --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-klogd.service.in @@ -0,0 +1,8 @@ +[Unit] +Description=Kernel Logging Service + +[Service] +ExecStart=@base_sbindir@/klogd -n + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-core/busybox/files/busybox-syslog.default b/meta/recipes-core/busybox/files/busybox-syslog.default new file mode 100644 index 0000000000..e516caf518 --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-syslog.default @@ -0,0 +1,25 @@ +OPTIONS="-C" +# The above option means syslogd will log to 16K shm circular buffer. +# You could use `logread' to read it. + +# All available options are: +# -O FILE : Log to FILE (default:/var/log/messages) +# -l N : Log only messages more urgent than prio N (1-8) +# -S : Smaller output +# -s SIZE : Max size (KB) before rotation (default:200KB, 0=off) +# -b N : N rotated logs to keep (default:1, max=99, 0=purge) +# -R HOST[:PORT]: Log to HOST:PORT (default PORT:514) +# -L : Log locally and via network +# -D : Drop duplicates +# -C[size_kb] : Log to shared mem buffer (use logread to read it) +# -f FILE : Use FILE as config (default:/etc/syslog.conf) +# -m MIN : Minutes between mark lines (default:20, 0=off) +# -K : Log to kernel printk buffer (use dmesg to read it) + +# Example 1: +# Log to local file /var/log/mylog +# OPTIONS="-O /var/log/mylog" +# +# Example 2: +# Log to remote host +# OPTIONS="-R 192.168.1.1:601" diff --git a/meta/recipes-core/busybox/files/busybox-syslog.service.in b/meta/recipes-core/busybox/files/busybox-syslog.service.in new file mode 100644 index 0000000000..2e04321385 --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-syslog.service.in @@ -0,0 +1,13 @@ +[Unit] +Description=System Logging Service +Wants=busybox-klogd.service + +[Service] +EnvironmentFile=-/etc/default/busybox-syslog +ExecStart=@base_sbindir@/syslogd -n $OPTIONS +Sockets=syslog.socket + +[Install] +WantedBy=multi-user.target +Also=busybox-klogd.service +Alias=syslog.service diff --git a/meta/recipes-core/busybox/files/busybox-udhcpd b/meta/recipes-core/busybox/files/busybox-udhcpd new file mode 100755 index 0000000000..c43903e8dc --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-udhcpd @@ -0,0 +1,43 @@ +#!/bin/sh +DAEMON=/usr/sbin/udhcpd +NAME=udhcpd +DESC="Busybox UDHCP Server" +ARGS="/etc/udhcpd.conf" + +test -f $DAEMON || exit 1 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + if [ ! -f /etc/udhcpd.conf ]; then + echo "error: /etc/udhcpd.conf is missing." + exit 1 + fi + /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + /sbin/start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/busybox/files/default.script b/meta/recipes-core/busybox/files/default.script new file mode 100644 index 0000000000..f2ac987a27 --- /dev/null +++ b/meta/recipes-core/busybox/files/default.script @@ -0,0 +1,4 @@ +#!/bin/sh + +exec run-parts -a "$1" /etc/udhcpc.d + diff --git a/meta/recipes-core/busybox/files/find-touchscreen.sh b/meta/recipes-core/busybox/files/find-touchscreen.sh new file mode 100644 index 0000000000..1582ea891c --- /dev/null +++ b/meta/recipes-core/busybox/files/find-touchscreen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then + ln -sf /dev/input/$MDEV /dev/input/touchscreen0 +fi + +if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then + ln -sf /dev/input/$MDEV /dev/input/touchscreen0 +fi diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh new file mode 100644 index 0000000000..be5f94d86c --- /dev/null +++ b/meta/recipes-core/busybox/files/hwclock.sh @@ -0,0 +1,83 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: hwclock +# Required-Start: +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Set system clock +# Description: Set system clock to hardware clock, according to the UTC +# setting in /etc/default/rcS (see also rcS(5)). +### END INIT INFO +# +# WARNING: If your hardware clock is not in UTC/GMT, this script +# must know the local time zone. This information is +# stored in /etc/localtime. This might be a problem if +# your /etc/localtime is a symlink to something in +# /usr/share/zoneinfo AND /usr isn't in the root +# partition! The workaround is to define TZ either +# in /etc/default/rcS, or in the proper place below. + +[ ! -x /sbin/hwclock ] && exit 0 + +[ -f /etc/default/rcS ] && . /etc/default/rcS + +[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime" +case "$1" in + start) + if [ "$VERBOSE" != no ] + then + echo "System time was `date`." + echo "Setting the System Clock using the Hardware Clock as reference..." + fi + + if [ "$HWCLOCKACCESS" != no ] + then + if [ -z "$TZ" ] + then + hwclock $tz --hctosys + else + TZ="$TZ" hwclock $tz --hctosys + fi + fi + + if [ "$VERBOSE" != no ] + then + echo "System Clock set. System local time is now `date`." + fi + ;; + stop|restart|reload|force-reload) + # + # Updates the Hardware Clock with the System Clock time. + # This will *override* any changes made to the Hardware Clock. + # + # WARNING: If you disable this, any changes to the system + # clock will not be carried across reboots. + # + if [ "$VERBOSE" != no ] + then + echo "Saving the System Clock time to the Hardware Clock..." + fi + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --systohc + fi + if [ "$VERBOSE" != no ] + then + echo "Hardware Clock updated to `date`." + fi + exit 0 + ;; + show) + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --show + fi + ;; + *) + echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2 + echo " start sets kernel (system) clock from hardware (RTC) clock" >&2 + echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2 + exit 1 + ;; +esac diff --git a/meta/recipes-core/busybox/files/inetd b/meta/recipes-core/busybox/files/inetd new file mode 100644 index 0000000000..cf50bcd546 --- /dev/null +++ b/meta/recipes-core/busybox/files/inetd @@ -0,0 +1,33 @@ +#!/bin/sh +# +# start/stop inetd super server. + +if ! [ -x /usr/sbin/inetd ]; then + exit 0 +fi + +case "$1" in + start) + echo -n "Starting internet superserver:" + echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null + echo "." + ;; + stop) + echo -n "Stopping internet superserver:" + echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null + echo "." + ;; + restart) + echo -n "Restarting internet superserver:" + echo -n " inetd " + killall -HUP inetd + echo "." + ;; + *) + echo "Usage: /etc/init.d/inetd {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 + diff --git a/meta/recipes-core/busybox/files/inetd.conf b/meta/recipes-core/busybox/files/inetd.conf new file mode 100644 index 0000000000..b02fe850c9 --- /dev/null +++ b/meta/recipes-core/busybox/files/inetd.conf @@ -0,0 +1,20 @@ +# /etc/inetd.conf: see inetd(8) for further informations. +# +# Internet server configuration database +# +# If you want to disable an entry so it isn't touched during +# package updates just comment it out with a single '#' character. +# +# +# +#:INTERNAL: Internal services +#echo stream tcp nowait root internal +#echo dgram udp wait root internal +#chargen stream tcp nowait root internal +#chargen dgram udp wait root internal +#discard stream tcp nowait root internal +#discard dgram udp wait root internal +#daytime stream tcp nowait root internal +#daytime dgram udp wait root internal +#time stream tcp nowait root internal +#time dgram udp wait root internal diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev new file mode 100755 index 0000000000..4eba6190c7 --- /dev/null +++ b/meta/recipes-core/busybox/files/mdev @@ -0,0 +1,7 @@ +#!/bin/sh + +mount -t tmpfs tmpfs /dev -o size=64k,mode=0755 +mkdir /dev/pts /dev/shm +mount -t devpts devpts /dev/pts +echo "/sbin/mdev" > /proc/sys/kernel/hotplug +mdev -s diff --git a/meta/recipes-core/busybox/files/mdev.conf b/meta/recipes-core/busybox/files/mdev.conf new file mode 100644 index 0000000000..e688911ff1 --- /dev/null +++ b/meta/recipes-core/busybox/files/mdev.conf @@ -0,0 +1,37 @@ +console 0:0 0600 +cpu_dma_latency 0:0 0660 +fb0:0 44 0660 +full 0:0 0666 +initctl 0:0 0600 +ircomm[0-9].* 0:20 0660 +kmem 0:15 0640 +kmsg 0:0 0660 +log 0:0 0666 +loop[0-9].* 0:6 0640 +mem 0:15 0640 +network_latency 0:0 0660 +network_throughput 0:0 0660 +null 0:0 0666 +port 0:15 0640 +ptmx 0:5 0666 +ram[0-9].* 0:6 0640 +random 0:0 0666 +sda 0:6 0640 +tty 0:5 0666 +tty.* 0:0 0620 +urandom 0:0 0666 +usbdev.* 0:0 0660 */etc/mdev/usb.sh +vcs.* 0:5 0660 +zero 0:0 0666 + +snd/pcm.* 0:0 0660 +snd/control.* 0:0 0660 +snd/timer 0:0 0660 +snd/seq 0:0 0660 +snd/mini.* 0:00 0660 + +input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh +input/mice 0:0 0660 +input/mouse.* 0:0 0660 + +tun[0-9]* 0:0 0660 =net/ diff --git a/meta/recipes-core/busybox/files/mount.busybox b/meta/recipes-core/busybox/files/mount.busybox new file mode 100755 index 0000000000..fef945b7b2 --- /dev/null +++ b/meta/recipes-core/busybox/files/mount.busybox @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /bin/busybox mount $@ diff --git a/meta/recipes-core/busybox/files/run-ptest b/meta/recipes-core/busybox/files/run-ptest new file mode 100644 index 0000000000..3608a8eb65 --- /dev/null +++ b/meta/recipes-core/busybox/files/run-ptest @@ -0,0 +1,7 @@ +#!/bin/sh + +current_dir=$(readlink -f $0) +export bindir=$(dirname $current_dir) + +cd testsuite || exit 1 +./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/' diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script new file mode 100644 index 0000000000..78ac4242a8 --- /dev/null +++ b/meta/recipes-core/busybox/files/simple.script @@ -0,0 +1,86 @@ +#!/bin/sh + +# udhcpc script edited by Tim Riker + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +RESOLV_CONF="/etc/resolv.conf" +[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" +[ -n "$subnet" ] && NETMASK="netmask $subnet" + +# return 0 if root is mounted on a network filesystem +root_is_nfs() { + sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts | + grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$" +} + +have_bin_ip=0 +if [ -x /sbin/ip ]; then + have_bin_ip=1 +fi + +case "$1" in + deconfig) + if [ -x /sbin/resolvconf ]; then + /sbin/resolvconf -d "${interface}.udhcpc" + fi + if ! root_is_nfs ; then + if [ $have_bin_ip -eq 1 ]; then + ip addr flush dev $interface + ip link set dev $interface up + else + /sbin/ifconfig $interface 0.0.0.0 + fi + fi + ;; + + renew|bound) + if [ $have_bin_ip -eq 1 ]; then + ip addr add dev $interface local $ip/$mask $BROADCAST + else + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + fi + + if [ -n "$router" ] ; then + if ! root_is_nfs ; then + if [ $have_bin_ip -eq 1 ]; then + while ip route del default 2>/dev/null ; do + : + done + else + while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do + : + done + fi + fi + + metric=0 + for i in $router ; do + if [ $have_bin_ip -eq 1 ]; then + ip route add default via $i metric $metric + else + route add default gw $i dev $interface metric $metric 2>/dev/null + fi + metric=$(($metric + 1)) + done + fi + + # Update resolver configuration file + R="" + [ -n "$domain" ] && R="domain $domain +" + for i in $dns; do + echo "$0: Adding DNS $i" + R="${R}nameserver $i +" + done + + if [ -x /sbin/resolvconf ]; then + echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc" + else + echo -n "$R" > "$RESOLV_CONF" + fi + ;; +esac + +exit 0 diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog new file mode 100644 index 0000000000..2944d3d06c --- /dev/null +++ b/meta/recipes-core/busybox/files/syslog @@ -0,0 +1,77 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: sysklogd +# Required-Start: $remote_fs $time +# Required-Stop: $remote_fs $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: System logger +### END INIT INFO + +set -e + +if [ -f /etc/syslog-startup.conf ]; then + . /etc/syslog-startup.conf + LOG_LOCAL=0 + LOG_REMOTE=0 + for D in $DESTINATION; do + if [ "$D" = "buffer" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE" + LOG_LOCAL=1 + elif [ "$D" = "file" ]; then + if [ -n "$LOGFILE" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE" + fi + if [ -n "$ROTATESIZE" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE" + fi + if [ -n "$ROTATEGENS" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS" + fi + LOCAL=0 + elif [ "$D" = "remote" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE" + LOG_REMOTE=1 + fi + done + if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -L" + fi + if [ "$REDUCE" = "yes" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -S" + fi + if [ "$DROPDUPLICATES" = "yes" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -D" + fi + if [ -n "$LOGLEVEL" ]; then + SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL" + fi +else + # default: log to 16K shm circular buffer + SYSLOG_ARGS="-C" +fi + +case "$1" in + start) + echo -n "Starting syslogd/klogd: " + start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS + start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n + echo "done" + ;; + stop) + echo -n "Stopping syslogd/klogd: " + start-stop-daemon -K -n syslogd + start-stop-daemon -K -n klogd + echo "done" + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "Usage: syslog { start | stop | restart }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/busybox/files/syslog-startup.conf b/meta/recipes-core/busybox/files/syslog-startup.conf new file mode 100644 index 0000000000..fda450aa0d --- /dev/null +++ b/meta/recipes-core/busybox/files/syslog-startup.conf @@ -0,0 +1,13 @@ +# This configuration file is used by the busybox syslog init script, +# /etc/init.d/syslog[.busybox] to set syslog configuration at start time. + +DESTINATION=file # log destinations (buffer file remote) +LOGFILE=/var/log/messages # where to log (file) +REMOTE=loghost:514 # where to log (syslog remote) +REDUCE=no # reduce-size logging +DROPDUPLICATES=no # whether to drop duplicate log entries +#ROTATESIZE=0 # rotate log if grown beyond X [kByte] +#ROTATEGENS=3 # keep X generations of rotated logs +BUFFERSIZE=64 # size of circular buffer [kByte] +FOREGROUND=no # run in foreground (don't use!) +#LOGLEVEL=5 # local log level (between 1 and 8) diff --git a/meta/recipes-core/busybox/files/syslog.conf b/meta/recipes-core/busybox/files/syslog.conf new file mode 100644 index 0000000000..75bb6309ab --- /dev/null +++ b/meta/recipes-core/busybox/files/syslog.conf @@ -0,0 +1 @@ +# /etc/syslog.conf Configuration file for busybox's syslogd utility diff --git a/meta/recipes-core/busybox/files/umount.busybox b/meta/recipes-core/busybox/files/umount.busybox new file mode 100755 index 0000000000..f3731626e6 --- /dev/null +++ b/meta/recipes-core/busybox/files/umount.busybox @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /bin/busybox umount $@ diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars new file mode 100644 index 0000000000..32692ab4b9 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch new file mode 100644 index 0000000000..c287014767 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch @@ -0,0 +1,17 @@ +Upstream-Status: Pending + +# +# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher +# + +--- console-tools-0.3.2/contrib/codepage.c~codepage ++++ console-tools-0.3.2/contrib/codepage.c +@@ -229,7 +229,7 @@ + return 0; + + fprintf(stderr, "\ +-Warning: CP format is a hack!\n ++Warning: CP format is a hack!\n\ + The files produced may or may not be usable!\n"); + + sprintf(outfile, "%d.cp", CPEntryHeader.codepage); diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch new file mode 100644 index 0000000000..c93f511950 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch @@ -0,0 +1,12 @@ +Upstream-Status: Pending + +--- console-tools-0.3.2/kbdtools/showkey.c~compile 1999-08-25 17:20:08.000000000 -0400 ++++ console-tools-0.3.2/kbdtools/showkey.c 2004-05-09 03:03:23.000000000 -0400 +@@ -264,7 +264,6 @@ + break; + case cmd_keymap: + printf(")\n"); +- default: + } + } + diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch new file mode 100644 index 0000000000..15c100c908 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch @@ -0,0 +1,29 @@ +Upstream-Status: Pending + +--- console-tools-0.3.2/configure.in~configure ++++ console-tools-0.3.2/configure.in +@@ -2,13 +2,14 @@ + dnl Process this file with autoconf to produce a configure script. + + # Initialize +-AC_INIT(kbdtools/loadkeys.y) ++AC_INIT ++AC_CONFIG_SRCDIR([kbdtools/loadkeys.y]) + + define(ct_unicodedata_default,/usr/share/unidata/UnicodeData-2.txt) + ct_localdatadir_default=/usr/local/share # iff --enable-localdatadir without specific dir + + #AC_CONFIG_AUX_DIR(autoconf) +-AC_CANONICAL_SYSTEM ++AC_CANONICAL_TARGET([]) + AM_INIT_AUTOMAKE(console-tools, 0.3.2) + + # Defaults +@@ -25,7 +26,6 @@ + # i18n stuff + ALL_LINGUAS="cs de ru ga fr" + AM_GNU_GETTEXT +-AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) + + AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/share/locale") + diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch new file mode 100644 index 0000000000..be61eb846b --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch @@ -0,0 +1,56 @@ +Fix the following error detected with i586-pokymllib32-linux-gcc (the +multilib x86-64 lib32 compiler): + ../lib/ctutils/.libs/libctutils.so: undefined reference to `get_kernel_sfm' + collect2: error: ld returned 1 exit status + +It seems that libctutils.so (the library that uses get_kernel_sfm) must +be stated before libconsole.so (the library that exports the function) when +using multilib gcc + +Upstream-Status: Pending +Signed-off-by: Constantin Musca + +Index: console-tools-0.3.2/fontfiletools/Makefile.am +=================================================================== +--- console-tools-0.3.2.orig/fontfiletools/Makefile.am ++++ console-tools-0.3.2/fontfiletools/Makefile.am +@@ -10,5 +10,5 @@ EXTRA_DIST = fonts2virfont.c virfont.h + + # libconsole is needed by ctutils + LDADD = ../lib/ctlocal/libctlocal.a ../lib/cfont/libcfont.la \ +- ../lib/console/libconsole.la \ +- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la ++ ../lib/ctutils/libctutils.la \ ++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la +Index: console-tools-0.3.2/vttools/Makefile.am +=================================================================== +--- console-tools-0.3.2.orig/vttools/Makefile.am ++++ console-tools-0.3.2/vttools/Makefile.am +@@ -7,9 +7,9 @@ bin_PROGRAMS = chvt deallocvt writevt fg + vcstime vt-is-UTF8 openvt @RESIZECONS@ + EXTRA_PROGRAMS = resizecons + +-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \ ++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \ + ../lib/cfont/libcfont.la \ +- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la ++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la + + vcstime_LDADD = ../lib/ctlocal/libctlocal.a + screendump_LDADD = ../lib/ctlocal/libctlocal.a +Index: console-tools-0.3.2/kbdtools/Makefile.am +=================================================================== +--- console-tools-0.3.2.orig/kbdtools/Makefile.am ++++ console-tools-0.3.2/kbdtools/Makefile.am +@@ -15,9 +15,9 @@ EXTRA_PROGRAMS = getkeycodes setkeycodes + loadkeys_SOURCES = loadkeys.y analyze.l + + YFLAGS = -d +-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \ ++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \ + ../lib/cfont/libcfont.la \ +- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la ++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la + + loadkeys_LDADD = $(LDADD) @LEXLIB@ + diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch new file mode 100644 index 0000000000..f370be8592 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch @@ -0,0 +1,75 @@ +Patch from Matthias Goebl +Added via OE bugtracker: bug #478 + +Upstream-Status: Pending + +--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig ++++ console-tools-0.3.2/kbdtools/kbd_mode.c +@@ -29,11 +29,16 @@ + OPT("-u --unicode ", _("UTF-8 mode (UNICODE)")); + OPT("-s --scancode ", _("scancode mode (RAW)")); + OPT(" --mode={8bit,keycode,unicode,scancode} ", _("set mode")); ++ OPT("-r --rate=RATE ", _("set repeat rate (default: 33)")); ++ OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)")); + + OPT("-h --help ", HELPDESC); + OPT("-V --version ", VERSIONDESC); + } + ++int rate=-1; ++int delay=-1; ++ + static int parse_cmdline (int argc, char *argv[]) + { + int mode = -1; +@@ -46,11 +51,13 @@ + { "mode" , required_argument, NULL, 'm' }, + { "scancode" , no_argument, NULL, 's' }, + { "unicode" , no_argument, NULL, 'u' }, ++ { "rate" , required_argument, NULL, 'r' }, ++ { "delay" , required_argument, NULL, 'd' }, + { NULL, 0, NULL, 0 } + }; + int c; + +- while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF) ++ while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF) + switch (c) { + case 'h': + usage (); +@@ -58,6 +65,14 @@ + case 'V': + version (); + exit(0); ++ case 'r': ++ rate = atoi(optarg); ++ mode = -2; ++ break; ++ case 'd': ++ delay = atoi(optarg); ++ mode = -2; ++ break; + case 'a': + mode = K_XLATE; + break; +@@ -129,6 +144,20 @@ + exit(0); + } + ++ if ( rate != -1 || delay != -1 ) ++ { ++ struct kbd_repeat kbd_rep; ++ kbd_rep.delay = delay; ++ kbd_rep.period = rate; ++ if (ioctl(fd, KDKBDREP, &kbd_rep)) ++ { ++ fprintf(stderr, progname); ++ perror(_(": error setting keyboard repeat mode\n")); ++ exit(1); ++ } ++ if(mode==-2) exit(0); ++ } ++ + if (ioctl(fd, KDSKBMODE, mode)) + { + fprintf(stderr, progname); diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 new file mode 100644 index 0000000000..18d47a94f7 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 @@ -0,0 +1,24 @@ +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch new file mode 100644 index 0000000000..2ed609219c --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch @@ -0,0 +1,22 @@ +The docs need tools we don't have to build so disable them. + +Also remove intl since the Makefile doesn't work with 3.82 and we +don't want to build libintl anyway. + +Upstream-Status: Inappropriate [configuration] +RP 2012/10/17 + +Index: console-tools-0.3.2/Makefile.am +=================================================================== +--- console-tools-0.3.2.orig/Makefile.am 1999-04-15 01:33:24.000000000 +0000 ++++ console-tools-0.3.2/Makefile.am 2012-10-17 11:48:14.107069145 +0000 +@@ -1,7 +1,7 @@ + # -*- makefile -*- + AUTOMAKE_OPTIONS = foreign + +-SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib doc \ +- compat include examples po intl ++SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib \ ++ compat include examples po + + EXTRA_DIST = BUGS RELEASE CREDITS COPYING.kbd local-scripts/* debian/* *.lsm diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch new file mode 100644 index 0000000000..0c95068a36 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch @@ -0,0 +1,49 @@ +Fixing the locale issues isn't enough, console-tools also does a couple of +other pretty stupid things (like FILE *f; f->_fileno instead of fileno(f)), + +Upstream-Status: Pending + +--- console-tools-0.3.2/lib/cfont/fontstruct.c.ark 2005-05-22 19:12:38.000000000 +0000 ++++ console-tools-0.3.2/lib/cfont/fontstruct.c 2005-05-22 19:13:23.000000000 +0000 +@@ -50,8 +50,7 @@ + * get filesize + */ + +- /* FIXME: should not use _fileno ! */ +- if (fstat(fontfile->_fileno, &stbuf) == -1) ++ if (fstat(fileno(fontfile), &stbuf) == -1) + goto rsf_return_error; + + if (S_ISREG(stbuf.st_mode)) +@@ -211,8 +210,7 @@ + * get filesize + */ + +- /* FIXME: should not use _fileno ! */ +- if (fstat(fontfile->_fileno, &stbuf) == -1) ++ if (fstat(fileno(fontfile), &stbuf) == -1) + goto rfg_return_error; + + if (S_ISREG(stbuf.st_mode)) +--- console-tools-0.3.2/lib/console/acm.c.ark 2005-05-22 19:17:15.000000000 +0000 ++++ console-tools-0.3.2/lib/console/acm.c 2005-05-22 19:17:23.000000000 +0000 +@@ -30,7 +30,7 @@ + lct_boolean parse_failed = False; + lct_boolean is_unicode; + +- if (fstat(fp->_fileno, &stbuf)) ++ if (fstat(fileno(fp), &stbuf)) + perror(_("Cannot stat ACM file")), exit(1); + + /* first try a wg15-charmap (glibc) file format */ +--- console-tools-0.3.2/include/lct/local.h.ark 2005-05-22 19:08:54.000000000 +0000 ++++ console-tools-0.3.2/include/lct/local.h 2005-05-22 19:09:12.000000000 +0000 +@@ -8,7 +8,7 @@ + #include + + +-#ifdef HAVE_LOCALE_H ++#if defined(HAVE_LOCALE_H) && defined(HAVE_LIBINTL_H) + # include + # define _(String) gettext (String) + # ifdef gettext_noop diff --git a/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/meta/recipes-core/console-tools/console-tools_0.3.2.bb new file mode 100644 index 0000000000..80fab55214 --- /dev/null +++ b/meta/recipes-core/console-tools/console-tools_0.3.2.bb @@ -0,0 +1,36 @@ +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING.kbd;md5=9b2d91511d3d80d4d20ac6e6b0137fe9" +SUMMARY = "Allows you to set-up and manipulate the Linux console" +DESCRIPTION = "Provides tools that enable the set-up and manipulation of the linux console and console-font files." +PR = "r8" + +SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \ + file://codepage.patch \ + file://configure.patch \ + file://compile.patch \ + file://kbdrate.patch \ + file://uclibc-fileno.patch \ + file://nodocs.patch \ + file://fix-libconsole-linking.patch \ + file://lcmessage.m4 \ + file://Makevars" + +SRC_URI[md5sum] = "bf21564fc38b3af853ef724babddbacd" +SRC_URI[sha256sum] = "eea6b441672dacd251079fc85ed322e196282e0e66c16303ec64c3a2b1c126c2" + +do_configure_prepend () { + mkdir -p ${S}/m4 + cp ${WORKDIR}/lcmessage.m4 ${S}/m4/ + rm -f ${S}/acinclude.m4 + cp ${WORKDIR}/Makevars ${S}/po/ +} + +inherit autotools gettext update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +bindir_progs = "chvt deallocvt fgconsole openvt" +ALTERNATIVE_${PN} = "${bindir_progs}" + +RDEPENDS_${PN} = "bash" diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch new file mode 100644 index 0000000000..5452b46bbc --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch @@ -0,0 +1,120 @@ +Upstream-Status: Inappropriate [legacy version] + +This patch was imported from the Fedora Core 8 coreutils-6.9-9 package. + +The package is stated as being Licensed as GPLv2+. + +Signed-off-by: Mark Hatle + +---- + +When "cp -i --update old new" would do nothing because "new" is +newer than "old", cp would nonetheless prompt for whether it is +ok to overwrite "new". Then, regardless of the response (because +of the --update option), cp would do nothing. + +The following patch eliminates the unnecessary prompt in that case. + +diff --git a/src/copy.c b/src/copy.c +index b7bf73b..0e549d2 100644 +--- a/src/copy.c ++++ b/src/copy.c +@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name, + return false; + } + ++ if (!S_ISDIR (src_mode) && x->update) ++ { ++ /* When preserving time stamps (but not moving within a file ++ system), don't worry if the destination time stamp is ++ less than the source merely because of time stamp ++ truncation. */ ++ int options = ((x->preserve_timestamps ++ && ! (x->move_mode ++ && dst_sb.st_dev == src_sb.st_dev)) ++ ? UTIMECMP_TRUNCATE_SOURCE ++ : 0); ++ ++ if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options)) ++ { ++ /* We're using --update and the destination is not older ++ than the source, so do not copy or move. Pretend the ++ rename succeeded, so the caller (if it's mv) doesn't ++ end up removing the source file. */ ++ if (rename_succeeded) ++ *rename_succeeded = true; ++ return true; ++ } ++ } ++ + /* When there is an existing destination file, we may end up + returning early, and hence not copying/moving the file. + This may be due to an interactive `negative' reply to the +@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name, + return false; + } + } +- +- if (x->update) +- { +- /* When preserving time stamps (but not moving within a file +- system), don't worry if the destination time stamp is +- less than the source merely because of time stamp +- truncation. */ +- int options = ((x->preserve_timestamps +- && ! (x->move_mode +- && dst_sb.st_dev == src_sb.st_dev)) +- ? UTIMECMP_TRUNCATE_SOURCE +- : 0); +- +- if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options)) +- { +- /* We're using --update and the destination is not older +- than the source, so do not copy or move. Pretend the +- rename succeeded, so the caller (if it's mv) doesn't +- end up removing the source file. */ +- if (rename_succeeded) +- *rename_succeeded = true; +- return true; +- } +- } + } + + if (x->move_mode) +diff --git a/tests/mv/update b/tests/mv/update +index 0c06024..6c3d149 100755 +--- a/tests/mv/update ++++ b/tests/mv/update +@@ -1,7 +1,7 @@ + #!/bin/sh + # make sure --update works as advertised + +-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. ++# Copyright (C) 2001, 2004, 2006-2007 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -46,11 +46,16 @@ fi + + fail=0 + +-for cp_or_mv in cp mv; do +- # This is a no-op. +- $cp_or_mv --update old new || fail=1 +- case "`cat new`" in new) ;; *) fail=1 ;; esac +- case "`cat old`" in old) ;; *) fail=1 ;; esac ++for interactive in '' -i; do ++ for cp_or_mv in cp mv; do ++ # This is a no-op, with no prompt. ++ # With coreutils-6.9 and earlier, using --update with -i would ++ # mistakenly elicit a prompt. ++ $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1 ++ test -s out && fail=1 ++ case "`cat new`" in new) ;; *) fail=1 ;; esac ++ case "`cat old`" in old) ;; *) fail=1 ;; esac ++ done + done + + # This will actually perform the rename. +-- +1.5.3.rc1.16.g9d6f diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch new file mode 100644 index 0000000000..8273d78eb3 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch @@ -0,0 +1,28 @@ +Upstream-Status: Inappropriate [embedded specific] + +Fix the following issue so that coreutils can build with ACL: + +configure: WARNING: libacl development library was not found or not usable. +configure: WARNING: GNU coreutils will be built without ACL support. + +Signed-off-by: Jackie Huang +--- + m4/acl.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/m4/acl.m4 b/m4/acl.m4 +index d6a448a..a9d4836 100644 +--- a/m4/acl.m4 ++++ b/m4/acl.m4 +@@ -159,7 +159,7 @@ AC_DEFUN([gl_ACL_GET_FILE], + ]])], + [gl_cv_func_working_acl_get_file=yes], + [gl_cv_func_working_acl_get_file=no], +- [gl_cv_func_working_acl_get_file=cross-compiling])]) ++ [gl_cv_func_working_acl_get_file=yes])]) + + AS_IF([test $gl_cv_func_working_acl_get_file = yes], [$1], [$2]) + ]) +-- +1.7.7 + diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch new file mode 100644 index 0000000000..88f61fa108 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch @@ -0,0 +1,101 @@ +Upstream-Status: Inappropriate [legacy version] + +The install command doesn't over write the dangling symlink, for +example: + +$ install fileA /tmp/fileA + +If /tmp/fileA is a dangling symlink, there would be an error: + +install: cannot create regular file '/tmp/fileA': File exists + +This is because of the following code in copy.c: + + if (!new_dst) + { + if (XSTAT (x, dst_name, &dst_sb) != 0) + { + if (errno != ENOENT) + { + error (0, errno, _("cannot stat %s"), quote (dst_name)); + return false; + } + else + { + new_dst = true; + } + } + +XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when +install.c invokes it, and stat will set errno to ENOENT, and then +new_dst will be set to true which means that /tmp/fileA doesn't exist, +then we will create /tmp/fileA without remove it first, so the error +comes. + +This is fixed in a way which adds the member cmd_install in +struct cp_options to make sure my change only affected to the install +command and use lstat to fix the problem. + +Signed-off-by: Robert Yang +Signed-off-by: Mark Hatle + +--- + src/copy.c | 10 +++++++++- + src/copy.h | 3 +++ + src/install.c | 1 + + 3 files changed, 13 insertions(+), 1 deletions(-) + +diff --git a/src/copy.c b/src/copy.c +--- a/src/copy.c ++++ b/src/copy.c +@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name, + bool delayed_ok; + bool copied_as_regular = false; + bool preserve_metadata; ++ int dst_stat_result; + + if (x->move_mode && rename_succeeded) + *rename_succeeded = false; +@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name, + + if (!new_dst) + { +- if (XSTAT (x, dst_name, &dst_sb) != 0) ++ if ( x->cmd_install && ( x->backup_type == no_backups)) ++ dst_stat_result = lstat (dst_name, &dst_sb); ++ else ++ { ++ dst_stat_result = XSTAT (x, dst_name, &dst_sb); ++ } ++ ++ if (dst_stat_result != 0) + { + if (errno != ENOENT) + { +diff --git a/src/copy.h b/src/copy.h +--- a/src/copy.h ++++ b/src/copy.h +@@ -114,6 +114,9 @@ struct cp_options + If that fails, then resort to copying. */ + bool move_mode; + ++ /* For the install command */ ++ bool cmd_install; ++ + /* Whether this process has appropriate privileges to chown a file + whose owner is not the effective user ID. */ + bool chown_privileges; +diff --git a/src/install.c b/src/install.c +--- a/src/install.c ++++ b/src/install.c +@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x) + x->hard_link = false; + x->interactive = I_UNSPECIFIED; + x->move_mode = false; ++ x->cmd_install = true; + x->chown_privileges = chown_privileges (); + x->one_file_system = false; + x->preserve_ownership = false; +-- +1.7.0.1 + diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch new file mode 100644 index 0000000000..3ae5a2faeb --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch @@ -0,0 +1,375 @@ +From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Tue, 26 Nov 2013 00:21:50 +0800 +Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx' + +Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses +to process an '@itemx' that is not preceded by an '@item'. Ensure that +node extended names in menus and sectioning are consistent, and that +ordering and presence of nodes in menus and in the actual text are +consistent as well. + +Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828] + +Signed-off-by: Robert Yang +--- + doc/coreutils.texi | 82 +++++++++++++++++++++++++++--------------------------- + 1 file changed, 41 insertions(+), 41 deletions(-) + +diff --git a/doc/coreutils.texi b/doc/coreutils.texi +index 588147f..2dae3fe 100644 +--- a/doc/coreutils.texi ++++ b/doc/coreutils.texi +@@ -555,7 +555,7 @@ symbolic link to a directory. @xref{Target directory}. + @end macro + + @macro optSi +-@itemx --si ++@item --si + @opindex --si + @cindex SI output + Append an SI-style abbreviation to each size, such as @samp{M} for +@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000. + @end macro + + @macro optStripTrailingSlashes +-@itemx @w{@kbd{--strip-trailing-slashes}} ++@item @w{@kbd{--strip-trailing-slashes}} + @opindex --strip-trailing-slashes + @cindex stripping trailing slashes + Remove any trailing slashes from each @var{source} argument. +@@ -2496,7 +2496,7 @@ by 1048576. + However, if @var{n} starts with a @samp{-}, + print all but the last @var{n} bytes of each file. + +-@itemx -n @var{n} ++@item -n @var{n} + @itemx --lines=@var{n} + @opindex -n + @opindex --lines +@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}. That is, tail + will attempt to reopen a file when it is removed. Should this fail, tail + will keep trying until it becomes accessible again. + +-@itemx --retry ++@item --retry + @opindex --retry + This option is useful mainly when following by name (i.e., with + @option{--follow=name}). +@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't + exist or is otherwise inaccessible, it reports that fact and + never checks it again. + +-@itemx --sleep-interval=@var{number} ++@item --sleep-interval=@var{number} + @opindex --sleep-interval + Change the number of seconds to wait between iterations (the default is 1.0). + During one iteration, every specified file is checked to see if it has +@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that + an arbitrary floating point number (using a period before any + fractional digits). + +-@itemx --pid=@var{pid} ++@item --pid=@var{pid} + @opindex --pid + When following by name or by descriptor, you may specify the process ID, + @var{pid}, of the sole writer of all @var{file} arguments. Then, shortly +@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated. + Note that @option{--pid} cannot be supported on some systems; @command{tail} + will print a warning if this is the case. + +-@itemx --max-unchanged-stats=@var{n} ++@item --max-unchanged-stats=@var{n} + @opindex --max-unchanged-stats + When tailing a file by name, if there have been @var{n} (default + n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive +@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines + and when it prints the lines that have accumulated in the new log file. + This option is meaningful only when following by name. + +-@itemx -n @var{n} ++@item -n @var{n} + @itemx --lines=@var{n} + @opindex -n + @opindex --lines +@@ -2817,7 +2817,7 @@ option. + @opindex --numeric-suffixes + Use digits in suffixes rather than lower-case letters. + +-@itemx --verbose ++@item --verbose + @opindex --verbose + Write a diagnostic to standard error just before each output file is opened. + +@@ -3055,7 +3055,7 @@ Print only the newline counts. + @opindex --max-line-length + Print only the maximum line lengths. + +-@itemx --files0-from=@var{FILE} ++@item --files0-from=@var{FILE} + @opindex --files0-from=@var{FILE} + @cindex including files from @command{du} + Rather than processing files named on the command line, process those +@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid + line is found, @command{md5sum} exits with nonzero status. Otherwise, + it exits successfully. + +-@itemx --status ++@item --status + @opindex --status + @cindex verifying MD5 checksums + This option is useful only when verifying checksums. +@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}), + If a command line argument specifies a symbolic link, show information + for the file the link references rather than for the link itself. + +-@itemx --dereference-command-line-symlink-to-dir ++@item --dereference-command-line-symlink-to-dir + @opindex --dereference-command-line-symlink-to-dir + @cindex symbolic links, dereferencing + Do not dereference symbolic links, with one exception: +@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list + of one or more of the following strings: + + @table @samp +-@itemx mode ++@item mode + Preserve the file mode bits and access control lists. +-@itemx ownership ++@item ownership + Preserve the owner and group. On most modern systems, + only users with appropriate privileges may change the owner of a file, + and ordinary users + may preserve the group ownership of a file only if they happen to be + a member of the desired group. +-@itemx timestamps ++@item timestamps + Preserve the times of last access and last modification, when possible. + In general, it is not possible to preserve these attributes + when the affected file is a symbolic link. +@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes + it possibile even for symbolic links. However, this implementation does + not yet take advantage of that. + @c FIXME: once we provide lutimes support, update the above. +-@itemx links ++@item links + Preserve in the destination files + any links between corresponding source files. + @c Give examples illustrating how hard links are preserved. + @c Also, show how soft links map to hard links with -L and -H. +-@itemx all ++@item all + Preserve all file attributes. + Equivalent to specifying all of the above. + @end table +@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the + umask and minus the set-user-ID and set-group-ID bits. + @xref{File permissions}. + +-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}} ++@item @w{@kbd{--no-preserve}=@var{attribute_list}} + @cindex file information, preserving + Do not preserve the specified attributes. The @var{attribute_list} + has the same form as for @option{--preserve}. + +-@itemx --parents ++@item --parents + @opindex --parents + @cindex parent directories and @command{cp} + Form the name of each destination file by appending to the target +@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir + copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating + any missing intermediate directories. + +-@itemx @w{@kbd{--reply}=@var{how}} ++@item @w{@kbd{--reply}=@var{how}} + @opindex --reply + @cindex interactivity + @c FIXME: remove in 2008 +@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless + of its permissions. + If the response is not affirmative, the file is skipped. + +-@itemx @w{@kbd{--reply}=@var{how}} ++@item @w{@kbd{--reply}=@var{how}} + @opindex --reply + @cindex interactivity + @c FIXME: remove in 2008 +@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested. Ignore any + previous @option{--force} (@option{-f}) option. Equivalent to + @option{--interactive=once}. + +-@itemx --interactive [=@var{when}] ++@item --interactive [=@var{when}] + @opindex --interactive + Specify when to issue an interactive prompt. @var{when} may be + omitted, or one of: +@@ -7866,7 +7866,7 @@ removal is requested. Equivalent to @option{-I}. + Specifying @option{--interactive} and no @var{when} is equivalent to + @option{--interactive=always}. + +-@itemx --one-file-system ++@item --one-file-system + @opindex --one-file-system + @cindex one file system, restricting @command{rm} to + When removing a hierarchy recursively, skip any directory that is on a +@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems. + Of course, this will not save your @file{/home} if it and your + chroot happen to be on the same file system. + +-@itemx --preserve-root ++@item --preserve-root + @opindex --preserve-root + @cindex root directory, disallow recursive destruction + Fail upon any attempt to remove the root directory, @file{/}, +@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option. + This is the default behavior. + @xref{Treating / specially}. + +-@itemx --no-preserve-root ++@item --no-preserve-root + @opindex --no-preserve-root + @cindex root directory, allow recursive destruction + Do not treat @file{/} specially when removing recursively. +@@ -8874,7 +8874,7 @@ actually changes. + Do not print error messages about files whose ownership cannot be + changed. + +-@itemx @w{@kbd{--from}=@var{old-owner}} ++@item @w{@kbd{--from}=@var{old-owner}} + @opindex --from + @cindex symbolic links, changing owner + Change a @var{file}'s ownership only if it has current attributes specified +@@ -8928,14 +8928,14 @@ is a symbolic link. + By default, no diagnostic is issued for symbolic links encountered + during a recursive traversal, but see @option{--verbose}. + +-@itemx --preserve-root ++@item --preserve-root + @opindex --preserve-root + @cindex root directory, disallow recursive modification + Fail upon any attempt to recursively change the root directory, @file{/}. + Without @option{--recursive}, this option has no effect. + @xref{Treating / specially}. + +-@itemx --no-preserve-root ++@item --no-preserve-root + @opindex --no-preserve-root + @cindex root directory, allow recursive modification + Cancel the effect of any preceding @option{--preserve-root} option. +@@ -9054,14 +9054,14 @@ is a symbolic link. + By default, no diagnostic is issued for symbolic links encountered + during a recursive traversal, but see @option{--verbose}. + +-@itemx --preserve-root ++@item --preserve-root + @opindex --preserve-root + @cindex root directory, disallow recursive modification + Fail upon any attempt to recursively change the root directory, @file{/}. + Without @option{--recursive}, this option has no effect. + @xref{Treating / specially}. + +-@itemx --no-preserve-root ++@item --no-preserve-root + @opindex --no-preserve-root + @cindex root directory, allow recursive modification + Cancel the effect of any preceding @option{--preserve-root} option. +@@ -9175,14 +9175,14 @@ actually changes. + Do not print error messages about files whose permissions cannot be + changed. + +-@itemx --preserve-root ++@item --preserve-root + @opindex --preserve-root + @cindex root directory, disallow recursive modification + Fail upon any attempt to recursively change the root directory, @file{/}. + Without @option{--recursive}, this option has no effect. + @xref{Treating / specially}. + +-@itemx --no-preserve-root ++@item --no-preserve-root + @opindex --no-preserve-root + @cindex root directory, allow recursive modification + Cancel the effect of any preceding @option{--preserve-root} option. +@@ -9603,7 +9603,7 @@ The program accepts the following options. Also see @ref{Common options}. + @opindex --all + Show counts for all files, not just directories. + +-@itemx --apparent-size ++@item --apparent-size + @opindex --apparent-size + Print apparent sizes, rather than disk usage. The apparent size of a + file is the number of bytes reported by @code{wc -c} on regular files, +@@ -9654,7 +9654,7 @@ Does not affect other symbolic links. This is helpful for finding + out the disk usage of directories, such as @file{/usr/tmp}, which + are often symbolic links. + +-@itemx --files0-from=@var{FILE} ++@item --files0-from=@var{FILE} + @opindex --files0-from=@var{FILE} + @cindex including files from @command{du} + Rather than processing files named on the command line, process those +@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline. + This option enables other programs to parse the output of @command{du} + even when that output would contain file names with embedded newlines. + +-@itemx --si ++@item --si + @opindex --si + @cindex SI output + Append an SI-style abbreviation to each size, such as @samp{MB} for +@@ -9754,13 +9754,13 @@ Display only a total for each argument. + Report the size of each directory separately, not including the sizes + of subdirectories. + +-@itemx --time ++@item --time + @opindex --time + @cindex last modified dates, displaying in @command{du} + Show time of the most recent modification of any file in the directory, + or any of its subdirectories. + +-@itemx --time=ctime ++@item --time=ctime + @itemx --time=status + @itemx --time=use + @opindex --time +@@ -9770,7 +9770,7 @@ or any of its subdirectories. + Show the most recent status change time (the @samp{ctime} in the inode) of + any file in the directory, instead of the modification time. + +-@itemx --time=atime ++@item --time=atime + @itemx --time=access + @opindex --time + @opindex atime@r{, show the most recent} +@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr + 2057:2 + @end example + +-@itemx --printf=@var{format} ++@item --printf=@var{format} + @opindex --printf=@var{format} + @cindex output format + Use @var{format} rather than the default format. +@@ -12240,7 +12240,7 @@ Overrides all other options. + @opindex -s + Ignored; for compatibility with other versions of @command{who}. + +-@itemx -u ++@item -u + @opindex -u + @cindex idle time + After the login time, print the number of hours and minutes that the +@@ -12254,7 +12254,7 @@ user has been idle. @samp{.} means the user was active in the last minute. + List only the entries that correspond to processes via which the + system is waiting for a user to login. The user name is always @samp{LOGIN}. + +-@itemx --lookup ++@item --lookup + @opindex --lookup + Attempt to canonicalize hostnames found in utmp through a DNS lookup. This + is not the default because it can cause significant delays on systems with +-- +1.8.3.1 + diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch new file mode 100644 index 0000000000..653722348a --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch @@ -0,0 +1,4051 @@ +Upstream-Status: Inappropriate [legacy version] + +This patch was imported from the Fedora Core 8 coreutils-6.9-9 package. + +The package is stated as being Licensed as GPLv2+. + +The comment indicates that the purpose is lin18nux/lsb compliance. + +Signed-off-by: Mark Hatle + +--- /dev/null 2007-03-01 09:16:39.219409909 +0000 ++++ coreutils-6.8+/tests/sort/sort-mb-tests 2007-03-01 15:08:24.000000000 +0000 +@@ -0,0 +1,58 @@ ++#! /bin/sh ++case $# in ++ 0) xx='../../src/sort';; ++ *) xx="$1";; ++esac ++test "$VERBOSE" && echo=echo || echo=: ++$echo testing program: $xx ++errors=0 ++test "$srcdir" || srcdir=. ++test "$VERBOSE" && $xx --version 2> /dev/null ++ ++export LC_ALL=en_US.UTF-8 ++locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77 ++errors=0 ++ ++$xx -t ï¼  -k2 -n mb1.I > mb1.O ++code=$? ++if test $code != 0; then ++ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2 ++ errors=`expr $errors + 1` ++else ++ cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1 ++ case $? in ++ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;; ++ 1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2 ++ (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null ++ errors=`expr $errors + 1`;; ++ 2) $echo "Test mb1 may have failed." 1>&2 ++ $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2 ++ errors=`expr $errors + 1`;; ++ esac ++fi ++ ++$xx -t ï¼  -k4 -n mb2.I > mb2.O ++code=$? ++if test $code != 0; then ++ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2 ++ errors=`expr $errors + 1` ++else ++ cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1 ++ case $? in ++ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;; ++ 1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2 ++ (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null ++ errors=`expr $errors + 1`;; ++ 2) $echo "Test mb2 may have failed." 1>&2 ++ $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2 ++ errors=`expr $errors + 1`;; ++ esac ++fi ++ ++if test $errors = 0; then ++ $echo Passed all 113 tests. 1>&2 ++else ++ $echo Failed $errors tests. 1>&2 ++fi ++test $errors = 0 || errors=1 ++exit $errors +--- /dev/null 2007-03-01 09:16:39.219409909 +0000 ++++ coreutils-6.8+/tests/sort/mb2.I 2007-03-01 15:08:24.000000000 +0000 +@@ -0,0 +1,4 @@ ++Apple@AA10ï¼ ï¼ 20 ++Banana@AA5ï¼ ï¼ 30 ++Citrus@AA20ï¼ ï¼ 5 ++Cherry@AA30ï¼ ï¼ 10 +--- /dev/null 2007-03-01 09:16:39.219409909 +0000 ++++ coreutils-6.8+/tests/sort/mb2.X 2007-03-01 15:08:24.000000000 +0000 +@@ -0,0 +1,4 @@ ++Citrus@AA20ï¼ ï¼ 5 ++Cherry@AA30ï¼ ï¼ 10 ++Apple@AA10ï¼ ï¼ 20 ++Banana@AA5ï¼ ï¼ 30 +--- /dev/null 2007-03-01 09:16:39.219409909 +0000 ++++ coreutils-6.8+/tests/sort/mb1.I 2007-03-01 15:08:24.000000000 +0000 +@@ -0,0 +1,4 @@ ++Appleï¼ 10 ++Bananaï¼ 5 ++Citrusï¼ 20 ++Cherryï¼ 30 +--- /dev/null 2007-03-01 09:16:39.219409909 +0000 ++++ coreutils-6.8+/tests/sort/mb1.X 2007-03-01 15:08:24.000000000 +0000 +@@ -0,0 +1,4 @@ ++Bananaï¼ 5 ++Appleï¼ 10 ++Citrusï¼ 20 ++Cherryï¼ 30 +--- coreutils-6.8+/tests/sort/Makefile.am.i18n 2007-01-24 07:47:37.000000000 +0000 ++++ coreutils-6.8+/tests/sort/Makefile.am 2007-03-01 15:09:59.000000000 +0000 +@@ -66,15 +66,17 @@ + bigfield.O bigfield.E + ##test-files-end + +-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) +-noinst_SCRIPTS = $x-tests ++run_gen += mb1.0 mb2.0 ++ ++EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X ++noinst_SCRIPTS = $x-tests # $x-mb-tests + TESTS_ENVIRONMENT = \ + CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \ + PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" + + editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g' + +-TESTS = $x-tests ++TESTS = $x-tests $x-mb-tests + + mk_script = $(srcdir)/../mk-script + $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am +--- coreutils-6.8+/lib/linebuffer.h.i18n 2005-05-14 07:44:24.000000000 +0100 ++++ coreutils-6.8+/lib/linebuffer.h 2007-03-01 15:08:24.000000000 +0000 +@@ -22,6 +22,11 @@ + + # include + ++/* Get mbstate_t. */ ++# if HAVE_WCHAR_H ++# include ++# endif ++ + /* A `struct linebuffer' holds a line of text. */ + + struct linebuffer +@@ -29,6 +34,9 @@ + size_t size; /* Allocated. */ + size_t length; /* Used. */ + char *buffer; ++# if HAVE_WCHAR_H ++ mbstate_t state; ++# endif + }; + + /* Initialize linebuffer LINEBUFFER for use. */ +--- coreutils-6.8+/src/expand.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/expand.c 2007-03-01 15:08:24.000000000 +0000 +@@ -38,11 +38,28 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "expand" + +@@ -183,6 +200,7 @@ + stops = num_start + len - 1; + } + } ++ + else + { + error (0, 0, _("tab size contains invalid character(s): %s"), +@@ -365,6 +383,142 @@ + } + } + ++#if HAVE_MBRTOWC ++static void ++expand_multibyte (void) ++{ ++ FILE *fp; /* Input strem. */ ++ mbstate_t i_state; /* Current shift state of the input stream. */ ++ mbstate_t i_state_bak; /* Back up the I_STATE. */ ++ mbstate_t o_state; /* Current shift state of the output stream. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ wchar_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character ++ which shows as same character as WC. */ ++ int tab_index = 0; /* Index in `tab_list' of next tabstop. */ ++ int column = 0; /* Column on screen of the next char. */ ++ int next_tab_column; /* Column the next tab stop is on. */ ++ int convert = 1; /* If nonzero, perform translations. */ ++ ++ fp = next_file ((FILE *) NULL); ++ if (fp == NULL) ++ return; ++ ++ memset (&o_state, '\0', sizeof(mbstate_t)); ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ /* Refill the buffer BUF. */ ++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp); ++ bufpos = buf; ++ } ++ ++ /* No character is left in BUF. */ ++ if (buflen < 1) ++ { ++ fp = next_file (fp); ++ ++ if (fp == NULL) ++ break; /* No more files. */ ++ else ++ { ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ continue; ++ } ++ } ++ ++ /* Get a wide character. */ ++ i_state_bak = i_state; ++ mblength = mbrtowc (&wc, bufpos, buflen, &i_state); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: /* illegal byte sequence. */ ++ case (size_t)-2: ++ mblength = 1; ++ i_state = i_state_bak; ++ if (convert) ++ { ++ ++column; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ putchar (*bufpos); ++ break; ++ ++ case 0: /* null. */ ++ mblength = 1; ++ if (convert && convert_entire_line == 0) ++ convert = 0; ++ putchar ('\0'); ++ break; ++ ++ default: ++ if (wc == L'\n') /* LF. */ ++ { ++ tab_index = 0; ++ column = 0; ++ convert = 1; ++ putchar ('\n'); ++ } ++ else if (wc == L'\t' && convert) /* Tab. */ ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (tab_index < first_free_tab - 1 ++ && column >= tab_list[tab_index]) ++ tab_index++; ++ next_tab_column = tab_list[tab_index]; ++ if (tab_index < first_free_tab - 1) ++ tab_index++; ++ if (column >= next_tab_column) ++ next_tab_column = column + 1; ++ } ++ else ++ next_tab_column = column + tab_size - column % tab_size; ++ ++ while (column < next_tab_column) ++ { ++ putchar (' '); ++ ++column; ++ } ++ } ++ else /* Others. */ ++ { ++ if (convert) ++ { ++ if (wc == L'\b') ++ { ++ if (column > 0) ++ --column; ++ } ++ else ++ { ++ int width; /* The width of WC. */ ++ ++ width = wcwidth (wc); ++ column += (width > 0) ? width : 0; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ } ++ fwrite (bufpos, sizeof(char), mblength, stdout); ++ } ++ } ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ + int + main (int argc, char **argv) + { +@@ -429,7 +583,12 @@ + + file_list = (optind < argc ? &argv[optind] : stdin_argv); + +- expand (); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ expand_multibyte (); ++ else ++#endif ++ expand (); + + if (have_read_stdin && fclose (stdin) != 0) + error (EXIT_FAILURE, errno, "-"); +--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000 +@@ -23,16 +23,30 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswblank(), towupper. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "hard-locale.h" + #include "linebuffer.h" +-#include "memcasecmp.h" + #include "quote.h" + #include "stdio--.h" + #include "xmemcoll.h" + #include "xstrtol.h" + ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "join" + +@@ -104,10 +118,12 @@ + /* Last element in `outlist', where a new element can be added. */ + static struct outlist *outlist_end = &outlist_head; + +-/* Tab character separating fields. If negative, fields are separated +- by any nonempty string of blanks, otherwise by exactly one +- tab character whose value (when cast to unsigned char) equals TAB. */ +-static int tab = -1; ++/* Tab character separating fields. If NULL, fields are separated ++ by any nonempty string of blanks. */ ++static char *tab = NULL; ++ ++/* The number of bytes used for tab. */ ++static size_t tablen = 0; + + static struct option const longopts[] = + { +@@ -190,6 +206,8 @@ + + /* Fill in the `fields' structure in LINE. */ + ++/* Fill in the `fields' structure in LINE. */ ++ + static void + xfields (struct line *line) + { +@@ -199,10 +217,11 @@ + if (ptr == lim) + return; + +- if (0 <= tab) ++ if (tab != NULL) + { ++ unsigned char t = tab[0]; + char *sep; +- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1) ++ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1) + extract_field (line, ptr, sep - ptr); + } + else +@@ -229,6 +248,148 @@ + extract_field (line, ptr, lim - ptr); + } + ++#if HAVE_MBRTOWC ++static void ++xfields_multibyte (struct line *line) ++{ ++ char *ptr = line->buf.buffer; ++ char const *lim = ptr + line->buf.length - 1; ++ wchar_t wc = 0; ++ size_t mblength = 1; ++ mbstate_t state, state_bak; ++ ++ memset (&state, 0, sizeof (mbstate_t)); ++ ++ if (ptr == lim) ++ return; ++ ++ if (tab != NULL) ++ { ++ unsigned char t = tab[0]; ++ char *sep = ptr; ++ for (; ptr < lim; ptr = sep + mblength) ++ { ++ sep = ptr; ++ while (sep < lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (mblength == tablen && !memcmp (sep, tab, mblength)) ++ break; ++ else ++ { ++ sep += mblength; ++ continue; ++ } ++ } ++ ++ if (sep == lim) ++ break; ++ ++ extract_field (line, ptr, sep - ptr); ++ } ++ } ++ else ++ { ++ /* Skip leading blanks before the first field. */ ++ while(ptr < lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (!iswblank(wc)) ++ break; ++ ptr += mblength; ++ } ++ ++ do ++ { ++ char *sep; ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ sep = ptr + mblength; ++ while (sep != lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (iswblank (wc)) ++ break; ++ ++ sep += mblength; ++ } ++ ++ extract_field (line, ptr, sep - ptr); ++ if (sep == lim) ++ return; ++ ++ state_bak = state; ++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ ptr = sep + mblength; ++ while (ptr != lim) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ mblength = 1; ++ state = state_bak; ++ break; ++ } ++ mblength = (mblength < 1) ? 1 : mblength; ++ ++ if (!iswblank (wc)) ++ break; ++ ++ ptr += mblength; ++ } ++ } ++ while (ptr != lim); ++ } ++ ++ extract_field (line, ptr, lim - ptr); ++} ++#endif ++ + /* Read a line from FP into LINE and split it into fields. + Return true if successful. */ + +@@ -249,6 +410,11 @@ + line->nfields_allocated = 0; + line->nfields = 0; + line->fields = NULL; ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ xfields_multibyte (line); ++ else ++#endif + xfields (line); + return true; + } +@@ -303,56 +469,114 @@ + keycmp (struct line const *line1, struct line const *line2) + { + /* Start of field to compare in each file. */ +- char *beg1; +- char *beg2; +- +- size_t len1; +- size_t len2; /* Length of fields to compare. */ ++ char *beg[2]; ++ char *copy[2]; ++ size_t len[2]; /* Length of fields to compare. */ + int diff; ++ int i, j; + + if (join_field_1 < line1->nfields) + { +- beg1 = line1->fields[join_field_1].beg; +- len1 = line1->fields[join_field_1].len; ++ beg[0] = line1->fields[join_field_1].beg; ++ len[0] = line1->fields[join_field_1].len; + } + else + { +- beg1 = NULL; +- len1 = 0; ++ beg[0] = NULL; ++ len[0] = 0; + } + + if (join_field_2 < line2->nfields) + { +- beg2 = line2->fields[join_field_2].beg; +- len2 = line2->fields[join_field_2].len; ++ beg[1] = line2->fields[join_field_2].beg; ++ len[1] = line2->fields[join_field_2].len; + } + else + { +- beg2 = NULL; +- len2 = 0; ++ beg[1] = NULL; ++ len[1] = 0; + } + +- if (len1 == 0) +- return len2 == 0 ? 0 : -1; +- if (len2 == 0) ++ if (len[0] == 0) ++ return len[1] == 0 ? 0 : -1; ++ if (len[1] == 0) + return 1; + + if (ignore_case) + { +- /* FIXME: ignore_case does not work with NLS (in particular, +- with multibyte chars). */ +- diff = memcasecmp (beg1, beg2, MIN (len1, len2)); ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ size_t mblength; ++ wchar_t wc, uwc; ++ mbstate_t state, state_bak; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++ ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0; j < MIN (len[0], len[1]);) ++ { ++ state_bak = state; ++ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state); ++ ++ switch (mblength) ++ { ++ case (size_t) -1: ++ case (size_t) -2: ++ state = state_bak; ++ /* Fall through */ ++ case 0: ++ mblength = 1; ++ break; ++ ++ default: ++ uwc = towupper (wc); ++ ++ if (uwc != wc) ++ { ++ mbstate_t state_wc; ++ ++ memset (&state_wc, '\0', sizeof (mbstate_t)); ++ wcrtomb (copy[i] + j, uwc, &state_wc); ++ } ++ else ++ memcpy (copy[i] + j, beg[i] + j, mblength); ++ } ++ j += mblength; ++ } ++ copy[i][j] = '\0'; ++ } ++ } ++ else ++#endif ++ { ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0; j < MIN (len[0], len[1]); j++) ++ copy[i][j] = toupper (beg[i][j]); ++ ++ copy[i][j] = '\0'; ++ } ++ } + } + else + { +- if (hard_LC_COLLATE) +- return xmemcoll (beg1, len1, beg2, len2); +- diff = memcmp (beg1, beg2, MIN (len1, len2)); ++ copy[0] = (unsigned char *) beg[0]; ++ copy[1] = (unsigned char *) beg[1]; + } + ++ if (hard_LC_COLLATE) ++ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); ++ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1])); ++ + if (diff) + return diff; +- return len1 < len2 ? -1 : len1 != len2; ++ return len[0] - len[1]; + } + + /* Print field N of LINE if it exists and is nonempty, otherwise +@@ -377,11 +601,18 @@ + + /* Print the join of LINE1 and LINE2. */ + ++#define PUT_TAB_CHAR \ ++ do \ ++ { \ ++ (tab != NULL) ? \ ++ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \ ++ } \ ++ while (0) ++ + static void + prjoin (struct line const *line1, struct line const *line2) + { + const struct outlist *outlist; +- char output_separator = tab < 0 ? ' ' : tab; + + outlist = outlist_head.next; + if (outlist) +@@ -397,12 +628,12 @@ + if (o->file == 0) + { + if (line1 == &uni_blank) +- { ++ { + line = line2; + field = join_field_2; + } + else +- { ++ { + line = line1; + field = join_field_1; + } +@@ -416,7 +647,7 @@ + o = o->next; + if (o == NULL) + break; +- putchar (output_separator); ++ PUT_TAB_CHAR; + } + putchar ('\n'); + } +@@ -434,23 +665,23 @@ + prfield (join_field_1, line1); + for (i = 0; i < join_field_1 && i < line1->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line1); + } + for (i = join_field_1 + 1; i < line1->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line1); + } + + for (i = 0; i < join_field_2 && i < line2->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line2); + } + for (i = join_field_2 + 1; i < line2->nfields; ++i) + { +- putchar (output_separator); ++ PUT_TAB_CHAR; + prfield (i, line2); + } + putchar ('\n'); +@@ -859,20 +1090,41 @@ + + case 't': + { +- unsigned char newtab = optarg[0]; +- if (! newtab) ++ char *newtab; ++ size_t newtablen; ++ if (! optarg[0]) + error (EXIT_FAILURE, 0, _("empty tab")); +- if (optarg[1]) ++ newtab = xstrdup (optarg); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ mbstate_t state; ++ ++ memset (&state, 0, sizeof (mbstate_t)); ++ newtablen = mbrtowc (NULL, newtab, ++ strnlen (newtab, MB_LEN_MAX), ++ &state); ++ if (newtablen == (size_t) 0 ++ || newtablen == (size_t) -1 ++ || newtablen == (size_t) -2) ++ newtablen = 1; ++ } ++ else ++#endif ++ newtablen = 1; ++ ++ if (newtablen == 1 && newtab[1]) ++ { ++ if (STREQ (newtab, "\\0")) ++ newtab[0] = '\0'; ++ } ++ if (tab != NULL && strcmp (tab, newtab)) + { +- if (STREQ (optarg, "\\0")) +- newtab = '\0'; +- else +- error (EXIT_FAILURE, 0, _("multi-character tab %s"), +- quote (optarg)); ++ free (newtab); ++ error (EXIT_FAILURE, 0, _("incompatible tabs")); + } +- if (0 <= tab && tab != newtab) +- error (EXIT_FAILURE, 0, _("incompatible tabs")); + tab = newtab; ++ tablen = newtablen; + } + break; + +--- coreutils-6.8+/src/uniq.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/uniq.c 2007-03-01 15:08:24.000000000 +0000 +@@ -23,6 +23,16 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get isw* functions. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "argmatch.h" + #include "linebuffer.h" +@@ -32,7 +42,19 @@ + #include "quote.h" + #include "xmemcoll.h" + #include "xstrtol.h" +-#include "memcasecmp.h" ++#include "xmemcoll.h" ++ ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "uniq" +@@ -109,6 +131,10 @@ + /* Select whether/how to delimit groups of duplicate lines. */ + static enum delimit_method delimit_groups; + ++/* Function pointers. */ ++static char * ++(*find_field) (struct linebuffer *line); ++ + static struct option const longopts[] = + { + {"count", no_argument, NULL, 'c'}, +@@ -198,7 +224,7 @@ + return a pointer to the beginning of the line's field to be compared. */ + + static char * +-find_field (const struct linebuffer *line) ++find_field_uni (struct linebuffer *line) + { + size_t count; + char *lp = line->buffer; +@@ -219,6 +245,83 @@ + return lp + i; + } + ++#if HAVE_MBRTOWC ++ ++# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ CONVFAIL = 0; \ ++ state_bak = *STATEP; \ ++ \ ++ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-2: \ ++ case (size_t)-1: \ ++ *STATEP = state_bak; \ ++ CONVFAIL++; \ ++ /* Fall through */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ ++ while (0) ++ ++static char * ++find_field_multi (struct linebuffer *line) ++{ ++ size_t count; ++ char *lp = line->buffer; ++ size_t size = line->length - 1; ++ size_t pos; ++ size_t mblength; ++ wchar_t wc; ++ mbstate_t *statep; ++ int convfail; ++ ++ pos = 0; ++ statep = &(line->state); ++ ++ /* skip fields. */ ++ for (count = 0; count < skip_fields && pos < size; count++) ++ { ++ while (pos < size) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ ++ if (convfail || !iswblank (wc)) ++ { ++ pos += mblength; ++ break; ++ } ++ pos += mblength; ++ } ++ ++ while (pos < size) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ ++ if (!convfail && iswblank (wc)) ++ break; ++ ++ pos += mblength; ++ } ++ } ++ ++ /* skip fields. */ ++ for (count = 0; count < skip_chars && pos < size; count++) ++ { ++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail); ++ pos += mblength; ++ } ++ ++ return lp + pos; ++} ++#endif ++ + /* Return false if two strings OLD and NEW match, true if not. + OLD and NEW point not to the beginnings of the lines + but rather to the beginnings of the fields to compare. +@@ -227,6 +330,8 @@ + static bool + different (char *old, char *new, size_t oldlen, size_t newlen) + { ++ char *copy_old, *copy_new; ++ + if (check_chars < oldlen) + oldlen = check_chars; + if (check_chars < newlen) +@@ -234,14 +339,92 @@ + + if (ignore_case) + { +- /* FIXME: This should invoke strcoll somehow. */ +- return oldlen != newlen || memcasecmp (old, new, oldlen); ++ size_t i; ++ ++ copy_old = alloca (oldlen + 1); ++ copy_new = alloca (oldlen + 1); ++ ++ for (i = 0; i < oldlen; i++) ++ { ++ copy_old[i] = toupper (old[i]); ++ copy_new[i] = toupper (new[i]); ++ } + } +- else if (hard_LC_COLLATE) +- return xmemcoll (old, oldlen, new, newlen) != 0; + else +- return oldlen != newlen || memcmp (old, new, oldlen); ++ { ++ copy_old = (char *)old; ++ copy_new = (char *)new; ++ } ++ ++ return xmemcoll (copy_old, oldlen, copy_new, newlen); ++} ++ ++#if HAVE_MBRTOWC ++static int ++different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate) ++{ ++ size_t i, j, chars; ++ const char *str[2]; ++ char *copy[2]; ++ size_t len[2]; ++ mbstate_t state[2]; ++ size_t mblength; ++ wchar_t wc, uwc; ++ mbstate_t state_bak; ++ ++ str[0] = old; ++ str[1] = new; ++ len[0] = oldlen; ++ len[1] = newlen; ++ state[0] = oldstate; ++ state[1] = newstate; ++ ++ for (i = 0; i < 2; i++) ++ { ++ copy[i] = alloca (len[i] + 1); ++ ++ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) ++ { ++ state_bak = state[i]; ++ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i])); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: ++ case (size_t)-2: ++ state[i] = state_bak; ++ /* Fall through */ ++ case 0: ++ mblength = 1; ++ break; ++ ++ default: ++ if (ignore_case) ++ { ++ uwc = towupper (wc); ++ ++ if (uwc != wc) ++ { ++ mbstate_t state_wc; ++ ++ memset (&state_wc, '\0', sizeof(mbstate_t)); ++ wcrtomb (copy[i] + j, uwc, &state_wc); ++ } ++ else ++ memcpy (copy[i] + j, str[i] + j, mblength); ++ } ++ else ++ memcpy (copy[i] + j, str[i] + j, mblength); ++ } ++ j += mblength; ++ } ++ copy[i][j] = '\0'; ++ len[i] = j; ++ } ++ ++ return xmemcoll (copy[0], len[0], copy[1], len[1]); + } ++#endif + + /* Output the line in linebuffer LINE to standard output + provided that the switches say it should be output. +@@ -295,15 +478,43 @@ + { + char *prevfield IF_LINT (= NULL); + size_t prevlen IF_LINT (= 0); ++#if HAVE_MBRTOWC ++ mbstate_t prevstate; ++ ++ memset (&prevstate, '\0', sizeof (mbstate_t)); ++#endif + + while (!feof (stdin)) + { + char *thisfield; + size_t thislen; ++#if HAVE_MBRTOWC ++ mbstate_t thisstate; ++#endif ++ + if (readlinebuffer (thisline, stdin) == 0) + break; + thisfield = find_field (thisline); + thislen = thisline->length - 1 - (thisfield - thisline->buffer); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ thisstate = thisline->state; ++ ++ if (prevline->length == 0 || different_multi ++ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate)) ++ { ++ fwrite (thisline->buffer, sizeof (char), ++ thisline->length, stdout); ++ ++ SWAP_LINES (prevline, thisline); ++ prevfield = thisfield; ++ prevlen = thislen; ++ prevstate = thisstate; ++ } ++ } ++ else ++#endif + if (prevline->length == 0 + || different (thisfield, prevfield, thislen, prevlen)) + { +@@ -322,17 +533,26 @@ + size_t prevlen; + uintmax_t match_count = 0; + bool first_delimiter = true; ++#if HAVE_MBRTOWC ++ mbstate_t prevstate; ++#endif + + if (readlinebuffer (prevline, stdin) == 0) + goto closefiles; + prevfield = find_field (prevline); + prevlen = prevline->length - 1 - (prevfield - prevline->buffer); ++#if HAVE_MBRTOWC ++ prevstate = prevline->state; ++#endif + + while (!feof (stdin)) + { + bool match; + char *thisfield; + size_t thislen; ++#if HAVE_MBRTOWC ++ mbstate_t thisstate; ++#endif + if (readlinebuffer (thisline, stdin) == 0) + { + if (ferror (stdin)) +@@ -341,6 +561,15 @@ + } + thisfield = find_field (thisline); + thislen = thisline->length - 1 - (thisfield - thisline->buffer); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ thisstate = thisline->state; ++ match = !different_multi (thisfield, prevfield, ++ thislen, prevlen, thisstate, prevstate); ++ } ++ else ++#endif + match = !different (thisfield, prevfield, thislen, prevlen); + match_count += match; + +@@ -373,6 +602,9 @@ + SWAP_LINES (prevline, thisline); + prevfield = thisfield; + prevlen = thislen; ++#if HAVE_MBRTOWC ++ prevstate = thisstate; ++#endif + if (!match) + match_count = 0; + } +@@ -417,6 +649,19 @@ + + atexit (close_stdout); + ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ find_field = find_field_multi; ++ } ++ else ++#endif ++ { ++ find_field = find_field_uni; ++ } ++ ++ ++ + skip_chars = 0; + skip_fields = 0; + check_chars = SIZE_MAX; +--- coreutils-6.8+/src/fold.c.i18n 2007-02-23 12:01:47.000000000 +0000 ++++ coreutils-6.8+/src/fold.c 2007-03-01 15:08:24.000000000 +0000 +@@ -23,11 +23,33 @@ + #include + #include + ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswprint(), iswblank(), wcwidth(). */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrtol.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# undef MB_LEN_MAX ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + #define TAB_WIDTH 8 + + /* The official name of this program (e.g., no `g' prefix). */ +@@ -35,23 +57,44 @@ + + #define AUTHORS "David MacKenzie" + ++#define FATAL_ERROR(Message) \ ++ do \ ++ { \ ++ error (0, 0, (Message)); \ ++ usage (2); \ ++ } \ ++ while (0) ++ ++enum operating_mode ++{ ++ /* Fold texts by columns that are at the given positions. */ ++ column_mode, ++ ++ /* Fold texts by bytes that are at the given positions. */ ++ byte_mode, ++ ++ /* Fold texts by characters that are at the given positions. */ ++ character_mode, ++}; ++ + /* The name this program was run with. */ + char *program_name; + ++/* The argument shows current mode. (Default: column_mode) */ ++static enum operating_mode operating_mode; ++ + /* If nonzero, try to break on whitespace. */ + static bool break_spaces; + +-/* If nonzero, count bytes, not column positions. */ +-static bool count_bytes; +- + /* If nonzero, at least one of the files we read was standard input. */ + static bool have_read_stdin; + +-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::"; ++static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::"; + + static struct option const longopts[] = + { + {"bytes", no_argument, NULL, 'b'}, ++ {"characters", no_argument, NULL, 'c'}, + {"spaces", no_argument, NULL, 's'}, + {"width", required_argument, NULL, 'w'}, + {GETOPT_HELP_OPTION_DECL}, +@@ -81,6 +124,7 @@ + "), stdout); + fputs (_("\ + -b, --bytes count bytes rather than columns\n\ ++ -c, --characters count characters rather than columns\n\ + -s, --spaces break at spaces\n\ + -w, --width=WIDTH use WIDTH columns instead of 80\n\ + "), stdout); +@@ -98,7 +142,7 @@ + static size_t + adjust_column (size_t column, char c) + { +- if (!count_bytes) ++ if (operating_mode != byte_mode) + { + if (c == '\b') + { +@@ -121,30 +165,14 @@ + to stdout, with maximum line length WIDTH. + Return true if successful. */ + +-static bool +-fold_file (char const *filename, size_t width) ++static void ++fold_text (FILE *istream, size_t width, int *saved_errno) + { +- FILE *istream; + int c; + size_t column = 0; /* Screen column where next char will go. */ + size_t offset_out = 0; /* Index in `line_out' for next char. */ + static char *line_out = NULL; + static size_t allocated_out = 0; +- int saved_errno; +- +- if (STREQ (filename, "-")) +- { +- istream = stdin; +- have_read_stdin = true; +- } +- else +- istream = fopen (filename, "r"); +- +- if (istream == NULL) +- { +- error (0, errno, "%s", filename); +- return false; +- } + + while ((c = getc (istream)) != EOF) + { +@@ -172,6 +200,15 @@ + bool found_blank = false; + size_t logical_end = offset_out; + ++ /* If LINE_OUT has no wide character, ++ put a new wide character in LINE_OUT ++ if column is bigger than width. */ ++ if (offset_out == 0) ++ { ++ line_out[offset_out++] = c; ++ continue; ++ } ++ + /* Look for the last blank. */ + while (logical_end) + { +@@ -218,11 +255,225 @@ + line_out[offset_out++] = c; + } + +- saved_errno = errno; ++ *saved_errno = errno; ++ ++ if (offset_out) ++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); ++ ++ free(line_out); ++} ++ ++#if HAVE_MBRTOWC ++static void ++fold_multibyte_text (FILE *istream, size_t width, int *saved_errno) ++{ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ char *bufpos; /* Next read position of BUF. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state, state_bak; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ char *line_out = NULL; ++ size_t offset_out = 0; /* Index in `line_out' for next char. */ ++ size_t allocated_out = 0; ++ ++ int increment; ++ size_t column = 0; ++ ++ size_t last_blank_pos; ++ size_t last_blank_column; ++ int is_blank_seen; ++ int last_blank_increment; ++ int is_bs_following_last_blank; ++ size_t bs_following_last_blank_num; ++ int is_cr_after_last_blank; ++ ++#define CLEAR_FLAGS \ ++ do \ ++ { \ ++ last_blank_pos = 0; \ ++ last_blank_column = 0; \ ++ is_blank_seen = 0; \ ++ is_bs_following_last_blank = 0; \ ++ bs_following_last_blank_num = 0; \ ++ is_cr_after_last_blank = 0; \ ++ } \ ++ while (0) ++ ++#define START_NEW_LINE \ ++ do \ ++ { \ ++ putchar ('\n'); \ ++ column = 0; \ ++ offset_out = 0; \ ++ CLEAR_FLAGS; \ ++ } \ ++ while (0) ++ ++ CLEAR_FLAGS; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ for (;; bufpos += mblength, buflen -= mblength) ++ { ++ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream); ++ bufpos = buf; ++ } ++ ++ if (buflen < 1) ++ break; ++ ++ /* Get a wide character. */ ++ convfail = 0; ++ state_bak = state; ++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state); ++ ++ switch (mblength) ++ { ++ case (size_t)-1: ++ case (size_t)-2: ++ convfail++; ++ state = state_bak; ++ /* Fall through. */ ++ ++ case 0: ++ mblength = 1; ++ break; ++ } ++ ++rescan: ++ if (operating_mode == byte_mode) /* byte mode */ ++ increment = mblength; ++ else if (operating_mode == character_mode) /* character mode */ ++ increment = 1; ++ else /* column mode */ ++ { ++ if (convfail) ++ increment = 1; ++ else ++ { ++ switch (wc) ++ { ++ case L'\n': ++ fwrite (line_out, sizeof(char), offset_out, stdout); ++ START_NEW_LINE; ++ continue; ++ ++ case L'\b': ++ increment = (column > 0) ? -1 : 0; ++ break; ++ ++ case L'\r': ++ increment = -1 * column; ++ break; ++ ++ case L'\t': ++ increment = 8 - column % 8; ++ break; ++ ++ default: ++ increment = wcwidth (wc); ++ increment = (increment < 0) ? 0 : increment; ++ } ++ } ++ } ++ ++ if (column + increment > width && break_spaces && last_blank_pos) ++ { ++ fwrite (line_out, sizeof(char), last_blank_pos, stdout); ++ putchar ('\n'); ++ ++ offset_out = offset_out - last_blank_pos; ++ column = column - last_blank_column + ((is_cr_after_last_blank) ++ ? last_blank_increment : bs_following_last_blank_num); ++ memmove (line_out, line_out + last_blank_pos, offset_out); ++ CLEAR_FLAGS; ++ goto rescan; ++ } ++ ++ if (column + increment > width && column != 0) ++ { ++ fwrite (line_out, sizeof(char), offset_out, stdout); ++ START_NEW_LINE; ++ goto rescan; ++ } ++ ++ if (allocated_out < offset_out + mblength) ++ { ++ allocated_out += 1024; ++ line_out = xrealloc (line_out, allocated_out); ++ } ++ ++ memcpy (line_out + offset_out, bufpos, mblength); ++ offset_out += mblength; ++ column += increment; ++ ++ if (is_blank_seen && !convfail && wc == L'\r') ++ is_cr_after_last_blank = 1; ++ ++ if (is_bs_following_last_blank && !convfail && wc == L'\b') ++ ++bs_following_last_blank_num; ++ else ++ is_bs_following_last_blank = 0; ++ ++ if (break_spaces && !convfail && iswblank (wc)) ++ { ++ last_blank_pos = offset_out; ++ last_blank_column = column; ++ is_blank_seen = 1; ++ last_blank_increment = increment; ++ is_bs_following_last_blank = 1; ++ bs_following_last_blank_num = 0; ++ is_cr_after_last_blank = 0; ++ } ++ } ++ ++ *saved_errno = errno; + + if (offset_out) + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); + ++ free(line_out); ++} ++#endif ++ ++/* Fold file FILENAME, or standard input if FILENAME is "-", ++ to stdout, with maximum line length WIDTH. ++ Return 0 if successful, 1 if an error occurs. */ ++ ++static bool ++fold_file (char *filename, size_t width) ++{ ++ FILE *istream; ++ int saved_errno; ++ ++ if (STREQ (filename, "-")) ++ { ++ istream = stdin; ++ have_read_stdin = 1; ++ } ++ else ++ istream = fopen (filename, "r"); ++ ++ if (istream == NULL) ++ { ++ error (0, errno, "%s", filename); ++ return 1; ++ } ++ ++ /* Define how ISTREAM is being folded. */ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ fold_multibyte_text (istream, width, &saved_errno); ++ else ++#endif ++ fold_text (istream, width, &saved_errno); ++ + if (ferror (istream)) + { + error (0, saved_errno, "%s", filename); +@@ -255,7 +506,8 @@ + + atexit (close_stdout); + +- break_spaces = count_bytes = have_read_stdin = false; ++ operating_mode = column_mode; ++ break_spaces = have_read_stdin = false; + + while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) + { +@@ -264,7 +516,15 @@ + switch (optc) + { + case 'b': /* Count bytes rather than columns. */ +- count_bytes = true; ++ if (operating_mode != column_mode) ++ FATAL_ERROR (_("only one way of folding may be specified")); ++ operating_mode = byte_mode; ++ break; ++ ++ case 'c': ++ if (operating_mode != column_mode) ++ FATAL_ERROR (_("only one way of folding may be specified")); ++ operating_mode = character_mode; + break; + + case 's': /* Break at word boundaries. */ +--- coreutils-6.8+/src/sort.c.i18n 2007-02-24 11:23:23.000000000 +0000 ++++ coreutils-6.8+/src/sort.c 2007-03-01 15:10:57.000000000 +0000 +@@ -23,10 +23,19 @@ + + #include + ++#include + #include + #include + #include + #include ++#if HAVE_WCHAR_H ++# include ++#endif ++/* Get isw* functions. */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++ + #include "system.h" + #include "argmatch.h" + #include "error.h" +@@ -116,14 +125,38 @@ + /* Thousands separator; if -1, then there isn't one. */ + static int thousands_sep; + ++static int force_general_numcompare = 0; ++ + /* Nonzero if the corresponding locales are hard. */ + static bool hard_LC_COLLATE; +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + static bool hard_LC_TIME; + #endif + + #define NONZERO(x) ((x) != 0) + ++/* get a multibyte character's byte length. */ ++#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t wc; \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ STATE = state_bak; \ ++ /* Fall through. */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ ++ while (0) ++ + /* The kind of blanks for '-b' to skip in various options. */ + enum blanktype { bl_start, bl_end, bl_both }; + +@@ -261,13 +294,11 @@ + they were read if all keys compare equal. */ + static bool stable; + +-/* If TAB has this value, blanks separate fields. */ +-enum { TAB_DEFAULT = CHAR_MAX + 1 }; +- +-/* Tab character separating fields. If TAB_DEFAULT, then fields are ++/* Tab character separating fields. If tab_length is 0, then fields are + separated by the empty string between a non-blank character and a blank + character. */ +-static int tab = TAB_DEFAULT; ++static char tab[MB_LEN_MAX + 1]; ++static size_t tab_length = 0; + + /* Flag to remove consecutive duplicate lines from the output. + Only the last of a sequence of equal lines will be output. */ +@@ -639,6 +670,44 @@ + update_proc (pid); + } + ++/* Function pointers. */ ++static void ++(*inittables) (void); ++static char * ++(*begfield) (const struct line*, const struct keyfield *); ++static char * ++(*limfield) (const struct line*, const struct keyfield *); ++static int ++(*getmonth) (char const *, size_t); ++static int ++(*keycompare) (const struct line *, const struct line *); ++static int ++(*numcompare) (const char *, const char *); ++ ++/* Test for white space multibyte character. ++ Set LENGTH the byte length of investigated multibyte character. */ ++#if HAVE_MBRTOWC ++static int ++ismbblank (const char *str, size_t len, size_t *length) ++{ ++ size_t mblength; ++ wchar_t wc; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ mblength = mbrtowc (&wc, str, len, &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ *length = 1; ++ return 0; ++ } ++ ++ *length = (mblength < 1) ? 1 : mblength; ++ return iswblank (wc); ++} ++#endif ++ + /* Clean up any remaining temporary files. */ + + static void +@@ -978,7 +1047,7 @@ + free (node); + } + +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + + static int + struct_month_cmp (const void *m1, const void *m2) +@@ -993,7 +1062,7 @@ + /* Initialize the character class tables. */ + + static void +-inittables (void) ++inittables_uni (void) + { + size_t i; + +@@ -1005,7 +1074,7 @@ + fold_toupper[i] = toupper (i); + } + +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + /* If we're not in the "C" locale, read different names for months. */ + if (hard_LC_TIME) + { +@@ -1031,6 +1100,64 @@ + #endif + } + ++#if HAVE_MBRTOWC ++static void ++inittables_mb (void) ++{ ++ int i, j, k, l; ++ char *name, *s; ++ size_t s_len, mblength; ++ char mbc[MB_LEN_MAX]; ++ wchar_t wc, pwc; ++ mbstate_t state_mb, state_wc; ++ ++ for (i = 0; i < MONTHS_PER_YEAR; i++) ++ { ++ s = (char *) nl_langinfo (ABMON_1 + i); ++ s_len = strlen (s); ++ monthtab[i].name = name = (char *) xmalloc (s_len + 1); ++ monthtab[i].val = i + 1; ++ ++ memset (&state_mb, '\0', sizeof (mbstate_t)); ++ memset (&state_wc, '\0', sizeof (mbstate_t)); ++ ++ for (j = 0; j < s_len;) ++ { ++ if (!ismbblank (s + j, s_len - j, &mblength)) ++ break; ++ j += mblength; ++ } ++ ++ for (k = 0; j < s_len;) ++ { ++ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb); ++ assert (mblength != (size_t)-1 && mblength != (size_t)-2); ++ if (mblength == 0) ++ break; ++ ++ pwc = towupper (wc); ++ if (pwc == wc) ++ { ++ memcpy (mbc, s + j, mblength); ++ j += mblength; ++ } ++ else ++ { ++ j += mblength; ++ mblength = wcrtomb (mbc, pwc, &state_wc); ++ assert (mblength != (size_t)0 && mblength != (size_t)-1); ++ } ++ ++ for (l = 0; l < mblength; l++) ++ name[k++] = mbc[l]; ++ } ++ name[k] = '\0'; ++ } ++ qsort ((void *) monthtab, MONTHS_PER_YEAR, ++ sizeof (struct month), struct_month_cmp); ++} ++#endif ++ + /* Specify the amount of main memory to use when sorting. */ + static void + specify_sort_size (char const *s) +@@ -1241,7 +1368,7 @@ + by KEY in LINE. */ + + static char * +-begfield (const struct line *line, const struct keyfield *key) ++begfield_uni (const struct line *line, const struct keyfield *key) + { + char *ptr = line->text, *lim = ptr + line->length - 1; + size_t sword = key->sword; +@@ -1251,10 +1378,10 @@ + /* The leading field separator itself is included in a field when -t + is absent. */ + +- if (tab != TAB_DEFAULT) ++ if (tab_length) + while (ptr < lim && sword--) + { +- while (ptr < lim && *ptr != tab) ++ while (ptr < lim && *ptr != tab[0]) + ++ptr; + if (ptr < lim) + ++ptr; +@@ -1282,11 +1409,70 @@ + return ptr; + } + ++#if HAVE_MBRTOWC ++static char * ++begfield_mb (const struct line *line, const struct keyfield *key) ++{ ++ int i; ++ char *ptr = line->text, *lim = ptr + line->length - 1; ++ size_t sword = key->sword; ++ size_t schar = key->schar; ++ size_t mblength; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ if (tab_length) ++ while (ptr < lim && sword--) ++ { ++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ } ++ else ++ while (ptr < lim && sword--) ++ { ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ } ++ ++ if (key->skipsblanks) ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ ++ for (i = 0; i < schar; i++) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ++ if (ptr + mblength > lim) ++ break; ++ else ++ ptr += mblength; ++ } ++ ++ return ptr; ++} ++#endif ++ + /* Return the limit of (a pointer to the first character after) the field + in LINE specified by KEY. */ + + static char * +-limfield (const struct line *line, const struct keyfield *key) ++limfield_uni (const struct line *line, const struct keyfield *key) + { + char *ptr = line->text, *lim = ptr + line->length - 1; + size_t eword = key->eword, echar = key->echar; +@@ -1299,10 +1485,10 @@ + `beginning' is the first character following the delimiting TAB. + Otherwise, leave PTR pointing at the first `blank' character after + the preceding field. */ +- if (tab != TAB_DEFAULT) ++ if (tab_length) + while (ptr < lim && eword--) + { +- while (ptr < lim && *ptr != tab) ++ while (ptr < lim && *ptr != tab[0]) + ++ptr; + if (ptr < lim && (eword | echar)) + ++ptr; +@@ -1348,10 +1534,10 @@ + */ + + /* Make LIM point to the end of (one byte past) the current field. */ +- if (tab != TAB_DEFAULT) ++ if (tab_length) + { + char *newlim; +- newlim = memchr (ptr, tab, lim - ptr); ++ newlim = memchr (ptr, tab[0], lim - ptr); + if (newlim) + lim = newlim; + } +@@ -1384,6 +1570,107 @@ + return ptr; + } + ++#if HAVE_MBRTOWC ++static char * ++limfield_mb (const struct line *line, const struct keyfield *key) ++{ ++ char *ptr = line->text, *lim = ptr + line->length - 1; ++ size_t eword = key->eword, echar = key->echar; ++ int i; ++ size_t mblength; ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ if (tab_length) ++ while (ptr < lim && eword--) ++ { ++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ if (ptr < lim && (eword | echar)) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ } ++ else ++ while (ptr < lim && eword--) ++ { ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ } ++ ++ ++# ifdef POSIX_UNSPECIFIED ++ /* Make LIM point to the end of (one byte past) the current field. */ ++ if (tab_length) ++ { ++ char *newlim, *p; ++ ++ newlim = NULL; ++ for (p = ptr; p < lim;) ++ { ++ if (memcmp (p, tab, tab_length) == 0) ++ { ++ newlim = p; ++ break; ++ } ++ ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ p += mblength; ++ } ++ } ++ else ++ { ++ char *newlim; ++ newlim = ptr; ++ ++ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength)) ++ newlim += mblength; ++ if (ptr < lim) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ptr += mblength; ++ } ++ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength)) ++ newlim += mblength; ++ lim = newlim; ++ } ++# endif ++ ++ /* If we're skipping leading blanks, don't start counting characters ++ * until after skipping past any leading blanks. */ ++ if (key->skipsblanks) ++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) ++ ptr += mblength; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ /* Advance PTR by ECHAR (if possible), but no further than LIM. */ ++ for (i = 0; i < echar; i++) ++ { ++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state); ++ ++ if (ptr + mblength > lim) ++ break; ++ else ++ ptr += mblength; ++ } ++ ++ return ptr; ++} ++#endif ++ + /* Fill BUF reading from FP, moving buf->left bytes from the end + of buf->buf to the beginning first. If EOF is reached and the + file wasn't terminated by a newline, supply one. Set up BUF's line +@@ -1466,8 +1753,24 @@ + else + { + if (key->skipsblanks) +- while (blanks[to_uchar (*line_start)]) +- line_start++; ++ { ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ size_t mblength; ++ mbstate_t state; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ while (line_start < line->keylim && ++ ismbblank (line_start, ++ line->keylim - line_start, ++ &mblength)) ++ line_start += mblength; ++ } ++ else ++#endif ++ while (blanks[to_uchar (*line_start)]) ++ line_start++; ++ } + line->keybeg = line_start; + } + } +@@ -1500,7 +1803,7 @@ + hideously fast. */ + + static int +-numcompare (const char *a, const char *b) ++numcompare_uni (const char *a, const char *b) + { + while (blanks[to_uchar (*a)]) + a++; +@@ -1510,6 +1813,25 @@ + return strnumcmp (a, b, decimal_point, thousands_sep); + } + ++#if HAVE_MBRTOWC ++static int ++numcompare_mb (const char *a, const char *b) ++{ ++ size_t mblength, len; ++ len = strlen (a); /* okay for UTF-8 */ ++ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength)) ++ { ++ a += mblength; ++ len -= mblength; ++ } ++ len = strlen (b); /* okay for UTF-8 */ ++ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength)) ++ b += mblength; ++ ++ return strnumcmp (a, b, decimal_point, thousands_sep); ++} ++#endif /* HAV_EMBRTOWC */ ++ + static int + general_numcompare (const char *sa, const char *sb) + { +@@ -1543,7 +1865,7 @@ + Return 0 if the name in S is not recognized. */ + + static int +-getmonth (char const *month, size_t len) ++getmonth_uni (char const *month, size_t len) + { + size_t lo = 0; + size_t hi = MONTHS_PER_YEAR; +@@ -1698,11 +2020,79 @@ + return diff; + } + ++#if HAVE_MBRTOWC ++static int ++getmonth_mb (const char *s, size_t len) ++{ ++ char *month; ++ register size_t i; ++ register int lo = 0, hi = MONTHS_PER_YEAR, result; ++ char *tmp; ++ size_t wclength, mblength; ++ const char **pp; ++ const wchar_t **wpp; ++ wchar_t *month_wcs; ++ mbstate_t state; ++ ++ while (len > 0 && ismbblank (s, len, &mblength)) ++ { ++ s += mblength; ++ len -= mblength; ++ } ++ ++ if (len == 0) ++ return 0; ++ ++ month = (char *) alloca (len + 1); ++ ++ tmp = (char *) alloca (len + 1); ++ memcpy (tmp, s, len); ++ tmp[len] = '\0'; ++ pp = (const char **)&tmp; ++ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t)); ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state); ++ assert (wclength != (size_t)-1 && *pp == NULL); ++ ++ for (i = 0; i < wclength; i++) ++ { ++ month_wcs[i] = towupper(month_wcs[i]); ++ if (iswblank (month_wcs[i])) ++ { ++ month_wcs[i] = L'\0'; ++ break; ++ } ++ } ++ ++ wpp = (const wchar_t **)&month_wcs; ++ ++ mblength = wcsrtombs (month, wpp, len + 1, &state); ++ assert (mblength != (-1) && *wpp == NULL); ++ ++ do ++ { ++ int ix = (lo + hi) / 2; ++ ++ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0) ++ hi = ix; ++ else ++ lo = ix; ++ } ++ while (hi - lo > 1); ++ ++ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name)) ++ ? monthtab[lo].val : 0); ++ ++ return result; ++} ++#endif ++ + /* Compare two lines A and B trying every key in sequence until there + are no more keys or a difference is found. */ + + static int +-keycompare (const struct line *a, const struct line *b) ++keycompare_uni (const struct line *a, const struct line *b) + { + struct keyfield const *key = keylist; + +@@ -1875,6 +2265,179 @@ + return key->reverse ? -diff : diff; + } + ++#if HAVE_MBRTOWC ++static int ++keycompare_mb (const struct line *a, const struct line *b) ++{ ++ struct keyfield *key = keylist; ++ ++ /* For the first iteration only, the key positions have been ++ precomputed for us. */ ++ char *texta = a->keybeg; ++ char *textb = b->keybeg; ++ char *lima = a->keylim; ++ char *limb = b->keylim; ++ ++ size_t mblength_a, mblength_b; ++ wchar_t wc_a, wc_b; ++ mbstate_t state_a, state_b; ++ ++ int diff; ++ ++ memset (&state_a, '\0', sizeof(mbstate_t)); ++ memset (&state_b, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ unsigned char *translate = (unsigned char *) key->translate; ++ bool const *ignore = key->ignore; ++ ++ /* Find the lengths. */ ++ size_t lena = lima <= texta ? 0 : lima - texta; ++ size_t lenb = limb <= textb ? 0 : limb - textb; ++ ++ /* Actually compare the fields. */ ++ if (key->random) ++ diff = compare_random (texta, lena, textb, lenb); ++ else if (key->numeric | key->general_numeric) ++ { ++ char savea = *lima, saveb = *limb; ++ ++ *lima = *limb = '\0'; ++ if (force_general_numcompare) ++ diff = general_numcompare (texta, textb); ++ else ++ diff = ((key->numeric ? numcompare : general_numcompare) ++ (texta, textb)); ++ *lima = savea, *limb = saveb; ++ } ++ else if (key->month) ++ diff = getmonth (texta, lena) - getmonth (textb, lenb); ++ else ++ { ++ if (ignore || translate) ++ { ++ char *copy_a = (char *) alloca (lena + 1 + lenb + 1); ++ char *copy_b = copy_a + lena + 1; ++ size_t new_len_a, new_len_b; ++ size_t i, j; ++ ++ /* Ignore and/or translate chars before comparing. */ ++# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t uwc; \ ++ char mbc[MB_LEN_MAX]; \ ++ mbstate_t state_wc; \ ++ \ ++ for (NEW_LEN = i = 0; i < LEN;) \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \ ++ \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \ ++ || MBLENGTH == 0) \ ++ { \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ ++ STATE = state_bak; \ ++ if (!ignore) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ continue; \ ++ } \ ++ \ ++ if (ignore) \ ++ { \ ++ if ((ignore == nonprinting && !iswprint (WC)) \ ++ || (ignore == nondictionary \ ++ && !iswalnum (WC) && !iswblank (WC))) \ ++ { \ ++ i += MBLENGTH; \ ++ continue; \ ++ } \ ++ } \ ++ \ ++ if (translate) \ ++ { \ ++ \ ++ uwc = towupper(WC); \ ++ if (WC == uwc) \ ++ { \ ++ memcpy (mbc, TEXT + i, MBLENGTH); \ ++ i += MBLENGTH; \ ++ } \ ++ else \ ++ { \ ++ i += MBLENGTH; \ ++ WC = uwc; \ ++ memset (&state_wc, '\0', sizeof (mbstate_t)); \ ++ \ ++ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \ ++ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \ ++ } \ ++ \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = mbc[j]; \ ++ } \ ++ else \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ } \ ++ COPY[NEW_LEN] = '\0'; \ ++ } \ ++ while (0) ++ IGNORE_CHARS (new_len_a, lena, texta, copy_a, ++ wc_a, mblength_a, state_a); ++ IGNORE_CHARS (new_len_b, lenb, textb, copy_b, ++ wc_b, mblength_b, state_b); ++ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b); ++ } ++ else if (lena == 0) ++ diff = - NONZERO (lenb); ++ else if (lenb == 0) ++ goto greater; ++ else ++ diff = xmemcoll (texta, lena, textb, lenb); ++ } ++ ++ if (diff) ++ goto not_equal; ++ ++ key = key->next; ++ if (! key) ++ break; ++ ++ /* Find the beginning and limit of the next field. */ ++ if (key->eword != -1) ++ lima = limfield (a, key), limb = limfield (b, key); ++ else ++ lima = a->text + a->length - 1, limb = b->text + b->length - 1; ++ ++ if (key->sword != -1) ++ texta = begfield (a, key), textb = begfield (b, key); ++ else ++ { ++ texta = a->text, textb = b->text; ++ if (key->skipsblanks) ++ { ++ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a)) ++ texta += mblength_a; ++ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b)) ++ textb += mblength_b; ++ } ++ } ++ } ++ ++ return 0; ++ ++greater: ++ diff = 1; ++not_equal: ++ return key->reverse ? -diff : diff; ++} ++#endif ++ + /* Compare two lines A and B, returning negative, zero, or positive + depending on whether A compares less than, equal to, or greater than B. */ + +@@ -2744,7 +3305,7 @@ + initialize_exit_failure (SORT_FAILURE); + + hard_LC_COLLATE = hard_locale (LC_COLLATE); +-#if HAVE_NL_LANGINFO ++#if HAVE_LANGINFO_CODESET + hard_LC_TIME = hard_locale (LC_TIME); + #endif + +@@ -2765,6 +3326,27 @@ + thousands_sep = -1; + } + ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ inittables = inittables_mb; ++ begfield = begfield_mb; ++ limfield = limfield_mb; ++ getmonth = getmonth_mb; ++ keycompare = keycompare_mb; ++ numcompare = numcompare_mb; ++ } ++ else ++#endif ++ { ++ inittables = inittables_uni; ++ begfield = begfield_uni; ++ limfield = limfield_uni; ++ getmonth = getmonth_uni; ++ keycompare = keycompare_uni; ++ numcompare = numcompare_uni; ++ } ++ + have_read_stdin = false; + inittables (); + +@@ -3015,13 +3597,35 @@ + + case 't': + { +- char newtab = optarg[0]; +- if (! newtab) ++ char newtab[MB_LEN_MAX + 1]; ++ size_t newtab_length = 1; ++ strncpy (newtab, optarg, MB_LEN_MAX); ++ if (! newtab[0]) + error (SORT_FAILURE, 0, _("empty tab")); +- if (optarg[1]) ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ wchar_t wc; ++ mbstate_t state; ++ size_t i; ++ ++ memset (&state, '\0', sizeof (mbstate_t)); ++ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab, ++ MB_LEN_MAX), ++ &state); ++ switch (newtab_length) ++ { ++ case (size_t) -1: ++ case (size_t) -2: ++ case 0: ++ newtab_length = 1; ++ } ++ } ++#endif ++ if (newtab_length == 1 && optarg[1]) + { + if (STREQ (optarg, "\\0")) +- newtab = '\0'; ++ newtab[0] = '\0'; + else + { + /* Provoke with `sort -txx'. Complain about +@@ -3032,9 +3636,12 @@ + quote (optarg)); + } + } +- if (tab != TAB_DEFAULT && tab != newtab) ++ if (tab_length ++ && (tab_length != newtab_length ++ || memcmp (tab, newtab, tab_length) != 0)) + error (SORT_FAILURE, 0, _("incompatible tabs")); +- tab = newtab; ++ memcpy (tab, newtab, newtab_length); ++ tab_length = newtab_length; + } + break; + +--- coreutils-6.8+/src/unexpand.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/unexpand.c 2007-03-01 15:08:24.000000000 +0000 +@@ -39,11 +39,28 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "unexpand" + +@@ -110,6 +127,208 @@ + {NULL, 0, NULL, 0} + }; + ++static FILE *next_file (FILE *fp); ++ ++#if HAVE_MBRTOWC ++static void ++unexpand_multibyte (void) ++{ ++ FILE *fp; /* Input stream. */ ++ mbstate_t i_state; /* Current shift state of the input stream. */ ++ mbstate_t i_state_bak; /* Back up the I_STATE. */ ++ mbstate_t o_state; /* Current shift state of the output stream. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen = 0; /* The length of the byte sequence in buf. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character ++ which shows as same character as WC. */ ++ ++ /* Index in `tab_list' of next tabstop: */ ++ int tab_index = 0; /* For calculating width of pending tabs. */ ++ int print_tab_index = 0; /* For printing as many tabs as possible. */ ++ unsigned int column = 0; /* Column on screen of next char. */ ++ int next_tab_column; /* Column the next tab stop is on. */ ++ int convert = 1; /* If nonzero, perform translations. */ ++ unsigned int pending = 0; /* Pending columns of blanks. */ ++ ++ fp = next_file ((FILE *) NULL); ++ if (fp == NULL) ++ return; ++ ++ memset (&o_state, '\0', sizeof(mbstate_t)); ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ ++ for (;;) ++ { ++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp)) ++ { ++ memmove (buf, bufpos, buflen); ++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp); ++ bufpos = buf; ++ } ++ ++ /* Get a wide character. */ ++ if (buflen < 1) ++ { ++ mblength = 1; ++ wc = WEOF; ++ } ++ else ++ { ++ i_state_bak = i_state; ++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state); ++ } ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ i_state = i_state_bak; ++ wc = L'\0'; ++ } ++ ++ if (wc == L' ' && convert && column < INT_MAX) ++ { ++ ++pending; ++ ++column; ++ } ++ else if (wc == L'\t' && convert) ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (tab_index < first_free_tab - 1 ++ && column >= tab_list[tab_index]) ++ tab_index++; ++ next_tab_column = tab_list[tab_index]; ++ if (tab_index < first_free_tab - 1) ++ tab_index++; ++ if (column >= next_tab_column) ++ { ++ convert = 0; /* Ran out of tab stops. */ ++ goto flush_pend_mb; ++ } ++ } ++ else ++ { ++ next_tab_column = column + tab_size - column % tab_size; ++ } ++ pending += next_tab_column - column; ++ column = next_tab_column; ++ } ++ else ++ { ++flush_pend_mb: ++ /* Flush pending spaces. Print as many tabs as possible, ++ then print the rest as spaces. */ ++ if (pending == 1) ++ { ++ putchar (' '); ++ pending = 0; ++ } ++ column -= pending; ++ while (pending > 0) ++ { ++ if (tab_size == 0) ++ { ++ /* Do not let print_tab_index == first_free_tab; ++ stop when it is 1 less. */ ++ while (print_tab_index < first_free_tab - 1 ++ && column >= tab_list[print_tab_index]) ++ print_tab_index++; ++ next_tab_column = tab_list[print_tab_index]; ++ if (print_tab_index < first_free_tab - 1) ++ print_tab_index++; ++ } ++ else ++ { ++ next_tab_column = ++ column + tab_size - column % tab_size; ++ } ++ if (next_tab_column - column <= pending) ++ { ++ putchar ('\t'); ++ pending -= next_tab_column - column; ++ column = next_tab_column; ++ } ++ else ++ { ++ --print_tab_index; ++ column += pending; ++ while (pending != 0) ++ { ++ putchar (' '); ++ pending--; ++ } ++ } ++ } ++ ++ if (wc == WEOF) ++ { ++ fp = next_file (fp); ++ if (fp == NULL) ++ break; /* No more files. */ ++ else ++ { ++ memset (&i_state, '\0', sizeof(mbstate_t)); ++ continue; ++ } ++ } ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ if (convert) ++ { ++ ++column; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ mblength = 1; ++ putchar (buf[0]); ++ } ++ else if (mblength == 0) ++ { ++ if (convert && convert_entire_line == 0) ++ convert = 0; ++ mblength = 1; ++ putchar ('\0'); ++ } ++ else ++ { ++ if (convert) ++ { ++ if (wc == L'\b') ++ { ++ if (column > 0) ++ --column; ++ } ++ else ++ { ++ int width; /* The width of WC. */ ++ ++ width = wcwidth (wc); ++ column += (width > 0) ? width : 0; ++ if (convert_entire_line == 0) ++ convert = 0; ++ } ++ } ++ ++ if (wc == L'\n') ++ { ++ tab_index = print_tab_index = 0; ++ column = pending = 0; ++ convert = 1; ++ } ++ fwrite (bufpos, sizeof(char), mblength, stdout); ++ } ++ } ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ ++ + void + usage (int status) + { +@@ -531,7 +750,12 @@ + + file_list = (optind < argc ? &argv[optind] : stdin_argv); + +- unexpand (); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ unexpand_multibyte (); ++ else ++#endif ++ unexpand (); + + if (have_read_stdin && fclose (stdin) != 0) + error (EXIT_FAILURE, errno, "-"); +--- coreutils-6.8+/src/pr.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/pr.c 2007-03-01 15:08:24.000000000 +0000 +@@ -313,6 +313,32 @@ + + #include + #include ++ ++/* Get MB_LEN_MAX. */ ++#include ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX == 1 ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Get MB_CUR_MAX. */ ++#include ++ ++/* Solaris 2.5 has a bug: must be included before . */ ++/* Get mbstate_t, mbrtowc(), wcwidth(). */ ++#if HAVE_WCHAR_H ++# include ++#endif ++ ++/* Get iswprint(). -- for wcwidth(). */ ++#if HAVE_WCTYPE_H ++# include ++#endif ++#if !defined iswprint && !HAVE_ISWPRINT ++# define iswprint(wc) 1 ++#endif ++ + #include "system.h" + #include "error.h" + #include "hard-locale.h" +@@ -324,6 +350,18 @@ + #include "strftime.h" + #include "xstrtol.h" + ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ ++#ifndef HAVE_DECL_WCWIDTH ++"this configure-time declaration test was not run" ++#endif ++#if !HAVE_DECL_WCWIDTH ++extern int wcwidth (); ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "pr" + +@@ -416,7 +454,20 @@ + + #define NULLCOL (COLUMN *)0 + +-static int char_to_clump (char c); ++/* Funtion pointers to switch functions for single byte locale or for ++ multibyte locale. If multibyte functions do not exist in your sysytem, ++ these pointers always point the function for single byte locale. */ ++static void (*print_char) (char c); ++static int (*char_to_clump) (char c); ++ ++/* Functions for single byte locale. */ ++static void print_char_single (char c); ++static int char_to_clump_single (char c); ++ ++/* Functions for multibyte locale. */ ++static void print_char_multi (char c); ++static int char_to_clump_multi (char c); ++ + static bool read_line (COLUMN *p); + static bool print_page (void); + static bool print_stored (COLUMN *p); +@@ -426,6 +477,7 @@ + static void pad_across_to (int position); + static void add_line_number (COLUMN *p); + static void getoptarg (char *arg, char switch_char, char *character, ++ int *character_length, int *character_width, + int *number); + void usage (int status); + static void print_files (int number_of_files, char **av); +@@ -440,7 +492,6 @@ + static void pad_down (int lines); + static void read_rest_of_line (COLUMN *p); + static void skip_read (COLUMN *p, int column_number); +-static void print_char (char c); + static void cleanup (void); + static void print_sep_string (void); + static void separator_string (const char *optarg_S); +@@ -455,7 +506,7 @@ + we store the leftmost columns contiguously in buff. + To print a line from buff, get the index of the first character + from line_vector[i], and print up to line_vector[i + 1]. */ +-static char *buff; ++static unsigned char *buff; + + /* Index of the position in buff where the next character + will be stored. */ +@@ -559,7 +610,7 @@ + static bool untabify_input = false; + + /* (-e) The input tab character. */ +-static char input_tab_char = '\t'; ++static char input_tab_char[MB_LEN_MAX] = "\t"; + + /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... + where the leftmost column is 1. */ +@@ -569,7 +620,10 @@ + static bool tabify_output = false; + + /* (-i) The output tab character. */ +-static char output_tab_char = '\t'; ++static char output_tab_char[MB_LEN_MAX] = "\t"; ++ ++/* (-i) The byte length of output tab character. */ ++static int output_tab_char_length = 1; + + /* (-i) The width of the output tab. */ + static int chars_per_output_tab = 8; +@@ -643,7 +697,13 @@ + static bool numbered_lines = false; + + /* (-n) Character which follows each line number. */ +-static char number_separator = '\t'; ++static char number_separator[MB_LEN_MAX] = "\t"; ++ ++/* (-n) The byte length of the character which follows each line number. */ ++static int number_separator_length = 1; ++ ++/* (-n) The character width of the character which follows each line number. */ ++static int number_separator_width = 0; + + /* (-n) line counting starts with 1st line of input file (not with 1st + line of 1st page printed). */ +@@ -696,6 +756,7 @@ + -a|COLUMN|-m is a `space' and with the -J option a `tab'. */ + static char *col_sep_string = ""; + static int col_sep_length = 0; ++static int col_sep_width = 0; + static char *column_separator = " "; + static char *line_separator = "\t"; + +@@ -852,6 +913,13 @@ + col_sep_length = (int) strlen (optarg_S); + col_sep_string = xmalloc (col_sep_length + 1); + strcpy (col_sep_string, optarg_S); ++ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ col_sep_width = mbswidth (col_sep_string, 0); ++ else ++#endif ++ col_sep_width = col_sep_length; + } + + int +@@ -877,6 +945,21 @@ + + atexit (close_stdout); + ++/* Define which functions are used, the ones for single byte locale or the ones ++ for multibyte locale. */ ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ { ++ print_char = print_char_multi; ++ char_to_clump = char_to_clump_multi; ++ } ++ else ++#endif ++ { ++ print_char = print_char_single; ++ char_to_clump = char_to_clump_single; ++ } ++ + n_files = 0; + file_names = (argc > 1 + ? xmalloc ((argc - 1) * sizeof (char *)) +@@ -949,8 +1032,12 @@ + break; + case 'e': + if (optarg) +- getoptarg (optarg, 'e', &input_tab_char, +- &chars_per_input_tab); ++ { ++ int dummy_length, dummy_width; ++ ++ getoptarg (optarg, 'e', input_tab_char, &dummy_length, ++ &dummy_width, &chars_per_input_tab); ++ } + /* Could check tab width > 0. */ + untabify_input = true; + break; +@@ -963,8 +1050,12 @@ + break; + case 'i': + if (optarg) +- getoptarg (optarg, 'i', &output_tab_char, +- &chars_per_output_tab); ++ { ++ int dummy_width; ++ ++ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length, ++ &dummy_width, &chars_per_output_tab); ++ } + /* Could check tab width > 0. */ + tabify_output = true; + break; +@@ -991,8 +1082,8 @@ + case 'n': + numbered_lines = true; + if (optarg) +- getoptarg (optarg, 'n', &number_separator, +- &chars_per_number); ++ getoptarg (optarg, 'n', number_separator, &number_separator_length, ++ &number_separator_width, &chars_per_number); + break; + case 'N': + skip_count = false; +@@ -1031,7 +1122,7 @@ + old_s = false; + /* Reset an additional input of -s, -S dominates -s */ + col_sep_string = ""; +- col_sep_length = 0; ++ col_sep_length = col_sep_width = 0; + use_col_separator = true; + if (optarg) + separator_string (optarg); +@@ -1188,10 +1279,45 @@ + a number. */ + + static void +-getoptarg (char *arg, char switch_char, char *character, int *number) ++getoptarg (char *arg, char switch_char, char *character, int *character_length, ++ int *character_width, int *number) + { + if (!ISDIGIT (*arg)) +- *character = *arg++; ++ { ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) /* for multibyte locale. */ ++ { ++ wchar_t wc; ++ size_t mblength; ++ int width; ++ mbstate_t state = {'\0'}; ++ ++ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state); ++ ++ if (mblength == (size_t)-1 || mblength == (size_t)-2) ++ { ++ *character_length = 1; ++ *character_width = 1; ++ } ++ else ++ { ++ *character_length = (mblength < 1) ? 1 : mblength; ++ width = wcwidth (wc); ++ *character_width = (width < 0) ? 0 : width; ++ } ++ ++ strncpy (character, arg, *character_length); ++ arg += *character_length; ++ } ++ else /* for single byte locale. */ ++#endif ++ { ++ *character = *arg++; ++ *character_length = 1; ++ *character_width = 1; ++ } ++ } ++ + if (*arg) + { + long int tmp_long; +@@ -1256,7 +1382,7 @@ + else + col_sep_string = column_separator; + +- col_sep_length = 1; ++ col_sep_length = col_sep_width = 1; + use_col_separator = true; + } + /* It's rather pointless to define a TAB separator with column +@@ -1288,11 +1414,11 @@ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */ + + /* Estimate chars_per_text without any margin and keep it constant. */ +- if (number_separator == '\t') ++ if (number_separator[0] == '\t') + number_width = chars_per_number + + TAB_WIDTH (chars_per_default_tab, chars_per_number); + else +- number_width = chars_per_number + 1; ++ number_width = chars_per_number + number_separator_width; + + /* The number is part of the column width unless we are + printing files in parallel. */ +@@ -1307,7 +1433,7 @@ + } + + chars_per_column = (chars_per_line - chars_used_by_number - +- (columns - 1) * col_sep_length) / columns; ++ (columns - 1) * col_sep_width) / columns; + + if (chars_per_column < 1) + error (EXIT_FAILURE, 0, _("page width too narrow")); +@@ -1432,7 +1558,7 @@ + + /* Enlarge p->start_position of first column to use the same form of + padding_not_printed with all columns. */ +- h = h + col_sep_length; ++ h = h + col_sep_width; + + /* This loop takes care of all but the rightmost column. */ + +@@ -1466,7 +1592,7 @@ + } + else + { +- h = h_next + col_sep_length; ++ h = h_next + col_sep_width; + h_next = h + chars_per_column; + } + } +@@ -1756,9 +1882,9 @@ + align_column (COLUMN *p) + { + padding_not_printed = p->start_position; +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2029,13 +2155,13 @@ + /* May be too generous. */ + buff = X2REALLOC (buff, &buff_allocated); + } +- buff[buff_current++] = c; ++ buff[buff_current++] = (unsigned char) c; + } + + static void + add_line_number (COLUMN *p) + { +- int i; ++ int i, j; + char *s; + int left_cut; + +@@ -2058,22 +2184,24 @@ + /* Tabification is assumed for multiple columns, also for n-separators, + but `default n-separator = TAB' hasn't been given priority over + equal column_width also specified by POSIX. */ +- if (number_separator == '\t') ++ if (number_separator[0] == '\t') + { + i = number_width - chars_per_number; + while (i-- > 0) + (p->char_func) (' '); + } + else +- (p->char_func) (number_separator); ++ for (j = 0; j < number_separator_length; j++) ++ (p->char_func) (number_separator[j]); + } + else + /* To comply with POSIX, we avoid any expansion of default TAB + separator with a single column output. No column_width requirement + has to be considered. */ + { +- (p->char_func) (number_separator); +- if (number_separator == '\t') ++ for (j = 0; j < number_separator_length; j++) ++ (p->char_func) (number_separator[j]); ++ if (number_separator[0] == '\t') + output_position = POS_AFTER_TAB (chars_per_output_tab, + output_position); + } +@@ -2234,7 +2362,7 @@ + while (goal - h_old > 1 + && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) + { +- putchar (output_tab_char); ++ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout); + h_old = h_new; + } + while (++h_old <= goal) +@@ -2254,6 +2382,7 @@ + { + char *s; + int l = col_sep_length; ++ int not_space_flag; + + s = col_sep_string; + +@@ -2267,6 +2396,7 @@ + { + for (; separators_not_printed > 0; --separators_not_printed) + { ++ not_space_flag = 0; + while (l-- > 0) + { + /* 3 types of sep_strings: spaces only, spaces and chars, +@@ -2280,12 +2410,15 @@ + } + else + { ++ not_space_flag = 1; + if (spaces_not_printed > 0) + print_white_space (); + putchar (*s++); +- ++output_position; + } + } ++ if (not_space_flag) ++ output_position += col_sep_width; ++ + /* sep_string ends with some spaces */ + if (spaces_not_printed > 0) + print_white_space (); +@@ -2313,7 +2446,7 @@ + required number of tabs and spaces. */ + + static void +-print_char (char c) ++print_char_single (char c) + { + if (tabify_output) + { +@@ -2337,6 +2470,74 @@ + putchar (c); + } + ++#ifdef HAVE_MBRTOWC ++static void ++print_char_multi (char c) ++{ ++ static size_t mbc_pos = 0; ++ static char mbc[MB_LEN_MAX] = {'\0'}; ++ static mbstate_t state = {'\0'}; ++ mbstate_t state_bak; ++ wchar_t wc; ++ size_t mblength; ++ int width; ++ ++ if (tabify_output) ++ { ++ state_bak = state; ++ mbc[mbc_pos++] = c; ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ while (mbc_pos > 0) ++ { ++ switch (mblength) ++ { ++ case (size_t)-2: ++ state = state_bak; ++ return; ++ ++ case (size_t)-1: ++ state = state_bak; ++ ++output_position; ++ putchar (mbc[0]); ++ memmove (mbc, mbc + 1, MB_CUR_MAX - 1); ++ --mbc_pos; ++ break; ++ ++ case 0: ++ mblength = 1; ++ ++ default: ++ if (wc == L' ') ++ { ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ --mbc_pos; ++ ++spaces_not_printed; ++ return; ++ } ++ else if (spaces_not_printed > 0) ++ print_white_space (); ++ ++ /* Nonprintables are assumed to have width 0, except L'\b'. */ ++ if ((width = wcwidth (wc)) < 1) ++ { ++ if (wc == L'\b') ++ --output_position; ++ } ++ else ++ output_position += width; ++ ++ fwrite (mbc, sizeof(char), mblength, stdout); ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ mbc_pos -= mblength; ++ } ++ } ++ return; ++ } ++ putchar (c); ++} ++#endif ++ + /* Skip to page PAGE before printing. + PAGE may be larger than total number of pages. */ + +@@ -2517,9 +2718,9 @@ + align_empty_cols = false; + } + +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2620,9 +2821,9 @@ + } + } + +- if (padding_not_printed - col_sep_length > 0) ++ if (padding_not_printed - col_sep_width > 0) + { +- pad_across_to (padding_not_printed - col_sep_length); ++ pad_across_to (padding_not_printed - col_sep_width); + padding_not_printed = ANYWHERE; + } + +@@ -2635,8 +2836,8 @@ + if (spaces_not_printed == 0) + { + output_position = p->start_position + end_vector[line]; +- if (p->start_position - col_sep_length == chars_per_margin) +- output_position -= col_sep_length; ++ if (p->start_position - col_sep_width == chars_per_margin) ++ output_position -= col_sep_width; + } + + return true; +@@ -2655,7 +2856,7 @@ + number of characters is 1.) */ + + static int +-char_to_clump (char c) ++char_to_clump_single (char c) + { + unsigned char uc = c; + char *s = clump_buff; +@@ -2665,10 +2866,10 @@ + int chars; + int chars_per_c = 8; + +- if (c == input_tab_char) ++ if (c == input_tab_char[0]) + chars_per_c = chars_per_input_tab; + +- if (c == input_tab_char || c == '\t') ++ if (c == input_tab_char[0] || c == '\t') + { + width = TAB_WIDTH (chars_per_c, input_position); + +@@ -2739,6 +2940,154 @@ + return chars; + } + ++#ifdef HAVE_MBRTOWC ++static int ++char_to_clump_multi (char c) ++{ ++ static size_t mbc_pos = 0; ++ static char mbc[MB_LEN_MAX] = {'\0'}; ++ static mbstate_t state = {'\0'}; ++ mbstate_t state_bak; ++ wchar_t wc; ++ size_t mblength; ++ int wc_width; ++ register char *s = clump_buff; ++ register int i, j; ++ char esc_buff[4]; ++ int width; ++ int chars; ++ int chars_per_c = 8; ++ ++ state_bak = state; ++ mbc[mbc_pos++] = c; ++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state); ++ ++ width = 0; ++ chars = 0; ++ while (mbc_pos > 0) ++ { ++ switch (mblength) ++ { ++ case (size_t)-2: ++ state = state_bak; ++ return 0; ++ ++ case (size_t)-1: ++ state = state_bak; ++ mblength = 1; ++ ++ if (use_esc_sequence || use_cntrl_prefix) ++ { ++ width = +4; ++ chars = +4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", mbc[0]); ++ for (i = 0; i <= 2; ++i) ++ *s++ = (int) esc_buff[i]; ++ } ++ else ++ { ++ width += 1; ++ chars += 1; ++ *s++ = mbc[0]; ++ } ++ break; ++ ++ case 0: ++ mblength = 1; ++ /* Fall through */ ++ ++ default: ++ if (memcmp (mbc, input_tab_char, mblength) == 0) ++ chars_per_c = chars_per_input_tab; ++ ++ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t') ++ { ++ int width_inc; ++ ++ width_inc = TAB_WIDTH (chars_per_c, input_position); ++ width += width_inc; ++ ++ if (untabify_input) ++ { ++ for (i = width_inc; i; --i) ++ *s++ = ' '; ++ chars += width_inc; ++ } ++ else ++ { ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ chars += mblength; ++ } ++ } ++ else if ((wc_width = wcwidth (wc)) < 1) ++ { ++ if (use_esc_sequence) ++ { ++ for (i = 0; i < mblength; i++) ++ { ++ width += 4; ++ chars += 4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", c); ++ for (j = 0; j <= 2; ++j) ++ *s++ = (int) esc_buff[j]; ++ } ++ } ++ else if (use_cntrl_prefix) ++ { ++ if (wc < 0200) ++ { ++ width += 2; ++ chars += 2; ++ *s++ = '^'; ++ *s++ = wc ^ 0100; ++ } ++ else ++ { ++ for (i = 0; i < mblength; i++) ++ { ++ width += 4; ++ chars += 4; ++ *s++ = '\\'; ++ sprintf (esc_buff, "%03o", c); ++ for (j = 0; j <= 2; ++j) ++ *s++ = (int) esc_buff[j]; ++ } ++ } ++ } ++ else if (wc == L'\b') ++ { ++ width += -1; ++ chars += 1; ++ *s++ = c; ++ } ++ else ++ { ++ width += 0; ++ chars += mblength; ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ } ++ } ++ else ++ { ++ width += wc_width; ++ chars += mblength; ++ for (i = 0; i < mblength; i++) ++ *s++ = mbc[i]; ++ } ++ } ++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength); ++ mbc_pos -= mblength; ++ } ++ ++ input_position += width; ++ return chars; ++} ++#endif ++ + /* We've just printed some files and need to clean up things before + looking for more options and printing the next batch of files. + +--- coreutils-6.8+/src/cut.c.i18n 2007-01-14 15:41:28.000000000 +0000 ++++ coreutils-6.8+/src/cut.c 2007-03-01 15:08:24.000000000 +0000 +@@ -29,6 +29,11 @@ + #include + #include + #include ++ ++/* Get mbstate_t, mbrtowc(). */ ++#if HAVE_WCHAR_H ++# include ++#endif + #include "system.h" + + #include "error.h" +@@ -37,6 +42,18 @@ + #include "quote.h" + #include "xstrndup.h" + ++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC ++ installation; work around this configuration error. */ ++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 ++# undef MB_LEN_MAX ++# define MB_LEN_MAX 16 ++#endif ++ ++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ ++#if HAVE_MBRTOWC && defined mbstate_t ++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "cut" + +@@ -67,6 +84,52 @@ + } \ + while (0) + ++/* Refill the buffer BUF to get a multibyte character. */ ++#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \ ++ do \ ++ { \ ++ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \ ++ { \ ++ memmove (BUF, BUFPOS, BUFLEN); \ ++ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \ ++ BUFPOS = BUF; \ ++ } \ ++ } \ ++ while (0) ++ ++/* Get wide character on BUFPOS. BUFPOS is not included after that. ++ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ ++#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ if (BUFLEN < 1) \ ++ { \ ++ WC = WEOF; \ ++ break; \ ++ } \ ++ \ ++ /* Get a wide character. */ \ ++ CONVFAIL = 0; \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ CONVFAIL++; \ ++ STATE = state_bak; \ ++ /* Fall througn. */ \ ++ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ break; \ ++ } \ ++ } \ ++ while (0) ++ + struct range_pair + { + size_t lo; +@@ -85,7 +148,7 @@ + /* The number of bytes allocated for FIELD_1_BUFFER. */ + static size_t field_1_bufsize; + +-/* The largest field or byte index used as an endpoint of a closed ++/* The largest byte, character or field index used as an endpoint of a closed + or degenerate range specification; this doesn't include the starting + index of right-open-ended ranges. For example, with either range spec + `2-5,9-', `2-3,5,9-' this variable would be set to 5. */ +@@ -97,10 +160,11 @@ + + /* This is a bit vector. + In byte mode, which bytes to output. ++ In character mode, which characters to output. + In field mode, which DELIM-separated fields to output. +- Both bytes and fields are numbered starting with 1, ++ Bytes, characters and fields are numbered starting with 1, + so the zeroth bit of this array is unused. +- A field or byte K has been selected if ++ A byte, character or field K has been selected if + (K <= MAX_RANGE_ENDPOINT and is_printable_field(K)) + || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */ + static unsigned char *printable_field; +@@ -109,9 +173,12 @@ + { + undefined_mode, + +- /* Output characters that are in the given bytes. */ ++ /* Output bytes that are at the given positions. */ + byte_mode, + ++ /* Output characters that are at the given positions. */ ++ character_mode, ++ + /* Output the given delimeter-separated fields. */ + field_mode + }; +@@ -121,6 +188,13 @@ + + static enum operating_mode operating_mode; + ++/* If nonzero, when in byte mode, don't split multibyte characters. */ ++static int byte_mode_character_aware; ++ ++/* If nonzero, the function for single byte locale is work ++ if this program runs on multibyte locale. */ ++static int force_singlebyte_mode; ++ + /* If true do not output lines containing no delimeter characters. + Otherwise, all such lines are printed. This option is valid only + with field mode. */ +@@ -132,6 +206,9 @@ + + /* The delimeter character for field mode. */ + static unsigned char delim; ++#if HAVE_WCHAR_H ++static wchar_t wcdelim; ++#endif + + /* True if the --output-delimiter=STRING option was specified. */ + static bool output_delimiter_specified; +@@ -205,7 +282,7 @@ + -f, --fields=LIST select only these fields; also print any line\n\ + that contains no delimiter character, unless\n\ + the -s option is specified\n\ +- -n (ignored)\n\ ++ -n with -b: don't split multibyte characters\n\ + "), stdout); + fputs (_("\ + --complement complement the set of selected bytes, characters\n\ +@@ -362,7 +439,7 @@ + in_digits = false; + /* Starting a range. */ + if (dash_found) +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + dash_found = true; + fieldstr++; + +@@ -387,14 +464,16 @@ + if (value == 0) + { + /* `n-'. From `initial' to end of line. */ +- eol_range_start = initial; ++ if (eol_range_start == 0 || ++ (eol_range_start != 0 && eol_range_start > initial)) ++ eol_range_start = initial; + field_found = true; + } + else + { + /* `m-n' or `-n' (1-n). */ + if (value < initial) +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + + /* Is there already a range going to end of line? */ + if (eol_range_start != 0) +@@ -467,6 +546,9 @@ + if (operating_mode == byte_mode) + error (0, 0, + _("byte offset %s is too large"), quote (bad_num)); ++ else if (operating_mode == character_mode) ++ error (0, 0, ++ _("character offset %s is too large"), quote (bad_num)); + else + error (0, 0, + _("field number %s is too large"), quote (bad_num)); +@@ -477,7 +559,7 @@ + fieldstr++; + } + else +- FATAL_ERROR (_("invalid byte or field list")); ++ FATAL_ERROR (_("invalid byte, character or field list")); + } + + max_range_endpoint = 0; +@@ -570,6 +652,63 @@ + } + } + ++#if HAVE_MBRTOWC ++/* This function is in use for the following case. ++ ++ 1. Read from the stream STREAM, printing to standard output any selected ++ characters. ++ ++ 2. Read from stream STREAM, printing to standard output any selected bytes, ++ without splitting multibyte characters. */ ++ ++static void ++cut_characters_or_cut_bytes_no_split (FILE *stream) ++{ ++ int idx; /* number of bytes or characters in the line so far. */ ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen; /* The length of the byte sequence in buf. */ ++ wint_t wc; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ idx = 0; ++ buflen = 0; ++ bufpos = buf; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ { ++ if (idx > 0) ++ putchar ('\n'); ++ break; ++ } ++ else if (wc == L'\n') ++ { ++ putchar ('\n'); ++ idx = 0; ++ } ++ else ++ { ++ idx += (operating_mode == byte_mode) ? mblength : 1; ++ if (print_kth (idx, NULL)) ++ fwrite (bufpos, mblength, sizeof(char), stdout); ++ } ++ ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++} ++#endif ++ + /* Read from stream STREAM, printing to standard output any selected fields. */ + + static void +@@ -692,13 +831,192 @@ + } + } + ++#if HAVE_MBRTOWC ++static void ++cut_fields_mb (FILE *stream) ++{ ++ int c; ++ unsigned int field_idx; ++ int found_any_selected_field; ++ int buffer_first_field; ++ int empty_input; ++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ ++ char *bufpos; /* Next read position of BUF. */ ++ size_t buflen; /* The length of the byte sequence in buf. */ ++ wint_t wc = 0; /* A gotten wide character. */ ++ size_t mblength; /* The byte size of a multibyte character which shows ++ as same character as WC. */ ++ mbstate_t state; /* State of the stream. */ ++ int convfail; /* 1, when conversion is failed. Otherwise 0. */ ++ ++ found_any_selected_field = 0; ++ field_idx = 1; ++ bufpos = buf; ++ buflen = 0; ++ memset (&state, '\0', sizeof(mbstate_t)); ++ ++ c = getc (stream); ++ empty_input = (c == EOF); ++ if (c != EOF) ++ ungetc (c, stream); ++ else ++ wc = WEOF; ++ ++ /* To support the semantics of the -s flag, we may have to buffer ++ all of the first field to determine whether it is `delimited.' ++ But that is unnecessary if all non-delimited lines must be printed ++ and the first field has been selected, or if non-delimited lines ++ must be suppressed and the first field has *not* been selected. ++ That is because a non-delimited line has exactly one field. */ ++ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL)); ++ ++ while (1) ++ { ++ if (field_idx == 1 && buffer_first_field) ++ { ++ int len = 0; ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER ++ (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ break; ++ ++ field_1_buffer = xrealloc (field_1_buffer, len + mblength); ++ memcpy (field_1_buffer + len, bufpos, mblength); ++ len += mblength; ++ buflen -= mblength; ++ bufpos += mblength; ++ ++ if (!convfail && (wc == L'\n' || wc == wcdelim)) ++ break; ++ } ++ ++ if (wc == WEOF) ++ break; ++ ++ /* If the first field extends to the end of line (it is not ++ delimited) and we are printing all non-delimited lines, ++ print this one. */ ++ if (convfail || (!convfail && wc != wcdelim)) ++ { ++ if (suppress_non_delimited) ++ { ++ /* Empty. */ ++ } ++ else ++ { ++ fwrite (field_1_buffer, sizeof (char), len, stdout); ++ /* Make sure the output line is newline terminated. */ ++ if (convfail || (!convfail && wc != L'\n')) ++ putchar ('\n'); ++ } ++ continue; ++ } ++ ++ if (print_kth (1, NULL)) ++ { ++ /* Print the field, but not the trailing delimiter. */ ++ fwrite (field_1_buffer, sizeof (char), len - 1, stdout); ++ found_any_selected_field = 1; ++ } ++ ++field_idx; ++ } ++ ++ if (wc != WEOF) ++ { ++ if (print_kth (field_idx, NULL)) ++ { ++ if (found_any_selected_field) ++ { ++ fwrite (output_delimiter_string, sizeof (char), ++ output_delimiter_length, stdout); ++ } ++ found_any_selected_field = 1; ++ } ++ ++ while (1) ++ { ++ REFILL_BUFFER (buf, bufpos, buflen, stream); ++ ++ GET_NEXT_WC_FROM_BUFFER ++ (wc, bufpos, buflen, mblength, state, convfail); ++ ++ if (wc == WEOF) ++ break; ++ else if (!convfail && (wc == wcdelim || wc == L'\n')) ++ { ++ buflen -= mblength; ++ bufpos += mblength; ++ break; ++ } ++ ++ if (print_kth (field_idx, NULL)) ++ fwrite (bufpos, mblength, sizeof(char), stdout); ++ ++ buflen -= mblength; ++ bufpos += mblength; ++ } ++ } ++ ++ if ((!convfail || wc == L'\n') && buflen < 1) ++ wc = WEOF; ++ ++ if (!convfail && wc == wcdelim) ++ ++field_idx; ++ else if (wc == WEOF || (!convfail && wc == L'\n')) ++ { ++ if (found_any_selected_field ++ || (!empty_input && !(suppress_non_delimited && field_idx == 1))) ++ putchar ('\n'); ++ if (wc == WEOF) ++ break; ++ field_idx = 1; ++ found_any_selected_field = 0; ++ } ++ } ++} ++#endif ++ + static void + cut_stream (FILE *stream) + { +- if (operating_mode == byte_mode) +- cut_bytes (stream); ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode) ++ { ++ switch (operating_mode) ++ { ++ case byte_mode: ++ if (byte_mode_character_aware) ++ cut_characters_or_cut_bytes_no_split (stream); ++ else ++ cut_bytes (stream); ++ break; ++ ++ case character_mode: ++ cut_characters_or_cut_bytes_no_split (stream); ++ break; ++ ++ case field_mode: ++ cut_fields_mb (stream); ++ break; ++ ++ default: ++ abort (); ++ } ++ } + else +- cut_fields (stream); ++#endif ++ { ++ if (operating_mode == field_mode) ++ cut_fields (stream); ++ else ++ cut_bytes (stream); ++ } + } + + /* Process file FILE to standard output. +@@ -748,6 +1066,8 @@ + bool ok; + bool delim_specified = false; + char *spec_list_string IF_LINT(= NULL); ++ char mbdelim[MB_LEN_MAX + 1]; ++ size_t delimlen = 0; + + initialize_main (&argc, &argv); + program_name = argv[0]; +@@ -770,7 +1090,6 @@ + switch (optc) + { + case 'b': +- case 'c': + /* Build the byte list. */ + if (operating_mode != undefined_mode) + FATAL_ERROR (_("only one type of list may be specified")); +@@ -778,6 +1097,14 @@ + spec_list_string = optarg; + break; + ++ case 'c': ++ /* Build the character list. */ ++ if (operating_mode != undefined_mode) ++ FATAL_ERROR (_("only one type of list may be specified")); ++ operating_mode = character_mode; ++ spec_list_string = optarg; ++ break; ++ + case 'f': + /* Build the field list. */ + if (operating_mode != undefined_mode) +@@ -789,10 +1116,35 @@ + case 'd': + /* New delimiter. */ + /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */ +- if (optarg[0] != '\0' && optarg[1] != '\0') +- FATAL_ERROR (_("the delimiter must be a single character")); +- delim = optarg[0]; +- delim_specified = true; ++#if HAVE_MBRTOWC ++ { ++ if(MB_CUR_MAX > 1) ++ { ++ mbstate_t state; ++ ++ memset (&state, '\0', sizeof(mbstate_t)); ++ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state); ++ ++ if (delimlen == (size_t)-1 || delimlen == (size_t)-2) ++ ++force_singlebyte_mode; ++ else ++ { ++ delimlen = (delimlen < 1) ? 1 : delimlen; ++ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0') ++ FATAL_ERROR (_("the delimiter must be a single character")); ++ memcpy (mbdelim, optarg, delimlen); ++ } ++ } ++ ++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode) ++#endif ++ { ++ if (optarg[0] != '\0' && optarg[1] != '\0') ++ FATAL_ERROR (_("the delimiter must be a single character")); ++ delim = (unsigned char) optarg[0]; ++ } ++ delim_specified = true; ++ } + break; + + case OUTPUT_DELIMITER_OPTION: +@@ -805,6 +1157,7 @@ + break; + + case 'n': ++ byte_mode_character_aware = 1; + break; + + case 's': +@@ -827,7 +1180,7 @@ + if (operating_mode == undefined_mode) + FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); + +- if (delim != '\0' && operating_mode != field_mode) ++ if (delim_specified && operating_mode != field_mode) + FATAL_ERROR (_("an input delimiter may be specified only\ + when operating on fields")); + +@@ -854,15 +1207,34 @@ + } + + if (!delim_specified) +- delim = '\t'; ++ { ++ delim = '\t'; ++#ifdef HAVE_MBRTOWC ++ wcdelim = L'\t'; ++ mbdelim[0] = '\t'; ++ mbdelim[1] = '\0'; ++ delimlen = 1; ++#endif ++ } + + if (output_delimiter_string == NULL) + { +- static char dummy[2]; +- dummy[0] = delim; +- dummy[1] = '\0'; +- output_delimiter_string = dummy; +- output_delimiter_length = 1; ++#ifdef HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode) ++ { ++ output_delimiter_string = xstrdup(mbdelim); ++ output_delimiter_length = delimlen; ++ } ++ ++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode) ++#endif ++ { ++ static char dummy[2]; ++ dummy[0] = delim; ++ dummy[1] = '\0'; ++ output_delimiter_string = dummy; ++ output_delimiter_length = 1; ++ } + } + + if (optind == argc) diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch new file mode 100644 index 0000000000..aba8742f6a --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch @@ -0,0 +1,117 @@ +Upstream-Status: Inappropriate [legacy version] + +This patch was imported from the Fedora Core 8 coreutils-6.9-9 package. + +The package is stated as being Licensed as GPLv2+. + +Signed-off-by: Mark Hatle + +--- coreutils-6.9/src/ls.c.ls-x 2007-06-13 14:27:36.000000000 +0100 ++++ coreutils-6.9/src/ls.c 2007-06-13 14:28:42.000000000 +0100 +@@ -4151,16 +4151,16 @@ + size_t pos = 0; + size_t cols = calculate_columns (false); + struct column_info const *line_fmt = &column_info[cols - 1]; +- size_t name_length = length_of_file_name_and_frills (cwd_file); ++ struct fileinfo const *f = sorted_file[0]; ++ size_t name_length = length_of_file_name_and_frills (f); + size_t max_name_length = line_fmt->col_arr[0]; + + /* Print first entry. */ +- print_file_name_and_frills (cwd_file); ++ print_file_name_and_frills (f); + + /* Now the rest. */ + for (filesno = 1; filesno < cwd_n_used; ++filesno) + { +- struct fileinfo const *f; + size_t col = filesno % cols; + + if (col == 0) +--- coreutils-6.9/tests/ls/Makefile.am.ls-x 2007-03-18 21:36:43.000000000 +0000 ++++ coreutils-6.9/tests/ls/Makefile.am 2007-06-13 14:28:42.000000000 +0100 +@@ -24,7 +24,7 @@ + stat-dtype \ + inode dangle file-type recursive dired infloop \ + rt-1 time-1 symlink-slash follow-slink no-arg m-option \ +- stat-vs-dirent ++ stat-vs-dirent x-option + + EXTRA_DIST = $(TESTS) + TESTS_ENVIRONMENT = \ +--- /dev/null 2007-06-13 08:43:51.993263382 +0100 ++++ coreutils-6.9/tests/ls/x-option 2007-06-13 14:28:42.000000000 +0100 +@@ -0,0 +1,59 @@ ++#!/bin/sh ++# Exercise the -x option. ++ ++# Copyright (C) 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301, USA. ++ ++if test "$VERBOSE" = yes; then ++ set -x ++ ls --version ++fi ++ ++. $srcdir/../envvar-check ++. $srcdir/../lang-default ++ ++pwd=`pwd` ++t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ ++trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 ++trap '(exit $?); exit $?' 1 2 13 15 ++ ++framework_failure=0 ++mkdir -p $tmp || framework_failure=1 ++cd $tmp || framework_failure=1 ++mkdir subdir || framework_failure=1 ++touch subdir/b || framework_failure=1 ++touch subdir/a || framework_failure=1 ++ ++if test $framework_failure = 1; then ++ echo "$0: failure in testing framework" 1>&2 ++ (exit 1); exit 1 ++fi ++ ++fail=0 ++ ++# Coreutils 6.8 and 6.9 would output this in the wrong order. ++ls -x subdir > out || fail=1 ++ls -rx subdir >> out || fail=1 ++cat <<\EOF > exp || fail=1 ++a b ++b a ++EOF ++ ++cmp out exp || fail=1 ++test $fail = 1 && diff out exp 2> /dev/null ++ ++(exit $fail); exit $fail +--- coreutils-6.9/NEWS.ls-x 2007-03-22 21:19:45.000000000 +0000 ++++ coreutils-6.9/NEWS 2007-06-13 14:28:42.000000000 +0100 +@@ -13,6 +13,11 @@ + Using pr -m -s (i.e. merging files, with TAB as the output separator) + no longer inserts extraneous spaces between output columns. + ++** Bug fixes ++ ++ ls -x DIR would sometimes output the wrong string in place of the ++ first entry. [introduced in coreutils-6.8] ++ + + * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable] + diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch new file mode 100644 index 0000000000..58074c09a5 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate [legacy version] + +This patch was imported from the Fedora Core 8 coreutils-6.9-9 package. + +The package is stated as being Licensed as GPLv2+. + +Signed-off-by: Mark Hatle + +--- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100 ++++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100 +@@ -75,7 +75,7 @@ + # define NEW_TIME 0 + #endif + +-#define IDLESTR_LEN 6 ++#define IDLESTR_LEN 10 + + #if HAVE_STRUCT_XTMP_UT_PID + # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \ diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch new file mode 100644 index 0000000000..02730dbbb4 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch @@ -0,0 +1,32 @@ +Upstream-Status: Pending + +automake 1.12 has depricated automatic de-ANSI-fication support + +this patch avoids these kinds of errors: + +| configure.ac:40: error: automatic de-ANSI-fication support has been removed +| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from... +| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from... +| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from... +| configure.ac:40: the top level +| autom4te: m4 failed with exit status: 1 + +Signed-Off-By: Nitin A Kamble +2012/05/04 + +Index: coreutils-6.9/m4/jm-macros.m4 +=================================================================== +--- coreutils-6.9.orig/m4/jm-macros.m4 ++++ coreutils-6.9/m4/jm-macros.m4 +@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES], + dnl whether functions and headers are available, whether they work, etc. + AC_REQUIRE([AC_SYS_LARGEFILE]) + +- dnl This test must precede tests of compiler characteristics like +- dnl that for the inline keyword, since it may change the degree to +- dnl which the compiler supports such features. +- AC_REQUIRE([AM_C_PROTOTYPES]) +- + dnl Checks for typedefs, structures, and compiler characteristics. + AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([AC_C_VOLATILE]) diff --git a/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch new file mode 100644 index 0000000000..e0d600a390 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch @@ -0,0 +1,85 @@ +Upstream-Status: Inappropriate [legacy version] + +Use native coreutils binaries to build manpages in cross environment. +This avoids man page build issues like this: + +| Making all in man +| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man' +| Updating man page cut.1 +| Updating man page dir.1 +| Updating man page expand.1 +| Updating man page fold.1 +| Updating man page install.1 +| Updating man page join.1 +| Updating man page pr.1 +| Updating man page ls.1 +| Updating man page sort.1 +| Updating man page unexpand.1 +| Updating man page uniq.1 +| Updating man page who.1 +| Updating man page vdir.1 +| help2man: can't get `--help' info from dir.td/dir +| help2man: can't get `--help' info from cut.td/cut +| make[1]: *** [dir.1] Error 126 +| make[1]: *** Waiting for unfinished jobs.... +| help2man: can't get `--help' info from fold.td/fold +| help2man: can't get `--help' info from install.td/install +| help2man: can't get `--help' info from expand.td/expand +| help2man: can't get `--help' info from join.td/join +| make[1]: *** [cut.1] Error 126 +| make[1]: *** [fold.1] Error 126 +| make[1]: *** [install.1] Error 126 +| help2man: can't get `--help' info from sort.td/sort +| make[1]: *** [expand.1] Error 126 +| help2man: can't get `--help' info from pr.td/pr +| make[1]: *** [join.1] Error 126 +| help2man: can't get `--help' info from ls.td/ls +| help2man: can't get `--help' info from unexpand.td/unexpand +| help2man: can't get `--help' info from uniq.td/uniq +| help2man: can't get `--help' info from who.td/who +| make[1]: *** [sort.1] Error 126 +| make[1]: *** [pr.1] Error 126 +| help2man: can't get `--help' info from vdir.td/vdir +| make[1]: *** [ls.1] Error 126 +| make[1]: *** [uniq.1] Error 126 +| make[1]: *** [unexpand.1] Error 126 +| make[1]: *** [who.1] Error 126 +| make[1]: *** [vdir.1] Error 126 +| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man' +| make: *** [all-recursive] Error 1 +| FATAL: oe_runmake failed +| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information) +NOTE: package coreutils-6.9-r0: task do_compile: Failed +ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1' + + +This patch is made for gplv2 coreutils the recipe +Nitin A Kamble +2011/03/17 + +Index: man/Makefile.am +=================================================================== +--- a/man.orig/Makefile.am ++++ b/man/Makefile.am +@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi + $(PERL) -- $(srcdir)/help2man \ + --source='$(PACKAGE_STRING)' \ + --include=$(srcdir)/$*.x \ +- --output=$t/$@ $t/$*; \ ++ --output=$t/$@ $*; \ + } \ + && sed 's|$*\.td/||g' $t/$@ > $@ \ + && chmod a-w $@ \ +Index: man/Makefile.in +=================================================================== +--- a/man.orig/Makefile.in ++++ b/man/Makefile.in +@@ -865,7 +865,7 @@ yes.1: $(common_dep) $(srcdir)/yes.x . + $(PERL) -- $(srcdir)/help2man \ + --source='$(PACKAGE_STRING)' \ + --include=$(srcdir)/$*.x \ +- --output=$t/$@ $t/$*; \ ++ --output=$t/$@ $*; \ + } \ + && sed 's|$*\.td/||g' $t/$@ > $@ \ + && chmod a-w $@ \ diff --git a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch new file mode 100644 index 0000000000..5ca590bcc6 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch @@ -0,0 +1,63 @@ +Upstream-Status: Inappropriate [legacy version] + +# coreutils uses gnulib which conflicts with newer libc header on futimens +# this patch simply renames coreutils futimes to avoid confliction +# +# Signed-off-by Kevin Tian , 2010-08-18 +# (this patch is licensed under GPLv2) + +diff --git a/lib/utimens.c b/lib/utimens.c +index 71bc510..ae870b8 100644 +--- a/lib/utimens.c ++++ b/lib/utimens.c +@@ -75,7 +75,7 @@ struct utimbuf + Return 0 on success, -1 (setting errno) on failure. */ + + int +-futimens (int fd ATTRIBUTE_UNUSED, ++futimens_coreutils (int fd ATTRIBUTE_UNUSED, + char const *file, struct timespec const timespec[2]) + { + /* Some Linux-based NFS clients are buggy, and mishandle time stamps +@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED, + int + utimens (char const *file, struct timespec const timespec[2]) + { +- return futimens (-1, file, timespec); ++ return futimens_coreutils (-1, file, timespec); + } +diff --git a/lib/utimens.h b/lib/utimens.h +index 0097aaa..13fc45a 100644 +--- a/lib/utimens.h ++++ b/lib/utimens.h +@@ -1,3 +1,3 @@ + #include +-int futimens (int, char const *, struct timespec const [2]); ++int futimens_coreutils (int, char const *, struct timespec const [2]); + int utimens (char const *, struct timespec const [2]); +diff --git a/src/copy.c b/src/copy.c +index 4bdb75c..04634f1 100644 +--- a/src/copy.c ++++ b/src/copy.c +@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name, + timespec[0] = get_stat_atime (src_sb); + timespec[1] = get_stat_mtime (src_sb); + +- if (futimens (dest_desc, dst_name, timespec) != 0) ++ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0) + { + error (0, errno, _("preserving times for %s"), quote (dst_name)); + if (x->require_preserve) +diff --git a/src/touch.c b/src/touch.c +index a79c26d..6ef317d 100644 +--- a/src/touch.c ++++ b/src/touch.c +@@ -182,7 +182,7 @@ touch (const char *file) + t = timespec; + } + +- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); ++ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); + + if (fd == STDIN_FILENO) + { diff --git a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch new file mode 100644 index 0000000000..8f355520bd --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch @@ -0,0 +1,21 @@ +Upstream-Status: Inappropriate [legacy version] + +# remove the line to cause recursive inclusion error from autoreconf, sicne +# newer autoconf has included this definition. Simply rename it here. +# +# Signed-off-by Kevin Tian , 2010-08-18 +# (this patch is licensed under GPLv2) + +diff --git a/extensions.m4 b/extensions.m4 +index 143a9e5..f6558f1 100644 +--- a/m4/extensions.m4 ++++ b/m4/extensions.m4 +@@ -16,7 +16,7 @@ + # ------------------------ + # Enable extensions on systems that normally disable them, + # typically due to standards-conformance issues. +-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], ++AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY], + [ + AC_BEFORE([$0], [AC_COMPILE_IFELSE]) + AC_BEFORE([$0], [AC_RUN_IFELSE]) diff --git a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch new file mode 100644 index 0000000000..c42cb9c059 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch @@ -0,0 +1,24 @@ +Upstream-Status: Inappropriate [legacy version] + +# man page for 'touch' is generated differently from others. All other utilities +# are provided static man source files, while for 'touch' it requires help2man +# to invoke "touch --help" and then convert the output into the manual. Since touch +# is with target format which can't be invoked on build system, disable building +# 'touch' man page here. +# +# Signed-off-by Kevin Tian , 2010-08-18 +# (this patch is licensed under GPLv2) + +diff --git a/man/Makefile.am b/man/Makefile.am +index 32df9d1..37b09e3 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -27,7 +27,7 @@ dist_man_MANS = \ + paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ + rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \ + shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \ +- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ ++ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \ + tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \ + whoami.1 yes.1 $(MAN) + optional_mans = \ diff --git a/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch b/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch new file mode 100644 index 0000000000..4757f52aa0 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch @@ -0,0 +1,22 @@ +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Marko Lindqvist +diff -Nurd coreutils-8.21/man/local.mk coreutils-8.21/man/local.mk +--- coreutils-8.21/man/local.mk 2013-02-05 16:01:21.000000000 +0200 ++++ coreutils-8.21/man/local.mk 2013-03-23 09:12:53.360470192 +0200 +@@ -19,11 +19,11 @@ + EXTRA_DIST += man/help2man man/dummy-man + + ## Graceful degradation for systems lacking perl. +-if HAVE_PERL +-run_help2man = $(PERL) -- $(srcdir)/man/help2man +-else ++#if HAVE_PERL ++#run_help2man = $(PERL) -- $(srcdir)/man/help2man ++#else + run_help2man = $(SHELL) $(srcdir)/man/dummy-man +-endif ++#endif + + man1_MANS = @man1_MANS@ + EXTRA_DIST += $(man1_MANS:.1=.x) diff --git a/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch b/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch new file mode 100644 index 0000000000..b7e82609bd --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch @@ -0,0 +1,31 @@ +Upstream-Status: Pending + +coreutils: fix for dummy-man usage + +The options should be before the final argument, otherwise, the following error +would appear when compiling. + +"dummy-man: too many non-option arguments" + +Signed-off-by: Chen Qi +--- + man/local.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/local.mk b/man/local.mk +index 7cef5e3..dc0865f 100644 +--- a/man/local.mk ++++ b/man/local.mk +@@ -189,8 +189,8 @@ man/yes.1: src/yes + && $(run_help2man) \ + --source='$(PACKAGE_STRING)' \ + --include=$(srcdir)/man/$$name.x \ +- --output=$$t/$$name.1 $$t/$$name \ + --info-page='coreutils \(aq'$$name' invocation\(aq' \ ++ --output=$$t/$$name.1 $$t/$$name \ + && sed \ + -e 's|$*\.td/||g' \ + -e '/For complete documentation/d' \ +-- +1.7.9.5 + diff --git a/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch b/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch new file mode 100644 index 0000000000..2ef8a548ac --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch @@ -0,0 +1,31 @@ +We have problem using hardcoded directories like /usr/local here +which will be checked for cross builds. This is a special case which +is valid for AIX only. We do not have AIX as one of our supported +build host or target. Therefore we get rid of the hardcoded paths +and make life easier for cross compilation process. + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [Upstream does care for AIX while we may not] + +Index: coreutils-8.14/m4/getloadavg.m4 +=================================================================== +--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700 ++++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700 +@@ -41,16 +41,6 @@ + [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes]) + fi + +- if test $gl_func_getloadavg_done = no; then +- # There is a commonly available library for RS/6000 AIX. +- # Since it is not a standard part of AIX, it might be installed locally. +- gl_getloadavg_LIBS=$LIBS +- LIBS="-L/usr/local/lib $LIBS" +- AC_CHECK_LIB([getloadavg], [getloadavg], +- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], +- [LIBS=$gl_getloadavg_LIBS]) +- fi +- + # Set up the replacement function if necessary. + if test $gl_func_getloadavg_done = no; then + HAVE_GETLOADAVG=0 diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb new file mode 100644 index 0000000000..338aae3d52 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils_6.9.bb @@ -0,0 +1,106 @@ +SUMMARY = "The basic file, shell and text manipulation utilities" +DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ +manipulation utilities. These are the core utilities which are expected to exist on \ +every system." + +HOMEPAGE = "http://www.gnu.org/software/coreutils/" +BUGTRACKER = "http://debbugs.gnu.org/coreutils" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543" +PR = "r5" +DEPENDS_class-native = "gettext-native" + +inherit autotools gettext + +SRC_URI_BASE = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \ + file://gnulib_m4.patch \ + file://futimens.patch \ + file://coreutils-ls-x.patch \ + file://coreutils-6.9-cp-i-u.patch \ + file://coreutils-i18n.patch \ + file://coreutils-overflow.patch \ + file://coreutils-fix-install.patch \ + file://man-touch.patch \ + file://coreutils_fix_for_automake-1.12.patch \ + file://coreutils-build-with-acl.patch \ + file://coreutils-fix-texinfo.patch \ + " + +SRC_URI = "${SRC_URI_BASE} file://fix_for_manpage_building.patch" +SRC_URI_class-native = "${SRC_URI_BASE}" + +SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06" +SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0" + + +# acl is not a default feature +# +PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}" +PACKAGECONFIG_class-native ??= "" + +# with, without, depends, rdepends +# +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," + + +# [ gets a special treatment and is not included in this +bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \ + env expand expr factor fmt fold groups head hostid id install \ + join link logname md5sum mkfifo nice nl nohup od paste pathchk \ + pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \ + sha384sum sha512sum shred shuf sort split sum tac tail tee test \ + tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime" + +# hostname gets a special treatment and is not included in this +base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ + mknod mv pwd rm rmdir sleep stty sync touch true uname hostname stat" + +sbindir_progs= "chroot" + +# Let aclocal use the relative path for the m4 file rather than the +# absolute since coreutils has a lot of m4 files, otherwise there might +# be an "Argument list too long" error when it is built in a long/deep +# directory. +acpaths = "-I ./m4" + +do_install() { + autotools_do_install + + install -d ${D}${base_bindir} + [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done + + install -d ${D}${sbindir} + [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done + + # [ requires special handling because [.coreutils will cause the sed stuff + # in update-alternatives to fail, therefore use lbracket - the name used + # for the actual source file. + mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} + + # Newer versions of coreutils do not include su, to mimic this behavior + # we simply remove it. + rm -f ${D}${bindir}/su +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}" + +ALTERNATIVE_PRIORITY[uptime] = "10" +ALTERNATIVE_PRIORITY[hostname] = "10" + +ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" +ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" + +python __anonymous() { + for prog in d.getVar('base_bindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) + + for prog in d.getVar('sbindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) +} + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/coreutils/coreutils_8.22.bb b/meta/recipes-core/coreutils/coreutils_8.22.bb new file mode 100644 index 0000000000..ba3a0a0228 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils_8.22.bb @@ -0,0 +1,101 @@ +SUMMARY = "The basic file, shell and text manipulation utilities" +DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ +manipulation utilities. These are the core utilities which are expected to exist on \ +every system." +HOMEPAGE = "http://www.gnu.org/software/coreutils/" +BUGTRACKER = "http://debbugs.gnu.org/coreutils" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://src/ls.c;beginline=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8" +DEPENDS = "gmp libcap" +DEPENDS_class-native = "" + +inherit autotools gettext + +SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ + file://remove-usr-local-lib-from-m4.patch \ + file://dummy_help2man.patch \ + file://fix-for-dummy-man-usage.patch \ + " + +SRC_URI[md5sum] = "8fb0ae2267aa6e728958adc38f8163a2" +SRC_URI[sha256sum] = "5b3e94998152c017e6c75d56b9b994188eb71bf46d4038a642cb9141f6ff1212" + +EXTRA_OECONF_class-native = "--without-gmp" +EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}" + +# acl is not a default feature +# +PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}" +PACKAGECONFIG_class-native ??= "" + +# with, without, depends, rdepends +# +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," + +# [ df mktemp base64 gets a special treatment and is not included in this +bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \ + env expand expr factor fmt fold groups head hostid id install \ + join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \ + pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \ + sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\ + tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes" + +# hostname gets a special treatment and is not included in this +base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ + mknod mv pwd rm rmdir sleep stty sync touch true uname stat" + +sbindir_progs= "chroot" + +# Let aclocal use the relative path for the m4 file rather than the +# absolute since coreutils has a lot of m4 files, otherwise there might +# be an "Argument list too long" error when it is built in a long/deep +# directory. +acpaths = "-I ./m4" + +# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h +do_compile_prepend () { + mkdir -p ${B}/src +} + +do_install_append() { + for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done + + install -d ${D}${base_bindir} + [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done + + install -d ${D}${sbindir} + [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done + + # [ requires special handling because [.coreutils will cause the sed stuff + # in update-alternatives to fail, therefore use lbracket - the name used + # for the actual source file. + mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df" + +ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" +ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" + +ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" +ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" + +ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" +ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" + +ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" +ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" + +python __anonymous() { + for prog in d.getVar('base_bindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) + + for prog in d.getVar('sbindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) +} + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/meta/recipes-core/dbus-wait/dbus-wait_git.bb new file mode 100644 index 0000000000..fdb19ba503 --- /dev/null +++ b/meta/recipes-core/dbus-wait/dbus-wait_git.bb @@ -0,0 +1,17 @@ +SUMMARY = "A simple tool to wait for a specific signal over DBus" +HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait" +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +DEPENDS = "dbus" + +SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517" +PV = "0.1+git${SRCPV}" +PR = "r2" + +SRC_URI = "git://git.yoctoproject.org/${BPN}" + +S = "${WORKDIR}/git" + +inherit autotools diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch new file mode 100644 index 0000000000..fbb4967828 --- /dev/null +++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch @@ -0,0 +1,15 @@ +Disable compiling examples + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Kevin Tian +Signed-off-by: Scott Garman + +--- dbus-glib-0.70/dbus/Makefile.am.orig 2006-07-23 16:04:43.000000000 +0200 ++++ dbus-glib-0.70/dbus/Makefile.am 2006-07-23 16:04:52.000000000 +0200 +@@ -1,4 +1,4 @@ +-SUBDIRS = . examples ++SUBDIRS = . + + INCLUDES=-I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -DDBUS_COMPILATION=1 -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" + diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch new file mode 100644 index 0000000000..40e3b12b5d --- /dev/null +++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch @@ -0,0 +1,15 @@ +Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=59003] + +Signed-off-by: Marko Lindqvist +diff -Nurd dbus-glib-0.100/configure.ac dbus-glib-0.100/configure.ac +--- dbus-glib-0.100/configure.ac 2012-06-25 19:26:39.000000000 +0300 ++++ dbus-glib-0.100/configure.ac 2013-01-03 04:53:22.314976758 +0200 +@@ -8,7 +8,7 @@ + + AM_INIT_AUTOMAKE([1.9]) + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + + # Honor aclocal flags + ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch new file mode 100644 index 0000000000..2e8e178bb7 --- /dev/null +++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch @@ -0,0 +1,48 @@ +Change Makefile.am to install regression tests for test package purpose. + +Upstream-Status: Inappropriate [test not install is for purpose from upstream] + +Signed-off-by: Yao Zhao + +diff --git a/test/Makefile.am b/test/Makefile.am +index 7ba11a8..249f0e7 100644 +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -13,7 +13,8 @@ else + TEST_BINARIES= + endif + +-noinst_PROGRAMS= $(TEST_BINARIES) ++testdir = $(datadir)/@PACKAGE@/tests ++test_PROGRAMS= $(TEST_BINARIES) + + test_service_SOURCES= \ + test-service.c +diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am +index 3cb2c39..e6de67d 100644 +--- a/test/interfaces/Makefile.am ++++ b/test/interfaces/Makefile.am +@@ -39,7 +39,8 @@ if DBUS_BUILD_TESTS + + ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we + ## build even when not doing "make check" +-noinst_PROGRAMS = test-service test-client ++testdir = $(datadir)/@PACKAGE@/tests/interfaces ++test_PROGRAMS = test-service test-client + + test_service_SOURCES = \ + test-interfaces.c \ +diff --git a/test/core/Makefile.am b/test/core/Makefile.am +index ef6cb26..9786c3a 100644 +--- a/test/core/Makefile.am ++++ b/test/core/Makefile.am +@@ -46,7 +46,8 @@ endif + + ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we + ## build even when not doing "make check" +-noinst_PROGRAMS = \ ++testdir = $(datadir)/@PACKAGE@/tests/core ++test_PROGRAMS = \ + test-dbus-glib \ + test-service-glib \ + $(THREAD_APPS) \ diff --git a/meta/recipes-core/dbus/dbus-glib.inc b/meta/recipes-core/dbus/dbus-glib.inc new file mode 100644 index 0000000000..6c60d9e408 --- /dev/null +++ b/meta/recipes-core/dbus/dbus-glib.inc @@ -0,0 +1,44 @@ +SUMMARY = "High level language (GLib) binding for D-Bus" +DESCRIPTION = "GLib bindings for the D-Bus message bus that integrate \ +the D-Bus library with the GLib thread abstraction and main loop." +HOMEPAGE = "http://www.freedesktop.org/Software/dbus" +LICENSE = "AFL-2 | GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=cf5b3a2f7083750d504333114e738656 \ + file://dbus/dbus-glib.h;beginline=7;endline=21;md5=7755c9d7abccd5dbd25a6a974538bb3c" +SECTION = "base" + +DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus" +DEPENDS_class-native = "glib-2.0-native dbus-native" + +SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \ + file://no-examples.patch \ + file://test-install-makefile.patch \ + file://obsolete_automake_macros.patch \ +" + +inherit autotools pkgconfig gettext + +#default disable regression tests, some unit test code in non testing code +#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf +PACKAGECONFIG ??= "" +PACKAGECONFIG[tests] = "--enable-tests,,," + +EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \ + --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool" +EXTRA_OECONF_class-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml" + +PACKAGES += "${PN}-bash-completion ${PN}-tests-dbg ${PN}-tests" + +FILES_${PN} = "${libdir}/lib*${SOLIBS}" +FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-completion.sh \ + ${libexecdir}/dbus-bash-completion-helper" +FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool" +FILES_${PN}-dev += "${bindir}/dbus-binding-tool" + +RDEPENDS_${PN}-tests += "dbus-x11" +FILES_${PN}-tests = "${datadir}/${BPN}/tests" +FILES_${PN}-tests-dbg = "${datadir}/${BPN}/tests/.debug/* \ + ${datadir}/${BPN}/tests/core/.debug/* \ + ${datadir}/${BPN}/tests/interfaces/.debug/*" + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/dbus/dbus-glib_0.100.2.bb b/meta/recipes-core/dbus/dbus-glib_0.100.2.bb new file mode 100644 index 0000000000..c1bb06a1b4 --- /dev/null +++ b/meta/recipes-core/dbus/dbus-glib_0.100.2.bb @@ -0,0 +1,5 @@ +require dbus-glib.inc + + +SRC_URI[md5sum] = "ad0920c7e3aad669163bb59171cf138e" +SRC_URI[sha256sum] = "a5bb42da921f51c28161e0e54a5a8241d94a1c0499a14007150e9ce743da6ac5" diff --git a/meta/recipes-core/dbus/dbus-test_1.6.18.bb b/meta/recipes-core/dbus/dbus-test_1.6.18.bb new file mode 100644 index 0000000000..9a7cdc5eee --- /dev/null +++ b/meta/recipes-core/dbus/dbus-test_1.6.18.bb @@ -0,0 +1,54 @@ +SUMMARY = "D-Bus test package (for D-bus functionality testing only)" +HOMEPAGE = "http://dbus.freedesktop.org" +SECTION = "base" +LICENSE = "AFL-2 | GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \ + file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c" + +DEPENDS = "python-pygobject dbus dbus-glib" + +RDEPENDS_${PN} += "make" +RDEPENDS_${PN}-dev = "" + +SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ + file://tmpdir.patch \ + file://ptest.patch \ + file://dbus-1.init \ + file://run-ptest \ + file://python-config.patch \ + file://clear-guid_from_server-if-send_negotiate_unix_f.patch \ + file://avoid_parallel_tests.patch \ + " + +SRC_URI[md5sum] = "b02e9c95027a416987b81f9893831061" +SRC_URI[sha256sum] = "7085a0895a9eb11a952394cdbea6d8b4358e17cb991fed0e8fb85e2b9e686dcd" + +S="${WORKDIR}/dbus-${PV}" +FILESPATH = "${FILE_DIRNAME}/dbus" + +inherit autotools pkgconfig gettext ptest + +EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}" +EXTRA_OECONF_X_class-native = "--without-x" + +EXTRA_OECONF = "--enable-tests \ + --enable-modular-tests \ + --enable-installed-tests \ + --enable-checks \ + --enable-asserts \ + --enable-verbose-mode \ + --disable-xml-docs \ + --disable-doxygen-docs \ + --disable-libaudit \ + --with-xml=expat \ + --disable-systemd \ + --without-systemdsystemunitdir \ + --with-dbus-test-dir=${PTEST_PATH} \ + ${EXTRA_OECONF_X}" + +do_install() { +} + +do_install_ptest() { + find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/' +} diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc new file mode 100644 index 0000000000..035221f61b --- /dev/null +++ b/meta/recipes-core/dbus/dbus.inc @@ -0,0 +1,157 @@ +SUMMARY = "D-Bus message bus" +DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed." +HOMEPAGE = "http://dbus.freedesktop.org" +SECTION = "base" +LICENSE = "AFL-2 | GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \ + file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c" +DEPENDS = "expat virtual/libintl" +RDEPENDS_dbus_class-native = "" +RDEPENDS_dbus_class-nativesdk = "" +PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest', '', d)}" +ALLOW_EMPTY_dbus-ptest = "1" +RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest" + +SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ + file://tmpdir.patch \ + file://dbus-1.init \ + file://os-test.patch \ + file://clear-guid_from_server-if-send_negotiate_unix_f.patch \ + file://Set-correct-address-when-using-address-systemd.patch \ + file://fixed-memory-freeing-if-error-during-listing-service.patch \ +" + +inherit useradd autotools pkgconfig gettext update-rc.d + +INITSCRIPT_NAME = "dbus-1" +INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." + +python __anonymous() { + if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "-r netdev" +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \ + --no-create-home --shell /bin/false \ + --user-group messagebus" + +CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" + +DEBIANNAME_${PN} = "dbus-1" + +PACKAGES =+ "${PN}-lib" + +OLDPKGNAME = "dbus-x11" +OLDPKGNAME_class-nativesdk = "" + +# for compatibility +RPROVIDES_${PN} = "${OLDPKGNAME}" +RREPLACES_${PN} += "${OLDPKGNAME}" + +FILES_${PN} = "${bindir}/dbus-daemon* \ + ${bindir}/dbus-uuidgen \ + ${bindir}/dbus-cleanup-sockets \ + ${bindir}/dbus-send \ + ${bindir}/dbus-monitor \ + ${bindir}/dbus-launch \ + ${libexecdir}/dbus* \ + ${sysconfdir} \ + ${localstatedir} \ + ${datadir}/dbus-1/services \ + ${datadir}/dbus-1/system-services \ + ${systemd_unitdir}/system/" +FILES_${PN}-lib = "${libdir}/lib*.so.*" +RRECOMMENDS_${PN}-lib = "${PN}" +FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool" + +pkg_postinst_dbus() { + # If both systemd and sysvinit are enabled, mask the dbus-1 init script + if ${@base_contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + systemctl $OPTS mask dbus-1.service + fi + + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi +} + +EXTRA_OECONF = "--disable-tests \ + --disable-xml-docs \ + --disable-doxygen-docs \ + --disable-libaudit \ + --with-xml=expat \ + --disable-systemd" + +PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" +PACKAGECONFIG_class-native = "" +PACKAGECONFIG_class-nativesdk = "" + +# Would like to --enable-systemd but that's a circular build-dependency between +# systemd<->dbus +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir" +PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" + +do_install() { + autotools_do_install + + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh + install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1 + fi + + install -d ${D}${sysconfdir}/default/volatiles + echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \ + > ${D}${sysconfdir}/default/volatiles/99_dbus + + + mkdir -p ${D}${localstatedir}/lib/dbus + + chown messagebus:messagebus ${D}${localstatedir}/lib/dbus + + chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper + chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper + + # Remove Red Hat initscript + rm -rf ${D}${sysconfdir}/rc.d + + # Remove empty testexec directory as we don't build tests + rm -rf ${D}${libdir}/dbus-1.0/test + + # Remove /var/run as it is created on startup + rm -rf ${D}${localstatedir}/run +} + +do_install_class-native() { + autotools_do_install + + # for dbus-glib-native introspection generation + install -d ${STAGING_DATADIR_NATIVE}/dbus/ + # N.B. is below install actually required? + install -m 0644 bus/session.conf ${STAGING_DATADIR_NATIVE}/dbus/session.conf + + # dbus-glib-native and dbus-glib need this xml file + ./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml + + # dbus-launch has no X support so lets not install it in case the host + # has a more featured and useful version + rm -f ${D}${bindir}/dbus-launch +} + +do_install_class-nativesdk() { + autotools_do_install + + # dbus-launch has no X support so lets not install it in case the host + # has a more featured and useful version + rm -f ${D}${bindir}/dbus-launch + + # Remove /var/run to avoid QA error + rm -rf ${D}${localstatedir}/run +} +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch b/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch new file mode 100644 index 0000000000..1fca9bb254 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch @@ -0,0 +1,193 @@ +From d728fdc655f17031da3bb129ab2fd17dadf0fe3a Mon Sep 17 00:00:00 2001 +From: Simon Peeters +Date: Sun, 7 Oct 2012 16:59:30 +0200 +Subject: [PATCH] Set correct address when using --address=systemd: + +When dbus gets launched through systemd, we need to create an address +string based on the sockets passed. + +The _dbus_append_addres_from_socket() function is responsible for +extracting the address information from the file-descriptor and +formatting it in a dbus friendly way. + +This fixes bus activation when running dbus under a systemd session. + +https://bugs.freedesktop.org/show_bug.cgi?id=50962 + +Upstream-Status: Backport + +Signed-off-by: Simon Peeters +Signed-off-by: Jonathan Liu +--- + dbus/dbus-server-unix.c | 38 ++++++++++++++++++--------- + dbus/dbus-sysdeps-unix.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ + dbus/dbus-sysdeps-unix.h | 4 +++ + 3 files changed, 97 insertions(+), 13 deletions(-) + +diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c +index 130f66e..d995240 100644 +--- a/dbus/dbus-server-unix.c ++++ b/dbus/dbus-server-unix.c +@@ -149,7 +149,7 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry, + } + else if (strcmp (method, "systemd") == 0) + { +- int n, *fds; ++ int i, n, *fds; + DBusString address; + + n = _dbus_listen_systemd_sockets (&fds, error); +@@ -159,27 +159,39 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry, + return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; + } + +- _dbus_string_init_const (&address, "systemd:"); ++ if (!_dbus_string_init (&address)) ++ goto systemd_oom; + +- *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL); +- if (*server_p == NULL) ++ for (i = 0; i < n; i++) + { +- int i; +- +- for (i = 0; i < n; i++) ++ if (i > 0) + { +- _dbus_close_socket (fds[i], NULL); ++ if (!_dbus_string_append (&address, ";")) ++ goto systemd_oom; + } +- dbus_free (fds); +- +- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); +- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; ++ if (!_dbus_append_address_from_socket (fds[i], &address, error)) ++ goto systemd_err; + } + ++ *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL); ++ if (*server_p == NULL) ++ goto systemd_oom; ++ + dbus_free (fds); + + return DBUS_SERVER_LISTEN_OK; +- } ++ systemd_oom: ++ _DBUS_SET_OOM (error); ++ systemd_err: ++ for (i = 0; i < n; i++) ++ { ++ _dbus_close_socket (fds[i], NULL); ++ } ++ dbus_free (fds); ++ _dbus_string_free (&address); ++ ++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; ++ } + #ifdef DBUS_ENABLE_LAUNCHD + else if (strcmp (method, "launchd") == 0) + { +diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c +index b4ecc96..55743b1 100644 +--- a/dbus/dbus-sysdeps-unix.c ++++ b/dbus/dbus-sysdeps-unix.c +@@ -55,6 +55,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_ERRNO_H + #include +@@ -4160,4 +4161,71 @@ _dbus_check_setuid (void) + #endif + } + ++/** ++ * Read the address from the socket and append it to the string ++ * ++ * @param fd the socket ++ * @param address ++ * @param error return location for error code ++ */ ++dbus_bool_t ++_dbus_append_address_from_socket (int fd, ++ DBusString *address, ++ DBusError *error) ++{ ++ union { ++ struct sockaddr sa; ++ struct sockaddr_storage storage; ++ struct sockaddr_un un; ++ struct sockaddr_in ipv4; ++ struct sockaddr_in6 ipv6; ++ } socket; ++ char hostip[INET6_ADDRSTRLEN]; ++ int size = sizeof (socket); ++ ++ if (getsockname (fd, &socket.sa, &size)) ++ goto err; ++ ++ switch (socket.sa.sa_family) ++ { ++ case AF_UNIX: ++ if (socket.un.sun_path[0]=='\0') ++ { ++ if (_dbus_string_append_printf (address, "unix:abstract=%s", &(socket.un.sun_path[1]))) ++ return TRUE; ++ } ++ else ++ { ++ if (_dbus_string_append_printf (address, "unix:path=%s", socket.un.sun_path)) ++ return TRUE; ++ } ++ break; ++ case AF_INET: ++ if (inet_ntop (AF_INET, &socket.ipv4.sin_addr, hostip, sizeof (hostip))) ++ if (_dbus_string_append_printf (address, "tcp:family=ipv4,host=%s,port=%u", ++ hostip, ntohs (socket.ipv4.sin_port))) ++ return TRUE; ++ break; ++#ifdef AF_INET6 ++ case AF_INET6: ++ if (inet_ntop (AF_INET6, &socket.ipv6.sin6_addr, hostip, sizeof (hostip))) ++ if (_dbus_string_append_printf (address, "tcp:family=ipv6,host=%s,port=%u", ++ hostip, ntohs (socket.ipv6.sin6_port))) ++ return TRUE; ++ break; ++#endif ++ default: ++ dbus_set_error (error, ++ _dbus_error_from_errno (EINVAL), ++ "Failed to read address from socket: Unknown socket type."); ++ return FALSE; ++ } ++ err: ++ dbus_set_error (error, ++ _dbus_error_from_errno (errno), ++ "Failed to open socket: %s", ++ _dbus_strerror (errno)); ++ return FALSE; ++} ++ + /* tests in dbus-sysdeps-util.c */ +diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h +index 9b70896..a265b33 100644 +--- a/dbus/dbus-sysdeps-unix.h ++++ b/dbus/dbus-sysdeps-unix.h +@@ -138,6 +138,10 @@ dbus_bool_t _dbus_parse_uid (const DBusString *uid_str, + + void _dbus_close_all (void); + ++dbus_bool_t _dbus_append_address_from_socket (int fd, ++ DBusString *address, ++ DBusError *error); ++ + /** @} */ + + DBUS_END_DECLS +-- +1.9.0 + diff --git a/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch b/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch new file mode 100644 index 0000000000..763b242ed4 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch @@ -0,0 +1,19 @@ +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +Signed-off-by: Alexandra Safta +Upstream-Status: Pending + +diff -ruN a/configure.ac b/configure.ac + +--- a/configure.ac 2014-05-27 10:45:55.224225040 +0200 ++++ b/configure.ac 2014-05-27 10:46:28.810814636 +0200 +@@ -13,7 +13,7 @@ + AC_CONFIG_HEADERS([config.h]) + AC_CONFIG_MACRO_DIR([m4]) + +-AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability]) ++AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability serial-tests]) + + GETTEXT_PACKAGE=dbus-1 + AC_SUBST(GETTEXT_PACKAGE) diff --git a/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch new file mode 100644 index 0000000000..6bb6d9c82e --- /dev/null +++ b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch @@ -0,0 +1,104 @@ +From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001 +From: Roy Li +Date: Thu, 27 Feb 2014 09:05:02 +0800 +Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd + failed + +Upstream-Status: Submitted + +bus-test dispatch test failed with below information: + ./bus/bus-test: Running message dispatch test + Activating service name='org.freedesktop.DBus.TestSuiteEchoService' + Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService' + 6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok + ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969] + ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44] + ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3] + ./bus/bus-test() [0x80e24da] + ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848] + ./bus/bus-test() [0x80aea49] + ./bus/bus-test() [0x80affde] + ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841] + ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174] + ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8] + ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509] + ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d] + ./bus/bus-test() [0x806cab0] + ./bus/bus-test() [0x806e0ca] + ./bus/bus-test() [0x806da6f] + ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c] + ./bus/bus-test() [0x806f723] + ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac] + ./bus/bus-test(main+0x1b7) [0x805acc7] + /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3] + ./bus/bus-test() [0x805ae39] + +The stack is below: + #0 0xffffe425 in __kernel_vsyscall () + #1 0x45fa62d6 in raise () from /lib/libc.so.6 + #2 0x45fa9653 in abort () from /lib/libc.so.6 + #3 0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94 + #4 0x080b52c3 in _dbus_real_assert (condition=0, + condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0", + file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545, + func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok") + data=0x8157290) at dbus-connection.c:1515 + #0 0x00000033fee353e9 in raise () from /lib64/libc.so.6 + #1 0x00000033fee38508 in abort () from /lib64/libc.so.6 + #2 0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94 + #3 0x0000000000466486 in _dbus_real_assert (condition=, + condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0", + file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546, + func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok") + at dbus-internals.c:931 + #4 0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480, + auth=0x6ff340) at dbus-auth.c:1546 + #5 handle_client_state_waiting_for_data (auth=0x6ff340, + command=, args=0x7fffffffe480) at dbus-auth.c:1996 + #6 0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208 + #7 _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458 + #8 0x000000000046091d in do_authentication ( + transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1, + do_writing=do_writing@entry=0, + auth_completed=auth_completed@entry=0x7fffffffe55c) + at dbus-transport-socket.c:442 + #9 0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0, + watch=0x6f4190, flags=1) at dbus-transport-socket.c:921 + #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0, + +Once send_negotiate_unix_fd failed, this failure will happen, since +auth->guid_from_server has been set to some value before +send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to +this auth be handled by process_ok again, but this auth->guid_from_server +is not zero. + +So we should clear auth->guid_from_server if send_negotiate_unix_fd failed + +Signed-off-by: Roy Li +--- + dbus/dbus-auth.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c +index d2c37a7..37b45c6 100644 +--- a/dbus/dbus-auth.c ++++ b/dbus/dbus-auth.c +@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth, + _dbus_verbose ("Got GUID '%s' from the server\n", + _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server)); + +- if (auth->unix_fd_possible) +- return send_negotiate_unix_fd(auth); ++ if (auth->unix_fd_possible) { ++ if (!send_negotiate_unix_fd(auth)) { ++ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0); ++ return FALSE; ++ } ++ return TRUE; ++ } + + _dbus_verbose("Not negotiating unix fd passing, since not possible\n"); + return send_begin (auth); +-- +1.7.10.4 + diff --git a/meta/recipes-core/dbus/dbus/dbus-1.init b/meta/recipes-core/dbus/dbus/dbus-1.init new file mode 100644 index 0000000000..42c86297c3 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/dbus-1.init @@ -0,0 +1,123 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: dbus +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: D-Bus systemwide message bus +# Description: D-Bus is a simple interprocess messaging system, used +# for sending messages between applications. +### END INIT INFO +# +# -*- coding: utf-8 -*- +# Debian init.d script for D-BUS +# Copyright © 2003 Colin Walters + +# set -e + +# Source function library. +. /etc/init.d/functions + +DAEMON=@bindir@/dbus-daemon +NAME=dbus +DAEMONUSER=messagebus # must match /etc/dbus-1/system.conf +PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf +UUIDDIR=/var/lib/dbus +DESC="system message bus" +EVENTDIR=/etc/dbus-1/event.d + +test -x $DAEMON || exit 0 + +# Source defaults file; edit that file to configure this script. +ENABLED=1 +PARAMS="" +if [ -e /etc/default/dbus ]; then + . /etc/default/dbus +fi + +test "$ENABLED" != "0" || exit 0 + +start_it_up() +{ + mkdir -p "`dirname $PIDFILE`" + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then + echo "$DESC already started; not starting." + else + echo "Removing stale PID file $PIDFILE." + rm -f $PIDFILE + fi + fi + + if [ ! -d $UUIDDIR ]; then + mkdir -p $UUIDDIR + chown $DAEMONUSER $UUIDDIR + chgrp $DAEMONUSER $UUIDDIR + fi + + dbus-uuidgen --ensure + + echo -n "Starting $DESC: " + start-stop-daemon -o --start --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS + echo "$NAME." + if [ -d $EVENTDIR ]; then + run-parts --arg=start $EVENTDIR + fi +} + +shut_it_down() +{ + if [ -d $EVENTDIR ]; then + # TODO: --reverse when busybox supports it + run-parts --arg=stop $EVENTDIR + fi + echo -n "Stopping $DESC: " + start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER + # We no longer include these arguments so that start-stop-daemon + # can do its job even given that we may have been upgraded. + # We rely on the pidfile being sanely managed + # --exec $DAEMON -- --system $PARAMS + echo "$NAME." + rm -f $PIDFILE +} + +reload_it() +{ + echo -n "Reloading $DESC config: " + dbus-send --print-reply --system --type=method_call \ + --dest=org.freedesktop.DBus \ + / org.freedesktop.DBus.ReloadConfig > /dev/null + # hopefully this is enough time for dbus to reload it's config file. + echo "done." +} + +case "$1" in + start) + start_it_up + ;; + stop) + shut_it_down + ;; + status) + status $DAEMON + exit $? + ;; + reload|force-reload) + reload_it + ;; + restart) + shut_it_down + sleep 1 + start_it_up + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch b/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch new file mode 100644 index 0000000000..96290f41be --- /dev/null +++ b/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch @@ -0,0 +1,45 @@ +From 03aeaccbffa97c9237b57ca067e3da7388862129 Mon Sep 17 00:00:00 2001 +From: Radoslaw Pajak +Date: Fri, 8 Nov 2013 13:51:32 +0100 +Subject: [PATCH] fixed memory freeing if error during listing services + +Upstream-Status: Backport + +Signed-off-by: Radoslaw Pajak +Reviewed-by: Simon McVittie +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71526 +Signed-off-by: Jonathan Liu +--- + bus/activation.c | 2 +- + bus/services.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bus/activation.c b/bus/activation.c +index fcb7133..ea48a26 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -2179,7 +2179,7 @@ bus_activation_list_services (BusActivation *activation, + + error: + for (j = 0; j < i; j++) +- dbus_free (retval[i]); ++ dbus_free (retval[j]); + dbus_free (retval); + + return FALSE; +diff --git a/bus/services.c b/bus/services.c +index 6f380fa..01a720e 100644 +--- a/bus/services.c ++++ b/bus/services.c +@@ -368,7 +368,7 @@ bus_registry_list_services (BusRegistry *registry, + + error: + for (j = 0; j < i; j++) +- dbus_free (retval[i]); ++ dbus_free (retval[j]); + dbus_free (retval); + + return FALSE; +-- +1.9.0 + diff --git a/meta/recipes-core/dbus/dbus/os-test.patch b/meta/recipes-core/dbus/dbus/os-test.patch new file mode 100644 index 0000000000..79554b1ee1 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/os-test.patch @@ -0,0 +1,35 @@ +dbus: remove build host test in configure script + +The dbus build tests the build host to detect what initscript +environment it expects. Remove the test and set it to "redhat" +unconditionally as the oe-core initscript has a redhat-style pid file +path. + +Signed-off-by: Andy Ross +Upstream-Status: innappropriate [embedded] + +diff -u a/configure.ac b/configure.ac +--- a/configure.ac 2012-08-28 11:23:43.040609874 -0700 ++++ b/configure.ac 2012-08-28 11:54:25.602913945 -0700 +@@ -1348,19 +1348,8 @@ + AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir") + AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir") + +-#### Check our operating system +-operating_system=unknown +-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then +- operating_system=redhat +-fi +- +-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then +- operating_system=slackware +-fi +- +-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then +- operating_system=cygwin +-fi ++#### Build host test removed from upstream code, openembedded initscript is redhat-like: ++operating_system=redhat + + #### Sort out init scripts + diff --git a/meta/recipes-core/dbus/dbus/ptest.patch b/meta/recipes-core/dbus/dbus/ptest.patch new file mode 100644 index 0000000000..263d17eff7 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/ptest.patch @@ -0,0 +1,154 @@ +Add install-ptest rules. +Change TEST_ENVIRONMENT to allow running outside build dir. + + Makefile.am | 7 +++++++ + bus/Makefile.am | 6 ++++++ + dbus/Makefile.am | 6 ++++++ + doc/Makefile.am | 4 ++++ + test/Makefile.am | 25 ++++++++++++++++++++----- + test/name-test/Makefile.am | 9 +++++++++ + tools/Makefile.am | 12 ++++++++++++ + 7 files changed, 64 insertions(+), 5 deletions(-) + +Signed-off-by: Björn Stenberg +Upstream-Status: Pending + +diff -ur a/Makefile.am b/Makefile.am +--- a/Makefile.am 2012-12-06 14:34:01.157414449 +0100 ++++ b/Makefile.am 2012-12-06 15:21:14.447113035 +0100 +@@ -30,4 +30,11 @@ + + ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} + ++if DBUS_BUILD_TESTS ++install-ptest: ++ @for subdir in $(SUBDIRS); do \ ++ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \ ++ done ++endif ++ + include tools/lcov.am +diff -ur a/bus/Makefile.am b/bus/Makefile.am +--- a/bus/Makefile.am 2012-12-06 14:34:01.169413931 +0100 ++++ b/bus/Makefile.am 2012-12-06 15:21:14.463112346 +0100 +@@ -290,3 +290,9 @@ + #### Extra dist + + EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) ++ ++if DBUS_BUILD_TESTS ++install-ptest: ++ @$(MKDIR_P) $(DESTDIR) ++ @install $(dbus_daemon_exec_PROGRAMS) $(noinst_PROGRAMS) $(DESTDIR) ++endif +diff -ur a/dbus/Makefile.am b/dbus/Makefile.am +--- a/dbus/Makefile.am 2012-12-06 14:34:01.161414276 +0100 ++++ b/dbus/Makefile.am 2012-12-06 15:21:14.451112862 +0100 +@@ -310,3 +310,9 @@ + update-systemd: + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h ++ ++if DBUS_BUILD_TESTS ++install-ptest: ++ @$(MKDIR_P) $(DESTDIR) ++ @install $(noinst_PROGRAMS) $(DESTDIR) ++endif +diff -ur a/test/Makefile.am b/test/Makefile.am +--- a/test/Makefile.am 2012-12-06 14:34:01.165414103 +0100 ++++ b/test/Makefile.am 2012-12-06 15:21:14.455112690 +0100 +@@ -119,12 +119,13 @@ + DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \ + DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir) + ++ptest_run_dir = .. ++ + TESTS_ENVIRONMENT = \ +- DBUS_BLOCK_ON_ABORT=1 \ +- DBUS_FATAL_WARNINGS=1 \ +- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \ +- DBUS_TEST_DATA=@abs_top_builddir@/test/data \ +- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \ ++ DBUS_FATAL_WARNINGS=0 \ ++ DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \ ++ DBUS_TEST_DATA=$(ptest_run_dir)/test/data \ ++ DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \ + $(NULL) + + test_corrupt_SOURCES = corrupt.c +@@ -325,3 +325,25 @@ + data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf + $(AM_V_at)$(MKDIR_P) data/valid-config-files + $(AM_V_GEN)cp $< $@ ++ ++if DBUS_BUILD_TESTS ++install-ptest: install-ptest-nonrecursive ++ @for subdir in $(SUBDIRS); do \ ++ if [ $$subdir != "." ]; then \ ++ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \ ++ fi; \ ++ done ++ ++install-ptest-nonrecursive: ++ @$(MKDIR_P) $(DESTDIR)/data/valid-config-files/session.d ++ @for file in Makefile $(installable_tests) $(noinst_PROGRAMS) $(noinst_DATA) ; do \ ++ if [ -f .libs/$$file ]; then \ ++ install .libs/$$file $(DESTDIR); \ ++ else \ ++ install -D $${file%.in} $(DESTDIR)/$${file%.in}; \ ++ fi; \ ++ done; ++ @for file in $(EXTRA_DIST); do \ ++ install -D ${srcdir}/$${file%.in} $(DESTDIR)/$${file%.in}; \ ++ done; ++endif +diff -ur a/test/name-test/Makefile.am b/test/name-test/Makefile.am +--- a/test/name-test/Makefile.am 2012-12-06 14:34:01.169413931 +0100 ++++ b/test/name-test/Makefile.am 2012-12-06 15:21:14.459112518 +0100 +@@ -36,4 +36,16 @@ + test_privserver_client_LDADD=../libdbus-testutils.la + test_autolaunch_LDADD=../libdbus-testutils.la + ++install-ptest: ++ @$(MKDIR_P) $(DESTDIR) ++ @for file in Makefile $(noinst_PROGRAMS); do \ ++ if [ -f .libs/$$file ]; then \ ++ install .libs/$$file $(DESTDIR); \ ++ else \ ++ install $$file $(DESTDIR); \ ++ fi \ ++ done; ++ @for file in $(EXTRA_DIST); do \ ++ cp $(srcdir)/$$file $(DESTDIR); \ ++ done; + endif +diff -ur a/tools/Makefile.am b/tools/Makefile.am +--- a/tools/Makefile.am 2012-12-06 14:34:01.161414276 +0100 ++++ b/tools/Makefile.am 2012-12-06 15:21:14.455112690 +0100 +@@ -78,3 +78,15 @@ + + installcheck-local: + test -d $(DESTDIR)$(localstatedir)/lib/dbus ++ ++if DBUS_BUILD_TESTS ++install-ptest: ++ @$(MKDIR_P) $(DESTDIR) ++ @for file in $(bin_PROGRAMS); do \ ++ if [ -f .libs/$$file ]; then \ ++ install .libs/$$file $(DESTDIR); \ ++ else \ ++ install $$file $(DESTDIR); \ ++ fi; \ ++ done; ++endif +diff -ur a/doc/Makefile.am b/doc/Makefile.am +--- a/doc/Makefile.am 2012-06-06 12:45:55.000000000 +0200 ++++ b/doc/Makefile.am 2012-12-06 16:04:58.990070587 +0100 +@@ -174,3 +174,7 @@ + + maintainer-clean-local: + rm -f $(XMLTO_OUTPUT) ++ ++if DBUS_BUILD_TESTS ++install-ptest: ++endif diff --git a/meta/recipes-core/dbus/dbus/python-config.patch b/meta/recipes-core/dbus/dbus/python-config.patch new file mode 100644 index 0000000000..294400247e --- /dev/null +++ b/meta/recipes-core/dbus/dbus/python-config.patch @@ -0,0 +1,25 @@ +When building the dbus-ptest package, we have to enable python. However +checking if the host-system python has the necessary library isn't useful. + +Disable the python module check for cross compiling. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Mark Hatle + +--- dbus-1.6.8/configure.ac.orig 2013-07-11 14:15:58.834554799 -0500 ++++ dbus-1.6.8/configure.ac 2013-07-11 14:14:40.969554848 -0500 +@@ -257,13 +257,6 @@ + # full test coverage is required, Python is a hard dependency + AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject]) + AM_PATH_PYTHON([2.6]) +- AC_MSG_CHECKING([for Python modules for full test coverage]) +- if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules]) +- fi + else + # --enable-tests not given: do not abort if Python is missing + AM_PATH_PYTHON([2.6], [], [:]) diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest new file mode 100755 index 0000000000..e08ecb1a63 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh +cd test +make -k runtest-TESTS diff --git a/meta/recipes-core/dbus/dbus/tmpdir.patch b/meta/recipes-core/dbus/dbus/tmpdir.patch new file mode 100644 index 0000000000..bf086e1788 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/tmpdir.patch @@ -0,0 +1,44 @@ +From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Thu, 23 Jun 2011 13:52:09 +0200 +Subject: [PATCH] buildsys: hardcode socketdir to /tmp + +the TMPDIR env var isn't always pointing to the right target path + +Upstream-Status: Inappropriate [embedded] + +Signed-off-by: Koen Kooi + +Original comment: + + avoid to check tmp dir at build time. instead uses hard coded /tmp here + comment added by Kevin Tian +--- + configure.ac | 11 +---------- + 1 files changed, 1 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 408054b..6d26180 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY) + AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY", + [Full path to the launch helper test program in the builddir]) + +-#### Find socket directories +-if ! test -z "$TMPDIR" ; then +- DEFAULT_SOCKET_DIR=$TMPDIR +-elif ! test -z "$TEMP" ; then +- DEFAULT_SOCKET_DIR=$TEMP +-elif ! test -z "$TMP" ; then +- DEFAULT_SOCKET_DIR=$TMP +-else +- DEFAULT_SOCKET_DIR=/tmp +-fi ++DEFAULT_SOCKET_DIR=/tmp + + DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'` + +-- +1.6.6.1 + diff --git a/meta/recipes-core/dbus/dbus_1.6.18.bb b/meta/recipes-core/dbus/dbus_1.6.18.bb new file mode 100644 index 0000000000..7270c36f95 --- /dev/null +++ b/meta/recipes-core/dbus/dbus_1.6.18.bb @@ -0,0 +1,4 @@ +include dbus.inc + +SRC_URI[md5sum] = "b02e9c95027a416987b81f9893831061" +SRC_URI[sha256sum] = "7085a0895a9eb11a952394cdbea6d8b4358e17cb991fed0e8fb85e2b9e686dcd" diff --git a/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch new file mode 100644 index 0000000000..6f828cfc51 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch @@ -0,0 +1,229 @@ +Fix various linkage errors for LibTomCrypt library in order to run tests +using ANSI-C PRNG algorithm. Also check that XCLOCKS_PER_SEC is larger than 1000000 +so that there may be a valid PRNG (Pseudo Random Number Generator). +Customize the tests output to be ptest-compliant . + +Upstream-Status: Pending +Signed-off-by: Dorin Gheorghe + +diff -Naur dropbear-2012.55/libtomcrypt/Makefile.in dropbear-2012.55.modified/libtomcrypt/Makefile.in +--- dropbear-2012.55/libtomcrypt/Makefile.in 2013-04-16 14:20:45.270448945 +0200 ++++ dropbear-2012.55.modified/libtomcrypt/Makefile.in 2013-04-16 11:00:06.517614900 +0200 +@@ -19,7 +19,7 @@ + + # Compilation flags. Note the += does not write over the user's CFLAGS! + # The rest of the flags come from the parent Dropbear makefile +-CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../ ++CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../ -I./testprof + + # additional warnings (newer GCC 3.4 and higher) + ifdef GCC_34 +@@ -175,6 +175,7 @@ + MULTIS=demos/multi.o + TIMINGS=demos/timing.o + TESTS=demos/test.o ++YARROW=src/prngs/yarrow.o src/prngs/rng_make_prng.o src/prngs/rng_get_bytes.o + + #Files left over from making the crypt.pdf. + LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out +@@ -227,8 +228,8 @@ + timing: library testprof/$(LIBTEST) $(TIMINGS) + $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) + +-test: library testprof/$(LIBTEST) $(TESTS) +- $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) ++test: library testprof/$(LIBTEST) $(TESTS) $(YARROW) ++ $(CC) $(LDFLAGS) $(TESTS) $(YARROW) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) + + #This rule installs the library and the header files. This must be run + #as root in order to have a high enough permission to write to the correct +diff -Naur dropbear-2012.55/libtomcrypt/demos/test.c dropbear-2012.55.modified/libtomcrypt/demos/test.c +--- dropbear-2012.55/libtomcrypt/demos/test.c 2012-02-23 14:47:05.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/demos/test.c 2013-04-18 14:30:44.519839797 +0200 +@@ -12,21 +12,21 @@ + #elif defined(USE_GMP) + ltc_mp = gmp_desc; + #else +- extern ltc_math_descriptor EXT_MATH_LIB; ++ ltc_math_descriptor EXT_MATH_LIB; + ltc_mp = EXT_MATH_LIB; + #endif + + printf("build == \n%s\n", crypt_build_settings); +- printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); +- printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = store_test(); printf(x ? "FAIL: " : "PASS: "); printf("store_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = cipher_hash_test(); printf(x ? "FAIL: " : "PASS: "); printf("cipher_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = modes_test(); printf(x ? "FAIL: " : "PASS: "); printf("modes_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = der_tests(); printf(x ? "FAIL: " : "PASS: "); printf("der_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = mac_test(); printf(x ? "FAIL: " : "PASS: "); printf("mac_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = pkcs_1_test(); printf(x ? "FAIL: " : "PASS: "); printf("pkcs_1_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = rsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("rsa_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = ecc_tests(); printf(x ? "FAIL: " : "PASS: "); printf("ecc_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = dsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("dsa_test\n"); if (x) exit(EXIT_FAILURE); ++ fflush(stdout); x = katja_test(); printf(x ? "FAIL: " : "PASS: "); printf("katja_test\n"); if (x) exit(EXIT_FAILURE); + printf("\n"); + return EXIT_SUCCESS; + } +diff -Naur dropbear-2012.55/libtomcrypt/src/ciphers/des.c dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c +--- dropbear-2012.55/libtomcrypt/src/ciphers/des.c 2012-02-23 14:47:05.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c 2013-04-16 11:05:46.171309548 +0200 +@@ -20,7 +20,7 @@ + #define EN0 0 + #define DE1 1 + +-#if 0 ++#if 1 + const struct ltc_cipher_descriptor des_desc = + { + "des", +@@ -1520,7 +1520,7 @@ + } + #endif + +-#if 0 ++#if 1 + /** + Initialize the DES block cipher + @param key The symmetric key you wish to pass +@@ -1581,7 +1581,7 @@ + return CRYPT_OK; + } + +-#if 0 ++#if 1 + /** + Encrypts a block of text with DES + @param pt The input plaintext (8 bytes) +@@ -1672,7 +1672,7 @@ + return CRYPT_OK; + } + +-#if 0 ++#if 1 + /** + Performs a self-test of the DES block cipher + @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled +@@ -1857,7 +1857,7 @@ + #endif + } + +-#if 0 ++#if 1 + /** Terminate the context + @param skey The scheduled key + */ +@@ -1874,7 +1874,7 @@ + } + + +-#if 0 ++#if 1 + /** + Gets suitable key size + @param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable. +diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h +--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h 2012-02-23 14:47:05.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h 2013-04-16 10:41:21.916943343 +0200 +@@ -187,6 +187,7 @@ + void *data; + } symmetric_key; + ++#define LTC_ECB_MODE + #ifdef LTC_ECB_MODE + /** A block cipher ECB structure */ + typedef struct { +diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h +--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h 2012-02-23 14:47:05.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h 2013-04-16 14:02:10.794122645 +0200 +@@ -72,13 +72,15 @@ + + /* Enable self-test test vector checking */ + /* Not for dropbear */ +-/*#define LTC_TEST*/ ++#define LTC_TEST ++ ++#define YARROW + + /* clean the stack of functions which put private information on stack */ + /* #define LTC_CLEAN_STACK */ + + /* disable all file related functions */ +-#define LTC_NO_FILE ++//#define LTC_NO_FILE + + /* disable all forms of ASM */ + /* #define LTC_NO_ASM */ +diff -Naur dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c +--- dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c 2012-02-23 14:47:06.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c 2013-04-16 10:46:33.359842595 +0200 +@@ -15,7 +15,6 @@ + Build strings, Tom St Denis + */ + +-/* + const char *crypt_build_settings = + "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" + "LibTomCrypt is public domain software.\n" +@@ -358,7 +357,7 @@ + "\n" + "\n\n\n" + ; +- */ ++ + + + /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt.c,v $ */ +diff -Naur dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c +--- dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c 2012-02-23 14:47:06.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c 2013-04-18 14:20:03.974930313 +0200 +@@ -60,7 +60,7 @@ + clock_t t1; + int l, acc, bits, a, b; + +- if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 10000) { ++ if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 1000000) { + return 0; + } + +diff -Naur dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c +--- dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c 2012-02-23 14:47:06.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c 2013-04-16 14:08:22.042234657 +0200 +@@ -11,6 +11,8 @@ + + /* test ciphers */ + for (x = 0; cipher_descriptor[x].name != NULL; x++) { ++ /* md5 test is failing with segfault */ ++ if (!strcmp(cipher_descriptor[x].name, "md5")) break; + DO(cipher_descriptor[x].test()); + } + +diff -Naur dropbear-2012.55/libtomcrypt/testprof/makefile dropbear-2012.55.modified/libtomcrypt/testprof/makefile +--- dropbear-2012.55/libtomcrypt/testprof/makefile 2012-02-23 14:47:06.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/testprof/makefile 2013-04-16 10:35:21.200110690 +0200 +@@ -1,4 +1,4 @@ +-CFLAGS += -I../src/headers -I./ -Wall -W ++CFLAGS += -I../src/headers -I./ -I./../../ -Wall -W + + # ranlib tools + ifndef RANLIB +diff -Naur dropbear-2012.55/libtomcrypt/testprof/modes_test.c dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c +--- dropbear-2012.55/libtomcrypt/testprof/modes_test.c 2012-02-23 14:47:06.000000000 +0100 ++++ dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c 2013-04-16 10:50:53.820882559 +0200 +@@ -1,6 +1,8 @@ + /* test CFB/OFB/CBC modes */ + #include + ++extern unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng); ++ + int modes_test(void) + { + unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16]; diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc new file mode 100644 index 0000000000..40ed9d261d --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear.inc @@ -0,0 +1,99 @@ +SUMMARY = "A lightweight SSH and SCP implementation" +HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" +SECTION = "console/network" + +# some files are from other projects and have others license terms: +# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY +LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4d290ce0ac102c828dfc9ce836784688" + +DEPENDS = "zlib" +RPROVIDES_${PN} = "ssh sshd" + +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ + file://0001-urandom-xauth-changes-to-options.h.patch \ + file://0003-configure.patch \ + file://0004-fix-2kb-keys.patch \ + file://0007-dropbear-fix-for-x32-abi.patch \ + file://init \ + file://dropbearkey.service \ + file://dropbear@.service \ + file://dropbear.socket \ + ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " + +PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ + file://0006-dropbear-configuration-file.patch \ + file://dropbear" + +inherit autotools update-rc.d systemd + +INITSCRIPT_NAME = "dropbear" +INITSCRIPT_PARAMS = "defaults 10" + +SYSTEMD_SERVICE_${PN} = "dropbear.socket" + +CFLAGS_prepend = " -I. " +LD = "${CC}" + +SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" +BINCOMMANDS = "dbclient ssh scp" +EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' +EXTRA_OECONF += "\ + ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" +CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\"" + +do_install() { + install -d ${D}${sysconfdir} \ + ${D}${sysconfdir}/init.d \ + ${D}${sysconfdir}/default \ + ${D}${sysconfdir}/dropbear \ + ${D}${bindir} \ + ${D}${sbindir} \ + ${D}${localstatedir} + + install -m 0755 dropbearmulti ${D}${sbindir}/ + ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient + + for i in ${SBINCOMMANDS} + do + ln -s ./dropbearmulti ${D}${sbindir}/$i + done + cat ${WORKDIR}/init | sed -e 's,/etc,${sysconfdir},g' \ + -e 's,/usr/sbin,${sbindir},g' \ + -e 's,/var,${localstatedir},g' \ + -e 's,/usr/bin,${bindir},g' \ + -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear + chmod 755 ${D}${sysconfdir}/init.d/dropbear + if [ "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then + install -d ${D}${sysconfdir}/pam.d + install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ + fi + + # deal with systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@BINDIR@,${bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "20" +ALTERNATIVE_${PN} = "scp ssh" + +ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" + +pkg_postrm_append_${PN} () { + if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then + rm ${sysconfdir}/dropbear/dropbear_rsa_host_key + fi + if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then + rm ${sysconfdir}/dropbear/dropbear_dss_host_key + fi +} diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch new file mode 100644 index 0000000000..71a4666b5c --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch @@ -0,0 +1,23 @@ +Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h + +Upstream-Status: Inappropriate [configuration] +--- + options.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/options.h b/options.h +index 7d06322..71a21c2 100644 +--- a/options.h ++++ b/options.h +@@ -247,7 +247,7 @@ much traffic. */ + /* The command to invoke for xauth when using X11 forwarding. + * "-q" for quiet */ + #ifndef XAUTH_COMMAND +-#define XAUTH_COMMAND "/usr/bin/X11/xauth -q" ++#define XAUTH_COMMAND "xauth -q" + #endif + + /* if you want to enable running an sftp server (such as the one included with +-- +1.7.11.7 + diff --git a/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/meta/recipes-core/dropbear/dropbear/0003-configure.patch new file mode 100644 index 0000000000..2baf665ae4 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0003-configure.patch @@ -0,0 +1,40 @@ +From c5f5c5054c1b15539dccf866e2c3faba7ed68456 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Eric=20B=C3=A9nard?= +Date: Thu, 25 Apr 2013 00:27:25 +0200 +Subject: [PATCH 3/6] configure + +--- + configure.ac | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 05461f3..9c16d90 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -166,15 +166,20 @@ AC_ARG_ENABLE(openpty, + AC_MSG_NOTICE(Not using openpty) + else + AC_MSG_NOTICE(Using openpty if available) +- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)]) ++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) + fi + ], + [ + AC_MSG_NOTICE(Using openpty if available) +- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)]) ++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) + ] + ) +- ++ ++if test "x$dropbear_cv_func_have_openpty" = "xyes"; then ++ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function) ++ no_ptc_check=yes ++ no_ptmx_check=yes ++fi + + AC_ARG_ENABLE(syslog, + [ --disable-syslog Don't include syslog support], +-- +1.7.11.7 + diff --git a/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch new file mode 100644 index 0000000000..7539d2034f --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch @@ -0,0 +1,22 @@ +Subject: [PATCH 4/6] fix 2kb keys + +Upstream-Status: Inappropriate [configuration] +--- + kex.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kex.h b/kex.h +index 72430e9..375c677 100644 +--- a/kex.h ++++ b/kex.h +@@ -67,6 +67,6 @@ struct KEXState { + }; + + +-#define MAX_KEXHASHBUF 2000 ++#define MAX_KEXHASHBUF 3000 + + #endif /* _KEX_H_ */ +-- +1.7.11.7 + diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch new file mode 100644 index 0000000000..c408c571e6 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch @@ -0,0 +1,28 @@ +Subject: [PATCH 5/6] dropbear enable pam + +dropbear: We need modify file option.h besides enabling pam in \ +configure if we want dropbear to support pam. + +Upstream-Status: Pending + +Signed-off-by: Xiaofeng Yan +--- + options.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: dropbear-2013.62/options.h +=================================================================== +--- dropbear-2013.62.orig/options.h 2014-01-14 21:53:02.803262009 +0000 ++++ dropbear-2013.62/options.h 2014-01-14 21:53:56.119263462 +0000 +@@ -192,9 +192,9 @@ + * PAM challenge/response. + * You can't enable both PASSWORD and PAM. */ + +-#define ENABLE_SVR_PASSWORD_AUTH ++/*#define ENABLE_SVR_PASSWORD_AUTH*/ + /* PAM requires ./configure --enable-pam */ +-/*#define ENABLE_SVR_PAM_AUTH */ ++#define ENABLE_SVR_PAM_AUTH + #define ENABLE_SVR_PUBKEY_AUTH + + /* Whether to take public key options in diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch new file mode 100644 index 0000000000..fa4c8d0a67 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch @@ -0,0 +1,22 @@ +Subject: [PATCH 6/6] dropbear configuration file + +dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \ +to "/etc/pam.d/dropbear for dropbear when enabling pam supporting" + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Maxin B. John +Signed-off-by: Xiaofeng Yan +--- +diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c +--- dropbear-2013.60-orig/svr-authpam.c 2013-10-16 16:34:53.000000000 +0200 ++++ dropbear-2013.60/svr-authpam.c 2013-10-21 17:04:04.969416055 +0200 +@@ -211,7 +211,7 @@ + userData.passwd = password; + + /* Init pam */ +- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { ++ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { + dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", + rc, pam_strerror(pamHandlep, rc)); + goto cleanup; diff --git a/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch new file mode 100644 index 0000000000..b4501211c3 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch @@ -0,0 +1,140 @@ +Upstream-Status: Pending + +The dropbearkey utility built in x32 abi format, when generating ssh +keys, was getting lost in the infinite loop. + +This patch fixes the issue by fixing types of variables and +parameters of functions used in the code, which were getting +undesired size, when compiled with the x32 abi toolchain. + +2013/05/23 +Received this fix from H J Lu. + +Signed-Off-By: Nitin A Kamble + +# HG changeset patch +# User H.J. Lu +# Date 1369344079 25200 +# Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f +# Parent e76614145aea67f66e4a4257685c771efba21aa1 +Typdef mp_digit to unsigned long long for MP_64BIT + +When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned +long long instead of unsigned long since for x32, unsigned long is +32-bit and unsigned long long is 64-bit and it is safe to use unsigned +long long for 64-bit integer with GCC. + +diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h +--- a/libtommath/tommath.h Thu Apr 18 22:57:47 2013 +0800 ++++ b/libtommath/tommath.h Thu May 23 14:21:19 2013 -0700 +@@ -73,7 +73,7 @@ + typedef signed long long long64; + #endif + +- typedef unsigned long mp_digit; ++ typedef unsigned long long mp_digit; + typedef unsigned long mp_word __attribute__ ((mode(TI))); + + #define DIGIT_BIT 60 +# HG changeset patch +# User H.J. Lu +# Date 1369344241 25200 +# Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536 +# Parent a10a1c46b857cc8a3923c3bb6d1504aa25b6052f +Cast to mp_digit when updating *rho + +There is + +int +mp_montgomery_setup (mp_int * n, mp_digit * rho) + +We should cast to mp_digit instead of unsigned long when updating +*rho since mp_digit may be unsigned long long and unsigned long long +may be different from unsigned long, like in x32. + +diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c +--- a/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:21:19 2013 -0700 ++++ b/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:24:01 2013 -0700 +@@ -48,7 +48,7 @@ + #endif + + /* rho = -1/m mod b */ +- *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; ++ *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + + return MP_OKAY; + } +# HG changeset patch +# User H.J. Lu +# Date 1369344541 25200 +# Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a +# Parent c7555a4cb7ded3a88409ba85f4027baa7af5f536 +Define LTC_FAST_TYPE to unsigned long long for __x86_64__ + +We should define LTC_FAST_TYPE to unsigned long long instead of unsigned +long if __x86_64__ to support x32 where unsigned long long is 64-bit +and unsigned long is 32-bit. + +diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h +--- a/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:24:01 2013 -0700 ++++ b/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:29:01 2013 -0700 +@@ -74,7 +74,7 @@ + #define ENDIAN_LITTLE + #define ENDIAN_64BITWORD + #define LTC_FAST +- #define LTC_FAST_TYPE unsigned long ++ #define LTC_FAST_TYPE unsigned long long + #endif + + /* detect PPC32 */ +# HG changeset patch +# User H.J. Lu +# Date 1369344730 25200 +# Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee +# Parent 7c656e7071a6412688b2f30a529a9afac6c7bf5a +Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC + +We should use unsigned long long instead of unsigned long as unsigned +64-bit integer for x86-64 GCC to support x32 where unsigned long is +32-bit. + +diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h +--- a/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:29:01 2013 -0700 ++++ b/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:32:10 2013 -0700 +@@ -343,7 +343,7 @@ + /* 64-bit Rotates */ + #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) + +-static inline unsigned long ROL64(unsigned long word, int i) ++static inline unsigned long long ROL64(unsigned long long word, int i) + { + asm("rolq %%cl,%0" + :"=r" (word) +@@ -351,7 +351,7 @@ + return word; + } + +-static inline unsigned long ROR64(unsigned long word, int i) ++static inline unsigned long long ROR64(unsigned long long word, int i) + { + asm("rorq %%cl,%0" + :"=r" (word) +@@ -361,7 +361,7 @@ + + #ifndef LTC_NO_ROLC + +-static inline unsigned long ROL64c(unsigned long word, const int i) ++static inline unsigned long long ROL64c(unsigned long long word, const int i) + { + asm("rolq %2,%0" + :"=r" (word) +@@ -369,7 +369,7 @@ + return word; + } + +-static inline unsigned long ROR64c(unsigned long word, const int i) ++static inline unsigned long long ROR64c(unsigned long long word, const int i) + { + asm("rorq %2,%0" + :"=r" (word) + diff --git a/meta/recipes-core/dropbear/dropbear/dropbear b/meta/recipes-core/dropbear/dropbear/dropbear new file mode 100644 index 0000000000..47e787fb10 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/dropbear @@ -0,0 +1,4 @@ +#%PAM-1.0 + +auth include common-auth +account include common-account diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket new file mode 100644 index 0000000000..e5c61b755e --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/dropbear.socket @@ -0,0 +1,10 @@ +[Unit] +Conflicts=dropbear.service + +[Socket] +ListenStream=22 +Accept=yes + +[Install] +WantedBy=sockets.target +Also=dropbearkey.service diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service new file mode 100644 index 0000000000..6fe9942090 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/dropbear@.service @@ -0,0 +1,11 @@ +[Unit] +Description=SSH Per-Connection Server +Wants=dropbearkey.service +After=syslog.target dropbearkey.service + +[Service] +EnvironmentFile=-/etc/default/dropbear +ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID +StandardInput=socket +KillMode=process diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service new file mode 100644 index 0000000000..ccc21d5cca --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service @@ -0,0 +1,8 @@ +[Unit] +Description=SSH Key Generation +ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key + +[Service] +Type=oneshot +ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key +RemainAfterExit=yes diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init new file mode 100755 index 0000000000..e8fed3f94d --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/init @@ -0,0 +1,113 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: sshd +# Required-Start: $remote_fs $syslog $networking +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Dropbear Secure Shell server +### END INIT INFO +# +# Do not configure this file. Edit /etc/default/dropbear instead! +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/dropbear +NAME=dropbear +DESC="Dropbear SSH server" +PIDFILE=/var/run/dropbear.pid + +DROPBEAR_PORT=22 +DROPBEAR_EXTRA_ARGS= +NO_START=0 + +set -e + +test ! -r /etc/default/dropbear || . /etc/default/dropbear +test "$NO_START" = "0" || exit 0 +test -x "$DAEMON" || exit 0 +test ! -h /var/service/dropbear || exit 0 + +readonly_rootfs=0 +for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' &2 + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/dropbear/dropbear/run-ptest b/meta/recipes-core/dropbear/dropbear/run-ptest new file mode 100644 index 0000000000..61f1e0c0dd --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +cd libtomcrypt; ./test 2>&1 | sed 's/NOPPASS/SKIP/' diff --git a/meta/recipes-core/dropbear/dropbear_2014.63.bb b/meta/recipes-core/dropbear/dropbear_2014.63.bb new file mode 100644 index 0000000000..bb7e6178bc --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear_2014.63.bb @@ -0,0 +1,4 @@ +require dropbear.inc + +SRC_URI[md5sum] = "7066bb9a2da708f3ed06314fdc9c47fd" +SRC_URI[sha256sum] = "595992de432ba586a0e7e191bbb1ad587727678bb3e345b018c395b8c55b57ae" diff --git a/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb new file mode 100644 index 0000000000..3ce0e1d394 --- /dev/null +++ b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb @@ -0,0 +1,49 @@ +SUMMARY = "Cross locale generation tool for eglibc" +HOMEPAGE = "http://www.eglibc.org/home" +SECTION = "libs" +LICENSE = "LGPL-2.1" + +LIC_DIR = "${WORKDIR}/eglibc-${PV}/libc" +LIC_FILES_CHKSUM = "file://${LIC_DIR}/LICENSES;md5=e9a558e243b36d3209f380deb394b213 \ + file://${LIC_DIR}/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://${LIC_DIR}/posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://${LIC_DIR}/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + + +inherit native +inherit autotools + +# pick up an eglibc patch +FILESPATH = "${FILE_DIRNAME}/eglibc-${PV}" + +SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \ + file://fix_for_centos_5.8.patch;patchdir=.. \ + " +SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd" +SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c" + +S = "${WORKDIR}/eglibc-${PV}/localedef" + +do_unpack_append() { + bb.build.exec_func('do_move_ports', d) +} + +do_move_ports() { + if test -d ${WORKDIR}/eglibc-${PV}/ports ; then + rm -rf ${WORKDIR}/libc/ports + mv ${WORKDIR}/eglibc-${PV}/ports ${WORKDIR}/libc/ + fi +} + +EXTRA_OECONF = "--with-glibc=${WORKDIR}/eglibc-${PV}/libc" +CFLAGS += "-DNOT_IN_libc=1" + +do_configure () { + ${S}/configure ${EXTRA_OECONF} +} + + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef +} diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch new file mode 100644 index 0000000000..b4489e9ae9 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch @@ -0,0 +1,56 @@ + +Quote from bug 1443 which explains what the patch does : + + We build some random program and link it with -lust. When we run it, + it dies with a SIGSEGV before reaching main(). + + Libust.so depends on liburcu-bp.so from the usermode-rcu package. + Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this + is critical. + + Libust.so uses a TLS / __thread variable that is defined in liburcu- + bp.so. There are special ARM-specific relocation types that allow two + shared libraries to share thread-specific data. This is critical too. + + One more critical issue: although liburcu-bp.so is prelinked, we can't + load it at its prelinked address, because we also link against + librt.so, and librt.so uses that address. + + The dynamic linker is forced to relink liburcu-bp.so at a different + address. In the course of relinking, it processes the special ARM + relocation record mentioned above. The prelinker has already filled + in the information, which is a short offset into a table of thread- + specific data that is allocated per-thread for each library that uses + TLS. Because the normal behavior of a relocation is to add the symbol + value to an addend stored at the address being relocated, we end up + adding the short offset to itself, doubling it. + + Now we have an awkward situation. The libust.so library doesn't know + about the addend, so its TLS data for this element is correct. The + liburcu-bp.so library has a different offset for the element. When we + go to initialize the element for the first time in liburcu-bp.so, we + write the address of the result at the doubled (broken) offset. + Later, when we refer to the address from libust.so, we check the value + at the correct offset, but it's NULL, so we eat hot SIGSEGV. + +Upstream-Status: Pending + +Signed-off-by: Andrei Dinu +--- + .../libc/ports/sysdeps/arm/dl-machine.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +ndex 8d905e8..dcfa71e 100644 +--- libc.orig/ports/sysdeps/arm/dl-machine.h ++++ libc/ports/sysdeps/arm/dl-machine.h +@@ -503,7 +503,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, + + case R_ARM_TLS_DTPOFF32: + if (sym != NULL) +- *reloc_addr += sym->st_value; ++ *reloc_addr = sym->st_value; + break; + + case R_ARM_TLS_TPOFF32: +-- + diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch new file mode 100644 index 0000000000..4559a110fb --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch @@ -0,0 +1,912 @@ +Pulled from +http://www.eglibc.org/archives/patches/msg01042.html + +Upstream-Status: Pending +Signed-off-by: Khem + +Hi, + +This patch adds 'make menuconfig' support to EGLIBC. + + +EGLIBC can re-use the Linux kernel kconfig host tools ('conf' and 'mconf') unmodified, by passing appropriate environment variables and with some pre- and post-processing on the input/output config files. + +There are three new make targets supported, which all are defined in the new libc/options-config/Makefile, which is included by the top-level libc/Makefile: + +- 'make defconfig'. This passes 'libc/option-groups.defaults' to 'conf' as a default config, and outputs 'option-groups.config' to the top-level build directory, which will be the same as the default config. + +- 'make config'. This is the same line-oriented interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory. + +- 'make menuconfig'. This is the same menu-based interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory. + + +Pre-Processing: + + +The Linux kernel kconfig tools expect a prefix of "CONFIG_" on all config option names, but EGLIBC expects a prefix of "OPTION_". The pre-processing script, libc/options-config/config-preproc.pl, simply replaces "CONFIG_ with "OPTION_" in the given config file. The libc/options-config/Makefile passes the script output to a temporary config file, which is then passed to 'conf' or 'mconf'. + +Post-Processing (libc/options-config/config-postproc.pl): + + +- Disabled options are output as a comment line of the form "# CONFIG_FOO is not set". This needs to be changed to an explicit "CONFIG_FOO=n" in order to be compatible with 'option-groups.awk' which generates the option-groups.h header. + +- "CONFIG_" prefix is changed back to "OPTION_". + + +- The kconfig tools will not output anything for options that depend on a parent option, when the parent option is disabled. This implicit disable must be converted to an explicit "CONFIG_FOO=n" in order to be compatible with the way EGLIBC overrides the default option settings in 'libc/option-groups.defaults' with those in 'option-groups.config'. + + +A new configure option, '--with-kconfig=', tells EGLIBC where to find the pre-built 'conf' and 'mconf' host tools from Linux kernel builds. + +libc/EGLIBC.cross-building is updated to include instructions for using '--with-kconfig' for the final EGLIBC build, and shows how and when to run 'make *config'. + +libc/EGLIBC.option-groups is updated to include new information on the menuconfig support. + +Thanks, + +attached is the updated patch to address above issues. + +Steve + +-- +Steve Longerbeam | Senior Embedded Engineer, ESD Services +Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 +P 510.354.5838 | M 408.410.2735 +Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS + + +Index: libc/EGLIBC.cross-building +=================================================================== +--- libc.orig/EGLIBC.cross-building ++++ libc/EGLIBC.cross-building +@@ -243,9 +243,29 @@ full EGLIBC build: + > $src/libc/configure \ + > --prefix=/usr \ + > --with-headers=$sysroot/usr/include \ ++ > --with-kconfig=$obj/linux/scripts/kconfig \ + > --build=$build \ + > --host=$target \ + > --disable-profile --without-gd --without-cvs --enable-add-ons ++ ++Note the additional '--with-kconfig' option. This tells EGLIBC where to ++find the host config tools used by the kernel 'make config' and 'make ++menuconfig'. These tools can be re-used by EGLIBC for its own 'make ++*config' support, which will create 'option-groups.config' for you. ++But first make sure those tools have been built by running some ++dummy 'make *config' calls in the kernel directory: ++ ++ $ cd $obj/linux ++ $ PATH=$tools/bin:$PATH make config \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ $ PATH=$tools/bin:$PATH make menuconfig \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ ++Now we can configure and build the full EGLIBC: ++ ++ $ cd $obj/eglibc ++ $ PATH=$tools/bin:$PATH make defconfig ++ $ PATH=$tools/bin:$PATH make menuconfig + $ PATH=$tools/bin:$PATH make + $ PATH=$tools/bin:$PATH make install install_root=$sysroot + +Index: libc/configure.ac +=================================================================== +--- libc.orig/configure.ac ++++ libc/configure.ac +@@ -127,6 +127,16 @@ AC_ARG_WITH([headers], + [sysheaders='']) + AC_SUBST(sysheaders) + ++AC_ARG_WITH([kconfig], ++ AC_HELP_STRING([--with-kconfig=PATH], ++ [location of kconfig tools to use (from Linux ++ kernel builds) to re-use for configuring EGLIBC ++ option groups]), ++ [KCONFIG_TOOLS=$withval], ++ [KCONFIG_TOOLS='']) ++AC_SUBST(KCONFIG_TOOLS) ++ ++ + AC_SUBST(use_default_link) + AC_ARG_WITH([default-link], + AC_HELP_STRING([--with-default-link], +Index: libc/config.make.in +=================================================================== +--- libc.orig/config.make.in ++++ libc/config.make.in +@@ -45,6 +45,8 @@ sysincludes = @SYSINCLUDES@ + c++-sysincludes = @CXX_SYSINCLUDES@ + all-warnings = @all_warnings@ + ++kconfig_tools = @KCONFIG_TOOLS@ ++ + have-z-combreloc = @libc_cv_z_combreloc@ + have-z-execstack = @libc_cv_z_execstack@ + have-Bgroup = @libc_cv_Bgroup@ +Index: libc/options-config/config-postproc.pl +=================================================================== +--- /dev/null ++++ libc/options-config/config-postproc.pl +@@ -0,0 +1,54 @@ ++#!/usr/bin/perl ++ ++$usage = "usage: $0 \n"; ++ ++die "$usage" unless @ARGV; ++$defaults = shift @ARGV; ++die "$usage" unless @ARGV; ++die "Could not open $ARGV[0]" unless -T $ARGV[0]; ++ ++sub yank { ++ @option = grep($_ ne $_[0], @option); ++} ++ ++open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; ++ ++# get the full list of available options using the default config file ++$i = 0; ++while () { ++ if (/^\s*OPTION_(\w+)\s*=/) { ++ $option[$i++] = $1; ++ } ++} ++ ++# now go through the config file, making the necessary changes ++while (<>) { ++ if (/Linux Kernel Configuration/) { ++ # change title ++ s/Linux Kernel/Option Groups/; ++ print; ++ } elsif (/^\s*CONFIG_(\w+)\s*=/) { ++ # this is an explicit option set line, change CONFIG_ to OPTION_ ++ # before printing and remove this option from option list ++ $opt = $1; ++ yank($opt); ++ s/CONFIG_/OPTION_/g; ++ print; ++ } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { ++ # this is a comment line, change CONFIG_ to OPTION_, remove this ++ # option from option list, and convert to explicit OPTION_FOO=n ++ $opt = $1; ++ yank($opt); ++ s/CONFIG_/OPTION_/g; ++ print "OPTION_$opt=n\n"; ++ } else { ++ print; ++ } ++} ++ ++# any options left in @options, are options that were not mentioned in ++# the config file, and implicitly that means the option must be set =n, ++# so do that here. ++foreach $opt (@option) { ++ print "OPTION_$opt=n\n"; ++} +Index: libc/options-config/config-preproc.pl +=================================================================== +--- /dev/null ++++ libc/options-config/config-preproc.pl +@@ -0,0 +1,8 @@ ++#!/usr/bin/perl ++ ++if (@ARGV) { ++ while (<>) { ++ s/OPTION_/CONFIG_/g; ++ print; ++ } ++} +Index: libc/options-config/Makefile +=================================================================== +--- /dev/null ++++ libc/options-config/Makefile +@@ -0,0 +1,55 @@ ++# =========================================================================== ++# EGLIBC option-groups configuration targets ++# These targets are included from top-level makefile ++ ++ifneq ($(kconfig_tools),) ++ifneq (no,$(PERL)) ++ ++ocdir := options-config ++ ++OconfigDefaults := option-groups.defaults ++OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig ++OconfigDef := option-groups.def ++Oconfig := $(common-objpfx)option-groups.config ++Oconfig_tmp := $(common-objpfx).tmp.config ++ ++conf := $(kconfig_tools)/conf ++mconf := $(kconfig_tools)/mconf ++ ++preproc := $(PERL) $(ocdir)/config-preproc.pl ++postproc := $(PERL) $(ocdir)/config-postproc.pl ++ ++PHONY += defconfig config menuconfig ++ ++defconfig: $(conf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(OconfigDefaults_tmp) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \ ++ $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ rm $(OconfigDefaults_tmp) ++ ++config: $(conf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ ++menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ ++# Help text used by make help ++help: ++ @echo ' defconfig - New config with default from default config' ++ @echo ' config - Update current config utilising a line-oriented program' ++ @echo ' menuconfig - Update current config utilising a menu based program' ++ ++endif ++endif +Index: libc/option-groups.def +=================================================================== +--- libc.orig/option-groups.def ++++ libc/option-groups.def +@@ -4,19 +4,19 @@ + # + # An entry of the form: + # +-# config OPTION_GROUP_NAME ++# config GROUP_NAME + # bool "one-line explanation of what this option group controls" + # help + # Multi-line help explaining the option group's meaning in + # some detail, terminated by indentation level. + # +-# defines an option group whose variable is OPTION_GROUP_NAME, with ++# defines an option group whose variable is GROUP_NAME, with + # meaningful values 'y' (enabled) and 'n' (disabled). The + # documentation is formatted to be consumed by some sort of + # interactive configuration interface, but EGLIBC doesn't have such an + # interface yet. + # +-# An option may have a 'depends' line, indicating which other options ++# An option may have a 'depends on' line, indicating which other options + # must also be enabled if this option is. At present, EGLIBC doesn't + # check that these dependencies are satisfied. + # +@@ -41,9 +41,9 @@ + # although this simply reestablishes the value already set by + # 'option-groups.defaults'. + +-config OPTION_EGLIBC_ADVANCED_INET6 ++config EGLIBC_ADVANCED_INET6 + bool "IPv6 Advanced Sockets API support (RFC3542)" +- depends OPTION_EGLIBC_INET ++ depends on EGLIBC_INET + help + This option group includes the functions specified by RFC 3542, + "Advanced Sockets Application Program Interface (API) for +@@ -71,7 +71,7 @@ config OPTION_EGLIBC_ADVANCED_INET6 + inet6_rth_segments + inet6_rth_space + +-config OPTION_EGLIBC_BACKTRACE ++config EGLIBC_BACKTRACE + bool "Functions for producing backtraces" + help + This option group includes functions for producing a list of +@@ -85,7 +85,7 @@ config OPTION_EGLIBC_BACKTRACE + backtrace_symbols + backtrace_symbols_fd + +-config OPTION_EGLIBC_BIG_MACROS ++config EGLIBC_BIG_MACROS + bool "Use extensive inline code" + help + This option group specifies whether certain pieces of code +@@ -93,7 +93,7 @@ config OPTION_EGLIBC_BIG_MACROS + group is not selected, function calls will be used instead, + hence reducing the library footprint. + +-config OPTION_EGLIBC_BSD ++config EGLIBC_BSD + bool "BSD-specific functions, and their compatibility stubs" + help + This option group includes functions specific to BSD kernels. +@@ -109,10 +109,9 @@ config OPTION_EGLIBC_BSD + revoke + setlogin + +-config OPTION_EGLIBC_CXX_TESTS ++config EGLIBC_CXX_TESTS + bool "Tests that link against the standard C++ library." +- depends OPTION_POSIX_WIDE_CHAR_DEVICE_IO +- depends OPTION_EGLIBC_LIBM ++ depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM + help + This option group does not include any C library functions; + instead, it controls which EGLIBC tests an ordinary 'make +@@ -121,23 +120,22 @@ config OPTION_EGLIBC_CXX_TESTS + run. + + The standard C++ library depends on the math library 'libm' and +- the wide character I/O functions included in EGLIBC. If those +- option groups are disabled, this test must also be disabled. ++ the wide character I/O functions included in EGLIBC. So those ++ option groups must be enabled if this test is enabled. + +-config OPTION_EGLIBC_CATGETS ++config EGLIBC_CATGETS + bool "Functions for accessing message catalogs" +- depends OPTION_EGLIBC_LOCALE_CODE ++ depends on EGLIBC_LOCALE_CODE + help + This option group includes functions for accessing message + catalogs: catopen, catclose, and catgets. + +- This option group depends on the OPTION_EGLIBC_LOCALE_CODE +- option group; if you disable that, you must also disable this. ++ This option group depends on the EGLIBC_LOCALE_CODE ++ option group. + +-config OPTION_EGLIBC_CHARSETS ++config EGLIBC_CHARSETS + bool "iconv/gconv character set conversion libraries" + help +- + This option group includes support for character sets other + than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their + various encodings. This affects both the character sets +@@ -198,16 +196,16 @@ config OPTION_EGLIBC_CHARSETS + WCHAR_T - EGLIBC's internal form (target-endian, + 32-bit ISO 10646) + +-config OPTION_EGLIBC_CRYPT ++config EGLIBC_CRYPT + bool "Encryption library" + help + This option group includes the `libcrypt' library which + provides functions for one-way encryption. Supported + encryption algorithms include MD5, SHA-256, SHA-512 and DES. + +-config OPTION_EGLIBC_CRYPT_UFC ++config EGLIBC_CRYPT_UFC + bool "Ultra fast `crypt' implementation" +- depends OPTION_EGLIBC_CRYPT ++ depends on EGLIBC_CRYPT + help + This option group provides ultra fast DES-based implementation of + the `crypt' function. When this option group is disabled, +@@ -216,7 +214,7 @@ config OPTION_EGLIBC_CRYPT_UFC + errno to ENOSYS if /salt/ passed does not correspond to either MD5, + SHA-256 or SHA-512 algorithm. + +-config OPTION_EGLIBC_DB_ALIASES ++config EGLIBC_DB_ALIASES + bool "Functions for accessing the mail aliases database" + help + This option group includues functions for looking up mail +@@ -233,7 +231,7 @@ config OPTION_EGLIBC_DB_ALIASES + When this option group is disabled, the NSS service libraries + also lack support for querying their mail alias tables. + +-config OPTION_EGLIBC_ENVZ ++config EGLIBC_ENVZ + bool "Functions for handling envz-style environment vectors." + help + This option group contains functions for creating and operating +@@ -248,7 +246,7 @@ config OPTION_EGLIBC_ENVZ + envz_entry envz_remove + envz_get envz_strip + +-config OPTION_EGLIBC_FCVT ++config EGLIBC_FCVT + bool "Functions for converting floating-point numbers to strings" + help + This option group includes functions for converting +@@ -262,14 +260,14 @@ config OPTION_EGLIBC_FCVT + fcvt_r qfcvt_r + gcvt qgcvt + +-config OPTION_EGLIBC_FMTMSG ++config EGLIBC_FMTMSG + bool "Functions for formatting messages" + help + This option group includes the following functions: + + addseverity fmtmsg + +-config OPTION_EGLIBC_FSTAB ++config EGLIBC_FSTAB + bool "Access functions for 'fstab'" + help + This option group includes functions for reading the mount +@@ -283,7 +281,7 @@ config OPTION_EGLIBC_FSTAB + getfsent setfsent + getfsfile + +-config OPTION_EGLIBC_FTRAVERSE ++config EGLIBC_FTRAVERSE + bool "Functions for traversing file hierarchies" + help + This option group includes functions for traversing file +@@ -297,9 +295,9 @@ config OPTION_EGLIBC_FTRAVERSE + fts_set nftw64 + fts_close + +-config OPTION_EGLIBC_GETLOGIN ++config EGLIBC_GETLOGIN + bool "The getlogin function" +- depends OPTION_EGLIBC_UTMP ++ depends on EGLIBC_UTMP + help + This function group includes the 'getlogin' and 'getlogin_r' + functions, which return the user name associated by the login +@@ -309,17 +307,17 @@ config OPTION_EGLIBC_GETLOGIN + fall back on 'getlogin' to find the user's login name for tilde + expansion when the 'HOME' environment variable is not set. + +-config OPTION_EGLIBC_IDN ++config EGLIBC_IDN + bool "International domain names support" + help + This option group includes the `libcidn' library which + provides support for international domain names. + +-config OPTION_EGLIBC_INET ++config EGLIBC_INET + bool "Networking support" + help + This option group includes networking-specific functions and +- data. With OPTION_EGLIBC_INET disabled, the EGLIBC ++ data. With EGLIBC_INET disabled, the EGLIBC + installation and API changes as follows: + + - The following libraries are not installed: +@@ -439,14 +437,14 @@ config OPTION_EGLIBC_INET + use Unix-domain sockets to communicate with the syslog daemon; + syslog is valuable in non-networked contexts. + +-config OPTION_EGLIBC_INET_ANL ++config EGLIBC_INET_ANL + bool "Asynchronous name lookup" +- depends OPTION_EGLIBC_INET ++ depends on EGLIBC_INET + help + This option group includes the `libanl' library which + provides support for asynchronous name lookup. + +-config OPTION_EGLIBC_LIBM ++config EGLIBC_LIBM + bool "libm (math library)" + help + This option group includes the 'libm' library, containing +@@ -464,7 +462,7 @@ config OPTION_EGLIBC_LIBM + group, you will not be able to build 'libstdc++' against the + resulting EGLIBC installation. + +-config OPTION_EGLIBC_LOCALES ++config EGLIBC_LOCALES + bool "Locale definitions" + help + This option group includes all locale definitions other than +@@ -472,17 +470,17 @@ config OPTION_EGLIBC_LOCALES + only the "C" locale is supported. + + +-config OPTION_EGLIBC_LOCALE_CODE ++config EGLIBC_LOCALE_CODE + bool "Locale functions" +- depends OPTION_POSIX_C_LANG_WIDE_CHAR ++ depends on POSIX_C_LANG_WIDE_CHAR + help + This option group includes locale support functions, programs, +- and libraries. With OPTION_EGLIBC_LOCALE_FUNCTIONS disabled, ++ and libraries. With EGLIBC_LOCALE_CODE disabled, + EGLIBC supports only the 'C' locale (also known as 'POSIX'), + and ignores the settings of the 'LANG' and 'LC_*' environment + variables. + +- With OPTION_EGLIBC_LOCALE_CODE disabled, the following ++ With EGLIBC_LOCALE_CODE disabled, the following + functions are omitted from libc: + + duplocale localeconv nl_langinfo rpmatch strfmon_l +@@ -491,46 +489,43 @@ config OPTION_EGLIBC_LOCALE_CODE + Furthermore, only the LC_CTYPE and LC_TIME categories of the + standard "C" locale are available. + +- The OPTION_EGLIBC_CATGETS option group depends on this option +- group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also +- disable OPTION_EGLIBC_CATGETS. ++ The EGLIBC_CATGETS option group depends on this option group. ++ + +-config OPTION_EGLIBC_MEMUSAGE ++config EGLIBC_MEMUSAGE + bool "Memory profiling library" + help + This option group includes the `libmemusage' library and + the `memusage' and `memusagestat' utilities. + These components provide memory profiling functions. + +- OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++ EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE + + Libmemusage library buffers the profiling data in memory + before writing it out to disk. By default, the library + allocates 1.5M buffer, which can be substantial for some +- systems. OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option ++ systems. EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option + allows to change the default buffer size. It specifies + the number of entries the buffer should have. + On most architectures one buffer entry amounts to 48 bytes, + so setting this option to the value of 512 will reduce the size of + the memory buffer to 24K. + +-config OPTION_EGLIBC_NIS ++config EGLIBC_NIS + bool "Support for NIS, NIS+, and the special 'compat' services." +- depends OPTION_EGLIBC_INET +- depends OPTION_EGLIBC_SUNRPC ++ depends on EGLIBC_INET && EGLIBC_SUNRPC + help + This option group includes the NIS, NIS+, and 'compat' Name + Service Switch service libraries. When it is disabled, those + services libraries are not installed; you should remove any + references to them from your 'nsswitch.conf' file. + +- This option group depends on the OPTION_EGLIBC_INET option ++ This option group depends on the EGLIBC_INET option + group; you must enable that to enable this option group. + +-config OPTION_EGLIBC_NSSWITCH ++config EGLIBC_NSSWITCH + bool "Name service switch (nsswitch) support" + help +- + This option group includes support for the 'nsswitch' facility. + With this option group enabled, all EGLIBC functions for + accessing various system databases (passwords and groups; +@@ -544,12 +539,12 @@ config OPTION_EGLIBC_NSSWITCH + 'option-groups.config' file must set the following two + variables: + +- OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG ++ EGLIBC_NSSWITCH_FIXED_CONFIG + + Set this to the name of a file whose contents observe the + same syntax as an ordinary '/etc/nsswitch.conf' file. The + EGLIBC build process parses this file just as EGLIBC would +- at run time if OPTION_EGLIBC_NSSWITCH were enabled, and ++ at run time if EGLIBC_NSSWITCH were enabled, and + produces a C library that uses the nsswitch service + libraries to search for database entries as this file + specifies, instead of consulting '/etc/nsswitch.conf' at run +@@ -567,7 +562,7 @@ config OPTION_EGLIBC_NSSWITCH + you will probably want to delete references to databases not + needed on your system. + +- OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS ++ EGLIBC_NSSWITCH_FIXED_FUNCTIONS + + The EGLIBC build process uses this file to decide which + functions to make available from which service libraries. +@@ -585,28 +580,28 @@ config OPTION_EGLIBC_NSSWITCH + Be sure to mention each function in each service you wish to + use. If you do not mention a service's function here, the + EGLIBC database access functions will not find it, even if +- it is listed in the OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG ++ it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG + file. + +- In this arrangement, EGLIBC will not use the 'dlopen' and +- 'dlsym' functions to find database access functions. Instead, +- libc hard-codes references to the service libraries' database +- access functions. You must explicitly link your program +- against the name service libraries (those whose names start +- with 'libnss_', in the sysroot's '/lib' directory) whose +- functions you intend to use. This arrangement helps +- system-wide static analysis tools decide which functions a +- system actually uses. +- +- Note that some nsswitch service libraries require other option +- groups to be enabled; for example, the OPTION_EGLIBC_INET +- option group must be enabled to use the 'libnss_dns.so.2' +- service library, which uses the Domain Name System network +- protocol to answer queries. ++ In this arrangement, EGLIBC will not use the 'dlopen' and ++ 'dlsym' functions to find database access functions. Instead, ++ libc hard-codes references to the service libraries' database ++ access functions. You must explicitly link your program ++ against the name service libraries (those whose names start ++ with 'libnss_', in the sysroot's '/lib' directory) whose ++ functions you intend to use. This arrangement helps ++ system-wide static analysis tools decide which functions a ++ system actually uses. ++ ++ Note that some nsswitch service libraries require other option ++ groups to be enabled; for example, the EGLIBC_INET ++ option group must be enabled to use the 'libnss_dns.so.2' ++ service library, which uses the Domain Name System network ++ protocol to answer queries. + +-config OPTION_EGLIBC_RCMD ++config EGLIBC_RCMD + bool "Support for 'rcmd' and related library functions" +- depends OPTION_EGLIBC_INET ++ depends on EGLIBC_INET + help + This option group includes functions for running commands on + remote machines via the 'rsh' protocol, and doing authentication +@@ -622,7 +617,7 @@ config OPTION_EGLIBC_RCMD + rresvport ruserpass + rresvport_af + +-config OPTION_EGLIBC_RTLD_DEBUG ++config EGLIBC_RTLD_DEBUG + bool "Runtime linker debug print outs" + help + This option group enables debug output of the runtime linker +@@ -633,7 +628,7 @@ config OPTION_EGLIBC_RTLD_DEBUG + the `ldd' utility which may also be used by the prelinker. + In particular, the `--unused' ldd option will not work correctly. + +-config OPTION_EGLIBC_SPAWN ++config EGLIBC_SPAWN + bool "Support for POSIX posix_spawn functions" + help + This option group includes the POSIX functions for executing +@@ -669,7 +664,7 @@ config OPTION_EGLIBC_SPAWN + disabled, those programs will only operate on uncompressed + charmap files. + +-config OPTION_EGLIBC_STREAMS ++config EGLIBC_STREAMS + bool "Support for accessing STREAMS." + help + This option group includes functions for reading and writing +@@ -685,14 +680,14 @@ config OPTION_EGLIBC_STREAMS + isastream fdetach + putmsg + +-config OPTION_EGLIBC_SUNRPC ++config EGLIBC_SUNRPC + bool "Support for the Sun 'RPC' protocol." +- depends OPTION_EGLIBC_INET ++ depends on EGLIBC_INET + help + This option group includes support for the Sun RPC protocols, + including the 'rpcgen' and 'rpcinfo' programs. + +-config OPTION_EGLIBC_UTMP ++config EGLIBC_UTMP + bool "Older access functions for 'utmp' login records" + help + This option group includes the older 'utent' family of +@@ -719,9 +714,9 @@ config OPTION_EGLIBC_UTMP + + libutil.so (and libutil.a) + +-config OPTION_EGLIBC_UTMPX ++config EGLIBC_UTMPX + bool "POSIX access functions for 'utmp' login records" +- depends OPTION_EGLIBC_UTMP ++ depends on EGLIBC_UTMP + help + This option group includes the POSIX functions for reading and + writing user login records in the 'utmp' file (usually +@@ -742,21 +737,21 @@ config OPTION_EGLIBC_UTMPX + updwtmpx + utmpxname + +-config OPTION_EGLIBC_WORDEXP ++config EGLIBC_WORDEXP + bool "Shell-style word expansion" + help + This option group includes the 'wordexp' function for + performing word expansion in the manner of the shell, and the + accompanying 'wordfree' function. + +-config OPTION_POSIX_C_LANG_WIDE_CHAR ++config POSIX_C_LANG_WIDE_CHAR + bool "ISO C library wide character functions, excluding I/O" + help + This option group includes the functions defined by the ISO C + standard for working with wide and multibyte characters in + memory. Functions for reading and writing wide and multibyte + characters from and to files call in the +- OPTION_POSIX_WIDE_CHAR_DEVICE_IO option group. ++ POSIX_WIDE_CHAR_DEVICE_IO option group. + + This option group includes the following functions: + +@@ -778,14 +773,14 @@ config OPTION_POSIX_C_LANG_WIDE_CHAR + mbrlen wcscoll wcstol + mbrtowc wcscpy wcstold + +-config OPTION_POSIX_REGEXP ++config POSIX_REGEXP + bool "Regular expressions" + help + This option group includes the POSIX regular expression + functions, and the associated non-POSIX extensions and + compatibility functions. + +- With OPTION_POSIX_REGEXP disabled, the following functions are ++ With POSIX_REGEXP disabled, the following functions are + omitted from libc: + + re_comp re_max_failures regcomp +@@ -799,9 +794,9 @@ config OPTION_POSIX_REGEXP + header file, 'compile', 'step', and 'advance', is + omitted. + +-config OPTION_POSIX_REGEXP_GLIBC ++config POSIX_REGEXP_GLIBC + bool "Regular expressions from GLIBC" +- depends OPTION_POSIX_REGEXP ++ depends on POSIX_REGEXP + help + This option group specifies which regular expression + library to use. The choice is between regex +@@ -810,9 +805,9 @@ config OPTION_POSIX_REGEXP_GLIBC + optimized for speed; regex from libiberty is more than twice + as small while still is enough for most practical purposes. + +-config OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++config POSIX_WIDE_CHAR_DEVICE_IO + bool "Input and output functions for wide characters" +- depends OPTION_POSIX_C_LANG_WIDE_CHAR ++ depends on POSIX_C_LANG_WIDE_CHAR + help + This option group includes functions for reading and writing + wide characters to and from streams. +Index: libc/Makefile +=================================================================== +--- libc.orig/Makefile ++++ libc/Makefile +@@ -24,6 +24,7 @@ endif + + include Makeconfig + ++include options-config/Makefile + + # This is the default target; it makes everything except the tests. + .PHONY: all +Index: libc/configure +=================================================================== +--- libc.orig/configure ++++ libc/configure +@@ -621,6 +621,7 @@ KSH + libc_cv_have_bash2 + BASH_SHELL + libc_cv_gcc_static_libgcc ++KCONFIG_TOOLS + CXX_SYSINCLUDES + SYSINCLUDES + AUTOCONF +@@ -734,6 +735,7 @@ with_fp + with_binutils + with_selinux + with_headers ++with_kconfig + with_default_link + enable_sanity_checks + enable_shared +@@ -1438,6 +1440,9 @@ Optional Packages: + --with-selinux if building with SELinux support + --with-headers=PATH location of system headers to use (for example + /usr/src/linux/include) [default=compiler default] ++ --with-kconfig=PATH location of kconfig tools to use (from Linux kernel ++ builds) to re-use for configuring EGLIBC option ++ groups + --with-default-link do not use explicit linker scripts + --with-cpu=CPU select code for CPU variant + +@@ -3401,6 +3406,14 @@ fi + + + ++# Check whether --with-kconfig was given. ++if test "${with_kconfig+set}" = set; then ++ withval=$with_kconfig; KCONFIG_TOOLS=$withval ++else ++ KCONFIG_TOOLS='' ++fi ++ ++ + + # Check whether --with-default-link was given. + if test "${with_default_link+set}" = set; then : +Index: libc/EGLIBC.option-groups +=================================================================== +--- libc.orig/EGLIBC.option-groups ++++ libc/EGLIBC.option-groups +@@ -56,33 +56,9 @@ disable option groups one by one, until + + The Option Groups + +-EGLIBC currently implements the following option groups, also +-documented in the file 'option-groups.def': +- +-OPTION_EGLIBC_CATGETS +- This option group includes functions for accessing message +- catalogs: catopen, catclose, and catgets. +- +-OPTION_EGLIBC_LOCALES +- This option group includes all locale definitions other than +- those for the "C" locale. If this option group is omitted, then +- only the "C" locale is supported. +- +-OPTION_EGLIBC_LIBM +- This option group includes the 'libm' library, containing +- mathematical functions. If this option group is omitted, then +- an EGLIBC installation does not include shared or unshared versions +- of the math library. +- +- Note that this does not remove all floating-point related +- functionality from EGLIBC; for example, 'printf' and 'scanf' +- can still print and read floating-point values with this option +- group disabled. +- +- Note that the ISO Standard C++ library 'libstdc++' depends on +- EGLIBC's math library 'libm'. If you disable this option +- group, you will not be able to build 'libstdc++' against the +- resulting EGLIBC installation. ++To see the current full list of implemented option groups, refer to the ++file 'option-groups.def' at the top of the source tree, or run ++'make menuconfig' from the top-level build directory. + + The POSIX.1-2001 specification includes a suggested partition of all + the functions in the POSIX C API into option groups: math functions +@@ -110,6 +86,18 @@ data, but include mathematical functions + OPTION_EGLIBC_LOCALES = n + OPTION_EGLIBC_LIBM = y + ++Like the Linux kernel, EGLIBC supports a similar set of '*config' make ++targets to make it easier to create 'option-groups.config', with all ++dependencies between option groups automatically satisfied. Run ++'make help' to see the list of supported make config targets. For ++example, 'make menuconfig' will update the current config utilising a ++menu based program. ++ ++The option group names and their type (boolean, int, hex, string), help ++description, and dependencies with other option groups, are described by ++'option-groups.def' at the top of the source tree, analogous to the ++'Kconfig' files in the Linux kernel. ++ + In general, each option group variable controls whether a given set of + object files in EGLIBC is compiled and included in the final + libraries, or omitted from the build. +@@ -132,22 +120,3 @@ under development. + + We have used the system to subset some portions of EGLIBC's + functionality. It needs to be extended to cover more of the library. +- +-At the moment, EGLIBC performs no sanity checks on the contents of +-'option-groups.config'; if an option group's name is mistyped, the +-option group is silently included in the build. EGLIBC should check +-that all variables set in 'option-groups.config' are proper option +-group names, and that their values are appropriate. +- +-Some portions of EGLIBC depend on others; for example, the Sun Remote +-Procedure Call functions in 'sunrpc' depend on the networking +-functions in 'inet'. The sanity checking described above should check +-that the selection configuration satisfies dependencies within EGLIBC, +-and produce a legible error message if it does not. At the moment, +-inconsistent configurations produce link errors late in the build +-process. +- +-The Linux kernel's configuration system provides interactive +-interfaces for creating and modifying configuration files (which also +-perform the sanity checking and dependency tracking described above). +-EGLIBC should provide similar interfaces. diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch new file mode 100644 index 0000000000..a8463ea915 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch @@ -0,0 +1,36 @@ +From 713d822908d1b2ae8403af7f9375c7054ed3dd49 Mon Sep 17 00:00:00 2001 +From: Ting Liu +Date: Wed, 19 Dec 2012 04:39:57 -0600 +Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S} + +libm-err-tab.pl will parse all the files named "libm-test-ulps" +in the given dir recursively. To avoid parsing the one in +${S}/.pc/ (it does exist after eglibc adds aarch64 support, +${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/ +aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs +in ${S}. + +Upstream-Status: inappropriate [OE specific] + +Signed-off-by: Ting Liu +--- + manual/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/manual/Makefile b/manual/Makefile +index 6fddff0..7af242e 100644 +--- a/manual/Makefile ++++ b/manual/Makefile +@@ -109,7 +109,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err + $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\ + $(dir)/libm-test-ulps)) + pwd=`pwd`; \ +- $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp ++ $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp ++ $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp + $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi + touch $@ + +-- +1.7.9.7 + diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch new file mode 100644 index 0000000000..7caba48112 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch @@ -0,0 +1,169 @@ +pulled from + +http://www.eglibc.org/archives/patches/msg01043.html + + +Upstream-Status: Pending +Signed-off-by: Khem + + +This patch builds on the menuconfig patch for EGLIBC. + + +There are a few options that have non-boolean types, that would benefit from the new 'make *config' support: + +EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int) +EGLIBC_NSSWITCH_FIXED_CONFIG (string) +EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string) + + +The patch converts these to real options in libc/option-groups.def. Also, libc/scripts/option-groups.awk is modified to output a '#define' line for int, hex, or string options encountered in the config file. + +In the post-processing script config-postproc.pl, a small change is needed: for any boolean option FOO that is implicitly disabled in the kconfig output, make sure that option is indeed a boolean before printing the explicit OPTION_FOO=n. + +Finally, libc/malloc/Makefile passes __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE as a CPPFLAGS, which is not necessary anymore because this macro will now be present in the generated header. + +attached is the updated patch to address above issues. + +Steve + +-- +Steve Longerbeam | Senior Embedded Engineer, ESD Services +Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 +P 510.354.5838 | M 408.410.2735 +Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS + + +Index: libc/malloc/Makefile +=================================================================== +--- libc.orig/malloc/Makefile 2012-01-04 22:06:18.000000000 -0800 ++++ libc/malloc/Makefile 2012-05-09 19:35:28.598682105 -0700 +@@ -48,10 +48,6 @@ + ifeq ($(OPTION_EGLIBC_MEMUSAGE),y) + extra-libs = libmemusage + extra-libs-others = $(extra-libs) +- +-ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE +-CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE) +-endif + endif + + libmemusage-routines = memusage +Index: libc/option-groups.def +=================================================================== +--- libc.orig/option-groups.def 2012-05-09 19:33:48.398677256 -0700 ++++ libc/option-groups.def 2012-05-09 19:35:28.610682107 -0700 +@@ -513,8 +513,11 @@ + the `memusage' and `memusagestat' utilities. + These components provide memory profiling functions. + +- EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE +- ++config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++ int "Memory profiling library buffer size" ++ depends on EGLIBC_MEMUSAGE ++ default "32768" ++ help + Libmemusage library buffers the profiling data in memory + before writing it out to disk. By default, the library + allocates 1.5M buffer, which can be substantial for some +@@ -553,8 +556,11 @@ + 'option-groups.config' file must set the following two + variables: + +- EGLIBC_NSSWITCH_FIXED_CONFIG +- ++config EGLIBC_NSSWITCH_FIXED_CONFIG ++ string "Nsswitch fixed config filename" ++ depends on !EGLIBC_NSSWITCH ++ default "" ++ help + Set this to the name of a file whose contents observe the + same syntax as an ordinary '/etc/nsswitch.conf' file. The + EGLIBC build process parses this file just as EGLIBC would +@@ -576,8 +582,11 @@ + you will probably want to delete references to databases not + needed on your system. + +- EGLIBC_NSSWITCH_FIXED_FUNCTIONS +- ++config EGLIBC_NSSWITCH_FIXED_FUNCTIONS ++ string "Nsswitch fixed functions filename" ++ depends on !EGLIBC_NSSWITCH ++ default "" ++ help + The EGLIBC build process uses this file to decide which + functions to make available from which service libraries. + The file 'nss/fixed-nsswitch.functions' serves as a sample +Index: libc/options-config/config-postproc.pl +=================================================================== +--- libc.orig/options-config/config-postproc.pl 2012-05-09 19:33:36.530676681 -0700 ++++ libc/options-config/config-postproc.pl 2012-05-09 19:35:28.610682107 -0700 +@@ -8,7 +8,7 @@ + die "Could not open $ARGV[0]" unless -T $ARGV[0]; + + sub yank { +- @option = grep($_ ne $_[0], @option); ++ @option = grep(!($_ =~ /$_[0]\s*=/), @option); + } + + open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; +@@ -16,7 +16,7 @@ + # get the full list of available options using the default config file + $i = 0; + while () { +- if (/^\s*OPTION_(\w+)\s*=/) { ++ if (/^\s*OPTION_(\w+\s*=.*$)/) { + $option[$i++] = $1; + } + } +@@ -35,8 +35,9 @@ + s/CONFIG_/OPTION_/g; + print; + } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { +- # this is a comment line, change CONFIG_ to OPTION_, remove this +- # option from option list, and convert to explicit OPTION_FOO=n ++ # this is a comment line for an unset boolean option, change CONFIG_ ++ # to OPTION_, remove this option from option list, and convert to ++ # explicit OPTION_FOO=n + $opt = $1; + yank($opt); + s/CONFIG_/OPTION_/g; +@@ -46,9 +47,12 @@ + } + } + +-# any options left in @options, are options that were not mentioned in ++# any boolean options left in @options, are options that were not mentioned in + # the config file, and implicitly that means the option must be set =n, + # so do that here. + foreach $opt (@option) { +- print "OPTION_$opt=n\n"; ++ if ($opt =~ /=\s*[yn]/) { ++ $opt =~ s/=\s*[yn]/=n/; ++ print "OPTION_$opt\n"; ++ } + } +Index: libc/scripts/option-groups.awk +=================================================================== +--- libc.orig/scripts/option-groups.awk 2012-01-04 22:06:00.000000000 -0800 ++++ libc/scripts/option-groups.awk 2012-05-09 19:35:28.610682107 -0700 +@@ -46,9 +46,15 @@ + print "#define __" var " 1" + else if (vars[var] == "n") + print "/* #undef __" var " */" +- # Ignore variables that don't have boolean values. +- # Ideally, this would be driven by the types given in +- # option-groups.def. ++ else if (vars[var] ~ /^[0-9]+/ || ++ vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ || ++ vars[var] ~ /^\"/) ++ print "#define __" var " " vars[var] ++ else ++ print "/* #undef __" var " */" ++ # Ignore variables that don't have boolean, int, hex, or ++ # string values. Ideally, this would be driven by the types ++ # given in option-groups.def. + } + } + diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch new file mode 100644 index 0000000000..d137f5b318 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch @@ -0,0 +1,176 @@ +Pulled from + +http://www.eglibc.org/archives/patches/msg01035.html + +Upstream-Status: Pending +Signed-off-by: Khem + +As part of the menuconfig development, I encountered some outdated information in the cross-build instructions, libc/EGLIBC.cross-building. This patch updates the file with new (and tested) instructions. It is unrelated to the menuconfig support, but applies after. + +My testing was done with an ARM target, and an x86_64 Linux host, so I converted the instructions to use those host/target types from the original i686/powerpc. Hope that's ok. + + +Thanks, + +-- +Steve Longerbeam | Senior Embedded Engineer, ESD Services +Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 +P 510.354.5838 | M 408.410.2735 +Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS + + + EGLIBC.cross-building | 59 +++++++++++++++++++++++++++++--------------------- + 1 file changed, 35 insertions(+), 24 deletions(-) + +Index: libc/EGLIBC.cross-building +=================================================================== +--- libc.orig/EGLIBC.cross-building 2012-05-09 19:33:36.522676681 -0700 ++++ libc/EGLIBC.cross-building 2012-05-09 19:36:13.918684298 -0700 +@@ -47,31 +47,34 @@ + EGLIBC requires recent versions of the GNU binutils, GCC, and the + Linux kernel. The web page + documents the current requirements, and lists patches needed for +-certain target architectures. As of this writing, EGLIBC required +-binutils 2.17, GCC 4.1, and Linux 2.6.19.1. ++certain target architectures. As of this writing, these build ++instructions have been tested with binutils 2.22.51, GCC 4.6.2, ++and Linux 3.1. + + First, let's set some variables, to simplify later commands. We'll +-build EGLIBC and GCC for a PowerPC target, known to the Linux kernel +-as 'powerpc', and we'll do the build on an Intel Linux box: ++build EGLIBC and GCC for an ARM target, known to the Linux kernel ++as 'arm', and we'll do the build on an Intel x86_64 Linux box: + +- $ build=i686-pc-linux-gnu ++ $ build=x86_64-pc-linux-gnu + $ host=$build +- $ target=powerpc-none-linux-gnu +- $ linux_arch=powerpc ++ $ target=arm-none-linux-gnueabi ++ $ linux_arch=arm + + We're using the aforementioned versions of Binutils, GCC, and Linux: + +- $ binutilsv=binutils-2.17 +- $ gccv=gcc-4.1.1 +- $ linuxv=linux-2.6.20 ++ $ binutilsv=binutils-2.22.51 ++ $ gccv=gcc-4.6.2 ++ $ linuxv=linux-3.1 + + We're carrying out the entire process under '~/cross-build', which +-contains unpacked source trees: ++contains unpacked source trees for binutils, gcc, and linux kernel, ++along with EGLIBC svn trunk (which can be checked-out with ++'svn co http://www.eglibc.org/svn/trunk eglibc'): + +- $ top=$HOME/cross-build/ppc ++ $ top=$HOME/cross-build/$target + $ src=$HOME/cross-build/src + $ ls $src +- binutils-2.17 gcc-4.1.1 libc linux-2.6.20 ++ binutils-2.22.51 eglibc gcc-4.6.2 linux-3.1 + + We're going to place our build directories in a subdirectory 'obj', + we'll install the cross-development toolchain in 'tools', and we'll +@@ -99,7 +102,7 @@ + + The First GCC + +-For our work, we need a cross-compiler targeting a PowerPC Linux ++For our work, we need a cross-compiler targeting an ARM Linux + system. However, that configuration includes the shared library + 'libgcc_s.so', which is compiled against the EGLIBC headers (which we + haven't installed yet) and linked against 'libc.so' (which we haven't +@@ -125,7 +128,8 @@ + > --prefix=$tools \ + > --without-headers --with-newlib \ + > --disable-shared --disable-threads --disable-libssp \ +- > --disable-libgomp --disable-libmudflap \ ++ > --disable-libgomp --disable-libmudflap --disable-libquadmath \ ++ > --disable-decimal-float --disable-libffi \ + > --enable-languages=c + $ PATH=$tools/bin:$PATH make + $ PATH=$tools/bin:$PATH make install +@@ -162,12 +166,13 @@ + > CXX=$tools/bin/$target-g++ \ + > AR=$tools/bin/$target-ar \ + > RANLIB=$tools/bin/$target-ranlib \ +- > $src/libc/configure \ ++ > $src/eglibc/libc/configure \ + > --prefix=/usr \ + > --with-headers=$sysroot/usr/include \ + > --build=$build \ + > --host=$target \ +- > --disable-profile --without-gd --without-cvs --enable-add-ons ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports + + The option '--prefix=/usr' may look strange, but you should never + configure EGLIBC with a prefix other than '/usr': in various places, +@@ -181,6 +186,11 @@ + The '--with-headers' option tells EGLIBC where the Linux headers have + been installed. + ++The '--enable-add-ons=nptl,libidn,../ports' option tells EGLIBC to look ++for the listed glibc add-ons. Most notably the ports add-on (located ++just above the libc sources in the EGLIBC svn tree) is required to ++support ARM targets. ++ + We can now use the 'install-headers' makefile target to install the + headers: + +@@ -223,6 +233,7 @@ + > --prefix=$tools \ + > --with-sysroot=$sysroot \ + > --disable-libssp --disable-libgomp --disable-libmudflap \ ++ > --disable-libffi --disable-libquadmath \ + > --enable-languages=c + $ PATH=$tools/bin:$PATH make + $ PATH=$tools/bin:$PATH make install +@@ -240,13 +251,14 @@ + > CXX=$tools/bin/$target-g++ \ + > AR=$tools/bin/$target-ar \ + > RANLIB=$tools/bin/$target-ranlib \ +- > $src/libc/configure \ ++ > $src/eglibc/libc/configure \ + > --prefix=/usr \ + > --with-headers=$sysroot/usr/include \ + > --with-kconfig=$obj/linux/scripts/kconfig \ + > --build=$build \ + > --host=$target \ +- > --disable-profile --without-gd --without-cvs --enable-add-ons ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports + + Note the additional '--with-kconfig' option. This tells EGLIBC where to + find the host config tools used by the kernel 'make config' and 'make +@@ -337,15 +349,15 @@ + ELF Header: + ... + Type: EXEC (Executable file) +- Machine: PowerPC ++ Machine: ARM + + ... + Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4 +- INTERP 0x000134 0x10000134 0x10000134 0x0000d 0x0000d R 0x1 +- [Requesting program interpreter: /lib/ld.so.1] +- LOAD 0x000000 0x10000000 0x10000000 0x008f0 0x008f0 R E 0x10000 ++ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1 ++ [Requesting program interpreter: /lib/ld-linux.so.3] ++ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000 + ... + + Looking at the dynamic section of the installed 'libgcc_s.so', we see +@@ -357,7 +369,6 @@ + Dynamic section at offset 0x1083c contains 24 entries: + Tag Type Name/Value + 0x00000001 (NEEDED) Shared library: [libc.so.6] +- 0x00000001 (NEEDED) Shared library: [ld.so.1] + 0x0000000e (SONAME) Library soname: [libgcc_s.so.1] + ... + diff --git a/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch new file mode 100644 index 0000000000..7258c82418 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch @@ -0,0 +1,143 @@ +Its controlled by __OPTION_EGLIBC_RTLD_DEBUG +so we should use GLRO_dl_debug_mask + +Singed-off-by: Khem Raj + +Upstream-Status: Pending +Index: libc/elf/dl-open.c +=================================================================== +--- libc.orig/elf/dl-open.c 2012-10-25 10:18:12.000000000 -0700 ++++ libc/elf/dl-open.c 2013-01-09 11:49:02.635577870 -0800 +@@ -155,7 +155,7 @@ + ns->_ns_main_searchlist->r_list[new_nlist++] = map; + + /* We modify the global scope. Report this. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) + _dl_debug_printf ("\nadd %s [%lu] to global scope\n", + map->l_name, map->l_ns); + } +@@ -298,7 +298,7 @@ + LIBC_PROBE (map_complete, 3, args->nsid, r, new); + + /* Print scope information. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) + _dl_show_scope (new, 0); + + /* Only do lazy relocation if `LD_BIND_NOW' is not set. */ +@@ -515,7 +515,7 @@ + } + + /* Print scope information. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) + _dl_show_scope (imap, from_scope); + } + +Index: libc/ports/sysdeps/mips/dl-lookup.c +=================================================================== +--- libc.orig/ports/sysdeps/mips/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700 ++++ libc/ports/sysdeps/mips/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800 +@@ -111,7 +111,7 @@ + continue; + + /* Print some debugging info if wanted. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS, 0)) + _dl_debug_printf ("symbol=%s; lookup in file=%s [%lu]\n", + undef_name, + map->l_name[0] ? map->l_name : rtld_progname, +@@ -432,7 +432,7 @@ + hash table. */ + if (__builtin_expect (tab->size, 0)) + { +- assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK); ++ assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK); + __rtld_lock_unlock_recursive (tab->lock); + goto success; + } +@@ -681,7 +681,7 @@ + } + + /* Display information if we are debugging. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0)) + _dl_debug_printf ("\ + \nfile=%s [%lu]; needed by %s [%lu] (relocation dependency)\n\n", + map->l_name[0] ? map->l_name : rtld_progname, +@@ -788,7 +788,7 @@ + { + if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) + && skip_map == NULL +- && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) ++ && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED)) + { + /* We could find no value for a strong reference. */ + const char *reference_name = undef_map ? undef_map->l_name : ""; +@@ -861,7 +861,7 @@ + if (__builtin_expect (current_value.m->l_used == 0, 0)) + current_value.m->l_used = 1; + +- if (__builtin_expect (GLRO(dl_debug_mask) ++ if (__builtin_expect (GLRO_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, + ¤t_value, version, type_class, protected); +@@ -926,7 +926,7 @@ + { + const char *reference_name = undef_map->l_name; + +- if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS) ++ if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS) + { + _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'", + (reference_name[0] +@@ -942,7 +942,7 @@ + _dl_debug_printf_c ("\n"); + } + #ifdef SHARED +- if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) ++ if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK) + { + int conflict = 0; + struct sym_val val = { NULL, NULL }; +Index: libc/elf/rtld.c +=================================================================== +--- libc.orig/elf/rtld.c 2012-10-10 08:35:46.000000000 -0700 ++++ libc/elf/rtld.c 2013-01-09 11:49:02.635577870 -0800 +@@ -2118,7 +2118,7 @@ + GLRO(dl_init_all_dirs) = GL(dl_all_dirs); + + /* Print scope information. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) + { + _dl_debug_printf ("\nInitial object scopes\n"); + +Index: libc/elf/dl-lookup.c +=================================================================== +--- libc.orig/elf/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700 ++++ libc/elf/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800 +@@ -771,7 +771,7 @@ + { + if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) + && skip_map == NULL +- && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) ++ && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED)) + { + /* We could find no value for a strong reference. */ + const char *reference_name = undef_map ? undef_map->l_name : ""; +Index: libc/elf/get-dynamic-info.h +=================================================================== +--- libc.orig/elf/get-dynamic-info.h 2012-12-02 13:11:45.000000000 -0800 ++++ libc/elf/get-dynamic-info.h 2013-01-09 12:53:51.015657653 -0800 +@@ -157,7 +157,7 @@ + them. Therefore to avoid breaking existing applications the + best we can do is add a warning during debugging with the + intent of notifying the user of the problem. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0) + && l->l_flags_1 & ~DT_1_SUPPORTED_MASK) + _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n", + l->l_flags_1 & ~DT_1_SUPPORTED_MASK); diff --git a/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch new file mode 100644 index 0000000000..cf5803585c --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch @@ -0,0 +1,17 @@ +import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html + +Upstream-Status: Pending + +Index: libc/bits/stdio-lock.h +=================================================================== +--- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700 ++++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700 +@@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _ + _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \ + _IO_flockfile (_fp) + ++# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp) ++ + # define _IO_release_lock(_fp) \ + _IO_funlockfile (_fp); \ + _IO_cleanup_region_end (0) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch new file mode 100644 index 0000000000..f5023c08d4 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch @@ -0,0 +1,20 @@ +The older versions of perf still require sys/resource.h to be +present in this header, the newer version of perf in 3.2 and +beyond directly include sys/resource.h + +Upstream-Status: Inapproriate [older kernel/perf specific] + +Signed-off-by: Saul Wold + +Index: libc/posix/sys/wait.h +=================================================================== +--- libc.orig/posix/sys/wait.h ++++ libc/posix/sys/wait.h +@@ -28,6 +28,7 @@ + __BEGIN_DECLS + + #include ++#include + + /* These macros could also be defined in . */ + #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch new file mode 100644 index 0000000000..4313aa5197 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch @@ -0,0 +1,21 @@ +In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21: +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private': +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM' +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function) +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.) +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function) +make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1 + +Upstream-Status: Pending + +--- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig ++++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #define FUTEX_WAIT 0 + #define FUTEX_WAKE 1 diff --git a/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch new file mode 100644 index 0000000000..bbf4605505 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch @@ -0,0 +1,38 @@ +Upstream-Status: backport + +Imported patch from: http://www.eglibc.org/archives/patches/msg01124.html + +Signed-Off-By: Nitin A Kamble +2012/05/09 + +Index: libc/posix/xregex.c +=================================================================== +--- libc.orig/posix/xregex.c ++++ libc/posix/xregex.c +@@ -2943,7 +2943,7 @@ PREFIX(regex_compile) (const char *ARG_P + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_INDIRECTWC); + +- idx = findidx ((const wint_t**)&cp); ++ idx = findidx ((const wint_t**)&cp, -1); + if (idx == 0 || cp < (wint_t*) str + c1) + /* This is no valid character. */ + FREE_STACK_RETURN (REG_ECOLLATE); +@@ -3392,7 +3392,7 @@ PREFIX(regex_compile) (const char *ARG_P + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); + +- idx = findidx (&cp); ++ idx = findidx (&cp, -1); + if (idx == 0 || cp < str + c1) + /* This is no valid character. */ + FREE_STACK_RETURN (REG_ECOLLATE); +@@ -6363,7 +6363,7 @@ byte_re_match_2_internal (struct re_patt + } + str_buf[i] = TRANSLATE(*(d+i)); + str_buf[i+1] = '\0'; /* sentinel */ +- idx2 = findidx ((const wint_t**)&cp); ++ idx2 = findidx ((const wint_t**)&cp, -1); + } + + /* Update d, however d will be incremented at diff --git a/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch new file mode 100644 index 0000000000..2ca0bca248 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch @@ -0,0 +1,22 @@ +Fix error like + +/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/build-mips64-oe-linux/libc_pic.os: In function `_IO_new_file_fopen': +/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/eglibc-2_16/libc/libio/fileops.c:431: undefined reference to `_IO_file_close_it_internal' +collect2: error: ld returned 1 exit status + + +Signed-off-by: Khem Raj +Upstream-Status: Pending +Index: libc/libio/fileops.c +=================================================================== +--- libc.orig/libio/fileops.c 2012-07-04 18:25:47.000000000 -0700 ++++ libc/libio/fileops.c 2012-07-24 00:21:17.220322557 -0700 +@@ -428,7 +428,7 @@ + result->_mode = 1; + #else + /* Treat this as if we couldn't find the given character set. */ +- (void) INTUSE(_IO_file_close_it) (fp); ++ (void) _IO_file_close_it (fp); + __set_errno (EINVAL); + return NULL; + #endif diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch new file mode 100644 index 0000000000..25c43a9fe6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch @@ -0,0 +1,38 @@ +cross localedef fails to compile these locales because name_fmt field is empty +It is not acceptable for cross localedef and it errors out + +LC_NAME: field `name_fmt' not defined + +We therefore give a dummy string to the format, the real fix needs some native +tibetian person to define proper name_fmt + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: libc/localedata/locales/bo_CN +=================================================================== +--- libc.orig/localedata/locales/bo_CN 2012-11-17 09:50:14.000000000 -0800 ++++ libc/localedata/locales/bo_CN 2013-01-04 08:55:15.593612288 -0800 +@@ -145,7 +145,7 @@ + LC_NAME + % FIXME + +-name_fmt "" ++name_fmt "FIXME" + % name_gen "FIXME" + % name_miss "FIXME" + % name_mr "FIXME" +Index: libc/localedata/locales/bo_IN +=================================================================== +--- libc.orig/localedata/locales/bo_IN 2012-11-17 09:50:14.000000000 -0800 ++++ libc/localedata/locales/bo_IN 2013-01-04 08:54:12.345609028 -0800 +@@ -70,7 +70,7 @@ + + LC_NAME + % FIXME +-name_fmt "" ++name_fmt "FIXME" + % name_gen "FIXME" + % name_miss "FIXME" + % name_mr "FIXME" diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch new file mode 100644 index 0000000000..7618c99534 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch @@ -0,0 +1,18 @@ +Upstream-Status: Inappropriate [other] + +This is a hack to fix building the locale bits on an older +CentOs 5.X machine + +Index: eglibc-2_16/libc/locale/programs/config.h +=================================================================== +--- eglibc-2_16.orig/libc/locale/programs/config.h ++++ eglibc-2_16/libc/locale/programs/config.h +@@ -19,6 +19,8 @@ + #ifndef _LD_CONFIG_H + #define _LD_CONFIG_H 1 + ++#define DUMMY_LOCALE_T ++ + /* Use the internal textdomain used for libc messages. */ + #define PACKAGE _libc_intl_domainname + #ifndef VERSION diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch new file mode 100644 index 0000000000..511ee9d19e --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch @@ -0,0 +1,100 @@ +Create e5500 specific math_private.h and let it include when compiling for e5500/64bit core +We prefefine __CPU_HAS_FSQRT to 0 and then in general ppc64 math_private.h we check if its +already defined before redefining it. This way we can ensure that on e5500 builds it wont +emit fsqrt intructions + +-Khem + +Upstream-Status: Pending + +Index: libc/sysdeps/powerpc/fpu/math_private.h +=================================================================== +--- libc.orig/sysdeps/powerpc/fpu/math_private.h ++++ libc/sysdeps/powerpc/fpu/math_private.h +@@ -25,10 +25,12 @@ + #include + #include_next + +-# if __WORDSIZE == 64 || defined _ARCH_PWR4 +-# define __CPU_HAS_FSQRT 1 +-# else +-# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) ++# ifndef __CPU_HAS_FSQRT ++# if __WORDSIZE == 64 || defined _ARCH_PWR4 ++# define __CPU_HAS_FSQRT 1 ++# else ++# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) ++# endif + # endif + + extern double __slow_ieee754_sqrt (double); +Index: libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h +=================================================================== +--- /dev/null ++++ libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h +@@ -0,0 +1,9 @@ ++#ifndef _E5500_MATH_PRIVATE_H_ ++#define _E5500_MATH_PRIVATE_H_ 1 ++/* E5500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E5500_MATH_PRIVATE_H_ */ +Index: libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h +=================================================================== +--- /dev/null ++++ libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h +@@ -0,0 +1,9 @@ ++#ifndef _E6500_MATH_PRIVATE_H_ ++#define _E6500_MATH_PRIVATE_H_ 1 ++/* E6500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E6500_MATH_PRIVATE_H_ */ +Index: libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h +=================================================================== +--- /dev/null ++++ libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h +@@ -0,0 +1,9 @@ ++#ifndef _E500MC_MATH_PRIVATE_H_ ++#define _E500MC_MATH_PRIVATE_H_ 1 ++/* E500MC core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E500MC_MATH_PRIVATE_H_ */ +Index: libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h +=================================================================== +--- /dev/null ++++ libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h +@@ -0,0 +1,9 @@ ++#ifndef _E5500_MATH_PRIVATE_H_ ++#define _E5500_MATH_PRIVATE_H_ 1 ++/* E5500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E5500_MATH_PRIVATE_H_ */ +Index: libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h +=================================================================== +--- /dev/null ++++ libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h +@@ -0,0 +1,9 @@ ++#ifndef _E6500_MATH_PRIVATE_H_ ++#define _E6500_MATH_PRIVATE_H_ 1 ++/* E6500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E6500_MATH_PRIVATE_H_ */ diff --git a/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk new file mode 100644 index 0000000000..d2a28c2dc6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk @@ -0,0 +1,11 @@ +#!/usr/bin/make + +include $(IN) + +all: + rm -f $(OUT) + touch $(OUT) + for locale in $(SUPPORTED-LOCALES); do \ + [ $$locale = true ] && continue; \ + echo $$locale | sed 's,/, ,' >> $(OUT); \ + done diff --git a/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch new file mode 100644 index 0000000000..689b79c61c --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch @@ -0,0 +1,1516 @@ +Signed-of-by: Edmar Wienskoski +Upstream-Status: Pending + +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc32/603e/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies +@@ -0,0 +1,2 @@ ++# e300c3 is a variant of 603e so use the same optimizations for sqrt ++powerpc/powerpc32/603e/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc32/e500mc/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc32/e5500/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc32/e6500/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc64/e5500/fpu +Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies +=================================================================== +--- /dev/null ++++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies +@@ -0,0 +1 @@ ++powerpc/powerpc64/e6500/fpu diff --git a/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch new file mode 100644 index 0000000000..be29856b03 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch @@ -0,0 +1,20 @@ +This is needed since initgroups belongs to NET group +so when NET is disabled in eglibc build then it reports +as undefined symbol + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: libc/nss/getent.c +=================================================================== +--- libc.orig/nss/getent.c 2012-03-09 09:41:57.099581559 -0800 ++++ libc/nss/getent.c 2012-03-09 09:42:13.095582334 -0800 +@@ -898,7 +898,7 @@ + D(group) + D(gshadow) + DN(hosts) +-D(initgroups) ++DN(initgroups) + DN(netgroup) + DN(networks) + D(passwd) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch new file mode 100644 index 0000000000..e83a0ad6d2 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch @@ -0,0 +1,56 @@ +Upstream-Status: Inappropriate [embedded specific] + +The default lib search path order is: + + 1) LD_LIBRARY_PATH + 2) RPATH from the binary + 3) ld.so.cache + 4) default search paths embedded in the linker + +For nativesdk binaries which are being used alongside binaries on a host system, we +need the search paths to firstly search the shipped nativesdk libs but then also +cover the host system. For example we want the host system's libGL and this may be +in a non-standard location like /usr/lib/mesa. The only place the location is know +about is in the ld.so.cache of the host system. + +Since nativesdk has a simple structure and doesn't need to use a cache itself, we +repurpose the cache for use as a last resort in finding host system binaries. This +means we need to switch the order of 3 and 4 above to make this work effectively. + +RP 14/10/2010 + +Index: libc/elf/dl-load.c +=================================================================== +--- libc.orig/elf/dl-load.c 2012-12-02 13:11:45.000000000 -0800 ++++ libc/elf/dl-load.c 2013-01-09 07:00:59.135223084 -0800 +@@ -2215,7 +2215,14 @@ + fd = open_path (name, namelen, mode & __RTLD_SECURE, + &loader->l_runpath_dirs, &realname, &fb, loader, + LA_SER_RUNPATH, &found_other_class); +- ++ /* try the default path. */ ++ if (fd == -1 ++ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL ++ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) ++ && rtld_search_dirs.dirs != (void *) -1) ++ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, ++ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); ++ /* Finally try ld.so.cache */ + #ifdef USE_LDCONFIG + if (fd == -1 + && (__builtin_expect (! (mode & __RTLD_SECURE), 1) +@@ -2283,14 +2290,6 @@ + } + #endif + +- /* Finally, try the default path. */ +- if (fd == -1 +- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL +- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) +- && rtld_search_dirs.dirs != (void *) -1) +- fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, +- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); +- + /* Add another newline when we are tracing the library loading. */ + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)) + _dl_debug_printf ("\n"); diff --git a/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch new file mode 100644 index 0000000000..9b646fea95 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch @@ -0,0 +1,26 @@ + +On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic +section if a --version-script sets _RLD_MAP to local. This is apparently +a binutils bug, but libc shouldn't segfault in this case. + +see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615 + +Upstream-Status: Pending + +9/19/2010 - added by Qing He + + +--- +diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h +--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800 ++++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800 +@@ -70,7 +70,8 @@ + /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in + with the run-time address of the r_debug structure */ + #define ELF_MACHINE_DEBUG_SETUP(l,r) \ +-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ ++do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \ ++ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \ + *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ + (ElfW(Addr)) (r); \ + } while (0) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch new file mode 100644 index 0000000000..1542b1b519 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch @@ -0,0 +1,17 @@ +Upstream-Status: Inappropriate [embedded specific] + +Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of +variable EGLIBC_KNOWN_INTERPRETER_NAMES. + +Lianhao Lu, 08/01/2011 + +--- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800 ++++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800 +@@ -52,6 +52,7 @@ + #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES + SYSDEP_KNOWN_INTERPRETER_NAMES + #endif ++ OECORE_KNOWN_INTERPRETER_NAMES + }; + + static struct known_names known_libs[] = diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch new file mode 100644 index 0000000000..6ea666b1d6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch @@ -0,0 +1,184 @@ +on ppc fixes the errors like below +| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite' +| collect2: ld returned 1 exit status + +Upstream-Status: Pending + +ChangeLog + +2012-01-06 Khem Raj + + * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias. + Remove cruft. + * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto. + * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto. + * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto. + +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +@@ -39,14 +39,8 @@ static const float half = 0.5; + We find the actual square root and half of its reciprocal + simultaneously. */ + +-#ifdef __STDC__ + double + __ieee754_sqrt (double b) +-#else +-double +-__ieee754_sqrt (b) +- double b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -132,3 +126,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +@@ -37,14 +37,8 @@ static const float threehalf = 1.5; + We find the reciprocal square root and use that to compute the actual + square root. */ + +-#ifdef __STDC__ + float + __ieee754_sqrtf (float b) +-#else +-float +-__ieee754_sqrtf (b) +- float b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +@@ -39,14 +39,8 @@ static const float half = 0.5; + We find the actual square root and half of its reciprocal + simultaneously. */ + +-#ifdef __STDC__ + double + __ieee754_sqrt (double b) +-#else +-double +-__ieee754_sqrt (b) +- double b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -132,3 +126,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +@@ -37,14 +37,8 @@ static const float threehalf = 1.5; + We find the reciprocal square root and use that to compute the actual + square root. */ + +-#ifdef __STDC__ + float + __ieee754_sqrtf (float b) +-#else +-float +-__ieee754_sqrtf (b) +- float b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch new file mode 100644 index 0000000000..60532cbd03 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch @@ -0,0 +1,365 @@ + __ieee754_sqrt{,f} are now inline functions and call out __slow versions + + +Signed-off-by: Khem Raj +Upstream-Status: Pending +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +@@ -40,7 +40,7 @@ static const float half = 0.5; + simultaneously. */ + + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -77,7 +77,7 @@ __ieee754_sqrt (double b) + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -126,4 +126,12 @@ __ieee754_sqrt (double b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +@@ -38,7 +38,7 @@ static const float threehalf = 1.5; + square root. */ + + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b) + } + return f_washf (b); + } ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +@@ -40,7 +40,7 @@ static const float half = 0.5; + simultaneously. */ + + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -77,7 +77,7 @@ __ieee754_sqrt (double b) + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -126,4 +126,12 @@ __ieee754_sqrt (double b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +@@ -38,7 +38,7 @@ static const float threehalf = 1.5; + square root. */ + + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b) + } + return f_washf (b); + } ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +@@ -41,10 +41,10 @@ static const float half = 0.5; + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ __ieee754_sqrt (b) + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +@@ -39,10 +39,10 @@ static const float threehalf = 1.5; + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +@@ -41,10 +41,10 @@ static const float half = 0.5; + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ __ieee754_sqrt (b) + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +@@ -39,10 +39,10 @@ static const float threehalf = 1.5; + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +@@ -41,10 +41,10 @@ static const float half = 0.5; + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ __ieee754_sqrt (b) + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +@@ -39,10 +39,10 @@ static const float threehalf = 1.5; + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +@@ -132,4 +132,12 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +@@ -99,4 +99,12 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch new file mode 100644 index 0000000000..4c6c1070c3 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch @@ -0,0 +1,47 @@ + __ieee754_sqrt{,f} are now inline functions and call out __slow versions + + +Signed-off-by: chunrong guo +Upstream-Status: Pending + +diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:39:58.487229887 -0500 ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:40:52.643069198 -0500 +@@ -41,10 +41,10 @@ + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:39:58.487229887 -0500 ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:41:26.017067682 -0500 +@@ -39,10 +39,10 @@ + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { diff --git a/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch new file mode 100644 index 0000000000..ca5f17ba58 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch @@ -0,0 +1,108 @@ +Upstream-Status: Inappropriate [SDK specific] + +This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings +and lengths as well as ld.so.cache path in the dynamic loader to specific +sections in memory. The sections that contain paths have been allocated a 4096 +byte section, which is the maximum path length in linux. This will allow the +relocating script to parse the ELF binary, detect the section and easily replace +the strings in a certain path. + +Signed-off-by: Laurentiu Palcu + +Index: libc/elf/interp.c +=================================================================== +--- libc.orig/elf/interp.c ++++ libc/elf/interp.c +@@ -16,5 +16,5 @@ + License along with the GNU C Library; if not, see + . */ + +-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) ++const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) + = RUNTIME_LINKER; +Index: libc/elf/dl-load.c +=================================================================== +--- libc.orig/elf/dl-load.c ++++ libc/elf/dl-load.c +@@ -144,8 +144,8 @@ static size_t max_capstrlen attribute_re + /* Get the generated information about the trusted directories. */ + #include "trusted-dirs.h" + +-static const char system_dirs[] = SYSTEM_DIRS; +-static const size_t system_dirs_len[] = ++static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS; ++volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) = + { + SYSTEM_DIRS_LEN + }; +Index: libc/elf/dl-cache.c +=================================================================== +--- libc.orig/elf/dl-cache.c ++++ libc/elf/dl-cache.c +@@ -133,6 +133,10 @@ do \ + while (0) + + ++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) = ++ SYSCONFDIR "/ld.so.cache"; ++ ++ + int + internal_function + _dl_cache_libcmp (const char *p1, const char *p2) +Index: libc/elf/ldconfig.c +=================================================================== +--- libc.orig/elf/ldconfig.c ++++ libc/elf/ldconfig.c +@@ -166,6 +166,9 @@ static struct argp argp = + options, parse_opt, NULL, doc, NULL, more_help, NULL + }; + ++ ++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); ++ + /* Check if string corresponds to an important hardware capability or + a platform. */ + static int +Index: libc/sysdeps/generic/dl-cache.h +=================================================================== +--- libc.orig/sysdeps/generic/dl-cache.h ++++ libc/sysdeps/generic/dl-cache.h +@@ -27,10 +27,6 @@ + ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID) + #endif + +-#ifndef LD_SO_CACHE +-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" +-#endif +- + #ifndef add_system_dir + # define add_system_dir(dir) add_dir (dir) + #endif +Index: libc/elf/rtld.c +=================================================================== +--- libc.orig/elf/rtld.c ++++ libc/elf/rtld.c +@@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local + strong_alias (__pointer_chk_guard_local, __pointer_chk_guard) + #endif + ++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); + + /* List of auditing DSOs. */ + static struct audit_list +@@ -1031,12 +1032,12 @@ of this helper program; chances are you + --list list all dependencies and how they are resolved\n\ + --verify verify that given object really is a dynamically linked\n\ + object we can handle\n\ +- --inhibit-cache Do not use " LD_SO_CACHE "\n\ ++ --inhibit-cache Do not use %s\n\ + --library-path PATH use given PATH instead of content of the environment\n\ + variable LD_LIBRARY_PATH\n\ + --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ + in LIST\n\ +- --audit LIST use objects named in LIST as auditors\n"); ++ --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE); + + ++_dl_skip_args; + --_dl_argc; diff --git a/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch new file mode 100644 index 0000000000..f164f8f9ae --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch @@ -0,0 +1,41 @@ +Upstream-Status: Inappropriate [SDK specific] + +eglibc-nativesdk: Fix buffer overrun with a relocated SDK + +When ld-linux-*.so.2 is relocated to a path that is longer than the +original fixed location, the dynamic loader will crash in open_path +because it implicitly assumes that max_dirnamelen is a fixed size that +never changes. + +The allocated buffer will not be large enough to contain the directory +path string which is larger than the fixed location provided at build +time. + +Signed-off-by: Jason Wessel + +--- + elf/dl-load.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/elf/dl-load.c ++++ b/elf/dl-load.c +@@ -1919,7 +1919,19 @@ open_path (const char *name, size_t name + given on the command line when rtld is run directly. */ + return -1; + ++ do ++ { ++ struct r_search_path_elem *this_dir = *dirs; ++ if (this_dir->dirnamelen > max_dirnamelen) ++ { ++ max_dirnamelen = this_dir->dirnamelen; ++ } ++ } ++ while (*++dirs != NULL); ++ + buf = alloca (max_dirnamelen + max_capstrlen + namelen); ++ ++ dirs = sps->dirs; + do + { + struct r_search_path_elem *this_dir = *dirs; diff --git a/meta/recipes-core/eglibc/eglibc-collateral.inc b/meta/recipes-core/eglibc/eglibc-collateral.inc new file mode 100644 index 0000000000..8feca09f2e --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-collateral.inc @@ -0,0 +1,12 @@ +INHIBIT_DEFAULT_DEPS = "1" +LICENSE = "GPLv2 & LGPLv2.1" +HOMEPAGE = "http://www.eglibc.org/" + +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot" + diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc new file mode 100644 index 0000000000..d18786ab93 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-common.inc @@ -0,0 +1,9 @@ +SUMMARY = "Embedded GLIBC (GNU C Library)" +DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) that is designed to work well on embedded systems. EGLIBC strives to be source and binary compatible with GLIBC. EGLIBC's goals include reduced footprint, configurable components, better support for cross-compilation and cross-testing." +HOMEPAGE = "http://www.eglibc.org/home" +SECTION = "libs" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \ + file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \ + file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff " diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc new file mode 100644 index 0000000000..0f0e1cd5e1 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-initial.inc @@ -0,0 +1,78 @@ +DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial" +PROVIDES = "virtual/${TARGET_PREFIX}libc-initial" + +PACKAGES = "" +PACKAGES_DYNAMIC = "" + +STAGINGCC = "gcc-cross-initial" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}" + +do_configure () { + sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure + chmod +x ${S}/configure + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + find ${S} -name "configure" | xargs touch + ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \ + --prefix=/usr \ + --without-cvs --disable-sanity-checks \ + --with-headers=${STAGING_DIR_TARGET}${includedir} \ + --with-kconfig=${STAGING_BINDIR_NATIVE} \ + --enable-hacker-mode --enable-addons +} + +do_compile () { + : +} + +do_install () { + oe_runmake cross-compiling=yes install_root=${D} \ + includedir='${includedir}' prefix='${prefix}' \ + install-bootstrap-headers=yes install-headers + + oe_runmake csu/subdir_lib + mkdir -p ${D}${libdir}/ + install -m 644 csu/crt[1in].o ${D}${libdir} + + # Two headers -- stubs.h and features.h -- aren't installed by install-headers, + # so do them by hand. We can tolerate an empty stubs.h for the moment. + # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html + mkdir -p ${D}${includedir}/gnu/ + touch ${D}${includedir}/gnu/stubs.h + cp ${S}/include/features.h ${D}${includedir}/features.h + + if [ -e ${B}/bits/stdio_lim.h ]; then + cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/ + fi + # add links to linux-libc-headers: final eglibc build need this. + for t in linux asm asm-generic; do + ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/ + done +} + +do_install_locale() { + : +} + +do_siteconfig () { + : +} + +SSTATEPOSTINSTFUNCS += "eglibcinitial_sstate_postinst" +eglibcinitial_sstate_postinst() { + if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] + then + # Recreate the symlinks to ensure they point to the correct location + for t in linux asm asm-generic; do + rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t + ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/ + done + fi +} + +do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/" + +# We don't install any scripts so there is nothing to evacuate +do_evacuate_scripts () { + : +} diff --git a/meta/recipes-core/eglibc/eglibc-initial_2.19.bb b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb new file mode 100644 index 0000000000..de45079603 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb @@ -0,0 +1,11 @@ +require eglibc_${PV}.bb +require eglibc-initial.inc + +DEPENDS += "kconfig-frontends-native" + +# main eglibc recipes muck with TARGET_CPPFLAGS to point into +# final target sysroot but we +# are not there when building eglibc-initial +# so reset it here + +TARGET_CPPFLAGS = "" diff --git a/meta/recipes-core/eglibc/eglibc-ld.inc b/meta/recipes-core/eglibc/eglibc-ld.inc new file mode 100644 index 0000000000..6261ae3419 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-ld.inc @@ -0,0 +1,56 @@ +def ld_append_if_tune_exists(d, infos, dict): + tune = d.getVar("DEFAULTTUNE", True) or "" + libdir = d.getVar("base_libdir", True) or "" + if tune in dict: + infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }') + infos['lddrewrite'].add(libdir+'/'+dict[tune][0]) + +def eglibc_dl_info(d): + ld_info_all = { + "mips": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"], + "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"], + "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"], + "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"], + "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"], + "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"], + "core2-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"], + "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"], + "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"], + "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"], + "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"], + "corei7-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"], + "corei7-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"], + } + + infos = {'ldconfig':set(), 'lddrewrite':set()} + ld_append_if_tune_exists(d, infos, ld_info_all) + + #DEFAULTTUNE_MULTILIB_ORIGINAL + original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True) + if original_tune: + localdata = bb.data.createCopy(d) + localdata.setVar("DEFAULTTUNE", original_tune) + ld_append_if_tune_exists(localdata, infos, ld_info_all) + + variants = d.getVar("MULTILIB_VARIANTS", True) or "" + for item in variants.split(): + localdata = bb.data.createCopy(d) + overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item + localdata.setVar("OVERRIDES", overrides) + bb.data.update_data(localdata) + ld_append_if_tune_exists(localdata, infos, ld_info_all) + infos['ldconfig'] = ','.join(infos['ldconfig']) + infos['lddrewrite'] = ' '.join(infos['lddrewrite']) + return infos + +EGLIBC_KNOWN_INTERPRETER_NAMES = "${@eglibc_dl_info(d)['ldconfig']}" +RTLDLIST = "${@eglibc_dl_info(d)['lddrewrite']}" diff --git a/meta/recipes-core/eglibc/eglibc-locale.inc b/meta/recipes-core/eglibc/eglibc-locale.inc new file mode 100644 index 0000000000..4da5abd778 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-locale.inc @@ -0,0 +1,96 @@ +include eglibc-collateral.inc + +SUMMARY = "Locale data from eglibc" + +BPN = "eglibc" +LOCALEBASEPN = "${MLPREFIX}eglibc" + +# eglibc-collateral.inc inhibits all default deps, but do_package needs objcopy +# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'eglibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'eglibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so') +# ERROR: Function failed: split_and_strip_files +BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" +BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" +do_package[depends] += "${BINUTILSDEP}" + +# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION +# is set. The idea is to avoid running localedef on the target (at first boot) +# to decrease initial boot time and avoid localedef being killed by the OOM +# killer which used to effectively break i18n on machines with < 128MB RAM. + +# default to disabled +ENABLE_BINARY_LOCALE_GENERATION ?= "0" +ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-eglibc-locale = "0" + +#enable locale generation on these arches +# BINARY_LOCALE_ARCHES is a space separated list of regular expressions +BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64 powerpc mips mips64" + +# set "1" to use cross-localedef for locale generation +# set "0" for qemu emulation of native localedef for locale generation +LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1" + +PROVIDES = "virtual/libc-locale" + +PACKAGES = "localedef ${PN}-dbg" + +PACKAGES_DYNAMIC = "^locale-base-.* \ + ^eglibc-gconv-.* ^eglibc-charmap-.* ^eglibc-localedata-.* ^eglibc-binary-localedata-.* \ + ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ + ^${MLPREFIX}eglibc-gconv$" + +# Create a eglibc-binaries package +ALLOW_EMPTY_${BPN}-binaries = "1" +PACKAGES += "${BPN}-binaries" +RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-binary") != -1])}" + +# Create a eglibc-charmaps package +ALLOW_EMPTY_${BPN}-charmaps = "1" +PACKAGES += "${BPN}-charmaps" +RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-charmap") != -1])}" + +# Create a eglibc-gconvs package +ALLOW_EMPTY_${BPN}-gconvs = "1" +PACKAGES += "${BPN}-gconvs" +RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-gconv") != -1])}" + +# Create a eglibc-localedatas package +ALLOW_EMPTY_${BPN}-localedatas = "1" +PACKAGES += "${BPN}-localedatas" +RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-localedata") != -1])}" + +DESCRIPTION_localedef = "eglibc: compile locale definition files" + +# eglibc-gconv is dynamically added into PACKAGES, thus +# FILES_eglibc-gconv will not be automatically extended in multilib. +# Explicitly add ${MLPREFIX} for FILES_eglibc-gconv. +FILES_${MLPREFIX}eglibc-gconv = "${libdir}/gconv/*" +FILES_${PN}-dbg += "${libdir}/gconv/.debug/*" +FILES_localedef = "${bindir}/localedef" + +LOCALETREESRC = "${STAGING_INCDIR}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}" + +do_install () { + mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir} + if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then + cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir} + fi + if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then + mkdir -p ${D}${localedir} + cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir} + fi + if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then + cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir} + fi + if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then + cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir} + fi + if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then + cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir} + fi + chown root.root -R ${D} + cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR} +} + +inherit libc-package + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-core/eglibc/eglibc-locale_2.19.bb b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb new file mode 100644 index 0000000000..ce6c1d2320 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb @@ -0,0 +1 @@ +require eglibc-locale.inc diff --git a/meta/recipes-core/eglibc/eglibc-mtrace.inc b/meta/recipes-core/eglibc/eglibc-mtrace.inc new file mode 100644 index 0000000000..d68783e439 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-mtrace.inc @@ -0,0 +1,13 @@ +include eglibc-collateral.inc + +SUMMARY = "mtrace utility provided by eglibc" +DESCRIPTION = "mtrace utility provided by eglibc" +RDEPENDS_${PN} = "perl" +RPROVIDES_${PN} = "libc-mtrace" + +SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}" + +do_install() { + install -d -m 0755 ${D}${bindir} + install -m 0755 ${SRC}/mtrace ${D}${bindir}/ +} diff --git a/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb new file mode 100644 index 0000000000..6fa2be9cc9 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb @@ -0,0 +1 @@ +require eglibc-mtrace.inc diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 0000000000..0432758417 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc @@ -0,0 +1,162 @@ +def eglibc_cfg(feature, tokens, cnf): + if type(tokens) == type(""): + tokens = [tokens] + if feature: + cnf.extend([token + '=y' for token in tokens]) + else: + for token in tokens: + cnf.extend([token + '=n']) + if token == 'OPTION_EGLIBC_NSSWITCH': + cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG=\"${S}/nss/nsswitch.conf\""]) + cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS=\"${S}/nss/fixed-nsswitch.functions\""]) + +# Map distro features to eglibc options settings +def features_to_eglibc_settings(d): + cnf = ([]) + + ipv4 = base_contains('DISTRO_FEATURES', 'ipv4', True, False, d) + ipv6 = base_contains('DISTRO_FEATURES', 'ipv6', True, False, d) + libc_backtrace = base_contains('DISTRO_FEATURES', 'libc-backtrace', True, False, d) + libc_big_macros = base_contains('DISTRO_FEATURES', 'libc-big-macros', True, False, d) + libc_bsd = base_contains('DISTRO_FEATURES', 'libc-bsd', True, False, d) + libc_cxx_tests = base_contains('DISTRO_FEATURES', 'libc-cxx-tests', True, False, d) + libc_catgets = base_contains('DISTRO_FEATURES', 'libc-catgets', True, False, d) + libc_charsets = base_contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) + libc_crypt = base_contains('DISTRO_FEATURES', 'libc-crypt', True, False, d) + libc_crypt_ufc = base_contains('DISTRO_FEATURES', 'libc-crypt-ufc', True, False, d) + libc_db_aliases = base_contains('DISTRO_FEATURES', 'libc-db-aliases', True, False, d) + libc_envz = base_contains('DISTRO_FEATURES', 'libc-envz', True, False, d) + libc_fcvt = base_contains('DISTRO_FEATURES', 'libc-fcvt', True, False, d) + libc_fmtmsg = base_contains('DISTRO_FEATURES', 'libc-fmtmsg', True, False, d) + libc_fstab = base_contains('DISTRO_FEATURES', 'libc-fstab', True, False, d) + libc_ftraverse = base_contains('DISTRO_FEATURES', 'libc-ftraverse', True, False, d) + libc_getlogin = base_contains('DISTRO_FEATURES', 'libc-getlogin', True, False, d) + libc_idn = base_contains('DISTRO_FEATURES', 'libc-idn', True, False, d) + libc_inet_anl = base_contains('DISTRO_FEATURES', 'libc-inet-anl', True, False, d) + libc_libm = base_contains('DISTRO_FEATURES', 'libc-libm', True, False, d) + libc_locales = base_contains('DISTRO_FEATURES', 'libc-locales', True, False, d) + libc_locale_code = base_contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d) + libc_memusage = base_contains('DISTRO_FEATURES', 'libc-memusage', True, False, d) + libc_nis = base_contains('DISTRO_FEATURES', 'libc-nis', True, False, d) + libc_nsswitch = base_contains('DISTRO_FEATURES', 'libc-nsswitch', True, False, d) + libc_rcmd = base_contains('DISTRO_FEATURES', 'libc-rcmd', True, False, d) + libc_rtld_debug = base_contains('DISTRO_FEATURES', 'libc-rtld-debug', True, False, d) + libc_spawn = base_contains('DISTRO_FEATURES', 'libc-spawn', True, False, d) + libc_streams = base_contains('DISTRO_FEATURES', 'libc-streams', True, False, d) + libc_sunrpc = base_contains('DISTRO_FEATURES', 'libc-sunrpc', True, False, d) + libc_utmp = base_contains('DISTRO_FEATURES', 'libc-utmp', True, False, d) + libc_utmpx = base_contains('DISTRO_FEATURES', 'libc-utmpx', True, False, d) + libc_wordexp = base_contains('DISTRO_FEATURES', 'libc-wordexp', True, False, d) + libc_posix_clang_wchar = base_contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', True, False, d) + libc_posix_regexp = base_contains('DISTRO_FEATURES', 'libc-posix-regexp', True, False, d) + libc_posix_regexp_glibc = base_contains('DISTRO_FEATURES', 'libc-posix-regexp-glibc', True, False, d) + libc_posix_wchar_io = base_contains('DISTRO_FEATURES', 'libc-posix-wchar-io', True, False, d) + + # arrange the dependencies among eglibc configuable options according to file option-groups.def from eglibc source code + new_dep = True + while new_dep: + new_dep = False + + if ipv6 and not ipv4: + new_dep = True + ipv4 = True + + if ipv4 and not libc_nsswitch: + new_dep = True + libc_nsswitch = True + + if libc_cxx_tests: + if not libc_posix_wchar_io: + new_dep = True + libc_posix_wchar_io = True + if not libc_libm: + new_dep = True + libc_libm = True + + if libc_catgets and not libc_locale_code: + new_dep = True + libc_locale_code = True + + if libc_crypt_ufc and not libc_crypt: + new_dep = True + libc_crypt = True + + if libc_getlogin and not libc_utmp: + new_dep = True + libc_utmp = True + + if libc_inet_anl and not ipv4: + new_dep = True + ipv4 = True + + if libc_locale_code and not libc_posix_clang_wchar: + new_dep = True + libc_posix_clang_wchar = True + + if libc_nis: + if not ipv4: + new_dep = True + ipv4 = True + if not libc_sunrpc: + new_dep = True + libc_sunrpc = True + + if libc_rcmd and not ipv4: + new_dep = True + ipv4 = True + + if libc_sunrpc and not ipv4: + new_dep = True + ipv4 = True + + if libc_utmpx and not libc_utmp: + new_dep = True + libc_utmp = True + + if libc_posix_regexp_glibc and not libc_posix_regexp: + new_dep = True + libc_posix_regexp = True + + if libc_posix_wchar_io and not libc_posix_clang_wchar: + new_dep = True + libc_posix_clang_wchar = True + + eglibc_cfg(ipv6, 'OPTION_EGLIBC_ADVANCED_INET6', cnf) + eglibc_cfg(libc_backtrace, 'OPTION_EGLIBC_BACKTRACE', cnf) + eglibc_cfg(libc_big_macros, 'OPTION_EGLIBC_BIG_MACROS', cnf) + eglibc_cfg(libc_bsd, 'OPTION_EGLIBC_BSD', cnf) + eglibc_cfg(libc_cxx_tests, 'OPTION_EGLIBC_CXX_TESTS', cnf) + eglibc_cfg(libc_catgets, 'OPTION_EGLIBC_CATGETS', cnf) + eglibc_cfg(libc_charsets, 'OPTION_EGLIBC_CHARSETS', cnf) + eglibc_cfg(libc_crypt, 'OPTION_EGLIBC_CRYPT', cnf) + eglibc_cfg(libc_crypt_ufc, 'OPTION_EGLIBC_CRYPT_UFC', cnf) + eglibc_cfg(libc_db_aliases, 'OPTION_EGLIBC_DB_ALIASES', cnf) + eglibc_cfg(libc_envz, 'OPTION_EGLIBC_ENVZ', cnf) + eglibc_cfg(libc_fcvt, 'OPTION_EGLIBC_FCVT', cnf) + eglibc_cfg(libc_fmtmsg, 'OPTION_EGLIBC_FMTMSG', cnf) + eglibc_cfg(libc_fstab, 'OPTION_EGLIBC_FSTAB', cnf) + eglibc_cfg(libc_ftraverse, 'OPTION_EGLIBC_FTRAVERSE', cnf) + eglibc_cfg(libc_getlogin, 'OPTION_EGLIBC_GETLOGIN', cnf) + eglibc_cfg(libc_idn, 'OPTION_EGLIBC_IDN', cnf) + eglibc_cfg(ipv4, 'OPTION_EGLIBC_INET', cnf) + eglibc_cfg(libc_inet_anl, 'OPTION_EGLIBC_INET_ANL', cnf) + eglibc_cfg(libc_libm, 'OPTION_EGLIBC_LIBM', cnf) + eglibc_cfg(libc_locales, 'OPTION_EGLIBC_LOCALES', cnf) + eglibc_cfg(libc_locale_code, 'OPTION_EGLIBC_LOCALE_CODE', cnf) + eglibc_cfg(libc_memusage, 'OPTION_EGLIBC_MEMUSAGE', cnf) + eglibc_cfg(libc_nis, 'OPTION_EGLIBC_NIS', cnf) + eglibc_cfg(libc_nsswitch, 'OPTION_EGLIBC_NSSWITCH', cnf) + eglibc_cfg(libc_rcmd, 'OPTION_EGLIBC_RCMD', cnf) + eglibc_cfg(libc_rtld_debug, 'OPTION_EGLIBC_RTLD_DEBUG', cnf) + eglibc_cfg(libc_spawn, 'OPTION_EGLIBC_SPAWN', cnf) + eglibc_cfg(libc_streams, 'OPTION_EGLIBC_STREAMS', cnf) + eglibc_cfg(libc_sunrpc, 'OPTION_EGLIBC_SUNRPC', cnf) + eglibc_cfg(libc_utmp, 'OPTION_EGLIBC_UTMP', cnf) + eglibc_cfg(libc_utmpx, 'OPTION_EGLIBC_UTMPX', cnf) + eglibc_cfg(libc_wordexp, 'OPTION_EGLIBC_WORDEXP', cnf) + eglibc_cfg(libc_posix_clang_wchar, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf) + eglibc_cfg(libc_posix_regexp, 'OPTION_POSIX_REGEXP', cnf) + eglibc_cfg(libc_posix_regexp_glibc, 'OPTION_POSIX_REGEXP_GLIBC', cnf) + eglibc_cfg(libc_posix_wchar_io, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf) + + return "\n".join(cnf) diff --git a/meta/recipes-core/eglibc/eglibc-package.inc b/meta/recipes-core/eglibc/eglibc-package.inc new file mode 100644 index 0000000000..6721819d2e --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-package.inc @@ -0,0 +1,155 @@ +# +# For now, we will skip building of a gcc package if it is a uclibc one +# and our build is not a uclibc one, and we skip a eglibc one if our build +# is a uclibc build. +# +# See the note in gcc/gcc_3.4.0.oe +# + +python __anonymous () { + import bb, re + uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None) + if uc_os: + raise bb.parse.SkipPackage("incompatible with target %s" % + d.getVar('TARGET_OS', True)) +} + +# Set this to zero if you don't want ldconfig in the output package +USE_LDCONFIG ?= "1" + +PACKAGES = "${PN}-dbg catchsegv sln nscd ldd ${PN}-utils eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc" + +# The ld.so in this eglibc supports the GNU_HASH +RPROVIDES_${PN} = "glibc rtld(GNU_HASH)" +RPROVIDES_${PN}-utils = "glibc-utils" +RPROVIDES_${PN}-mtrace = "glibc-mtrace libc-mtrace" +RPROVIDES_${PN}-pic = "glibc-pic" +RPROVIDES_${PN}-dev = "glibc-dev libc6-dev virtual-libc-dev" +RPROVIDES_${PN}-staticdev = "glibc-staticdev" +RPROVIDES_${PN}-doc = "glibc-doc" +RPROVIDES_eglibc-extra-nss = "glibc-extra-nss" +RPROVIDES_eglibc-thread-db = "glibc-thread-db" +RPROVIDES_${PN}-pcprofile = "glibc-pcprofile" +RPROVIDES_${PN}-dbg = "glibc-dbg" +libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so" + +FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}" +FILES_ldd = "${bindir}/ldd" +FILES_libsegfault = "${base_libdir}/libSegFault*" +FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" +FILES_libmemusage = "${base_libdir}/libmemusage.so" +FILES_eglibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" +FILES_sln = "/sbin/sln" +FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o" +FILES_libsotruss = "${libdir}/audit/sotruss-lib.so" +FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}" +FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal" +FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a" +FILES_nscd = "${sbindir}/nscd*" +FILES_${PN}-mtrace = "${bindir}/mtrace" +FILES_${PN}-utils = "${bindir}/* ${sbindir}/*" +FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug" +FILES_catchsegv = "${bindir}/catchsegv" +RDEPENDS_catchsegv = "libsegfault" +FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so" +FILES_eglibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so" +RPROVIDES_${PN}-dev += "libc-dev" +RPROVIDES_${PN}-staticdev += "libc-staticdev" + +SUMMARY_sln = "The static ln" +DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional." +SUMMARY_nscd = "Name service cache daemon" +DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services." +SUMMARY_eglibc-extra-nss = "hesiod, NIS and NIS+ nss libraries" +DESCRIPTION_eglibc-extra-nss = "eglibc: nis, nisplus and hesiod search services." +SUMMARY_ldd = "print shared library dependencies" +DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line." +SUMMARY_${PN}-utils = "Miscellaneous utilities provided by eglibc" +DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconf, locale, gencat, tzselect, zic, rpcinfo, ..." +DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs" + +inherit libc-common multilib_header + +do_install_append () { + rm -f ${D}${sysconfdir}/localtime + rm -rf ${D}${localstatedir} + + # remove empty eglibc dir + if [ -d ${D}${libdir}/eglibc -a ! -e ${D}${libdir}/eglibc/pt_chown ]; then + rmdir ${D}${libdir}/eglibc + fi + oe_multilib_header bits/syscall.h + + if [ -f ${D}${bindir}/mtrace ]; then + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace + fi + rm -rf ${D}${includedir}/rpcsvc/rquota* + # Info dir listing isn't interesting at this point so remove it if it exists. + if [ -e "${D}${infodir}/dir" ]; then + rm -f ${D}${infodir}/dir + fi + + if [ "${USE_LDCONFIG}" != "1" ]; then + # We won't ship this file (see FILES above) so let's not install it + rm -f ${D}${sysconfdir}/ld.so.conf + # This directory will be empty now so remove it too. + # But check whether it exists first, since it won't for eglibc-initial. + if [ -d ${D}${sysconfdir} ]; then + rmdir ${D}${sysconfdir} + fi + fi +} + +do_install_locale () { + dest=${D}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS} + install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir} + if [ "${base_libdir}" != "${libdir}" ]; then + cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir} + fi + if [ -e ${D}${bindir}/localedef ]; then + mv -f ${D}${bindir}/localedef ${dest}${bindir} + fi + if [ -e ${D}${libdir}/gconv ]; then + mv -f ${D}${libdir}/gconv ${dest}${libdir} + fi + if [ -e ${D}${exec_prefix}/lib ]; then + cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix} + fi + if [ -e ${D}${datadir}/i18n ]; then + mv ${D}${datadir}/i18n ${dest}${datadir} + fi + cp -fpPR ${D}${datadir}/* ${dest}${datadir} + rm -rf ${D}${datadir}/locale/ + cp -fpPR ${WORKDIR}/SUPPORTED ${dest} +} + +addtask do_install_locale after do_install before do_populate_sysroot do_package + +bashscripts = "mtrace sotruss xtrace" + +do_evacuate_scripts () { + target=${D}${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS} + mkdir -p $target + for i in ${bashscripts}; do + if [ -f ${D}${bindir}/$i ]; then + cp ${D}${bindir}/$i $target/ + fi + done +} + +addtask evacuate_scripts after do_install before do_populate_sysroot do_package + +PACKAGE_PREPROCESS_FUNCS += "eglibc_package_preprocess" + +eglibc_package_preprocess () { + rm -rf ${PKGD}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS} + rm -rf ${PKGD}/${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS} + for i in ${bashscripts}; do + rm -f ${PKGD}${bindir}/$i + done + rm -rf ${PKGD}/${localedir} + if [ "${libdir}" != "${exec_prefix}/lib" ]; then + # This dir only exists to hold locales + rm -rf ${PKGD}${exec_prefix}/lib + fi +} diff --git a/meta/recipes-core/eglibc/eglibc-scripts.inc b/meta/recipes-core/eglibc/eglibc-scripts.inc new file mode 100644 index 0000000000..9ca6673404 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-scripts.inc @@ -0,0 +1,16 @@ +include eglibc-collateral.inc + +SUMMARY = "utility scripts provided by eglibc" +DESCRIPTION = "utility scripts provided by eglibc" +RDEPENDS_${PN} = "bash eglibc-mtrace" + +SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}" + +bashscripts = "sotruss xtrace" + +do_install() { + install -d -m 0755 ${D}${bindir} + for i in ${bashscripts}; do + install -m 0755 ${SRC}/$i ${D}${bindir}/ + done +} diff --git a/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb new file mode 100644 index 0000000000..31133621d1 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb @@ -0,0 +1 @@ +require eglibc-scripts.inc diff --git a/meta/recipes-core/eglibc/eglibc-testing.inc b/meta/recipes-core/eglibc/eglibc-testing.inc new file mode 100644 index 0000000000..ab3ec1555f --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-testing.inc @@ -0,0 +1,79 @@ +do_compile_append () { + # now generate script to drive testing + echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testeglibc + set >> ${B}/${HOST_PREFIX}testeglibc + # prune out the unneeded vars + sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PATCH_GET/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testeglibc + sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testeglibc + + # point to real sysroot not the toolchain bootstrap sysroot + sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testeglibc + + # use the final cross-gcc to test since some tests need libstdc++ + sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testeglibc + + # append execution part script +cat >> ${B}/${HOST_PREFIX}testeglibc << STOP +target="\$1" +if [ "x\$target" = "x" ] +then + echo "Please specify the target machine and remote user in form of user@target" + exit 1; +fi +ssh \$target ls \$PWD\ 2>&1 > /dev/null +if [ "x\$?" != "x0" ] +then + echo "Failed connecting to \$target it could be because of:" + echo "1. You dont have passwordless ssh setup to access \$target" + echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout." + echo " The tree should be accessible at same location on build host and target" + echo " You can add nfs-server to IMAGE_FEATURES to get the nfs client on target" + echo "3. nfs server on build host is not running." + echo " Please make sure that you have 'no_root_squash' added in /etc/exports if you want" + echo " to test as root user on target (usually its recommended to create a non" + echo " root user." + echo " As a sanity check make sure that target can read/write to the eglibc build tree" + echo " Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup" + exit 1 +fi + echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms + echo "# definitions that come from ${B}/config.make" >> ${B}/configparms + + fgrep tcbootstrap ${B}/config.make > ${B}/configparms + sed -i -e "s/\-tcbootstrap//g" ${B}/configparms +wrapper="${S}/scripts/cross-test-ssh.sh \$target" +localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4" +make tests-clean +make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check +rm -rf ${B}/configparms +STOP + + chmod +x ${B}/${HOST_PREFIX}testeglibc +} diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc new file mode 100644 index 0000000000..375b9bc116 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc.inc @@ -0,0 +1,84 @@ +require eglibc-common.inc +require eglibc-ld.inc +require eglibc-testing.inc + +STAGINGCC = "gcc-cross-initial" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial" +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" + +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +# eglibc can't be built without optimization, if someone tries to compile an +# entire image as -O0, we override it with -O2 here and give a note about it. +def get_optimization(d): + selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True) + if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": + bb.note("eglibc can't be built with -O0, -O2 will be used instead.") + return selected_optimization.replace("-O0", "-O2") + return selected_optimization + +SELECTED_OPTIMIZATION := "${@get_optimization(d)}" + +# siteconfig.bbclass runs configure which needs a working compiler +# For the compiler to work we need a working libc yet libc isn't +# in the sysroots directory at this point. This means the libc.so +# linker script won't work as the --sysroot setting isn't correct. +# Here we create a hacked up libc linker script and pass in the right +# flags to let configure work. Ugly. +EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'" +siteconfig_do_siteconfig_gencache_prepend = " \ + mkdir -p ${WORKDIR}/site_config_libc; \ + cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ + sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ +" + +# nptl needs unwind support in gcc, which can't be built without glibc. +DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial" +# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this +#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}" +PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" +PROVIDES += "virtual/libintl virtual/libiconv" +inherit autotools +require eglibc-options.inc + +LEAD_SONAME = "libc.so" + +CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \ + ac_cv_path_BASH_SHELL=${base_bindir}/bash \ + libc_cv_localedir=${localedir} \ + libc_cv_ssp=no \ + " + +GLIBC_EXTRA_OECONF ?= "" +GLIBC_EXTRA_OECONF_class-nativesdk = "" +INHIBIT_DEFAULT_DEPS = "1" + +ARM_INSTRUCTION_SET = "arm" + +# eglibc uses PARALLELMFLAGS variable to pass parallel build info so transfer +# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE +EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}"" +EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM" +EXTRA_OEMAKE += "${EGLIBCPARALLELISM}" +PARALLEL_MAKE = "" + +# eglibc make-syscalls.sh has a number of issues with /bin/dash and +# it's output which make calls via the SHELL also has issues, so +# ensure make uses /bin/bash +EXTRA_OEMAKE += "SHELL=/bin/bash" + +OE_FEATURES = "${@features_to_eglibc_settings(d)}" +do_configure_prepend() { + sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in + echo '${OE_FEATURES}' > ${B}/option-groups.config +} + +do_configure_append() { + oe_runmake config + + # Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will + # avoid install error. + sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config +} + +GLIBC_ADDONS ?= "ports,nptl,libidn" diff --git a/meta/recipes-core/eglibc/eglibc_2.19.bb b/meta/recipes-core/eglibc/eglibc_2.19.bb new file mode 100644 index 0000000000..8f096769ee --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc_2.19.bb @@ -0,0 +1,146 @@ +require eglibc.inc + +DEPENDS += "gperf-native kconfig-frontends-native" + +SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \ + file://eglibc-svn-arm-lowlevellock-include-tls.patch \ + file://IO-acquire-lock-fix.patch \ + file://mips-rld-map-check.patch \ + file://etc/ld.so.conf \ + file://generate-supported.mk \ + file://glibc.fix_sqrt2.patch \ + file://multilib_readlib.patch \ + file://ppc-sqrt_finite.patch \ + file://GLRO_dl_debug_mask.patch \ + file://initgroups_keys.patch \ + file://eglibc_fix_findidx_parameters.patch \ + file://ppc_slow_ieee754_sqrt.patch \ + file://fileops-without-wchar-io.patch \ + file://add_resource_h_to_wait_h.patch \ + file://0001-eglibc-menuconfig-support.patch \ + file://0002-eglibc-menuconfig-hex-string-options.patch \ + file://0003-eglibc-menuconfig-build-instructions.patch \ + file://fsl-ppc-no-fsqrt.patch \ + file://0001-R_ARM_TLS_DTPOFF32.patch \ + file://0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ + file://fix-tibetian-locales.patch \ + file://ppce6500-32b_slow_ieee754_sqrt.patch \ + " +SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd" +SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c" + +LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI_append_class-nativesdk = " file://ld-search-order.patch \ + file://relocatable_sdk.patch \ + file://relocatable_sdk_fix_openpath.patch \ + " +S = "${WORKDIR}/eglibc-${PV}/libc" +B = "${WORKDIR}/build-${TARGET_SYS}" + +PACKAGES_DYNAMIC = "" + +# the -isystem in bitbake.conf screws up glibc do_stage +BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" +TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" + +GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIRNAME}/eglibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}" + +# +# For now, we will skip building of a gcc package if it is a uclibc one +# and our build is not a uclibc one, and we skip a glibc one if our build +# is a uclibc build. +# +# See the note in gcc/gcc_3.4.0.oe +# + +python __anonymous () { + import re + uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None) + if uc_os: + raise bb.parse.SkipPackage("incompatible with target %s" % + d.getVar('TARGET_OS', True)) +} + +export libc_cv_slibdir = "${base_libdir}" + +EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ + --without-cvs --disable-profile \ + --disable-debug --without-gd \ + --enable-clocale=gnu \ + --enable-add-ons \ + --with-headers=${STAGING_INCDIR} \ + --without-selinux \ + --enable-obsolete-rpc \ + --with-kconfig=${STAGING_BINDIR_NATIVE} \ + ${GLIBC_EXTRA_OECONF}" + +EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" + +do_patch_append() { + bb.build.exec_func('do_fix_readlib_c', d) +} + +# for mips eglibc now builds syscall tables for all abi's +# so we make sure that we choose right march option which is +# compatible with o32,n32 and n64 abi's +# e.g. -march=mips32 is not compatible with n32 and n64 therefore +# we filter it out in such case -march=from-abi which will be +# mips1 when using o32 and mips3 when using n32/n64 + +TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}" +TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}" + +do_fix_readlib_c () { + sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c +} + +do_configure () { +# override this function to avoid the autoconf/automake/aclocal/autoheader +# calls for now +# don't pass CPPFLAGS into configure, since it upsets the kernel-headers +# version check and doesn't really help with anything + if [ -z "`which rpcgen`" ]; then + echo "rpcgen not found. Install glibc-devel." + exit 1 + fi + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + find ${S} -name "configure" | xargs touch + CPPFLAGS="" oe_runconf +} + +rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \ + yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \ + rusers.x spray.x nfs_prot.x rquota.x key_prot.x" + +do_compile () { + # -Wl,-rpath-link /lib in LDFLAGS can cause breakage if another glibc is in staging + unset LDFLAGS + base_do_compile + ( + cd ${S}/sunrpc/rpcsvc + for r in ${rpcsvc}; do + h=`echo $r|sed -e's,\.x$,.h,'` + rpcgen -h $r -o $h || bbwarn "unable to generate header for $r" + done + ) + echo "Adjust ldd script" + if [ -n "${RTLDLIST}" ] + then + prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'` + if [ "${prevrtld}" != "${RTLDLIST}" ] + then + sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#" + fi + fi + +} + +require eglibc-package.inc + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch new file mode 100644 index 0000000000..cdfeaeadd8 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch @@ -0,0 +1,331 @@ +Upstream-Status: Inappropriate [embedded specific] + +We run the ldconfig in the cross fashion. make the code bitsize aware so that +we can cross build ldconfig cache for various architectures. + +Richard Purdie 2009/05/19 +Nitin A Kamble 2009/03/29 + +Index: ldconfig-native-2.12.1/readelflib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readelflib.c ++++ ldconfig-native-2.12.1/readelflib.c +@@ -40,39 +40,212 @@ do \ + + /* Returns 0 if everything is ok, != 0 in case of error. */ + int +-process_elf_file (const char *file_name, const char *lib, int *flag, ++process_elf_file32 (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) + { + int i; + unsigned int j; +- ElfW(Addr) loadaddr; ++ Elf32_Addr loadaddr; + unsigned int dynamic_addr; + size_t dynamic_size; + char *program_interpreter; + +- ElfW(Ehdr) *elf_header; +- ElfW(Phdr) *elf_pheader, *segment; +- ElfW(Dyn) *dynamic_segment, *dyn_entry; ++ Elf32_Ehdr *elf_header; ++ Elf32_Phdr *elf_pheader, *segment; ++ Elf32_Dyn *dynamic_segment, *dyn_entry; + char *dynamic_strings; + +- elf_header = (ElfW(Ehdr) *) file_contents; ++ elf_header = (Elf32_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) ++ if (elf_header->e_type != ET_DYN) + { +- if (opt_verbose) ++ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, ++ elf_header->e_type); ++ return 1; ++ } ++ ++ /* Get information from elf program header. */ ++ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents); ++ check_ptr (elf_pheader); ++ ++ /* The library is an elf library, now search for soname and ++ libc5/libc6. */ ++ *flag = FLAG_ELF; ++ ++ loadaddr = -1; ++ dynamic_addr = 0; ++ dynamic_size = 0; ++ program_interpreter = NULL; ++ for (i = 0, segment = elf_pheader; ++ i < elf_header->e_phnum; i++, segment++) ++ { ++ check_ptr (segment); ++ ++ switch (segment->p_type) + { +- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) +- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name); +- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) +- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name); +- else +- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); ++ case PT_LOAD: ++ if (loadaddr == (Elf32_Addr) -1) ++ loadaddr = segment->p_vaddr - segment->p_offset; ++ break; ++ ++ case PT_DYNAMIC: ++ if (dynamic_addr) ++ error (0, 0, _("more than one dynamic segment\n")); ++ ++ dynamic_addr = segment->p_offset; ++ dynamic_size = segment->p_filesz; ++ break; ++ ++ case PT_INTERP: ++ program_interpreter = (char *) (file_contents + segment->p_offset); ++ check_ptr (program_interpreter); ++ ++ /* Check if this is enough to classify the binary. */ ++ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]); ++ ++j) ++ if (strcmp (program_interpreter, interpreters[j].soname) == 0) ++ { ++ *flag = interpreters[j].flag; ++ break; ++ } ++ break; ++ ++ case PT_NOTE: ++ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ { ++ Elf32_Word *abi_note = (Elf32_Word *) (file_contents ++ + segment->p_offset); ++ Elf32_Addr size = segment->p_filesz; ++ ++ while (abi_note [0] != 4 || abi_note [1] != 16 ++ || abi_note [2] != 1 ++ || memcmp (abi_note + 3, "GNU", 4) != 0) ++ { ++#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word))) ++ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word)) ++ + ROUND (abi_note[0]) ++ + ROUND (abi_note[1]); ++ ++ if (size - 32 < note_size || note_size == 0) ++ { ++ size = 0; ++ break; ++ } ++ size -= note_size; ++ abi_note = (void *) abi_note + note_size; ++ } ++ ++ if (size == 0) ++ break; ++ ++ *osversion = (abi_note [4] << 24) | ++ ((abi_note [5] & 0xff) << 16) | ++ ((abi_note [6] & 0xff) << 8) | ++ (abi_note [7] & 0xff); ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ } ++ if (loadaddr == (Elf32_Addr) -1) ++ { ++ /* Very strange. */ ++ loadaddr = 0; ++ } ++ ++ /* Now we can read the dynamic sections. */ ++ if (dynamic_size == 0) ++ return 1; ++ ++ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr); ++ check_ptr (dynamic_segment); ++ ++ /* Find the string table. */ ++ dynamic_strings = NULL; ++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ ++dyn_entry) ++ { ++ check_ptr (dyn_entry); ++ if (dyn_entry->d_tag == DT_STRTAB) ++ { ++ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ check_ptr (dynamic_strings); ++ break; + } +- return 1; + } + ++ if (dynamic_strings == NULL) ++ return 1; ++ ++ /* Now read the DT_NEEDED and DT_SONAME entries. */ ++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ ++dyn_entry) ++ { ++ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ { ++ char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ check_ptr (name); ++ ++ if (dyn_entry->d_tag == DT_NEEDED) ++ { ++ ++ if (*flag == FLAG_ELF) ++ { ++ /* Check if this is enough to classify the binary. */ ++ for (j = 0; ++ j < sizeof (known_libs) / sizeof (known_libs [0]); ++ ++j) ++ if (strcmp (name, known_libs [j].soname) == 0) ++ { ++ *flag = known_libs [j].flag; ++ break; ++ } ++ } ++ } ++ ++ else if (dyn_entry->d_tag == DT_SONAME) ++ *soname = xstrdup (name); ++ ++ /* Do we have everything we need? */ ++ if (*soname && *flag != FLAG_ELF) ++ return 0; ++ } ++ } ++ ++ /* We reach this point only if the file doesn't contain a DT_SONAME ++ or if we can't classify the library. If it doesn't have a ++ soname, return the name of the library. */ ++ if (*soname == NULL) ++ *soname = xstrdup (lib); ++ ++ return 0; ++} ++ ++int ++process_elf_file64 (const char *file_name, const char *lib, int *flag, ++ unsigned int *osversion, char **soname, void *file_contents, ++ size_t file_length) ++{ ++ int i; ++ unsigned int j; ++ Elf64_Addr loadaddr; ++ unsigned int dynamic_addr; ++ size_t dynamic_size; ++ char *program_interpreter; ++ ++ Elf64_Ehdr *elf_header; ++ Elf64_Phdr *elf_pheader, *segment; ++ Elf64_Dyn *dynamic_segment, *dyn_entry; ++ char *dynamic_strings; ++ ++ elf_header = (Elf64_Ehdr *) file_contents; ++ *osversion = 0; ++ + if (elf_header->e_type != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +@@ -81,7 +254,7 @@ process_elf_file (const char *file_name, + } + + /* Get information from elf program header. */ +- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -100,7 +273,7 @@ process_elf_file (const char *file_name, + switch (segment->p_type) + { + case PT_LOAD: +- if (loadaddr == (ElfW(Addr)) -1) ++ if (loadaddr == (Elf64_Addr) -1) + loadaddr = segment->p_vaddr - segment->p_offset; + break; + +@@ -129,16 +302,16 @@ process_elf_file (const char *file_name, + case PT_NOTE: + if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) + { +- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents ++ Elf64_Word *abi_note = (Elf64_Word *) (file_contents + + segment->p_offset); +- ElfW(Addr) size = segment->p_filesz; ++ Elf64_Addr size = segment->p_filesz; + + while (abi_note [0] != 4 || abi_note [1] != 16 + || abi_note [2] != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { +-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word))) +- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word)) ++#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word)) ++ Elf64_Addr note_size = 3 * sizeof (Elf64_Word) + + ROUND (abi_note[0]) + + ROUND (abi_note[1]); + +@@ -166,7 +339,7 @@ process_elf_file (const char *file_name, + } + + } +- if (loadaddr == (ElfW(Addr)) -1) ++ if (loadaddr == (Elf64_Addr) -1) + { + /* Very strange. */ + loadaddr = 0; +@@ -176,7 +349,7 @@ process_elf_file (const char *file_name, + if (dynamic_size == 0) + return 1; + +- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr); ++ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr); + check_ptr (dynamic_segment); + + /* Find the string table. */ +@@ -233,3 +406,33 @@ process_elf_file (const char *file_name, + + return 0; + } ++/* Returns 0 if everything is ok, != 0 in case of error. */ ++int ++process_elf_file (const char *file_name, const char *lib, int *flag, ++ unsigned int *osversion, char **soname, void *file_contents, ++ size_t file_length) ++{ ++ int i; ++ unsigned int j; ++ ElfW(Addr) loadaddr; ++ unsigned int dynamic_addr; ++ size_t dynamic_size; ++ char *program_interpreter; ++ ++ ElfW(Ehdr) *elf_header; ++ ElfW(Phdr) *elf_pheader, *segment; ++ ElfW(Dyn) *dynamic_segment, *dyn_entry; ++ char *dynamic_strings; ++ ++ elf_header = (ElfW(Ehdr) *) file_contents; ++ *osversion = 0; ++ ++ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) ++ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length); ++ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) ++ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length); ++ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); ++ return 1; ++} ++ ++ diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README new file mode 100644 index 0000000000..43fb983729 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README @@ -0,0 +1,8 @@ +The files are pulled verbatim from glibc 2.5 and then patched to allow +standalone compilation of ldconfig. + +Richard Purdie +OpenedHand Ltd. + +Upgraded the ldconfig recipe to eglibc 2.12.1 +Nitin A Kamble 2011/03/29 diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch new file mode 100644 index 0000000000..7f8e4db78a --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch @@ -0,0 +1,454 @@ +Upstream-Status: Inappropriate [embedded specific] + +Do data input/output handling according to endien-ness of the library file. That +enables use of ldconfig in the cross fashion for any architecture. + +2011/04/04 +Richard Purdie +Nitin Kamble + +Index: ldconfig-native-2.12.1/readelflib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readelflib.c ++++ ldconfig-native-2.12.1/readelflib.c +@@ -38,6 +38,28 @@ do \ + } \ + while (0); + ++int be; ++static uint16_t read16(uint16_t x, int be) ++{ ++ if (be) ++ return be16toh(x); ++ return le16toh(x); ++} ++ ++static uint32_t read32(uint32_t x, int be) ++{ ++ if (be) ++ return be32toh(x); ++ return le32toh(x); ++} ++ ++static uint64_t read64(uint64_t x, int be) ++{ ++ if (be) ++ return be64toh(x); ++ return le64toh(x); ++} ++ + /* Returns 0 if everything is ok, != 0 in case of error. */ + int + process_elf_file32 (const char *file_name, const char *lib, int *flag, +@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam + elf_header = (Elf32_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_type != ET_DYN) ++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB); ++ ++ if (read16(elf_header->e_type, be) != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +- elf_header->e_type); ++ read16(elf_header->e_type, be)); + return 1; + } + + /* Get information from elf program header. */ +- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam + dynamic_size = 0; + program_interpreter = NULL; + for (i = 0, segment = elf_pheader; +- i < elf_header->e_phnum; i++, segment++) ++ i < read16(elf_header->e_phnum, be); i++, segment++) + { + check_ptr (segment); + +- switch (segment->p_type) ++ switch (read32(segment->p_type, be)) + { + case PT_LOAD: + if (loadaddr == (Elf32_Addr) -1) +- loadaddr = segment->p_vaddr - segment->p_offset; ++ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be); + break; + + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); + +- dynamic_addr = segment->p_offset; +- dynamic_size = segment->p_filesz; ++ dynamic_addr = read32(segment->p_offset, be); ++ dynamic_size = read32(segment->p_filesz, be); + break; + + case PT_INTERP: +- program_interpreter = (char *) (file_contents + segment->p_offset); ++ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be)); + check_ptr (program_interpreter); + + /* Check if this is enough to classify the binary. */ +@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam + break; + + case PT_NOTE: +- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4) + { + Elf32_Word *abi_note = (Elf32_Word *) (file_contents +- + segment->p_offset); +- Elf32_Addr size = segment->p_filesz; ++ + read32(segment->p_offset, be)); ++ Elf32_Addr size = read32(segment->p_filesz, be); + +- while (abi_note [0] != 4 || abi_note [1] != 16 +- || abi_note [2] != 1 ++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16 ++ || read32(abi_note [2], be) != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { +-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word))) +- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word)) +- + ROUND (abi_note[0]) +- + ROUND (abi_note[1]); ++#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word)) ++ Elf32_Addr note_size = 3 * sizeof (Elf32_Word) ++ + ROUND (read32(abi_note[0], be)) ++ + ROUND (read32(abi_note[1], be)); + + if (size - 32 < note_size || note_size == 0) + { +@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam + if (size == 0) + break; + +- *osversion = (abi_note [4] << 24) | +- ((abi_note [5] & 0xff) << 16) | +- ((abi_note [6] & 0xff) << 8) | +- (abi_note [7] & 0xff); ++ *osversion = (read32(abi_note [4], be) << 24) | ++ ((read32(abi_note [5], be) & 0xff) << 16) | ++ ((read32(abi_note [6], be) & 0xff) << 8) | ++ (read32(abi_note [7], be) & 0xff); + } + break; + +@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam + + /* Find the string table. */ + dynamic_strings = NULL; +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { + check_ptr (dyn_entry); +- if (dyn_entry->d_tag == DT_STRTAB) ++ if (read32(dyn_entry->d_tag, be) == DT_STRTAB) + { +- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr); + check_ptr (dynamic_strings); + break; + } +@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam + return 1; + + /* Now read the DT_NEEDED and DT_SONAME entries. */ +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { +- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME) + { +- char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be); + check_ptr (name); + +- if (dyn_entry->d_tag == DT_NEEDED) ++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED) + { + + if (*flag == FLAG_ELF) +@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam + } + } + +- else if (dyn_entry->d_tag == DT_SONAME) ++ else if (read32(dyn_entry->d_tag, be) == DT_SONAME) + *soname = xstrdup (name); + + /* Do we have everything we need? */ +@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam + elf_header = (Elf64_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_type != ET_DYN) ++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB); ++ ++ if (read16(elf_header->e_type, be) != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +- elf_header->e_type); ++ read16(elf_header->e_type, be)); + return 1; + } + + /* Get information from elf program header. */ +- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam + dynamic_size = 0; + program_interpreter = NULL; + for (i = 0, segment = elf_pheader; +- i < elf_header->e_phnum; i++, segment++) ++ i < read16(elf_header->e_phnum, be); i++, segment++) + { + check_ptr (segment); + +- switch (segment->p_type) ++ switch (read32(segment->p_type, be)) + { + case PT_LOAD: + if (loadaddr == (Elf64_Addr) -1) +- loadaddr = segment->p_vaddr - segment->p_offset; ++ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be); + break; + + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); + +- dynamic_addr = segment->p_offset; +- dynamic_size = segment->p_filesz; ++ dynamic_addr = read64(segment->p_offset, be); ++ dynamic_size = read32(segment->p_filesz, be); + break; + + case PT_INTERP: +- program_interpreter = (char *) (file_contents + segment->p_offset); ++ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be)); + check_ptr (program_interpreter); + + /* Check if this is enough to classify the binary. */ +@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam + break; + + case PT_NOTE: +- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4) + { + Elf64_Word *abi_note = (Elf64_Word *) (file_contents +- + segment->p_offset); +- Elf64_Addr size = segment->p_filesz; ++ + read64(segment->p_offset, be)); ++ Elf64_Addr size = read32(segment->p_filesz, be); + +- while (abi_note [0] != 4 || abi_note [1] != 16 +- || abi_note [2] != 1 ++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16 ++ || read32(abi_note [2], be) != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { ++#undef ROUND + #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word)) + Elf64_Addr note_size = 3 * sizeof (Elf64_Word) +- + ROUND (abi_note[0]) +- + ROUND (abi_note[1]); ++ + ROUND (read32(abi_note[0], be)) ++ + ROUND (read32(abi_note[1], be)); + + if (size - 32 < note_size || note_size == 0) + { +@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam + if (size == 0) + break; + +- *osversion = (abi_note [4] << 24) | +- ((abi_note [5] & 0xff) << 16) | +- ((abi_note [6] & 0xff) << 8) | +- (abi_note [7] & 0xff); ++ *osversion = (read32(abi_note [4], be) << 24) | ++ ((read32(abi_note [5], be) & 0xff) << 16) | ++ ((read32(abi_note [6], be) & 0xff) << 8) | ++ (read32(abi_note [7], be) & 0xff); + } + break; + +@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam + + /* Find the string table. */ + dynamic_strings = NULL; +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { + check_ptr (dyn_entry); +- if (dyn_entry->d_tag == DT_STRTAB) ++ if (read64(dyn_entry->d_tag, be) == DT_STRTAB) + { +- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr); + check_ptr (dynamic_strings); + break; + } +@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam + return 1; + + /* Now read the DT_NEEDED and DT_SONAME entries. */ +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { +- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME) + { +- char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be); + check_ptr (name); + +- if (dyn_entry->d_tag == DT_NEEDED) ++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED) + { + + if (*flag == FLAG_ELF) +@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam + } + } + +- else if (dyn_entry->d_tag == DT_SONAME) ++ else if (read64(dyn_entry->d_tag, be) == DT_SONAME) + *soname = xstrdup (name); + + /* Do we have everything we need? */ +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -169,7 +169,8 @@ process_file (const char *real_file_name + ret = 1; + } + /* Libraries have to be shared object files. */ +- else if (elf_header->e_type != ET_DYN) ++ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) || ++ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN)) + ret = 1; + else if (process_elf_file (file_name, lib, flag, osversion, soname, + file_contents, statbuf.st_size)) +Index: ldconfig-native-2.12.1/cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/cache.c ++++ ldconfig-native-2.12.1/cache.c +@@ -39,6 +39,29 @@ + # define N_(msgid) msgid + #define _(msg) msg + ++extern int be; ++ ++static uint16_t write16(uint16_t x, int be) ++{ ++ if (be) ++ return htobe16(x); ++ return htole16(x); ++} ++ ++static uint32_t write32(uint32_t x, int be) ++{ ++ if (be) ++ return htobe32(x); ++ return htole32(x); ++} ++ ++static uint64_t write64(uint64_t x, int be) ++{ ++ if (be) ++ return htobe64(x); ++ return htole64(x); ++} ++ + struct cache_entry + { + char *lib; /* Library name. */ +@@ -279,7 +302,12 @@ save_cache (const char *cache_name) + /* Number of normal cache entries. */ + int cache_entry_old_count = 0; + +- for (entry = entries; entry != NULL; entry = entry->next) ++ if (be) ++ printf("saving cache in big endian encoding\n"); ++ else ++ printf("saving cache in little endian encoding\n"); ++ ++ for (entry = entries; entry != NULL; entry = entry->next) + { + /* Account the final NULs. */ + total_strlen += strlen (entry->lib) + strlen (entry->path) + 2; +@@ -310,7 +338,7 @@ save_cache (const char *cache_name) + memset (file_entries, '\0', sizeof (struct cache_file)); + memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1); + +- file_entries->nlibs = cache_entry_old_count; ++ file_entries->nlibs = write32(cache_entry_old_count, be); + } + + struct cache_file_new *file_entries_new = NULL; +@@ -330,8 +358,8 @@ save_cache (const char *cache_name) + memcpy (file_entries_new->version, CACHE_VERSION, + sizeof CACHE_VERSION - 1); + +- file_entries_new->nlibs = cache_entry_count; +- file_entries_new->len_strings = total_strlen; ++ file_entries_new->nlibs = write32(cache_entry_count, be); ++ file_entries_new->len_strings = write32(total_strlen, be); + } + + /* Pad for alignment of cache_file_new. */ +@@ -358,9 +386,9 @@ save_cache (const char *cache_name) + /* First the library. */ + if (opt_format != 2 && entry->hwcap == 0) + { +- file_entries->libs[idx_old].flags = entry->flags; ++ file_entries->libs[idx_old].flags = write32(entry->flags, be); + /* XXX: Actually we can optimize here and remove duplicates. */ +- file_entries->libs[idx_old].key = str_offset + pad; ++ file_entries->libs[idx_old].key = write32(str_offset + pad, be); + } + if (opt_format != 0) + { +@@ -368,10 +396,10 @@ save_cache (const char *cache_name) + not doing so makes the code easier, the string table + always begins at the beginning of the the new cache + struct. */ +- file_entries_new->libs[idx_new].flags = entry->flags; +- file_entries_new->libs[idx_new].osversion = entry->osversion; +- file_entries_new->libs[idx_new].hwcap = entry->hwcap; +- file_entries_new->libs[idx_new].key = str_offset; ++ file_entries_new->libs[idx_new].flags = write32(entry->flags, be); ++ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be); ++ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be); ++ file_entries_new->libs[idx_new].key = write32(str_offset, be); + } + + size_t len = strlen (entry->lib) + 1; +@@ -379,9 +407,9 @@ save_cache (const char *cache_name) + str_offset += len; + /* Then the path. */ + if (opt_format != 2 && entry->hwcap == 0) +- file_entries->libs[idx_old].value = str_offset + pad; ++ file_entries->libs[idx_old].value = write32(str_offset + pad, be); + if (opt_format != 0) +- file_entries_new->libs[idx_new].value = str_offset; ++ file_entries_new->libs[idx_new].value = write32(str_offset, be); + len = strlen (entry->path) + 1; + str = mempcpy (str, entry->path, len); + str_offset += len; diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch new file mode 100644 index 0000000000..a18b2c20de --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch @@ -0,0 +1,113 @@ +Upstream-Status: Inappropriate [fix poky patch] + +This patch fixes build issues with a previous endian-ness_handling.patch on +distros that don't have macros referenced + +7/20/2011 +Matthew McClintock + +diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h +--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600 ++++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500 +@@ -0,0 +1,64 @@ ++/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++ ++#ifndef _ENDIAN_EXTRA_H ++#define _ENDIAN_EXTRA_H 1 ++ ++/* Don't redefine these macros if they already exist */ ++#ifndef htobe16 ++#ifdef __USE_BSD ++/* Conversion interfaces. */ ++# include ++ ++# if __BYTE_ORDER == __LITTLE_ENDIAN ++# define htobe16(x) __bswap_16 (x) ++# define htole16(x) (x) ++# define be16toh(x) __bswap_16 (x) ++# define le16toh(x) (x) ++ ++# define htobe32(x) __bswap_32 (x) ++# define htole32(x) (x) ++# define be32toh(x) __bswap_32 (x) ++# define le32toh(x) (x) ++ ++# define htobe64(x) __bswap_64 (x) ++# define htole64(x) (x) ++# define be64toh(x) __bswap_64 (x) ++# define le64toh(x) (x) ++# else ++# define htobe16(x) (x) ++# define htole16(x) __bswap_16 (x) ++# define be16toh(x) (x) ++# define le16toh(x) __bswap_16 (x) ++ ++# define htobe32(x) (x) ++# define htole32(x) __bswap_32 (x) ++# define be32toh(x) (x) ++# define le32toh(x) __bswap_32 (x) ++ ++# define htobe64(x) (x) ++# define htole64(x) __bswap_64 (x) ++# define be64toh(x) (x) ++# define le64toh(x) __bswap_64 (x) ++# endif ++#endif ++#endif ++ ++#endif /* endian_extra.h */ +diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c +--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500 ++++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500 +@@ -39,6 +39,8 @@ + # define N_(msgid) msgid + #define _(msg) msg + ++#include "endian_extra.h" ++ + extern int be; + + static uint16_t write16(uint16_t x, int be) +diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c +--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500 ++++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500 +@@ -25,6 +25,9 @@ + + /* check_ptr checks that a pointer is in the mmaped file and doesn't + point outside it. */ ++ ++#include "endian_extra.h" ++ + #undef check_ptr + #define check_ptr(ptr) \ + do \ +diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c +--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500 ++++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500 +@@ -40,6 +40,8 @@ + + #include "ldconfig.h" + ++#include "endian_extra.h" ++ + #define _(msg) msg + + #define Elf32_CLASS ELFCLASS32 diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch new file mode 100644 index 0000000000..4e9aab9416 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch @@ -0,0 +1,24 @@ +Upstream-Status: Inappropriate [embedded specific] + +The native version of ldconfig was using native definition of LD_SO (i.e. +ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig. +This was causing libc.so on the target marked as ELF lib rather than +FLAG_ELF_LIBC6 in the ld.so.cache. + +Nitin A Kamble 2011/04/4 + +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -51,6 +51,10 @@ struct known_names + int flag; + }; + ++/* don't use host's definition of LD_SO */ ++#undef LD_SO ++#define LD_SO "ld.so.1" ++ + static struct known_names interpreters[] = + { + { "/lib/" LD_SO, FLAG_ELF_LIBC6 }, diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 new file mode 100644 index 0000000000..dc1e79888e Binary files /dev/null and b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 differ diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch new file mode 100644 index 0000000000..52986e61c7 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch @@ -0,0 +1,471 @@ +Upstream-Status: Inappropriate [embedded specific] + +enable standalone building of ldconfig + +--- + cache.c | 11 +- + chroot_canon.c | 7 + + dl-cache.c | 235 --------------------------------------------------------- + dl-cache.h | 3 + ldconfig.c | 27 ++++-- + readlib.c | 7 + + xstrdup.c | 11 -- + 7 files changed, 45 insertions(+), 256 deletions(-) + +Index: ldconfig-native-2.12.1/cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/cache.c ++++ ldconfig-native-2.12.1/cache.c +@@ -16,6 +16,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -31,8 +34,10 @@ + #include + #include + +-#include +-#include ++#include "ldconfig.h" ++#include "dl-cache.h" ++# define N_(msgid) msgid ++#define _(msg) msg + + struct cache_entry + { +Index: ldconfig-native-2.12.1/chroot_canon.c +=================================================================== +--- ldconfig-native-2.12.1.orig/chroot_canon.c ++++ ldconfig-native-2.12.1/chroot_canon.c +@@ -17,6 +17,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -27,7 +30,9 @@ + #include + #include + +-#include ++#include "ldconfig.h" ++ ++#define __set_errno(Val) errno = (Val) + + #ifndef PATH_MAX + #define PATH_MAX 1024 +Index: ldconfig-native-2.12.1/dl-cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/dl-cache.c ++++ ldconfig-native-2.12.1/dl-cache.c +@@ -20,12 +20,12 @@ + + #include + #include +-#include ++//#include "ldsodefs.h" + #include + #include + #include + +-#include ++//#include "_itoa.h" + + #ifndef _DL_PLATFORMS_COUNT + # define _DL_PLATFORMS_COUNT 0 +@@ -39,103 +39,7 @@ static size_t cachesize; + /* 1 if cache_data + PTR points into the cache. */ + #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size) + +-#define SEARCH_CACHE(cache) \ +-/* We use binary search since the table is sorted in the cache file. \ +- The first matching entry in the table is returned. \ +- It is important to use the same algorithm as used while generating \ +- the cache file. */ \ +-do \ +- { \ +- left = 0; \ +- right = cache->nlibs - 1; \ +- \ +- while (left <= right) \ +- { \ +- __typeof__ (cache->libs[0].key) key; \ +- \ +- middle = (left + right) / 2; \ +- \ +- key = cache->libs[middle].key; \ +- \ +- /* Make sure string table indices are not bogus before using \ +- them. */ \ +- if (! _dl_cache_verify_ptr (key)) \ +- { \ +- cmpres = 1; \ +- break; \ +- } \ +- \ +- /* Actually compare the entry with the key. */ \ +- cmpres = _dl_cache_libcmp (name, cache_data + key); \ +- if (__builtin_expect (cmpres == 0, 0)) \ +- { \ +- /* Found it. LEFT now marks the last entry for which we \ +- know the name is correct. */ \ +- left = middle; \ +- \ +- /* There might be entries with this name before the one we \ +- found. So we have to find the beginning. */ \ +- while (middle > 0) \ +- { \ +- __typeof__ (cache->libs[0].key) key; \ +- \ +- key = cache->libs[middle - 1].key; \ +- /* Make sure string table indices are not bogus before \ +- using them. */ \ +- if (! _dl_cache_verify_ptr (key) \ +- /* Actually compare the entry. */ \ +- || _dl_cache_libcmp (name, cache_data + key) != 0) \ +- break; \ +- --middle; \ +- } \ +- \ +- do \ +- { \ +- int flags; \ +- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \ +- \ +- /* Only perform the name test if necessary. */ \ +- if (middle > left \ +- /* We haven't seen this string so far. Test whether the \ +- index is ok and whether the name matches. Otherwise \ +- we are done. */ \ +- && (! _dl_cache_verify_ptr (lib->key) \ +- || (_dl_cache_libcmp (name, cache_data + lib->key) \ +- != 0))) \ +- break; \ +- \ +- flags = lib->flags; \ +- if (_dl_cache_check_flags (flags) \ +- && _dl_cache_verify_ptr (lib->value)) \ +- { \ +- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \ +- { \ +- HWCAP_CHECK; \ +- best = cache_data + lib->value; \ +- \ +- if (flags == GLRO(dl_correct_cache_id)) \ +- /* We've found an exact match for the shared \ +- object and no general `ELF' release. Stop \ +- searching. */ \ +- break; \ +- } \ +- } \ +- } \ +- while (++middle <= right); \ +- break; \ +- } \ +- \ +- if (cmpres < 0) \ +- left = middle + 1; \ +- else \ +- right = middle - 1; \ +- } \ +- } \ +-while (0) +- +- + int +-internal_function + _dl_cache_libcmp (const char *p1, const char *p2) + { + while (*p1 != '\0') +@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const + } + return *p1 - *p2; + } +- +- +-/* Look up NAME in ld.so.cache and return the file name stored there, +- or null if none is found. */ +- +-const char * +-internal_function +-_dl_load_cache_lookup (const char *name) +-{ +- int left, right, middle; +- int cmpres; +- const char *cache_data; +- uint32_t cache_data_size; +- const char *best; +- +- /* Print a message if the loading of libs is traced. */ +- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)) +- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE); +- +- if (cache == NULL) +- { +- /* Read the contents of the file. */ +- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize, +- PROT_READ); +- +- /* We can handle three different cache file formats here: +- - the old libc5/glibc2.0/2.1 format +- - the old format with the new format in it +- - only the new format +- The following checks if the cache contains any of these formats. */ +- if (file != MAP_FAILED && cachesize > sizeof *cache +- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0) +- { +- size_t offset; +- /* Looks ok. */ +- cache = file; +- +- /* Check for new version. */ +- offset = ALIGN_CACHE (sizeof (struct cache_file) +- + cache->nlibs * sizeof (struct file_entry)); +- +- cache_new = (struct cache_file_new *) ((void *) cache + offset); +- if (cachesize < (offset + sizeof (struct cache_file_new)) +- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW, +- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0) +- cache_new = (void *) -1; +- } +- else if (file != MAP_FAILED && cachesize > sizeof *cache_new +- && memcmp (file, CACHEMAGIC_VERSION_NEW, +- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0) +- { +- cache_new = file; +- cache = file; +- } +- else +- { +- if (file != MAP_FAILED) +- __munmap (file, cachesize); +- cache = (void *) -1; +- } +- +- assert (cache != NULL); +- } +- +- if (cache == (void *) -1) +- /* Previously looked for the cache file and didn't find it. */ +- return NULL; +- +- best = NULL; +- +- if (cache_new != (void *) -1) +- { +- uint64_t platform; +- +- /* This is where the strings start. */ +- cache_data = (const char *) cache_new; +- +- /* Now we can compute how large the string table is. */ +- cache_data_size = (const char *) cache + cachesize - cache_data; +- +- platform = _dl_string_platform (GLRO(dl_platform)); +- if (platform != (uint64_t) -1) +- platform = 1ULL << platform; +- +-#define _DL_HWCAP_TLS_MASK (1LL << 63) +- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask)) +- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK); +- +- /* Only accept hwcap if it's for the right platform. */ +-#define HWCAP_CHECK \ +- if (lib->hwcap & hwcap_exclude) \ +- continue; \ +- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \ +- continue; \ +- if (_DL_PLATFORMS_COUNT \ +- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ +- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ +- continue +- SEARCH_CACHE (cache_new); +- } +- else +- { +- /* This is where the strings start. */ +- cache_data = (const char *) &cache->libs[cache->nlibs]; +- +- /* Now we can compute how large the string table is. */ +- cache_data_size = (const char *) cache + cachesize - cache_data; +- +-#undef HWCAP_CHECK +-#define HWCAP_CHECK do {} while (0) +- SEARCH_CACHE (cache); +- } +- +- /* Print our result if wanted. */ +- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0) +- && best != NULL) +- _dl_debug_printf (" trying file=%s\n", best); +- +- return best; +-} +- +-#ifndef MAP_COPY +-/* If the system does not support MAP_COPY we cannot leave the file open +- all the time since this would create problems when the file is replaced. +- Therefore we provide this function to close the file and open it again +- once needed. */ +-void +-_dl_unload_cache (void) +-{ +- if (cache != NULL && cache != (struct cache_file *) -1) +- { +- __munmap (cache, cachesize); +- cache = NULL; +- } +-} +-#endif +Index: ldconfig-native-2.12.1/dl-cache.h +=================================================================== +--- ldconfig-native-2.12.1.orig/dl-cache.h ++++ ldconfig-native-2.12.1/dl-cache.h +@@ -101,5 +101,4 @@ struct cache_file_new + (((addr) + __alignof__ (struct cache_file_new) -1) \ + & (~(__alignof__ (struct cache_file_new) - 1))) + +-extern int _dl_cache_libcmp (const char *p1, const char *p2) +- internal_function; ++extern int _dl_cache_libcmp (const char *p1, const char *p2); +Index: ldconfig-native-2.12.1/ldconfig.c +=================================================================== +--- ldconfig-native-2.12.1.orig/ldconfig.c ++++ ldconfig-native-2.12.1/ldconfig.c +@@ -16,6 +16,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #define PROCINFO_CLASS static + #include + #include +@@ -39,10 +42,20 @@ + #include + #include + +-#include +-#include ++#include "ldconfig.h" ++#include "dl-cache.h" ++ ++#include "dl-procinfo.h" ++ ++#include "argp.h" ++ ++ ++#define SYSCONFDIR "/etc" ++#define LIBDIR "/usr/lib" ++#define SLIBDIR "/lib" ++# define N_(msgid) msgid ++#define _(msg) msg + +-#include + + #ifdef _DL_FIRST_PLATFORM + # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT) +@@ -55,7 +68,7 @@ + #endif + + /* Get libc version number. */ +-#include ++#include "version.h" + + #define PACKAGE _libc_intl_domainname + +@@ -152,8 +165,8 @@ static const struct argp_option options[ + { NULL, 0, NULL, 0, NULL, 0 } + }; + +-#define PROCINFO_CLASS static +-#include ++//#define PROCINFO_CLASS static ++//#include + + /* Short description of program. */ + static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); +@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar + return 0; + } + ++#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org" + /* Print bug-reporting information in the help message. */ + static char * + more_help (int key, const char *text, void *input) +@@ -315,7 +329,7 @@ For bug reporting instructions, please s + static void + print_version (FILE *stream, struct argp_state *state) + { +- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION); ++ fprintf (stream, "ldconfig (Hacked Poky Version)\n"); + fprintf (stream, gettext ("\ + Copyright (C) %s Free Software Foundation, Inc.\n\ + This is free software; see the source for copying conditions. There is NO\n\ +@@ -1233,6 +1247,7 @@ set_hwcap (void) + hwcap_mask = strtoul (mask, NULL, 0); + } + ++const char _libc_intl_domainname[] = "libc"; + + int + main (int argc, char **argv) +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -22,6 +22,9 @@ + development version. Besides the simplification, it has also been + modified to read some other file formats. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -35,7 +38,9 @@ + #include + #include + +-#include ++#include "ldconfig.h" ++ ++#define _(msg) msg + + #define Elf32_CLASS ELFCLASS32 + #define Elf64_CLASS ELFCLASS64 +Index: ldconfig-native-2.12.1/xstrdup.c +=================================================================== +--- ldconfig-native-2.12.1.orig/xstrdup.c ++++ ldconfig-native-2.12.1/xstrdup.c +@@ -16,15 +16,10 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +-#ifdef HAVE_CONFIG_H +-# include +-#endif ++#define _GNU_SOURCE ++ ++#include + +-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC +-# include +-#else +-# include +-#endif + void *xmalloc (size_t n) __THROW; + char *xstrdup (char *string) __THROW; + diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch new file mode 100644 index 0000000000..27bc411078 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch @@ -0,0 +1,36 @@ +Upstream-Status: Pending + +Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149 + +Nitin A Kamble 2011/03/29 + +--- ldconfig-native-2.12.1.orig/ldconfig.c ++++ ldconfig-native-2.12.1/ldconfig.c +@@ -1359,14 +1359,9 @@ main (int argc, char **argv) + + const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE; + if (opt_chroot) +- { +- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file); +- if (aux_cache_file == NULL) +- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), +- _PATH_LDCONFIG_AUX_CACHE); +- } ++ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file); + +- if (! opt_ignore_aux_cache) ++ if (! opt_ignore_aux_cache && aux_cache_file) + load_aux_cache (aux_cache_file); + else + init_aux_cache (); +@@ -1376,7 +1371,8 @@ main (int argc, char **argv) + if (opt_build_cache) + { + save_cache (cache_file); +- save_aux_cache (aux_cache_file); ++ if (aux_cache_file) ++ save_aux_cache (aux_cache_file); + } + + return 0; + diff --git a/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb new file mode 100644 index 0000000000..d7bc4446a8 --- /dev/null +++ b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb @@ -0,0 +1,30 @@ +SUMMARY = "A standalone native ldconfig build" + +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399" + +SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \ + file://ldconfig.patch \ + file://ldconfig_aux-cache_path_fix.patch \ + file://32and64bit.patch \ + file://endian-ness_handling.patch \ + file://flag_fix.patch \ + file://endianess-header.patch" + +PR = "r2" + +FILESPATH = "${FILE_DIRNAME}/${PN}-${PV}/" + +inherit native + +S = "${WORKDIR}/${PN}-${PV}" + +do_compile () { + $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig +} + +do_install () { + install -d ${D}/${bindir}/ + install ldconfig ${D}/${bindir}/ +} diff --git a/meta/recipes-core/eglibc/site_config/funcs b/meta/recipes-core/eglibc/site_config/funcs new file mode 100644 index 0000000000..ccc85392d7 --- /dev/null +++ b/meta/recipes-core/eglibc/site_config/funcs @@ -0,0 +1,474 @@ +a64l +abs +access +__adjtimex +alarm +alphasort +argz_append +__argz_count +argz_create_sep +argz_insert +__argz_next +argz_next +__argz_stringify +argz_stringify +asprintf +atexit +atof +atoi +bcmp +bcopy +bindresvport +bind_textdomain_codeset +btowc +bzero +calloc +canonicalize_file_name +catgets +cfgetospeed +cfsetispeed +cfsetspeed +chmod +chown +chroot +clock +close +closedir +closelog +confstr +connect +daemon +dcgettext +difftime +dirfd +dirname +dngettext +dup2 +ecvt +endgrent +endmntent +endpwent +endutent +endutxent +epoll_ctl +err +ether_hostton +ether_ntohost +euidaccess +execv +fchdir +fchmod +fchmodat +fchown +fchownat +fcntl +fcvt +fdatasync +fdopendir +feof_unlocked +fgets_unlocked +fgetxattr +finite +flistxattr +flock +flockfile +fnmatch +fork +fpathconf +__fpending +fprintf +free +freeaddrinfo +freeifaddrs +fseeko +__fsetlocking +fsetxattr +fstat64 +fstat +fstatfs +fsync +ftello +ftime +ftruncate +funlockfile +futimes +futimesat +gai_strerror +gcvt +getaddrinfo +getc_unlocked +getcwd +getdelim +getdomainname +getdtablesize +getegid +getenv +geteuid +getgid +getgrent +getgrent_r +getgrgid_r +getgrnam +getgrnam_r +getgrouplist +getgroups +gethostbyaddr_r +gethostbyname2 +gethostbyname +gethostbyname_r +gethostent +gethostid +gethostname +getifaddrs +getline +getloadavg +getmntent +getmsg +getnameinfo +getnetbyaddr_r +getnetgrent_r +getopt +getopt_long +getopt_long_only +getpagesize +getpass +getpeername +getpgrp +getpid +getppid +getprotoent_r +getpwent +getpwent_r +getpwnam +getpwnam_r +getpwuid +getpwuid_r +getresuid +getrlimit +getrusage +getservbyname +getservbyname_r +getservbyport_r +getservent +getservent_r +getspnam +getspnam_r +gettimeofday +getttyent +getttynam +getuid +getusershell +getutent +getutid +getutline +getutmp +getutmpx +getutxent +getutxid +getutxline +getwd +getxattr +glob +gmtime +gmtime_r +grantpt +group_member +herror +hstrerror +iconv +iconv_open +if_freenameindex +if_indextoname +if_nameindex +if_nametoindex +index +inet_addr +inet_aton +inet_ntoa +inet_ntop +inet_pton +initgroups +innetgr +iruserok +isascii +isatty +isblank +isgraph +isinf +isnan +isprint +isspace +iswalnum +iswcntrl +iswctype +iswprint +iswspace +iswupper +isxdigit +kill +killpg +lchown +lckpwdf +lgetxattr +link +listxattr +llistxattr +localtime +localtime_r +lockf +lrand48 +lsearch +lseek64 +lsetxattr +lstat +mallinfo +malloc +mblen +mbrlen +mbrtowc +mbsinit +mbsrtowcs +mbtowc +memalign +memchr +memcmp +memcpy +memmove +mempcpy +memrchr +memset +mkdir +mkdirat +mkdtemp +mkfifo +mknod +mkstemp64 +mkstemp +mktime +mlock +mmap +mtrace +munlock +munmap +nanosleep +nice +nl_langinfo +ntp_adjtime +ntp_gettime +_obstack_free +on_exit +open64 +open +openat +opendir +openlog +pathconf +pipe +poll +popen +posix_memalign +prctl +pread +printf +__progname +pselect +pthread_mutex_lock +ptsname +putenv +putgrent +putpwent +putspent +pututline +pututxline +putwc +pwrite +qsort +raise +rand +random +rand_r +read +readdir +readdir_r +readlink +realloc +realpath +re_comp +recvmsg +re_exec +regcomp +regexec +remove +rename +re_search +rmdir +rpmatch +rresvport_af +ruserok +ruserok_af +sbrk +scandir +sched_setscheduler +sched_yield +__secure_getenv +select +semctl +semget +sendmsg +setbuf +setbuffer +setegid +setenv +seteuid +setgid +setgroups +sethostname +setitimer +_setjmp +setjmp +setlinebuf +setlocale +setmntent +setpgid +setpgrp +setpriority +setregid +setresgid +setresuid +setreuid +setrlimit +setsid +setsockopt +settimeofday +setuid +setutent +setutxent +setvbuf +setxattr +sgetspent +shmat +shmctl +shmdt +shmget +shutdown +sigaction +sigaddset +sigaltstack +sigblock +sigemptyset +sighold +siginterrupt +signal +sigprocmask +sigset +sigsetmask +sigstack +sigsuspend +sigvec +snprintf +socket +socketpair +sprintf +srand48 +srand +srandom +sscanf +stat +statfs +statvfs +stime +stpcpy +strcasecmp +strcasestr +strchr +strchrnul +strcmp +strcspn +strdup +strerror +strerror_r +strftime +strlen +strncasecmp +strncmp +strndup +strnlen +strpbrk +strptime +strrchr +strsep +strsignal +strspn +strstr +strtod +strtoimax +strtok_r +strtol +strtoll +strtoul +strtoull +strtoumax +strverscmp +strxfrm +symlink +sync +sysconf +sysctl +sysinfo +syslog +_sys_siglist +sys_siglist +system +tcgetattr +tcgetpgrp +tcsetattr +tcsetpgrp +time +timegm +times +timezone +tmpnam +towlower +towupper +truncate +tsearch +ttyname +tzset +ulimit +umask +uname +unlink +unsetenv +unshare +updwtmp +updwtmpx +usleep +ustat +utime +utimes +utmpname +utmpxname +valloc +vasprintf +verrx +vfork +vfprintf +vfscanf +vhangup +vprintf +vsnprintf +vsprintf +wait3 +wait4 +waitpid +wcrtomb +wcscoll +wcsdup +wcslen +wctob +wctomb +wctype +wcwidth +wmemchr +wmemcpy +wmempcpy diff --git a/meta/recipes-core/eglibc/site_config/headers b/meta/recipes-core/eglibc/site_config/headers new file mode 100644 index 0000000000..609ab53797 --- /dev/null +++ b/meta/recipes-core/eglibc/site_config/headers @@ -0,0 +1,156 @@ +aio.h +alloca.h +argz.h +arpa/inet.h +arpa/nameser.h +asm/byteorder.h +asm/ioctls.h +asm/page.h +asm/types.h +assert.h +byteswap.h +crypt.h +ctype.h +dirent.h +dlfcn.h +elf.h +endian.h +err.h +errno.h +execinfo.h +fcntl.h +features.h +float.h +fstab.h +ftw.h +getopt.h +glob.h +grp.h +iconv.h +ifaddrs.h +inttypes.h +langinfo.h +lastlog.h +libgen.h +libintl.h +limits.h +linux/capability.h +linux/fd.h +linux/fs.h +linux/hayesesp.h +linux/hdreg.h +linux/icmp.h +linux/in6.h +linux/joystick.h +linux/ptrace.h +linux/serial.h +linux/sonypi.h +linux/unistd.h +linux/utsname.h +linux/version.h +locale.h +malloc.h +math.h +mcheck.h +memory.h +mntent.h +mqueue.h +netdb.h +net/if.h +netinet/ether.h +netinet/in.h +netinet/ip6.h +netinet/ip.h +netinet/tcp.h +netinet/udp.h +netipx/ipx.h +net/route.h +paths.h +poll.h +pthread.h +pty.h +pwd.h +regex.h +resolv.h +rpc/rpc.h +rpc/types.h +sched.h +scsi/scsi.h +search.h +semaphore.h +setjmp.h +sgtty.h +shadow.h +signal.h +stdarg.h +stdbool.h +stdc +stddef.h +stdint.h +stdio.h +stdlib.h +string.h +strings.h +stropts.h +sys/bitypes.h +sys/cdefs.h +sys/dir.h +sys/epoll.h +sysexits.h +sys/fcntl.h +sys/file.h +sys/fsuid.h +sys/ioctl.h +sys/ipc.h +syslog.h +sys/mman.h +sys/mount.h +sys/mtio.h +sys/param.h +sys/poll.h +sys/prctl.h +sys/ptrace.h +sys/queue.h +sys/reg.h +sys/resource.h +sys/select.h +sys/sem.h +sys/shm.h +sys/signal.h +sys/socket.h +sys/socketvar.h +sys/soundcard.h +sys/statfs.h +sys/stat.h +sys/statvfs.h +sys/stropts.h +sys/swap.h +sys/sysctl.h +sys/sysinfo.h +sys/sysmacros.h +sys/termios.h +sys/timeb.h +sys/time.h +sys/times.h +sys/timex.h +sys/types.h +sys/uio.h +sys/un.h +sys/unistd.h +sys/user.h +sys/utsname.h +sys/vfs.h +sys/wait.h +termio.h +termios.h +time.h +ttyent.h +ulimit.h +unistd.h +ustat.h +utime.h +utmp.h +utmpx.h +values.h +wchar.h +wctype.h diff --git a/meta/recipes-core/eglibc/site_config/types b/meta/recipes-core/eglibc/site_config/types new file mode 100644 index 0000000000..178bd85a00 --- /dev/null +++ b/meta/recipes-core/eglibc/site_config/types @@ -0,0 +1,21 @@ +char +char * +double +float +int +long +long double +long int +long long +long long int +short +short int +signed char +unsigned char +unsigned int +unsigned long +unsigned long int +unsigned long long int +unsigned short +unsigned short int +void * diff --git a/meta/recipes-core/expat/expat-2.1.0/autotools.patch b/meta/recipes-core/expat/expat-2.1.0/autotools.patch new file mode 100644 index 0000000000..0e599697a6 --- /dev/null +++ b/meta/recipes-core/expat/expat-2.1.0/autotools.patch @@ -0,0 +1,24 @@ +Avoid using expat's m4 files + +Upstream-Status: Inappropriate [Other] +Workaround specific to our build system. + +Signed-off-by: Kevin Tian +Signed-off-by: Scott Garman + +Updated to apply over expat 2.1.0 + +Signed-off-by: Marko Lindqvist + +diff -Nurd expat-2.1.0/configure.in expat-2.1.0/configure.in +--- expat-2.1.0/configure.in 2012-03-04 01:45:53.000000000 +0200 ++++ expat-2.1.0/configure.in 2012-05-10 21:04:44.000000000 +0300 +@@ -51,8 +51,6 @@ + + AC_CONFIG_HEADER(expat_config.h) + +-sinclude(conftools/ac_c_bigendian_cross.m4) +- + AC_LIBTOOL_WIN32_DLL + AC_PROG_LIBTOOL + diff --git a/meta/recipes-core/expat/expat.inc b/meta/recipes-core/expat/expat.inc new file mode 100644 index 0000000000..6dfafe94d2 --- /dev/null +++ b/meta/recipes-core/expat/expat.inc @@ -0,0 +1,20 @@ +SUMMARY = "A stream-oriented XML parser library" +DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)" +HOMEPAGE = "http://expat.sourceforge.net/" +SECTION = "libs" +LICENSE = "MIT" + +SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.gz \ + file://autotools.patch" + +inherit autotools lib_package gzipnative + +# This package uses an archive format known to have issue with some +# versions of gzip +do_unpack[depends] += "gzip-native:do_populate_sysroot" + +do_configure_prepend () { + rm -f ${S}/conftools/libtool.m4 +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/expat/expat_2.1.0.bb b/meta/recipes-core/expat/expat_2.1.0.bb new file mode 100644 index 0000000000..b958742edc --- /dev/null +++ b/meta/recipes-core/expat/expat_2.1.0.bb @@ -0,0 +1,5 @@ +require expat.inc +LIC_FILES_CHKSUM = "file://COPYING;md5=1b71f681713d1256e1c23b0890920874" + +SRC_URI[md5sum] = "dd7dab7a5fea97d2a6a43f511449b7cd" +SRC_URI[sha256sum] = "823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86" diff --git a/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb b/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb new file mode 100644 index 0000000000..fb312f8151 --- /dev/null +++ b/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb @@ -0,0 +1,44 @@ +SUMMARY = "Poky example feed configuration" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PR = "r2" +PACKAGE_ARCH = "${MACHINE_ARCH}" +INHIBIT_DEFAULT_DEPS = "1" + +#FEEDNAMEPREFIX ?= "INVALID" +#FEEDURIPREFIX ?= "INVALID" + +do_compile() { + mkdir -p ${S}/${sysconfdir}/opkg/ + + archconf=${S}/${sysconfdir}/opkg/arch.conf + + rm -f $archconf + ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}" + priority=1 + for arch in $ipkgarchs; do + echo "arch $arch $priority" >> $archconf + priority=$(expr $priority + 5) + done + + basefeedconf=${S}/${sysconfdir}/opkg/base-feeds.conf + + rm -f $basefeedconf + touch $basefeedconf + + #for arch in $ipkgarchs; do + # echo "src/gz ${FEEDNAMEPREFIX}-$arch http://pokylinux.org/${FEEDURIPREFIX}$arch" >> $basefeedconf + #done +} + + +do_install () { + install -d ${D}${sysconfdir}/opkg + install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/ +} + +FILES_${PN} = "${sysconfdir}/opkg/ " + +CONFFILES_${PN} += "${sysconfdir}/opkg/base-feeds.conf \ + ${sysconfdir}/opkg/arch.conf" + diff --git a/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch new file mode 100644 index 0000000000..e4c5f1566b --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch @@ -0,0 +1,39 @@ + +# Pulled from OpenEmbedded +# +# Commented by: Saul Wold + +Upstream-Status: Inappropriate [licensing] + +Index: gettext-0.16.1/gettext-tools/configure.ac +=================================================================== +--- gettext-0.16.1.orig/gettext-tools/configure.ac 2006-11-27 09:02:01.000000000 -0800 ++++ gettext-0.16.1/gettext-tools/configure.ac 2011-03-16 16:55:36.111396557 -0700 +@@ -36,27 +36,15 @@ + gt_JAVA_CHOICE + + gt_GCJ +-if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then +- BUILDJAVAEXE=yes +-else + BUILDJAVAEXE=no +-fi + AC_SUBST(BUILDJAVAEXE) + + gt_JAVAEXEC + gt_JAVACOMP([1.3]) + AC_CHECK_PROG(JAR, jar, jar) +-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then +- BUILDJAVA=yes +-else + BUILDJAVA=no +-fi + AC_SUBST(BUILDJAVA) +-if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then +- TESTJAVA=yes +-else + TESTJAVA=no +-fi + AC_SUBST(TESTJAVA) + + gt_CSHARPCOMP diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch new file mode 100644 index 0000000000..7293f5b08d --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch @@ -0,0 +1,110 @@ + +This patch updates the required version number from 2.61 to the +current 2.65 version of aclocal, this will need to be updated +when we update aclocal + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by Saul Wold + +Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:36.391519775 -0700 ++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:45.569526073 -0700 +@@ -148,7 +148,7 @@ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl Autoconf >= 2.61 supports dots in --with options. +- define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) ++ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ +Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:36.391519775 -0700 ++++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:45.570526904 -0700 +@@ -11,8 +11,8 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, +-[m4_fatal([this file was generated for autoconf 2.61. ++m4_if(m4_PACKAGE_VERSION, [2.65],, ++[m4_fatal([this file was generated for autoconf 2.65. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) + +Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:36.391519775 -0700 ++++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:45.572525773 -0700 +@@ -11,8 +11,8 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, +-[m4_fatal([this file was generated for autoconf 2.61. ++m4_if(m4_PACKAGE_VERSION, [2.65],, ++[m4_fatal([this file was generated for autoconf 2.65. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) + +Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:36.391519775 -0700 ++++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:45.578394916 -0700 +@@ -11,7 +11,7 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, ++m4_if(m4_PACKAGE_VERSION, [2.65],, + [m4_fatal([this file was generated for autoconf 2.61. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) +Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:36.391519775 -0700 ++++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:45.586395416 -0700 +@@ -11,8 +11,8 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, +-[m4_fatal([this file was generated for autoconf 2.61. ++m4_if(m4_PACKAGE_VERSION, [2.65],, ++[m4_fatal([this file was generated for autoconf 2.65. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) + +Index: gettext-0.16.1/gettext-tools/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/gettext-tools/aclocal.m4 2006-11-27 09:34:32.000000000 -0800 ++++ gettext-0.16.1/gettext-tools/aclocal.m4 2011-03-17 02:27:01.135682807 -0700 +@@ -11,8 +11,8 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, +-[m4_fatal([this file was generated for autoconf 2.61. ++m4_if(m4_PACKAGE_VERSION, [2.65],, ++[m4_fatal([this file was generated for autoconf 2.65. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) + +Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4 +=================================================================== +--- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4 2006-11-27 09:16:23.000000000 -0800 ++++ gettext-0.16.1/gettext-tools/examples/aclocal.m4 2011-03-17 02:26:52.589396683 -0700 +@@ -11,8 +11,8 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-m4_if(m4_PACKAGE_VERSION, [2.61],, +-[m4_fatal([this file was generated for autoconf 2.61. ++m4_if(m4_PACKAGE_VERSION, [2.65],, ++[m4_fatal([this file was generated for autoconf 2.65. + You have another version of autoconf. If you want to use that, + you should regenerate the build system entirely.], [63])]) + diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch new file mode 100644 index 0000000000..06861492c0 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch @@ -0,0 +1,348 @@ + +This patch removes the circular dependency on AC_GNU_SOURCE in +AC_USE_SYSTEM_EXTENSIONS. + +Thanks to Mark Hatle for the timely pointers and fixes. + +Upstream-Status: Inappropriate [licensing] + +Signed-off-by Saul Wold + +diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4 +--- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 2006-11-27 09:14:38.000000000 -0800 ++++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4 2011-03-16 23:54:01.711923448 -0700 +@@ -16,43 +16,47 @@ + # ------------------------ + # Enable extensions on systems that normally disable them, + # typically due to standards-conformance issues. +-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +-[ +- AC_BEFORE([$0], [AC_COMPILE_IFELSE]) +- AC_BEFORE([$0], [AC_RUN_IFELSE]) +- +- AC_REQUIRE([AC_GNU_SOURCE]) +- AC_REQUIRE([AC_AIX]) +- AC_REQUIRE([AC_MINIX]) +- +- AH_VERBATIM([__EXTENSIONS__], +-[/* Enable extensions on Solaris. */ +-#ifndef __EXTENSIONS__ +-# undef __EXTENSIONS__ +-#endif +-#ifndef _POSIX_PTHREAD_SEMANTICS +-# undef _POSIX_PTHREAD_SEMANTICS +-#endif +-#ifndef _TANDEM_SOURCE +-# undef _TANDEM_SOURCE +-#endif]) +- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], +- [ac_cv_safe_to_define___extensions__], +- [AC_COMPILE_IFELSE( +- [AC_LANG_PROGRAM([ +-# define __EXTENSIONS__ 1 +- AC_INCLUDES_DEFAULT])], +- [ac_cv_safe_to_define___extensions__=yes], +- [ac_cv_safe_to_define___extensions__=no])]) +- test $ac_cv_safe_to_define___extensions__ = yes && +- AC_DEFINE([__EXTENSIONS__]) +- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) +- AC_DEFINE([_TANDEM_SOURCE]) +-]) ++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], ++#[ ++# AC_BEFORE([$0], [AC_COMPILE_IFELSE]) ++# AC_BEFORE([$0], [AC_RUN_IFELSE]) ++# ++# AC_REQUIRE([AC_GNU_SOURCE]) ++# AC_REQUIRE([AC_AIX]) ++# AC_REQUIRE([AC_MINIX]) ++# ++# AH_VERBATIM([__EXTENSIONS__], ++#[/* Enable extensions on Solaris. */ ++##ifndef __EXTENSIONS__ ++## undef __EXTENSIONS__ ++##endif ++##ifndef _POSIX_PTHREAD_SEMANTICS ++## undef _POSIX_PTHREAD_SEMANTICS ++##endif ++##ifndef _TANDEM_SOURCE ++## undef _TANDEM_SOURCE ++##endif]) ++# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], ++# [ac_cv_safe_to_define___extensions__], ++# [AC_COMPILE_IFELSE( ++# [AC_LANG_PROGRAM([ ++## define __EXTENSIONS__ 1 ++# AC_INCLUDES_DEFAULT])], ++# [ac_cv_safe_to_define___extensions__=yes], ++# [ac_cv_safe_to_define___extensions__=no])]) ++# test $ac_cv_safe_to_define___extensions__ = yes && ++# AC_DEFINE([__EXTENSIONS__]) ++# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) ++# AC_DEFINE([_TANDEM_SOURCE]) ++#]) + + # gl_USE_SYSTEM_EXTENSIONS + # ------------------------ + # Enable extensions on systems that normally disable them, + # typically due to standards-conformance issues. + AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], +- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) ++[ ++ AC_REQUIRE([AC_GNU_SOURCE]) ++ ++ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) ++]) +diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4 +--- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:19.000000000 -0800 ++++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4 2011-03-16 23:50:17.471531838 -0700 +@@ -25,7 +25,7 @@ + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + AC_REQUIRE([AC_PROG_RANLIB]) +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + ]) + +diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4 +--- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 2006-11-27 09:14:38.000000000 -0800 ++++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4 2011-03-16 23:50:10.814396529 -0700 +@@ -9,7 +9,7 @@ + + AC_DEFUN([gl_MBCHAR], + [ +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + dnl The following line is that so the user can test HAVE_WCHAR_H + dnl before #include "mbchar.h". + AC_CHECK_HEADERS_ONCE([wchar.h]) +diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4 +--- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 2006-11-27 09:14:38.000000000 -0800 ++++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4 2011-03-16 23:50:08.357396247 -0700 +@@ -7,7 +7,7 @@ + AC_DEFUN([gl_FUNC_WCWIDTH], + [ + dnl Persuade glibc to declare wcwidth(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) +diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4 +--- gettext-0.16.1/gettext-runtime/m4/lock.m4 2006-10-24 13:59:59.000000000 -0700 ++++ gettext.patched/gettext-runtime/m4/lock.m4 2011-03-16 23:50:04.355891676 -0700 +@@ -35,7 +35,7 @@ + AC_BEFORE([$0], [gl_ARGP])dnl + + AC_REQUIRE([AC_CANONICAL_HOST]) +- AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems + dnl Check for multithreading. + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 2006-11-27 09:14:54.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4 2011-03-16 23:53:28.487671266 -0700 +@@ -16,43 +16,47 @@ + # ------------------------ + # Enable extensions on systems that normally disable them, + # typically due to standards-conformance issues. +-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +-[ +- AC_BEFORE([$0], [AC_COMPILE_IFELSE]) +- AC_BEFORE([$0], [AC_RUN_IFELSE]) +- +- AC_REQUIRE([AC_GNU_SOURCE]) +- AC_REQUIRE([AC_AIX]) +- AC_REQUIRE([AC_MINIX]) +- +- AH_VERBATIM([__EXTENSIONS__], +-[/* Enable extensions on Solaris. */ +-#ifndef __EXTENSIONS__ +-# undef __EXTENSIONS__ +-#endif +-#ifndef _POSIX_PTHREAD_SEMANTICS +-# undef _POSIX_PTHREAD_SEMANTICS +-#endif +-#ifndef _TANDEM_SOURCE +-# undef _TANDEM_SOURCE +-#endif]) +- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], +- [ac_cv_safe_to_define___extensions__], +- [AC_COMPILE_IFELSE( +- [AC_LANG_PROGRAM([ +-# define __EXTENSIONS__ 1 +- AC_INCLUDES_DEFAULT])], +- [ac_cv_safe_to_define___extensions__=yes], +- [ac_cv_safe_to_define___extensions__=no])]) +- test $ac_cv_safe_to_define___extensions__ = yes && +- AC_DEFINE([__EXTENSIONS__]) +- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) +- AC_DEFINE([_TANDEM_SOURCE]) +-]) ++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], ++#[ ++# AC_BEFORE([$0], [AC_COMPILE_IFELSE]) ++# AC_BEFORE([$0], [AC_RUN_IFELSE]) ++# ++# AC_REQUIRE([AC_GNU_SOURCE]) ++# AC_REQUIRE([AC_AIX]) ++# AC_REQUIRE([AC_MINIX]) ++# ++# AH_VERBATIM([__EXTENSIONS__], ++#[/* Enable extensions on Solaris. */ ++##ifndef __EXTENSIONS__ ++## undef __EXTENSIONS__ ++##endif ++##ifndef _POSIX_PTHREAD_SEMANTICS ++## undef _POSIX_PTHREAD_SEMANTICS ++##endif ++##ifndef _TANDEM_SOURCE ++## undef _TANDEM_SOURCE ++##endif]) ++# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], ++# [ac_cv_safe_to_define___extensions__], ++# [AC_COMPILE_IFELSE( ++# [AC_LANG_PROGRAM([ ++## define __EXTENSIONS__ 1 ++# AC_INCLUDES_DEFAULT])], ++# [ac_cv_safe_to_define___extensions__=yes], ++# [ac_cv_safe_to_define___extensions__=no])]) ++# test $ac_cv_safe_to_define___extensions__ = yes && ++# AC_DEFINE([__EXTENSIONS__]) ++# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) ++# AC_DEFINE([_TANDEM_SOURCE]) ++#]) + + # gl_USE_SYSTEM_EXTENSIONS + # ------------------------ + # Enable extensions on systems that normally disable them, + # typically due to standards-conformance issues. + AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], +- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) ++[ ++ AC_REQUIRE([AC_GNU_SOURCE]) ++ ++ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) ++]) +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 2006-11-27 09:14:54.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4 2011-03-16 23:52:06.477463671 -0700 +@@ -91,7 +91,7 @@ + AC_DEFUN([gl_FUNC_FNMATCH_GNU], + [ + dnl Persuade glibc to declare FNM_CASEFOLD etc. +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + FNMATCH_H= + _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu], +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 2006-11-27 09:14:54.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4 2011-03-16 23:52:22.871674845 -0700 +@@ -12,7 +12,7 @@ + [ + + dnl Persuade glibc to declare getdelim(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(getdelim) + AC_CHECK_DECLS_ONCE(getdelim) +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 2006-11-27 09:14:54.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/getline.m4 2011-03-16 23:51:49.829971108 -0700 +@@ -16,7 +16,7 @@ + AC_DEFUN([gl_FUNC_GETLINE], + [ + dnl Persuade glibc to declare getline(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_CHECK_DECLS([getline]) + +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:36.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4 2011-03-16 23:52:18.970450488 -0700 +@@ -25,7 +25,7 @@ + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + AC_REQUIRE([AC_PROG_RANLIB]) +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_LOCK_EARLY]) + ]) +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 2006-11-27 09:14:55.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4 2011-03-16 23:51:40.844410216 -0700 +@@ -9,7 +9,7 @@ + + AC_DEFUN([gl_MBCHAR], + [ +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + dnl The following line is that so the user can test HAVE_WCHAR_H + dnl before #include "mbchar.h". + AC_CHECK_HEADERS_ONCE([wchar.h]) +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 2006-11-27 09:14:55.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4 2011-03-16 23:52:14.691396045 -0700 +@@ -7,7 +7,7 @@ + AC_DEFUN([gl_FUNC_STPCPY], + [ + dnl Persuade glibc to declare stpcpy(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(stpcpy) + if test $ac_cv_func_stpcpy = no; then +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 2006-11-27 09:14:55.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4 2011-03-16 23:52:10.356641459 -0700 +@@ -7,7 +7,7 @@ + AC_DEFUN([gl_FUNC_STPNCPY], + [ + dnl Persuade glibc to declare stpncpy(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function + dnl declared in . Its side effects are the same as those +diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4 +--- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 2006-11-27 09:14:55.000000000 -0800 ++++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4 2011-03-16 23:51:08.260324221 -0700 +@@ -7,7 +7,7 @@ + AC_DEFUN([gl_FUNC_WCWIDTH], + [ + dnl Persuade glibc to declare wcwidth(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) +diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 +--- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:45.000000000 -0800 ++++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2011-03-16 23:51:02.036061317 -0700 +@@ -25,7 +25,7 @@ + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + AC_REQUIRE([AC_PROG_RANLIB]) +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_LOCK_EARLY]) + ]) +diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4 +--- gettext-0.16.1/gettext-tools/m4/regex.m4 2006-11-27 09:02:05.000000000 -0800 ++++ gettext.patched/gettext-tools/m4/regex.m4 2011-03-16 23:50:53.533477195 -0700 +@@ -116,7 +116,7 @@ + dnl to get them. + + dnl Persuade glibc to declare mempcpy(). +- AC_REQUIRE([AC_GNU_SOURCE]) ++ dnl AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_FUNC_ALLOCA]) diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch new file mode 100644 index 0000000000..072fe5ff6c --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch @@ -0,0 +1,19 @@ + +# Pulled from OpenEmbedded +# +# Commented by: Saul Wold + +Upstream-Status: Inappropriate [licensing] + +--- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~ 2009-04-17 15:12:30.000000000 -0700 ++++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4 2009-04-17 15:37:39.000000000 -0700 +@@ -267,6 +267,9 @@ + fi + fi + fi ++ dnl Just let the compiler find the library, the compiler and user are smarter then this script ++ dnl when cross compiling and working with a relocated install. ++ found_dir="" + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch new file mode 100644 index 0000000000..93d91942f0 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch @@ -0,0 +1,19 @@ + +# Pulled from OpenEmbedded +# +# Commented by: Saul Wold + +Upstream-Status: Inappropriate [licensing] + +diff -ur gettext-0.14.6/gettext-tools/lib/error.h gettext-0.14.6-patched/gettext-tools/lib/error.h +--- gettext-0.14.6/gettext-tools/lib/error.h 2005-05-20 16:03:42.000000000 -0500 ++++ gettext-0.14.6-patched/gettext-tools/lib/error.h 2007-01-13 20:57:24.422168053 -0600 +@@ -50,7 +50,7 @@ + /* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +-extern DLL_VARIABLE void (*error_print_progname) (void); ++void (*error_print_progname) (void); + + /* This variable is incremented each time `error' is called. */ + extern DLL_VARIABLE unsigned int error_message_count; diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch new file mode 100644 index 0000000000..f09e450efe --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch @@ -0,0 +1,20 @@ + +# Pulled from OpenEmbedded +# +# Commented by: Saul Wold + +Upstream-Status: Inappropriate [licensing] + +Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in +=================================================================== +--- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in 2006-11-27 09:02:00.000000000 -0800 ++++ gettext-0.16.1/gettext-runtime/intl/Makefile.in 2011-03-16 16:04:49.175419930 -0700 +@@ -35,7 +35,7 @@ + # 'make' does the wrong thing if GNU gettext was configured with + # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la + # files it finds in srcdir = ../../gettext-runtime/intl. +-VPATH = $(srcdir) ++#VPATH = $(srcdir) + + prefix = @prefix@ + exec_prefix = @exec_prefix@ diff --git a/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch new file mode 100644 index 0000000000..4da8dd4536 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch @@ -0,0 +1,51 @@ + +This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION, +the version check is only part of 0.17 and will not affect any 0.16.1 +operations + +Upstream-Status: Inappropriate [licensing] + +Signed-off-by: Saul Wold + +Index: gettext-0.16.1/gettext-runtime/m4/po.m4 +=================================================================== +--- gettext-0.16.1.orig/gettext-runtime/m4/po.m4 2011-03-17 02:24:28.953520231 -0700 ++++ gettext-0.16.1/gettext-runtime/m4/po.m4 2011-03-17 02:28:25.455396862 -0700 +@@ -27,6 +27,9 @@ + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AM_NLS])dnl + ++ dnl Hardcode the MACRO_VERSION to 0.17 for gnutls ++ AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) ++ + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + +Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in +=================================================================== +--- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700 ++++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700 +@@ -10,6 +10,9 @@ + # + # Origin: gettext-0.16 + ++# Hardcode this value for gnutls building against gplv2 code ++GETTEXT_MACRO_VERSION = 0.17 ++ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in +=================================================================== +--- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700 ++++ gettext-0.16.1/gettext-tools/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700 +@@ -10,6 +10,9 @@ + # + # Origin: gettext-0.16 + ++# Hardcode this value for gnutls building against gplv2 code ++GETTEXT_MACRO_VERSION = 0.17 ++ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ diff --git a/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch new file mode 100644 index 0000000000..d921069711 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch @@ -0,0 +1,720 @@ + +# Pulled from OpenEmbedded +# +# Commented by: Saul Wold + +Upstream-Status: Inappropriate [licensing] + +Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2006-11-27 09:01:58.000000000 -0800 ++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 00:36:08.710836720 -0700 +@@ -6,12 +6,14 @@ + + dnl From Bruno Haible. + +-AC_PREREQ(2.50) ++AC_PREREQ(2.54) + + dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and + dnl augments the CPPFLAGS variable. ++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname ++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. + AC_DEFUN([AC_LIB_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) +@@ -24,13 +26,16 @@ + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ++ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" ++ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) ++ AC_SUBST([LIB]NAME[_PREFIX]) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes +@@ -46,6 +51,8 @@ + dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and + dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs + dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. ++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname ++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. + AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) +@@ -82,17 +89,24 @@ + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= ++ LIB[]NAME[]_PREFIX= ++ + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) ++ AC_SUBST([LIB]NAME[_PREFIX]) + undefine([Name]) + undefine([NAME]) + ]) + + dnl Determine the platform dependent parameters needed to use rpath: +-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +-dnl hardcode_direct, hardcode_minus_L. ++dnl acl_libext, ++dnl acl_shlibext, ++dnl acl_hardcode_libdir_flag_spec, ++dnl acl_hardcode_libdir_separator, ++dnl acl_hardcode_direct, ++dnl acl_hardcode_minus_L. + AC_DEFUN([AC_LIB_RPATH], + [ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. +@@ -109,12 +123,14 @@ + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" +- libext="$acl_cv_libext" +- shlibext="$acl_cv_shlibext" +- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" +- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" +- hardcode_direct="$acl_cv_hardcode_direct" +- hardcode_minus_L="$acl_cv_hardcode_minus_L" ++ acl_libext="$acl_cv_libext" ++ acl_shlibext="$acl_cv_shlibext" ++ acl_libname_spec="$acl_cv_libname_spec" ++ acl_library_names_spec="$acl_cv_library_names_spec" ++ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" ++ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" ++ acl_hardcode_direct="$acl_cv_hardcode_direct" ++ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], +@@ -124,20 +140,24 @@ + dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. ++dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found ++dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. + AC_DEFUN([AC_LIB_LINKFLAGS_BODY], + [ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) ++ dnl Autoconf >= 2.61 supports dots in --with options. ++ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) +- AC_LIB_ARG_WITH([lib$1-prefix], +-[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib +- --without-lib$1-prefix don't search for lib$1 in includedir and libdir], ++ AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], ++[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib ++ --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], + [ + if test "X$withval" = "Xno"; then + use_additional=no +@@ -158,6 +178,7 @@ + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= ++ LIB[]NAME[]_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= +@@ -197,27 +218,53 @@ + found_la= + found_so= + found_a= ++ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name ++ if test -n "$acl_shlibext"; then ++ shrext=".$acl_shlibext" # typically: shrext=.so ++ else ++ shrext= ++ fi + if test $use_additional = yes; then +- if test -n "$shlibext" \ +- && { test -f "$additional_libdir/lib$name.$shlibext" \ +- || { test "$shlibext" = dll \ +- && test -f "$additional_libdir/lib$name.dll.a"; }; }; then +- found_dir="$additional_libdir" +- if test -f "$additional_libdir/lib$name.$shlibext"; then +- found_so="$additional_libdir/lib$name.$shlibext" ++ dir="$additional_libdir" ++ dnl The same code as in the loop below: ++ dnl First look for a shared library. ++ if test -n "$acl_shlibext"; then ++ if test -f "$dir/$libname$shrext"; then ++ found_dir="$dir" ++ found_so="$dir/$libname$shrext" + else +- found_so="$additional_libdir/lib$name.dll.a" ++ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ++ ver=`(cd "$dir" && \ ++ for f in "$libname$shrext".*; do echo "$f"; done \ ++ | sed -e "s,^$libname$shrext\\\\.,," \ ++ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ ++ | sed 1q ) 2>/dev/null` ++ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then ++ found_dir="$dir" ++ found_so="$dir/$libname$shrext.$ver" ++ fi ++ else ++ eval library_names=\"$acl_library_names_spec\" ++ for f in $library_names; do ++ if test -f "$dir/$f"; then ++ found_dir="$dir" ++ found_so="$dir/$f" ++ break ++ fi ++ done ++ fi + fi +- if test -f "$additional_libdir/lib$name.la"; then +- found_la="$additional_libdir/lib$name.la" ++ fi ++ dnl Then look for a static library. ++ if test "X$found_dir" = "X"; then ++ if test -f "$dir/$libname.$acl_libext"; then ++ found_dir="$dir" ++ found_a="$dir/$libname.$acl_libext" + fi +- else +- if test -f "$additional_libdir/lib$name.$libext"; then +- found_dir="$additional_libdir" +- found_a="$additional_libdir/lib$name.$libext" +- if test -f "$additional_libdir/lib$name.la"; then +- found_la="$additional_libdir/lib$name.la" +- fi ++ fi ++ if test "X$found_dir" != "X"; then ++ if test -f "$dir/$libname.la"; then ++ found_la="$dir/$libname.la" + fi + fi + fi +@@ -227,26 +274,44 @@ + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` +- if test -n "$shlibext" \ +- && { test -f "$dir/lib$name.$shlibext" \ +- || { test "$shlibext" = dll \ +- && test -f "$dir/lib$name.dll.a"; }; }; then +- found_dir="$dir" +- if test -f "$dir/lib$name.$shlibext"; then +- found_so="$dir/lib$name.$shlibext" ++ dnl First look for a shared library. ++ if test -n "$acl_shlibext"; then ++ if test -f "$dir/$libname$shrext"; then ++ found_dir="$dir" ++ found_so="$dir/$libname$shrext" + else +- found_so="$dir/lib$name.dll.a" +- fi +- if test -f "$dir/lib$name.la"; then +- found_la="$dir/lib$name.la" ++ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ++ ver=`(cd "$dir" && \ ++ for f in "$libname$shrext".*; do echo "$f"; done \ ++ | sed -e "s,^$libname$shrext\\\\.,," \ ++ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ ++ | sed 1q ) 2>/dev/null` ++ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then ++ found_dir="$dir" ++ found_so="$dir/$libname$shrext.$ver" ++ fi ++ else ++ eval library_names=\"$acl_library_names_spec\" ++ for f in $library_names; do ++ if test -f "$dir/$f"; then ++ found_dir="$dir" ++ found_so="$dir/$f" ++ break ++ fi ++ done ++ fi + fi +- else +- if test -f "$dir/lib$name.$libext"; then ++ fi ++ dnl Then look for a static library. ++ if test "X$found_dir" = "X"; then ++ if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" +- found_a="$dir/lib$name.$libext" +- if test -f "$dir/lib$name.la"; then +- found_la="$dir/lib$name.la" +- fi ++ found_a="$dir/$libname.$acl_libext" ++ fi ++ fi ++ if test "X$found_dir" != "X"; then ++ if test -f "$dir/$libname.la"; then ++ found_la="$dir/$libname.la" + fi + fi + ;; +@@ -282,12 +347,12 @@ + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. +- if test "$hardcode_direct" = yes; then ++ if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else +- if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then ++ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" +@@ -318,13 +383,13 @@ + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi +- if test "$hardcode_minus_L" != no; then ++ if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else +- dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH ++ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. +@@ -512,18 +577,18 @@ + done + done + if test "X$rpathdirs" != "X"; then +- if test -n "$hardcode_libdir_separator"; then ++ if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do +- alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" ++ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done +- dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. ++ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" +- eval flag=\"$hardcode_libdir_flag_spec\" ++ eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else +@@ -531,7 +596,7 @@ + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" +- eval flag=\"$hardcode_libdir_flag_spec\" ++ eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done +@@ -642,3 +707,79 @@ + fi + AC_SUBST([$1]) + ]) ++ ++dnl For those cases where a variable contains several -L and -l options ++dnl referring to unknown libraries and directories, this macro determines the ++dnl necessary additional linker options for the runtime path. ++dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) ++dnl sets LDADDVAR to linker options needed together with LIBSVALUE. ++dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, ++dnl otherwise linking without libtool is assumed. ++AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], ++[ ++ AC_REQUIRE([AC_LIB_RPATH]) ++ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) ++ $1= ++ if test "$enable_rpath" != no; then ++ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then ++ dnl Use an explicit option to hardcode directories into the resulting ++ dnl binary. ++ rpathdirs= ++ next= ++ for opt in $2; do ++ if test -n "$next"; then ++ dir="$next" ++ dnl No need to hardcode the standard /usr/lib. ++ if test "X$dir" != "X/usr/$acl_libdirstem"; then ++ rpathdirs="$rpathdirs $dir" ++ fi ++ next= ++ else ++ case $opt in ++ -L) next=yes ;; ++ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` ++ dnl No need to hardcode the standard /usr/lib. ++ if test "X$dir" != "X/usr/$acl_libdirstem"; then ++ rpathdirs="$rpathdirs $dir" ++ fi ++ next= ;; ++ *) next= ;; ++ esac ++ fi ++ done ++ if test "X$rpathdirs" != "X"; then ++ if test -n ""$3""; then ++ dnl libtool is used for linking. Use -R options. ++ for dir in $rpathdirs; do ++ $1="${$1}${$1:+ }-R$dir" ++ done ++ else ++ dnl The linker is used for linking directly. ++ if test -n "$acl_hardcode_libdir_separator"; then ++ dnl Weird platform: only the last -rpath option counts, the user ++ dnl must pass all path elements in one option. ++ alldirs= ++ for dir in $rpathdirs; do ++ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" ++ done ++ acl_save_libdir="$libdir" ++ libdir="$alldirs" ++ eval flag=\"$acl_hardcode_libdir_flag_spec\" ++ libdir="$acl_save_libdir" ++ $1="$flag" ++ else ++ dnl The -rpath options are cumulative. ++ for dir in $rpathdirs; do ++ acl_save_libdir="$libdir" ++ libdir="$dir" ++ eval flag=\"$acl_hardcode_libdir_flag_spec\" ++ libdir="$acl_save_libdir" ++ $1="${$1}${$1:+ }$flag" ++ done ++ fi ++ fi ++ fi ++ fi ++ fi ++ AC_SUBST([$1]) ++]) +Index: gettext-0.16.1/autoconf-lib-link/config.rpath +=================================================================== +--- gettext-0.16.1.orig/autoconf-lib-link/config.rpath 2006-11-27 09:01:58.000000000 -0800 ++++ gettext-0.16.1/autoconf-lib-link/config.rpath 2011-03-17 00:33:23.336539490 -0700 +@@ -2,7 +2,7 @@ + # Output a system dependent set of variables, describing how to set the + # run time search path of shared libraries in an executable. + # +-# Copyright 1996-2006 Free Software Foundation, Inc. ++# Copyright 1996-2007 Free Software Foundation, Inc. + # Taken from GNU libtool, 2001 + # Originally by Gordon Matzigkeit , 1996 + # +@@ -47,6 +47,18 @@ + done + cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + ++# Code taken from libtool.m4's _LT_CC_BASENAME. ++ ++for cc_temp in $CC""; do ++ case $cc_temp in ++ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; ++ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; ++ \-*) ;; ++ *) break;; ++ esac ++done ++cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` ++ + # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + + wl= +@@ -64,7 +76,14 @@ + ;; + esac + ;; +- mingw* | pw32* | os2*) ++ darwin*) ++ case $cc_basename in ++ xlc*) ++ wl='-Wl,' ++ ;; ++ esac ++ ;; ++ mingw* | cygwin* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' +@@ -74,7 +93,7 @@ + ;; + newsos6) + ;; +- linux*) ++ linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' +@@ -100,7 +119,7 @@ + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; +- sco3.2v5*) ++ rdos*) + ;; + solaris*) + wl='-Wl,' +@@ -108,11 +127,14 @@ + sunos4*) + wl='-Qoption ld ' + ;; +- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ++ sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ wl='-Wl,' ++ ;; + unicos*) + wl='-Wl,' + ;; +@@ -141,6 +163,10 @@ + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; ++ interix*) ++ # we just hope/assume this is gcc and not c89 (= MSVC++) ++ with_gnu_ld=yes ++ ;; + openbsd*) + with_gnu_ld=no + ;; +@@ -189,11 +215,11 @@ + ld_shlibs=no + fi + ;; +- interix3*) ++ interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; +- linux*) ++ gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else +@@ -280,7 +306,7 @@ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 +- hardcode_direct=yes ++ : + else + # We have old collect2 + hardcode_direct=unsupported +@@ -359,7 +385,7 @@ + hardcode_direct=yes + hardcode_minus_L=yes + ;; +- freebsd* | kfreebsd*-gnu | dragonfly*) ++ freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; +@@ -412,18 +438,22 @@ + hardcode_libdir_separator=: + ;; + openbsd*) +- hardcode_direct=yes +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ++ if test -f /usr/libexec/ld.so; then ++ hardcode_direct=yes ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ++ else ++ case "$host_os" in ++ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) ++ hardcode_libdir_flag_spec='-R$libdir' ++ ;; ++ *) ++ hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ++ ;; ++ esac ++ fi + else +- case "$host_os" in +- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) +- hardcode_libdir_flag_spec='-R$libdir' +- ;; +- *) +- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' +- ;; +- esac ++ ld_shlibs=no + fi + ;; + os2*) +@@ -471,7 +501,7 @@ + ld_shlibs=yes + fi + ;; +- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' +@@ -488,33 +518,51 @@ + + # Check dynamic linker characteristics + # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. ++# Unlike libtool.m4, here we don't care about _all_ names of the library, but ++# only about the one the linker finds when passed -lNAME. This is the last ++# element of library_names_spec in libtool.m4, or possibly two of them if the ++# linker has special search rules. ++library_names_spec= # the last element of library_names_spec in libtool.m4 + libname_spec='lib$name' + case "$host_os" in + aix3*) ++ library_names_spec='$libname.a' + ;; + aix4* | aix5*) ++ library_names_spec='$libname$shrext' + ;; + amigaos*) ++ library_names_spec='$libname.a' + ;; + beos*) ++ library_names_spec='$libname$shrext' + ;; + bsdi[45]*) ++ library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll ++ library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib ++ library_names_spec='$libname$shrext' + ;; + dgux*) ++ library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; +- kfreebsd*-gnu) +- ;; + freebsd* | dragonfly*) ++ case "$host_os" in ++ freebsd[123]*) ++ library_names_spec='$libname$shrext$versuffix' ;; ++ *) ++ library_names_spec='$libname$shrext' ;; ++ esac + ;; + gnu*) ++ library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in +@@ -528,10 +576,13 @@ + shrext=.sl + ;; + esac ++ library_names_spec='$libname$shrext' + ;; +- interix3*) ++ interix[3-9]*) ++ library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) ++ library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= +@@ -548,33 +599,46 @@ + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; +- linux*) ++ linux* | k*bsd*-gnu) ++ library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) ++ library_names_spec='$libname$shrext' + ;; + netbsd*) ++ library_names_spec='$libname$shrext' + ;; + newsos6) ++ library_names_spec='$libname$shrext' + ;; + nto-qnx*) ++ library_names_spec='$libname$shrext' + ;; + openbsd*) ++ library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll ++ library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) ++ library_names_spec='$libname$shrext' + ;; + solaris*) ++ library_names_spec='$libname$shrext' + ;; + sunos4*) ++ library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) ++ library_names_spec='$libname$shrext' + ;; + sysv4*MP*) ++ library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) ++ library_names_spec='$libname$shrext' + ;; + uts4*) + ;; +@@ -583,6 +647,8 @@ + sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` + shlibext=`echo "$shrext" | sed -e 's,^\.,,'` ++escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` ++escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + + LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < + +--- a/gettext-tools/gnulib-lib/Makefile.am ++++ b/gettext-tools/gnulib-lib/Makefile.am +@@ -57,6 +57,10 @@ endif + # Rules generated and collected by gnulib-tool. + include Makefile.gnulib + ++# defined in Makefile.gnulib but missing this dependency ++# ++install-exec-clean: install-libLTLIBRARIES ++ + # Which classes to export from the shared library. + MOOPPFLAGS += --dllexport=styled_ostream + +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -229,8 +229,8 @@ libgettextsrc_la_LDFLAGS += -Wl,--export + endif + + # No need to install libgettextsrc.a, except on AIX. +-install-exec-local: install-libLTLIBRARIES install-exec-clean +-install-exec-clean: ++install-exec-local: install-exec-clean ++install-exec-clean: install-libLTLIBRARIES + case "@host_os@" in \ + aix*) ;; \ + *) $(RM) $(DESTDIR)$(libdir)/libgettextsrc.a ;; \ diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING new file mode 100644 index 0000000000..3485c5a2cb --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING @@ -0,0 +1,4 @@ +dnl Copyright (C) 1997-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in new file mode 100644 index 0000000000..fabdc76c9c --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in @@ -0,0 +1,454 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. +# +# Origin: gettext-0.18.3 +GETTEXT_MACRO_VERSION = 0.18 + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +SED = @SED@ +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: stamp-po +all-no: + +# Ensure that the gettext macros and this Makefile.in.in are in sync. +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ + } + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu='GNU '; \ + else \ + package_gnu=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_gnu}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: stamp-po $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ + cd $(top_builddir) \ + && @SHELL@ ./config.status $(subdir)/$@.in po-directories + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template new file mode 100644 index 0000000000..4a9ff7d231 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template @@ -0,0 +1,53 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz new file mode 100644 index 0000000000..e0335a3d1c Binary files /dev/null and b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz differ diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath new file mode 100755 index 0000000000..c38b914d6b --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath @@ -0,0 +1,690 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2013 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < +Date: Wed, 20 Nov 2013 17:52:50 +0800 +Subject: [PATCH] remove the test to convert euc-jp + +Remove the test "Test against HP-UX 11.11 bug: +No converter from EUC-JP to UTF-8 is provided" +since we don't support HP-UX and it causes +guile-native compile failure if the euc-jp is not +installed on the host + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jackie Huang +--- + iconv.m4 | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/iconv.m4 b/iconv.m4 +index a503646..dbe7ca1 100644 +--- a/iconv.m4 ++++ b/iconv.m4 +@@ -159,17 +159,6 @@ int main () + } + } + #endif +- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is +- provided. */ +- if (/* Try standardized names. */ +- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) +- /* Try IRIX, OSF/1 names. */ +- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) +- /* Try AIX names. */ +- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) +- /* Try HP-UX names. */ +- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) +- result |= 16; + return result; + }]])], + [am_cv_func_iconv_works=yes], +-- +1.8.3 + diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin new file mode 100644 index 0000000000..2436c49e78 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb b/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb new file mode 100644 index 0000000000..2b43b97022 --- /dev/null +++ b/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb @@ -0,0 +1,32 @@ +SUMMARY = "Minimal gettext for supporting native autoconf/automake" +DESCRIPTION = "Contains the m4 macros sufficient to support building \ +autoconf/automake. This provides a significant build time speedup by \ +the removal of gettext-native from most dependency chains (now only \ +needed for gettext for the target)." +SRC_URI = "file://aclocal.tgz \ + file://config.rpath \ + file://Makefile.in.in \ + file://remove-potcdate.sin \ + file://COPYING \ + file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \ +" + +INHIBIT_DEFAULT_DEPS = "1" +INHIBIT_AUTOTOOLS_DEPS = "1" + +LICENSE = "FSF-Unlimited" +LIC_FILES_CHKSUM = "file://COPYING;md5=0854da868a929923087141d9d7aba7d5" + +inherit native + + +S = "${WORKDIR}" + +do_install () { + install -d ${D}${datadir}/aclocal/ + cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/ + install -d ${D}${datadir}/gettext/po/ + cp ${WORKDIR}/config.rpath ${D}${datadir}/gettext/ + cp ${WORKDIR}/Makefile.in.in ${D}${datadir}/gettext/po/ + cp ${WORKDIR}/remove-potcdate.sin ${D}${datadir}/gettext/po/ +} diff --git a/meta/recipes-core/gettext/gettext_0.16.1.bb b/meta/recipes-core/gettext/gettext_0.16.1.bb new file mode 100644 index 0000000000..5725e7fe07 --- /dev/null +++ b/meta/recipes-core/gettext/gettext_0.16.1.bb @@ -0,0 +1,109 @@ +SUMMARY = "Utilities and libraries for producing multi-lingual messages" +DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings." +HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html" +SECTION = "libs" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5" + +PR = "r6" +DEPENDS = "virtual/libiconv" +DEPENDS_class-native = "" +PROVIDES = "virtual/libintl virtual/gettext" +PROVIDES_class-native = "" + +SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \ + file://gettext-vpath.patch \ + file://linklib_from_0.17.patch \ + file://gettext-autoconf-lib-link-no-L.patch \ + file://disable_java.patch \ + file://fix_aclocal_version.patch \ + file://fix_gnu_source_circular.patch \ + file://hardcode_macro_version.patch \ + " + + +SRC_URI_append_linux-uclibc = " file://gettext-error_print_progname.patch" +SRC_URI_append_linux-uclibceabi = " file://gettext-error_print_progname.patch" + +SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127" +SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d" + +PARALLEL_MAKE = "" + +inherit autotools + +EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs" +acpaths = '-I ${S}/autoconf-lib-link/m4/ \ + -I ${S}/gettext-runtime/m4 \ + -I ${S}/gettext-tools/m4' + +do_configure_prepend() { + rm -f ${S}/config/m4/libtool.m4 +} + +# these lack the .x behind the .so, but shouldn't be in the -dev package +# Otherwise you get the following results: +# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz +# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz +# because gettext depends on gettext-dev, which pulls in more -dev packages: +# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk +# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk +# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk +# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk + +PACKAGES =+ "libgettextlib libgettextsrc" +FILES_libgettextlib = "${libdir}/libgettextlib-*.so*" +FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*" + +PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-staticdev gettext-runtime-doc" + +FILES_${PN} += "${libdir}/${BPN}/*" + +FILES_gettext-runtime = "${bindir}/gettext \ + ${bindir}/ngettext \ + ${bindir}/envsubst \ + ${bindir}/gettext.sh \ + ${libdir}/libasprintf${SODEV} \ + ${libdir}/GNU.Gettext.dll \ + " +FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \ + ${libdir}/charset.alias \ + " +FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a" +FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \ + ${libdir}/libasprintf${SOLIBDEV}" +FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \ + ${includedir}/libintl.h \ + " +FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \ + ${mandir}/man1/ngettext.* \ + ${mandir}/man1/envsubst.* \ + ${mandir}/man1/.* \ + ${mandir}/man3/* \ + ${docdir}/gettext/gettext.* \ + ${docdir}/gettext/ngettext.* \ + ${docdir}/gettext/envsubst.* \ + ${docdir}/gettext/*.3.html \ + ${datadir}/gettext/ABOUT-NLS \ + ${docdir}/gettext/csharpdoc/* \ + ${docdir}/libasprintf/autosprintf.html \ + ${infodir}/autosprintf.info \ + " + + +do_install_append() { + rm -f ${D}${libdir}/preloadable_libintl.so +} + +# Anyone inheriting gettext will have both gettext-native and gettext +# available, and we don't want to use older macros from the target gettext in +# a non-gplv3 build, so kill them and let dependent recipes rely on +# gettext-native. + +SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_m4_macros" + +remove_sysroot_m4_macros () { + rm -r "${SYSROOT_DESTDIR}${datadir}/aclocal" +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/gettext/gettext_0.18.3.2.bb b/meta/recipes-core/gettext/gettext_0.18.3.2.bb new file mode 100644 index 0000000000..553d52223e --- /dev/null +++ b/meta/recipes-core/gettext/gettext_0.18.3.2.bb @@ -0,0 +1,106 @@ +SUMMARY = "Utilities and libraries for producing multi-lingual messages" +DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings." +HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html" +SECTION = "libs" +LICENSE = "GPLv3+ & LGPL-2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +DEPENDS = "gettext-native virtual/libiconv expat" +DEPENDS_class-native = "gettext-minimal-native" +PROVIDES = "virtual/libintl virtual/gettext" +PROVIDES_class-native = "virtual/gettext-native" +RCONFLICTS_${PN} = "proxy-libintl" +SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \ + file://parallel.patch \ + " + +PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses," + +LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread " + +SRC_URI[md5sum] = "241aba309d07aa428252c74b40a818ef" +SRC_URI[sha256sum] = "d1a4e452d60eb407ab0305976529a45c18124bd518d976971ac6dc7aa8b4c5d7" + +inherit autotools + +EXTRA_OECONF += "--without-lispdir \ + --disable-csharp \ + --disable-libasprintf \ + --disable-java \ + --disable-native-java \ + --disable-openmp \ + --disable-acl \ + --with-included-glib \ + --without-emacs \ + --without-cvs \ + --without-git \ + --with-included-libxml \ + --with-included-libcroco \ + --with-included-libunistring \ + " + +acpaths = '-I ${S}/gettext-runtime/m4 \ + -I ${S}/gettext-tools/m4' + + +# these lack the .x behind the .so, but shouldn't be in the -dev package +# Otherwise you get the following results: +# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz +# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz +# because gettext depends on gettext-dev, which pulls in more -dev packages: +# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk +# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk +# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk +# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk + +PACKAGES =+ "libgettextlib libgettextsrc" +FILES_libgettextlib = "${libdir}/libgettextlib-*.so*" +FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*" + +PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc" + +FILES_${PN} += "${libdir}/${BPN}/*" + +FILES_gettext-runtime = "${bindir}/gettext \ + ${bindir}/ngettext \ + ${bindir}/envsubst \ + ${bindir}/gettext.sh \ + ${libdir}/libasprintf.so* \ + ${libdir}/GNU.Gettext.dll \ + " +FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \ + ${libdir}/charset.alias \ + " +FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \ + ${includedir}/autosprintf.h \ + " +FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \ + ${includedir}/libintl.h \ + " +FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \ + ${mandir}/man1/ngettext.* \ + ${mandir}/man1/envsubst.* \ + ${mandir}/man1/.* \ + ${mandir}/man3/* \ + ${docdir}/gettext/gettext.* \ + ${docdir}/gettext/ngettext.* \ + ${docdir}/gettext/envsubst.* \ + ${docdir}/gettext/*.3.html \ + ${datadir}/gettext/ABOUT-NLS \ + ${docdir}/gettext/csharpdoc/* \ + ${docdir}/libasprintf/autosprintf.html \ + ${infodir}/autosprintf.info \ + " + +do_install_append() { + rm -f ${D}${libdir}/preloadable_libintl.so +} + +do_install_append_class-native () { + rm ${D}${datadir}/aclocal/* + rm ${D}${datadir}/gettext/config.rpath + rm ${D}${datadir}/gettext/po/Makefile.in.in + rm ${D}${datadir}/gettext/po/remove-potcdate.sin +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch new file mode 100644 index 0000000000..9b87d9d547 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch @@ -0,0 +1,56 @@ +From 0167c3340d8201dca8e9031b61703bbc5ed6ce33 Mon Sep 17 00:00:00 2001 +From: Jan Schmidt +Date: Wed, 25 Sep 2013 19:22:26 +1000 +Subject: [PATCH] gio: Fix -Werror format string errors from mismatched ints. + +Upstream-Status: Backport + +--- + gio/gdbusmessage.c | 8 ++++---- + gio/gdbusprivate.c | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c +index ac233a3..ad77aa6 100644 +--- a/gio/gdbusmessage.c ++++ b/gio/gdbusmessage.c +@@ -3468,10 +3468,10 @@ g_dbus_message_print (GDBusMessage *message, + statbuf.st_mode); + g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_ino); +- g_string_append_printf (fs, "%s" "uid=%d", fs->len > 0 ? "," : "", +- statbuf.st_uid); +- g_string_append_printf (fs, "%s" "gid=%d", fs->len > 0 ? "," : "", +- statbuf.st_gid); ++ g_string_append_printf (fs, "%s" "uid=%u", fs->len > 0 ? "," : "", ++ (guint) statbuf.st_uid); ++ g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "", ++ (guint) statbuf.st_gid); + g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "", + major (statbuf.st_rdev), minor (statbuf.st_rdev)); + g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", +diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c +index 0e5bef2..785a0c0 100644 +--- a/gio/gdbusprivate.c ++++ b/gio/gdbusprivate.c +@@ -2155,7 +2155,7 @@ write_message_print_transport_debug (gssize bytes_written, + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Transport:\n" +- " >>>> WROTE %" G_GSIZE_FORMAT " bytes of message with serial %d and\n" ++ " >>>> WROTE %" G_GSSIZE_FORMAT " bytes of message with serial %d and\n" + " size %" G_GSIZE_FORMAT " from offset %" G_GSIZE_FORMAT " on a %s\n", + bytes_written, + g_dbus_message_get_serial (data->message), +@@ -2206,7 +2206,7 @@ read_message_print_transport_debug (gssize bytes_read, + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Transport:\n" +- " <<<< READ %" G_GSIZE_FORMAT " bytes of message with serial %d and\n" ++ " <<<< READ %" G_GSSIZE_FORMAT " bytes of message with serial %d and\n" + " size %d to offset %" G_GSIZE_FORMAT " from a %s\n", + bytes_read, + serial, +-- +1.8.3.1 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch new file mode 100644 index 0000000000..3aac35a5d3 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch @@ -0,0 +1,39 @@ +From 55253b55b9c65f3e0efbbe03cbab2a4c4014a16b Mon Sep 17 00:00:00 2001 +From: Song.Li +Date: Thu, 5 Jul 2012 15:09:41 +0800 +Subject: [PATCH] add -march=i486 into CFLAGS automatically + +Upstream-Status: Inappropriate [configuration] + +glib configure will check if current gcc need -march=i486, +when gcc need -march=i486 but CFLAGS don't have, +glib configure will abort and advise the user to add -march=i486 or later. +This will break the build process,it's not good for automatic build system. +so change this to adding -march=i485 automatically when it is needed. +--- + configure.ac | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +Index: glib-2.36.0/configure.ac +=================================================================== +--- glib-2.36.0.orig/configure.ac ++++ glib-2.36.0/configure.ac +@@ -2378,7 +2378,7 @@ dnl + dnl Note that the atomic ops are only available with GCC on x86 when + dnl using -march=i486 or higher. If we detect that the atomic ops are + dnl not available but would be available given the right flags, we want +-dnl to abort and advise the user to fix their CFLAGS. It's better to do ++dnl to add -march=i486 automatically to fix their CFLAGS. It's better to do + dnl that then to silently fall back on emulated atomic ops just because + dnl the user had the wrong build environment. + +@@ -2401,7 +2401,8 @@ AC_CACHE_CHECK([for lock-free atomic int + AC_TRY_COMPILE([], + [volatile int atomic = 2;\ + __sync_bool_compare_and_swap (&atomic, 2, 3);], +- [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])], ++ [AC_MSG_WARN([GLib must be build with -march=i486 or later.]) ++ SAVE_CFLAGS="${SAVE_CFLAGS} -march=i486"], + []) + CFLAGS="${SAVE_CFLAGS}" + fi diff --git a/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch new file mode 100644 index 0000000000..1d69a3f290 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch @@ -0,0 +1,60 @@ +From 1c5718648d49e795efee91c220a2bf9386c184f2 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sat, 28 Apr 2012 18:24:50 +0200 +Subject: [PATCH] configure: use $host_alias-libtool instead of libtool + directly + +Poky renames libtool to $host_alias-libtool. +./$host_alias-libtool isn't created until after configure runs with +libtool >= 2.2.2 +so we can't call # it at this point. We can safely assume a version is +available +from PATH though + +Rebased to glib-2.27.3 by Dongxiao Xu +Rebased to glib-2.32.1 by Martin Jansa + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Martin Jansa +--- + configure.ac | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index a6478c6..9a93d60 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1470,7 +1470,7 @@ if test x"$glib_native_win32" = xyes; then + G_MODULE_LDFLAGS= + else + export SED +- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` ++ G_MODULE_LDFLAGS=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` + fi + dnl G_MODULE_IMPL= don't reset, so cmd-line can override + G_MODULE_NEED_USCORE=0 +@@ -1535,9 +1535,9 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then + LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS" + dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness + echo "void glib_plugin_test(void) { }" > plugin.c +- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \ ++ ${SHELL} ./$host_alias-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \ + ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1 +- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \ ++ ${SHELL} ./$host_alias-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \ + ${LDFLAGS} -module -o plugin.la -export-dynamic \ + -shrext ".o" -avoid-version plugin.lo \ + -rpath /dont/care >/dev/null 2>&1 +@@ -1614,7 +1614,7 @@ fi + + AC_MSG_CHECKING(for the suffix of module shared libraries) + export SED +-shrext_cmds=`./libtool --config | grep '^shrext_cmds='` ++shrext_cmds=`./$host_alias-libtool --config | grep '^shrext_cmds='` + eval $shrext_cmds + module=yes eval std_shrext=$shrext_cmds + # chop the initial dot +-- +1.7.8.6 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch new file mode 100644 index 0000000000..1571112b0e --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch @@ -0,0 +1,35 @@ +Rename 'rand' variable to avoid conflict. + +Upstream-Status: pending +Signed-off-by: Björn Stenberg + +diff -u glib-2.34.3/tests/refcount/signals.c~ glib-2.34.3/tests/refcount/signals.c +--- glib-2.34.3/tests/refcount/signals.c 2012-11-26 17:52:48.000000000 +0100 ++++ glib-2.34.3/tests/refcount/signals.c 2013-02-08 14:24:10.052477546 +0100 +@@ -9,7 +9,7 @@ + #define MY_IS_TEST_CLASS(tclass) (G_TYPE_CHECK_CLASS_TYPE ((tclass), G_TYPE_TEST)) + #define MY_TEST_GET_CLASS(test) (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass)) + +-static GRand *rand; ++static GRand *grand; + + typedef struct _GTest GTest; + typedef struct _GTestClass GTestClass; +@@ -84,7 +84,7 @@ + NULL + }; + +- rand = g_rand_new(); ++ grand = g_rand_new(); + + test_type = g_type_register_static (G_TYPE_OBJECT, "GTest", + &test_info, 0); +@@ -218,7 +218,7 @@ + static void + my_test_do_prop (GTest * test) + { +- test->value = g_rand_int (rand); ++ test->value = g_rand_int (grand); + g_object_notify (G_OBJECT (test), "test-prop"); + } + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch b/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch new file mode 100644 index 0000000000..720ea6c328 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch @@ -0,0 +1,54 @@ +Upstream-Status: Submitted +Signed-off-by: Ross Burton + +From a047a0270ee5faf1d9d6080cbc613defdf52baea Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Tue, 4 Feb 2014 13:15:08 +0000 +Subject: [PATCH] gio/tests: fix race when generating code + +There is a race condition in the makefile that can result in build failures like this in parallel builds: + +| ./gdbus-test-codegen-generated.h:7:0: error: unterminated #ifndef +| #ifndef __GDBUS_TEST_CODEGEN_GENERATED_H__ + +This is because a rule like this: + +x.c x.h: prerequisites + @commands + +doesn't consider x.c and x.h together. Instead, it expands to two rules, one to +generate x.c and one to generate x.h, which happen to run the same commands. In +the worst case they execute in parallel, overwriting each other's output. + +Signed-off-by: Ross Burton + +https://bugzilla.gnome.org/show_bug.cgi?id=723616 +--- + gio/tests/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am +index 0beb239..270faf6 100644 +--- a/gio/tests/Makefile.am ++++ b/gio/tests/Makefile.am +@@ -436,7 +436,7 @@ gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumode + gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c + + gdbus-test-codegen.o: gdbus-test-codegen-generated.h +-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen ++gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen + $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \ + UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \ + $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \ +@@ -455,6 +455,8 @@ gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml + --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \ + $(srcdir)/test-codegen.xml \ + $(NULL) ++gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h ++ @: # Generated as side-effect of .h + + EXTRA_DIST += test-codegen.xml + CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml +-- +1.7.10.4 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch new file mode 100644 index 0000000000..9759d11e3c --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch @@ -0,0 +1,29 @@ +configure.ac: change readlink -f to -m + +Change "readlink -f" to "readlink -m" since $libdir/$with_runtime_libdir +may not exist. + +This patch should go to the upstream, I will send it sooner. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -271,7 +271,7 @@ AC_ARG_WITH(runtime-libdir, + [], + [with_runtime_libdir=""]) + GLIB_RUNTIME_LIBDIR="$with_runtime_libdir" +-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`" ++ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`" + AC_SUBST(GLIB_RUNTIME_LIBDIR) + AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR) + AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"]) +-- +1.8.1.2 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch new file mode 100644 index 0000000000..ee435111fc --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch @@ -0,0 +1,24 @@ +# an very old patch cherry-picked in every glib-2.0 patch directory. The earliest container +# for it is 2.6.5 in OE. The earliest commit for it is c8e5702127e507e82e6f68a4b8c546803accea9d +# in OE side which ports from previous bitkeeper SCM. In OE side it's only used til 2.12.4. +# +# keep it since it's always cleaner to not hardcode destination path. Use @datadir@ is more +# portable here. mark for upstream +# +# by Kevin Tian , 06/25/2010 +# Rebased by Dongxiao Xu , 11/16/2010 + +Upstream-Status: Inappropriate [configuration] + +diff -ruN glib-2.27.3-orig/glib-gettextize.in glib-2.27.3/glib-gettextize.in +--- glib-2.27.3-orig/glib-gettextize.in 2009-04-01 07:04:20.000000000 +0800 ++++ glib-2.27.3/glib-gettextize.in 2010-11-16 12:55:06.874605916 +0800 +@@ -52,7 +52,7 @@ + datadir=@datadir@ + datarootdir=@datarootdir@ + +-gettext_dir=$prefix/share/glib-2.0/gettext ++gettext_dir=@datadir@/glib-2.0/gettext + + while test $# -gt 0; do + case "$1" in diff --git a/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch b/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch new file mode 100644 index 0000000000..3dba0ee31b --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch @@ -0,0 +1,197 @@ +Fix the handling of skipped tests so that it follows what automake does. + +Upstream-Status: Backport [https://bugzilla.gnome.org/show_bug.cgi?id=720263] +Signed-off-by: Ross Burton + +diff --git a/glib/gtestutils.c b/glib/gtestutils.c +index bc7bbcf..feaafa3 100644 +--- a/glib/gtestutils.c ++++ b/glib/gtestutils.c +@@ -607,9 +607,10 @@ static gchar *test_run_name = ""; + static GSList **test_filename_free_list; + static guint test_run_forks = 0; + static guint test_run_count = 0; ++static guint test_skipped_count = 0; + static GTestResult test_run_success = G_TEST_RUN_FAILURE; + static gchar *test_run_msg = NULL; +-static guint test_skip_count = 0; ++static guint test_startup_skip_count = 0; + static GTimer *test_user_timer = NULL; + static double test_user_stamp = 0; + static GSList *test_paths = NULL; +@@ -765,6 +766,8 @@ g_test_log (GTestLogType lbit, + g_print ("Bail out!\n"); + abort(); + } ++ if (largs[0] == G_TEST_RUN_SKIPPED) ++ test_skipped_count++; + break; + case G_TEST_LOG_MIN_RESULT: + if (test_tap_log) +@@ -869,11 +872,11 @@ parse_args (gint *argc_p, + { + gchar *equal = argv[i] + 16; + if (*equal == '=') +- test_skip_count = g_ascii_strtoull (equal + 1, NULL, 0); ++ test_startup_skip_count = g_ascii_strtoull (equal + 1, NULL, 0); + else if (i + 1 < argc) + { + argv[i++] = NULL; +- test_skip_count = g_ascii_strtoull (argv[i], NULL, 0); ++ test_startup_skip_count = g_ascii_strtoull (argv[i], NULL, 0); + } + argv[i] = NULL; + } +@@ -1516,14 +1519,21 @@ g_test_get_root (void) + * g_test_run_suite() or g_test_run() may only be called once + * in a program. + * +- * Returns: 0 on success ++ * Returns: 0 on success, 1 on failure (assuming it returns at all), ++ * 77 if all tests were skipped with g_test_skip(). + * + * Since: 2.16 + */ + int + g_test_run (void) + { +- return g_test_run_suite (g_test_get_root()); ++ if (g_test_run_suite (g_test_get_root()) != 0) ++ return 1; ++ ++ if (test_run_count > 0 && test_run_count == test_skipped_count) ++ return 77; ++ else ++ return 0; + } + + /** +@@ -2063,7 +2073,7 @@ test_case_run (GTestCase *tc) + } + } + +- if (++test_run_count <= test_skip_count) ++ if (++test_run_count <= test_startup_skip_count) + g_test_log (G_TEST_LOG_SKIP_CASE, test_run_name, NULL, 0, NULL); + else if (test_run_list) + { +@@ -2117,7 +2127,8 @@ test_case_run (GTestCase *tc) + g_free (test_uri_base); + test_uri_base = old_base; + +- return success == G_TEST_RUN_SUCCESS; ++ return (success == G_TEST_RUN_SUCCESS || ++ success == G_TEST_RUN_SKIPPED); + } + + static int +diff --git a/glib/tests/testing.c b/glib/tests/testing.c +index 20c2e79..1025f12 100644 +--- a/glib/tests/testing.c ++++ b/glib/tests/testing.c +@@ -575,10 +575,93 @@ test_nonfatal (void) + g_test_trap_assert_stdout ("*The End*"); + } + ++static void ++test_skip (void) ++{ ++ g_test_skip ("Skipped should count as passed, not failed"); ++} ++ ++static void ++test_pass (void) ++{ ++} ++ ++static const char *argv0; ++ ++static void ++test_skip_all (void) ++{ ++ GPtrArray *argv; ++ GError *error = NULL; ++ int status; ++ ++ argv = g_ptr_array_new (); ++ g_ptr_array_add (argv, (char *) argv0); ++ g_ptr_array_add (argv, "--GTestSubprocess"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip"); ++ g_ptr_array_add (argv, NULL); ++ ++ g_spawn_sync (NULL, (char **) argv->pdata, NULL, ++ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, ++ NULL, NULL, NULL, NULL, &status, ++ &error); ++ g_assert_no_error (error); ++ ++ g_spawn_check_exit_status (status, &error); ++ g_assert_error (error, G_SPAWN_EXIT_ERROR, 77); ++ g_clear_error (&error); ++ ++ g_ptr_array_set_size (argv, 0); ++ g_ptr_array_add (argv, (char *) argv0); ++ g_ptr_array_add (argv, "--GTestSubprocess"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip2"); ++ g_ptr_array_add (argv, NULL); ++ ++ g_spawn_sync (NULL, (char **) argv->pdata, NULL, ++ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, ++ NULL, NULL, NULL, NULL, &status, ++ &error); ++ g_assert_no_error (error); ++ ++ g_spawn_check_exit_status (status, &error); ++ g_assert_error (error, G_SPAWN_EXIT_ERROR, 77); ++ g_clear_error (&error); ++ ++ g_ptr_array_set_size (argv, 0); ++ g_ptr_array_add (argv, (char *) argv0); ++ g_ptr_array_add (argv, "--GTestSubprocess"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip-all/subprocess/pass"); ++ g_ptr_array_add (argv, "-p"); ++ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1"); ++ g_ptr_array_add (argv, NULL); ++ ++ g_spawn_sync (NULL, (char **) argv->pdata, NULL, ++ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, ++ NULL, NULL, NULL, NULL, &status, ++ &error); ++ g_assert_no_error (error); ++ ++ g_spawn_check_exit_status (status, &error); ++ g_assert_no_error (error); ++ ++ g_ptr_array_unref (argv); ++} ++ + int + main (int argc, + char *argv[]) + { ++ argv0 = argv[0]; ++ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/random-generator/rand-1", test_rand1); +@@ -633,5 +716,11 @@ main (int argc, + + g_test_add_func ("/misc/nonfatal", test_nonfatal); + ++ g_test_add_func ("/misc/skip", test_skip); ++ g_test_add_func ("/misc/skip-all", test_skip_all); ++ g_test_add_func ("/misc/skip-all/subprocess/skip1", test_skip); ++ g_test_add_func ("/misc/skip-all/subprocess/skip2", test_skip); ++ g_test_add_func ("/misc/skip-all/subprocess/pass", test_pass); ++ + return g_test_run(); + } diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch new file mode 100644 index 0000000000..0db8fd1609 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch @@ -0,0 +1,65 @@ +Fix dbus-appinfo from attempting to use the session's bus, and hanging if there +isn't one present. + +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 940fa98290812789d095d93ff1c550cd86fb2428 Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Mon, 28 Oct 2013 21:18:54 +0000 +Subject: Tests: add session_bus_run() and use it where possible + +This is to avoid having again the subtil bug in dbus-appinfo.c: +session_bus_down() was called before g_test_run() so the test was +running on the user's dbus session. + +https://bugzilla.gnome.org/show_bug.cgi?id=697348 +--- +diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c +index ca11e98..7698429 100644 +--- a/gio/tests/dbus-appinfo.c ++++ b/gio/tests/dbus-appinfo.c +@@ -280,11 +280,7 @@ main (int argc, char **argv) + { + g_test_init (&argc, &argv, NULL); + +- session_bus_up (); +- + g_test_add_func ("/appinfo/dbusappinfo", test_dbus_appinfo); + +- session_bus_down (); +- +- return g_test_run (); ++ return session_bus_run (); + } +diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c +index 68c4449..13c2edb 100644 +--- a/gio/tests/gdbus-sessionbus.c ++++ b/gio/tests/gdbus-sessionbus.c +@@ -47,3 +47,14 @@ session_bus_down (void) + g_clear_object (&singleton); + } + ++gint ++session_bus_run (void) ++{ ++ gint ret; ++ ++ session_bus_up (); ++ ret = g_test_run (); ++ session_bus_down (); ++ ++ return ret; ++} +diff --git a/gio/tests/gdbus-sessionbus.h b/gio/tests/gdbus-sessionbus.h +index 7ef3abd..284cd00 100644 +--- a/gio/tests/gdbus-sessionbus.h ++++ b/gio/tests/gdbus-sessionbus.h +@@ -30,6 +30,7 @@ G_BEGIN_DECLS + void session_bus_up (void); + void session_bus_stop (void); + void session_bus_down (void); ++gint session_bus_run (void); + + G_END_DECLS + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch new file mode 100644 index 0000000000..f3be02770c --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch @@ -0,0 +1,30 @@ +Instead of writing the temporary mapping files in the mappedfile test to the +user runtime directory, write them to $TMP. The runtime directory may not +currently exist if the test is executed on a non-desktop system and the test +doesn't attempt to create the directory structure. + +Upstream-Status: Pending +Signed-off-by: Ross Burton + +diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c +index 40e0e60..27a24be 100644 +--- a/glib/tests/mappedfile.c ++++ b/glib/tests/mappedfile.c +@@ -81,7 +81,7 @@ test_writable (void) + const gchar *new = "abcdefghijklmnopqrstuvxyz"; + gchar *tmp_copy_path; + +- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL); ++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL); + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error); + g_assert_no_error (error); +@@ -125,7 +125,7 @@ test_writable_fd (void) + int fd; + gchar *tmp_copy_path; + +- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL); ++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL); + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error); + g_assert_no_error (error); diff --git a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest new file mode 100644 index 0000000000..130ae09b6c --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest @@ -0,0 +1,3 @@ +#! /bin/sh + +gnome-desktop-testing-runner glib diff --git a/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch new file mode 100644 index 0000000000..2a154fdd4a --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch @@ -0,0 +1,20 @@ +Fix DATADIRNAME on uclibc/Linux + +translation files are always installed under PREFIX/share/locale in uclibc +based systems therefore lets set DATADIRNAME to "share". + +Signed-off-by: Khem Raj +Upstream-Status: Pending +Index: glib-2.38.2/m4macros/glib-gettext.m4 +=================================================================== +--- glib-2.38.2.orig/m4macros/glib-gettext.m4 2013-11-07 07:29:13.000000000 -0800 ++++ glib-2.38.2/m4macros/glib-gettext.m4 2014-03-15 14:51:54.712135644 -0700 +@@ -239,7 +239,7 @@ + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; +- *-*-openbsd*) ++ *-*-openbsd* | *-*-linux-uclibc*) + CATOBJEXT=.mo + DATADIRNAME=share + ;; diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb new file mode 100644 index 0000000000..40529503ba --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb @@ -0,0 +1,24 @@ +require glib.inc + +PE = "1" + +SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" + +SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ + file://configure-libtool.patch \ + file://fix-conflicting-rand.patch \ + file://add-march-i486-into-CFLAGS-automatically.patch \ + file://glib-2.0-configure-readlink.patch \ + file://run-ptest \ + file://0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch \ + file://ptest-dbus.patch \ + file://ptest-paths.patch \ + file://gtest-skip-fixes.patch \ + file://gio-test-race.patch \ + file://uclibc.patch \ + " + +SRC_URI_append_class-native = " file://glib-gettextize-dir.patch" + +SRC_URI[md5sum] = "26d1d08e478fc48c181ca8be44f5b69f" +SRC_URI[sha256sum] = "056a9854c0966a0945e16146b3345b7a82562a5ba4d5516fd10398732aea5734" diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc new file mode 100644 index 0000000000..66bf290c2f --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib.inc @@ -0,0 +1,98 @@ +SUMMARY = "A general-purpose utility library" +DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." +# pcre is under BSD; +# docs/reference/COPYING is with a 'public domai'-like license! +LICENSE = "LGPLv2+ & BSD & PD" +LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \ + file://glib/glib.h;beginline=4;endline=17;md5=62b7bd0d17b98573dfb87495ac1c5b4c \ + file://gmodule/COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \ + file://gmodule/gmodule.h;beginline=4;endline=17;md5=62b7bd0d17b98573dfb87495ac1c5b4c \ + file://glib/pcre/COPYING;md5=266ebc3ff74ee9ce6fad65577667c0f4 \ + file://glib/pcre/pcre.h;beginline=11;endline=35;md5=de27f2bf633d20a2b7af0b1983423283 \ + file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc" +BUGTRACKER = "http://bugzilla.gnome.org" +SECTION = "libs" + +BBCLASSEXTEND = "native nativesdk" + +DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib" +DEPENDS_append_class-target = "${@base_contains('DISTRO_FEATURES', 'ptest', ' dbus', '', d)}" +DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native" +DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-libffi nativesdk-zlib ${BPN}-native" + +PACKAGES =+ "${PN}-utils ${PN}-bash-completion ${PN}-codegen" + +LEAD_SONAME = "libglib-2.0.*" +FILES_${PN}-utils = "${bindir}/* ${datadir}/glib-2.0/gettext" + +inherit autotools gettext gtk-doc pkgconfig ptest + +S = "${WORKDIR}/glib-${PV}" + +CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man" + +PTEST_CONF = "${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-installed-tests', '--disable-installed-tests', d)}" +EXTRA_OECONF = "--enable-included-printf=no ${CORECONF} ${PTEST_CONF}" +EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux" +EXTRA_OECONF_append_libc-uclibc = " --with-libiconv=gnu" + +do_configure_prepend() { + sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in +} + +FILES_${PN} = "${libdir}/lib*${SOLIBS} ${libdir}/gio ${datadir}/glib-2.0/schemas \ + ${datadir}/glib-2.0/gettext/mkinstalldirs ${datadir}/glib-2.0/gettext/po/Makefile.in.in" +FILES_${PN}-dev += "${libdir}/glib-2.0/include \ + ${libdir}/gio/modules/lib*${SOLIBSDEV} \ + ${libdir}/gio/modules/*.la" +FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb \ + ${libdir}/gio/modules/.debug \ + ${libdir}/glib-2.0/installed-tests/glib/.debug" +FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py" +FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d \ + ${datadir}/bash-completion" +FILES_${PN}-ptest += "${libdir}/glib-2.0/installed-tests \ + ${datadir}/installed-tests/glib" + +ARM_INSTRUCTION_SET = "arm" +USE_NLS = "yes" + +do_install_append () { + sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python|' + + # Remove some unpackaged files + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo + + # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location + # for target as /usr/bin/perl, so fix it to /usr/bin/perl. + if [ -f ${D}${bindir}/glib-mkenums ]; then + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums + fi +} + +RDEPENDS_${PN}-ptest += "\ + gnome-desktop-testing \ + tzdata \ + tzdata-americas \ + tzdata-asia \ + tzdata-europe \ + tzdata-posix \ + python-pygobject \ + python-dbus \ + shared-mime-info \ + " + +RDEPENDS_${PN}-ptest_append_libc-glibc = "\ + eglibc-gconv-utf-16 \ + eglibc-charmap-utf-8 \ + eglibc-gconv-cp1255 \ + eglibc-charmap-cp1255 \ + eglibc-gconv-utf-32 \ + eglibc-gconv-utf-7 \ + eglibc-gconv-euc-jp \ + eglibc-gconv-iso8859-1 \ + eglibc-gconv-iso8859-15 \ + eglibc-charmap-invariant \ + eglibc-localedata-translit-cjk-variants \ + " diff --git a/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb b/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb new file mode 100644 index 0000000000..a9c1a4129a --- /dev/null +++ b/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb @@ -0,0 +1,32 @@ +SUMMARY = "GLib networking extensions" +DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies." +HOMEPAGE = "http://git.gnome.org/browse/glib-networking/" +BUGTRACKER = "http://bugzilla.gnome.org" + +LICENSE = "LGPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" + +SECTION = "libs" +DEPENDS = "glib-2.0 intltool-native" + +GNOME_COMPRESS_TYPE = "xz" + +SRC_URI[archive.md5sum] = "a22907deed3d956860d83aa3233e86ff" +SRC_URI[archive.sha256sum] = "a43eacbf721b475cf6ba0cd2eab02a332014f71a4c41d0b44bd7bbf8ed1f840d" + +PACKAGECONFIG ??= "ca-certificates gnutls" + +# No explicit dependency as it works without ca-certificates installed +PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates" +PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" +PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy" +PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit" + +EXTRA_OECONF = "--without-gnome-proxy" + +inherit gnomebase + +FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/" +FILES_${PN}-dbg += "${libdir}/gio/modules/.debug/" +FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la" +FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a" diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx new file mode 100644 index 0000000000..b04a1b6a73 --- /dev/null +++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx @@ -0,0 +1,52 @@ +.encoding = "UTF-8" +displayname = "Yocto Build Appliance" +guestos = "other" +tools.syncTime = "FALSE" +virtualhw.version = "8" +config.version = "8" +numvcpus = "2" +cpuid.coresPerSocket = "1" +vcpu.hotadd = "TRUE" +mem.hotadd = "TRUE" +memsize = "4096" +svga.autodetect = "TRUE" +pciBridge0.present = "TRUE" +mks.enable3d = "TRUE" +pciBridge4.present = "TRUE" +pciBridge4.virtualDev = "pcieRootPort" +pciBridge4.functions = "8" +pciBridge5.present = "TRUE" +pciBridge5.virtualDev = "pcieRootPort" +pciBridge5.functions = "8" +pciBridge6.present = "TRUE" +pciBridge6.virtualDev = "pcieRootPort" +pciBridge6.functions = "8" +pciBridge7.present = "TRUE" +pciBridge7.virtualDev = "pcieRootPort" +pciBridge7.functions = "8" +vmci0.present = "TRUE" +floppy0.present = "TRUE" +floppy0.fileType = "device" +floppy0.autodetect = "FALSE" +floppy0.startConnected = "FALSE" +ide1:0.present = "TRUE" +ide1:0.deviceType = "atapi-cdrom" +ide1:0.autodetect = "TRUE" +ide1:0.startConnected = "FALSE" +ide0:0.present = "TRUE" +ide0:0.deviceType = "disk" +ide0:0.fileName = "Yocto_Build_Appliance.vmdk" +usb.present = "TRUE" +scsi0.virtualDev = "lsilogic" +scsi0.present = "TRUE" +ethernet0.present = "TRUE" +ethernet0.virtualDev = "e1000" +ethernet0.connectionType = "bridged" +ethernet0.startConnected = "TRUE" +ethernet0.addressType = "generated" +sound.present = "TRUE" +sound.virtualDev = "es1371" +sound.autodetect = "TRUE" +extendedConfigFile = "Yocto_Build_Appliance.vmxf" +sound.fileName = "-1" +virtualHW.productCompatibility = "hosted" diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf new file mode 100644 index 0000000000..ca3f0264d6 --- /dev/null +++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf @@ -0,0 +1,8 @@ + + + +52 e4 0b df 7b 70 21 f8-88 56 a7 26 47 43 95 93 + + + +Yocto_Build_Appliance.vmx diff --git a/meta/recipes-core/images/build-appliance-image_8.0.bb b/meta/recipes-core/images/build-appliance-image_8.0.bb new file mode 100644 index 0000000000..420f30f337 --- /dev/null +++ b/meta/recipes-core/images/build-appliance-image_8.0.bb @@ -0,0 +1,93 @@ +SUMMARY = "An image containing the build system itself" +DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation." +HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted" + +IMAGE_FEATURES += "x11-base package-management splash" + +# Ensure there's enough space to do a core-image-sato build, with rm_work enabled +IMAGE_ROOTFS_EXTRA_SPACE = "41943040" + +# Do a quiet boot with limited console messages +APPEND += "quiet" + +DEPENDS = "zip-native" +IMAGE_FSTYPES = "vmdk" + +inherit core-image + +SRCREV ?= "84d524c9386065d06e6b9c2368b93fc07dc1816f" +SRC_URI = "git://git.yoctoproject.org/poky;branch=daisy \ + file://Yocto_Build_Appliance.vmx \ + file://Yocto_Build_Appliance.vmxf \ + " + +IMAGE_CMD_ext3_append () { + # We don't need to reserve much space for root, 0.5% is more than enough + tune2fs -m 0.5 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3 +} + +fakeroot do_populate_poky_src () { + # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo + # will become invalid in the target. + rm -rf ${WORKDIR}/git/.git + rm -f ${WORKDIR}/git/.gitignore + + cp -Rp ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky + + mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf + mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads + cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/ + + # Remove the git2_* tarballs -- this is ok since we still have the git2/. + rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_* + + echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone + echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf + mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo + echo "export PSEUDO_PREFIX=/usr" >> ${IMAGE_ROOTFS}/home/builder/.bashrc + echo "export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo" >> ${IMAGE_ROOTFS}/home/builder/.bashrc + echo "export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64" >> ${IMAGE_ROOTFS}/home/builder/.bashrc + + chown builder.builder ${IMAGE_ROOTFS}/home/builder/pseudo + + chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky + + # Allow builder to use sudo to setup tap/tun + echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers + + # Use Clearlooks GTK+ theme + mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0 + echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc +} + +IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " + +addtask rootfs after do_unpack + +python () { + # Ensure we run these usually noexec tasks + d.delVarFlag("do_fetch", "noexec") + d.delVarFlag("do_unpack", "noexec") +} + +create_bundle_files () { + cd ${WORKDIR} + mkdir -p Yocto_Build_Appliance + cp *.vmx* Yocto_Build_Appliance + ln -sf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk + zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance + ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance.zip +} + +python do_bundle_files() { + bb.build.exec_func('create_bundle_files', d) +} + +addtask bundle_files after do_vmdkimg before do_build +do_bundle_files[nostamp] = "1" diff --git a/meta/recipes-core/images/core-image-base.bb b/meta/recipes-core/images/core-image-base.bb new file mode 100644 index 0000000000..75a08cfc92 --- /dev/null +++ b/meta/recipes-core/images/core-image-base.bb @@ -0,0 +1,8 @@ +SUMMARY = "A console-only image that fully supports the target device \ +hardware." + +IMAGE_FEATURES += "splash" + +LICENSE = "MIT" + +inherit core-image diff --git a/meta/recipes-core/images/core-image-minimal-dev.bb b/meta/recipes-core/images/core-image-minimal-dev.bb new file mode 100644 index 0000000000..93ead20553 --- /dev/null +++ b/meta/recipes-core/images/core-image-minimal-dev.bb @@ -0,0 +1,7 @@ +require core-image-minimal.bb + +DESCRIPTION = "A small image just capable of allowing a device to boot and \ +is suitable for development work." + +IMAGE_FEATURES += "dev-pkgs" + diff --git a/meta/recipes-core/images/core-image-minimal-initramfs.bb b/meta/recipes-core/images/core-image-minimal-initramfs.bb new file mode 100644 index 0000000000..1f0fa9580b --- /dev/null +++ b/meta/recipes-core/images/core-image-minimal-initramfs.bb @@ -0,0 +1,21 @@ +# Simple initramfs image. Mostly used for live images. +DESCRIPTION = "Small image capable of booting a device. The kernel includes \ +the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ +first 'init' program more efficiently." + +PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install initramfs-live-install-efi busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "core-image-minimal-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" + +BAD_RECOMMENDATIONS += "busybox-syslog" diff --git a/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/meta/recipes-core/images/core-image-minimal-mtdutils.bb new file mode 100644 index 0000000000..c92234c082 --- /dev/null +++ b/meta/recipes-core/images/core-image-minimal-mtdutils.bb @@ -0,0 +1,7 @@ +require core-image-minimal.bb + +DESCRIPTION = "Small image capable of booting a device with support for the \ +Minimal MTD Utilities, which let the user interact with the MTD subsystem in \ +the kernel to perform operations on flash devices." + +IMAGE_INSTALL += "mtd-utils" diff --git a/meta/recipes-core/images/core-image-minimal.bb b/meta/recipes-core/images/core-image-minimal.bb new file mode 100644 index 0000000000..9716274c34 --- /dev/null +++ b/meta/recipes-core/images/core-image-minimal.bb @@ -0,0 +1,12 @@ +SUMMARY = "A small image just capable of allowing a device to boot." + +IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}" + +IMAGE_LINGUAS = " " + +LICENSE = "MIT" + +inherit core-image + +IMAGE_ROOTFS_SIZE ?= "8192" + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright new file mode 100644 index 0000000000..2a8e0d1264 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright @@ -0,0 +1,11 @@ +This package was created by Peter Tobias tobias@et-inf.fho-emden.de on +Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns + until 2001. +It is currently maintained by Marco d'Itri . + +Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri + +The programs in this package are distributed under the terms of the GNU +General Public License, version 2 as distributed by the Free Software +Foundation. On Debian systems, a copy of this license may be found in +/usr/share/common-licenses/GPL-2. diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init new file mode 100644 index 0000000000..fb31c635be --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init @@ -0,0 +1,90 @@ +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: networking +# Required-Start: mountvirtfs $local_fs +# Required-Stop: $local_fs +# Should-Start: ifupdown +# Should-Stop: ifupdown +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Raise network interfaces. +### END INIT INFO + +PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" + +[ -x /sbin/ifup ] || exit 0 + +check_network_file_systems() { + [ -e /proc/mounts ] || return 0 + + if [ -e /etc/iscsi/iscsi.initramfs ]; then + echo "not deconfiguring network interfaces: iSCSI root is mounted." + exit 0 + fi + + exec 9<&0 < /proc/mounts + while read DEV MTPT FSTYPE REST; do + case $DEV in + /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*) + echo "not deconfiguring network interfaces: network devices still mounted." + exit 0 + ;; + esac + case $FSTYPE in + nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs) + echo "not deconfiguring network interfaces: network file systems still mounted." + exit 0 + ;; + esac + done + exec 0<&9 9<&- +} + +check_network_swap() { + [ -e /proc/swaps ] || return 0 + + exec 9<&0 < /proc/swaps + while read DEV MTPT FSTYPE REST; do + case $DEV in + /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*) + echo "not deconfiguring network interfaces: network swap still mounted." + exit 0 + ;; + esac + done + exec 0<&9 9<&- +} + +case "$1" in +start) + echo -n "Configuring network interfaces... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + ifup -a + echo "done." + ;; + +stop) + check_network_file_systems + check_network_swap + + echo -n "Deconfiguring network interfaces... " + ifdown -a + echo "done." + ;; + +force-reload|restart) + echo "Running $0 $1 is deprecated because it may not enable again some interfaces" + echo "Reconfiguring network interfaces... " + ifdown -a || true + ifup -a + echo "done." + ;; + +*) + echo "Usage: /etc/init.d/networking {start|stop}" + exit 1 + ;; +esac + +exit 0 + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces new file mode 100644 index 0000000000..0acf4cf441 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces @@ -0,0 +1,31 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wireless interfaces +iface wlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf + +iface atml0 inet dhcp + +# Wired or wireless interfaces +auto eth0 +iface eth0 inet dhcp +iface eth1 inet dhcp + +# Ethernet/RNDIS gadget (g_ether) +# ... or on host side, usbnet and random hwaddr +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.0 + network 192.168.7.0 + gateway 192.168.7.1 + +# Bluetooth networking +iface bnep0 inet dhcp + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot new file mode 100644 index 0000000000..750c0a98f9 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot @@ -0,0 +1,39 @@ +#! /bin/sh + +# In case the interface is used as nfsroot, avoid ifup, otherwise +# nfsroot may lose response + +nfsroot=0 + +if test "x$IFACE" = xlo ; then + exit 0 +fi + +exec 9<&0 < /proc/mounts +while read dev mtpt fstype rest; do + if test $mtpt = "/" ; then + case $fstype in + nfs | nfs4) + nfsroot=1 + nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'` + break + ;; + *) + ;; + esac + fi +done +exec 0<&9 9<&- + +test $nfsroot -eq 0 && exit 0 + +if [ -x /bin/ip -o -x /sbin/ip ] ; then + nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'` +fi + +if test "x$IFACE" = "x$nfs_iface" ; then + echo "ifup skipped for nfsroot interface $nfs_iface" + exit 1 +fi + +exit 0 diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces new file mode 100644 index 0000000000..16967763e5 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces @@ -0,0 +1,5 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces new file mode 100644 index 0000000000..16967763e5 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces @@ -0,0 +1,5 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces new file mode 100644 index 0000000000..16967763e5 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces @@ -0,0 +1,5 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces new file mode 100644 index 0000000000..f62b9a897d --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces @@ -0,0 +1,8 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + + + diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb new file mode 100644 index 0000000000..3d88506c05 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb @@ -0,0 +1,39 @@ +SUMMARY = "Basic TCP/IP networking init scripts and configuration files" +DESCRIPTION = "This package provides high level tools to configure network interfaces" +HOMEPAGE = "http://packages.debian.org/ifupdown" +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab" +PR = "r7" + +inherit update-rc.d + +INITSCRIPT_NAME = "networking" +INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ." + +SRC_URI = "file://copyright \ + file://init \ + file://interfaces \ + file://nfsroot" + +do_install () { + install -d ${D}${sysconfdir}/init.d \ + ${D}${sysconfdir}/network/if-pre-up.d \ + ${D}${sysconfdir}/network/if-up.d \ + ${D}${sysconfdir}/network/if-down.d \ + ${D}${sysconfdir}/network/if-post-down.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking + install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces + install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d +} + +do_install_append_qemuall () { + # Disable network manager on machines that commonly do NFS booting + touch ${D}${sysconfdir}/network/nm-disabled-eth0 +} + +PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}" +RDEPENDS_${PN} = "netbase" +RCONFLICTS_${PN} = "netbase (< 1:5.0)" + +CONFFILES_${PN} = "${sysconfdir}/network/interfaces" diff --git a/meta/recipes-core/initrdscripts/files/init-boot.sh b/meta/recipes-core/initrdscripts/files/init-boot.sh new file mode 100644 index 0000000000..e82eba025d --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-boot.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +mkdir /proc +mkdir /sys +mount -t proc proc /proc +mount -t sysfs sysfs /sys + +exec sh diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh new file mode 100644 index 0000000000..2fea7610f9 --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh @@ -0,0 +1,199 @@ +#!/bin/sh -e +# +# Copyright (c) 2012, Intel Corporation. +# All rights reserved. +# +# install.sh [device_name] [rootfs_name] +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# We need 200 Mb for the boot partition +boot_size=200 + +# 50% for the second rootfs +testfs_ratio=50 + +found="no" + +echo "Searching for a hard drive..." +for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1' +do + if [ -e /sys/block/${device}/removable ]; then + if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then + found="yes" + + while true; do + # Try sleeping here to avoid getting kernel messages + # obscuring/confusing user + sleep 5 + echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]" + read answer + if [ "$answer" = "y" ] ; then + break + fi + + if [ "$answer" = "n" ] ; then + found=no + break + fi + + echo "Please answer y or n" + done + fi + fi + + if [ "$found" = "yes" ]; then + break; + fi + +done + +if [ "$found" = "no" ]; then + exit 1 +fi + +echo "Installing image on /dev/${device}" + +# +# The udev automounter can cause pain here, kill it +# +rm -f /etc/udev/rules.d/automount.rules +rm -f /etc/udev/scripts/mount* + +# +# Unmount anything the automounter had mounted +# +umount /dev/${device}* 2> /dev/null || /bin/true + +mkdir -p /tmp +cat /proc/mounts > /etc/mtab + +disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") + +testfs_size=$((disk_size*testfs_ratio/100)) +rootfs_size=$((disk_size-boot_size-testfs_size)) + +rootfs_start=$((boot_size)) +rootfs_end=$((rootfs_start+rootfs_size)) +testfs_start=$((rootfs_end)) + +# MMC devices are special in a couple of ways +# 1) they use a partition prefix character 'p' +# 2) they are detected asynchronously (need rootwait) +rootwait="" +part_prefix="" +if [ ! "${device#mmcblk}" = "${device}" ]; then + part_prefix="p" + rootwait="rootwait" +fi +bootfs=/dev/${device}${part_prefix}1 +rootfs=/dev/${device}${part_prefix}2 +testfs=/dev/${device}${part_prefix}3 + +echo "*****************" +echo "Boot partition size: $boot_size MB ($bootfs)" +echo "Rootfs partition size: $rootfs_size MB ($rootfs)" +echo "Testfs partition size: $testfs_size MB ($testfs)" +echo "*****************" +echo "Deleting partition table on /dev/${device} ..." +dd if=/dev/zero of=/dev/${device} bs=512 count=2 + +echo "Creating new partition table on /dev/${device} ..." +parted /dev/${device} mklabel gpt + +echo "Creating boot partition on $bootfs" +parted /dev/${device} mkpart primary 0% $boot_size +parted /dev/${device} set 1 boot on + +echo "Creating rootfs partition on $rootfs" +parted /dev/${device} mkpart primary $rootfs_start $rootfs_end + +echo "Creating testfs partition on $testfs" +parted /dev/${device} mkpart primary $testfs_start 100% + +parted /dev/${device} print + +echo "Formatting $bootfs to vfat..." +mkfs.vfat -n "boot" $bootfs + +echo "Formatting $rootfs to ext3..." +mkfs.ext3 -L "platform" $rootfs + +echo "Formatting $testfs to ext3..." +mkfs.ext3 -L "testrootfs" $testfs + +mkdir /ssd +mkdir /rootmnt +mkdir /bootmnt + +mount $rootfs /ssd +mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt + +echo "Copying rootfs files..." +cp -a /rootmnt/* /ssd + +touch /ssd/etc/masterimage + +if [ -d /ssd/etc/ ] ; then + # We dont want udev to mount our root device while we're booting... + if [ -d /ssd/etc/udev/ ] ; then + echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist + fi +fi + +umount /ssd +umount /rootmnt + +echo "Preparing boot partition..." +mount $bootfs /ssd + +EFIDIR="/ssd/EFI/BOOT" +mkdir -p $EFIDIR +cp /media/$1/vmlinuz /ssd +# Copy the efi loader +cp /media/$1/EFI/BOOT/*.efi $EFIDIR + +if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then + GRUBCFG="$EFIDIR/grub.cfg" + cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG + # Update grub config for the installed image + # Delete the install entry + sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG + # Delete the initrd lines + sed -i "/initrd /d" $GRUBCFG + # Delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG + # Delete any root= strings + sed -i "s/ root=[^ ]*/ /" $GRUBCFG + # Add the root= and other standard boot options + sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG +fi + +if [ -d /media/$1/loader ]; then + GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" + # copy config files for gummiboot + cp -dr /media/$1/loader /ssd + # delete the install entry + rm -f /ssd/loader/entries/install.conf + # delete the initrd lines + sed -i "/initrd /d" $GUMMIBOOT_CFGS + # delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS + # delete any root= strings + sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS + # add the root= and other standard boot options + sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS + # Add the test label + echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf +fi + +umount /ssd +sync + +echo "Remove your installation media, and press ENTER" + +read enter + +echo "Rebooting..." +reboot -f diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh new file mode 100644 index 0000000000..ed3221b0a6 --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh @@ -0,0 +1,197 @@ +#!/bin/sh -e +# +# Copyright (c) 2012, Intel Corporation. +# All rights reserved. +# +# install.sh [device_name] [rootfs_name] +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# We need 20 Mb for the boot partition +boot_size=20 + +# 5% for swap +swap_ratio=5 + +found="no" + +echo "Searching for a hard drive..." +for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1' +do + if [ -e /sys/block/${device}/removable ]; then + if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then + found="yes" + + while true; do + # Try sleeping here to avoid getting kernel messages + # obscuring/confusing user + sleep 5 + echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]" + read answer + if [ "$answer" = "y" ] ; then + break + fi + + if [ "$answer" = "n" ] ; then + found=no + break + fi + + echo "Please answer y or n" + done + fi + fi + + if [ "$found" = "yes" ]; then + break; + fi + +done + +if [ "$found" = "no" ]; then + exit 1 +fi + +echo "Installing image on /dev/${device}" + +# +# The udev automounter can cause pain here, kill it +# +rm -f /etc/udev/rules.d/automount.rules +rm -f /etc/udev/scripts/mount* + +# +# Unmount anything the automounter had mounted +# +umount /dev/${device}* 2> /dev/null || /bin/true + +mkdir -p /tmp +cat /proc/mounts > /etc/mtab + +disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") + +swap_size=$((disk_size*swap_ratio/100)) +rootfs_size=$((disk_size-boot_size-swap_size)) + +rootfs_start=$((boot_size)) +rootfs_end=$((rootfs_start+rootfs_size)) +swap_start=$((rootfs_end)) + +# MMC devices are special in a couple of ways +# 1) they use a partition prefix character 'p' +# 2) they are detected asynchronously (need rootwait) +rootwait="" +part_prefix="" +if [ ! "${device#mmcblk}" = "${device}" ]; then + part_prefix="p" + rootwait="rootwait" +fi +bootfs=/dev/${device}${part_prefix}1 +rootfs=/dev/${device}${part_prefix}2 +swap=/dev/${device}${part_prefix}3 + +echo "*****************" +echo "Boot partition size: $boot_size MB ($bootfs)" +echo "Rootfs partition size: $rootfs_size MB ($rootfs)" +echo "Swap partition size: $swap_size MB ($swap)" +echo "*****************" +echo "Deleting partition table on /dev/${device} ..." +dd if=/dev/zero of=/dev/${device} bs=512 count=2 + +echo "Creating new partition table on /dev/${device} ..." +parted /dev/${device} mklabel gpt + +echo "Creating boot partition on $bootfs" +parted /dev/${device} mkpart primary 0% $boot_size +parted /dev/${device} set 1 boot on + +echo "Creating rootfs partition on $rootfs" +parted /dev/${device} mkpart primary $rootfs_start $rootfs_end + +echo "Creating swap partition on $swap" +parted /dev/${device} mkpart primary $swap_start 100% + +parted /dev/${device} print + +echo "Formatting $bootfs to vfat..." +mkfs.vfat $bootfs + +echo "Formatting $rootfs to ext3..." +mkfs.ext3 $rootfs + +echo "Formatting swap partition...($swap)" +mkswap $swap + +mkdir /ssd +mkdir /rootmnt +mkdir /bootmnt + +mount $rootfs /ssd +mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt + +echo "Copying rootfs files..." +cp -a /rootmnt/* /ssd + +if [ -d /ssd/etc/ ] ; then + echo "$swap swap swap defaults 0 0" >> /ssd/etc/fstab + + # We dont want udev to mount our root device while we're booting... + if [ -d /ssd/etc/udev/ ] ; then + echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist + fi +fi + +umount /ssd +umount /rootmnt + +echo "Preparing boot partition..." +mount $bootfs /ssd + +EFIDIR="/ssd/EFI/BOOT" +mkdir -p $EFIDIR +cp /media/$1/vmlinuz /ssd +# Copy the efi loader +cp /media/$1/EFI/BOOT/*.efi $EFIDIR + +if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then + GRUBCFG="$EFIDIR/grub.cfg" + cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG + # Update grub config for the installed image + # Delete the install entry + sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG + # Delete the initrd lines + sed -i "/initrd /d" $GRUBCFG + # Delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG + # Delete any root= strings + sed -i "s/ root=[^ ]*/ /" $GRUBCFG + # Add the root= and other standard boot options + sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG +fi + +if [ -d /media/$1/loader ]; then + GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" + # copy config files for gummiboot + cp -dr /media/$1/loader /ssd + # delete the install entry + rm -f /ssd/loader/entries/install.conf + # delete the initrd lines + sed -i "/initrd /d" $GUMMIBOOT_CFGS + # delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS + # delete any root= strings + sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS + # add the root= and other standard boot options + sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS +fi + +umount /ssd +sync + +echo "Remove your installation media, and press ENTER" + +read enter + +echo "Rebooting..." +reboot -f diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh new file mode 100644 index 0000000000..d2f2420498 --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh @@ -0,0 +1,211 @@ +#!/bin/sh -e +# +# Copyright (C) 2008-2011 Intel +# +# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode] +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# We need 20 Mb for the boot partition +boot_size=200 + +# 50% for the the test partition +testfs_ratio=50 + +# Get a list of hard drives +hdnamelist="" +live_dev_name=${1%%/*} + +echo "Searching for hard drives ..." + +for device in `ls /sys/block/`; do + case $device in + loop*) + # skip loop device + ;; + ram*) + # skip ram device + ;; + *) + # skip the device LiveOS is on + # Add valid hard drive name to the list + if [ $device != $live_dev_name -a -e /dev/$device ]; then + hdnamelist="$hdnamelist $device" + fi + ;; + esac +done + +TARGET_DEVICE_NAME="" +for hdname in $hdnamelist; do + # Display found hard drives and their basic info + echo "-------------------------------" + echo /dev/$hdname + if [ -r /sys/block/$hdname/device/vendor ]; then + echo -n "VENDOR=" + cat /sys/block/$hdname/device/vendor + fi + echo -n "MODEL=" + cat /sys/block/$hdname/device/model + cat /sys/block/$hdname/device/uevent + echo + # Get user choice + while true; do + echo -n "Do you want to install this image there? [y/n] " + read answer + if [ "$answer" = "y" -o "$answer" = "n" ]; then + break + fi + echo "Please answer y or n" + done + if [ "$answer" = "y" ]; then + TARGET_DEVICE_NAME=$hdname + break + fi +done + +if [ -n "$TARGET_DEVICE_NAME" ]; then + echo "Installing image on /dev/$TARGET_DEVICE_NAME ..." +else + echo "No hard drive selected. Installation aborted." + exit 1 +fi + +device=$TARGET_DEVICE_NAME + +# +# The udev automounter can cause pain here, kill it +# +rm -f /etc/udev/rules.d/automount.rules +rm -f /etc/udev/scripts/mount* + +# +# Unmount anything the automounter had mounted +# +umount /dev/${device}* 2> /dev/null || /bin/true + +if [ ! -b /dev/loop0 ] ; then + mknod /dev/loop0 b 7 0 +fi + +mkdir -p /tmp +cat /proc/mounts > /etc/mtab + +disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") + +testfs_size=$((disk_size*testfs_ratio/100)) +rootfs_size=$((disk_size-boot_size-testfs_size)) + +rootfs_start=$((boot_size)) +rootfs_end=$((rootfs_start+rootfs_size)) +testfs_start=$((rootfs_end)) + +# MMC devices are special in a couple of ways +# 1) they use a partition prefix character 'p' +# 2) they are detected asynchronously (need rootwait) +rootwait="" +part_prefix="" +if [ ! "${device#mmcblk}" = "${device}" ]; then + part_prefix="p" + rootwait="rootwait" +fi +bootfs=/dev/${device}${part_prefix}1 +rootfs=/dev/${device}${part_prefix}2 +testfs=/dev/${device}${part_prefix}3 + +echo "*****************" +echo "Boot partition size: $boot_size MB ($bootfs)" +echo "Rootfs partition size: $rootfs_size MB ($rootfs)" +echo "Testfs partition size: $testfs_size MB ($testfs)" +echo "*****************" +echo "Deleting partition table on /dev/${device} ..." +dd if=/dev/zero of=/dev/${device} bs=512 count=2 + +echo "Creating new partition table on /dev/${device} ..." +parted /dev/${device} mklabel msdos + +echo "Creating boot partition on $bootfs" +parted /dev/${device} mkpart primary 0% $boot_size + +echo "Creating rootfs partition on $rootfs" +parted /dev/${device} mkpart primary $rootfs_start $rootfs_end + +echo "Creating testfs partition on $testfs" +parted /dev/${device} mkpart primary $testfs_start 100% + +parted /dev/${device} print + +echo "Formatting $bootfs to ext3..." +mkfs.ext3 -L "boot" $bootfs + +echo "Formatting $rootfs to ext3..." +mkfs.ext3 -L "rootfs" $rootfs + +echo "Formatting $testfs to ext3..." +mkfs.ext3 -L "testrootfs" $testfs + +mkdir /tgt_root +mkdir /src_root +mkdir -p /boot + +# Handling of the target root partition +mount $rootfs /tgt_root +mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root +echo "Copying rootfs files..." +cp -a /src_root/* /tgt_root +if [ -d /tgt_root/etc/ ] ; then + echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab + # We dont want udev to mount our root device while we're booting... + if [ -d /tgt_root/etc/udev/ ] ; then + echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist + fi +fi +umount /tgt_root +umount /src_root + +# Handling of the target boot partition +mount $bootfs /boot +echo "Preparing boot partition..." +if [ -f /etc/grub.d/40_custom ] ; then + echo "Preparing custom grub2 menu..." + GRUBCFG="/boot/grub/grub.cfg" + mkdir -p $(dirname $GRUBCFG) + cp /etc/grub.d/40_custom $GRUBCFG + sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG + sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG + sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG + sed -i "s/__CONSOLE__/$5/g" $GRUBCFG + sed -i "/#/d" $GRUBCFG + sed -i "/exec tail/d" $GRUBCFG + + # Add the test label + echo -ne "\nmenuentry 'test' {\nlinux /test-kernel root=$testfs rw $rootwait quiet\n}\n" >> $GRUBCFG + + chmod 0444 $GRUBCFG +fi +grub-install /dev/${device} +echo "(hd0) /dev/${device}" > /boot/grub/device.map + +# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst +if [ ! -f /boot/grub/grub.cfg ] ; then + echo "Preparing custom grub menu..." + echo "default 0" > /boot/grub/menu.lst + echo "timeout 30" >> /boot/grub/menu.lst + echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst + echo "root (hd0,0)" >> /boot/grub/menu.lst + echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst +fi + +cp /media/$1/vmlinuz /boot/ + +umount /boot + +sync + +echo "Remove your installation media, and press ENTER" + +read enter + +echo "Rebooting..." +reboot -f diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh new file mode 100644 index 0000000000..8e433d5eda --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-install.sh @@ -0,0 +1,208 @@ +#!/bin/sh -e +# +# Copyright (C) 2008-2011 Intel +# +# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode] +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# We need 20 Mb for the boot partition +boot_size=20 + +# 5% for the swap +swap_ratio=5 + +# Get a list of hard drives +hdnamelist="" +live_dev_name=${1%%/*} + +echo "Searching for hard drives ..." + +for device in `ls /sys/block/`; do + case $device in + loop*) + # skip loop device + ;; + ram*) + # skip ram device + ;; + *) + # skip the device LiveOS is on + # Add valid hard drive name to the list + if [ $device != $live_dev_name -a -e /dev/$device ]; then + hdnamelist="$hdnamelist $device" + fi + ;; + esac +done + +TARGET_DEVICE_NAME="" +for hdname in $hdnamelist; do + # Display found hard drives and their basic info + echo "-------------------------------" + echo /dev/$hdname + if [ -r /sys/block/$hdname/device/vendor ]; then + echo -n "VENDOR=" + cat /sys/block/$hdname/device/vendor + fi + echo -n "MODEL=" + cat /sys/block/$hdname/device/model + cat /sys/block/$hdname/device/uevent + echo + # Get user choice + while true; do + echo -n "Do you want to install this image there? [y/n] " + read answer + if [ "$answer" = "y" -o "$answer" = "n" ]; then + break + fi + echo "Please answer y or n" + done + if [ "$answer" = "y" ]; then + TARGET_DEVICE_NAME=$hdname + break + fi +done + +if [ -n "$TARGET_DEVICE_NAME" ]; then + echo "Installing image on /dev/$TARGET_DEVICE_NAME ..." +else + echo "No hard drive selected. Installation aborted." + exit 1 +fi + +device=$TARGET_DEVICE_NAME + +# +# The udev automounter can cause pain here, kill it +# +rm -f /etc/udev/rules.d/automount.rules +rm -f /etc/udev/scripts/mount* + +# +# Unmount anything the automounter had mounted +# +umount /dev/${device}* 2> /dev/null || /bin/true + +if [ ! -b /dev/loop0 ] ; then + mknod /dev/loop0 b 7 0 +fi + +mkdir -p /tmp +cat /proc/mounts > /etc/mtab + +disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") + +swap_size=$((disk_size*swap_ratio/100)) +rootfs_size=$((disk_size-boot_size-swap_size)) + +rootfs_start=$((boot_size)) +rootfs_end=$((rootfs_start+rootfs_size)) +swap_start=$((rootfs_end)) + +# MMC devices are special in a couple of ways +# 1) they use a partition prefix character 'p' +# 2) they are detected asynchronously (need rootwait) +rootwait="" +part_prefix="" +if [ ! "${device#mmcblk}" = "${device}" ]; then + part_prefix="p" + rootwait="rootwait" +fi +bootfs=/dev/${device}${part_prefix}1 +rootfs=/dev/${device}${part_prefix}2 +swap=/dev/${device}${part_prefix}3 + +echo "*****************" +echo "Boot partition size: $boot_size MB ($bootfs)" +echo "Rootfs partition size: $rootfs_size MB ($rootfs)" +echo "Swap partition size: $swap_size MB ($swap)" +echo "*****************" +echo "Deleting partition table on /dev/${device} ..." +dd if=/dev/zero of=/dev/${device} bs=512 count=2 + +echo "Creating new partition table on /dev/${device} ..." +parted /dev/${device} mklabel msdos + +echo "Creating boot partition on $bootfs" +parted /dev/${device} mkpart primary 0% $boot_size + +echo "Creating rootfs partition on $rootfs" +parted /dev/${device} mkpart primary $rootfs_start $rootfs_end + +echo "Creating swap partition on $swap" +parted /dev/${device} mkpart primary $swap_start 100% + +parted /dev/${device} print + +echo "Formatting $bootfs to ext3..." +mkfs.ext3 $bootfs + +echo "Formatting $rootfs to ext3..." +mkfs.ext3 $rootfs + +echo "Formatting swap partition...($swap)" +mkswap $swap + +mkdir /tgt_root +mkdir /src_root +mkdir -p /boot + +# Handling of the target root partition +mount $rootfs /tgt_root +mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root +echo "Copying rootfs files..." +cp -a /src_root/* /tgt_root +if [ -d /tgt_root/etc/ ] ; then + echo "$swap swap swap defaults 0 0" >> /tgt_root/etc/fstab + echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab + # We dont want udev to mount our root device while we're booting... + if [ -d /tgt_root/etc/udev/ ] ; then + echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist + fi +fi +umount /tgt_root +umount /src_root + +# Handling of the target boot partition +mount $bootfs /boot +echo "Preparing boot partition..." +if [ -f /etc/grub.d/40_custom ] ; then + echo "Preparing custom grub2 menu..." + GRUBCFG="/boot/grub/grub.cfg" + mkdir -p $(dirname $GRUBCFG) + cp /etc/grub.d/40_custom $GRUBCFG + sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG + sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG + sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG + sed -i "s/__CONSOLE__/$5/g" $GRUBCFG + sed -i "/#/d" $GRUBCFG + sed -i "/exec tail/d" $GRUBCFG + chmod 0444 $GRUBCFG +fi +grub-install /dev/${device} +echo "(hd0) /dev/${device}" > /boot/grub/device.map + +# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst +if [ ! -f /boot/grub/grub.cfg ] ; then + echo "Preparing custom grub menu..." + echo "default 0" > /boot/grub/menu.lst + echo "timeout 30" >> /boot/grub/menu.lst + echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst + echo "root (hd0,0)" >> /boot/grub/menu.lst + echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst +fi + +cp /media/$1/vmlinuz /boot/ + +umount /boot + +sync + +echo "Remove your installation media, and press ENTER" + +read enter + +echo "Rebooting..." +reboot -f diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh new file mode 100644 index 0000000000..9e53a25a51 --- /dev/null +++ b/meta/recipes-core/initrdscripts/files/init-live.sh @@ -0,0 +1,223 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +ROOT_MOUNT="/rootfs/" +ROOT_IMAGE="rootfs.img" +MOUNT="/bin/mount" +UMOUNT="/bin/umount" +ISOLINUX="" + +# Copied from initramfs-framework. The core of this script probably should be +# turned into initramfs-framework modules to reduce duplication. +udev_daemon() { + OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd" + + for o in $OPTIONS; do + if [ -x "$o" ]; then + echo $o + return 0 + fi + done + + return 1 +} + +_UDEV_DAEMON=`udev_daemon` + +early_setup() { + mkdir -p /proc + mkdir -p /sys + mount -t proc proc /proc + mount -t sysfs sysfs /sys + mount -t devtmpfs none /dev + + # support modular kernel + modprobe isofs 2> /dev/null + + mkdir -p /run + mkdir -p /var/run + + $_UDEV_DAEMON --daemon + udevadm trigger --action=add +} + +read_args() { + [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline` + for arg in $CMDLINE; do + optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` + case $arg in + root=*) + ROOT_DEVICE=$optarg ;; + rootimage=*) + ROOT_IMAGE=$optarg ;; + rootfstype=*) + modprobe $optarg 2> /dev/null ;; + LABEL=*) + label=$optarg ;; + video=*) + video_mode=$arg ;; + vga=*) + vga_mode=$arg ;; + console=*) + if [ -z "${console_params}" ]; then + console_params=$arg + else + console_params="$console_params $arg" + fi ;; + debugshell*) + if [ -z "$optarg" ]; then + shelltimeout=30 + else + shelltimeout=$optarg + fi + esac + done +} + +boot_live_root() { + # Watches the udev event queue, and exits if all current events are handled + udevadm settle --timeout=3 --quiet + killall "${_UDEV_DAEMON##*/}" 2>/dev/null + + # Move the mount points of some filesystems over to + # the corresponding directories under the real root filesystem. + for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do + mkdir -p ${ROOT_MOUNT}/$dir + mount -n --move $dir ${ROOT_MOUNT}/$dir + done + mount -n --move /proc ${ROOT_MOUNT}/proc + mount -n --move /sys ${ROOT_MOUNT}/sys + mount -n --move /dev ${ROOT_MOUNT}/dev + + cd $ROOT_MOUNT + + # busybox switch_root supports -c option + exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE || + fatal "Couldn't switch_root, dropping to shell" +} + +fatal() { + echo $1 >$CONSOLE + echo >$CONSOLE + exec sh +} + +early_setup + +[ -z "$CONSOLE" ] && CONSOLE="/dev/console" + +read_args + +echo "Waiting for removable media..." +C=0 +while true +do + for i in `ls /media 2>/dev/null`; do + if [ -f /media/$i/$ROOT_IMAGE ] ; then + found="yes" + break + elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then + found="yes" + ISOLINUX="isolinux" + break + fi + done + if [ "$found" = "yes" ]; then + break; + fi + # don't wait for more than $shelltimeout seconds, if it's set + if [ -n "$shelltimeout" ]; then + echo -n " " $(( $shelltimeout - $C )) + if [ $C -ge $shelltimeout ]; then + echo "..." + echo "Mounted filesystems" + mount | grep media + echo "Available block devices" + ls /dev/sd* + fatal "Cannot find $ROOT_IMAGE file in /media/* , dropping to a shell " + fi + C=$(( C + 1 )) + fi + sleep 1 +done + +# Try to mount the root image read-write and then boot it up. +# This function distinguishes between a read-only image and a read-write image. +# In the former case (typically an iso), it tries to make a union mount if possible. +# In the latter case, the root image could be mounted and then directly booted up. +mount_and_boot() { + mkdir $ROOT_MOUNT + mknod /dev/loop0 b 7 0 2>/dev/null + + if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then + fatal "Could not mount rootfs image" + fi + + if touch $ROOT_MOUNT/bin 2>/dev/null; then + # The root image is read-write, directly boot it up. + boot_live_root + fi + + # determine which unification filesystem to use + union_fs_type="" + if grep -q -w "overlayfs" /proc/filesystems; then + union_fs_type="overlayfs" + elif grep -q -w "aufs" /proc/filesystems; then + union_fs_type="aufs" + else + union_fs_type="" + fi + + # make a union mount if possible + case $union_fs_type in + "overlayfs") + mkdir -p /rootfs.ro /rootfs.rw + if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then + rm -rf /rootfs.ro /rootfs.rw + fatal "Could not move rootfs mount point" + else + mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw + mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT + mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw + mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro + mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw + fi + ;; + "aufs") + mkdir -p /rootfs.ro /rootfs.rw + if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then + rm -rf /rootfs.ro /rootfs.rw + fatal "Could not move rootfs mount point" + else + mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw + mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT + mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw + mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro + mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw + fi + ;; + "") + mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media + ;; + esac + + # boot the image + boot_live_root +} + +case $label in + boot) + mount_and_boot + ;; + install|install-efi) + if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then + ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params + else + fatal "Could not find $label script" + fi + + # If we're getting here, we failed... + fatal "Installation image failed" + ;; +esac diff --git a/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb new file mode 100644 index 0000000000..0ede20b15d --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "Extremely basic live image init script" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SRC_URI = "file://init-boot.sh" + +PR = "r2" + +do_install() { + install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init +} + +inherit allarch + +FILES_${PN} += " /init " diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/debug b/meta/recipes-core/initrdscripts/initramfs-framework/debug new file mode 100644 index 0000000000..00bfd7d3f5 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/debug @@ -0,0 +1,82 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT + +# Adds support to dynamic debugging of initramfs using bootparam in +# following format: +# shell : starts a shell before and after each module +# shell=before: : starts a shell before is loaded and run +# shell=after: : starts a shell after is loaded and run +# +# shell-debug : run set -x as soon as possible +# shell-debug=before: : run set -x before is loaded and run +# shell-debug=after: : run set -x after is loaded and run + +DEBUG_SHELL="false" + +debug_hook_handler() { + status=$1 + module=$2 + + if [ -n "$bootparam_shell" ] && [ "$bootparam_shell" != "true" ]; then + shell_wanted_status=`expr $bootparam_shell : '\(.*\):.*'` + shell_wanted_module=`expr $bootparam_shell : '.*:\(.*\)'` + + if [ "$shell_wanted_status" = "before" ]; then + shell_wanted_status=pre + else + shell_wanted_status=post + fi + fi + + if [ "$bootparam_shell" = "true" ] || + ( [ "$status" = "$shell_wanted_status" ] && + [ "$module" = "$shell_wanted_module" ] ); then + if [ "$status" = "pre" ]; then + status_msg="before" + else + status_msg="after" + fi + + msg "Starting shell $status_msg $module..." + sh + fi + + if [ -n "$bootparam_shell_debug" ] && [ "$bootparam_shell_debug" != "true" ]; then + shell_debug_wanted_status=`expr $bootparam_shell_debug : '\(.*\):.*'` + shell_debug_wanted_module=`expr $bootparam_shell_debug : '.*:\(.*\)'` + + if [ "$shell_debug_wanted_status" = "before" ]; then + shell_debug_wanted_status=pre + else + shell_debug_wanted_status=post + fi + fi + + if [ "$bootparam_shell_debug" = "true" ] || + ( [ "$status" = "$shell_debug_wanted_status" ] && + [ "$module" = "$shell_debug_wanted_module" ] ); then + if [ "$DEBUG_SHELL" = "true" ]; then + return 0 + fi + + if [ "$status" = "pre" ]; then + status_msg="before" + else + status_msg="after" + fi + + msg "Starting shell debugging $status_msg $module..." + DEBUG_SHELL="true" + set -x + fi +} + +debug_enabled() { + return 0 +} + +debug_run() { + add_module_pre_hook "debug_hook_handler" + add_module_post_hook "debug_hook_handler" +} diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs new file mode 100755 index 0000000000..29f801a7bd --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT + +e2fs_enabled() { + return 0 +} + +e2fs_run() { + filesystems="ext4 ext3 ext2" + + # load modules + for fs in $filesystems; do + load_kernel_module $fs + done + + for fs in $filesystems; do + eval "fs_options=\$bootparam_${fs}" + if [ -n "$fs_options" ]; then + dev=`expr "$fs_options" : '\([^:]*\).*'` + path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'` + + info "Mounting $dev as $fs on $path as $fs..." + mkdir -p $path + mount -t $fs $dev $path + fi + done +} diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish new file mode 100755 index 0000000000..325f47be40 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish @@ -0,0 +1,47 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT + +finish_enabled() { + return 0 +} + +finish_run() { + if [ -n "$ROOTFS_DIR" ]; then + if [ -n "$bootparam_rootdelay" ]; then + debug "Sleeping for $rootdelay second(s) to wait root to settle..." + sleep $bootparam_rootdelay + fi + + if [ -n "$bootparam_root" ]; then + debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..." + + if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then + root_uuid=`echo $bootparam_root | cut -c6-` + bootparam_root="/dev/disk/by-uuid/$root_uuid" + fi + + if [ -e "$bootparam_root" ]; then + mount $bootparam_root $ROOTFS_DIR + else + debug "root '$bootparam_root' doesn't exist." + fi + fi + + if [ ! -d $ROOTFS_DIR/dev ]; then + fatal "ERROR: There's no '/dev' on rootfs." + fi + + info "Switching root to '$ROOTFS_DIR'..." + + debug "Moving /dev, /proc and /sys onto rootfs..." + mount --move /dev $ROOTFS_DIR/dev + mount --move /proc $ROOTFS_DIR/proc + mount --move /sys $ROOTFS_DIR/sys + + cd $ROOTFS_DIR + exec switch_root -c /dev/console $ROOTFS_DIR /sbin/init + else + debug "No rootfs has been set" + fi +} diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init new file mode 100755 index 0000000000..95fa9fb1a0 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/init @@ -0,0 +1,140 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT +# +# Provides the API to be used by the initramfs modules +# +# Modules need to provide the following functions: +# +# _enabled : check if the module ought to run (return 1 to skip) +# _run : do what is need +# +# Boot parameters are available on environment in the as: +# +# 'foo=value' as 'bootparam_foo=value' +# 'foo' as 'bootparam_foo=true' + +# Register a function to be called before running a module +# The hook is called as: +# pre +add_module_pre_hook() { + MODULE_PRE_HOOKS="$MODULE_PRE_HOOKS $1" +} + +# Register a function to be called after running a module +# The hook is called as: +# post +add_module_post_hook() { + MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1" +} + +# Load kernel module +load_kernel_module() { + if modprobe $1 >/dev/null 2>&1; then + info "Loaded module $1" + else + debug "Failed to load module $1" + fi +} + +# Prints information +msg() { + echo "$@" >/dev/console +} + +# Prints information if verbose bootparam is used +info() { + [ -n "$bootparam_verbose" ] && echo "$@" >/dev/console +} + +# Prints information if debug bootparam is used +debug() { + [ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console +} + +# Prints a message and start a endless loop +fatal() { + echo $1 >/dev/console + echo >/dev/console + + while [ "true" ]; do + sleep 3600 + done +} + +# Variables shared amoung modules +ROOTFS_DIR="/rootfs" # where to do the switch root +MODULE_PRE_HOOKS="" # functions to call before running each module +MODULE_POST_HOOKS="" # functions to call after running each module +MODULES_DIR=/init.d # place to look for modules + +# make mount stop complaining about missing /etc/fstab +touch /etc/fstab + +# initialize /proc, /sys and /var/lock +mkdir -p /proc /sys /var/lock +mount -t proc proc /proc +mount -t sysfs sysfs /sys + +# populate bootparam environment +for p in `cat /proc/cmdline`; do + opt=`echo $p | cut -d'=' -f1` + opt=`echo $opt | sed -e 's/-/_/'` + if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then + eval "bootparam_${opt}=true" + else + value="`echo $p | cut -d'=' -f2-`" + eval "bootparam_${opt}=\"${value}\"" + fi +done + +# use /dev with devtmpfs +if grep -q devtmpfs /proc/filesystems; then + mkdir -p /dev + mount -t devtmpfs devtmpfs /dev +else + if [ ! -d /dev ]; then + fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled." + fi +fi + +mkdir $ROOTFS_DIR + +# Load and run modules +for m in $MODULES_DIR/*; do + # Skip backup files + if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then + continue + fi + + module=`basename $m | cut -d'-' -f 2` + debug "Loading module $module" + + # pre hooks + for h in $MODULE_PRE_HOOKS; do + debug "Calling module hook (pre): $h" + eval "$h pre $module" + debug "Finished module hook (pre): $h" + done + + # process module + . $m + + if ! eval "${module}_enabled"; then + debug "Skipping module $module" + continue + fi + + debug "Running ${module}_run" + eval "${module}_run" + + # post hooks + for h in $MODULE_POST_HOOKS; do + debug "Calling module hook (post): $h" + eval "$h post $module" + debug "Finished module hook (post): $h" + done +done + +# Catch all +fatal "ERROR: Initramfs failed to initialize the system." diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/meta/recipes-core/initrdscripts/initramfs-framework/mdev new file mode 100644 index 0000000000..a5df1d717a --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/mdev @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT + +mdev_enabled() { + if [ ! -e /sbin/mdev ]; then + debug "/sbin/mdev doesn't exist" + return 1 + fi + + return 0 +} + +mdev_run() { + # setup the environment + mount -t tmpfs tmpfs /dev + + mkdir -m 1777 /dev/shm + + mkdir -m 0755 /dev/pts + mount -t devpts devpts /dev/pts + + echo /sbin/mdev > /proc/sys/kernel/hotplug + mdev -s + + # load modules for devices + find /sys -name modalias | while read m; do + load_kernel_module $(cat $m) + done +} diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev new file mode 100644 index 0000000000..bb462dc448 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev @@ -0,0 +1,45 @@ +#!/bin/sh +# Copyright (C) 2011, 2012 O.S. Systems Software LTDA. +# Licensed on MIT + +udev_shutdown_hook_handler() { + status=$1 + module=$2 + if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then + killall `basename $_UDEV_DAEMON` 2>/dev/null + fi +} + +udev_daemon() { + OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd" + + for o in $OPTIONS; do + if [ -x "$o" ]; then + echo $o + return 0 + fi + done + + return 1 +} + +_UDEV_DAEMON=`udev_daemon` + +udev_enabled() { + if [ -z "$_UDEV_DAEMON" ]; then + msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs." + return 1 + fi + + return 0 +} + +udev_run() { + add_module_pre_hook "udev_shutdown_hook_handler" + + mkdir -p /run + + $_UDEV_DAEMON --daemon + udevadm trigger --action=add + udevadm settle +} diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb new file mode 100644 index 0000000000..861bec363f --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb @@ -0,0 +1,59 @@ +SUMMARY = "Modular initramfs system" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +RDEPENDS_${PN} += "busybox" + +PR = "r2" + +inherit allarch + +SRC_URI = "file://init \ + file://finish \ + file://mdev \ + file://udev \ + file://e2fs \ + file://debug" + +do_install() { + install -d ${D}/init.d + + # base + install -m 0755 ${WORKDIR}/init ${D}/init + install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish + + # mdev + install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev + + # udev + install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev + + # e2fs + install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs + + # debug + install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug +} + +PACKAGES = "${PN}-base \ + initramfs-module-mdev \ + initramfs-module-udev \ + initramfs-module-e2fs \ + initramfs-module-debug" + +FILES_${PN}-base = "/init /init.d/99-finish" + +SUMMARY_initramfs-module-mdev = "initramfs support for mdev" +RDEPENDS_initramfs-module-mdev = "${PN}-base" +FILES_initramfs-module-mdev = "/init.d/01-mdev" + +SUMMARY_initramfs-module-udev = "initramfs support for udev" +RDEPENDS_initramfs-module-udev = "${PN}-base udev udev-utils" +FILES_initramfs-module-udev = "/init.d/01-udev" + +SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems" +RDEPENDS_initramfs-module-e2fs = "${PN}-base" +FILES_initramfs-module-e2fs = "/init.d/10-e2fs" + +SUMMARY_initramfs-module-debug = "initramfs dynamic debug support" +RDEPENDS_initramfs-module-debug = "${PN}-base" +FILES_initramfs-module-debug = "/init.d/00-debug" diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb new file mode 100644 index 0000000000..2d378e2101 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb @@ -0,0 +1,17 @@ +SUMMARY = "Live image init script" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +DEPENDS = "virtual/kernel" +RDEPENDS_${PN} = "udev udev-extraconf" +SRC_URI = "file://init-live.sh" + +PR = "r11" + +do_install() { + install -m 0755 ${WORKDIR}/init-live.sh ${D}/init +} + +FILES_${PN} += " /init " + +# Due to kernel depdendency +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb new file mode 100644 index 0000000000..a54960c596 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "Live image install script for with a second rootfs/kernel option" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SRC_URI = "file://init-install-efi-testfs.sh" + +RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools" + +do_install() { + install -m 0755 ${WORKDIR}/init-install-efi-testfs.sh ${D}/install-efi.sh +} + +INHIBIT_DEFAULT_DEPS = "1" +FILES_${PN} = " /install-efi.sh " +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb new file mode 100644 index 0000000000..7195dc2718 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb @@ -0,0 +1,22 @@ +SUMMARY = "Live image install script for grub-efi" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SRC_URI = "file://init-install-efi.sh" + +PR = "r1" + +RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools" + +do_install() { + install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/install-efi.sh +} + +# While this package maybe an allarch due to it being a +# simple script, reality is that it is Host specific based +# on the COMPATIBLE_HOST below, which needs to take precedence +#inherit allarch +INHIBIT_DEFAULT_DEPS = "1" + +FILES_${PN} = " /install-efi.sh " + +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb new file mode 100644 index 0000000000..db4cf544e8 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "Live image install script with a second rootfs/kernel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SRC_URI = "file://init-install-testfs.sh" + +RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs" + +do_install() { + install -m 0755 ${WORKDIR}/init-install-testfs.sh ${D}/install.sh +} + +INHIBIT_DEFAULT_DEPS = "1" +FILES_${PN} = " /install.sh " +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb new file mode 100644 index 0000000000..7bf31c9cf8 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb @@ -0,0 +1,22 @@ +SUMMARY = "Live image install script for grub" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SRC_URI = "file://init-install.sh" + +PR = "r9" + +RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs" + +do_install() { + install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh +} + +# While this package maybe an allarch due to it being a +# simple script, reality is that it is Host specific based +# on the COMPATIBLE_HOST below, which needs to take precedence +#inherit allarch +INHIBIT_DEFAULT_DEPS = "1" + +FILES_${PN} = " /install.sh " + +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch new file mode 100644 index 0000000000..1ee8181f12 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch @@ -0,0 +1,347 @@ +Upstream-Status: Inappropriate [licensing] + +diff --git a/COPYING b/COPYING +new file mode 100644 +index 0000000..d511905 +--- /dev/null ++++ b/COPYING +@@ -0,0 +1,339 @@ ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 ++ ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++License is intended to guarantee your freedom to share and change free ++software--to make sure the software is free for all its users. This ++General Public License applies to most of the Free Software ++Foundation's software and to any other program whose authors commit to ++using it. (Some other Free Software Foundation software is covered by ++the GNU Lesser General Public License instead.) You can apply it to ++your programs, too. ++ ++ When we speak of free software, we are referring to freedom, not ++price. Our General Public Licenses are designed to make sure that you ++have the freedom to distribute copies of free software (and charge for ++this service if you wish), that you receive source code or can get it ++if you want it, that you can change the software or use pieces of it ++in new free programs; and that you know you can do these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++anyone to deny you these rights or to ask you to surrender the rights. ++These restrictions translate to certain responsibilities for you if you ++distribute copies of the software, or if you modify it. ++ ++ For example, if you distribute copies of such a program, whether ++gratis or for a fee, you must give the recipients all the rights that ++you have. You must make sure that they, too, receive or can get the ++source code. And you must show them these terms so they know their ++rights. ++ ++ We protect your rights with two steps: (1) copyright the software, and ++(2) offer you this license which gives you legal permission to copy, ++distribute and/or modify the software. ++ ++ Also, for each author's protection and ours, we want to make certain ++that everyone understands that there is no warranty for this free ++software. If the software is modified by someone else and passed on, we ++want its recipients to know that what they have is not the original, so ++that any problems introduced by others will not reflect on the original ++authors' reputations. ++ ++ Finally, any free program is threatened constantly by software ++patents. We wish to avoid the danger that redistributors of a free ++program will individually obtain patent licenses, in effect making the ++program proprietary. To prevent this, we have made it clear that any ++patent must be licensed for everyone's free use or not licensed at all. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. ++ ++ GNU GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License applies to any program or other work which contains ++a notice placed by the copyright holder saying it may be distributed ++under the terms of this General Public License. The "Program", below, ++refers to any such program or work, and a "work based on the Program" ++means either the Program or any derivative work under copyright law: ++that is to say, a work containing the Program or a portion of it, ++either verbatim or with modifications and/or translated into another ++language. (Hereinafter, translation is included without limitation in ++the term "modification".) Each licensee is addressed as "you". ++ ++Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running the Program is not restricted, and the output from the Program ++is covered only if its contents constitute a work based on the ++Program (independent of having been made by running the Program). ++Whether that is true depends on what the Program does. ++ ++ 1. You may copy and distribute verbatim copies of the Program's ++source code as you receive it, in any medium, provided that you ++conspicuously and appropriately publish on each copy an appropriate ++copyright notice and disclaimer of warranty; keep intact all the ++notices that refer to this License and to the absence of any warranty; ++and give any other recipients of the Program a copy of this License ++along with the Program. ++ ++You may charge a fee for the physical act of transferring a copy, and ++you may at your option offer warranty protection in exchange for a fee. ++ ++ 2. You may modify your copy or copies of the Program or any portion ++of it, thus forming a work based on the Program, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) You must cause the modified files to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ b) You must cause any work that you distribute or publish, that in ++ whole or in part contains or is derived from the Program or any ++ part thereof, to be licensed as a whole at no charge to all third ++ parties under the terms of this License. ++ ++ c) If the modified program normally reads commands interactively ++ when run, you must cause it, when started running for such ++ interactive use in the most ordinary way, to print or display an ++ announcement including an appropriate copyright notice and a ++ notice that there is no warranty (or else, saying that you provide ++ a warranty) and that users may redistribute the program under ++ these conditions, and telling the user how to view a copy of this ++ License. (Exception: if the Program itself is interactive but ++ does not normally print such an announcement, your work based on ++ the Program is not required to print an announcement.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Program, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Program, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Program. ++ ++In addition, mere aggregation of another work not based on the Program ++with the Program (or with a work based on the Program) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may copy and distribute the Program (or a work based on it, ++under Section 2) in object code or executable form under the terms of ++Sections 1 and 2 above provided that you also do one of the following: ++ ++ a) Accompany it with the complete corresponding machine-readable ++ source code, which must be distributed under the terms of Sections ++ 1 and 2 above on a medium customarily used for software interchange; or, ++ ++ b) Accompany it with a written offer, valid for at least three ++ years, to give any third party, for a charge no more than your ++ cost of physically performing source distribution, a complete ++ machine-readable copy of the corresponding source code, to be ++ distributed under the terms of Sections 1 and 2 above on a medium ++ customarily used for software interchange; or, ++ ++ c) Accompany it with the information you received as to the offer ++ to distribute corresponding source code. (This alternative is ++ allowed only for noncommercial distribution and only if you ++ received the program in object code or executable form with such ++ an offer, in accord with Subsection b above.) ++ ++The source code for a work means the preferred form of the work for ++making modifications to it. For an executable work, complete source ++code means all the source code for all modules it contains, plus any ++associated interface definition files, plus the scripts used to ++control compilation and installation of the executable. However, as a ++special exception, the source code distributed need not include ++anything that is normally distributed (in either source or binary ++form) with the major components (compiler, kernel, and so on) of the ++operating system on which the executable runs, unless that component ++itself accompanies the executable. ++ ++If distribution of executable or object code is made by offering ++access to copy from a designated place, then offering equivalent ++access to copy the source code from the same place counts as ++distribution of the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 4. You may not copy, modify, sublicense, or distribute the Program ++except as expressly provided under this License. Any attempt ++otherwise to copy, modify, sublicense or distribute the Program is ++void, and will automatically terminate your rights under this License. ++However, parties who have received copies, or rights, from you under ++this License will not have their licenses terminated so long as such ++parties remain in full compliance. ++ ++ 5. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Program or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Program (or any work based on the ++Program), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Program or works based on it. ++ ++ 6. Each time you redistribute the Program (or any work based on the ++Program), the recipient automatically receives a license from the ++original licensor to copy, distribute or modify the Program subject to ++these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties to ++this License. ++ ++ 7. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Program at all. For example, if a patent ++license would not permit royalty-free redistribution of the Program by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Program. ++ ++If any portion of this section is held invalid or unenforceable under ++any particular circumstance, the balance of the section is intended to ++apply and the section as a whole is intended to apply in other ++circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system, which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 8. If the distribution and/or use of the Program is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Program under this License ++may add an explicit geographical distribution limitation excluding ++those countries, so that distribution is permitted only in or among ++countries not thus excluded. In such case, this License incorporates ++the limitation as if written in the body of this License. ++ ++ 9. The Free Software Foundation may publish revised and/or new versions ++of the General Public License from time to time. Such new versions will ++be similar in spirit to the present version, but may differ in detail to ++address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Program ++specifies a version number of this License which applies to it and "any ++later version", you have the option of following the terms and conditions ++either of that version or of any later version published by the Free ++Software Foundation. If the Program does not specify a version number of ++this License, you may choose any version ever published by the Free Software ++Foundation. ++ ++ 10. If you wish to incorporate parts of the Program into other free ++programs whose distribution conditions are different, write to the author ++to ask for permission. For software which is copyrighted by the Free ++Software Foundation, write to the Free Software Foundation; we sometimes ++make exceptions for this. Our decision will be guided by the two goals ++of preserving the free status of all derivatives of our free software and ++of promoting the sharing and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY ++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN ++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES ++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED ++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS ++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, ++REPAIR OR CORRECTION. ++ ++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING ++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR ++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, ++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED ++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Programs ++ ++ If you develop a new program, and you want it to be of the greatest ++possible use to the public, the best way to achieve this is to make it ++free software which everyone can redistribute and change under these terms. ++ ++ To do so, attach the following notices to the program. It is safest ++to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least ++the "copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License along ++ with this program; if not, write to the Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++If the program is interactive, make it output a short notice like this ++when it starts in an interactive mode: ++ ++ Gnomovision version 69, Copyright (C) year name of author ++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. ++ This is free software, and you are welcome to redistribute it ++ under certain conditions; type `show c' for details. ++ ++The hypothetical commands `show w' and `show c' should show the appropriate ++parts of the General Public License. Of course, the commands you use may ++be called something other than `show w' and `show c'; they could even be ++mouse-clicks or menu items--whatever suits your program. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the program, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program ++ `Gnomovision' (which makes passes at compilers) written by James Hacker. ++ ++ , 1 April 1989 ++ Ty Coon, President of Vice ++ ++This General Public License does not permit incorporating your program into ++proprietary programs. If your program is a subroutine library, you may ++consider it more useful to permit linking proprietary applications with the ++library. If this is what you want to do, use the GNU Lesser General ++Public License instead of this License. diff --git a/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh new file mode 100644 index 0000000000..b577b9a03a --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh @@ -0,0 +1,13 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: alignment +# Required-Start: mountkernfs +# Required-Stop: mountkernfs +# Default-Start: S +# Default-Stop: +### END INIT INFO + +if [ -e /proc/cpu/alignment ]; then + echo "3" > /proc/cpu/alignment +fi + diff --git a/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh new file mode 100644 index 0000000000..9e2b091252 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh @@ -0,0 +1,24 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: banner +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO + +if [ ! -e /dev/tty ]; then + /bin/mknod -m 0666 /dev/tty c 5 0 +fi + +if ( > /dev/tty0 ) 2>/dev/null; then + vtmaster=/dev/tty0 +elif ( > /dev/vc/0 ) 2>/dev/null; then + vtmaster=/dev/vc/0 +elif ( > /dev/console ) 2>/dev/null; then + vtmaster=/dev/console +else + vtmaster=/dev/null +fi +echo > $vtmaster +echo "Please wait: booting..." > $vtmaster diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh new file mode 100755 index 0000000000..3b5a47fcdd --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh @@ -0,0 +1,71 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: bootmisc +# Required-Start: $local_fs mountvirtfs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Misc and other. +### END INIT INFO + +. /etc/default/rcS +# +# Put a nologin file in /etc to prevent people from logging in before +# system startup is complete. +# +if test "$DELAYLOGIN" = yes +then + echo "System bootup in progress - please wait" > /etc/nologin + cp /etc/nologin /etc/nologin.boot +fi + +# +# Set pseudo-terminal access permissions. +# +if test -c /dev/ttyp0 +then + chmod 666 /dev/tty[p-za-e][0-9a-f] + chown root:tty /dev/tty[p-za-e][0-9a-f] +fi + +# +# Apply /proc settings if defined +# +SYSCTL_CONF="/etc/sysctl.conf" +if [ -f "${SYSCTL_CONF}" ] +then + if [ -x "/sbin/sysctl" ] + then + /sbin/sysctl -p "${SYSCTL_CONF}" + else + echo "To have ${SYSCTL_CONF} applied during boot, install package ." + fi +fi + +# +# Update /etc/motd. +# +if test "$EDITMOTD" != no +then + uname -a > /etc/motd.tmp + sed 1d /etc/motd >> /etc/motd.tmp + mv /etc/motd.tmp /etc/motd +fi + +# +# This is as good a place as any for a sanity check +# +# Set the system clock from hardware clock +# If the timestamp is more recent than the current time, +# use the timestamp instead. +test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start +if test -e /etc/timestamp +then + SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M` + read TIMESTAMP < /etc/timestamp + if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then + date -u ${TIMESTAMP#????}${TIMESTAMP%????????} + test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop + fi +fi +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh new file mode 100755 index 0000000000..62869451b7 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh @@ -0,0 +1,50 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: checkfs +# Required-Start: checkroot +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Check all other file systems +### END INIT INFO + +. /etc/default/rcS + +# +# Check the rest of the filesystems. +# +if test ! -f /fastboot +then + if test -f /forcefsck + then + force="-f" + else + force="" + fi + if test "$FSCKFIX" = yes + then + fix="-y" + else + fix="-a" + fi + spinner="-C" + case "$TERM" in + dumb|network|unknown|"") spinner="" ;; + esac + test "`uname -m`" = "s390" && spinner="" # This should go away + test "$VERBOSE" != no && echo "Checking all filesystems..." + fsck $spinner -R -A $fix $force + if test "$?" -gt 1 + then + echo + echo "fsck failed. Please repair manually." + echo + echo "CONTROL-D will exit from this shell and continue system startup." + echo + # Start a single user shell on the console + /sbin/sulogin $CONSOLE + fi +fi +rm -f /fastboot /forcefsck + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh new file mode 100755 index 0000000000..dfee2afaad --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh @@ -0,0 +1,148 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: checkroot +# Required-Start: udev +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Check to root file system. +### END INIT INFO + +. /etc/default/rcS + +# +# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned +# from this script *before anything else* with a timeout, like SCO does. +# +test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE + +# +# Read /etc/fstab. +# +exec 9< /etc/fstab +rootmode=rw +rootopts=rw +rootcheck=$ENABLE_ROOTFS_FSCK +swap_on_md=no +devfs= +while read fs mnt type opts dump pass junk <&9 +do + case "$fs" in + ""|\#*) + continue; + ;; + /dev/md*) + # Swap on md device. + test "$type" = swap && swap_on_md=yes + ;; + /dev/*) + ;; + *) + # Might be a swapfile. + test "$type" = swap && swap_on_md=yes + ;; + esac + test "$type" = devfs && devfs="$fs" + test "$mnt" != / && continue + rootopts="$opts" + test "$pass" = 0 -o "$pass" = "" && rootcheck=no + case "$opts" in + ro|ro,*|*,ro|*,ro,*) + rootmode=ro + ;; + esac +done +exec 0>&9 9>&- + +# Check for conflicting configurations +if [ "$rootmode" = "ro" -a "$ROOTFS_READ_ONLY" = "no" ] || \ + [ "$rootmode" = "rw" -a "$ROOTFS_READ_ONLY" = "yes" ]; then + echo "" + echo "WARN: conflicting configurations in /etc/fstab and /etc/default/rcS" + echo " regarding the writability of rootfs. Please fix one of them." + echo "" +fi + + +# +# Activate the swap device(s) in /etc/fstab. This needs to be done +# before fsck, since fsck can be quite memory-hungry. +# +test "$VERBOSE" != no && echo "Activating swap" +swapon -a 2> /dev/null + +# +# Check the root filesystem. +# +if test -f /fastboot || test $rootcheck = no +then + test $rootcheck = yes && echo "Fast boot, no filesystem check" +else + # + # Ensure that root is quiescent and read-only before fsck'ing. + # + mount -n -o remount,ro / + if test $? = 0 + then + if test -f /forcefsck + then + force="-f" + else + force="" + fi + if test "$FSCKFIX" = yes + then + fix="-y" + else + fix="-a" + fi + spinner="-C" + case "$TERM" in + dumb|network|unknown|"") spinner="" ;; + esac + test `uname -m` = s390 && spinner="" # This should go away + test "$VERBOSE" != no && echo "Checking root filesystem..." + fsck $spinner $force $fix / + # + # If there was a failure, drop into single-user mode. + # + # NOTE: "failure" is defined as exiting with a return code of + # 2 or larger. A return code of 1 indicates that filesystem + # errors were corrected but that the boot may proceed. + # + if test "$?" -gt 1 + then + # Surprise! Re-directing from a HERE document (as in + # "cat << EOF") won't work, because the root is read-only. + echo + echo "fsck failed. Please repair manually and reboot. Please note" + echo "that the root filesystem is currently mounted read-only. To" + echo "remount it read-write:" + echo + echo " # mount -n -o remount,rw /" + echo + echo "CONTROL-D will exit from this shell and REBOOT the system." + echo + # Start a single user shell on the console + /sbin/sulogin $CONSOLE + reboot -f + fi + else + echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!" + echo + fi +fi + +# +# If the root filesystem was not marked as read-only in /etc/fstab, +# remount the rootfs rw but do not try to change mtab because it +# is on a ro fs until the remount succeeded. Then clean up old mtabs +# and finally write the new mtab. +# +mount -n -o remount,$rootmode / +if test "$rootmode" = rw +then + ln -sf /proc/mounts /dev/mtab +fi + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts b/meta/recipes-core/initscripts/initscripts-1.0/devpts new file mode 100644 index 0000000000..4a0978b404 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts @@ -0,0 +1,5 @@ +# GID of the `tty' group +TTYGRP=5 + +# Set to 600 to have `mesg n' be the default +TTYMODE=620 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh new file mode 100755 index 0000000000..c6043fb1e6 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh @@ -0,0 +1,28 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: devpts +# Required-Start: udev +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount /dev/pts file systems. +### END INIT INFO + +. /etc/default/devpts + +if grep -q devpts /proc/filesystems +then + # + # Create multiplexor device. + # + test -c /dev/ptmx || mknod -m 666 /dev/ptmx c 5 2 + + # + # Mount /dev/pts if needed. + # + if ! grep -q devpts /proc/mounts + then + mkdir -p /dev/pts + mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE} + fi +fi diff --git a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh new file mode 100644 index 0000000000..a97b0681e1 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh @@ -0,0 +1,17 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: dmesg +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO + +if [ -f /var/log/dmesg ]; then + if [ -f /usr/sbin/logrotate ]; then + logrotate -f /etc/logrotate-dmesg.conf + else + mv -f /var/log/dmesg /var/log/dmesg.old + fi +fi +dmesg -s 131072 > /var/log/dmesg diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions new file mode 100755 index 0000000000..01ad1edd3e --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/functions @@ -0,0 +1,91 @@ +# -*-Shell-script-*- +# +# functions This file contains functions to be used by most or all +# shell scripts in the /etc/init.d directory. +# + +NORMAL="\\033[0;39m" # Standard console grey +SUCCESS="\\033[1;32m" # Success is green +WARNING="\\033[1;33m" # Warnings are yellow +FAILURE="\\033[1;31m" # Failures are red +INFO="\\033[1;36m" # Information is light cyan +BRACKET="\\033[1;34m" # Brackets are blue + +# NOTE: The pidofproc () doesn't support the process which is a script unless +# the pidof supports "-x" option. If you want to use it for such a +# process: +# 1) If there is no "pidof -x", replace the "pidof $1" with another +# command like(for core-image-minimal): +# ps | awk '/'"$1"'/ {print $1}' +# Or +# 2) If there is "pidof -x", replace "pidof" with "pidof -x". +# +# pidofproc - print the pid of a process +# $1: the name of the process +pidofproc () { + + # pidof output null when no program is running, so no "2>/dev/null". + pid=`pidof $1` + status=$? + case $status in + 0) + echo $pid + return 0 + ;; + 127) + echo "ERROR: command pidof not found" >&2 + exit 127 + ;; + *) + return $status + ;; + esac +} + +machine_id() { # return the machine ID + awk 'BEGIN { FS=": " } /Hardware/ \ + { gsub(" ", "_", $2); print tolower($2) } ' /dev/null +if [ $? -eq 0 ]; then + exit +fi + +# Busybox hostname doesn't support -b so we need implement it on our own +if [ -f /etc/hostname ];then + hostname -F /etc/hostname +elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then + hostname localhost +fi diff --git a/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf new file mode 100644 index 0000000000..6f46e4216f --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf @@ -0,0 +1,9 @@ +# see "man logrotate" for details +# rotate dmesg, and keep 5 versions. + +/var/log/dmesg { + create + rotate 5 + nodateext +} + diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh new file mode 100755 index 0000000000..94bae420c0 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh @@ -0,0 +1,39 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: mountall +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount all filesystems. +# Description: +### END INIT INFO + +. /etc/default/rcS + +# +# Mount local filesystems in /etc/fstab. For some reason, people +# might want to mount "proc" several times, and mount -v complains +# about this. So we mount "proc" filesystems without -v. +# +test "$VERBOSE" != no && echo "Mounting local filesystems..." +mount -at nonfs,nosmbfs,noncpfs 2>/dev/null + +# +# We might have mounted something over /dev, see if /dev/initctl is there. +# +if test ! -p /dev/initctl +then + rm -f /dev/initctl + mknod -m 600 /dev/initctl p +fi +kill -USR1 1 + +# +# Execute swapon command again, in case we want to swap to +# a file on a now mounted filesystem. +# +swapon -a 2> /dev/null + +: exit 0 + diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh new file mode 100755 index 0000000000..fe6c19605f --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh @@ -0,0 +1,88 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: mountnfs +# Required-Start: $local_fs $network $rpcbind +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO + +# +# Run in a subshell because of I/O redirection. +# +test -f /etc/fstab && ( + +# +# Read through fstab line by line. If it is NFS, set the flag +# for mounting NFS filesystems. If any NFS partition is found and it +# not mounted with the nolock option, we start the rpcbind. +# +rpcbind=no +mount_nfs=no +mount_smb=no +mount_ncp=no +mount_cifs=no +while read device mountpt fstype options +do + case "$device" in + ""|\#*) + continue + ;; + esac + + case "$options" in + *noauto*) + continue + ;; + esac + + if test "$fstype" = nfs + then + mount_nfs=yes + case "$options" in + *nolock*) + ;; + *) + rpcbind=yes + ;; + esac + fi + if test "$fstype" = smbfs + then + mount_smb=yes + fi + if test "$fstype" = ncpfs + then + mount_ncp=yes + fi + if test "$fstype" = cifs + then + mount_cifs=yes + fi +done + +exec 0>&1 + +if test "$rpcbind" = yes +then + if test -x /usr/sbin/rpcbind + then + echo -n "Starting rpcbind... " + start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind + sleep 2 + fi +fi + +if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes +then + echo "Mounting remote filesystems..." + test "$mount_nfs" = yes && mount -a -t nfs + test "$mount_smb" = yes && mount -a -t smbfs + test "$mount_ncp" = yes && mount -a -t ncpfs + test "$mount_cifs" = yes && mount -a -t cifs +fi + +) < /etc/fstab + +: exit 0 + diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh new file mode 100755 index 0000000000..6ffe1f2171 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh @@ -0,0 +1,220 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: volatile +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: +# Short-Description: Populate the volatile filesystem +### END INIT INFO + +# Get ROOT_DIR +DIRNAME=`dirname $0` +ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'` + +[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS +# When running populate-volatile.sh at rootfs time, disable cache. +[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no +# If rootfs is read-only, disable cache. +[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no + +CFGDIR="${ROOT_DIR}/etc/default/volatiles" +TMPROOT="${ROOT_DIR}/var/volatile/tmp" +COREDEF="00_core" + +[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems." + +create_file() { + EXEC=" + touch \"$1\"; + chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; + chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build + + [ -e "$1" ] && { + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + } || { + if [ -z "$ROOT_DIR" ]; then + eval $EXEC & + else + # Creating some files at rootfs time may fail and should fail, + # but these failures should not be logged to make sure the do_rootfs + # process doesn't fail. This does no harm, as this script will + # run on target to set up the correct files and directories. + eval $EXEC > /dev/null 2>&1 + fi + } +} + +mk_dir() { + EXEC=" + mkdir -p \"$1\"; + chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; + chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build + [ -e "$1" ] && { + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + } || { + if [ -z "$ROOT_DIR" ]; then + eval $EXEC + else + # For the same reason with create_file(), failures should + # not be logged. + eval $EXEC > /dev/null 2>&1 + fi + } +} + +link_file() { + EXEC=" + if [ -L \"$2\" ]; then + [ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; + elif [ -d \"$2\" ]; then + cp -a $2/* $1 2>/dev/null; + cp -a $2/.[!.]* $1 2>/dev/null; + rm -rf \"$2\"; + ln -sf \"$1\" \"$2\"; + else + ln -sf \"$1\" \"$2\"; + fi + " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build + + if [ -z "$ROOT_DIR" ]; then + eval $EXEC & + else + # For the same reason with create_file(), failures should + # not be logged. + eval $EXEC > /dev/null 2>&1 + fi +} + +check_requirements() { + cleanup() { + rm "${TMP_INTERMED}" + rm "${TMP_DEFINED}" + rm "${TMP_COMBINED}" + } + + CFGFILE="$1" + [ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0 + + TMP_INTERMED="${TMPROOT}/tmp.$$" + TMP_DEFINED="${TMPROOT}/tmpdefined.$$" + TMP_COMBINED="${TMPROOT}/tmpcombined.$$" + + cat ${ROOT_DIR}/etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}" + cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}" + cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" + NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`" + NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`" + + [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && { + echo "Undefined users:" + diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>" + cleanup + return 1 + } + + + cat ${ROOT_DIR}/etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}" + cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}" + cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" + + NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`" + NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`" + + [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && { + echo "Undefined groups:" + diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>" + cleanup + return 1 + } + + # Add checks for required directories here + + cleanup + return 0 +} + +apply_cfgfile() { + CFGFILE="$1" + + check_requirements "${CFGFILE}" || { + echo "Skipping ${CFGFILE}" + return 1 + } + + cat ${CFGFILE} | grep -v "^#" | \ + while read LINE; do + eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"` + TNAME=${ROOT_DIR}${TNAME} + [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." + + [ "${TTYPE}" = "l" ] && { + TSOURCE="$TLTARGET" + [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-." + link_file "${TSOURCE}" "${TNAME}" + continue + } + + [ -L "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Found link." + NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'` + echo ${NEWNAME} | grep -v "^/" >/dev/null && { + TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." + } || { + TNAME="${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." + } + } + + case "${TTYPE}" in + "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-." + create_file "${TNAME}" & + ;; + "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-." + mk_dir "${TNAME}" + # Add check to see if there's an entry in fstab to mount. + ;; + *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-." + continue + ;; + esac + done + return 0 +} + +clearcache=0 +exec 9&- + +if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0" +then + sh ${ROOT_DIR}/etc/volatile.cache +else + rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build + for file in `ls -1 "${CFGDIR}" | sort`; do + apply_cfgfile "${CFGDIR}/${file}" + done + + [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache +fi + +if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] +then + ln -s /etc/ld.so.cache /var/run/ld.so.cache +fi diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh new file mode 100644 index 0000000000..1a0328d63e --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +. /etc/default/rcS + +[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0 + +is_on_read_only_partition () { + DIRECTORY=$1 + dir=`readlink -f $DIRECTORY` + while true; do + if [ ! -d "$dir" ]; then + echo "ERROR: $dir is not a directory" + exit 1 + else + for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \ + END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do + [ "$flag" = "FOUND" ] && partition="read-write" + [ "$flag" = "ro" ] && { partition="read-only"; break; } + done + if [ "$dir" = "/" -o -n "$partition" ]; then + break + else + dir=`dirname $dir` + fi + fi + done + [ "$partition" = "read-only" ] && echo "yes" || echo "no" +} + +if [ "$1" = "start" ] ; then + if [ `is_on_read_only_partition /var/lib` = "yes" ]; then + grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile + mkdir -p /var/volatile/lib + cp -a /var/lib/* /var/volatile/lib + mount --bind /var/volatile/lib /var/lib + fi +fi + diff --git a/meta/recipes-core/initscripts/initscripts-1.0/reboot b/meta/recipes-core/initscripts/initscripts-1.0/reboot new file mode 100755 index 0000000000..087d8d5da4 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/reboot @@ -0,0 +1,15 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: reboot +# Required-Start: +# Required-Stop: +# Default-Start: +# Default-Stop: 6 +# Short-Description: Execute the reboot command. +# Description: +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +echo -n "Rebooting... " +reboot SED_HALTARGS diff --git a/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh new file mode 100755 index 0000000000..76de3418ac --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh @@ -0,0 +1,20 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: rmnologin +# Required-Start: $remote_fs $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Remove /etc/nologin at boot +# Description: This script removes the /etc/nologin file as the +# last step in the boot process, if DELAYLOGIN=yes. +# If DELAYLOGIN=no, /etc/nologin was not created by +# bootmisc earlier in the boot process. +### END INIT INFO + +if test -f /etc/nologin.boot +then + rm -f /etc/nologin /etc/nologin.boot +fi + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh new file mode 100644 index 0000000000..1f804e2374 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh @@ -0,0 +1,13 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: save-rtc +# Required-Start: +# Required-Stop: $local_fs hwclock +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Store system clock into file +# Description: +### END INIT INFO + +# Update the timestamp +date -u +%4Y%2m%2d%2H%2M > /etc/timestamp diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs new file mode 100755 index 0000000000..34e1b7714b --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs @@ -0,0 +1,21 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: sendsigs +# Required-Start: +# Required-Stop: umountnfs +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Kill all remaining processes. +# Description: +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# Kill all processes. +echo "Sending all processes the TERM signal..." +killall5 -15 +sleep 5 +echo "Sending all processes the KILL signal..." +killall5 -9 + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/single b/meta/recipes-core/initscripts/initscripts-1.0/single new file mode 100755 index 0000000000..da82d178a1 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/single @@ -0,0 +1,24 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: single +# Required-Start: $local_fs $all killprocs +# Required-Stop: +# Default-Start: 1 +# Default-Stop: +# Short-Description: executed by init(8) upon entering runlevel 1 (single). +### END INIT INFO + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" + +# Kill all processes. +echo "Sending all processes the TERM signal..." +killall5 -15 +sleep 5 +echo "Sending all processes the KILL signal..." +killall5 -9 + +# We start update here, since we just killed it. +test -x /sbin/update && update + +echo "Entering single-user mode..." +exec init -t1 S diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh new file mode 100644 index 0000000000..0cfe76e230 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh @@ -0,0 +1,23 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: mountvirtfs +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mount kernel virtual file systems. +# Description: Mount initial set of virtual filesystems the kernel +# provides and that are required by everything. +### END INIT INFO + +if [ -e /proc ] && ! [ -e /proc/mounts ]; then + mount -t proc proc /proc +fi + +if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then + mount -t sysfs sysfs /sys +fi + +if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then + mount -t debugfs debugfs /sys/kernel/debug +fi diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/meta/recipes-core/initscripts/initscripts-1.0/umountfs new file mode 100755 index 0000000000..61324c630b --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/umountfs @@ -0,0 +1,24 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: umountfs +# Required-Start: +# Required-Stop: +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Turn off swap and unmount all local file systems. +# Description: +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +echo "Deactivating swap..." +swapoff -a + +# We leave /proc mounted. +echo "Unmounting local filesystems..." +grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram +mount -o remount,ro / + +umount -f -a -r > /dev/null 2>&1 + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh new file mode 100755 index 0000000000..af075407fd --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh @@ -0,0 +1,33 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: umountnfs +# Required-Start: +# Required-Stop: umountfs +# Should-Stop: $network $portmap +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Unmount all network filesystems +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# Write a reboot record to /var/log/wtmp before unmounting +halt -w + +echo "Unmounting remote filesystems..." + +test -f /etc/fstab && ( + +# +# Read through fstab line by line and unount network file systems +# +while read device mountpt fstype options +do + if test "$fstype" = nfs || test "$fstype" = smbfs || test "$fstype" = ncpfs || test "$fstype" = cifs + then + umount -f $mountpt + fi +done +) < /etc/fstab + +: exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/urandom b/meta/recipes-core/initscripts/initscripts-1.0/urandom new file mode 100755 index 0000000000..eb3a7c3359 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/urandom @@ -0,0 +1,46 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: urandom +# Required-Start: $local_fs mountvirtfs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Save and restore the random seed +# Description: Save the random seed on shutdown and restore it on boot, +# to ensure that the seed isn't predicable on startup +# (because the boot process is predictable) +### END INIT INFO + +test -c /dev/urandom || exit 0 +. /etc/default/rcS + +case "$1" in + start|"") + test "$VERBOSE" != no && echo "Initializing random number generator..." + # Load and then save 512 bytes, + # which is the size of the entropy pool + if test -f /var/lib/urandom/random-seed + then + cat /var/lib/urandom/random-seed >/dev/urandom + fi + rm -f /var/lib/urandom/random-seed + umask 077 + dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \ + >/dev/null 2>&1 || echo "urandom start: failed." + umask 022 + ;; + stop) + # Carry a random seed from shut-down to start-up; + # see documentation in linux/drivers/char/random.c + test "$VERBOSE" != no && echo "Saving random seed..." + umask 077 + dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \ + >/dev/null 2>&1 || echo "urandom stop: failed." + ;; + *) + echo "Usage: urandom {start|stop}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles new file mode 100644 index 0000000000..297245d0e4 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles @@ -0,0 +1,36 @@ +# This configuration file lists filesystem objects that should get verified +# during startup and be created if missing. +# +# Every line must either be a comment starting with # +# or a definition of format: +# +# where the items are separated by whitespace ! +# +# : d|f|l : (d)irectory|(f)ile|(l)ink +# +# A linking example: +# l root root 0777 /var/test /tmp/testfile +# f root root 0644 /var/test none +# +# Understanding links: +# When populate-volatile is to verify/create a directory or file, it will first +# check it's existence. If a link is found to exist in the place of the target, +# the path of the target is replaced with the target the link points to. +# Thus, if a link is in the place to be verified, the object will be created +# in the place the link points to instead. +# This explains the order of "link before object" as in the example above, where +# a link will be created at /var/test pointing to /tmp/testfile and due to this +# link the file defined as /var/test will actually be created as /tmp/testfile. +d root root 1777 /run/lock none +d root root 0755 /var/volatile/log none +d root root 1777 /var/volatile/tmp none +l root root 1777 /var/lock /run/lock +l root root 0755 /var/log /var/volatile/log +l root root 0755 /var/run /run +l root root 1777 /var/tmp /var/volatile/tmp +l root root 1777 /tmp /var/tmp +d root root 0755 /var/lock/subsys none +f root root 0664 /var/log/wtmp none +f root root 0664 /var/run/utmp none +l root root 0644 /etc/resolv.conf /var/run/resolv.conf +f root root 0644 /var/run/resolv.conf none diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb new file mode 100644 index 0000000000..62d0eae9f9 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb @@ -0,0 +1,160 @@ +SUMMARY = "SysV init scripts" +DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup." +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +PR = "r154" + +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://functions \ + file://halt \ + file://umountfs \ + file://devpts.sh \ + file://devpts \ + file://hostname.sh \ + file://mountall.sh \ + file://banner.sh \ + file://bootmisc.sh \ + file://mountnfs.sh \ + file://reboot \ + file://checkfs.sh \ + file://single \ + file://sendsigs \ + file://urandom \ + file://rmnologin.sh \ + file://checkroot.sh \ + file://umountnfs.sh \ + file://sysfs.sh \ + file://populate-volatile.sh \ + file://read-only-rootfs-hook.sh \ + file://volatiles \ + file://save-rtc.sh \ + file://GPLv2.patch \ + file://dmesg.sh \ + file://logrotate-dmesg.conf \ +" + +SRC_URI_append_arm = " file://alignment.sh" + +KERNEL_VERSION = "" + +inherit update-alternatives +DEPENDS_append = " update-rc.d-native" +DEPENDS_append = " ${@base_contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}" + +PACKAGES =+ "${PN}-functions" +RDEPENDS_${PN} = "${PN}-functions" +FILES_${PN}-functions = "${sysconfdir}/init.d/functions*" + +ALTERNATIVE_PRIORITY_${PN}-functions = "90" +ALTERNATIVE_${PN}-functions = "functions" +ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions" + +HALTARGS ?= "-d -f" + +do_configure() { + sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt + sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot +} + +do_install () { +# +# Create directories and install device independent scripts +# + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/rcS.d + install -d ${D}${sysconfdir}/rc0.d + install -d ${D}${sysconfdir}/rc1.d + install -d ${D}${sysconfdir}/rc2.d + install -d ${D}${sysconfdir}/rc3.d + install -d ${D}${sysconfdir}/rc4.d + install -d ${D}${sysconfdir}/rc5.d + install -d ${D}${sysconfdir}/rc6.d + install -d ${D}${sysconfdir}/default + install -d ${D}${sysconfdir}/default/volatiles + # Holds state information pertaining to urandom + install -d ${D}/var/lib/urandom + + install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/halt ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/hostname.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/mountall.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/mountnfs.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/reboot ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/rmnologin.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/sendsigs ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/single ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/umountnfs.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/urandom ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default + install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core + install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/ + + if [ "${TARGET_ARCH}" = "arm" ]; then + install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d + fi +# +# Install device dependent scripts +# + install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh + install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs +# +# Create runlevel links +# + update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 . + update-rc.d -r ${D} sendsigs start 20 0 6 . + update-rc.d -r ${D} urandom start 30 S 0 6 . + update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 . + update-rc.d -r ${D} umountfs start 40 0 6 . + update-rc.d -r ${D} reboot start 90 6 . + update-rc.d -r ${D} halt start 90 0 . + update-rc.d -r ${D} save-rtc.sh start 25 0 6 . + update-rc.d -r ${D} banner.sh start 02 S . + update-rc.d -r ${D} checkroot.sh start 06 S . + update-rc.d -r ${D} mountall.sh start 03 S . + update-rc.d -r ${D} hostname.sh start 39 S . + update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 . + update-rc.d -r ${D} bootmisc.sh start 55 S . + update-rc.d -r ${D} sysfs.sh start 02 S . + update-rc.d -r ${D} populate-volatile.sh start 37 S . + update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S . + update-rc.d -r ${D} devpts.sh start 38 S . + if [ "${TARGET_ARCH}" = "arm" ]; then + update-rc.d -r ${D} alignment.sh start 06 S . + fi + # We wish to have /var/log ready at this stage so execute this after + # populate-volatile.sh + update-rc.d -r ${D} dmesg.sh start 38 S . +} + +MASKED_SCRIPTS = " \ + banner \ + bootmisc \ + checkroot \ + devpts \ + hostname \ + mountall \ + mountnfs \ + rmnologin \ + sysfs \ + urandom" + +pkg_postinst_${PN} () { + if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + for SERVICE in ${MASKED_SCRIPTS}; do + systemctl $OPTS mask $SERVICE.service + done + fi +} diff --git a/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff b/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff new file mode 100644 index 0000000000..3b8fa6980a --- /dev/null +++ b/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff @@ -0,0 +1,1070 @@ +This is a well-known debian patch used by many Linux distribution, but not +accepted by upstream yet. +Upstream-Status: Pending + +--- libjpeg7-7.orig/config.sub ++++ libjpeg7-7/config.sub +@@ -1,4 +1,10 @@ + #! /bin/sh ++# autotools-dev hack (, Wed, 14 Nov 2001 10:13:10 +0100) ++if [ -x /usr/share/misc/config.sub ]; then ++ /usr/share/misc/config.sub $* ++ exit $? ++fi ++ + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +--- libjpeg7-7.orig/config.guess ++++ libjpeg7-7/config.guess +@@ -1,4 +1,10 @@ + #! /bin/sh ++# autotools-dev hack (, Wed, 14 Nov 2001 10:13:10 +0100) ++if [ -x /usr/share/misc/config.guess ]; then ++ /usr/share/misc/config.guess $* ++ exit $? ++fi ++ + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +--- libjpeg7-7.orig/debian/libjpeg7-dev.files ++++ libjpeg7-7/debian/libjpeg7-dev.files +@@ -0,0 +1,4 @@ ++usr/include ++usr/lib/libjpeg.a ++usr/lib/libjpeg.la ++usr/lib/libjpeg.so +--- libjpeg7-7.orig/debian/libjpeg-progs.README.Debian ++++ libjpeg7-7/debian/libjpeg-progs.README.Debian +@@ -0,0 +1,13 @@ ++libjpeg-progs for Debian ++======================== ++ ++This package contains programs for manipulating JPEG files: ++ cjpeg/djpeg: convert to/from the JPEG file format ++ rdjpgcom/wrjpgcom: read/write comments in JPEG files ++ jpegtran: lossless transformations of JPEG files ++ jpegexiforient/exifautotran: manipulate EXIF orientation tag ++ ++Thanks for using Debian! ++ ++-- ++Bill Allombert Sun, 05 Jul 2009 15:18:59 +0200 +--- libjpeg7-7.orig/debian/shlibs.local ++++ libjpeg7-7/debian/shlibs.local +@@ -0,0 +1 @@ ++libjpeg 7 libjpeg7 +--- libjpeg7-7.orig/debian/rules ++++ libjpeg7-7/debian/rules +@@ -0,0 +1,71 @@ ++#!/usr/bin/make -f ++# Made with the aid of debmake, by Christoph Lameter, ++# based on the sample debian/rules file for GNU hello by Ian Jackson. ++ ++package=libjpeg ++ ++export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) ++export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ++ ++export CFLAGS=-D_REENTRANT -g -Wall ++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ++CFLAGS += -O0 ++else ++CFLAGS += -O2 ++endif ++ ++#export DH_VERBOSE=1 ++ ++build: build-stamp ++build-stamp: ++ dh_testdir ++ ./configure --prefix=/usr --mandir=/usr/share/man \ ++ --enable-static --enable-shared \ ++ --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) ++ $(MAKE) ++ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) ++ $(MAKE) check ++endif ++ $(MAKE) -C debian/extra ++ ++ touch build-stamp ++ ++clean: ++ dh_testdir ++ dh_testroot ++ -rm -f build-stamp ++ if [ -f Makefile ]; then $(MAKE) distclean; fi ++ $(MAKE) clean -C debian/extra ++ dh_clean ++ ++binary-indep: ++ ++binary-arch: build ++ dh_testdir ++ dh_testroot ++ dh_clean -k ++ dh_installdirs ++ $(MAKE) install DESTDIR=`pwd`/debian/tmp ++ $(MAKE) install -C debian/extra prefix=/usr DESTDIR=`pwd`/debian/tmp ++ # fix jconfig.h ++ rm debian/tmp/usr/include/jconfig.h ++ sed -e "s/#\(undef\|define\) HAVE_\(LOCALE\|\(STD\(DEF\|LIB\)\)\)_H 1//g" \ ++ jconfig.h > debian/tmp/usr/include/jconfig.h ++ # separate out lib package ++ dh_movefiles ++ # Finish it off with debhelper ++ dh_installdocs README ++ dh_installexamples ++ dh_installchangelogs change.log ++ dh_strip --dbg-package=libjpeg7-dbg ++ dh_compress ++ dh_fixperms ++ dh_installdeb ++ dh_shlibdeps -l`pwd`/debian/libjpeg7/usr/lib ++ dh_gencontrol ++ dh_md5sums ++ dh_builddeb ++ ++binary: binary-indep binary-arch ++ ++.PHONY: clean binary-indep binary-arch binary build +--- libjpeg7-7.orig/debian/libjpeg7-dev.README.Debian ++++ libjpeg7-7/debian/libjpeg7-dev.README.Debian +@@ -0,0 +1,18 @@ ++IJG JPEG for Debian ++=================== ++ ++The following patch has been applied to the headers files: ++ ++--- jconfig.h: Remove unused symbol HAVE_STDDEF_H, HAVE_STDLIB_H and ++HAVE_LOCALE_H since they are not used by the installed headers files and cause ++problem with autoconf. ++ ++This can theoretically cause problems if your software relies on theses symbols ++being defined by this header. If it ever happens, please define them manually. ++ ++Note: this is not Debian-specific, others distributions apply similar patches. ++ ++Thanks for using Debian! ++ ++--- ++Bill Allombert Sun, 05 Jul 2009 15:17:56 +0200 +--- libjpeg7-7.orig/debian/shlibs ++++ libjpeg7-7/debian/shlibs +@@ -0,0 +1 @@ ++libjpeg 7 libjpeg7 +--- libjpeg7-7.orig/debian/control ++++ libjpeg7-7/debian/control +@@ -0,0 +1,52 @@ ++Source: libjpeg7 ++Maintainer: Bill Allombert ++Section: graphics ++Priority: optional ++Build-Depends: debhelper (>= 5), autotools-dev ++Standards-Version: 3.8.2 ++ ++Package: libjpeg7 ++Architecture: any ++Section: libs ++Description: The Independent JPEG Group's JPEG runtime library ++ The Independent JPEG Group's JPEG library is a library for handling ++ JPEG files. ++ . ++ This package contains the shared library. ++Depends: ${shlibs:Depends} ++ ++Package: libjpeg7-dev ++Architecture: any ++Section: libdevel ++Description: Development files for the IJG JPEG library ++ The Independent JPEG Group's JPEG library is a library for handling ++ JPEG files. ++ . ++ This package contains the static library, headers and documentation. ++Depends: libjpeg7 (=${binary:Version}), libc-dev ++Conflicts: libjpeg62-dev ++Replaces: libjpeg62-dev ++ ++Package: libjpeg7-dbg ++Architecture: any ++Section: debug ++Priority: extra ++Description: Development files for the IJG JPEG library ++ The Independent JPEG Group's JPEG library is a library for handling ++ JPEG files. ++ . ++ This package contains the debugging symbols for libjpeg. ++Provides: libjpeg-dbg ++Depends: libjpeg7 (=${binary:Version}) ++Conflicts: libjpeg62-dbg ++Replaces: libjpeg62-dbg ++ ++Package: libjpeg-progs ++Architecture: any ++Description: Programs for manipulating JPEG files ++ This package contains programs for manipulating JPEG files: ++ cjpeg/djpeg: convert to/from the JPEG file format ++ rdjpgcom/wrjpgcom: read/write comments in JPEG files ++ jpegtran: lossless transformations of JPEG files ++ jpegexiforient/exifautotran: manipulate EXIF orientation tag ++Depends: ${shlibs:Depends} +--- libjpeg7-7.orig/debian/libjpeg7.files ++++ libjpeg7-7/debian/libjpeg7.files +@@ -0,0 +1,2 @@ ++/usr/lib/libjpeg.so.7.0.0 ++/usr/lib/libjpeg.so.7 +--- libjpeg7-7.orig/debian/postinst ++++ libjpeg7-7/debian/postinst +@@ -0,0 +1,8 @@ ++#!/bin/sh -e ++ ++#DEBHELPER# ++ ++if [ "$1" = "configure" ]; then ++ ldconfig ++fi ++ +--- libjpeg7-7.orig/debian/compat ++++ libjpeg7-7/debian/compat +@@ -0,0 +1 @@ ++5 +--- libjpeg7-7.orig/debian/libjpeg7-dev.examples ++++ libjpeg7-7/debian/libjpeg7-dev.examples +@@ -0,0 +1 @@ ++example.c +--- libjpeg7-7.orig/debian/changelog ++++ libjpeg7-7/debian/changelog +@@ -0,0 +1,245 @@ ++libjpeg7 (7-1) unstable; urgency=low ++ ++ * The "Yoan" release. ++ * New upstream release. closes: #535350 ++ - This release includes configure.ac and Makefile.am. closes: #346126 ++ - All patches merged upstream. ++ - Remove dpatch support. ++ * debian/control: ++ - Remove Build-Dependency on libtool and sharutils. ++ - Move libjpeg7-dbg to debug section. ++ - Bump standard version to 3.8.2. ++ * Skip test-suite if nocheck is set. closes: #451222 ++ ++ -- Bill Allombert Sun, 05 Jul 2009 15:29:27 +0200 ++ ++libjpeg6b (6b-14) unstable; urgency=low ++ ++ * The "Lino" release. ++ * exifautotran: ++ - fix typo in manpage. closes: #376371, thanks Reuben Thomas. ++ - preserve file mode. closes: #383379, thanks Vincent Arkesteijn. ++ * debian/control, debian/rules, debian/compat: ++ + switch to debhelper v5 ++ + add libjpeg-dbg debugging package. ++ * debian/rules: remove - before "make clean" rules. ++ * Add patch 204_jpegtran_man to improve readability of manpage. ++ closes: #437453. Thanks Jorgen Grahn. ++ * jpegexiforient.1: Apply patch from Jorgen Grahn to improve formatting. ++ closes: #437446. ++ ++ -- Bill Allombert Thu, 16 Aug 2007 22:59:21 +0200 ++ ++libjpeg6b (6b-13) unstable; urgency=low ++ ++ * The "If at first you don't succeed..." release. ++ * Change --enable-maxmem to 1024, following Guido advice. ++ This should fix the slowdowns with large files (for large < 1Gb): ++ closes: #356556, #365025, Thanks Nicolas. ++ If you hit performance problems, please set the JPEGMEM variable to ++ about half your available RAM, see jpegtran(1). ++ * Update libjpeg-progs README.Debian to reflect the new patch set and ++ the JPEGMEM feature. ++ * Bump standard version to 3.7.2. ++ ++ -- Bill Allombert Fri, 5 May 2006 19:14:25 +0200 ++ ++libjpeg6b (6b-12) unstable; urgency=low ++ ++ * The "vote for me" release ++ * Bump standard version to 3.6.2. ++ * Run 'make test' instead of home-made test-suite. ++ * Switch to debhelper v4. ++ * libjpeg is now configured with --enable-maxmem=32. This limits the memory ++ usage to 32Mb and it can be overrided by JPEGMEM. Without this flag ++ JPEGMEM is ignored and there were no limits. ++ closes: #346023. Thanks C. Scott Ananian. ++ ++ -- Bill Allombert Thu, 2 Mar 2006 18:52:44 +0100 ++ ++libjpeg6b (6b-11) unstable; urgency=high ++ ++ * The "Silencio" release ++ * exifautotran: Apply patch by Uwe Zeisberger to fix bad temporary file ++ handling. closes: #340079 ++ ++ -- Bill Allombert Sun, 20 Nov 2005 20:57:07 +0100 ++ ++libjpeg6b (6b-10) unstable; urgency=low ++ ++ * The "timeout" release. ++ * Rebuild with current toolchain. ++ * Depends on libc-dev instead of libc6-dev. closes: #294696 ++ Thanks Joel Aelwyn for discussing thoroughly the matter. ++ * Instead of copying /usr/bin/libtool, we replace it by a script that ++ call libtool (using standard path search). Remarked by Jesus Climent. ++ * debian/control: remove pre-hamm cruft. ++ * Add jpegexiforient and jpegautotran by Guido Vollbeding ++ as proposed by Philip ++ Armstrong. closes: #257061. ++ * Run the test-suite at build time instead of shipping it in the package: ++ - /usr/share/doc/libjpeg-progs/tests: removed. ++ - debian/control: Add Build-Depends on sharutils for uuencode. ++ - debian/libjpeg-progs.dirs: removed. ++ - debian/libjpeg-progs.test: removed. ++ ++ -- Bill Allombert Tue, 1 Mar 2005 19:43:26 +0100 ++ ++libjpeg6b (6b-9) unstable; urgency=low ++ ++ * The "I'm all for aggressive goals" release. ++ * Rebuild with new libtool. closes: #201943. ++ * patch 100_crop: Updated from Guido Vollbeding ++ to include patches 203_jpegtran_errmsg,204_perfect. ++ * patch 200_crop_man: Include 205_perfect_man. ++ * patches 203_jpegtran_errmsg, 204_perfect, 205_perfect_man: removed ++ * Add patch 203_rdppm: fix cjpeg issue with 16-bit PPM files. closes: #208937 ++ * Bump standard version to 3.6.1. ++ * Update debian/edit-patch. ++ ++ -- Bill Allombert Mon, 8 Sep 2003 16:22:08 +0200 ++ ++libjpeg6b (6b-8) unstable; urgency=low ++ ++ * The "I *hate* when that happens" release. ++ * Move libjpeg62-dev to libdevel section. ++ * See debian/README.sources for detail about the (d)patch system. ++ * debian/rules: avoid to run configure twice. ++ * Add patches 204_perfect and 205_perfect_man. They implement the ++ -perfect jpegtran option as proposed by Mark W. Eichin. closes: #189027 ++ * Bump standard version to 3.5.10. ++ * Use /usr/bin/libtool instead of ldconfig-generated libtool, and remove ++ various libtool related kludges, including patch 301_configure. ++ closes: #195281. Thanks Robert Millan for the suggestion. ++ * Remove patch 302_makefile. Fix debian/rules instead. ++ ++ -- Bill Allombert Sat, 31 May 2003 16:16:59 +0200 ++ ++libjpeg6b (6b-7) unstable; urgency=low ++ ++ * Rebuild with new gcc/new glibc/new debhelper. ++ * Add -g to build options according to new policy. ++ * Add support for DEB_BUILD_OPTIONS noopt. nostrip is handled by dh_strip. ++ * Bump standard version to 3.5.9. ++ * Extend description a bit (If you have a better one please email me!). ++ * Use dpatch to handle the patches. ++ ++ -- Bill Allombert Sun, 16 Mar 2003 12:19:36 +0100 ++ ++libjpeg6b (6b-6) unstable; urgency=low ++ ++ * The "Try to break sarge before it even got a name" release ++ * jpegtran: better error messages when opening files. ++ closes: #147516 Thanks Mark W. Eichin. ++ * Add debian/patch dir with my patches. ++ * Add extern "C" if we are under C++. ++ closes: #113167 Thanks, Fredrik Jagenheim. ++ * Remove HAVE_STD{LIB,DEF}_H from jconfig.h since they are not used and ++ conflict with autoconf. closes: #109516 Thanks ++ * Add README.Debian in /usr/share/libjpeg62-dev ++ ++ -- Bill Allombert Mon, 3 Jun 2002 19:34:08 +0200 ++ ++libjpeg6b (6b-5) unstable; urgency=low ++ ++ * jpeg-->JPEG in libjpeg-progs description. ++ * Add lib path to dh_shlibdeps to avoid warning. ++ * Apply patch from by ++ closes: #129412 Thanks, Colin Marquardt. ++ ++ -- Bill Allombert Mon, 20 May 2002 11:55:22 +0200 ++ ++libjpeg6b (6b-4) unstable; urgency=low ++ ++ * Avoid bashism in debian/rules. ++ * Update libtool to 1.3.5. (1.4 will break). ++ closes: #52095 Thanks, ++ * Patch config.guess to use version in the autotools-dev package. ++ * Correct Section: field of libjpeg62 and libjpeg62-dev. ++ ++ -- Bill Allombert Tue, 20 Nov 2001 10:23:47 +0100 ++ ++libjpeg6b (6b-3) unstable; urgency=low ++ ++ * The "Where is ltconfig ?" release. ++ * Remove jconfig.h in debian/rules clean and do some clean up. ++ * Install libjpeg.la per Policy 11.2. ++ * Remove duplicate wizard.doc file in libjpeg62-dev. ++ * Use dpkg-architecture instead of config.guess. ++ * Patch config.sub to use version in the autotools-dev package. ++ closes: #85558, #120039 ++ * Patch rdjpgcom.c to use locales for isprint check on comment chars. ++ closes: #116589 Thanks, Neal H Walfield ++ * Apply patch from by ++ closes: #114415 Thanks, ++ ++ -- Bill Allombert Tue, 13 Nov 2001 21:41:49 +0000 ++ ++libjpeg6b (6b-2) unstable; urgency=low ++ ++ * New Maintainer. Mark, If you want back the package, just ask! ++ * Acknowledge previous NMU: ++ Jordi: closes: #74087, #24330, #24291 ++ Colin: closes: #80752 ++ Joel: closes: #25324, #27033, #28341 ++ * Write source location as a valid URL in debian/copyright. ++ closes: #118628 Thanks, Doug Porter . ++ * Fix formating of description of libjpeg-progs. ++ closes: #114378 Thanks, Colin Watson . ++ * Install jpegint.h header needed by some apps. closes: #100171 ++ * Remove unused/empty debian/postrm. ++ closes: #24849 Thanks, Adrian Bridgett . ++ * Install wizard.doc file. closes: #64807 Thanks . ++ * Fix libjpeg-progs test.sh. ++ * Fix lintian bugs: typo in copyright, emacs user info in changelog. ++ * Fix false lintian bug: unsafe ldconfig in postinst, by reformatting. ++ * Remove "-g" from CFLAGS per Policy 11.1, hoping m68k is fixed now. ++ * Remove libtool and Makefile in debian/rules clean. ++ * Fix the test system. As a side effect, ++ closes: #109195 Thanks Daniel Schepler ++ * Standards-Version is now 3.5.6. ++ ++ -- Bill Allombert Fri, 9 Nov 2001 22:40:16 +0100 ++ ++libjpeg6b (6b-1.3) frozen unstable; urgency=low ++ ++ * Non-Maintainer Upload. ++ * Added Build-Depends. ++ * Gil Bahat did the rest of the changes. ++ * Close bug regarding non-standard jpegs not being processed ++ (closes: #74087). ++ * The output gifs are uncompressed, so have no UNISYS patent issues. ++ (closes: #24330, #24291). ++ * Standards-Version is now 3.0.0. ++ ++ -- Jordi Mallach Sat, 24 Feb 2001 22:17:38 +0100 ++ ++libjpeg6b (6b-1.2) frozen unstable; urgency=low (HIGH for m68k) ++ ++ * Non-maintainer release. ++ * Recompile for m68k since existing djpeg binary claims all jpegs I have ++ are invalid (yet hamm djpeg has no problem with them). ++ Specifically, added "-O2 -g -Wall" to CFLAGS -- possible gcc bug? ++ ++ -- Chris Lawrence Tue, 10 Nov 1998 20:57:38 -0600 ++ ++libjpeg6b (6b-1.1) frozen unstable; urgency=high ++ ++ * Non-maintainer release. ++ * Use upstream library soname (62). ++ * Removed libjpeg-gif package, as the source notes ++ that the GIF reading has been removed, and the GIFs written ++ do not infringe on the LZW patent. ++ ++ -- Joel Klecker Thu, 22 Oct 1998 05:49:48 -0700 ++ ++libjpeg6b (6b-1) unstable; urgency=low ++ ++ * New binary packages for 6b ++ * New upstream release ++ ++ -- Mark Mickan Tue, 7 Jul 1998 22:27:10 +0930 ++ ++Local variables: ++mode: debian-changelog ++End: +--- libjpeg7-7.orig/debian/libjpeg-progs.files ++++ libjpeg7-7/debian/libjpeg-progs.files +@@ -0,0 +1,2 @@ ++usr/bin ++usr/share/man/man1 +--- libjpeg7-7.orig/debian/libjpeg7-dev.docs ++++ libjpeg7-7/debian/libjpeg7-dev.docs +@@ -0,0 +1,3 @@ ++libjpeg.txt ++structure.txt ++coderules.txt +--- libjpeg7-7.orig/debian/libjpeg-progs.docs ++++ libjpeg7-7/debian/libjpeg-progs.docs +@@ -0,0 +1,2 @@ ++usage.txt ++wizard.txt +--- libjpeg7-7.orig/debian/copyright ++++ libjpeg7-7/debian/copyright +@@ -0,0 +1,96 @@ ++This is Debian's prepackaged version of the `jpeg library' by the Independent ++JPEG Group. ++ ++This package was created by Mark Mickan from sources ++which can be found at ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz ++ ++It is partly based on the libjpeg6a package originally put together by ++Andy Guy and later maintained by Mark Mickan. ++ ++Current Debian maintainer is Bill Allombert . ++ ++LEGAL ISSUES [ from README supplied with source - MM ] ++============ ++ ++In plain English: ++ ++1. We don't promise that this software works. (But if you find any bugs, ++ please let us know!) ++2. You can use this software for whatever you want. You don't have to pay us. ++3. You may not pretend that you wrote this software. If you use it in a ++ program, you must acknowledge somewhere in your documentation that ++ you've used the IJG code. ++ ++In legalese: ++ ++The authors make NO WARRANTY or representation, either express or implied, ++with respect to this software, its quality, accuracy, merchantability, or ++fitness for a particular purpose. This software is provided "AS IS", and you, ++its user, assume the entire risk as to its quality and accuracy. ++ ++This software is copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding. ++All Rights Reserved except as specified below. ++ ++Permission is hereby granted to use, copy, modify, and distribute this ++software (or portions thereof) for any purpose, without fee, subject to these ++conditions: ++(1) If any part of the source code for this software is distributed, then this ++README file must be included, with this copyright and no-warranty notice ++unaltered; and any additions, deletions, or changes to the original files ++must be clearly indicated in accompanying documentation. ++(2) If only executable code is distributed, then the accompanying ++documentation must state that "this software is based in part on the work of ++the Independent JPEG Group". ++(3) Permission for use of this software is granted only if the user accepts ++full responsibility for any undesirable consequences; the authors accept ++NO LIABILITY for damages of any kind. ++ ++These conditions apply to any software derived from or based on the IJG code, ++not just to the unmodified library. If you use our work, you ought to ++acknowledge us. ++ ++Permission is NOT granted for the use of any IJG author's name or company name ++in advertising or publicity relating to this software or products derived from ++it. This software may be referred to only as "the Independent JPEG Group's ++software". ++ ++We specifically permit and encourage the use of this software as the basis of ++commercial products, provided that all warranty or liability claims are ++assumed by the product vendor. ++ ++ ++ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, ++sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. ++ansi2knr.c is NOT covered by the above copyright and conditions, but instead ++by the usual distribution terms of the Free Software Foundation; principally, ++that you must include source code if you redistribute it. (See the file ++ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part ++of any program generated from the IJG code, this does not limit you more than ++the foregoing paragraphs do. ++ ++The Unix configuration script "configure" was produced with GNU Autoconf. ++It is copyright by the Free Software Foundation but is freely distributable. ++The same holds for its supporting scripts (config.guess, config.sub, ++ltconfig, ltmain.sh). Another support script, install-sh, is copyright ++by M.I.T. but is also freely distributable. ++ ++It appears that the arithmetic coding option of the JPEG spec is covered by ++patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot ++legally be used without obtaining one or more licenses. For this reason, ++support for arithmetic coding has been removed from the free JPEG software. ++(Since arithmetic coding provides only a marginal gain over the unpatented ++Huffman mode, it is unlikely that very many implementations will support it.) ++So far as we are aware, there are no patent restrictions on the remaining ++code. ++ ++The IJG distribution formerly included code to read and write GIF files. ++To avoid entanglement with the Unisys LZW patent, GIF reading support has ++been removed altogether, and the GIF writer has been simplified to produce ++"uncompressed GIFs". This technique does not use the LZW algorithm; the ++resulting GIF files are larger than usual, but are readable by all standard ++GIF decoders. ++ ++We are required to state that ++ "The Graphics Interchange Format(c) is the Copyright property of ++ CompuServe Incorporated. GIF(sm) is a Service Mark property of ++ CompuServe Incorporated." +--- libjpeg7-7.orig/debian/extra/jpegexiforient.c ++++ libjpeg7-7/debian/extra/jpegexiforient.c +@@ -0,0 +1,299 @@ ++/* ++ * jpegexiforient.c ++ * ++ * This is a utility program to get and set the Exif Orientation Tag. ++ * It can be used together with jpegtran in scripts for automatic ++ * orientation correction of digital camera pictures. ++ * ++ * The Exif orientation value gives the orientation of the camera ++ * relative to the scene when the image was captured. The relation ++ * of the '0th row' and '0th column' to visual position is shown as ++ * below. ++ * ++ * Value | 0th Row | 0th Column ++ * ------+-------------+----------- ++ * 1 | top | left side ++ * 2 | top | rigth side ++ * 3 | bottom | rigth side ++ * 4 | bottom | left side ++ * 5 | left side | top ++ * 6 | right side | top ++ * 7 | right side | bottom ++ * 8 | left side | bottom ++ * ++ * For convenience, here is what the letter F would look like if it were ++ * tagged correctly and displayed by a program that ignores the orientation ++ * tag: ++ * ++ * 1 2 3 4 5 6 7 8 ++ * ++ * 888888 888888 88 88 8888888888 88 88 8888888888 ++ * 88 88 88 88 88 88 88 88 88 88 88 88 ++ * 8888 8888 8888 8888 88 8888888888 8888888888 88 ++ * 88 88 88 88 ++ * 88 88 888888 888888 ++ * ++ */ ++ ++#include ++#include ++ ++static FILE * myfile; /* My JPEG file */ ++ ++static unsigned char exif_data[65536L]; ++ ++/* Return next input byte, or EOF if no more */ ++#define NEXTBYTE() getc(myfile) ++ ++/* Error exit handler */ ++#define ERREXIT(msg) (exit(0)) ++ ++/* Read one byte, testing for EOF */ ++static int ++read_1_byte (void) ++{ ++ int c; ++ ++ c = NEXTBYTE(); ++ if (c == EOF) ++ ERREXIT("Premature EOF in JPEG file"); ++ return c; ++} ++ ++/* Read 2 bytes, convert to unsigned int */ ++/* All 2-byte quantities in JPEG markers are MSB first */ ++static unsigned int ++read_2_bytes (void) ++{ ++ int c1, c2; ++ ++ c1 = NEXTBYTE(); ++ if (c1 == EOF) ++ ERREXIT("Premature EOF in JPEG file"); ++ c2 = NEXTBYTE(); ++ if (c2 == EOF) ++ ERREXIT("Premature EOF in JPEG file"); ++ return (((unsigned int) c1) << 8) + ((unsigned int) c2); ++} ++ ++static const char * progname; /* program name for error messages */ ++ ++static void ++usage (FILE *out) ++/* complain about bad command line */ ++{ ++ fprintf(out, "jpegexiforient reads or writes the Exif Orientation Tag "); ++ fprintf(out, "in a JPEG Exif file.\n"); ++ ++ fprintf(out, "Usage: %s [switches] jpegfile\n", progname); ++ ++ fprintf(out, "Switches:\n"); ++ fprintf(out, " --help display this help and exit\n"); ++ fprintf(out, " --version output version information and exit\n"); ++ fprintf(out, " -n Do not output the trailing newline\n"); ++ fprintf(out, " -1 .. -8 Set orientation value 1 .. 8\n"); ++} ++ ++/* ++ * The main program. ++ */ ++ ++int ++main (int argc, char **argv) ++{ ++ int n_flag, set_flag; ++ unsigned int length, i; ++ int is_motorola; /* Flag for byte order */ ++ unsigned int offset, number_of_tags, tagnum; ++ ++ progname = argv[0]; ++ if (progname == NULL || progname[0] == 0) ++ progname = "jpegexiforient"; /* in case C library doesn't provide it */ ++ ++ if (argc < 2) { usage(stderr); return 1; } ++ ++ n_flag = 0; set_flag = 0; ++ ++ i = 1; ++ while (argv[i][0] == '-') { ++ switch (argv[i][1]) { ++ case '-': ++ switch (argv[i][2]) { ++ case 'h': usage(stdout); return 0; ++ case 'v': fprintf(stdout,"jpegexiforient\n"); return 0; ++ } ++ case 'n': ++ n_flag = 1; ++ break; ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ set_flag = argv[i][1] - '0'; ++ break; ++ default: ++ usage(stderr); return 1; ++ } ++ if (++i >= argc) { usage(stderr); return 1; } ++ } ++ ++ if (set_flag) { ++ if ((myfile = fopen(argv[i], "rb+")) == NULL) { ++ fprintf(stderr, "%s: can't open %s\n", progname, argv[i]); ++ return 0; ++ } ++ } else { ++ if ((myfile = fopen(argv[i], "rb")) == NULL) { ++ fprintf(stderr, "%s: can't open %s\n", progname, argv[i]); ++ return 0; ++ } ++ } ++ ++ /* Read File head, check for JPEG SOI + Exif APP1 */ ++ for (i = 0; i < 4; i++) ++ exif_data[i] = (unsigned char) read_1_byte(); ++ if (exif_data[0] != 0xFF || ++ exif_data[1] != 0xD8 || ++ exif_data[2] != 0xFF || ++ exif_data[3] != 0xE1) ++ return 0; ++ ++ /* Get the marker parameter length count */ ++ length = read_2_bytes(); ++ /* Length includes itself, so must be at least 2 */ ++ /* Following Exif data length must be at least 6 */ ++ if (length < 8) ++ return 0; ++ length -= 8; ++ /* Read Exif head, check for "Exif" */ ++ for (i = 0; i < 6; i++) ++ exif_data[i] = (unsigned char) read_1_byte(); ++ if (exif_data[0] != 0x45 || ++ exif_data[1] != 0x78 || ++ exif_data[2] != 0x69 || ++ exif_data[3] != 0x66 || ++ exif_data[4] != 0 || ++ exif_data[5] != 0) ++ return 0; ++ /* Read Exif body */ ++ for (i = 0; i < length; i++) ++ exif_data[i] = (unsigned char) read_1_byte(); ++ ++ if (length < 12) return 0; /* Length of an IFD entry */ ++ ++ /* Discover byte order */ ++ if (exif_data[0] == 0x49 && exif_data[1] == 0x49) ++ is_motorola = 0; ++ else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D) ++ is_motorola = 1; ++ else ++ return 0; ++ ++ /* Check Tag Mark */ ++ if (is_motorola) { ++ if (exif_data[2] != 0) return 0; ++ if (exif_data[3] != 0x2A) return 0; ++ } else { ++ if (exif_data[3] != 0) return 0; ++ if (exif_data[2] != 0x2A) return 0; ++ } ++ ++ /* Get first IFD offset (offset to IFD0) */ ++ if (is_motorola) { ++ if (exif_data[4] != 0) return 0; ++ if (exif_data[5] != 0) return 0; ++ offset = exif_data[6]; ++ offset <<= 8; ++ offset += exif_data[7]; ++ } else { ++ if (exif_data[7] != 0) return 0; ++ if (exif_data[6] != 0) return 0; ++ offset = exif_data[5]; ++ offset <<= 8; ++ offset += exif_data[4]; ++ } ++ if (offset > length - 2) return 0; /* check end of data segment */ ++ ++ /* Get the number of directory entries contained in this IFD */ ++ if (is_motorola) { ++ number_of_tags = exif_data[offset]; ++ number_of_tags <<= 8; ++ number_of_tags += exif_data[offset+1]; ++ } else { ++ number_of_tags = exif_data[offset+1]; ++ number_of_tags <<= 8; ++ number_of_tags += exif_data[offset]; ++ } ++ if (number_of_tags == 0) return 0; ++ offset += 2; ++ ++ /* Search for Orientation Tag in IFD0 */ ++ for (;;) { ++ if (offset > length - 12) return 0; /* check end of data segment */ ++ /* Get Tag number */ ++ if (is_motorola) { ++ tagnum = exif_data[offset]; ++ tagnum <<= 8; ++ tagnum += exif_data[offset+1]; ++ } else { ++ tagnum = exif_data[offset+1]; ++ tagnum <<= 8; ++ tagnum += exif_data[offset]; ++ } ++ if (tagnum == 0x0112) break; /* found Orientation Tag */ ++ if (--number_of_tags == 0) return 0; ++ offset += 12; ++ } ++ ++ if (set_flag) { ++ /* Set the Orientation value */ ++ if (is_motorola) { ++ exif_data[offset+2] = 0; /* Format = unsigned short (2 octets) */ ++ exif_data[offset+3] = 3; ++ exif_data[offset+4] = 0; /* Number Of Components = 1 */ ++ exif_data[offset+5] = 0; ++ exif_data[offset+6] = 0; ++ exif_data[offset+7] = 1; ++ exif_data[offset+8] = 0; ++ exif_data[offset+9] = (unsigned char)set_flag; ++ exif_data[offset+10] = 0; ++ exif_data[offset+11] = 0; ++ } else { ++ exif_data[offset+2] = 3; /* Format = unsigned short (2 octets) */ ++ exif_data[offset+3] = 0; ++ exif_data[offset+4] = 1; /* Number Of Components = 1 */ ++ exif_data[offset+5] = 0; ++ exif_data[offset+6] = 0; ++ exif_data[offset+7] = 0; ++ exif_data[offset+8] = (unsigned char)set_flag; ++ exif_data[offset+9] = 0; ++ exif_data[offset+10] = 0; ++ exif_data[offset+11] = 0; ++ } ++ fseek(myfile, (4 + 2 + 6 + 2) + offset, SEEK_SET); ++ fwrite(exif_data + 2 + offset, 1, 10, myfile); ++ } else { ++ /* Get the Orientation value */ ++ if (is_motorola) { ++ if (exif_data[offset+8] != 0) return 0; ++ set_flag = exif_data[offset+9]; ++ } else { ++ if (exif_data[offset+9] != 0) return 0; ++ set_flag = exif_data[offset+8]; ++ } ++ if (set_flag > 8) return 0; ++ } ++ ++ /* Write out Orientation value */ ++ if (n_flag) ++ printf("%c", '0' + set_flag); ++ else ++ printf("%c\n", '0' + set_flag); ++ ++ /* All done. */ ++ return 0; ++} +--- libjpeg7-7.orig/debian/extra/exifautotran.1 ++++ libjpeg7-7/debian/extra/exifautotran.1 +@@ -0,0 +1,13 @@ ++.TH EXIFAUTOTRAN "1" "February 2005" "exifautotran" "User Commands" ++.SH NAME ++exifautotran \- Transforms Exif files so that Orientation becomes 1 ++.SH DESCRIPTION ++exifautotran [list of files] ++.PP ++Take a list of files as input and transform them in place so that the ++Orientation becomes 1. ++.SH "AUTHOR" ++ Guido Vollbeding ++.SH "SEE ALSO" ++.BR jpegtran(1) ++.BR jpegexiforient(1) +--- libjpeg7-7.orig/debian/extra/jpegexiforient.1 ++++ libjpeg7-7/debian/extra/jpegexiforient.1 +@@ -0,0 +1,73 @@ ++.TH JPEGEXIFORIENT "1" "February 2005" "jpegexiforient" "User Commands" ++.SH NAME ++jpegexiforient \- reads or writes the Exif Orientation Tag ++.SH SYNOPSIS ++.B jpegexiforient ++[\fIswitches\fR] \fIjpegfile\fR ++.SH DESCRIPTION ++. ++This is a utility program to get and set the Exif Orientation Tag. ++It can be used together with jpegtran in scripts for automatic ++orientation correction of digital camera pictures. ++.PP ++The Exif orientation value gives the orientation of the camera ++relative to the scene when the image was captured. The relation ++of the '0th row' and '0th column' to visual position is shown as ++below. ++.IP ++.nf ++.ft CR ++Value | 0th Row | 0th Column ++------+-------------+----------- ++ 1 | top | left side ++ 2 | top | rigth side ++ 3 | bottom | rigth side ++ 4 | bottom | left side ++ 5 | left side | top ++ 6 | right side | top ++ 7 | right side | bottom ++ 8 | left side | bottom ++.fi ++.PP ++For convenience, here is what the letter F would look like if it were ++tagged correctly and displayed by a program that ignores the orientation ++tag: ++.IP ++.nf ++.ft CB ++ 1 2 3 4 ++ ++888888 888888 88 88 ++88 88 88 88 ++8888 8888 8888 8888 ++88 88 88 88 ++88 88 888888 888888 ++ ++ 5 6 7 8 ++ ++8888888888 88 88 8888888888 ++88 88 88 88 88 88 88 88 ++88 8888888888 8888888888 88 ++.fi ++.PP ++jpegexiforient output the Exif Orientation Tag in a JPEG Exif file. ++With the options -1 .. -8, it can also be used to set the tag. ++. ++.SS "OPTIONS" ++.TP ++\fB\-\-help\fR ++display this help and exit ++.TP ++\fB\-\-version\fR ++output version information and exit ++.TP ++\fB\-n\fR ++Do not output the trailing newline ++.TP ++\fB\-1\fR .. \fB\-8\fR ++Set orientation value 1 .. 8 ++.SH "AUTHOR" ++ Guido Vollbeding ++.SH "SEE ALSO" ++.BR jpegtran(1) ++.BR exifautotran(1) +--- libjpeg7-7.orig/debian/extra/exifautotran ++++ libjpeg7-7/debian/extra/exifautotran +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# exifautotran [list of files] ++# ++# Transforms Exif files so that Orientation becomes 1 ++# ++ ++trap "if test -n \"\$tempfile\"; then rm -f \"\$tempfile\"; fi" INT QUIT TERM ++ ++for i ++do ++ case $i in ++ -v|--version) echo "exifautotran"; exit 0;; ++ -h|--help) ++ cat <&2 ++ exit 1; ++ fi ++ echo Executing: jpegtran -copy all $transform $i >&2 ++ jpegtran -copy all $transform "$i" > $tempfile ++ if test $? -ne 0; then ++ echo Error while transforming $i - skipped. >&2 ++ rm "$tempfile" ++ else ++ cp "$tempfile" "$i" ++ rm "$tempfile" ++ jpegexiforient -1 "$i" > /dev/null ++ fi ++ fi ++done +--- libjpeg7-7.orig/debian/extra/Makefile ++++ libjpeg7-7/debian/extra/Makefile +@@ -0,0 +1,22 @@ ++CFLAGS = -O2 -Wall -g ++CC = cc ++INSTALL = install -m755 -o root -g root ++INSTALLDIR = install -m755 -o root -g root -d ++DESTDIR = ++prefix = /usr/local ++bindir = $(prefix)/bin ++mandir = $(prefix)/share/man/man1 ++ ++all: jpegexiforient ++ ++jpegexiforient: jpegexiforient.c ++ $(CC) $(CFLAGS) -o jpegexiforient jpegexiforient.c ++clean: ++ -rm -f jpegexiforient ++install: ++ $(INSTALLDIR) $(DESTDIR)$(bindir) ++ $(INSTALLDIR) $(DESTDIR)$(mandir) ++ $(INSTALL) jpegexiforient $(DESTDIR)$(bindir) ++ $(INSTALL) jpegexiforient.1 $(DESTDIR)$(mandir) ++ $(INSTALL) exifautotran $(DESTDIR)$(bindir) ++ $(INSTALL) exifautotran.1 $(DESTDIR)$(mandir) diff --git a/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch b/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch new file mode 100644 index 0000000000..3a970ea477 --- /dev/null +++ b/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch @@ -0,0 +1,44 @@ +Upstream-Status: Pending + +The support for automatic de-ANSI-fication has been deprecated in +automake 1.11.2, and will be removed altogether in automake 1.12 + +This avoids this error: +| configure.ac:24: automatic de-ANSI-fication support is deprecated +| autoreconf: automake failed with exit status: 1 +| ERROR: autoreconf execution failed. +NOTE: package jpeg-native-8c-r2: task do_configure: Failed + +Signed-Off-By: Nitin A Kamble +2011/12/28 + + +Index: jpeg-8d/configure.ac +=================================================================== +--- jpeg-8d.orig/configure.ac ++++ jpeg-8d/configure.ac +@@ -21,7 +21,7 @@ AC_CANONICAL_TARGET + + # Initialize Automake + # Don't require all the GNU mandated files +-AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign]) ++AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete no-dist foreign]) + + # Make --enable-silent-rules the default. + # To get verbose build output you may configure +@@ -29,7 +29,14 @@ AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obs + AM_SILENT_RULES([yes]) + + # This is required when using the de-ANSI-fication feature. +-AM_C_PROTOTYPES ++#AM_C_PROTOTYPES ++# add following to avoid this error: ++#| automake: warnings are treated as errors ++#| /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libjpeg.la': linking libtool libraries using a non-POSIX ++#| /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac' ++#| Makefile.am:65: while processing Libtool library 'libjpeg.la' ++#| autoreconf: automake failed with exit status: 1 ++AM_PROG_AR + + # Add configure option --enable-maintainer-mode which enables + # dependency checking and generation useful to package maintainers. diff --git a/meta/recipes-core/jpeg/jpeg_8d.bb b/meta/recipes-core/jpeg/jpeg_8d.bb new file mode 100644 index 0000000000..da23302149 --- /dev/null +++ b/meta/recipes-core/jpeg/jpeg_8d.bb @@ -0,0 +1,51 @@ +SUMMARY = "libjpeg is a library for handling the JPEG (JFIF) image format" +DESCRIPTION = "libjpeg contains a library for handling the JPEG (JFIF) image format, as well as related programs for accessing the libjpeg functions." +HOMEPAGE = "http://www.ijg.org/" + +LICENSE ="BSD-3-Clause" +LIC_FILES_CHKSUM = "file://README;md5=4f46756b064c225fae088903300e5c98" + +SECTION = "libs" + +DEPENDS = "libtool-cross" +DEPENDS_class-native = "libtool-native" + +PR = "r1" + +SRC_URI = "http://www.ijg.org/files/jpegsrc.v${PV}.tar.gz \ + file://debian-libjpeg7_7-1.diff \ + file://fix_for_automake_1.12.1.patch" + +SRC_URI[md5sum] = "52654eb3b2e60c35731ea8fc87f1bd29" +SRC_URI[sha256sum] = "00029b1473f0f0ea72fbca3230e8cb25797fbb27e58ae2e46bb8bf5a806fe0b3" + +inherit autotools + +EXTRA_OECONF="--enable-static --enable-shared" +EXTRA_OEMAKE='"LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"' + +CFLAGS_append = " -D_REENTRANT" + +do_configure_prepend () { + rm -f ${S}/ltconfig + rm -f ${S}/ltmain.sh +} + +do_install() { + install -d ${D}${bindir} ${D}${includedir} \ + ${D}${mandir}/man1 ${D}${libdir} + oe_runmake 'DESTDIR=${D}' install +} + +PACKAGES =+ "jpeg-tools " +DESCRIPTION_jpeg-tools = "The jpeg-tools package includes the client programs for access libjpeg functionality. These tools allow for the compression, decompression, transformation and display of JPEG files." +FILES_jpeg-tools = "${bindir}/*" + +BBCLASSEXTEND = "native" + +pkg_postinst_${PN}_linuxstdbase () { + if [ ! -e $D${libdir}/libjpeg.so.62 ]; then + JPEG=`find $D${libdir} -type f -name libjpeg.so.\*.\*.\*` + ln -sf `basename $JPEG` $D${libdir}/libjpeg.so.62 + fi +} diff --git a/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch new file mode 100644 index 0000000000..be7f324acc --- /dev/null +++ b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch @@ -0,0 +1,36 @@ +In file included from keymap.h:5:0, + from ksyms.c:6: +./keymap/common.h:65:38: error: unknown type name 'va_list' + const char *format, va_list args), + ^ +./keymap/common.h:66:3: error: expected ';', ',' or ')' before 'const' + const void *data); + ^ + +Upstream-Status: Pending +Signed-off-by: Khem Raj +Index: kbd-2.0.0/src/libkeymap/contextP.h +=================================================================== +--- kbd-2.0.0.orig/src/libkeymap/contextP.h 2013-08-13 06:46:23.000000000 -0700 ++++ kbd-2.0.0/src/libkeymap/contextP.h 2013-11-05 22:33:49.200528226 -0800 +@@ -2,7 +2,7 @@ + #define LK_CONTEXTP_H + + #include "keymap.h" +- ++#include + /** + * @brief Copy of struct kbdiacruc. + */ +Index: kbd-2.0.0/src/libkeymap/keymap/common.h +=================================================================== +--- kbd-2.0.0.orig/src/libkeymap/keymap/common.h 2013-08-13 06:46:23.000000000 -0700 ++++ kbd-2.0.0/src/libkeymap/keymap/common.h 2013-11-05 22:33:59.964528438 -0800 +@@ -6,6 +6,7 @@ + */ + + #include ++#include + + /** Initializes the structures necessary to read and/or parse keymap. + * diff --git a/meta/recipes-core/kbd/kbd_2.0.1.bb b/meta/recipes-core/kbd/kbd_2.0.1.bb new file mode 100644 index 0000000000..998a2d39b2 --- /dev/null +++ b/meta/recipes-core/kbd/kbd_2.0.1.bb @@ -0,0 +1,35 @@ +SUMMARY = "Keytable files and keyboard utilities" +# everything minus console-fonts is GPLv2+ +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5" +DEPENDS = "libcheck" + +inherit autotools gettext ptest + +RREPLACES_${PN} = "console-tools" +RPROVIDES_${PN} = "console-tools" +RCONFLICTS_${PN} = "console-tools" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.bz2 \ + file://uclibc-stdarg.patch \ + " + +SRC_URI[md5sum] = "f80b93a6abddb6cc2a3652daaf7562ba" +SRC_URI[sha256sum] = "223d60bb6882323cca161aeb5965590768b2f590fd7cddbf27511ad0ba7a429e" + +PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" +PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam," + +PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans" + +FILES_${PN}-consolefonts = "${datadir}/consolefonts" +FILES_${PN}-consoletrans = "${datadir}/consoletrans" +FILES_${PN}-keymaps = "${datadir}/keymaps" +FILES_${PN}-unimaps = "${datadir}/unimaps" + +inherit update-alternatives + +ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt" +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/meta/recipes-core/libcgroup/libcgroup_0.41.bb new file mode 100644 index 0000000000..76b0b585fb --- /dev/null +++ b/meta/recipes-core/libcgroup/libcgroup_0.41.bb @@ -0,0 +1,41 @@ +SUMMARY = "Linux control group abstraction library" +DESCRIPTION = "libcgroup is a library that abstracts the control group file system \ +in Linux. Control groups allow you to limit, account and isolate resource usage \ +(CPU, memory, disk I/O, etc.) of groups of processes." +SECTION = "libs" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1" + +inherit autotools pkgconfig + +DEPENDS = "bison-native flex-native ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2" + +SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f" +SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51" + +EXTRA_OECONF = "${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}" + +# http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg21444.html +PARALLEL_MAKE = "" + +PACKAGES =+ "cgroups-pam-plugin" +FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*" +FILES_${PN}-dbg += "${base_libdir}/security/.debug" +FILES_${PN}-dev += "${base_libdir}/security/*.la" + +do_install_append() { + # Moving libcgroup to base_libdir + if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then + mkdir -p ${D}/${base_libdir}/ + mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/ + rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'` + ln -sf ${rel_lib_prefix}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so + fi + # pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks. + if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then + mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so + rm -f ${D}${base_libdir}/security/pam_cgroup.so.* + fi +} diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc new file mode 100644 index 0000000000..60bb6b8539 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2.inc @@ -0,0 +1,61 @@ +SUMMARY = "XML C Parser Library and Toolkit" +DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat." +HOMEPAGE = "http://www.xmlsoft.org/" +BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2" +SECTION = "libs" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \ + file://hash.c;beginline=6;endline=15;md5=96f7296605eae807670fb08947829969 \ + file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \ + file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e" + +DEPENDS_class-nativesdk = "nativesdk-python" +DEPENDS_class-native = "python-native" +DEPENDS =+ "zlib" + +SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \ + file://libxml-64bit.patch \ + file://ansidecl.patch \ + file://runtest.patch \ + file://run-ptest \ + file://libxml2-CVE-2014-0191-fix.patch \ + " + +inherit autotools pkgconfig binconfig pythonnative ptest + +RDEPENDS_${PN}-ptest_append_libc-glibc += "eglibc-gconv-ebcdic-us eglibc-gconv-ibm1141" + +# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header +do_configure_prepend () { + sed -i -e '/.*ansidecl.h.*/d' ${S}/configure.in +} + +EXTRA_OECONF = "--without-python --without-debug --without-legacy --without-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" +EXTRA_OECONF_class-native = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma" +EXTRA_OECONF_class-nativesdk = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma" +EXTRA_OECONF_linuxstdbase = "--without-python --with-debug --with-legacy --with-catalog --with-docbook --with-c14n --without-lzma" + +# required for pythong binding +export HOST_SYS +export BUILD_SYS +export STAGING_LIBDIR +export STAGING_INCDIR + +export LDFLAGS += "-ldl" + +python populate_packages_prepend () { + # autonamer would call this libxml2-2, but we don't want that + if d.getVar('DEBIAN_NAMES', True): + d.setVar('PKG_libxml2', '${MLPREFIX}libxml2') +} + +PACKAGES += "${PN}-utils" + +FILES_${PN}-dev += "${libdir}/xml2Conf.sh" +FILES_${PN}-utils += "${bindir}/*" + +do_install_ptest () { + cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH} +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/libxml/libxml2/ansidecl.patch b/meta/recipes-core/libxml/libxml2/ansidecl.patch new file mode 100644 index 0000000000..2452d780d5 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/ansidecl.patch @@ -0,0 +1,25 @@ +Sadly cmake is broken. If it sees this reference and ansidecl is present, it will add a +dependency upon it, even if HAVE_ANSIDEC_H is never set. + +The easiest solution is to remove these lines, otherwise recipes like libzypp can have a +dependency on the ansidecl.h header via cmake. This can lead to odd results if the +header is removed (clean binutils) and then the code is recompiled. + +RP 2012/7/10 + +Upstream-Status: Inappropriate [its really a cmake bug] + +Index: libxml2-2.8.0/include/libxml/xmlversion.h.in +=================================================================== +--- libxml2-2.8.0.orig/include/libxml/xmlversion.h.in 2012-07-10 11:51:52.460750573 +0000 ++++ libxml2-2.8.0/include/libxml/xmlversion.h.in 2012-07-10 11:52:41.436749397 +0000 +@@ -401,9 +401,6 @@ + #endif + + #ifdef __GNUC__ +-#ifdef HAVE_ANSIDECL_H +-#include +-#endif + + /** + * ATTRIBUTE_UNUSED: diff --git a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch new file mode 100644 index 0000000000..1147017b61 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch @@ -0,0 +1,22 @@ +Upstream-Status: Backport [from debian: bugs.debian.org/439843] + +--- + libxml.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- libxml2-2.6.29.orig/libxml.h ++++ libxml2-2.6.29/libxml.h +@@ -11,10 +11,13 @@ + + #ifndef NO_LARGEFILE_SOURCE + #ifndef _LARGEFILE_SOURCE + #define _LARGEFILE_SOURCE + #endif ++#ifndef _LARGEFILE64_SOURCE ++#define _LARGEFILE64_SOURCE ++#endif + #ifndef _FILE_OFFSET_BITS + #define _FILE_OFFSET_BITS 64 + #endif + #endif + diff --git a/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch new file mode 100644 index 0000000000..1c05ae649e --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch @@ -0,0 +1,37 @@ +From: Daniel Veillard +Date: Tue, 22 Apr 2014 15:30:56 +0800 +Subject: Do not fetch external parameter entities + +Unless explicitely asked for when validating or replacing entities +with their value. Problem pointed out by Daniel Berrange + +Upstream-Status: Backport +Reference: https://access.redhat.com/security/cve/CVE-2014-0191 + +Signed-off-by: Daniel Veillard +Signed-off-by: Maxin B. John +--- +diff -Naur libxml2-2.9.1-orig/parser.c libxml2-2.9.1/parser.c +--- libxml2-2.9.1-orig/parser.c 2013-04-16 15:39:18.000000000 +0200 ++++ libxml2-2.9.1/parser.c 2014-05-07 13:35:46.883687946 +0200 +@@ -2595,6 +2595,20 @@ + xmlCharEncoding enc; + + /* ++ * Note: external parsed entities will not be loaded, it is ++ * not required for a non-validating parser, unless the ++ * option of validating, or substituting entities were ++ * given. Doing so is far more secure as the parser will ++ * only process data coming from the document entity by ++ * default. ++ */ ++ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && ++ ((ctxt->options & XML_PARSE_NOENT) == 0) && ++ ((ctxt->options & XML_PARSE_DTDVALID) == 0) && ++ (ctxt->validate == 0)) ++ return; ++ ++ /* + * handle the extra spaces added before and after + * c.f. http://www.w3.org/TR/REC-xml#as-PE + * this is done independently. diff --git a/meta/recipes-core/libxml/libxml2/run-ptest b/meta/recipes-core/libxml/libxml2/run-ptest new file mode 100644 index 0000000000..473d0b67a7 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -k runtests diff --git a/meta/recipes-core/libxml/libxml2/runtest.patch b/meta/recipes-core/libxml/libxml2/runtest.patch new file mode 100644 index 0000000000..397ab20c30 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/runtest.patch @@ -0,0 +1,820 @@ +Add 'install-ptest' rule. +Print a standard result line for each test. + +Signed-off-by: Mihaela Sendrea +Upstream-Status: Pending + +diff -uNr a/Makefile.am b/Makefile.am +--- a/Makefile.am 2013-04-17 14:51:42.633386477 +0200 ++++ b/Makefile.am 2013-04-19 14:47:51.544720568 +0200 +@@ -202,10 +202,19 @@ + #testOOM_DEPENDENCIES = $(DEPS) + #testOOM_LDADD= $(LDADDS) + ++install-ptest: ++ @(if [ -d .libs ] ; then cd .libs; fi; \ ++ install $(noinst_PROGRAMS) $(DESTDIR)) ++ cp -r $(srcdir)/test $(DESTDIR) ++ cp -r $(srcdir)/result $(DESTDIR) ++ cp -r $(srcdir)/python $(DESTDIR) ++ cp Makefile $(DESTDIR) ++ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile ++ + runtests: + [ -d test ] || $(LN_S) $(srcdir)/test . + [ -d result ] || $(LN_S) $(srcdir)/result . +- $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) ++ ./runtest$(EXEEXT) ; ./testrecurse$(EXEEXT) ; ./testapi$(EXEEXT) ; ./testchar$(EXEEXT) ; ./testdict$(EXEEXT) ; ./runxmlconf$(EXEEXT) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + +diff -uNr a/runsuite.c b/runsuite.c +--- a/runsuite.c 2013-04-12 16:17:11.462823238 +0200 ++++ b/runsuite.c 2013-04-17 14:07:24.352693211 +0200 +@@ -1162,6 +1162,7 @@ + + if (logfile != NULL) + fclose(logfile); ++ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } + #else /* !SCHEMAS */ +diff -uNr a/runtest.c b/runtest.c +--- a/runtest.c 2013-04-16 13:19:15.087997290 +0200 ++++ b/runtest.c 2013-04-17 14:08:29.529949655 +0200 +@@ -4386,6 +4386,7 @@ + err++; + } + } ++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc); + return(err); + } + +@@ -4455,6 +4456,7 @@ + xmlCleanupParser(); + xmlMemoryDump(); + ++ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } + +diff -uNr a/runxmlconf.c b/runxmlconf.c +--- a/runxmlconf.c 2013-04-16 12:53:49.900982990 +0200 ++++ b/runxmlconf.c 2013-04-17 14:09:21.111778104 +0200 +@@ -595,6 +595,7 @@ + + if (logfile != NULL) + fclose(logfile); ++ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } + +diff -uNr a/testapi.c b/testapi.c +--- a/testapi.c 2013-04-12 16:16:57.763417659 +0200 ++++ b/testapi.c 2013-04-17 14:10:28.876924881 +0200 +@@ -1245,49 +1245,91 @@ + testlibxml2(void) + { + int test_ret = 0; ++ int ret = 0; + +- test_ret += test_HTMLparser(); +- test_ret += test_HTMLtree(); +- test_ret += test_SAX2(); +- test_ret += test_c14n(); +- test_ret += test_catalog(); +- test_ret += test_chvalid(); +- test_ret += test_debugXML(); +- test_ret += test_dict(); +- test_ret += test_encoding(); +- test_ret += test_entities(); +- test_ret += test_hash(); +- test_ret += test_list(); +- test_ret += test_nanoftp(); +- test_ret += test_nanohttp(); +- test_ret += test_parser(); +- test_ret += test_parserInternals(); +- test_ret += test_pattern(); +- test_ret += test_relaxng(); +- test_ret += test_schemasInternals(); +- test_ret += test_schematron(); +- test_ret += test_tree(); +- test_ret += test_uri(); +- test_ret += test_valid(); +- test_ret += test_xinclude(); +- test_ret += test_xmlIO(); +- test_ret += test_xmlautomata(); +- test_ret += test_xmlerror(); +- test_ret += test_xmlmodule(); +- test_ret += test_xmlreader(); +- test_ret += test_xmlregexp(); +- test_ret += test_xmlsave(); +- test_ret += test_xmlschemas(); +- test_ret += test_xmlschemastypes(); +- test_ret += test_xmlstring(); +- test_ret += test_xmlunicode(); +- test_ret += test_xmlwriter(); +- test_ret += test_xpath(); +- test_ret += test_xpathInternals(); +- test_ret += test_xpointer(); ++ test_ret += (ret = test_HTMLparser()); ++ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_HTMLtree()); ++ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_SAX2()); ++ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_c14n()); ++ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_catalog()); ++ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_chvalid()); ++ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_debugXML()); ++ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_dict()); ++ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_encoding()); ++ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_entities()); ++ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_hash()); ++ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_list()); ++ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_nanoftp()); ++ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_nanohttp()); ++ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_parser()); ++ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_parserInternals()); ++ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_pattern()); ++ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_relaxng()); ++ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_schemasInternals()); ++ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_schematron()); ++ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_tree()); ++ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_uri()); ++ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_valid()); ++ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xinclude()); ++ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlIO()); ++ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlautomata()); ++ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlerror()); ++ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlmodule()); ++ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlreader()); ++ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlregexp()); ++ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlsave()); ++ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlschemas()); ++ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlschemastypes()); ++ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlstring()); ++ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlunicode()); ++ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xmlwriter()); ++ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xpath()); ++ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xpathInternals()); ++ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL"); ++ test_ret += (ret = test_xpointer()); ++ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL"); + + printf("Total: %d functions, %d tests, %d errors\n", + function_tests, call_tests, test_ret); ++ ++ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL"); + return(test_ret); + } + +diff -uNr a/testchar.c b/testchar.c +--- a/testchar.c 2013-04-17 10:50:30.250147418 +0200 ++++ b/testchar.c 2013-04-18 16:11:28.455733800 +0200 +@@ -23,7 +23,7 @@ + char document1[100] = "XXXX"; + char document2[100] = ""; + +-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document, ++static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document, + int len, char *data, int forbid1, int forbid2) { + int i; + xmlDocPtr res; +@@ -37,33 +37,41 @@ + res = xmlReadMemory(document, len, "test", NULL, 0); + + if ((i == forbid1) || (i == forbid2)) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Byte 0x%02X: %c\n", + i, i); ++ return(1); ++ } + } + + else if ((i == '<') || (i == '&')) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect illegal char %c for Byte 0x%02X\n", i, i); ++ return(1); ++ } + } + else if (((i < 0x20) || (i >= 0x80)) && + (i != 0x9) && (i != 0xA) && (i != 0xD)) { +- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) ++ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Byte 0x%02X\n", i); ++ return(1); ++ } + } + else if (res == NULL) { + fprintf(stderr, + "Failed to parse valid char for Byte 0x%02X : %c\n", i, i); ++ return(1); + } + if (res != NULL) + xmlFreeDoc(res); + } ++ return(0); + } + +-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, ++static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, + int len, char *data) { + int i, j; + xmlDocPtr res; +@@ -80,10 +88,12 @@ + + /* if first bit of first char is set, then second bit must too */ + if ((i & 0x80) && ((i & 0x40) == 0)) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -91,10 +101,12 @@ + * bits must be 10 + */ + else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -102,10 +114,12 @@ + * than 0x80, i.e. one of bits 5 to 1 of i must be set + */ + else if ((i & 0x80) && ((i & 0x1E) == 0)) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -113,10 +127,12 @@ + * at least 3 bytes, but we give only 2 ! + */ + else if ((i & 0xE0) == 0xE0) { +- if ((lastError == 0) || (res != NULL)) ++ if ((lastError == 0) || (res != NULL)) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -125,11 +141,13 @@ + else if ((lastError != 0) || (res == NULL)) { + fprintf(stderr, + "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); ++ return(1); + } + if (res != NULL) + xmlFreeDoc(res); + } + } ++ return(0); + } + + /** +@@ -141,9 +159,10 @@ + * CDATA in text or in attribute values. + */ + +-static void testDocumentRanges(void) { ++static int testDocumentRanges(void) { + xmlParserCtxtPtr ctxt; + char *data; ++ int test_ret = 0; + + /* + * Set up a parsing context using the first document as +@@ -152,7 +171,7 @@ + ctxt = xmlNewParserCtxt(); + if (ctxt == NULL) { + fprintf(stderr, "Failed to allocate parser context\n"); +- return; ++ return(1); + } + + printf("testing 1 byte char in document: 1"); +@@ -163,7 +182,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 1 byte injection at beginning of area */ +- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), ++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), + data, -1, -1); + printf(" 2"); + fflush(stdout); +@@ -172,7 +191,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 1 byte injection at end of area */ +- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), ++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), + data + 3, -1, -1); + + printf(" 3"); +@@ -183,7 +202,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 1 byte injection at beginning of area */ +- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), ++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), + data, '\'', -1); + printf(" 4"); + fflush(stdout); +@@ -192,7 +211,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 1 byte injection at end of area */ +- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), ++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), + data + 3, '\'', -1); + printf(" done\n"); + +@@ -204,7 +223,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 2 byte injection at beginning of area */ +- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), ++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), + data); + printf(" 2"); + fflush(stdout); +@@ -213,7 +232,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 2 byte injection at end of area */ +- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), ++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), + data + 2); + + printf(" 3"); +@@ -224,7 +243,7 @@ + data[2] = ' '; + data[3] = ' '; + /* test 2 byte injection at beginning of area */ +- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), ++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), + data); + printf(" 4"); + fflush(stdout); +@@ -233,14 +252,15 @@ + data[2] = ' '; + data[3] = ' '; + /* test 2 byte injection at end of area */ +- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), ++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), + data + 2); + printf(" done\n"); + + xmlFreeParserCtxt(ctxt); ++ return(test_ret); + } + +-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) { ++static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) { + int i = 0; + int len, c; + +@@ -255,19 +275,25 @@ + c = xmlCurrentChar(ctxt, &len); + if ((i == 0) || (i >= 0x80)) { + /* we must see an error there */ +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Byte 0x%02X\n", i); ++ return(1); ++ } + } else if (i == 0xD) { +- if ((c != 0xA) || (len != 1)) ++ if ((c != 0xA) || (len != 1)) { + fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i); ++ return(1); ++ } + } else if ((c != i) || (len != 1)) { + fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i); ++ return(1); + } + } ++ return(0); + } + +-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { ++static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { + int i, j; + int len, c; + +@@ -284,10 +310,12 @@ + + /* if first bit of first char is set, then second bit must too */ + if ((i & 0x80) && ((i & 0x40) == 0)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -295,10 +323,12 @@ + * bits must be 10 + */ + else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n", + i, j, c); ++ return(1); ++ } + } + + /* +@@ -306,10 +336,12 @@ + * than 0x80, i.e. one of bits 5 to 1 of i must be set + */ + else if ((i & 0x80) && ((i & 0x1E) == 0)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n", + i, j, c); ++ return(1); ++ } + } + + /* +@@ -317,10 +349,12 @@ + * at least 3 bytes, but we give only 2 ! + */ + else if ((i & 0xE0) == 0xE0) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n", + i, j); ++ return(1); ++ } + } + + /* +@@ -329,6 +363,7 @@ + else if ((lastError != 0) || (len != 2)) { + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j); ++ return(1); + } + + /* +@@ -338,12 +373,14 @@ + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n", + i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c); ++ return(1); + } + } + } ++ return(0); + } + +-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { ++static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { + int i, j, k, K; + int len, c; + unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; +@@ -368,20 +405,24 @@ + * at least 4 bytes, but we give only 3 ! + */ + if ((i & 0xF0) == 0xF0) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", + i, j, K, data[3]); ++ return(1); ++ } + } + + /* + * The second and the third bytes must start with 10 + */ + else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n", + i, j, K); ++ return(1); ++ } + } + + /* +@@ -390,10 +431,12 @@ + * the 6th byte of data[1] must be set + */ + else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n", + i, j, K); ++ return(1); ++ } + } + + /* +@@ -401,10 +444,12 @@ + */ + else if (((value > 0xD7FF) && (value <0xE000)) || + ((value > 0xFFFD) && (value <0x10000))) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n", + value, i, j, K); ++ return(1); ++ } + } + + /* +@@ -414,6 +459,7 @@ + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", + i, j, K); ++ return(1); + } + + /* +@@ -423,13 +469,15 @@ + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", + i, j, data[2], value, c); ++ return(1); + } + } + } + } ++ return(0); + } + +-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { ++static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { + int i, j, k, K, l, L; + int len, c; + unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; +@@ -458,10 +506,12 @@ + * at least 5 bytes, but we give only 4 ! + */ + if ((i & 0xF8) == 0xF8) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", + i, j, K, data[3]); ++ return(1); ++ } + } + + /* +@@ -469,10 +519,12 @@ + */ + else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) || + ((L & 0xC0) != 0x80)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", + i, j, K, L); ++ return(1); ++ } + } + + /* +@@ -481,10 +533,12 @@ + * the 6 or 5th byte of j must be set + */ + else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", + i, j, K, L); ++ return(1); ++ } + } + + /* +@@ -493,10 +547,12 @@ + else if (((value > 0xD7FF) && (value <0xE000)) || + ((value > 0xFFFD) && (value <0x10000)) || + (value > 0x10FFFF)) { +- if (lastError != XML_ERR_INVALID_CHAR) ++ if (lastError != XML_ERR_INVALID_CHAR) { + fprintf(stderr, + "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", + value, i, j, K, L); ++ return(1); ++ } + } + + /* +@@ -506,6 +562,7 @@ + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", + i, j, K); ++ return(1); + } + + /* +@@ -515,11 +572,13 @@ + fprintf(stderr, + "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", + i, j, data[2], value, c); ++ return(1); + } + } + } + } + } ++ return(0); + } + + /** +@@ -530,11 +589,12 @@ + * cover the full range of UTF-8 chars accepted by XML-1.0 + */ + +-static void testCharRanges(void) { ++static int testCharRanges(void) { + char data[5]; + xmlParserCtxtPtr ctxt; + xmlParserInputBufferPtr buf; + xmlParserInputPtr input; ++ int test_ret = 0; + + memset(data, 0, 5); + +@@ -545,17 +605,19 @@ + ctxt = xmlNewParserCtxt(); + if (ctxt == NULL) { + fprintf(stderr, "Failed to allocate parser context\n"); +- return; ++ return(1); + } + buf = xmlParserInputBufferCreateStatic(data, sizeof(data), + XML_CHAR_ENCODING_NONE); + if (buf == NULL) { + fprintf(stderr, "Failed to allocate input buffer\n"); ++ test_ret = 1; + goto error; + } + input = xmlNewInputStream(ctxt); + if (input == NULL) { + xmlFreeParserInputBuffer(buf); ++ test_ret = 1; + goto error; + } + input->filename = NULL; +@@ -567,25 +629,28 @@ + + printf("testing char range: 1"); + fflush(stdout); +- testCharRangeByte1(ctxt, data); ++ test_ret += testCharRangeByte1(ctxt, data); + printf(" 2"); + fflush(stdout); +- testCharRangeByte2(ctxt, data); ++ test_ret += testCharRangeByte2(ctxt, data); + printf(" 3"); + fflush(stdout); +- testCharRangeByte3(ctxt, data); ++ test_ret += testCharRangeByte3(ctxt, data); + printf(" 4"); + fflush(stdout); +- testCharRangeByte4(ctxt, data); ++ test_ret += testCharRangeByte4(ctxt, data); + printf(" done\n"); + fflush(stdout); + + error: + xmlFreeParserCtxt(ctxt); ++ return(test_ret); + } + + int main(void) { + ++ int ret = 0; ++ + /* + * this initialize the library and check potential ABI mismatches + * between the version it was compiled for and the actual shared +@@ -602,8 +667,9 @@ + /* + * Run the tests + */ +- testCharRanges(); +- testDocumentRanges(); ++ ret += testCharRanges(); ++ ret += testDocumentRanges(); ++ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL"); + + /* + * Cleanup function for the XML library. +diff -uNr a/testdict.c b/testdict.c +--- a/testdict.c 2013-04-16 15:08:42.971177193 +0200 ++++ b/testdict.c 2013-04-18 15:59:00.699482439 +0200 +@@ -440,5 +440,6 @@ + clean_strings(); + xmlCleanupParser(); + xmlMemoryDump(); ++ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } +diff -uNr a/testlimits.c b/testlimits.c +--- a/testlimits.c 2013-04-12 16:16:36.180354177 +0200 ++++ b/testlimits.c 2013-04-17 14:03:17.203092987 +0200 +@@ -1630,5 +1630,6 @@ + xmlCleanupParser(); + xmlMemoryDump(); + ++ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } +diff -uNr a/testrecurse.c b/testrecurse.c +--- a/testrecurse.c 2013-04-16 13:19:49.366536295 +0200 ++++ b/testrecurse.c 2013-04-17 14:06:27.367091622 +0200 +@@ -892,6 +892,7 @@ + err++; + } + } ++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc); + return(err); + } + +@@ -961,5 +962,6 @@ + xmlCleanupParser(); + xmlMemoryDump(); + ++ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } diff --git a/meta/recipes-core/libxml/libxml2_2.9.1.bb b/meta/recipes-core/libxml/libxml2_2.9.1.bb new file mode 100644 index 0000000000..0b6ac5d5c6 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2_2.9.1.bb @@ -0,0 +1,8 @@ +require libxml2.inc + +SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;name=testtar" + +SRC_URI[libtar.md5sum] = "9c0cfef285d5c4a5c80d00904ddab380" +SRC_URI[libtar.sha256sum] = "fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb" +SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a" +SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" diff --git a/meta/recipes-core/meta/buildtools-tarball.bb b/meta/recipes-core/meta/buildtools-tarball.bb new file mode 100644 index 0000000000..c54d9e8699 --- /dev/null +++ b/meta/recipes-core/meta/buildtools-tarball.bb @@ -0,0 +1,71 @@ +DESCRIPTION = "SDK type target for building a standalone tarball containing python, chrpath, make, git and tar. The \ + tarball can be used to run bitbake builds on systems which don't meet the usual version requirements." +SUMMARY = "Standalone tarball for running builds on systems with inadequate software" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +TOOLCHAIN_TARGET_TASK ?= "" + +TOOLCHAIN_HOST_TASK ?= "\ + nativesdk-python-core \ + nativesdk-python-textutils \ + nativesdk-python-sqlite3 \ + nativesdk-python-pickle \ + nativesdk-python-logging \ + nativesdk-python-elementtree \ + nativesdk-python-curses \ + nativesdk-python-compile \ + nativesdk-python-compiler \ + nativesdk-python-fcntl \ + nativesdk-python-shell \ + nativesdk-python-misc \ + nativesdk-python-multiprocessing \ + nativesdk-python-subprocess \ + nativesdk-python-xmlrpc \ + nativesdk-python-netclient \ + nativesdk-python-netserver \ + nativesdk-python-distutils \ + nativesdk-python-unixadmin \ + nativesdk-python-compression \ + nativesdk-python-json \ + nativesdk-python-unittest \ + nativesdk-python-mmap \ + nativesdk-python-difflib \ + nativesdk-python-pprint \ + nativesdk-python-git \ + nativesdk-python-pkgutil \ + nativesdk-ncurses-terminfo-base \ + nativesdk-chrpath \ + nativesdk-tar \ + nativesdk-git \ + nativesdk-pigz \ + nativesdk-make \ + nativesdk-wget \ + " + +TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-buildtools-nativesdk-standalone-${DISTRO_VERSION}" + +RDEPENDS = "${TOOLCHAIN_HOST_TASK}" + +EXCLUDE_FROM_WORLD = "1" + +inherit meta +inherit populate_sdk + +create_sdk_files_append () { + rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-* + rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-* + rm -f ${SDK_OUTPUT}/${SDKPATH}/version-* + + # Generate new (mini) sdk-environment-setup file + script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}} + touch $script + echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script + # In order for the self-extraction script to correctly extract and set up things, + # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script. + # However, buildtools-tarball is inherently a tool set instead of a fully functional SDK, + # so instead of exporting the variable, we use a comment here. + echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script + toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS} +} diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb new file mode 100644 index 0000000000..cf142ef5ca --- /dev/null +++ b/meta/recipes-core/meta/meta-environment.bb @@ -0,0 +1,51 @@ +SUMMARY = "Package of environment files for SDK" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +LICENSE = "MIT" +PR = "r8" + +EXCLUDE_FROM_WORLD = "1" + +inherit toolchain-scripts +TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib" +REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" + +SDK_DIR = "${WORKDIR}/sdk" +SDK_OUTPUT = "${SDK_DIR}/image" +SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}" + +inherit cross-canadian + +do_generate_content[nostamp] = "1" +do_generate_content() { + + rm -rf ${SDK_OUTPUT} + mkdir -p ${SDK_OUTPUT}/${SDKPATH} + + toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS} + + toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} ${REAL_MULTIMACH_TARGET_SYS} '##SDKTARGETSYSROOT##' ${target_libdir} + + # Add version information + toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS} +} +addtask generate_content before do_install after do_compile + +do_install[nostamp] = "1" +do_install() { + install -d ${D}/${SDKPATH} + install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/* +} + +PN = "meta-environment-${MACHINE}" +PACKAGES = "${PN}" +FILES_${PN}= " \ + ${SDKPATH}/* \ + " + +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_populate_sysroot[noexec] = "1" diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb new file mode 100644 index 0000000000..40bda28949 --- /dev/null +++ b/meta/recipes-core/meta/meta-ide-support.bb @@ -0,0 +1,18 @@ +SUMMARY = "Integrated Development Environment support" +DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +DEPENDS = "virtual/libc gdb-cross qemu-native qemu-helper-native unfs3-native" +PR = "r3" + +inherit meta toolchain-scripts + +do_populate_ide_support () { + toolchain_create_tree_env_script +} + +do_populate_ide_support[nostamp] = "1" +do_populate_ide_support[recrdeptask] = "do_package_write" +addtask populate_ide_support before do_build after do_install diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb new file mode 100644 index 0000000000..ba9fd88805 --- /dev/null +++ b/meta/recipes-core/meta/meta-toolchain.bb @@ -0,0 +1,9 @@ +SUMMARY = "Meta package for building a installable toolchain" +LICENSE = "MIT" + +PR = "r7" + +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit populate_sdk diff --git a/meta/recipes-core/meta/package-index.bb b/meta/recipes-core/meta/package-index.bb new file mode 100644 index 0000000000..27b6d8ea9f --- /dev/null +++ b/meta/recipes-core/meta/package-index.bb @@ -0,0 +1,29 @@ +SUMMARY = "Rebuilds the package index" +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" +PACKAGES = "" + +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" +do_package[noexec] = "1" +do_packagedata[noexec] = "1" +do_package_write[noexec] = "1" +do_package_write_ipk[noexec] = "1" +do_package_write_rpm[noexec] = "1" +do_package_write_deb[noexec] = "1" +do_populate_sysroot[noexec] = "1" + +do_package_index[nostamp] = "1" +do_package_index[depends] += "${PACKAGEINDEXDEPS}" + +python do_package_index() { + from oe.rootfs import generate_index_files + generate_index_files(d) +} +addtask do_package_index before do_build +EXCLUDE_FROM_WORLD = "1" diff --git a/meta/recipes-core/ncurses/ncurses-5.9/config.cache b/meta/recipes-core/ncurses/ncurses-5.9/config.cache new file mode 100644 index 0000000000..6a9217d5bb --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.9/config.cache @@ -0,0 +1,4 @@ +#! /bin/sh + +cf_cv_func_nanosleep=yes +cf_cv_func_mkstemp=yes diff --git a/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch new file mode 100644 index 0000000000..cba89d26f5 --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch @@ -0,0 +1,27 @@ +Upstream-Status: Inappropriate [configuration] + +'tic' of some linux distributions (e.g. fedora 11) hang in an infinite +loop when processing the original file. + +Index: ncurses-5.7/misc/terminfo.src +=================================================================== +--- ncurses-5.7.orig/misc/terminfo.src ++++ ncurses-5.7/misc/terminfo.src +@@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key + # The value for kbs reflects local customization rather than the settings used + # for XFree86 xterm. + konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, +- kend=\EOF, khome=\EOH, use=konsole+pcfkeys, +- use=konsole-vt100, +-# Konsole does not implement shifted cursor-keys. +-konsole+pcfkeys|konsole subset of xterm+pcfkeys, +- kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2, +- use=xterm+pcf0, ++ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R, ++ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, ++ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~, ++ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS, ++ khome=\EOH, use=konsole-vt100, + # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but + # it is still useful for deriving the other entries. + konsole-vt100|KDE console window with vt100 (sic) keyboard, diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc new file mode 100644 index 0000000000..f0a4044345 --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses.inc @@ -0,0 +1,292 @@ +SUMMARY = "The New Curses library" +DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library." +HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66" +SECTION = "libs" +DEPENDS = "ncurses-native" +DEPENDS_class-native = "" +INC_PR = "r15" + +inherit autotools binconfig multilib_header + +# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/ +SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz" + +EXTRA_AUTORECONF = "-I m4" +CONFIG_SITE =+ "${WORKDIR}/config.cache" + +# Whether to enable separate widec libraries; must be 'true' or 'false' +# +# TODO: remove this variable when widec is supported in every setup? +ENABLE_WIDEC ?= "true" + +# _GNU_SOURCE is required for widec stuff and is detected automatically +# for target objects. But it must be set manually for native and sdk +# builds. +BUILD_CPPFLAGS += "-D_GNU_SOURCE" + +# natives don't generally look in base_libdir +base_libdir_class-native = "${libdir}" + +# Display corruption occurs on 64 bit hosts without these settings +# This was derrived from the upstream debian ncurses which uses +# these settings for 32 and 64 bit hosts. +EXCONFIG_ARGS = "" +EXCONFIG_ARGS_class-native = " \ + --disable-lp64 \ + --with-chtype='long' \ + --with-mmask-t='long'" +EXCONFIG_ARGS_class-nativesdk = " \ + --disable-lp64 \ + --with-chtype='long' \ + --with-mmask-t='long'" + +PACKAGES_DYNAMIC = "^${PN}-lib.*" + +# Fall back to the host termcap / terminfo for -nativesdk and -native +# The reality is a work around for strange problems with things like +# "bitbake -c menuconfig busybox" where it cannot find the terminfo +# because the sstate had a hard coded search path. Until this is fixed +# another way this is deemed good enough. +EX_TERMCAP = "" +EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap" +EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap" +EX_TERMINFO = "" +EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo" +EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo" + +# Helper function for do_configure to allow multiple configurations +# $1 the directory to run configure in +# $@ the arguments to pass to configure +ncurses_configure() { + mkdir -p $1 + cd $1 + shift + oe_runconf \ + --disable-static \ + --without-debug \ + --without-ada \ + --without-gpm \ + --enable-hard-tabs \ + --enable-xmc-glitch \ + --enable-colorfgbg \ + --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \ + --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \ + --with-shared \ + --disable-big-core \ + --program-prefix= \ + --with-ticlib \ + --with-termlib=tinfo \ + --enable-sigwinch \ + --enable-pc-files \ + --disable-rpath-hack \ + ${EXCONFIG_ARGS} \ + --with-manpage-format=normal \ + "$@" || return 1 + cd .. +} + +# Override the function from the autotools class; ncurses requires a +# patched autoconf213 to generate the configure script. This autoconf +# is not available so that the shipped script will be used. +do_configure() { + # check does not work with cross-compiling and is generally + # broken because it requires stdin to be pollable (which is + # not the case for /dev/null redirections) + export cf_cv_working_poll=yes + + ( cd ${S}; gnu-configize --force ) + ncurses_configure "narrowc" || \ + return 1 + ! ${ENABLE_WIDEC} || \ + ncurses_configure "widec" "--enable-widec" "--without-progs" +} + +do_compile() { + oe_runmake -C narrowc libs + oe_runmake -C narrowc/progs + + ! ${ENABLE_WIDEC} || \ + oe_runmake -C widec libs +} + +# set of expected differences between narrowc and widec header +# +# TODO: the NCURSES_CH_T difference can cause real problems :( +_unifdef_cleanup = " \ + -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \ + -e '/^#define NCURSES_CH_T /d' \ + -e '/^#include /d' \ + -e '\!^/\* .* \*/!d' \ +" + +do_test[depends] = "unifdef-native:do_populate_sysroot" +do_test[dirs] = "${S}" +do_test() { + ${ENABLE_WIDEC} || return 0 + + # make sure that the narrow and widec header are compatible + # and differ only in minor details. + unifdef -k narrowc/include/curses.h | \ + sed ${_unifdef_cleanup} > curses-narrowc.h + unifdef -k widec/include/curses.h | \ + sed ${_unifdef_cleanup} > curses-widec.h + + diff curses-narrowc.h curses-widec.h +} + +# Split original _install_opts to two parts. +# One is the options to install contents, the other is the parameters \ +# when running command "make install" +_install_opts = "\ + install.libs install.includes install.man \ +" +_install_cfgs = "\ + DESTDIR='${D}' \ + PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \ +" + +do_install() { + # Order of installation is important; widec installs a 'curses.h' + # header with more definitions and must be installed last hence. + # Compatibility of these headers will be checked in 'do_test()'. + oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \ + install.progs + + # The install.data should run after install.libs, otherwise + # there would be a race issue in a very critical conditon, since + # tic will be run by install.data, and tic needs libtinfo.so + # which would be regenerated by install.libs. + oe_runmake -C narrowc ${_install_cfgs} \ + install.data + + + ! ${ENABLE_WIDEC} || \ + oe_runmake -C widec ${_install_cfgs} ${_install_opts} + + cd narrowc + + # include some basic terminfo files + # stolen ;) from gentoo and modified a bit + for x in ansi console dumb linux rxvt screen sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color + do + local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" + local basedir="$(basename $(dirname "${termfile}"))" + + if [ -n "${termfile}" ] + then + install -d ${D}${sysconfdir}/terminfo/${basedir} + mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/ + ln -s /etc/terminfo/${basedir}/${x} \ + ${D}${datadir}/terminfo/${basedir}/${x} + fi + done + # i think we can use xterm-color as default xterm + if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] + then + ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm + fi + + rm -f ${D}${libdir}/terminfo + + # create linker scripts for libcurses.so and libncurses to + # link against -ltinfo when needed. Some builds might break + # else when '-Wl,--no-copy-dt-needed-entries' has been set in + # linker flags. + for i in libncurses libncursesw; do + f=${D}${libdir}/$i.so + test -h $f || continue + rm -f $f + echo '/* GNU ld script */' >$f + echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f + done + + # Make sure that libcurses is linked so that it gets -ltinfo + # also, this should be addressed upstream really. + ln -sf libncurses.so ${D}${libdir}/libcurses.so + + # create libtermcap.so linker script for backward compatibility + f=${D}${libdir}/libtermcap.so + echo '/* GNU ld script */' >$f + echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f + + if [ ! -d "${D}${base_libdir}" ]; then + # Setting base_libdir to libdir as is done in the -native + # case will skip this code + mkdir ${D}${base_libdir} + mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir} + ! ${ENABLE_WIDEC} || \ + mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir} + + mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir} + rm ${D}${libdir}/libtinfo.so + + # Use lnr to ensure this is a relative link despite absolute paths + # (as we can't know the relationship between base_libdir and libdir). + # At some point we can rely on coreutils 8.16 which has ln -r. + lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so + fi + + oe_multilib_header curses.h +} + +python populate_packages_prepend () { + libdir = d.expand("${libdir}") + base_libdir = d.expand("${base_libdir}") + pnbase = d.expand("${PN}-lib%s") + do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True) + if libdir is not base_libdir: + do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True) +} + + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_ncurses-tools_class-target = "clear reset" + +BBCLASSEXTEND = "native nativesdk" + +PACKAGES += " \ + ${PN}-tools \ + ${PN}-terminfo \ + ${PN}-terminfo-base \ +" + +FILES_${PN} = "\ + ${bindir}/tput \ + ${bindir}/tset \ + ${bindir}/ncurses5-config \ + ${bindir}/ncursesw5-config \ + ${datadir}/tabset \ +" + +# This keeps only tput/tset in ncurses +# clear/reset are in already busybox +FILES_${PN}-tools = "\ + ${bindir}/tic \ + ${bindir}/toe \ + ${bindir}/infotocap \ + ${bindir}/captoinfo \ + ${bindir}/infocmp \ + ${bindir}/clear${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \ + ${bindir}/reset${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \ + ${bindir}/tack \ + ${bindir}/tabs \ +" + +# 'reset' is a symlink to 'tset' which is in the 'ncurses' package +RDEPENDS_${PN}-tools = "${PN}" + +FILES_${PN}-terminfo = "\ + ${datadir}/terminfo \ +" + +FILES_${PN}-terminfo-base = "\ + ${sysconfdir}/terminfo \ +" + +RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo" +RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base" diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb new file mode 100644 index 0000000000..6d23c0c7ea --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses_5.9.bb @@ -0,0 +1,10 @@ +require ncurses.inc + +PR = "${INC_PR}.1" + +SRC_URI += "file://tic-hang.patch \ + file://config.cache \ +" + +SRC_URI[md5sum] = "8cb9c412e5f2d96bc6f459aa8c6282a1" +SRC_URI[sha256sum] = "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b" diff --git a/meta/recipes-core/ncurses/site_config/headers b/meta/recipes-core/ncurses/site_config/headers new file mode 100644 index 0000000000..087b7bfd5e --- /dev/null +++ b/meta/recipes-core/ncurses/site_config/headers @@ -0,0 +1,5 @@ +curses.h +ncurses/curses.h +ncurses.h +ncurses/termcap.h + diff --git a/meta/recipes-core/netbase/netbase/hosts b/meta/recipes-core/netbase/netbase/hosts new file mode 100644 index 0000000000..2f332451b5 --- /dev/null +++ b/meta/recipes-core/netbase/netbase/hosts @@ -0,0 +1,2 @@ +127.0.0.1 localhost.localdomain localhost + diff --git a/meta/recipes-core/netbase/netbase_5.2.bb b/meta/recipes-core/netbase/netbase_5.2.bb new file mode 100644 index 0000000000..ab7ae6527c --- /dev/null +++ b/meta/recipes-core/netbase/netbase_5.2.bb @@ -0,0 +1,23 @@ +SUMMARY = "Basic TCP/IP networking support" +DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking" +HOMEPAGE = "http://packages.debian.org/netbase" +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab" +PE = "1" + +SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \ + file://hosts" + +SRC_URI[md5sum] = "3a01bfce6a28e1743412198abd241262" +SRC_URI[sha256sum] = "d62ba56d62b9b121664828175c2a237a7014ef32df8a4116ea33cff332de3307" + +do_install () { + install -d ${D}/${mandir}/man8 ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts + install -m 0644 etc-rpc ${D}${sysconfdir}/rpc + install -m 0644 etc-protocols ${D}${sysconfdir}/protocols + install -m 0644 etc-services ${D}${sysconfdir}/services +} + +CONFFILES_${PN} = "${sysconfdir}/hosts" diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb new file mode 100644 index 0000000000..0c6a530be6 --- /dev/null +++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb @@ -0,0 +1,33 @@ +# +# Copyright (C) 2007 OpenedHand Ltd +# + +SUMMARY = "Host packages for the standalone SDK or external toolchain" +PR = "r12" +LICENSE = "MIT" + +inherit packagegroup nativesdk + +PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" + +RDEPENDS_${PN} = "\ + nativesdk-pkgconfig \ + nativesdk-qemu \ + nativesdk-qemu-helper \ + nativesdk-pseudo \ + nativesdk-unfs3 \ + nativesdk-opkg \ + nativesdk-libtool \ + nativesdk-autoconf \ + nativesdk-automake \ + nativesdk-shadow \ + nativesdk-makedevs \ + nativesdk-smartpm \ + nativesdk-postinst-intercept \ + " + +RDEPENDS_${PN}_darwin = "\ + nativesdk-pkgconfig \ + nativesdk-opkg \ + nativesdk-libtool \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-base.bb b/meta/recipes-core/packagegroups/packagegroup-base.bb new file mode 100644 index 0000000000..368c318f01 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-base.bb @@ -0,0 +1,373 @@ +SUMMARY = "Merge machine and distro options to create a basic machine task/package" +LICENSE = "MIT" +PR = "r83" + +inherit packagegroup + +PROVIDES = "${PACKAGES}" +PACKAGES = ' \ + packagegroup-base \ + packagegroup-base-extended \ + packagegroup-distro-base \ + packagegroup-machine-base \ + \ + ${@base_contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \ + ${@base_contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \ + ${@base_contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "pci", "packagegroup-base-pci", "",d)} \ + ${@base_contains("MACHINE_FEATURES", "pcmcia", "packagegroup-base-pcmcia", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "phone", "packagegroup-base-phone", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "serial", "packagegroup-base-serial", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "usbgadget", "packagegroup-base-usbgadget", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "usbhost", "packagegroup-base-usbhost", "", d)} \ + \ + ${@base_contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "nfs", "packagegroup-base-nfs", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "ppp", "packagegroup-base-ppp", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "smbfs", "packagegroup-base-smbfs", "", d)} \ + ${@base_contains("DISTRO_FEATURES", "zeroconf", "packagegroup-base-zeroconf", "", d)} \ + \ + ' + +# +# packages which content depend on MACHINE_FEATURES need to be MACHINE_ARCH +# +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Override by distro if needed +VIRTUAL-RUNTIME_keymaps ?= "keymaps" + +# +# packagegroup-base contain stuff needed for base system (machine related) +# +RDEPENDS_packagegroup-base = "\ + packagegroup-distro-base \ + packagegroup-machine-base \ + \ + sysfsutils \ + module-init-tools \ + ${@base_contains('MACHINE_FEATURES', 'apm', 'packagegroup-base-apm', '',d)} \ + ${@base_contains('MACHINE_FEATURES', 'acpi', 'packagegroup-base-acpi', '',d)} \ + ${@base_contains('MACHINE_FEATURES', 'keyboard', 'packagegroup-base-keyboard', '',d)} \ + ${@base_contains('MACHINE_FEATURES', 'phone', 'packagegroup-base-phone', '',d)} \ + \ + ${@base_contains('COMBINED_FEATURES', 'alsa', 'packagegroup-base-alsa', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'ext2', 'packagegroup-base-ext2', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'vfat', 'packagegroup-base-vfat', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'irda', 'packagegroup-base-irda', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pci', 'packagegroup-base-pci', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'packagegroup-base-pcmcia', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'usbgadget', 'packagegroup-base-usbgadget', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'usbhost', 'packagegroup-base-usbhost', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \ + ${@base_contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \ + \ + ${@base_contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'smbfs', 'packagegroup-base-smbfs', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'ipv6', 'packagegroup-base-ipv6', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'ipsec', 'packagegroup-base-ipsec', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'ppp', 'packagegroup-base-ppp', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '',d)} \ + " + + +RRECOMMENDS_packagegroup-base = "\ + kernel-module-nls-utf8 \ + kernel-module-input \ + kernel-module-uinput \ + kernel-module-rtc-dev \ + kernel-module-rtc-proc \ + kernel-module-rtc-sysfs \ + kernel-module-unix" + +RDEPENDS_packagegroup-base-extended = "\ + packagegroup-base \ + ${ADD_WIFI} \ + ${ADD_BT} \ + ${ADD_3G} \ + ${ADD_NFC} \ + " + +ADD_WIFI = "" +ADD_BT = "" +ADD_3G = "" +ADD_NFC = "" + +python __anonymous () { + # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them) + # then include packagegroup-base-wifi in packagegroup-base + + distro_features = set(d.getVar("DISTRO_FEATURES", True).split()) + machine_features= set(d.getVar("MACHINE_FEATURES", True).split()) + + if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features): + d.setVar("ADD_BT", "packagegroup-base-bluetooth") + + if "wifi" in distro_features and not "wifi" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features): + d.setVar("ADD_WIFI", "packagegroup-base-wifi") + + if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features): + d.setVar("ADD_3G", "packagegroup-base-3g") + + if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features): + d.setVar("ADD_NFC", "packagegroup-base-nfc") + + # For backwards compatibility after rename + packages = d.getVar("PACKAGES", True).split() + for pkg in packages: + d.appendVar("RPROVIDES_%s" % pkg, pkg.replace("packagegroup-", "task-")) + d.appendVar("RREPLACES_%s" % pkg, pkg.replace("packagegroup-", "task-")) + d.appendVar("RCONFLICTS_%s" % pkg, pkg.replace("packagegroup-", "task-")) +} + +# +# packages added by distribution +# +SUMMARY_packagegroup-distro-base = "${DISTRO} extras" +DEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_DEPENDS}" +RDEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RDEPENDS}" +RRECOMMENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RRECOMMENDS}" + +# +# packages added by machine config +# +SUMMARY_packagegroup-machine-base = "${MACHINE} extras" +SUMMARY_packagegroup-machine-base = "Extra packages required to fully support ${MACHINE} hardware" +RDEPENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RDEPENDS}" +RRECOMMENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RRECOMMENDS}" + +SUMMARY_packagegroup-base-keyboard = "Keyboard support" +RDEPENDS_packagegroup-base-keyboard = "\ + ${VIRTUAL-RUNTIME_keymaps}" + +SUMMARY_packagegroup-base-pci = "PCI bus support" +RDEPENDS_packagegroup-base-pci = "\ + pciutils" + +SUMMARY_packagegroup-base-acpi = "ACPI support" +RDEPENDS_packagegroup-base-acpi = "\ + acpid \ + libacpi " + +SUMMARY_packagegroup-base-apm = "APM support" +RDEPENDS_packagegroup-base-apm = "\ + ${VIRTUAL-RUNTIME_apm} \ + apmd" + +SUMMARY_packagegroup-base-ext2 = "ext2 filesystem support" +RDEPENDS_packagegroup-base-ext2 = "\ + hdparm \ + e2fsprogs \ + e2fsprogs-e2fsck \ + e2fsprogs-mke2fs" + +SUMMARY_packagegroup-base-vfat = "FAT filesystem support" +RRECOMMENDS_packagegroup-base-vfat = "\ + kernel-module-msdos \ + kernel-module-vfat \ + kernel-module-nls-iso8859-1 \ + kernel-module-nls-cp437 \ + dosfstools" + +SUMMARY_packagegroup-base-alsa = "ALSA sound support" +RDEPENDS_packagegroup-base-alsa = "\ + alsa-utils-alsactl \ + alsa-utils-alsamixer \ + ${VIRTUAL-RUNTIME_alsa-state}" + +RRECOMMENDS_packagegroup-base-alsa = "\ + kernel-module-snd-mixer-oss \ + kernel-module-snd-pcm-oss" + +SUMMARY_packagegroup-base-pcmcia = "PC card slot support" +RDEPENDS_packagegroup-base-pcmcia = "\ + pcmciautils \ + " + +RRECOMMENDS_packagegroup-base-pcmcia = "\ + kernel-module-pcmcia \ + kernel-module-airo-cs \ + kernel-module-pcnet-cs \ + kernel-module-serial-cs \ + kernel-module-ide-cs \ + kernel-module-ide-disk \ + ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-hostap-cs', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-orinoco-cs', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-spectrum-cs', '',d)}" + +SUMMARY_packagegroup-base-bluetooth = "Bluetooth support" +RDEPENDS_packagegroup-base-bluetooth = "\ + bluez4 \ + ${@base_contains('COMBINED_FEATURES', 'alsa', 'libasound-module-bluez', '',d)} \ + " + +RRECOMMENDS_packagegroup-base-bluetooth = "\ + kernel-module-bluetooth \ + kernel-module-l2cap \ + kernel-module-rfcomm \ + kernel-module-hci-vhci \ + kernel-module-bnep \ + kernel-module-hidp \ + kernel-module-hci-uart \ + kernel-module-sco \ + ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-hci-usb', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetooth3c-cs', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluecard-cs', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetoothuart-cs', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-dtl1-cs', '',d)} \ + " + +SUMMARY_packagegroup-base-irda = "IrDA support" +RDEPENDS_packagegroup-base-irda = "\ + irda-utils" + +RRECOMMENDS_packagegroup-base-irda = "\ + kernel-module-pxaficp-ir \ + kernel-module-irda \ + kernel-module-ircomm \ + kernel-module-ircomm-tty \ + kernel-module-irlan \ + ${@base_contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \ + kernel-module-irport \ + kernel-module-irtty \ + kernel-module-irtty-sir \ + kernel-module-sir-dev \ + ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} " + +SUMMARY_packagegroup-base-usbgadget = "USB gadget support" +RRECOMMENDS_packagegroup-base-usbgadget = "\ + kernel-module-pxa27x_udc \ + kernel-module-gadgetfs \ + kernel-module-g-file-storage \ + kernel-module-g-serial \ + kernel-module-g-ether" + +SUMMARY_packagegroup-base-usbhost = "USB host support" +RDEPENDS_packagegroup-base-usbhost = "\ + usbutils " + +RRECOMMENDS_packagegroup-base-usbhost = "\ + kernel-module-uhci-hcd \ + kernel-module-ohci-hcd \ + kernel-module-ehci-hcd \ + kernel-module-usbcore \ + kernel-module-usbhid \ + kernel-module-usbnet \ + kernel-module-sd-mod \ + kernel-module-scsi-mod \ + kernel-module-usbmouse \ + kernel-module-mousedev \ + kernel-module-usbserial \ + kernel-module-usb-storage " + +SUMMARY_packagegroup-base-ppp = "PPP dial-up protocol support" +RDEPENDS_packagegroup-base-ppp = "\ + ppp \ + ppp-dialin" + +RRECOMMENDS_packagegroup-base-ppp = "\ + kernel-module-ppp-async \ + kernel-module-ppp-deflate \ + kernel-module-ppp-generic \ + kernel-module-ppp-mppe \ + kernel-module-slhc" + +SUMMARY_packagegroup-base-ipsec = "IPSEC support" +RDEPENDS_packagegroup-base-ipsec = "\ + " + +RRECOMMENDS_packagegroup-base-ipsec = "\ + kernel-module-ipsec" + +# +# packagegroup-base-wifi contain everything needed to get WiFi working +# WEP/WPA connection needs to be supported out-of-box +# +SUMMARY_packagegroup-base-wifi = "WiFi support" +RDEPENDS_packagegroup-base-wifi = "\ + wireless-tools \ + ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'hostap-utils', '',d)} \ + ${@base_contains('COMBINED_FEATURES', 'pci', 'hostap-utils', '',d)} \ + wpa-supplicant" + +RRECOMMENDS_packagegroup-base-wifi = "\ + ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \ + kernel-module-ieee80211-crypt \ + kernel-module-ieee80211-crypt-ccmp \ + kernel-module-ieee80211-crypt-tkip \ + kernel-module-ieee80211-crypt-wep \ + kernel-module-ecb \ + kernel-module-arc4 \ + kernel-module-crypto_algapi \ + kernel-module-cryptomgr \ + kernel-module-michael-mic \ + kernel-module-aes-generic \ + kernel-module-aes" + +SUMMARY_packagegroup-base-nfc = "Near Field Communication support" +RDEPENDS_packagegroup-base-nfc = "\ + neard" + +RRECOMMENDS_packagegroup-base-nfc = "\ + kernel-module-nfc" + +SUMMARY_packagegroup-base-3g = "Cellular data support" +RDEPENDS_packagegroup-base-3g = "\ + ofono" + +RRECOMMENDS_packagegroup-base-3g = "\ + kernel-module-cdc-acm \ + kernel-module-cdc-wdm" + +SUMMARY_packagegroup-base-smbfs = "SMB network filesystem support" +RRECOMMENDS_packagegroup-base-smbfs = "\ + kernel-module-cifs \ + kernel-module-smbfs" + +SUMMARY_packagegroup-base-cramfs = "cramfs filesystem support" +RRECOMMENDS_packagegroup-base-cramfs = "\ + kernel-module-cramfs" + +# +# packagegroup-base-nfs provides ONLY client support - server is in nfs-utils package +# +SUMMARY_packagegroup-base-nfs = "NFS network filesystem support" +RDEPENDS_packagegroup-base-nfs = "\ + rpcbind" + +RRECOMMENDS_packagegroup-base-nfs = "\ + kernel-module-nfs " + +SUMMARY_packagegroup-base-zeroconf = "Zeroconf support" +RDEPENDS_packagegroup-base-zeroconf = "\ + libnss-mdns \ + avahi-daemon" + +SUMMARY_packagegroup-base-ipv6 = "IPv6 support" +RDEPENDS_packagegroup-base-ipv6 = "\ + " + +RRECOMMENDS_packagegroup-base-ipv6 = "\ + kernel-module-ipv6 " + +SUMMARY_packagegroup-base-serial = "Serial port support" +RDEPENDS_packagegroup-base-serial = "\ + setserial \ + lrzsz " + +SUMMARY_packagegroup-base-phone = "Cellular telephony (voice) support" +RDEPENDS_packagegroup-base-phone = "\ + ofono" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb new file mode 100644 index 0000000000..1154bc05b5 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb @@ -0,0 +1,52 @@ +# +# Copyright (C) 2007 OpenedHand Ltd. +# + +SUMMARY = "Minimal boot requirements" +DESCRIPTION = "The minimal set of packages required to boot the system" +LICENSE = "MIT" +PR = "r17" + +inherit packagegroup + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# +# Set by the machine configuration with packages essential for device bootup +# +MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= "" +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= "" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-boot" +RREPLACES_${PN} = "task-core-boot" +RCONFLICTS_${PN} = "task-core-boot" + +# Distro can override the following VIRTUAL-RUNTIME providers: +VIRTUAL-RUNTIME_dev_manager ?= "udev" +VIRTUAL-RUNTIME_login_manager ?= "busybox" +VIRTUAL-RUNTIME_init_manager ?= "sysvinit" +VIRTUAL-RUNTIME_initscripts ?= "initscripts" +VIRTUAL-RUNTIME_keymaps ?= "keymaps" + +SYSVINIT_SCRIPTS = "${@base_contains('MACHINE_FEATURES', 'rtc', 'busybox-hwclock', '', d)} \ + modutils-initscripts \ + init-ifupdown \ + " + +RDEPENDS_${PN} = "\ + base-files \ + base-passwd \ + busybox \ + ${@base_contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \ + ${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ + netbase \ + ${VIRTUAL-RUNTIME_login_manager} \ + ${VIRTUAL-RUNTIME_init_manager} \ + ${VIRTUAL-RUNTIME_initscripts} \ + ${VIRTUAL-RUNTIME_dev_manager} \ + ${VIRTUAL-RUNTIME_update-alternatives} \ + ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}" + +RRECOMMENDS_${PN} = "\ + ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb new file mode 100644 index 0000000000..74ed247512 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb @@ -0,0 +1,29 @@ +# +# Copyright (C) 2007 OpenedHand Ltd. +# Copyright (C) 2012 Red Hat, Inc. +# + +SUMMARY = "Essential build dependencies" +LICENSE = "MIT" + +inherit packagegroup + +RDEPENDS_packagegroup-core-buildessential = "\ + autoconf \ + automake \ + binutils \ + binutils-symlinks \ + cpp \ + cpp-symlinks \ + gcc \ + gcc-symlinks \ + g++ \ + g++-symlinks \ + gettext \ + make \ + libstdc++ \ + libstdc++-dev \ + libtool \ + pkgconfig \ + " + diff --git a/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb new file mode 100644 index 0000000000..e7b013d406 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb @@ -0,0 +1,10 @@ +SUMMARY = "Remote debugging tools for Eclipse integration" +LICENSE = "MIT" + +inherit packagegroup + +RDEPENDS_${PN} = "\ + gdbserver \ + tcf-agent \ + openssh-sftp-server \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb new file mode 100644 index 0000000000..24c98c4938 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb @@ -0,0 +1,22 @@ +# +# Copyright (C) 2008 OpenedHand Ltd. +# + +SUMMARY = "NFS package groups" +LICENSE = "MIT" +PR = "r2" + +inherit packagegroup + +PACKAGES = "${PN}-server" + +# For backwards compatibility after rename +RPROVIDES_${PN}-server = "task-core-nfs-server" +RREPLACES_${PN}-server = "task-core-nfs-server" +RCONFLICTS_${PN}-server = "task-core-nfs-server" + +SUMMARY_${PN}-server = "NFS server" +RDEPENDS_${PN}-server = "\ + nfs-utils \ + nfs-utils-client \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb new file mode 100644 index 0000000000..172398929c --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb @@ -0,0 +1,77 @@ +# +# Copyright (C) 2007 OpenedHand Ltd. +# + +SUMMARY = "Software development tools" +LICENSE = "MIT" +PR = "r9" + +inherit packagegroup + +#PACKAGEFUNCS =+ 'generate_sdk_pkgs' + +# For backwards compatibility after rename +RPROVIDES_packagegroup-core-sdk = "task-core-sdk" +RREPLACES_packagegroup-core-sdk = "task-core-sdk" +RCONFLICTS_packagegroup-core-sdk = "task-core-sdk" + +RDEPENDS_packagegroup-core-sdk = "\ + packagegroup-core-buildessential \ + coreutils \ + ccache \ + diffutils \ + intltool \ + perl-module-re \ + perl-module-text-wrap \ + findutils \ + quilt \ + less \ + distcc \ + ldd \ + file \ + tcl" + +RRECOMMENDS_packagegroup-core-sdk = "\ + libgomp \ + libgomp-dev" + +#python generate_sdk_pkgs () { +# poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES'] +# pkgs = d.getVar('PACKAGES', True).split() +# for pkg in poky_pkgs.split(): +# newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk') +# +# # for each of the task packages, add a corresponding sdk task +# pkgs.append(newpkg) +# +# # for each sdk task, take the rdepends of the non-sdk task, and turn +# # that into rrecommends upon the -dev versions of those, not unlike +# # the package depchain code +# spkgdata = read_subpkgdata(pkg, d) +# +# rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '') +# rreclist = [] +# +# for depend in rdepends: +# split_depend = depend.split(' (') +# name = split_depend[0].strip() +# if packaged('%s-dev' % name, d): +# rreclist.append('%s-dev' % name) +# else: +# deppkgdata = read_subpkgdata(name, d) +# rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '') +# for depend in rdepends2: +# split_depend = depend.split(' (') +# name = split_depend[0].strip() +# if packaged('%s-dev' % name, d): +# rreclist.append('%s-dev' % name) +# +# oldrrec = d.getVar('RRECOMMENDS_%s' % newpkg) or '' +# d.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist)) +# # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, d.getVar('RRECOMMENDS_%s' % newpkg))) +# +# # bb.note('pkgs is %s' % pkgs) +# d.setVar('PACKAGES', ' '.join(pkgs)) +#} +# +#PACKAGES_DYNAMIC += "^packagegroup-core-sdk-.*" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb new file mode 100644 index 0000000000..458d8fa036 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb @@ -0,0 +1,12 @@ +SUMMARY = "Dropbear SSH client/server" +LICENSE = "MIT" +PR = "r1" + +inherit packagegroup + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-ssh-dropbear" +RREPLACES_${PN} = "task-core-ssh-dropbear" +RCONFLICTS_${PN} = "task-core-ssh-dropbear" + +RDEPENDS_${PN} = "dropbear" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb new file mode 100644 index 0000000000..df70962912 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb @@ -0,0 +1,12 @@ +SUMMARY = "OpenSSH SSH client/server" +LICENSE = "MIT" +PR = "r1" + +inherit packagegroup + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-ssh-openssh" +RREPLACES_${PN} = "task-core-ssh-openssh" +RCONFLICTS_${PN} = "task-core-ssh-openssh" + +RDEPENDS_${PN} = "openssh" diff --git a/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb new file mode 100644 index 0000000000..3325ef672e --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb @@ -0,0 +1,22 @@ +SUMMARY = "Target packages for the standalone SDK" +PR = "r8" +LICENSE = "MIT" + +inherit packagegroup + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-standalone-sdk-target" +RREPLACES_${PN} = "task-core-standalone-sdk-target" +RCONFLICTS_${PN} = "task-core-standalone-sdk-target" +RPROVIDES_${PN}-dbg = "task-core-standalone-sdk-target-dbg" +RREPLACES_${PN}-dbg = "task-core-standalone-sdk-target-dbg" +RCONFLICTS_${PN}-dbg = "task-core-standalone-sdk-target-dbg" + +RDEPENDS_${PN} = "\ + libgcc \ + libgcc-dev \ + libstdc++ \ + libstdc++-dev \ + ${LIBC_DEPENDENCIES} \ + qemuwrapper-cross \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb new file mode 100644 index 0000000000..f72aae4c9d --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb @@ -0,0 +1,27 @@ +# +# Copyright (C) 2008 OpenedHand Ltd. +# + +SUMMARY = "Debugging tools" +LICENSE = "MIT" + +inherit packagegroup + +PR = "r2" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-tools-debug" +RREPLACES_${PN} = "task-core-tools-debug" +RCONFLICTS_${PN} = "task-core-tools-debug" + +MTRACE = "" +MTRACE_libc-glibc = "libc-mtrace" + +RDEPENDS_${PN} = "\ + gdb \ + gdbserver \ + strace \ + ${MTRACE} \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb new file mode 100644 index 0000000000..80f3031ff5 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb @@ -0,0 +1,86 @@ +# +# Copyright (C) 2008 OpenedHand Ltd. +# + +SUMMARY = "Profiling tools" +LICENSE = "MIT" + +PR = "r3" + +inherit packagegroup + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-tools-profile" +RREPLACES_${PN} = "task-core-tools-profile" +RCONFLICTS_${PN} = "task-core-tools-profile" + +PROFILE_TOOLS_X = "${@base_contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}" +PROFILE_TOOLS_SYSTEMD = "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)}" + +RRECOMMENDS_${PN} = "\ + perf \ + trace-cmd \ + kernel-module-oprofile \ + blktrace \ + ${PROFILE_TOOLS_X} \ + ${PROFILE_TOOLS_SYSTEMD} \ + " + +PROFILETOOLS = "\ + oprofile \ + oprofileui-server \ + powertop \ + latencytop \ + " + +# systemtap needs elfutils which is not fully buildable on uclibc +# hence we exclude it from uclibc based builds +SYSTEMTAP = "systemtap" +SYSTEMTAP_libc-uclibc = "" +SYSTEMTAP_mips = "" +SYSTEMTAP_mips64 = "" +SYSTEMTAP_aarch64 = "" + +# lttng-ust uses sched_getcpu() which is not there on uclibc +# for some of the architectures it can be patched to call the +# syscall directly but for x86_64 __NR_getcpu is a vsyscall +# which means we can not use syscall() to call it. So we ignore +# it for x86_64/uclibc + +LTTNGUST = "lttng-ust" +LTTNGUST_libc-uclibc = "" +LTTNGUST_aarch64 = "" + +LTTNGTOOLS = "lttng-tools" +LTTNGTOOLS_aarch64 = "" + +LTTNGMODULES = "lttng-modules" +LTTNGMODULES_aarch64 = "" +LTTNGMODULES_arm = "" + +BABELTRACE = "babeltrace" +BABELTRACE_aarch64 = "" + +# valgrind does not work on mips + +VALGRIND = "valgrind" +VALGRIND_libc-uclibc = "" +VALGRIND_mips = "" +VALGRIND_mips64 = "" +VALGRIND_arm = "" +VALGRIND_aarch64 = "" + +# exmap-console +# exmap-server + +RDEPENDS_${PN} = "\ + ${PROFILETOOLS} \ + ${LTTNGUST} \ + ${LTTNGTOOLS} \ + ${LTTNGMODULES} \ + ${BABELTRACE} \ + ${SYSTEMTAP} \ + ${VALGRIND} \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb new file mode 100644 index 0000000000..952fbd0d1a --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb @@ -0,0 +1,63 @@ +# +# Copyright (C) 2008 OpenedHand Ltd. +# + +SUMMARY = "Testing tools/applications" +LICENSE = "MIT" + +PR = "r2" + +inherit packagegroup + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "task-core-tools-testapps" +RREPLACES_${PN} = "task-core-tools-testapps" +RCONFLICTS_${PN} = "task-core-tools-testapps" + +# kexec-tools doesn't work on Mips +KEXECTOOLS ?= "kexec" +KEXECTOOLS_mips ?= "" +KEXECTOOLS_mipsel ?= "" +KEXECTOOLS_powerpc ?= "" +KEXECTOOLS_e5500-64b ?= "" +KEXECTOOLS_aarch64 ?= "" + +X11GLTOOLS = "\ + mesa-demos \ + piglit \ + " + +3GTOOLS = "\ + ofono-tests \ + " + +X11TOOLS = "\ + fstests \ + owl-video \ + x11perf \ + xrestop \ + xwininfo \ + xprop \ + xvideo-tests \ + " + +RDEPENDS_${PN} = "\ + blktool \ + tslib-calibrate \ + tslib-tests \ + lrzsz \ + ${KEXECTOOLS} \ + alsa-utils-amixer \ + alsa-utils-aplay \ + gst-meta-video \ + gst-meta-audio \ + ltp \ + connman-tools \ + connman-tests \ + connman-client \ + ${@base_contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \ + ${@base_contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \ + ${@base_contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \ + " diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb new file mode 100644 index 0000000000..e3b1c18fa9 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb @@ -0,0 +1,18 @@ +SUMMARY = "Host SDK package for cross canadian toolchain" +PN = "packagegroup-cross-canadian-${MACHINE}" +LICENSE = "MIT" + +# Save TRANSLATED_TARGET_ARCH before allarch tramples it +TRANSLATED_TARGET_ARCH = "${@d.getVar('TUNE_ARCH', True).replace('_', '-')}" + +inherit cross-canadian packagegroup + +PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" + +RDEPENDS_${PN} = "\ + binutils-cross-canadian-${@' binutils-cross-canadian-'.join(all_multilib_tune_values(d,'TRANSLATED_TARGET_ARCH').split())} \ + gdb-cross-canadian-${@' gdb-cross-canadian-'.join(all_multilib_tune_values(d, 'TRANSLATED_TARGET_ARCH').split())} \ + gcc-cross-canadian-${@' gcc-cross-canadian-'.join(all_multilib_tune_values(d, 'TRANSLATED_TARGET_ARCH').split())} \ + meta-environment-${MACHINE} \ + " + diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb new file mode 100644 index 0000000000..8e3b917c75 --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb @@ -0,0 +1,229 @@ +# +# Copyright (C) 2010 Intel Corporation +# + +SUMMARY = "Self-hosting" +DESCRIPTION = "Packages required to run the build system" +PR = "r13" +LICENSE = "MIT" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-self-hosted \ + packagegroup-self-hosted-debug \ + packagegroup-self-hosted-sdk \ + packagegroup-self-hosted-extended \ + packagegroup-self-hosted-graphics \ + packagegroup-self-hosted-host-tools \ + " + +RDEPENDS_packagegroup-self-hosted = "\ + packagegroup-self-hosted-debug \ + packagegroup-self-hosted-sdk \ + packagegroup-self-hosted-extended \ + packagegroup-self-hosted-graphics \ + packagegroup-self-hosted-host-tools \ + " + +# midori depends on webkit-gtk which could not build for mips64 +MIDORI = "midori" +MIDORI_mips64 = "" + +RDEPENDS_packagegroup-self-hosted-host-tools = "\ + connman \ + connman-plugin-ethernet \ + dhcp-client \ + e2fsprogs \ + e2fsprogs-e2fsck \ + e2fsprogs-mke2fs \ + e2fsprogs-tune2fs \ + hdparm \ + iptables \ + lsb \ + xdg-utils \ + mc \ + mc-fish \ + mc-helpers \ + mc-helpers-perl \ + mc-helpers-python \ + leafpad \ + ${MIDORI} \ + pcmanfm \ + parted \ + pseudo \ + screen \ + vte \ + " + +RRECOMMENDS_packagegroup-self-hosted-host-tools = "\ + kernel-module-tun \ + kernel-module-iptable-raw \ + kernel-module-iptable-nat \ + kernel-module-iptable-mangle \ + kernel-module-iptable-filter \ + " + +# eglibc-utils: for rpcgen +RDEPENDS_packagegroup-self-hosted-sdk = "\ + autoconf \ + automake \ + binutils \ + binutils-symlinks \ + ccache \ + coreutils \ + cpp \ + cpp-symlinks \ + distcc \ + eglibc-utils \ + eglibc-gconv-ibm850 \ + file \ + findutils \ + g++ \ + g++-symlinks \ + gcc \ + gcc-symlinks \ + intltool \ + ldd \ + less \ + libssp \ + libssp-dev \ + libssp-staticdev \ + libstdc++ \ + libstdc++-dev \ + libtool \ + make \ + mktemp \ + perl-module-re \ + perl-module-text-wrap \ + pkgconfig \ + quilt \ + sed \ + " + +RDEPENDS_packagegroup-self-hosted-debug = " \ + gdb \ + gdbserver \ + rsync \ + strace \ + tcf-agent" + + +RDEPENDS_packagegroup-self-hosted-extended = "\ + bzip2 \ + chkconfig \ + chrpath \ + cpio \ + curl \ + diffstat \ + diffutils \ + elfutils \ + expat \ + gamin \ + gawk \ + gdbm \ + gettext \ + gettext-runtime \ + git \ + grep \ + groff \ + gzip \ + settings-daemon \ + hicolor-icon-theme \ + sato-icon-theme \ + libaio \ + libusb1 \ + libxml2 \ + lrzsz \ + lsof \ + lzo \ + man \ + man-pages \ + mdadm \ + minicom \ + mtools \ + ncurses \ + ncurses-terminfo-base \ + neon \ + nfs-utils \ + nfs-utils-client \ + openssl \ + openssh-sftp-server \ + opkg \ + opkg-utils \ + patch \ + perl \ + perl-dev \ + perl-modules \ + perl-pod \ + ${PTH} \ + python \ + python-compile \ + python-compiler \ + python-compression \ + python-core \ + python-curses \ + python-datetime \ + python-difflib \ + python-distutils \ + python-elementtree \ + python-email \ + python-fcntl \ + python-git \ + python-json \ + python-logging \ + python-misc \ + python-mmap \ + python-multiprocessing \ + python-netclient \ + python-netserver \ + python-pickle \ + python-pkgutil \ + python-pprint \ + python-re \ + python-rpm \ + python-shell \ + python-sqlite3 \ + python-subprocess \ + python-textutils \ + python-unittest \ + python-unixadmin \ + python-xmlrpc \ + quota \ + readline \ + rpm \ + setserial \ + socat \ + subversion \ + sudo \ + sysstat \ + tar \ + tcl \ + texi2html \ + texinfo \ + unzip \ + usbutils \ + watchdog \ + wget \ + which \ + xinetd \ + zip \ + zlib \ + xz \ + " + + +RDEPENDS_packagegroup-self-hosted-graphics = "\ + builder \ + libgl \ + libgl-dev \ + libglu \ + libglu-dev \ + libsdl \ + libsdl-dev \ + libx11-dev \ + python-pygtk \ + gtk-theme-clearlooks \ + " +PTH = "pth" +PTH_libc-uclibc = "" diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init new file mode 100755 index 0000000000..66c85e9335 --- /dev/null +++ b/meta/recipes-core/psplash/files/psplash-init @@ -0,0 +1,29 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: psplash +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO + +read CMDLINE < /proc/cmdline +for x in $CMDLINE; do + case $x in + psplash=false) + echo "Boot splashscreen disabled" + exit 0; + ;; + esac +done + +export TMPDIR=/mnt/.psplash +mount tmpfs -t tmpfs $TMPDIR -o,size=40k + +rotation=0 +if [ -e /etc/rotation ]; then + read rotation < /etc/rotation +fi + +/usr/bin/psplash --angle $rotation & + diff --git a/meta/recipes-core/psplash/files/psplash-poky-img.h b/meta/recipes-core/psplash/files/psplash-poky-img.h new file mode 100644 index 0000000000..8d56aa0201 --- /dev/null +++ b/meta/recipes-core/psplash/files/psplash-poky-img.h @@ -0,0 +1,1259 @@ +/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */ + +#define POKY_IMG_ROWSTRIDE (1920) +#define POKY_IMG_WIDTH (640) +#define POKY_IMG_HEIGHT (480) +#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */ +#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\237\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \ + "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \ + "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \ + "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \ + "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\363\376\377\374\3\373\375" \ + "\372\360\366\370\353\360\363\202\347\355\357\5\346\354\356\347\355\357" \ + "\351\356\360\360\366\370\371\373\370\363\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\353\376\377\374\10\356" \ + "\363\366\324\331\333\277\304\306\252\262\272\227\237\247}\220\233p\203" \ + "\216ew\202\212]oz\10dv\201n\201\214~\215\223\216\236\244\247\257\267" \ + "\274\301\303\320\326\330\352\357\362\353\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\346\376\377\374\5\366" \ + "\370\364\320\326\330\255\265\275\210\227\235j}\210\232]oz\5gy\204\204" \ + "\223\231\250\260\270\314\321\324\355\362\365\346\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\342\376\377" \ + "\374\5\373\375\372\327\334\337\253\263\273x\213\227^p{\243]oz\4q\204" \ + "\217\242\252\262\320\326\330\365\372\375\342\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\337\376\377\374" \ + "\4\371\373\370\317\324\327\225\245\253ew\202\252]oz\4bt\177\211\230\236" \ + "\306\314\316\367\371\366\337\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\335\376\377\374\3\333\340\343\236" \ + "\246\256fx\203\260]oz\3bt\177\225\235\245\320\326\330\335\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\332" \ + "\376\377\374\3\367\371\366\276\303\305u\210\224\266]oz\3m\200\213\257" \ + "\267\277\355\362\365\332\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\330\376\377\374\3\353\360\363\252\262" \ + "\272fx\203\272]oz\3as~\230\250\256\342\347\352\330\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\326\376\377" \ + "\374\3\352\357\362\236\246\256as~\276]oz\3^p{\216\236\244\341\346\351" \ + "\326\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\324\376\377\374\3\354\361\364\246\256\266as~\302]oz\3^p" \ + "{\227\237\247\346\354\356\324\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\322\376\377\374\3\372\374\371\265" \ + "\276\306fx\203\306]oz\3as~\250\260\270\362\367\371\322\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\321\376" \ + "\377\374\2\320\326\330p\203\216\312]oz\2hz\205\302\307\312\321\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\317\376\377\374\2\356\363\366\231\241\251\316]oz\2\204\223\231\345\352" \ + "\355\317\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\316\376\377\374\2\311\316\321i{\206\320]oz\2bt\177\264" \ + "\274\305\316\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\314\376\377\374\2\362\367\371\226\246\254\324]o" \ + "z\2\206\225\233\353\360\363\314\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\313\376\377\374\2\334\342\344o\202" \ + "\215\326]oz\2gy\204\315\322\325\313\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\312\376\377\374\2\302\307\312" \ + "as~\330]oz\3^p{\254\264\274\373\375\372\311\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\310\376\377\374\2\372" \ + "\374\371\236\246\256\334]oz\2\210\227\235\360\366\370\310\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\307" \ + "\376\377\374\2\360\366\370\205\224\232\336]oz\2s\206\221\347\355\357" \ + "\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\306\376\377\374\2\347\355\357t\207\222\340]oz\2i{\206\333" \ + "\340\343\306\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\305\376\377\374\2\343\350\353j}\210\251]oz\7bt\177" \ + "w\212\226\215\234\243\236\246\256\246\256\266\254\264\274\264\274\305" \ + "\202\300\305\310\7\264\274\305\255\265\275\250\260\270\233\252\261\222" \ + "\241\247~\215\223ew\202\251]oz\2cu\200\322\330\332\305\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\304\376" \ + "\377\374\2\337\344\346i{\206\245]oz\5j}\210\230\240\250\270\300\311\322" \ + "\330\332\351\356\360\220\376\377\374\5\354\361\364\326\333\335\300\305" \ + "\310\236\246\256p\203\216\245]oz\2as~\316\323\326\304\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\303\376" \ + "\377\374\2\335\343\345gy\204\242]oz\4ew\202\222\241\247\276\303\305\342" \ + "\347\352\232\376\377\374\4\352\357\362\304\311\314\233\243\253j}\210" \ + "\242]oz\2as~\313\320\322\303\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\302\376\377\374\2\341\346\351hz" \ + "\205\240]oz\4_q|\211\230\236\307\315\317\370\372\367\240\376\377\374" \ + "\4\373\375\372\320\326\330\231\241\251bt\177\240]oz\2as~\317\324\327" \ + "\302\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\301\376\377\374\2\343\350\353i{\206\237]oz\3q\204\217\266" \ + "\277\307\354\361\364\246\376\377\374\3\366\370\364\303\310\313\177\216" \ + "\224\237]oz\2bt\177\325\332\334\301\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\300\376\377\374\2\355\362\365" \ + "l\177\212\236]oz\3u\210\224\307\315\317\373\375\372\253\376\377\374\2" \ + "\324\331\333\204\223\231\236]oz\2ew\202\341\346\351\300\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\277\376" \ + "\377\374\2\365\372\375\177\216\224\235]oz\2~\215\223\315\322\325\260" \ + "\376\377\374\2\331\336\341\211\230\236\235]oz\2l\177\212\353\360\363" \ + "\277\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\277\376\377\374\1\214\233\242\234]oz\2i{\206\305\312\315" \ + "\264\376\377\374\2\324\331\333q\204\217\234]oz\2u\210\224\367\371\366" \ + "\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\276\376\377\374\1\257\267\277\233]oz\3^p{\242\252\262\362" \ + "\367\371\266\376\377\374\3\372\374\371\261\271\302bt\177\233]oz\1\225" \ + "\235\245\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\275\376\377\374\2\317\324\327^p{\232]oz\2w\212\226" \ + "\335\343\345\272\376\377\374\2\351\356\360\211\230\236\233]oz\1\264\274" \ + "\305\275\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\274\376\377\374\2\347\355\357ew\202\232]oz\2\242\252" \ + "\262\371\373\370\225\376\377\374\10\336\367\374\262\355\370\220\343\361" \ + "m\332\361G\317\353,\311\352(\307\350#\304\346\202\0\301\350\10\0\304" \ + "\352(\307\350,\311\352B\314\347i\326\356\207\341\364\260\353\366\333" \ + "\364\371\226\376\377\374\2\266\277\307as~\231]oz\2_q|\327\334\337\274" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\273\376\377\374\2\373\375\372}\220\233\231]oz\2ew\202\313\320" \ + "\322\223\376\377\374\4\334\365\372\233\345\364M\323\357\0\304\352\222" \ + "\25\274\344\4\0\301\350J\321\355\211\342\365\314\361\372\223\376\377" \ + "\374\2\332\337\342m\200\213\231]oz\2l\177\212\360\366\370\273\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\273\376\377\374\1\257\267\277\231]oz\2x\213\227\347\355\357\221\376" \ + "\377\374\3\336\367\374\206\340\363*\310\351\232\25\274\344\3#\304\346" \ + "w\333\356\316\363\374\221\376\377\374\2\360\366\370\214\233\242\231]" \ + "oz\1\227\237\247\273\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\272\376\377\374\2\335\343\345_q|\230]oz" \ + "\2\210\227\235\364\371\374\217\376\377\374\3\370\376\377\256\350\364" \ + "B\314\347\240\25\274\344\3*\310\351\233\345\364\367\375\377\217\376\377" \ + "\374\2\373\375\372\242\252\262\231]oz\1\305\312\315\272\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\271\376" \ + "\377\374\2\372\374\371w\212\226\230]oz\2\231\241\251\372\374\371\216" \ + "\376\377\374\3\367\375\377\233\345\364(\307\350\244\25\274\344\3\0\302" \ + "\351\206\340\363\356\373\374\217\376\377\374\1\257\267\277\230]oz\2h" \ + "z\205\356\363\366\271\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\271\376\377\374\1\257\267\277\230]oz\1\246" \ + "\256\266\217\376\377\374\2\237\350\367\0\304\352\250\25\274\344\3\0\276" \ + "\345\207\341\364\370\376\377\216\376\377\374\2\277\304\306_q|\227]oz" \ + "\1\231\241\251\271\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\270\376\377\374\2\346\354\356bt\177\227]oz\1" \ + "\251\261\271\216\376\377\374\2\315\362\3731\313\354\254\25\274\344\2" \ + "(\307\350\262\355\370\216\376\377\374\2\305\312\315^p{\227]oz\1\322\330" \ + "\332\270\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\270\376\377\374\1\215\234\243\227]oz\1\233\252\261\215" \ + "\376\377\374\3\367\375\377m\332\361\0\276\345\257\25\274\344\2L\322\356" \ + "\356\373\374\215\376\377\374\1\274\301\303\227]oz\2t\207\222\373\375" \ + "\372\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\267\376\377\374\1\325\332\334\227]oz\2\214\233\242\373" \ + "\375\372\214\376\377\374\2\333\364\371,\311\352\262\25\274\344\2\0\304" \ + "\352\301\356\366\215\376\377\374\1\252\262\272\227]oz\1\274\301\303\267" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\267\376\377\374\1v\211\225\226]oz\2\205\224\232\365\372\375" \ + "\214\376\377\374\2\236\347\366\0\276\345\264\25\274\344\3\0\276\345\203" \ + "\334\360\370\376\377\214\376\377\374\1\236\246\256\226]oz\2hz\205\362" \ + "\367\371\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\266\376\377\374\1\307\315\317\226]oz\2n\201\214" \ + "\360\366\370\214\376\377\374\1m\332\361\270\25\274\344\2I\320\354\366" \ + "\373\376\213\376\377\374\2\373\375\372\203\222\230\226]oz\1\254\264\274" \ + "\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\265\376\377\374\2\373\375\372s\206\221\225]oz\2as~\333\340" \ + "\343\213\376\377\374\2\370\376\377M\323\357\272\25\274\344\2""1\313\354" \ + "\356\373\374\213\376\377\374\2\353\360\363i{\206\225]oz\2ew\202\357\365" \ + "\367\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\265\376\377\374\1\305\312\315\226]oz\1\265\276\306\213" \ + "\376\377\374\2\366\373\376B\314\347\274\25\274\344\2(\307\350\336\367" \ + "\374\213\376\377\374\2\322\330\332^p{\225]oz\1\252\262\272\265\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\265\376\377\374\1u\210\224\225]oz\1\214\233\242\213\376\377\374\2\366" \ + "\373\376B\314\347\276\25\274\344\2#\304\346\337\370\375\213\376\377\374" \ + "\1\253\263\273\225]oz\2fx\203\367\371\366\264\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374" \ + "\1\322\330\332\225]oz\2i{\206\360\366\370\212\376\377\374\2\370\376\377" \ + "I\320\354\300\25\274\344\2*\310\351\357\374\375\212\376\377\374\2\373" \ + "\375\372~\215\223\225]oz\1\264\274\305\264\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1\210" \ + "\227\235\225]oz\1\303\310\313\213\376\377\374\1i\326\356\302\25\274\344" \ + "\2B\314\347\370\376\377\212\376\377\374\2\335\343\345^p{\224]oz\2m\200" \ + "\213\373\375\372\263\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\263\376\377\374\2\345\352\355^p{\224]oz" \ + "\1~\221\235\213\376\377\374\1y\336\360\304\25\274\344\1M\323\357\213" \ + "\376\377\374\1\242\252\262\225]oz\1\315\322\325\263\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\263\376\377" \ + "\374\1\252\262\272\224]oz\2_q|\341\346\351\212\376\377\374\2\274\355" \ + "\373\0\276\345\305\25\274\344\1\220\343\361\212\376\377\374\2\360\366" \ + "\370i{\206\224]oz\1\211\230\236\263\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\262\376\377\374\2\372\374\371" \ + "i{\206\224]oz\1\250\260\270\212\376\377\374\2\350\371\377\0\304\352\306" \ + "\25\274\344\2\0\276\345\316\363\374\212\376\377\374\1\303\310\313\224" \ + "]oz\2^p{\352\357\362\262\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\262\376\377\374\1\315\322\325\224]o" \ + "z\2dv\201\357\365\367\212\376\377\374\1G\317\353\240\25\274\344\3\0\302" \ + "\351,\311\352J\321\355\203L\322\356\2B\314\347#\304\346\240\25\274\344" \ + "\2*\310\351\367\375\377\212\376\377\374\1q\204\217\224]oz\1\257\267\277" \ + "\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\262\376\377\374\1\230\240\250\224]oz\1\247\257\267\212\376" \ + "\377\374\1\233\345\364\235\25\274\344\4*\310\351n\333\362\273\354\371" \ + "\360\375\376\210\376\377\374\4\357\374\375\303\361\370\206\340\363/\312" \ + "\353\235\25\274\344\1w\333\356\212\376\377\374\1\303\310\313\224]oz\1" \ + "v\211\225\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\261\376\377\374\2\365\372\375dv\201\223]oz\2as~" \ + "\353\360\363\211\376\377\374\2\356\373\374\0\302\351\232\25\274\344\3" \ + "\0\276\345m\332\361\335\366\373\220\376\377\374\2\336\367\374(\307\350" \ + "\232\25\274\344\2%\305\347\336\367\374\212\376\377\374\2\372\374\371" \ + "n\201\214\224]oz\1\343\350\353\261\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\261\376\377\374\1\313\320\322" \ + "\224]oz\1\233\252\261\212\376\377\374\1k\327\357\231\25\274\344\3\0\276" \ + "\345\206\340\363\357\374\375\222\376\377\374\1k\327\357\232\25\274\344" \ + "\2%\305\347\336\367\374\214\376\377\374\1\276\303\305\224]oz\1\257\267" \ + "\277\261\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\261\376\377\374\1\226\246\254\223]oz\2^p{\347\355\357" \ + "\211\376\377\374\2\316\363\374\0\276\345\230\25\274\344\2J\321\355\337" \ + "\370\375\223\376\377\374\1k\327\357\232\25\274\344\2%\305\347\336\367" \ + "\374\215\376\377\374\2\370\372\367i{\206\223]oz\1\177\216\224\261\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\261\376\377\374\1k~\211\223]oz\1\205\224\232\212\376\377\374\1J" \ + "\321\355\227\25\274\344\2\0\276\345\257\351\365\224\376\377\374\1m\332" \ + "\361\232\25\274\344\2%\305\347\336\367\374\217\376\377\374\1\246\256" \ + "\266\223]oz\2^p{\356\363\366\260\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\260\376\377\374\1\335\343\345" \ + "\224]oz\1\303\310\313\211\376\377\374\2\333\364\371\0\276\345\226\25" \ + "\274\344\2#\304\346\316\363\374\224\376\377\374\1m\332\361\232\25\274" \ + "\344\2%\305\347\336\367\374\220\376\377\374\1\335\343\345\224]oz\1\306" \ + "\314\316\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\260\376\377\374\1\264\274\305\223]oz\2cu\200\367" \ + "\371\366\211\376\377\374\1i\326\356\226\25\274\344\2,\311\352\347\370" \ + "\376\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367\374" \ + "\222\376\377\374\1t\207\222\223]oz\1\236\246\256\260\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\260\376" \ + "\377\374\1\215\234\243\223]oz\1\231\241\251\211\376\377\374\2\347\370" \ + "\376\0\276\345\225\25\274\344\2*\310\351\357\374\375\224\376\377\374" \ + "\1m\332\361\232\25\274\344\2%\305\347\336\367\374\223\376\377\374\1\261" \ + "\271\302\223]oz\1q\204\217\260\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\260\376\377\374\1i{\206\223]oz\1" \ + "\317\324\327\211\376\377\374\1\207\341\364\225\25\274\344\2#\304\346" \ + "\337\370\375\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336" \ + "\367\374\224\376\377\374\1\351\356\360\224]oz\1\356\363\366\257\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\257\376\377\374\1\345\352\355\223]oz\2as~\370\372\367\211\376\377\374" \ + "\1,\311\352\224\25\274\344\2\0\276\345\313\360\371\224\376\377\374\1" \ + "m\332\361\232\25\274\344\2%\305\347\336\367\374\226\376\377\374\1q\204" \ + "\217\223]oz\1\314\321\324\257\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\257\376\377\374\1\311\316\321\223" \ + "]oz\1\202\221\227\211\376\377\374\1\320\365\376\225\25\274\344\1\207" \ + "\341\364\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367" \ + "\374\214\376\377\374\2\236\347\366\237\350\367\211\376\377\374\1\236" \ + "\246\256\223]oz\1\255\265\275\257\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\254\264\274" \ + "\223]oz\1\255\265\275\211\376\377\374\1y\336\360\224\25\274\344\2/\312" \ + "\353\370\376\377\223\376\377\374\1m\332\361\232\25\274\344\2%\305\347" \ + "\336\367\374\214\376\377\374\3\236\347\366\0\276\345J\321\355\211\376" \ + "\377\374\1\311\316\321\223]oz\1\215\234\243\257\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374" \ + "\1\214\233\242\223]oz\1\326\333\335\211\376\377\374\1,\311\352\224\25" \ + "\274\344\1\312\357\370\223\376\377\374\1n\333\362\232\25\274\344\2%\305" \ + "\347\336\367\374\214\376\377\374\5\236\347\366\0\276\345\25\274\344\0" \ + "\276\345\367\375\377\210\376\377\374\2\356\363\366^p{\222]oz\1o\202\215" \ + "\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\257\376\377\374\1o\202\215\222]oz\2as~\366\373\376\210\376" \ + "\377\374\2\357\374\375\0\276\345\223\25\274\344\1J\321\355\223\376\377" \ + "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \ + "\2\236\347\366\0\276\345\203\25\274\344\1\274\355\373\211\376\377\374" \ + "\1u\210\224\222]oz\2^p{\370\372\367\256\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\2\373\375" \ + "\372_q|\222]oz\1u\210\224\211\376\377\374\1\261\354\367\224\25\274\344" \ + "\1\312\357\370\222\376\377\374\1n\333\362\232\25\274\344\2%\305\347\336" \ + "\367\374\214\376\377\374\2\236\347\366\0\276\345\204\25\274\344\1\204" \ + "\335\361\211\376\377\374\1\230\240\250\223]oz\1\342\347\352\256\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\256\376\377\374\1\351\356\360\223]oz\1\225\235\245\211\376\377\374\1" \ + "n\333\362\223\25\274\344\1,\311\352\222\376\377\374\1n\333\362\232\25" \ + "\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345" \ + "\205\25\274\344\1B\314\347\211\376\377\374\1\257\267\277\223]oz\1\317" \ + "\324\327\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\256\376\377\374\1\326\333\335\223]oz\1\253\263\273" \ + "\211\376\377\374\1B\314\347\223\25\274\344\1\211\342\365\221\376\377" \ + "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \ + "\2\236\347\366\0\276\345\206\25\274\344\1\0\302\351\211\376\377\374\1" \ + "\307\315\317\223]oz\1\276\303\305\256\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\306\314" \ + "\316\223]oz\1\305\312\315\211\376\377\374\1#\304\346\223\25\274\344\1" \ + "\337\370\375\220\376\377\374\1w\333\356\232\25\274\344\2%\305\347\336" \ + "\367\374\214\376\377\374\2\236\347\366\0\276\345\210\25\274\344\1\356" \ + "\373\374\210\376\377\374\1\337\344\346\223]oz\1\253\263\273\256\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\256\376\377\374\1\274\301\303\223]oz\1\333\340\343\210\376\377\374\2" \ + "\367\375\377\0\276\345\222\25\274\344\1(\307\350\220\376\377\374\1\231" \ + "\342\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236" \ + "\347\366\0\276\345\211\25\274\344\1\302\357\367\210\376\377\374\2\364" \ + "\371\374^p{\222]oz\1\236\246\256\256\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\257\267" \ + "\277\223]oz\1\353\360\363\210\376\377\374\1\316\363\374\223\25\274\344" \ + "\1\\\326\355\217\376\377\374\2\320\365\376\31\275\345\231\25\274\344" \ + "\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\212\25" \ + "\274\344\1\237\350\367\211\376\377\374\1gy\204\222]oz\1\216\236\244\256" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\256\376\377\374\1\242\252\262\223]oz\1\366\370\364\210\376\377" \ + "\374\1\262\355\370\223\25\274\344\1\220\343\361\217\376\377\374\1J\321" \ + "\355\231\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347" \ + "\366\0\276\345\213\25\274\344\1\211\342\365\211\376\377\374\1m\200\213" \ + "\222]oz\1\204\223\231\256\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\256\376\377\374\1\226\246\254\223]o" \ + "z\211\376\377\374\1\237\350\367\223\25\274\344\1\262\355\370\216\376" \ + "\377\374\2\350\371\377\0\276\345\230\25\274\344\2%\305\347\336\367\374" \ + "\214\376\377\374\2\236\347\366\0\276\345\214\25\274\344\1n\333\362\211" \ + "\376\377\374\1u\210\224\222]oz\1y\214\230\256\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \ + "\1\231\241\251\222]oz\1cu\200\211\376\377\374\1\233\345\364\223\25\274" \ + "\344\1\316\363\374\216\376\377\374\1\235\346\365\230\25\274\344\2%\305" \ + "\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\215\25\274\344" \ + "\1k\327\357\211\376\377\374\1\200\217\225\222]oz\1u\210\224\256\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\256\376\377\374\1\222\241\247\222]oz\1j}\210\211\376\377\374\1\220\343" \ + "\361\223\25\274\344\1\336\367\374\216\376\377\374\1w\333\356\227\25\274" \ + "\344\2#\304\346\336\367\374\214\376\377\374\2\236\347\366\0\276\345\216" \ + "\25\274\344\1M\323\357\211\376\377\374\1\210\227\235\222]oz\1s\206\221" \ + "\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\256\376\377\374\1\211\230\236\222]oz\1n\201\214\211\376" \ + "\377\374\1\206\340\363\223\25\274\344\1\350\371\377\216\376\377\374\1" \ + "i\326\356\226\25\274\344\2#\304\346\336\367\374\214\376\377\374\2\236" \ + "\347\366\0\276\345\217\25\274\344\1M\323\357\211\376\377\374\1\215\234" \ + "\243\222]oz\1m\200\213\256\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\256\376\377\374\1\222\241\247\222]o" \ + "z\1l\177\212\211\376\377\374\1\207\341\364\223\25\274\344\1\336\367\374" \ + "\216\376\377\374\1n\333\362\225\25\274\344\2#\304\346\336\367\374\214" \ + "\376\377\374\2\235\346\365\0\276\345\220\25\274\344\1M\323\357\211\376" \ + "\377\374\1\211\230\236\222]oz\1s\206\221\256\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \ + "\1\231\241\251\222]oz\1ew\202\211\376\377\374\1\231\342\362\223\25\274" \ + "\344\1\320\365\376\216\376\377\374\1\221\344\362\224\25\274\344\2#\304" \ + "\346\336\367\374\214\376\377\374\2\235\346\365\0\276\345\221\25\274\344" \ + "\1i\326\356\211\376\377\374\1\202\221\227\222]oz\1u\210\224\256\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\256\376\377\374\1\242\252\262\222]oz\1^p{\211\376\377\374\1\237\350" \ + "\367\223\25\274\344\1\301\356\366\216\376\377\374\1\333\364\371\223\25" \ + "\274\344\2#\304\346\336\367\374\214\376\377\374\2\356\373\374\0\276\345" \ + "\222\25\274\344\1n\333\362\211\376\377\374\1w\212\226\222]oz\1\202\221" \ + "\227\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\256\376\377\374\1\246\256\266\223]oz\1\370\372\367\210" \ + "\376\377\374\1\260\353\366\223\25\274\344\1\233\345\364\217\376\377\374" \ + "\1,\311\352\221\25\274\344\2#\304\346\336\367\374\215\376\377\374\1\312" \ + "\357\370\223\25\274\344\1\204\335\361\211\376\377\374\1o\202\215\222" \ + "]oz\1\205\224\232\256\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\256\376\377\374\1\252\262\272\223]oz\1\355" \ + "\362\365\210\376\377\374\1\314\361\372\223\25\274\344\1m\332\361\217" \ + "\376\377\374\1\273\354\371\220\25\274\344\2#\304\346\336\367\374\216" \ + "\376\377\374\1\233\345\364\223\25\274\344\1\236\347\366\211\376\377\374" \ + "\1i{\206\222]oz\1\211\230\236\256\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\266\277\307" \ + "\223]oz\1\340\345\350\210\376\377\374\1\356\373\374\223\25\274\344\1" \ + ",\311\352\220\376\377\374\1i\326\356\216\25\274\344\2#\304\346\336\367" \ + "\374\217\376\377\374\1\\\326\355\223\25\274\344\1\274\355\373\210\376" \ + "\377\374\2\372\374\371_q|\222]oz\1\226\246\254\256\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377" \ + "\374\1\307\315\317\223]oz\1\313\320\322\211\376\377\374\1\0\302\351\222" \ + "\25\274\344\2\0\276\345\357\374\375\217\376\377\374\2\370\376\377G\317" \ + "\353\214\25\274\344\2(\307\350\336\367\374\220\376\377\374\1%\305\347" \ + "\223\25\274\344\1\336\367\374\210\376\377\374\1\343\350\353\223]oz\1" \ + "\254\264\274\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\256\376\377\374\1\327\334\337\223]oz\1\257\267" \ + "\277\211\376\377\374\1B\314\347\223\25\274\344\1\237\350\367\220\376" \ + "\377\374\3\370\376\377n\333\362\31\275\345\211\25\274\344\2J\321\355" \ + "\356\373\374\220\376\377\374\1\315\362\373\223\25\274\344\1\0\301\350" \ + "\211\376\377\374\1\316\323\326\223]oz\1\276\303\305\256\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376" \ + "\377\374\1\346\354\356\223]oz\1\225\245\253\211\376\377\374\1k\327\357" \ + "\223\25\274\344\1G\317\353\222\376\377\374\3\320\365\376Z\325\354\0\301" \ + "\350\204\25\274\344\3\0\276\345G\317\353\274\355\373\222\376\377\374" \ + "\1w\333\356\223\25\274\344\1""3\314\355\211\376\377\374\1\264\274\305" \ + "\223]oz\1\315\322\325\256\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\256\376\377\374\1\366\373\376\223]o" \ + "z\1z\215\231\211\376\377\374\1\237\350\367\223\25\274\344\2\31\275\345" \ + "\335\366\373\223\376\377\374\2\370\376\377\316\363\374\202\261\354\367" \ + "\2\313\360\371\366\373\376\223\376\377\374\2\370\376\377\0\302\351\223" \ + "\25\274\344\1n\333\362\211\376\377\374\1\230\250\256\223]oz\1\334\342" \ + "\344\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\257\376\377\374\1m\200\213\222]oz\1ew\202\211\376\377" \ + "\374\1\347\370\376\224\25\274\344\1m\332\361\254\376\377\374\1\233\345" \ + "\364\224\25\274\344\1\261\354\367\211\376\377\374\1}\220\233\223]oz\1" \ + "\366\370\364\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\257\376\377\374\1\211\230\236\223]oz\1\335\343" \ + "\345\211\376\377\374\1%\305\347\223\25\274\344\2\0\276\345\336\367\374" \ + "\252\376\377\374\2\367\375\377#\304\346\223\25\274\344\2\31\275\345\357" \ + "\374\375\210\376\377\374\2\370\372\367as~\222]oz\1m\200\213\257\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\257\376\377\374\1\251\261\271\223]oz\1\264\274\305\211\376\377\374\1" \ + "k\327\357\224\25\274\344\1L\322\356\252\376\377\374\1\206\340\363\224" \ + "\25\274\344\1""3\314\355\211\376\377\374\1\322\330\332\223]oz\1\211\230" \ + "\236\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\257\376\377\374\1\305\312\315\223]oz\1\211\230\236\211" \ + "\376\377\374\1\301\356\366\225\25\274\344\1\262\355\370\250\376\377\374" \ + "\2\334\365\372\0\276\345\224\25\274\344\1\220\343\361\211\376\377\374" \ + "\1\252\262\272\223]oz\1\251\261\271\257\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\337\344" \ + "\346\223]oz\2ew\202\373\375\372\210\376\377\374\2\370\376\377#\304\346" \ + "\224\25\274\344\2\0\302\351\347\370\376\246\376\377\374\2\367\375\377" \ + ",\311\352\224\25\274\344\2\0\276\345\337\370\375\211\376\377\374\1\177" \ + "\216\224\223]oz\1\305\312\315\257\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\2\373\375\372" \ + "dv\201\223]oz\1\331\336\341\211\376\377\374\1n\333\362\225\25\274\344" \ + "\2B\314\347\370\376\377\245\376\377\374\1i\326\356\225\25\274\344\1B" \ + "\314\347\211\376\377\374\2\362\367\371_q|\223]oz\1\346\354\356\257\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\260\376\377\374\1\210\227\235\223]oz\1\246\256\266\211\376\377\374" \ + "\1\316\363\374\226\25\274\344\2M\323\357\370\376\377\243\376\377\374" \ + "\1\206\340\363\226\25\274\344\1\256\350\364\211\376\377\374\1\301\306" \ + "\311\223]oz\1k~\211\260\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\260\376\377\374\1\257\267\277\223]oz\2i" \ + "{\206\373\375\372\211\376\377\374\1G\317\353\226\25\274\344\2\\\326\355" \ + "\370\376\377\241\376\377\374\1\220\343\361\226\25\274\344\2\0\304\352" \ + "\370\376\377\211\376\377\374\1\204\223\231\223]oz\1\230\240\250\260\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\260\376\377\374\1\331\336\341\224]oz\1\317\324\327\211\376\377\374" \ + "\1\301\356\366\227\25\274\344\2J\321\355\367\375\377\237\376\377\374" \ + "\1w\333\356\227\25\274\344\1\206\340\363\211\376\377\374\2\351\356\360" \ + "^p{\223]oz\1\277\304\306\260\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\260\376\377\374\2\372\374\371cu" \ + "\200\223]oz\1\222\241\247\212\376\377\374\1/\312\353\227\25\274\344\2" \ + ",\311\352\334\365\372\234\376\377\374\2\356\373\374I\320\354\227\25\274" \ + "\344\2\0\301\350\366\373\376\211\376\377\374\1\261\271\302\224]oz\1\343" \ + "\350\353\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\261\376\377\374\1\216\236\244\223]oz\2cu\200\362" \ + "\367\371\211\376\377\374\1\261\354\367\230\25\274\344\3\0\276\345\233" \ + "\345\364\370\376\377\231\376\377\374\2\262\355\370\0\304\352\230\25\274" \ + "\344\1\206\340\363\212\376\377\374\1s\206\221\223]oz\1q\204\217\261\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\261\376\377\374\1\305\312\315\224]oz\1\257\267\277\212\376\377\374" \ + "\1B\314\347\231\25\274\344\2""1\313\354\303\361\370\226\376\377\374\2" \ + "\334\365\372J\321\355\231\25\274\344\2#\304\346\366\373\376\211\376\377" \ + "\374\1\315\322\325\224]oz\1\251\261\271\261\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\261\376\377\374\2\362" \ + "\367\371as~\223]oz\2hz\205\370\372\367\211\376\377\374\2\334\365\372" \ + "\0\276\345\232\25\274\344\3B\314\347\262\355\370\370\376\377\221\376" \ + "\377\374\3\313\360\371L\322\356\0\276\345\232\25\274\344\1\256\350\364" \ + "\212\376\377\374\1z\215\231\224]oz\1\333\340\343\261\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376" \ + "\377\374\1\207\226\234\224]oz\1\270\300\311\212\376\377\374\1w\333\356" \ + "\234\25\274\344\4\0\304\352m\332\361\273\354\371\366\373\376\212\376" \ + "\377\374\4\370\376\377\302\357\367y\336\360(\307\350\234\25\274\344\1" \ + "B\314\347\212\376\377\374\1\324\331\333\224]oz\1k~\211\262\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262" \ + "\376\377\374\1\301\306\311\224]oz\2k~\211\372\374\371\211\376\377\374" \ + "\2\366\373\376(\307\350\236\25\274\344\5\31\275\345,\311\352M\323\357" \ + "y\336\360\211\342\365\202\233\345\364\5\220\343\361\204\335\361Z\325" \ + "\3541\313\354\0\276\345\236\25\274\344\2\0\301\350\336\367\374\212\376" \ + "\377\374\1\205\224\232\224]oz\1\246\256\266\262\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376\377\374" \ + "\2\367\371\366dv\201\224]oz\1\274\301\303\212\376\377\374\2\315\362\373" \ + "\0\276\345\307\25\274\344\1\236\347\366\212\376\377\374\1\325\332\334" \ + "\225]oz\1\341\346\351\262\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\263\376\377\374\1\236\246\256\224]o" \ + "z\2fx\203\356\363\366\212\376\377\374\1\221\344\362\306\25\274\344\1" \ + "M\323\357\212\376\377\374\2\372\374\371t\207\222\224]oz\1\177\216\224" \ + "\263\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\263\376\377\374\1\333\340\343\225]oz\1\226\246\254\213\376" \ + "\377\374\1L\322\356\304\25\274\344\2,\311\352\366\373\376\212\376\377" \ + "\374\1\265\276\306\225]oz\1\302\307\312\263\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1u\210" \ + "\224\224]oz\2^p{\331\336\341\212\376\377\374\2\366\373\376/\312\353\302" \ + "\25\274\344\2\0\302\351\336\367\374\212\376\377\374\2\353\360\363dv\201" \ + "\224]oz\2dv\201\364\371\374\263\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\264\376\377\374\1\302\307\312\225" \ + "]oz\2w\212\226\372\374\371\212\376\377\374\2\350\371\377%\305\347\300" \ + "\25\274\344\2\0\301\350\314\361\372\213\376\377\374\1\227\237\247\225" \ + "]oz\1\246\256\266\264\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\264\376\377\374\2\372\374\371l\177\212\225" \ + "]oz\1\252\262\272\213\376\377\374\2\337\370\375\0\304\352\276\25\274" \ + "\344\2\0\276\345\274\355\373\213\376\377\374\1\305\312\315\225]oz\2a" \ + "s~\353\360\363\264\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\265\376\377\374\1\270\300\311\225]oz\2^p{\322" \ + "\330\332\213\376\377\374\2\332\363\370#\304\346\274\25\274\344\2\0\276" \ + "\345\273\354\371\213\376\377\374\2\343\350\353dv\201\225]oz\1\236\246" \ + "\256\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\265\376\377\374\2\365\372\375hz\205\225]oz\2i{\206\354" \ + "\361\364\213\376\377\374\2\337\370\375*\310\351\272\25\274\344\2\0\302" \ + "\351\314\361\372\213\376\377\374\2\371\373\370x\213\227\225]oz\2_q|\346" \ + "\354\356\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\266\376\377\374\1\261\271\302\226]oz\2\205\224\232" \ + "\373\375\372\213\376\377\374\2\356\373\374B\314\347\270\25\274\344\2" \ + "%\305\347\335\366\373\214\376\377\374\1\242\252\262\226]oz\1\231\241" \ + "\251\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\266\376\377\374\2\370\372\367m\200\213\226]oz\1\242" \ + "\252\262\214\376\377\374\2\367\375\377i\326\356\266\25\274\344\2B\314" \ + "\347\350\371\377\214\376\377\374\1\277\304\306\226]oz\2bt\177\351\356" \ + "\360\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\267\376\377\374\1\305\312\315\227]oz\1\261\271\302\215" \ + "\376\377\374\2\250\347\371\0\301\350\262\25\274\344\3\31\275\345\206" \ + "\340\363\370\376\377\214\376\377\374\2\316\323\326_q|\226]oz\1\251\261" \ + "\271\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\270\376\377\374\1y\214\230\226]oz\2^p{\301\306\311\215" \ + "\376\377\374\2\335\366\373/\312\353\260\25\274\344\2#\304\346\312\357" \ + "\370\215\376\377\374\2\330\335\340cu\200\226]oz\2hz\205\366\370\364\267" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\270\376\377\374\1\332\337\342\230\222\241\247\1\353\360\363" \ + "\215\376\377\374\3\370\376\377\231\342\362\0\301\350\254\25\274\344\3" \ + "\0\276\345w\333\356\366\373\376\215\376\377\374\2\365\372\375\236\246" \ + "\256\227\222\241\247\1\307\315\317\270\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\341\376\377\374\3\356\373" \ + "\374i\326\356\0\276\345\251\25\274\344\2J\321\355\335\366\373\341\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\343\376\377\374\3\316\363\374Z\325\354\31\275\345\245\25\274\344" \ + "\2G\317\353\302\357\367\343\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\345\376\377\374\3\336\367\374m\332\361" \ + "\0\276\345\240\25\274\344\3\31\275\345M\323\357\316\363\374\345\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\347\376\377\374\4\366\373\376\237\350\367I\320\354\31\275\345\232\25" \ + "\274\344\4\0\276\345B\314\347\231\342\362\356\373\374\347\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\352" \ + "\376\377\374\4\356\373\374\235\346\365Z\325\354#\304\346\224\25\274\344" \ + "\4\0\302\351L\322\356\221\344\362\336\367\374\352\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\356\376\377" \ + "\374\6\336\367\374\237\350\367w\333\356M\323\357,\311\352\0\276\345\210" \ + "\25\274\344\6\0\276\345*\310\351J\321\355n\333\362\233\345\364\320\365" \ + "\376\356\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\364\376\377\374\10\367\375\377\356\373\374\335\366\373" \ + "\316\363\374\315\362\373\335\366\373\350\371\377\366\373\376\364\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \ + "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\375\376\377\374\202" \ + "\370\376\377\250\376\377\374\1\367\375\377\217\376\377\374\1\367\375" \ + "\377\237\376\377\374\1\367\375\377\230\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374\4\237\350" \ + "\367\0\276\345\31\275\345\203\334\360\245\376\377\374\5\316\363\374#" \ + "\304\346\25\274\344G\317\353\367\375\377\213\376\377\374\5\335\366\373" \ + "(\307\350\25\274\344B\314\347\366\373\376\233\376\377\374\5\356\373\374" \ + "/\312\353\25\274\344*\310\351\337\370\375\226\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374" \ + "\1#\304\346\203\25\274\344\1\357\374\375\244\376\377\374\1i\326\356\203" \ + "\25\274\344\1\260\353\366\213\376\377\374\1n\333\362\203\25\274\344\1" \ + "\235\346\365\233\376\377\374\1\231\342\362\203\25\274\344\1y\336\360" \ + "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \ + "\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377" \ + "\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340" \ + "\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\374\376\377\374\1\0\301\350" \ + "\203\25\274\344\1\336\367\374\244\376\377\374\1I\320\354\203\25\274\344" \ + "\1\231\342\362\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363" \ + "\233\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377" \ + "\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357" \ + "\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274" \ + "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1" \ + "\336\367\374\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362" \ + "\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377" \ + "\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377" \ + "\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377\374\1I\320" \ + "\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357\203\25\274" \ + "\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274\344\1k\327" \ + "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\232\376\377\374\7\311\316\321\211\230\236j}\210cu\200" \ + "n\201\214\233\243\253\333\340\343\206\376\377\374\2\236\246\256dv\201" \ + "\205]oz\4_q|k~\211\222\241\247\337\344\346\210\376\377\374\7\322\330" \ + "\332\222\241\247l\177\212cu\200k~\211\222\241\247\322\330\332\206\376" \ + "\377\374\2\257\267\277gy\204\205]oz\4^p{i{\206\211\230\236\325\332\334" \ + "\210\376\377\374\10\313\360\371\\\326\355%\305\347\0\276\345\0\302\351" \ + "G\317\353\237\350\367\370\376\377\205\376\377\374\2\235\346\365\0\304" \ + "\352\212\25\274\344\4\0\276\345\0\304\352M\323\357\315\362\373\205\376" \ + "\377\374\1\0\301\350\207\25\274\344\4\0\301\350B\314\347\233\345\364" \ + "\370\376\377\207\376\377\374\7\302\357\367M\323\357#\304\346\0\276\345" \ + "\0\304\352J\321\355\260\353\366\210\376\377\374\4\315\362\373M\323\357" \ + "#\304\346\31\275\345\207\25\274\344\1\231\342\362\204\376\377\374\4\323" \ + "\364\367\\\326\355%\305\347\0\276\345\207\25\274\344\1\206\340\363\205" \ + "\376\377\374\10\334\365\372m\332\361(\307\350\0\276\345\0\302\351B\314" \ + "\347\233\345\364\370\376\377\207\376\377\374\4\336\367\374m\332\361(" \ + "\307\350\0\276\345\207\25\274\344\1k\327\357\226\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\230\376\377" \ + "\374\2\356\363\366\202\221\227\206]oz\3^p{\247\257\267\373\375\372\203" \ + "\376\377\374\1\327\334\337\212]oz\2_q|\303\310\313\205\376\377\374\2" \ + "\364\371\374\222\241\247\207]oz\2\222\241\247\370\372\367\203\376\377" \ + "\374\2\353\360\363^p{\212]oz\1\254\264\274\205\376\377\374\2\370\376" \ + "\377m\332\361\207\25\274\344\2B\314\347\350\371\377\203\376\377\374\2" \ + "\370\376\377\0\276\345\216\25\274\344\2\31\275\345\235\346\365\204\376" \ + "\377\374\1\0\301\350\212\25\274\344\2B\314\347\357\374\375\204\376\377" \ + "\374\2\367\375\377Z\325\354\207\25\274\344\2G\317\353\357\374\375\205" \ + "\376\377\374\2\235\346\365\31\275\345\212\25\274\344\1\231\342\362\203" \ + "\376\377\374\2\256\350\364\0\276\345\212\25\274\344\1\206\340\363\204" \ + "\376\377\374\2\206\340\363\31\275\345\206\25\274\344\2*\310\351\335\366" \ + "\373\205\376\377\374\2\302\357\367\0\301\350\212\25\274\344\1k\327\357" \ + "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\227\376\377\374\2\364\371\374u\210\224\211]oz\1\242\252" \ + "\262\203\376\377\374\1\306\314\316\213]oz\2_q|\325\332\334\203\376\377" \ + "\374\2\373\375\372\210\227\235\211]oz\2\211\230\236\373\375\372\202\376" \ + "\377\374\1\330\335\340\214]oz\1\304\311\314\204\376\377\374\1i\326\356" \ + "\211\25\274\344\2*\310\351\366\373\376\202\376\377\374\1\357\374\375" \ + "\220\25\274\344\2\0\276\345\274\355\373\203\376\377\374\1\0\301\350\213" \ + "\25\274\344\1M\323\357\204\376\377\374\1L\322\356\211\25\274\344\2""3" \ + "\314\355\370\376\377\203\376\377\374\2\313\360\371\0\276\345\213\25\274" \ + "\344\1\231\342\362\202\376\377\374\2\333\364\371\0\276\345\213\25\274" \ + "\344\1\206\340\363\203\376\377\374\1\206\340\363\211\25\274\344\2\0\304" \ + "\352\347\370\376\203\376\377\374\2\356\373\374\0\304\352\213\25\274\344" \ + "\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\227\376\377\374\1\251\261\271\213]oz\1\322\330\332" \ + "\202\376\377\374\1\306\314\316\214]oz\1\200\217\225\203\376\377\374\1" \ + "\277\304\306\213]oz\1\277\304\306\202\376\377\374\1\330\335\340\214]" \ + "oz\2j}\210\373\375\372\202\376\377\374\1\273\354\371\213\25\274\344\1" \ + "n\333\362\202\376\377\374\1\357\374\375\221\25\274\344\1""1\313\354\203" \ + "\376\377\374\1\0\301\350\214\25\274\344\1\332\363\370\202\376\377\374" \ + "\1\237\350\367\213\25\274\344\1\206\340\363\203\376\377\374\1I\320\354" \ + "\214\25\274\344\1\231\342\362\202\376\377\374\1M\323\357\214\25\274\344" \ + "\1\206\340\363\202\376\377\374\2\320\365\376\31\275\345\212\25\274\344" \ + "\1L\322\356\203\376\377\374\1\203\334\360\214\25\274\344\1k\327\357\226" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\226\376\377\374\2\370\372\367cu\200\203]oz\5s\206\221\317\324" \ + "\327\343\350\353\276\303\305ew\202\203]oz\1\210\227\235\202\376\377\374" \ + "\1\306\314\316\203]oz\1y\214\230\203\347\355\357\2\346\354\356\264\274" \ + "\305\203]oz\2^p{\357\365\367\202\376\377\374\1p\203\216\203]oz\5k~\211" \ + "\307\315\317\343\350\353\306\314\316k~\211\203]oz\1p\203\216\202\376" \ + "\377\374\1\330\335\340\203]oz\1k~\211\204\347\355\357\2\304\311\314_" \ + "q|\203]oz\1\334\342\344\202\376\377\374\1B\314\347\203\25\274\344\5\0" \ + "\301\350\233\345\364\333\364\371\260\353\366(\307\350\203\25\274\344" \ + "\4\0\276\345\367\375\377\376\377\374\357\374\375\204\25\274\344\203\335" \ + "\366\373\204\25\274\344\3\302\357\367\335\366\373\206\340\363\204\25" \ + "\274\344\1\356\373\374\202\376\377\374\1\0\301\350\203\25\274\344\1\302" \ + "\357\367\203\335\366\373\2\302\357\367\0\304\352\203\25\274\344\1\207" \ + "\341\364\202\376\377\374\1,\311\352\203\25\274\344\5\0\302\351\236\347" \ + "\366\332\363\370\256\350\364#\304\346\203\25\274\344\5\0\302\351\370" \ + "\376\377\376\377\374\370\376\377\0\276\345\203\25\274\344\1w\333\356" \ + "\204\335\366\373\1B\314\347\203\25\274\344\1\231\342\362\202\376\377" \ + "\374\1\0\276\345\203\25\274\344\2m\332\361\334\365\372\203\335\366\373" \ + "\1I\320\354\203\25\274\344\1\206\340\363\202\376\377\374\1i\326\356\203" \ + "\25\274\344\5\0\276\345\206\340\363\323\364\367\273\354\3711\313\354" \ + "\204\25\274\344\1\335\366\373\202\376\377\374\1,\311\352\203\25\274\344" \ + "\2L\322\356\332\363\370\203\335\366\373\1n\333\362\203\25\274\344\1k" \ + "\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\226\376\377\374\1\324\331\333\203]oz\2cu\200\353" \ + "\360\363\203\376\377\374\1\307\315\317\203]oz\4as~\372\374\371\376\377" \ + "\374\306\314\316\203]oz\1\202\221\227\205\376\377\374\1hz\205\203]oz" \ + "\3\341\346\351\376\377\374\347\355\357\203]oz\2^p{\335\343\345\203\376" \ + "\377\374\1\333\340\343\204]oz\3\347\355\357\376\377\374\330\335\340\203" \ + "]oz\1m\200\213\205\376\377\374\1~\215\223\203]oz\4\313\320\322\376\377" \ + "\374\370\376\377\31\275\345\203\25\274\344\1\256\350\364\203\376\377" \ + "\374\2\336\367\374\0\276\345\203\25\274\344\3\274\355\373\376\377\374" \ + "\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367" \ + "\374\202\376\377\374\1\0\301\350\203\25\274\344\1\323\364\367\202\376" \ + "\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374\1n" \ + "\333\362\203\25\274\344\3m\332\361\376\377\374\356\373\374\204\25\274" \ + "\344\1\274\355\373\203\376\377\374\2\323\364\367\0\276\345\203\25\274" \ + "\344\3\315\362\373\376\377\374\335\366\373\203\25\274\344\2\0\276\345" \ + "\370\376\377\204\376\377\374\1I\320\354\203\25\274\344\3\231\342\362" \ + "\376\377\374\366\373\376\204\25\274\344\1\366\373\376\204\376\377\374" \ + "\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\1%\305\347\203" \ + "\25\274\344\1\207\341\364\203\376\377\374\2\360\375\376\0\304\352\203" \ + "\25\274\344\1\233\345\364\202\376\377\374\1\0\301\350\203\25\274\344" \ + "\1\323\364\367\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357" \ + "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\226\376\377\374\1\303\310\313\203]oz\1\204\223\231\204\376" \ + "\377\374\2\370\372\367_q|\203]oz\3\354\361\364\376\377\374\306\314\316" \ + "\203]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351" \ + "\376\377\374\326\333\335\203]oz\1n\201\214\205\376\377\374\1l\177\212" \ + "\203]oz\3\327\334\337\376\377\374\330\335\340\203]oz\1m\200\213\205\376" \ + "\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\337\370\375\203" \ + "\25\274\344\2\31\275\345\370\376\377\204\376\377\374\1""3\314\355\203" \ + "\25\274\344\3\236\347\366\376\377\374\357\374\375\204\25\274\344\203" \ + "\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346" \ + "\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274" \ + "\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357" \ + "\376\377\374\315\362\373\203\25\274\344\1\0\301\350\205\376\377\374\1" \ + "*\310\351\203\25\274\344\3\261\354\367\376\377\374\316\363\374\203\25" \ + "\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \ + "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \ + "\357\203\25\274\344\1\206\340\363\202\376\377\374\1\31\275\345\203\25" \ + "\274\344\1\335\366\373\204\376\377\374\1M\323\357\203\25\274\344\1\203" \ + "\334\360\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204" \ + "\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226" \ + "\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202" \ + "\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205" \ + "\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327" \ + "\203]oz\1as~\205o\202\215\1as~\203]oz\3\317\324\327\376\377\374\330\335" \ + "\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306\314" \ + "\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\205%\305\347" \ + "\1\0\276\345\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204" \ + "\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377" \ + "\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301" \ + "\350\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274" \ + "\344\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\31\275\345\205" \ + "%\305\347\1\0\276\345\203\25\274\344\3\237\350\367\376\377\374\316\363" \ + "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \ + "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \ + "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274" \ + "\344\1#\304\346\204%\305\347\1\0\301\350\203\25\274\344\1w\333\356\202" \ + "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \ + "\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376\377\374" \ + "\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203]oz\3" \ + "\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376\377" \ + "\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215]oz\3" \ + "\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374" \ + "\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25\274" \ + "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376\377" \ + "\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274" \ + "\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \ + "\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376\377\374" \ + "\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363\374\203" \ + "\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \ + "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \ + "\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274\344\1w\333" \ + "\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376" \ + "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376" \ + "\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203" \ + "]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376" \ + "\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215" \ + "]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377" \ + "\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25" \ + "\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376" \ + "\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203" \ + "\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344" \ + "\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376" \ + "\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363" \ + "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \ + "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \ + "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274" \ + "\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \ + "\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\226\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374" \ + "\1ew\202\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221" \ + "\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317" \ + "\324\327\215]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213" \ + "\205\376\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367" \ + "\374\215\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274" \ + "\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#" \ + "\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203" \ + "\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3" \ + "k\327\357\376\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377" \ + "\374\316\363\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354" \ + "\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344" \ + "\205\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377" \ + "\374\215\25\274\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274" \ + "\344\1\336\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327" \ + "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\226\376\377\374\1\300\305\310\203]oz\1\211\230\236\205" \ + "\376\377\374\1bt\177\203]oz\3\352\357\362\376\377\374\306\314\316\203" \ + "]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376" \ + "\377\374\317\324\327\203]oz\1p\203\216\211\335\343\345\3\366\370\364" \ + "\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \ + "\227\203]oz\3\306\314\316\376\377\374\336\367\374\203\25\274\344\1\0" \ + "\276\345\211\314\361\372\3\350\371\377\376\377\374\357\374\375\204\25" \ + "\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374" \ + "\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350" \ + "\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344" \ + "\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\0\302\351\211\314" \ + "\361\372\3\356\373\374\376\377\374\316\363\374\203\25\274\344\1\0\301" \ + "\350\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376\377" \ + "\374\357\374\375\204\25\274\344\205\376\377\374\1M\323\357\203\25\274" \ + "\344\1\206\340\363\202\376\377\374\204\25\274\344\1\301\356\366\210\314" \ + "\361\372\1\337\370\375\202\376\377\374\1\0\301\350\203\25\274\344\1\336" \ + "\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\226\376\377\374\1\314\321\324\203]oz\2l\177\212\372\374\371" \ + "\203\376\377\374\1\333\340\343\203]oz\4^p{\366\373\376\376\377\374\306" \ + "\314\316\203]oz\1\202\221\227\205\376\377\374\1k~\211\203]oz\3\341\346" \ + "\351\376\377\374\320\326\330\203]oz\1t\207\222\213\376\377\374\1\330" \ + "\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306" \ + "\314\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\213\376\377" \ + "\374\1\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336" \ + "\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202" \ + "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \ + "\1n\333\362\203\25\274\344\3k\327\357\376\377\374\303\361\370\203\25" \ + "\274\344\1\0\304\352\213\376\377\374\1\332\363\370\203\25\274\344\1\0" \ + "\276\345\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376" \ + "\377\374\357\374\375\204\25\274\344\1\370\376\377\204\376\377\374\1M" \ + "\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274\344" \ + "\1\356\373\374\213\376\377\374\1\0\301\350\203\25\274\344\1\335\366\373" \ + "\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\226\376\377\374\2\353\360\363^p{\203]oz\5\236\246\256\366\373\376\376" \ + "\377\374\347\355\357w\212\226\203]oz\1~\215\223\202\376\377\374\1\306" \ + "\314\316\203]oz\1\202\221\227\204\376\377\374\2\335\343\345^p{\203]o" \ + "z\3\351\356\360\376\377\374\335\343\345\203]oz\2bt\177\343\350\353\212" \ + "\376\377\374\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \ + "\227\203]oz\3\306\314\316\376\377\374\356\373\374\204\25\274\344\1\274" \ + "\355\373\212\376\377\374\1\357\374\375\204\25\274\344\203\376\377\374" \ + "\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344" \ + "\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \ + "\203\376\377\374\2\367\375\377/\312\353\203\25\274\344\3\204\335\361" \ + "\376\377\374\334\365\372\203\25\274\344\2\0\276\345\314\361\372\212\376" \ + "\377\374\1\356\373\374\204\25\274\344\1\274\355\373\204\376\377\374\1" \ + "I\320\354\203\25\274\344\4\231\342\362\376\377\374\370\376\377\0\276" \ + "\345\203\25\274\344\1\257\351\365\204\376\377\374\1M\323\357\203\25\274" \ + "\344\1\206\340\363\202\376\377\374\1\0\301\350\203\25\274\344\1\233\345" \ + "\364\213\376\377\374\1#\304\346\203\25\274\344\1\207\341\364\204\376" \ + "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\227\376" \ + "\377\374\1\211\230\236\204]oz\3cu\200p\203\216^p{\204]oz\1\277\304\306" \ + "\202\376\377\374\1\306\314\316\203]oz\1dv\201\203~\215\223\2v\211\225" \ + "as~\203]oz\1n\201\214\202\376\377\374\2\371\373\370dv\201\203]oz\2bt" \ + "\177w\212\226\205~\215\223\2\203\222\230\304\311\314\202\376\377\374" \ + "\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]o" \ + "z\1\306\314\316\202\376\377\374\1(\307\350\203\25\274\344\2\0\276\345" \ + "*\310\351\205,\311\352\2""1\313\354\207\341\364\202\376\377\374\1\357" \ + "\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374" \ + "\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377" \ + "\374\1\0\301\350\203\25\274\344\1*\310\351\203,\311\352\1\0\302\351\204" \ + "\25\274\344\4\274\355\373\376\377\374\370\376\377\0\302\351\203\25\274" \ + "\344\2\31\275\345*\310\351\205,\311\352\2B\314\347\231\342\362\203\376" \ + "\377\374\1%\305\347\203\25\274\344\2\0\276\345*\310\351\203,\311\352" \ + "\1\0\301\350\203\25\274\344\1\231\342\362\202\376\377\374\1/\312\353" \ + "\203\25\274\344\2\0\276\345*\310\351\203,\311\352\1\0\301\350\203\25" \ + "\274\344\1\206\340\363\202\376\377\374\1G\317\353\204\25\274\344\1(\307" \ + "\350\205,\311\352\3""1\313\354w\333\356\370\376\377\202\376\377\374\1" \ + "M\323\357\204\25\274\344\1(\307\350\203,\311\352\1\0\304\352\203\25\274" \ + "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\227\376\377\374\2\343\350\353ew\202\211]oz\2" \ + "\177\216\224\373\375\372\202\376\377\374\1\306\314\316\214]oz\1\270\300" \ + "\311\203\376\377\374\1\253\263\273\213]oz\4_q|\352\357\362\376\377\374" \ + "\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\1" \ + "\306\314\316\202\376\377\374\1\233\345\364\214\25\274\344\3\301\356\366" \ + "\376\377\374\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344" \ + "\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374" \ + "\202\376\377\374\1\0\301\350\213\25\274\344\2,\311\352\370\376\377\202" \ + "\376\377\374\1\206\340\363\214\25\274\344\1\316\363\374\202\376\377\374" \ + "\1\233\345\364\214\25\274\344\1\231\342\362\202\376\377\374\1\250\347" \ + "\371\214\25\274\344\1\206\340\363\202\376\377\374\1\273\354\371\214\25" \ + "\274\344\1\236\347\366\202\376\377\374\2\313\360\371\0\276\345\213\25" \ + "\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\230\376\377\374\2\325\332\334gy\204\207" \ + "]oz\2x\213\227\354\361\364\203\376\377\374\1\306\314\316\213]oz\1\225" \ + "\235\245\204\376\377\374\2\372\374\371~\221\235\213]oz\3\333\340\343" \ + "\376\377\374\342\347\352\203]oz\1t\207\222\205\376\377\374\1\211\230" \ + "\236\203]oz\1\317\324\327\203\376\377\374\1M\323\357\213\25\274\344\4" \ + "\237\350\367\376\377\374\367\375\377\0\276\345\202\25\274\344\1\0\276" \ + "\345\203\376\377\374\1\0\301\350\203\25\274\344\1\357\374\375\202\376" \ + "\377\374\1(\307\350\203\25\274\344\1\335\366\373\202\376\377\374\1\0" \ + "\302\351\212\25\274\344\2\0\301\350\333\364\371\203\376\377\374\2\370" \ + "\376\377G\317\353\213\25\274\344\1\273\354\371\203\376\377\374\1M\323" \ + "\357\213\25\274\344\1\237\350\367\203\376\377\374\1k\327\357\213\25\274" \ + "\344\1\231\342\362\203\376\377\374\1w\333\356\213\25\274\344\1\206\340" \ + "\363\203\376\377\374\1\207\341\364\213\25\274\344\1n\333\362\226\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\231\376\377\374\3\351\356\360\231\241\251bt\177\203]oz\3k~\211\257" \ + "\267\277\370\372\367\204\376\377\374\1\306\314\316\211]oz\3gy\204\261" \ + "\271\302\373\375\372\205\376\377\374\3\371\373\370\252\262\272dv\201" \ + "\210]oz\2x\213\227\372\374\371\202\376\377\374\4}\220\233]oz^p{\266\277" \ + "\307\205\376\377\374\5\311\316\321_q|]ozq\204\217\370\372\367\203\376" \ + "\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344\2\0\304\352" \ + "\356\373\374\202\376\377\374\1M\323\357\202\25\274\344\1m\332\361\203" \ + "\376\377\374\1n\333\362\202\25\274\344\1L\322\356\203\376\377\374\1\206" \ + "\340\363\202\25\274\344\2B\314\347\370\376\377\202\376\377\374\1w\333" \ + "\356\210\25\274\344\3\0\276\345L\322\356\336\367\374\205\376\377\374" \ + "\3\370\376\377\204\335\361\0\301\350\210\25\274\344\2(\307\350\366\373" \ + "\376\203\376\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344" \ + "\2#\304\346\356\373\374\204\376\377\374\2\233\345\364\0\302\351\210\25" \ + "\274\344\2\0\302\351\337\370\375\204\376\377\374\2\237\350\367#\304\346" \ + "\210\25\274\344\2\0\301\350\333\364\371\204\376\377\374\2\257\351\365" \ + "%\305\347\210\25\274\344\2\0\276\345\314\361\372\226\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\233\376" \ + "\377\374\4\365\372\375\335\343\345\325\332\334\343\350\353\207\376\377" \ + "\374\1\306\314\316\203]oz\1u\210\224\204\324\331\333\2\335\343\345\373" \ + "\375\372\211\376\377\374\2\372\374\371\334\342\344\206\324\331\333\2" \ + "\331\336\341\372\374\371\203\376\377\374\3\373\375\372\332\337\342\343" \ + "\350\353\207\376\377\374\3\351\356\360\330\335\340\366\373\376\206\376" \ + "\377\374\2\370\376\377\316\363\374\206\273\354\371\2\302\357\367\366" \ + "\373\376\204\376\377\374\2\314\361\372\315\362\373\205\376\377\374\2" \ + "\316\363\374\313\360\371\205\376\377\374\3\332\363\370\312\357\370\370" \ + "\376\377\204\376\377\374\1\316\363\374\206\273\354\371\2\302\357\367" \ + "\356\373\374\211\376\377\374\2\370\376\377\314\361\372\206\273\354\371" \ + "\2\302\357\367\367\375\377\206\376\377\374\2\370\376\377\316\363\374" \ + "\206\273\354\371\2\302\357\367\366\373\376\206\376\377\374\2\370\376" \ + "\377\316\363\374\206\273\354\371\2\301\356\366\357\374\375\207\376\377" \ + "\374\1\332\363\370\206\273\354\371\2\301\356\366\356\373\374\207\376" \ + "\377\374\2\333\364\371\274\355\373\205\273\354\371\2\274\355\373\350" \ + "\371\377\227\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202\221\227" \ + "\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202" \ + "\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203" \ + "]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314" \ + "\316\203]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374" \ + "\1\315\322\325\203]oz\1\211\230\236\377\376\377\374\306\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376" \ + "\377\374\2\360\366\370i{\206\202]oz\1\302\307\312\377\376\377\374\306" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\247\376\377\374\3\357\365\367\313\320\322\335\343\345\377\376" \ + "\377\374\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \ + "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \ + "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \ + "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \ + "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \ + "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \ + "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \ + "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \ + "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \ + "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \ + "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \ + "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \ + "\377\377\377\377\232\377\377\377") + + diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb new file mode 100644 index 0000000000..628ced4d49 --- /dev/null +++ b/meta/recipes-core/psplash/psplash_git.bb @@ -0,0 +1,111 @@ +SUMMARY = "Userspace framebuffer boot logo based on usplash" +DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information." +HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6" + +SRCREV = "afd4e228c606a9998feae44a3fed4474803240b7" +PV = "0.1+git${SRCPV}" +PR = "r15" + +SRC_URI = "git://git.yoctoproject.org/${BPN} \ + file://psplash-init \ + ${SPLASH_IMAGES}" + +SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default" + +python __anonymous() { + oldpkgs = d.getVar("PACKAGES", True).split() + splashfiles = d.getVar('SPLASH_IMAGES', True).split() + pkgs = [] + localpaths = [] + haspng = False + for uri in splashfiles: + fetcher = bb.fetch2.Fetch([uri], d) + flocal = os.path.basename(fetcher.localpath(uri)) + fbase = os.path.splitext(flocal)[0] + outsuffix = fetcher.ud[uri].parm.get("outsuffix") + if not outsuffix: + if fbase.startswith("psplash-"): + outsuffix = fbase[8:] + else: + outsuffix = fbase + if outsuffix.endswith('-img'): + outsuffix = outsuffix[:-4] + outname = "psplash-%s" % outsuffix + if outname == '' or outname in oldpkgs: + bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri)) + else: + pkgs.append(outname) + if flocal.endswith(".png"): + haspng = True + localpaths.append(flocal) + + # Set these so that we have less work to do in do_compile and do_install_append + d.setVar("SPLASH_INSTALL", " ".join(pkgs)) + d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths)) + + if haspng: + d.appendVar("DEPENDS", " gdk-pixbuf-native") + + d.prependVar("PACKAGES", "%s " % (" ".join(pkgs))) + mlprefix = d.getVar('MLPREFIX', True) or '' + pn = d.getVar('PN', True) or '' + for p in pkgs: + ep = '%s%s' % (mlprefix, p) + epsplash = '%s%s' % (mlprefix, 'psplash') + d.setVar("FILES_%s" % ep, "${bindir}/%s" % p) + d.setVar("ALTERNATIVE_%s" % ep, 'psplash') + d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p) + d.appendVar("RDEPENDS_%s" % ep, " %s" % pn) + if p == "psplash-default": + d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep) +} + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig update-rc.d update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash" + +python do_compile () { + import shutil + + # Build a separate executable for each splash image + workdir = d.getVar('WORKDIR', True) + convertscript = "%s/make-image-header.sh" % d.getVar('S', True) + destfile = "%s/psplash-poky-img.h" % d.getVar('S', True) + localfiles = d.getVar('SPLASH_LOCALPATHS', True).split() + outputfiles = d.getVar('SPLASH_INSTALL', True).split() + for localfile, outputfile in zip(localfiles, outputfiles): + if localfile.endswith(".png"): + outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile))) + print(outp[1]) + fbase = os.path.splitext(localfile)[0] + shutil.copyfile("%s-img.h" % fbase, destfile) + else: + shutil.copyfile(os.path.join(workdir, localfile), destfile) + # For some reason just updating the header is not enough, we have to touch the .c + # file in order to get it to rebuild + os.utime("%s/psplash.c" % d.getVar('S', True), None) + bb.build.exec_func("oe_runmake", d) + shutil.copyfile("psplash", outputfile) +} + +do_install_append() { + install -d ${D}/mnt/.psplash/ + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh + install -d ${D}${bindir} + for i in ${SPLASH_INSTALL} ; do + install -m 0755 $i ${D}${bindir}/$i + done + rm -f ${D}${bindir}/psplash +} + +FILES_${PN} += "/mnt/.psplash" + +INITSCRIPT_NAME = "psplash.sh" +INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ." diff --git a/meta/recipes-core/readline/files/acinclude.m4 b/meta/recipes-core/readline/files/acinclude.m4 new file mode 100644 index 0000000000..c30a7d3054 --- /dev/null +++ b/meta/recipes-core/readline/files/acinclude.m4 @@ -0,0 +1,1871 @@ +dnl +dnl Bash specific tests +dnl +dnl Some derived from PDKSH 5.1.3 autoconf tests +dnl + +AC_DEFUN([BASH_C_LONG_LONG], +[AC_CACHE_CHECK(for long long, ac_cv_c_long_long, +[if test "$GCC" = yes; then + ac_cv_c_long_long=yes +else +AC_TRY_RUN([ +int +main() +{ +long long foo = 0; +exit(sizeof(long long) < sizeof(long)); +} +], ac_cv_c_long_long=yes, ac_cv_c_long_long=no) +fi]) +if test $ac_cv_c_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.]) +fi +]) + +dnl +dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX +dnl (< changed to <=) added. +dnl +AC_DEFUN([BASH_C_LONG_DOUBLE], +[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, +[if test "$GCC" = yes; then + ac_cv_c_long_double=yes +else +AC_TRY_RUN([ +int +main() +{ + /* The Stardent Vistra knows sizeof(long double), but does not + support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + /* On IRIX 5.3, the compiler converts long double to double with a warning, + but compiles this successfully. */ + exit(sizeof(long double) <= sizeof(double)); +} +], ac_cv_c_long_double=yes, ac_cv_c_long_double=no) +fi]) +if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.]) +fi +]) + +dnl +dnl Check for . This is separated out so that it can be +dnl AC_REQUIREd. +dnl +dnl BASH_HEADER_INTTYPES +AC_DEFUN([BASH_HEADER_INTTYPES], +[ + AC_CHECK_HEADERS(inttypes.h) +]) + +dnl +dnl check for typedef'd symbols in header files, but allow the caller to +dnl specify the include files to be checked in addition to the default +dnl +dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) +AC_DEFUN([BASH_CHECK_TYPE], +[ +AC_REQUIRE([AC_HEADER_STDC])dnl +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(bash_cv_type_$1, +[AC_EGREP_CPP($1, [#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +$2 +], bash_cv_type_$1=yes, bash_cv_type_$1=no)]) +AC_MSG_RESULT($bash_cv_type_$1) +ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then + AC_DEFINE($4) + fi]) +if test $bash_cv_type_$1 = no; then + AC_DEFINE_UNQUOTED($1, $3) +fi +]) + +dnl +dnl BASH_CHECK_DECL(FUNC) +dnl +dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like +dnl AC_CHECK_DECL +dnl +AC_DEFUN([BASH_CHECK_DECL], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1, +[AC_TRY_LINK( +[ +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif +], +[return !$1;], +bash_cv_decl_$1=yes, bash_cv_decl_$1=no)]) +bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_$1 = yes; then + AC_DEFINE_UNQUOTED($bash_tr_func, 1) +else + AC_DEFINE_UNQUOTED($bash_tr_func, 0) +fi +]) + +AC_DEFUN([BASH_DECL_PRINTF], +[AC_MSG_CHECKING(for declaration of printf in ) +AC_CACHE_VAL(bash_cv_printf_declared, +[AC_TRY_RUN([ +#include +#ifdef __STDC__ +typedef int (*_bashfunc)(const char *, ...); +#else +typedef int (*_bashfunc)(); +#endif +main() +{ +_bashfunc pf; +pf = (_bashfunc) printf; +exit(pf == 0); +} +], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, + [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes) + bash_cv_printf_declared=yes] +)]) +AC_MSG_RESULT($bash_cv_printf_declared) +if test $bash_cv_printf_declared = yes; then +AC_DEFINE(PRINTF_DECLARED) +fi +]) + +AC_DEFUN([BASH_DECL_SBRK], +[AC_MSG_CHECKING(for declaration of sbrk in ) +AC_CACHE_VAL(bash_cv_sbrk_declared, +[AC_EGREP_HEADER(sbrk, unistd.h, + bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)]) +AC_MSG_RESULT($bash_cv_sbrk_declared) +if test $bash_cv_sbrk_declared = yes; then +AC_DEFINE(SBRK_DECLARED) +fi +]) + +dnl +dnl Check for sys_siglist[] or _sys_siglist[] +dnl +AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST], +[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h]) +AC_CACHE_VAL(bash_cv_decl_under_sys_siglist, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif], [ char *msg = _sys_siglist[2]; ], + bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl +AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) +if test $bash_cv_decl_under_sys_siglist = yes; then +AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED) +fi +]) + +AC_DEFUN([BASH_UNDER_SYS_SIGLIST], +[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_MSG_CHECKING([for _sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_under_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef UNDER_SYS_SIGLIST_DECLARED +extern char *_sys_siglist[]; +#endif +main() +{ +char *msg = (char *)_sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) + bash_cv_under_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_under_sys_siglist) +if test $bash_cv_under_sys_siglist = yes; then +AC_DEFINE(HAVE_UNDER_SYS_SIGLIST) +fi +]) + +AC_DEFUN([BASH_SYS_SIGLIST], +[ +AC_CHECK_DECLS([sys_siglist]) +AC_MSG_CHECKING([for sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef HAVE_DECL_SYS_SIGLIST +extern char *sys_siglist[]; +#endif +main() +{ +char *msg = sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, + [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no) + bash_cv_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_sys_siglist) +if test $bash_cv_sys_siglist = yes; then +AC_DEFINE(HAVE_SYS_SIGLIST) +fi +]) + +dnl Check for the various permutations of sys_siglist and make sure we +dnl compile in siglist.o if they're not defined +AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [ +AC_REQUIRE([BASH_SYS_SIGLIST]) +AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_REQUIRE([BASH_FUNC_STRSIGNAL]) +if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then + SIGLIST_O=siglist.o +else + SIGLIST_O= +fi +AC_SUBST([SIGLIST_O]) +]) + +dnl Check for sys_errlist[] and sys_nerr, check for declaration +AC_DEFUN([BASH_SYS_ERRLIST], +[AC_MSG_CHECKING([for sys_errlist and sys_nerr]) +AC_CACHE_VAL(bash_cv_sys_errlist, +[AC_TRY_LINK([#include ], +[extern char *sys_errlist[]; + extern int sys_nerr; + char *msg = sys_errlist[sys_nerr - 1];], + bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl +AC_MSG_RESULT($bash_cv_sys_errlist) +if test $bash_cv_sys_errlist = yes; then +AC_DEFINE(HAVE_SYS_ERRLIST) +fi +]) + +dnl +dnl Check if dup2() does not clear the close on exec flag +dnl +AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK], +[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag) +AC_CACHE_VAL(bash_cv_dup2_broken, +[AC_TRY_RUN([ +#include +#include +main() +{ + int fd1, fd2, fl; + fd1 = open("/dev/null", 2); + if (fcntl(fd1, 2, 1) < 0) + exit(1); + fd2 = dup2(fd1, 1); + if (fd2 < 0) + exit(2); + fl = fcntl(fd2, 1, 0); + /* fl will be 1 if dup2 did not reset the close-on-exec flag. */ + exit(fl != 1); +} +], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, + [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no) + bash_cv_dup2_broken=no]) +]) +AC_MSG_RESULT($bash_cv_dup2_broken) +if test $bash_cv_dup2_broken = yes; then +AC_DEFINE(DUP2_BROKEN) +fi +]) + +AC_DEFUN([BASH_FUNC_STRSIGNAL], +[AC_MSG_CHECKING([for the existence of strsignal]) +AC_CACHE_VAL(bash_cv_have_strsignal, +[AC_TRY_LINK([#include +#include ], +[char *s = (char *)strsignal(2);], + bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)]) +AC_MSG_RESULT($bash_cv_have_strsignal) +if test $bash_cv_have_strsignal = yes; then +AC_DEFINE(HAVE_STRSIGNAL) +fi +]) + +dnl Check to see if opendir will open non-directories (not a nice thing) +AC_DEFUN([BASH_FUNC_OPENDIR_CHECK], +[AC_REQUIRE([AC_HEADER_DIRENT])dnl +AC_MSG_CHECKING(if opendir() opens non-directories) +AC_CACHE_VAL(bash_cv_opendir_not_robust, +[AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +main() +{ +DIR *dir; +int fd, err; +err = mkdir("/tmp/bash-aclocal", 0700); +if (err < 0) { + perror("mkdir"); + exit(1); +} +unlink("/tmp/bash-aclocal/not_a_directory"); +fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666); +write(fd, "\n", 1); +close(fd); +dir = opendir("/tmp/bash-aclocal/not_a_directory"); +unlink("/tmp/bash-aclocal/not_a_directory"); +rmdir("/tmp/bash-aclocal"); +exit (dir == 0); +}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, + [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no) + bash_cv_opendir_not_robust=no] +)]) +AC_MSG_RESULT($bash_cv_opendir_not_robust) +if test $bash_cv_opendir_not_robust = yes; then +AC_DEFINE(OPENDIR_NOT_ROBUST) +fi +]) + +dnl +AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void]) +AC_DEFUN([BASH_TYPE_SIGHANDLER], +[AC_MSG_CHECKING([whether signal handlers are of type void]) +AC_CACHE_VAL(bash_cv_void_sighandler, +[AC_TRY_COMPILE([#include +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" +#endif +void (*signal ()) ();], +[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl +AC_MSG_RESULT($bash_cv_void_sighandler) +if test $bash_cv_void_sighandler = yes; then +AC_DEFINE(VOID_SIGHANDLER) +fi +]) + +dnl +dnl A signed 16-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_BITS16_T], +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(bits16_t, short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(bits16_t, char) +else + AC_CHECK_TYPE(bits16_t, short) +fi +]) + +dnl +dnl An unsigned 16-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_U_BITS16_T], +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned char) +else + AC_CHECK_TYPE(u_bits16_t, unsigned short) +fi +]) + +dnl +dnl A signed 32-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_BITS32_T], +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(bits32_t, int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(bits32_t, long) +else + AC_CHECK_TYPE(bits32_t, int) +fi +]) + +dnl +dnl An unsigned 32-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_U_BITS32_T], +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned long) +else + AC_CHECK_TYPE(u_bits32_t, unsigned int) +fi +]) + +AC_DEFUN([BASH_TYPE_PTRDIFF_T], +[ +if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, int) +elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, long) +elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, [long long]) +else + AC_CHECK_TYPE(ptrdiff_t, int) +fi +]) + +dnl +dnl A signed 64-bit quantity +dnl +AC_DEFUN([BASH_TYPE_BITS64_T], +[ +if test "$ac_cv_sizeof_char_p" = 8; then + AC_CHECK_TYPE(bits64_t, char *) +elif test "$ac_cv_sizeof_double" = 8; then + AC_CHECK_TYPE(bits64_t, double) +elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then + AC_CHECK_TYPE(bits64_t, [long long]) +elif test "$ac_cv_sizeof_long" = 8; then + AC_CHECK_TYPE(bits64_t, long) +else + AC_CHECK_TYPE(bits64_t, double) +fi +]) + +AC_DEFUN([BASH_TYPE_LONG_LONG], +[ +AC_CACHE_CHECK([for long long], bash_cv_type_long_long, +[AC_TRY_LINK([ +long long ll = 1; int i = 63;], +[ +long long llm = (long long) -1; +return ll << i | ll >> i | llm / ll | llm % ll; +], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')]) +if test "$bash_cv_type_long_long" = 'long long'; then + AC_DEFINE(HAVE_LONG_LONG, 1) +fi +]) + +AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG], +[ +AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long, +[AC_TRY_LINK([ +unsigned long long ull = 1; int i = 63;], +[ +unsigned long long ullmax = (unsigned long long) -1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull; +], bash_cv_type_unsigned_long_long='unsigned long long', + bash_cv_type_unsigned_long_long='unsigned long')]) +if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1) +fi +]) + +dnl +dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0) +dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use +dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify +dnl matters, this just checks for rlim_t, quad_t, or long. +dnl +AC_DEFUN([BASH_TYPE_RLIMIT], +[AC_MSG_CHECKING(for size and type of struct rlimit fields) +AC_CACHE_VAL(bash_cv_type_rlimit, +[AC_TRY_COMPILE([#include +#include ], +[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ +AC_TRY_RUN([ +#include +#include +#include +main() +{ +#ifdef HAVE_QUAD_T + struct rlimit rl; + if (sizeof(rl.rlim_cur) == sizeof(quad_t)) + exit(0); +#endif + exit(1); +}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, + [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) + bash_cv_type_rlimit=long])]) +]) +AC_MSG_RESULT($bash_cv_type_rlimit) +if test $bash_cv_type_rlimit = quad_t; then +AC_DEFINE(RLIMTYPE, quad_t) +elif test $bash_cv_type_rlimit = rlim_t; then +AC_DEFINE(RLIMTYPE, rlim_t) +fi +]) + +AC_DEFUN([BASH_FUNC_LSTAT], +[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an +dnl inline function in . +AC_CACHE_CHECK([for lstat], bash_cv_func_lstat, +[AC_TRY_LINK([ +#include +#include +],[ lstat(".",(struct stat *)0); ], +bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) +if test $bash_cv_func_lstat = yes; then + AC_DEFINE(HAVE_LSTAT) +fi +]) + +AC_DEFUN([BASH_FUNC_INET_ATON], +[ +AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton, +[AC_TRY_LINK([ +#include +#include +#include +struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ], +bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)]) +if test $bash_cv_func_inet_aton = yes; then + AC_DEFINE(HAVE_INET_ATON) +else + AC_LIBOBJ(inet_aton) +fi +]) + +AC_DEFUN([BASH_FUNC_GETENV], +[AC_MSG_CHECKING(to see if getenv can be redefined) +AC_CACHE_VAL(bash_cv_getenv_redef, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +char * +getenv (name) +#if defined (__linux__) || defined (__bsdi__) || defined (convex) + const char *name; +#else + char const *name; +#endif /* !__linux__ && !__bsdi__ && !convex */ +{ +return "42"; +} +main() +{ +char *s; +/* The next allows this program to run, but does not allow bash to link + when it redefines getenv. I'm not really interested in figuring out + why not. */ +#if defined (NeXT) +exit(1); +#endif +s = getenv("ABCDE"); +exit(s == 0); /* force optimizer to leave getenv in */ +} +], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, + [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) + bash_cv_getenv_redef=yes] +)]) +AC_MSG_RESULT($bash_cv_getenv_redef) +if test $bash_cv_getenv_redef = yes; then +AC_DEFINE(CAN_REDEFINE_GETENV) +fi +]) + +# We should check for putenv before calling this +AC_DEFUN([BASH_FUNC_STD_PUTENV], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int putenv (char *); +#else +extern int putenv (); +#endif +], +[return (putenv == 0);], +bash_cv_std_putenv=yes, bash_cv_std_putenv=no +)]) +if test $bash_cv_std_putenv = yes; then +AC_DEFINE(HAVE_STD_PUTENV) +fi +]) + +# We should check for unsetenv before calling this +AC_DEFUN([BASH_FUNC_STD_UNSETENV], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int unsetenv (const char *); +#else +extern int unsetenv (); +#endif +], +[return (unsetenv == 0);], +bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no +)]) +if test $bash_cv_std_unsetenv = yes; then +AC_DEFINE(HAVE_STD_UNSETENV) +fi +]) + +AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS], +[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize) +AC_CACHE_VAL(bash_cv_ulimit_maxfds, +[AC_TRY_RUN([ +main() +{ +long maxfds = ulimit(4, 0L); +exit (maxfds == -1L); +} +], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, + [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) + bash_cv_ulimit_maxfds=no] +)]) +AC_MSG_RESULT($bash_cv_ulimit_maxfds) +if test $bash_cv_ulimit_maxfds = yes; then +AC_DEFINE(ULIMIT_MAXFDS) +fi +]) + +AC_DEFUN([BASH_FUNC_GETCWD], +[AC_MSG_CHECKING([if getcwd() calls popen()]) +AC_CACHE_VAL(bash_cv_getcwd_calls_popen, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifndef __STDC__ +#ifndef const +#define const +#endif +#endif + +int popen_called; + +FILE * +popen(command, type) + const char *command; + const char *type; +{ + popen_called = 1; + return (FILE *)NULL; +} + +FILE *_popen(command, type) + const char *command; + const char *type; +{ + return (popen (command, type)); +} + +int +pclose(stream) +FILE *stream; +{ + return 0; +} + +int +_pclose(stream) +FILE *stream; +{ + return 0; +} + +main() +{ + char lbuf[32]; + popen_called = 0; + getcwd(lbuf, 32); + exit (popen_called); +} +], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, + [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no) + bash_cv_getcwd_calls_popen=no] +)]) +AC_MSG_RESULT($bash_cv_getcwd_calls_popen) +if test $bash_cv_getcwd_calls_popen = yes; then +AC_DEFINE(GETCWD_BROKEN) +AC_LIBOBJ(getcwd) +fi +]) + +dnl +dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every +dnl system, we can't use AC_PREREQ +dnl +AC_DEFUN([BASH_FUNC_GETHOSTBYNAME], +[if test "X$bash_cv_have_gethostbyname" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(for gethostbyname in socket library) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_have_gethostbyname, +[AC_TRY_LINK([#include ], +[ struct hostent *hp; + hp = gethostbyname("localhost"); +], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)] +) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_CHECKING(for gethostbyname in socket library) +fi +AC_MSG_RESULT($bash_cv_have_gethostbyname) +if test "$bash_cv_have_gethostbyname" = yes; then +AC_DEFINE(HAVE_GETHOSTBYNAME) +fi +]) + +AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH], +[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH) +AC_CACHE_VAL(bash_cv_fnm_extmatch, +[AC_TRY_RUN([ +#include + +main() +{ +#ifdef FNM_EXTMATCH + exit (0); +#else + exit (1); +#endif +} +], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no, + [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no) + bash_cv_fnm_extmatch=no]) +]) +AC_MSG_RESULT($bash_cv_fnm_extmatch) +if test $bash_cv_fnm_extmatch = yes; then +AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH) +fi +]) + +AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available]) +AC_DEFUN([BASH_FUNC_POSIX_SETJMP], +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp) +AC_CACHE_VAL(bash_cv_func_sigsetjmp, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +main() +{ +#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) +exit (1); +#else + +int code; +sigset_t set, oset; +sigjmp_buf xx; + +/* get the mask */ +sigemptyset(&set); +sigemptyset(&oset); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); + +/* save it */ +code = sigsetjmp(xx, 1); +if (code) + exit(0); /* could get sigmask and compare to oset here. */ + +/* change it */ +sigaddset(&set, SIGINT); +sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); + +/* and siglongjmp */ +siglongjmp(xx, 10); +exit(1); +#endif +}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, + [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) + bash_cv_func_sigsetjmp=missing] +)]) +AC_MSG_RESULT($bash_cv_func_sigsetjmp) +if test $bash_cv_func_sigsetjmp = present; then +AC_DEFINE(HAVE_POSIX_SIGSETJMP) +fi +]) + +AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.]) +AC_DEFUN([BASH_FUNC_STRCOLL], +[ +AC_MSG_CHECKING(whether or not strcoll and strcmp differ) +AC_CACHE_VAL(bash_cv_func_strcoll_broken, +[AC_TRY_RUN([ +#include +#if defined (HAVE_LOCALE_H) +#include +#endif + +main(c, v) +int c; +char *v[]; +{ + int r1, r2; + char *deflocale, *defcoll; + +#ifdef HAVE_SETLOCALE + deflocale = setlocale(LC_ALL, ""); + defcoll = setlocale(LC_COLLATE, ""); +#endif + +#ifdef HAVE_STRCOLL + /* These two values are taken from tests/glob-test. */ + r1 = strcoll("abd", "aXd"); +#else + r1 = 0; +#endif + r2 = strcmp("abd", "aXd"); + + /* These two should both be greater than 0. It is permissible for + a system to return different values, as long as the sign is the + same. */ + + /* Exit with 1 (failure) if these two values are both > 0, since + this tests whether strcoll(3) is broken with respect to strcmp(3) + in the default locale. */ + exit (r1 > 0 && r2 > 0); +} +], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, + [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) + bash_cv_func_strcoll_broken=no] +)]) +AC_MSG_RESULT($bash_cv_func_strcoll_broken) +if test $bash_cv_func_strcoll_broken = yes; then +AC_DEFINE(STRCOLL_BROKEN) +fi +]) + +AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT], +[AC_MSG_CHECKING([for printf floating point output in hex notation]) +AC_CACHE_VAL(bash_cv_printf_a_format, +[AC_TRY_RUN([ +#include +#include + +int +main() +{ + double y = 0.0; + char abuf[1024]; + + sprintf(abuf, "%A", y); + exit(strchr(abuf, 'P') == (char *)0); +} +], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no, + [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no) + bash_cv_printf_a_format=no] +)]) +AC_MSG_RESULT($bash_cv_printf_a_format) +if test $bash_cv_printf_a_format = yes; then +AC_DEFINE(HAVE_PRINTF_A_FORMAT) +fi +]) + +AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC], +[ +AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[ +#include +#include +]) +]) + +AC_DEFUN([BASH_STRUCT_TERMIO_LDISC], +[ +AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[ +#include +#include +]) +]) + +dnl +dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS +dnl +dnl sets bash_cv_struct_stat_st_blocks +dnl +dnl unused for now; we'll see how AC_CHECK_MEMBERS works +dnl +AC_DEFUN([BASH_STRUCT_ST_BLOCKS], +[ +AC_MSG_CHECKING([for struct stat.st_blocks]) +AC_CACHE_VAL(bash_cv_struct_stat_st_blocks, +[AC_TRY_COMPILE( +[ +#include +#include +], +[ +main() +{ +static struct stat a; +if (a.st_blocks) return 0; +return 0; +} +], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no) +]) +AC_MSG_RESULT($bash_cv_struct_stat_st_blocks) +if test "$bash_cv_struct_stat_st_blocks" = "yes"; then +AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS) +fi +]) + +AC_DEFUN([BASH_CHECK_LIB_TERMCAP], +[ +if test "X$bash_cv_termcap_lib" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(which library has the termcap functions) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_termcap_lib, +[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, + [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, + [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, + bash_cv_termcap_lib=gnutermcap)])])])]) +if test "X$_bash_needmsg" = "Xyes"; then +AC_MSG_CHECKING(which library has the termcap functions) +fi +AC_MSG_RESULT(using $bash_cv_termcap_lib) +if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then +LDFLAGS="$LDFLAGS -L./lib/termcap" +TERMCAP_LIB="./lib/termcap/libtermcap.a" +TERMCAP_DEP="./lib/termcap/libtermcap.a" +elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +TERMCAP_LIB=-ltermcap +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfo; then +TERMCAP_LIB=-ltinfo +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncurses; then +TERMCAP_LIB=-lncurses +TERMCAP_DEP= +else +TERMCAP_LIB=-lcurses +TERMCAP_DEP= +fi +]) + +dnl +dnl Check for the presence of getpeername in libsocket. +dnl If libsocket is present, check for libnsl and add it to LIBS if +dnl it's there, since most systems with libsocket require linking +dnl with libnsl as well. This should only be called if getpeername +dnl was not found in libc. +dnl +dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT +dnl AS WELL +dnl +AC_DEFUN([BASH_CHECK_LIB_SOCKET], +[ +if test "X$bash_cv_have_socklib" = "X"; then +_bash_needmsg= +else +AC_MSG_CHECKING(for socket library) +_bash_needmsg=yes +fi +AC_CACHE_VAL(bash_cv_have_socklib, +[AC_CHECK_LIB(socket, getpeername, + bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)]) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_socklib) + _bash_needmsg= +fi +if test $bash_cv_have_socklib = yes; then + # check for libnsl, add it to LIBS if present + if test "X$bash_cv_have_libnsl" = "X"; then + _bash_needmsg= + else + AC_MSG_CHECKING(for libnsl) + _bash_needmsg=yes + fi + AC_CACHE_VAL(bash_cv_have_libnsl, + [AC_CHECK_LIB(nsl, t_open, + bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)]) + if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_libnsl) + _bash_needmsg= + fi + if test $bash_cv_have_libnsl = yes; then + LIBS="-lsocket -lnsl $LIBS" + else + LIBS="-lsocket $LIBS" + fi + AC_DEFINE(HAVE_LIBSOCKET) + AC_DEFINE(HAVE_GETPEERNAME) +fi +]) + +AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_INO], +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(if struct dirent has a d_ino member) +AC_CACHE_VAL(bash_cv_dirent_has_dino, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_ino; +], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_dino) +if test $bash_cv_dirent_has_dino = yes; then +AC_DEFINE(STRUCT_DIRENT_HAS_D_INO) +fi +]) + +AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO], +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(if struct dirent has a d_fileno member) +AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_fileno; +], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_d_fileno) +if test $bash_cv_dirent_has_d_fileno = yes; then +AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO) +fi +]) + +AC_DEFUN([BASH_STRUCT_TIMEVAL], +[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h) +AC_CACHE_VAL(bash_cv_struct_timeval, +[ +AC_EGREP_HEADER(struct timeval, sys/time.h, + bash_cv_struct_timeval=yes, + AC_EGREP_HEADER(struct timeval, time.h, + bash_cv_struct_timeval=yes, + bash_cv_struct_timeval=no)) +]) +AC_MSG_RESULT($bash_cv_struct_timeval) +if test $bash_cv_struct_timeval = yes; then + AC_DEFINE(HAVE_TIMEVAL) +fi +]) + +AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h]) +AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h]) +AC_DEFUN([BASH_STRUCT_WINSIZE], +[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h) +AC_CACHE_VAL(bash_cv_struct_winsize_header, +[AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=ioctl_h, + [AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other) +])]) +if test $bash_cv_struct_winsize_header = ioctl_h; then + AC_MSG_RESULT(sys/ioctl.h) + AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL) +elif test $bash_cv_struct_winsize_header = termios_h; then + AC_MSG_RESULT(termios.h) + AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS) +else + AC_MSG_RESULT(not found) +fi +]) + +dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) +AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines]) +AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines]) +AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines]) +AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE], +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_MSG_CHECKING(for type of signal functions) +AC_CACHE_VAL(bash_cv_signal_vintage, +[ + AC_MSG_WARN([checking for posix...]) + AC_TRY_LINK([#include ],[ + sigset_t ss; + struct sigaction sa; + sigemptyset(&ss); sigsuspend(&ss); + sigaction(SIGINT, &sa, (struct sigaction *) 0); + sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); + ], bash_cv_signal_vintage="posix", + [ + AC_MSG_WARN([checking for 4.2bsd...]) + AC_TRY_LINK([#include ], [ + int mask = sigmask(SIGINT); + sigsetmask(mask); sigblock(mask); sigpause(mask); + ], bash_cv_signal_vintage="4.2bsd", + [ + AC_MSG_WARN([checking for svr3...]) + AC_TRY_LINK([ + #include + RETSIGTYPE foo() { }], [ + int mask = sigmask(SIGINT); + sigset(SIGINT, foo); sigrelse(SIGINT); + sighold(SIGINT); sigpause(SIGINT); + ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7" + )] + )] +) +]) +AC_MSG_RESULT($bash_cv_signal_vintage) +if test "$bash_cv_signal_vintage" = "posix"; then +AC_DEFINE(HAVE_POSIX_SIGNALS) +elif test "$bash_cv_signal_vintage" = "4.2bsd"; then +AC_DEFINE(HAVE_BSD_SIGNALS) +elif test "$bash_cv_signal_vintage" = "svr3"; then +AC_DEFINE(HAVE_USG_SIGHOLD) +fi +]) + +dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process. +AC_DEFUN([BASH_SYS_PGRP_SYNC], +[AC_REQUIRE([AC_FUNC_GETPGRP]) +AC_MSG_CHECKING(whether pgrps need synchronization) +AC_CACHE_VAL(bash_cv_pgrp_pipe, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +main() +{ +# ifdef GETPGRP_VOID +# define getpgID() getpgrp() +# else +# define getpgID() getpgrp(0) +# define setpgid(x,y) setpgrp(x,y) +# endif + int pid1, pid2, fds[2]; + int status; + char ok; + + switch (pid1 = fork()) { + case -1: + exit(1); + case 0: + setpgid(0, getpid()); + exit(0); + } + setpgid(pid1, pid1); + + sleep(2); /* let first child die */ + + if (pipe(fds) < 0) + exit(2); + + switch (pid2 = fork()) { + case -1: + exit(3); + case 0: + setpgid(0, pid1); + ok = getpgID() == pid1; + write(fds[1], &ok, 1); + exit(0); + } + setpgid(pid2, pid1); + + close(fds[1]); + if (read(fds[0], &ok, 1) != 1) + exit(4); + wait(&status); + wait(&status); + exit(ok ? 0 : 5); +} +], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, + [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no) + bash_cv_pgrp_pipe=no]) +]) +AC_MSG_RESULT($bash_cv_pgrp_pipe) +if test $bash_cv_pgrp_pipe = yes; then +AC_DEFINE(PGRP_PIPE) +fi +]) + +AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.]) +AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS], +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) +AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +typedef RETSIGTYPE sigfunc(); + +int nsigint; + +#ifdef HAVE_POSIX_SIGNALS +sigfunc * +set_signal_handler(sig, handler) + int sig; + sigfunc *handler; +{ + struct sigaction act, oact; + act.sa_handler = handler; + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + sigaction (sig, &act, &oact); + return (oact.sa_handler); +} +#else +#define set_signal_handler(s, h) signal(s, h) +#endif + +RETSIGTYPE +sigint(s) +int s; +{ + nsigint++; +} + +main() +{ + nsigint = 0; + set_signal_handler(SIGINT, sigint); + kill((int)getpid(), SIGINT); + kill((int)getpid(), SIGINT); + exit(nsigint != 2); +} +], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, + [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no) + bash_cv_must_reinstall_sighandlers=no] +)]) +AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers) +if test $bash_cv_must_reinstall_sighandlers = yes; then +AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) +fi +]) + +dnl check that some necessary job control definitions are present +AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING], +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of necessary job control definitions) +AC_CACHE_VAL(bash_cv_job_control_missing, +[AC_TRY_RUN([ +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +/* Add more tests in here as appropriate. */ +main() +{ +/* signal type */ +#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS) +exit(1); +#endif + +/* signals and tty control. */ +#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT) +exit (1); +#endif + +/* process control */ +#if !defined (WNOHANG) || !defined (WUNTRACED) +exit(1); +#endif + +/* Posix systems have tcgetpgrp and waitpid. */ +#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP) +exit(1); +#endif + +#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID) +exit(1); +#endif + +/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */ +#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3) +exit(1); +#endif + +exit(0); +}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, + [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing) + bash_cv_job_control_missing=missing] +)]) +AC_MSG_RESULT($bash_cv_job_control_missing) +if test $bash_cv_job_control_missing = missing; then +AC_DEFINE(JOB_CONTROL_MISSING) +fi +]) + +dnl check whether named pipes are present +dnl this requires a previous check for mkfifo, but that is awkward to specify +AC_DEFUN([BASH_SYS_NAMED_PIPES], +[AC_MSG_CHECKING(for presence of named pipes) +AC_CACHE_VAL(bash_cv_sys_named_pipes, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Add more tests in here as appropriate. */ +main() +{ +int fd, err; + +#if defined (HAVE_MKFIFO) +exit (0); +#endif + +#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO)) +exit (1); +#endif + +#if defined (NeXT) +exit (1); +#endif +err = mkdir("/tmp/bash-aclocal", 0700); +if (err < 0) { + perror ("mkdir"); + exit(1); +} +fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0); +if (fd == -1) { + rmdir ("/tmp/bash-aclocal"); + exit (1); +} +close(fd); +unlink ("/tmp/bash-aclocal/sh-np-autoconf"); +rmdir ("/tmp/bash-aclocal"); +exit(0); +}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, + [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) + bash_cv_sys_named_pipes=missing] +)]) +AC_MSG_RESULT($bash_cv_sys_named_pipes) +if test $bash_cv_sys_named_pipes = missing; then +AC_DEFINE(NAMED_PIPES_MISSING) +fi +]) + +AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR], +[AC_MSG_CHECKING(for default mail directory) +AC_CACHE_VAL(bash_cv_mail_dir, +[if test -d /var/mail; then + bash_cv_mail_dir=/var/mail + elif test -d /var/spool/mail; then + bash_cv_mail_dir=/var/spool/mail + elif test -d /usr/mail; then + bash_cv_mail_dir=/usr/mail + elif test -d /usr/spool/mail; then + bash_cv_mail_dir=/usr/spool/mail + else + bash_cv_mail_dir=unknown + fi +]) +AC_MSG_RESULT($bash_cv_mail_dir) +AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir") +]) + +AC_DEFUN([BASH_HAVE_TIOCGWINSZ], +[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCGWINSZ;], + bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl) +if test $bash_cv_tiocgwinsz_in_ioctl = yes; then +AC_DEFINE(GWINSZ_IN_SYS_IOCTL) +fi +]) + +AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h]) +AC_DEFUN([BASH_HAVE_TIOCSTAT], +[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCSTAT;], + bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl) +if test $bash_cv_tiocstat_in_ioctl = yes; then +AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL) +fi +]) + +AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h]) +AC_DEFUN([BASH_HAVE_FIONREAD], +[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_fionread_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = FIONREAD;], + bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_fionread_in_ioctl) +if test $bash_cv_fionread_in_ioctl = yes; then +AC_DEFINE(FIONREAD_IN_SYS_IOCTL) +fi +]) + +dnl +dnl See if speed_t is declared in . Some versions of linux +dnl require a definition of speed_t each time is included, +dnl but you can only get speed_t if you include (on some +dnl versions) or (on others). +dnl +AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h]) +AC_DEFUN([BASH_CHECK_SPEED_T], +[AC_MSG_CHECKING(for speed_t in sys/types.h) +AC_CACHE_VAL(bash_cv_speed_t_in_sys_types, +[AC_TRY_COMPILE([#include ], [speed_t x;], + bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)]) +AC_MSG_RESULT($bash_cv_speed_t_in_sys_types) +if test $bash_cv_speed_t_in_sys_types = yes; then +AC_DEFINE(SPEED_T_IN_SYS_TYPES) +fi +]) + +AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h]) +AC_DEFUN([BASH_CHECK_GETPW_FUNCS], +[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h) +AC_CACHE_VAL(bash_cv_getpw_declared, +[AC_EGREP_CPP(getpwuid, +[ +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +], +bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)]) +AC_MSG_RESULT($bash_cv_getpw_declared) +if test $bash_cv_getpw_declared = yes; then +AC_DEFINE(HAVE_GETPW_DECLS) +fi +]) + +AC_DEFUN([BASH_CHECK_DEV_FD], +[AC_MSG_CHECKING(whether /dev/fd is available) +AC_CACHE_VAL(bash_cv_dev_fd, +[if test -d /dev/fd && test -r /dev/fd/0; then + bash_cv_dev_fd=standard + elif test -d /proc/self/fd && test -r /proc/self/fd/0; then + bash_cv_dev_fd=whacky + else + bash_cv_dev_fd=absent + fi +]) +AC_MSG_RESULT($bash_cv_dev_fd) +if test $bash_cv_dev_fd = "standard"; then + AC_DEFINE(HAVE_DEV_FD) + AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/") +elif test $bash_cv_dev_fd = "whacky"; then + AC_DEFINE(HAVE_DEV_FD) + AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/") +fi +]) + +AC_DEFUN([BASH_CHECK_DEV_STDIN], +[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available) +AC_CACHE_VAL(bash_cv_dev_stdin, +[if test -d /dev/fd && test -r /dev/stdin; then + bash_cv_dev_stdin=present + elif test -d /proc/self/fd && test -r /dev/stdin; then + bash_cv_dev_stdin=present + else + bash_cv_dev_stdin=absent + fi +]) +AC_MSG_RESULT($bash_cv_dev_stdin) +if test $bash_cv_dev_stdin = "present"; then + AC_DEFINE(HAVE_DEV_STDIN) +fi +]) + +dnl +dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions +dnl +AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT], +[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines]) +AC_CACHE_VAL(bash_cv_kernel_rlimit, +[AC_TRY_COMPILE([ +#include +#include +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=no, +[AC_TRY_COMPILE([ +#include +#define _KERNEL +#include +#undef _KERNEL +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] +)]) +AC_MSG_RESULT($bash_cv_kernel_rlimit) +if test $bash_cv_kernel_rlimit = yes; then +AC_DEFINE(RLIMIT_NEEDS_KERNEL) +fi +]) + +dnl +dnl Check for 64-bit off_t -- used for malloc alignment +dnl +dnl C does not allow duplicate case labels, so the compile will fail if +dnl sizeof(off_t) is > 4. +dnl +AC_DEFUN([BASH_CHECK_OFF_T_64], +[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64, +AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +],[ +switch (0) case 0: case (sizeof (off_t) <= 4):; +], bash_cv_off_t_64=no, bash_cv_off_t_64=yes)) +if test $bash_cv_off_t_64 = yes; then + AC_DEFINE(HAVE_OFF_T_64) +fi]) + +AC_DEFUN([BASH_CHECK_RTSIGS], +[AC_MSG_CHECKING(for unusable real-time signals due to large values) +AC_CACHE_VAL(bash_cv_unusable_rtsigs, +[AC_TRY_RUN([ +#include +#include + +#ifndef NSIG +# define NSIG 64 +#endif + +main () +{ + int n_sigs = 2 * NSIG; +#ifdef SIGRTMIN + int rtmin = SIGRTMIN; +#else + int rtmin = 0; +#endif + + exit(rtmin < n_sigs); +}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no, + [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes) + bash_cv_unusable_rtsigs=yes] +)]) +AC_MSG_RESULT($bash_cv_unusable_rtsigs) +if test $bash_cv_unusable_rtsigs = yes; then +AC_DEFINE(UNUSABLE_RT_SIGNALS) +fi +]) + +dnl +dnl check for availability of multibyte characters and functions +dnl +AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function]) +AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function]) +AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t]) +AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET]) +AC_DEFUN([BASH_CHECK_MULTIBYTE], +[ +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) +AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) + +AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t, +[AC_TRY_RUN([ +#include +int +main () +{ + mbstate_t ps; + return 0; +}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)]) +if test $bash_cv_have_mbstate_t = yes; then + AC_DEFINE(HAVE_MBSTATE_T) +fi + +AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset, +[AC_TRY_LINK( +[#include ], +[char* cs = nl_langinfo(CODESET);], +bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)]) +if test $bash_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET) +fi + +]) + +dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB +dnl require: +dnl AC_PROG_CC +dnl BASH_CHECK_LIB_TERMCAP + +AC_DEFUN([RL_LIB_READLINE_VERSION], +[ +AC_REQUIRE([BASH_CHECK_LIB_TERMCAP]) + +AC_MSG_CHECKING([version of installed readline library]) + +# What a pain in the ass this is. + +# save cpp and ld options +_save_CFLAGS="$CFLAGS" +_save_LDFLAGS="$LDFLAGS" +_save_LIBS="$LIBS" + +# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This +# allows the caller to do something like $_rl_prefix=$withval if the user +# specifies --with-installed-readline=PREFIX as an argument to configure + +if test -z "$ac_cv_rl_prefix"; then +test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} +fi + +eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include +eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib + +LIBS="$LIBS -lreadline ${TERMCAP_LIB}" +CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" +LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" + +AC_TRY_RUN([ +#include +#include + +main() +{ + FILE *fp; + fp = fopen("conftest.rlv", "w"); + if (fp == 0) exit(1); + fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); + fclose(fp); + exit(0); +} +], +ac_cv_rl_version=`cat conftest.rlv`, +ac_cv_rl_version='0.0', +ac_cv_rl_version='4.2') + +CFLAGS="$_save_CFLAGS" +LDFLAGS="$_save_LDFLAGS" +LIBS="$_save_LIBS" + +RL_MAJOR=0 +RL_MINOR=0 + +# ( +case "$ac_cv_rl_version" in +2*|3*|4*|5*|6*|7*|8*|9*) + RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` + RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'` + ;; +esac + +# ((( +case $RL_MAJOR in +[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;; +[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;; +*) _RL_MAJOR=00 ;; +esac + +# ((( +case $RL_MINOR in +[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;; +[[0-9]]) _RL_MINOR=0$RL_MINOR ;; +*) _RL_MINOR=00 ;; +esac + +RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" + +# Readline versions greater than 4.2 have these defines in readline.h + +if test $ac_cv_rl_version = '0.0' ; then + AC_MSG_WARN([Could not test version of installed readline library.]) +elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then + # set these for use by the caller + RL_PREFIX=$ac_cv_rl_prefix + RL_LIBDIR=$ac_cv_rl_libdir + RL_INCLUDEDIR=$ac_cv_rl_includedir + AC_MSG_RESULT($ac_cv_rl_version) +else + +AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library]) + +AC_SUBST(RL_VERSION) +AC_SUBST(RL_MAJOR) +AC_SUBST(RL_MINOR) + +# set these for use by the caller +RL_PREFIX=$ac_cv_rl_prefix +RL_LIBDIR=$ac_cv_rl_libdir +RL_INCLUDEDIR=$ac_cv_rl_includedir + +AC_MSG_RESULT($ac_cv_rl_version) + +fi +]) + +AC_DEFUN(BASH_FUNC_CTYPE_NONASCII, +[ +AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters) +AC_CACHE_VAL(bash_cv_func_ctype_nonascii, +[AC_TRY_RUN([ +#ifdef HAVE_LOCALE_H +#include +#endif +#include +#include + +main(c, v) +int c; +char *v[]; +{ + char *deflocale; + unsigned char x; + int r1, r2; + +#ifdef HAVE_SETLOCALE + /* We take a shot here. If that locale is not known, try the + system default. We try this one because '\342' (226) is + known to be a printable character in that locale. */ + deflocale = setlocale(LC_ALL, "en_US.ISO8859-1"); + if (deflocale == 0) + deflocale = setlocale(LC_ALL, ""); +#endif + + x = '\342'; + r1 = isprint(x); + x -= 128; + r2 = isprint(x); + exit (r1 == 0 || r2 == 0); +} +], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no, + [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no) + bash_cv_func_ctype_nonascii=no] +)]) +AC_MSG_RESULT($bash_cv_func_ctype_nonascii) +if test $bash_cv_func_ctype_nonascii = yes; then +AC_DEFINE(CTYPE_NON_ASCII) +fi +]) + +AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T, +[AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t, +[AC_TRY_LINK([ +#include +],[ sig_atomic_t x; ], +ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)]) +if test "$ac_cv_have_sig_atomic_t" = "no" +then + AC_CHECK_TYPE(sig_atomic_t,int) +fi +]) diff --git a/meta/recipes-core/readline/files/norpath.patch b/meta/recipes-core/readline/files/norpath.patch new file mode 100644 index 0000000000..5d71582b70 --- /dev/null +++ b/meta/recipes-core/readline/files/norpath.patch @@ -0,0 +1,21 @@ +This support script ends up hardcoding unnecessary rpaths into the libraries. We +will search $libdir automatically so this is just wastes space. There may be some +cases this is necessary but our use cases aren't one of them. + +Upstream-Status: Inappropriate + +RP 2012/2/23 + +Index: readline-6.2/support/shobj-conf +=================================================================== +--- readline-6.2.orig/support/shobj-conf 2012-02-23 11:06:37.193179379 +0000 ++++ readline-6.2/support/shobj-conf 2012-02-23 11:06:50.049178918 +0000 +@@ -114,7 +114,7 @@ + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' + +- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' ++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + diff --git a/meta/recipes-core/readline/readline-5.2/acinclude.m4 b/meta/recipes-core/readline/readline-5.2/acinclude.m4 new file mode 100644 index 0000000000..8a45f99084 --- /dev/null +++ b/meta/recipes-core/readline/readline-5.2/acinclude.m4 @@ -0,0 +1,1815 @@ +dnl +dnl Bash specific tests +dnl +dnl Some derived from PDKSH 5.1.3 autoconf tests +dnl + +AC_DEFUN([BASH_C_LONG_LONG], +[AC_CACHE_CHECK(for long long, ac_cv_c_long_long, +[if test "$GCC" = yes; then + ac_cv_c_long_long=yes +else +AC_TRY_RUN([ +int +main() +{ +long long foo = 0; +exit(sizeof(long long) < sizeof(long)); +} +], ac_cv_c_long_long=yes, ac_cv_c_long_long=no) +fi]) +if test $ac_cv_c_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.]) +fi +]) + +dnl +dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX +dnl (< changed to <=) added. +dnl +AC_DEFUN([BASH_C_LONG_DOUBLE], +[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, +[if test "$GCC" = yes; then + ac_cv_c_long_double=yes +else +AC_TRY_RUN([ +int +main() +{ + /* The Stardent Vistra knows sizeof(long double), but does not + support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + /* On IRIX 5.3, the compiler converts long double to double with a warning, + but compiles this successfully. */ + exit(sizeof(long double) <= sizeof(double)); +} +], ac_cv_c_long_double=yes, ac_cv_c_long_double=no) +fi]) +if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.]) +fi +]) + +dnl +dnl Check for . This is separated out so that it can be +dnl AC_REQUIREd. +dnl +dnl BASH_HEADER_INTTYPES +AC_DEFUN([BASH_HEADER_INTTYPES], +[ + AC_CHECK_HEADERS(inttypes.h) +]) + +dnl +dnl check for typedef'd symbols in header files, but allow the caller to +dnl specify the include files to be checked in addition to the default +dnl +dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) +AC_DEFUN([BASH_CHECK_TYPE], +[ +AC_REQUIRE([AC_HEADER_STDC])dnl +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(bash_cv_type_$1, +[AC_EGREP_CPP($1, [#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +$2 +], bash_cv_type_$1=yes, bash_cv_type_$1=no)]) +AC_MSG_RESULT($bash_cv_type_$1) +ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then + AC_DEFINE($4) + fi]) +if test $bash_cv_type_$1 = no; then + AC_DEFINE_UNQUOTED($1, $3) +fi +]) + +dnl +dnl BASH_CHECK_DECL(FUNC) +dnl +dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like +dnl AC_CHECK_DECL +dnl +AC_DEFUN([BASH_CHECK_DECL], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1, +[AC_TRY_LINK( +[ +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif +], +[return !$1;], +bash_cv_decl_$1=yes, bash_cv_decl_$1=no)]) +bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_$1 = yes; then + AC_DEFINE_UNQUOTED($bash_tr_func, 1) +else + AC_DEFINE_UNQUOTED($bash_tr_func, 0) +fi +]) + +AC_DEFUN([BASH_DECL_PRINTF], +[AC_MSG_CHECKING(for declaration of printf in ) +AC_CACHE_VAL(bash_cv_printf_declared, +[AC_TRY_RUN([ +#include +#ifdef __STDC__ +typedef int (*_bashfunc)(const char *, ...); +#else +typedef int (*_bashfunc)(); +#endif +main() +{ +_bashfunc pf; +pf = (_bashfunc) printf; +exit(pf == 0); +} +], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, + [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes) + bash_cv_printf_declared=yes] +)]) +AC_MSG_RESULT($bash_cv_printf_declared) +if test $bash_cv_printf_declared = yes; then +AC_DEFINE(PRINTF_DECLARED) +fi +]) + +AC_DEFUN([BASH_DECL_SBRK], +[AC_MSG_CHECKING(for declaration of sbrk in ) +AC_CACHE_VAL(bash_cv_sbrk_declared, +[AC_EGREP_HEADER(sbrk, unistd.h, + bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)]) +AC_MSG_RESULT($bash_cv_sbrk_declared) +if test $bash_cv_sbrk_declared = yes; then +AC_DEFINE(SBRK_DECLARED) +fi +]) + +dnl +dnl Check for sys_siglist[] or _sys_siglist[] +dnl +AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST], +[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h]) +AC_CACHE_VAL(bash_cv_decl_under_sys_siglist, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif], [ char *msg = _sys_siglist[2]; ], + bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl +AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) +if test $bash_cv_decl_under_sys_siglist = yes; then +AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED) +fi +]) + +AC_DEFUN([BASH_UNDER_SYS_SIGLIST], +[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_MSG_CHECKING([for _sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_under_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef UNDER_SYS_SIGLIST_DECLARED +extern char *_sys_siglist[]; +#endif +main() +{ +char *msg = (char *)_sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) + bash_cv_under_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_under_sys_siglist) +if test $bash_cv_under_sys_siglist = yes; then +AC_DEFINE(HAVE_UNDER_SYS_SIGLIST) +fi +]) + +AC_DEFUN([BASH_SYS_SIGLIST], +[ +AC_CHECK_DECLS([sys_siglist]) +AC_MSG_CHECKING([for sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef HAVE_DECL_SYS_SIGLIST +extern char *sys_siglist[]; +#endif +main() +{ +char *msg = sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, + [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no) + bash_cv_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_sys_siglist) +if test $bash_cv_sys_siglist = yes; then +AC_DEFINE(HAVE_SYS_SIGLIST) +fi +]) + +dnl Check for the various permutations of sys_siglist and make sure we +dnl compile in siglist.o if they're not defined +AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [ +AC_REQUIRE([BASH_SYS_SIGLIST]) +AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_REQUIRE([BASH_FUNC_STRSIGNAL]) +if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then + SIGLIST_O=siglist.o +else + SIGLIST_O= +fi +AC_SUBST([SIGLIST_O]) +]) + +dnl Check for sys_errlist[] and sys_nerr, check for declaration +AC_DEFUN([BASH_SYS_ERRLIST], +[AC_MSG_CHECKING([for sys_errlist and sys_nerr]) +AC_CACHE_VAL(bash_cv_sys_errlist, +[AC_TRY_LINK([#include ], +[extern char *sys_errlist[]; + extern int sys_nerr; + char *msg = sys_errlist[sys_nerr - 1];], + bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl +AC_MSG_RESULT($bash_cv_sys_errlist) +if test $bash_cv_sys_errlist = yes; then +AC_DEFINE(HAVE_SYS_ERRLIST) +fi +]) + +dnl +dnl Check if dup2() does not clear the close on exec flag +dnl +AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK], +[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag) +AC_CACHE_VAL(bash_cv_dup2_broken, +[AC_TRY_RUN([ +#include +#include +main() +{ + int fd1, fd2, fl; + fd1 = open("/dev/null", 2); + if (fcntl(fd1, 2, 1) < 0) + exit(1); + fd2 = dup2(fd1, 1); + if (fd2 < 0) + exit(2); + fl = fcntl(fd2, 1, 0); + /* fl will be 1 if dup2 did not reset the close-on-exec flag. */ + exit(fl != 1); +} +], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, + [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no) + bash_cv_dup2_broken=no]) +]) +AC_MSG_RESULT($bash_cv_dup2_broken) +if test $bash_cv_dup2_broken = yes; then +AC_DEFINE(DUP2_BROKEN) +fi +]) + +AC_DEFUN([BASH_FUNC_STRSIGNAL], +[AC_MSG_CHECKING([for the existence of strsignal]) +AC_CACHE_VAL(bash_cv_have_strsignal, +[AC_TRY_LINK([#include +#include ], +[char *s = (char *)strsignal(2);], + bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)]) +AC_MSG_RESULT($bash_cv_have_strsignal) +if test $bash_cv_have_strsignal = yes; then +AC_DEFINE(HAVE_STRSIGNAL) +fi +]) + +dnl Check to see if opendir will open non-directories (not a nice thing) +AC_DEFUN([BASH_FUNC_OPENDIR_CHECK], +[AC_REQUIRE([AC_HEADER_DIRENT])dnl +AC_MSG_CHECKING(if opendir() opens non-directories) +AC_CACHE_VAL(bash_cv_opendir_not_robust, +[AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +main() +{ +DIR *dir; +int fd, err; +err = mkdir("/tmp/bash-aclocal", 0700); +if (err < 0) { + perror("mkdir"); + exit(1); +} +unlink("/tmp/bash-aclocal/not_a_directory"); +fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666); +write(fd, "\n", 1); +close(fd); +dir = opendir("/tmp/bash-aclocal/not_a_directory"); +unlink("/tmp/bash-aclocal/not_a_directory"); +rmdir("/tmp/bash-aclocal"); +exit (dir == 0); +}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, + [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no) + bash_cv_opendir_not_robust=no] +)]) +AC_MSG_RESULT($bash_cv_opendir_not_robust) +if test $bash_cv_opendir_not_robust = yes; then +AC_DEFINE(OPENDIR_NOT_ROBUST) +fi +]) + +dnl +AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void]) +AC_DEFUN([BASH_TYPE_SIGHANDLER], +[AC_MSG_CHECKING([whether signal handlers are of type void]) +AC_CACHE_VAL(bash_cv_void_sighandler, +[AC_TRY_COMPILE([#include +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" +#endif +void (*signal ()) ();], +[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl +AC_MSG_RESULT($bash_cv_void_sighandler) +if test $bash_cv_void_sighandler = yes; then +AC_DEFINE(VOID_SIGHANDLER) +fi +]) + +dnl +dnl A signed 16-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_BITS16_T], +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(bits16_t, short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(bits16_t, char) +else + AC_CHECK_TYPE(bits16_t, short) +fi +]) + +dnl +dnl An unsigned 16-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_U_BITS16_T], +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned char) +else + AC_CHECK_TYPE(u_bits16_t, unsigned short) +fi +]) + +dnl +dnl A signed 32-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_BITS32_T], +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(bits32_t, int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(bits32_t, long) +else + AC_CHECK_TYPE(bits32_t, int) +fi +]) + +dnl +dnl An unsigned 32-bit integer quantity +dnl +AC_DEFUN([BASH_TYPE_U_BITS32_T], +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned long) +else + AC_CHECK_TYPE(u_bits32_t, unsigned int) +fi +]) + +AC_DEFUN([BASH_TYPE_PTRDIFF_T], +[ +if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, int) +elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, long) +elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, [long long]) +else + AC_CHECK_TYPE(ptrdiff_t, int) +fi +]) + +dnl +dnl A signed 64-bit quantity +dnl +AC_DEFUN([BASH_TYPE_BITS64_T], +[ +if test "$ac_cv_sizeof_char_p" = 8; then + AC_CHECK_TYPE(bits64_t, char *) +elif test "$ac_cv_sizeof_double" = 8; then + AC_CHECK_TYPE(bits64_t, double) +elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then + AC_CHECK_TYPE(bits64_t, [long long]) +elif test "$ac_cv_sizeof_long" = 8; then + AC_CHECK_TYPE(bits64_t, long) +else + AC_CHECK_TYPE(bits64_t, double) +fi +]) + +AC_DEFUN([BASH_TYPE_LONG_LONG], +[ +AC_CACHE_CHECK([for long long], bash_cv_type_long_long, +[AC_TRY_LINK([ +long long ll = 1; int i = 63;], +[ +long long llm = (long long) -1; +return ll << i | ll >> i | llm / ll | llm % ll; +], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')]) +if test "$bash_cv_type_long_long" = 'long long'; then + AC_DEFINE(HAVE_LONG_LONG, 1) +fi +]) + +AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG], +[ +AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long, +[AC_TRY_LINK([ +unsigned long long ull = 1; int i = 63;], +[ +unsigned long long ullmax = (unsigned long long) -1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull; +], bash_cv_type_unsigned_long_long='unsigned long long', + bash_cv_type_unsigned_long_long='unsigned long')]) +if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1) +fi +]) + +dnl +dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0) +dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use +dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify +dnl matters, this just checks for rlim_t, quad_t, or long. +dnl +AC_DEFUN([BASH_TYPE_RLIMIT], +[AC_MSG_CHECKING(for size and type of struct rlimit fields) +AC_CACHE_VAL(bash_cv_type_rlimit, +[AC_TRY_COMPILE([#include +#include ], +[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ +AC_TRY_RUN([ +#include +#include +#include +main() +{ +#ifdef HAVE_QUAD_T + struct rlimit rl; + if (sizeof(rl.rlim_cur) == sizeof(quad_t)) + exit(0); +#endif + exit(1); +}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, + [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) + bash_cv_type_rlimit=long])]) +]) +AC_MSG_RESULT($bash_cv_type_rlimit) +if test $bash_cv_type_rlimit = quad_t; then +AC_DEFINE(RLIMTYPE, quad_t) +elif test $bash_cv_type_rlimit = rlim_t; then +AC_DEFINE(RLIMTYPE, rlim_t) +fi +]) + +AC_DEFUN([BASH_FUNC_LSTAT], +[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an +dnl inline function in . +AC_CACHE_CHECK([for lstat], bash_cv_func_lstat, +[AC_TRY_LINK([ +#include +#include +],[ lstat(".",(struct stat *)0); ], +bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) +if test $bash_cv_func_lstat = yes; then + AC_DEFINE(HAVE_LSTAT) +fi +]) + +AC_DEFUN([BASH_FUNC_INET_ATON], +[ +AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton, +[AC_TRY_LINK([ +#include +#include +#include +struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ], +bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)]) +if test $bash_cv_func_inet_aton = yes; then + AC_DEFINE(HAVE_INET_ATON) +else + AC_LIBOBJ(inet_aton) +fi +]) + +AC_DEFUN([BASH_FUNC_GETENV], +[AC_MSG_CHECKING(to see if getenv can be redefined) +AC_CACHE_VAL(bash_cv_getenv_redef, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +char * +getenv (name) +#if defined (__linux__) || defined (__bsdi__) || defined (convex) + const char *name; +#else + char const *name; +#endif /* !__linux__ && !__bsdi__ && !convex */ +{ +return "42"; +} +main() +{ +char *s; +/* The next allows this program to run, but does not allow bash to link + when it redefines getenv. I'm not really interested in figuring out + why not. */ +#if defined (NeXT) +exit(1); +#endif +s = getenv("ABCDE"); +exit(s == 0); /* force optimizer to leave getenv in */ +} +], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, + [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) + bash_cv_getenv_redef=yes] +)]) +AC_MSG_RESULT($bash_cv_getenv_redef) +if test $bash_cv_getenv_redef = yes; then +AC_DEFINE(CAN_REDEFINE_GETENV) +fi +]) + +# We should check for putenv before calling this +AC_DEFUN([BASH_FUNC_STD_PUTENV], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int putenv (char *); +#else +extern int putenv (); +#endif +], +[return (putenv == 0);], +bash_cv_std_putenv=yes, bash_cv_std_putenv=no +)]) +if test $bash_cv_std_putenv = yes; then +AC_DEFINE(HAVE_STD_PUTENV) +fi +]) + +# We should check for unsetenv before calling this +AC_DEFUN([BASH_FUNC_STD_UNSETENV], +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int unsetenv (const char *); +#else +extern int unsetenv (); +#endif +], +[return (unsetenv == 0);], +bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no +)]) +if test $bash_cv_std_unsetenv = yes; then +AC_DEFINE(HAVE_STD_UNSETENV) +fi +]) + +AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS], +[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize) +AC_CACHE_VAL(bash_cv_ulimit_maxfds, +[AC_TRY_RUN([ +main() +{ +long maxfds = ulimit(4, 0L); +exit (maxfds == -1L); +} +], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, + [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) + bash_cv_ulimit_maxfds=no] +)]) +AC_MSG_RESULT($bash_cv_ulimit_maxfds) +if test $bash_cv_ulimit_maxfds = yes; then +AC_DEFINE(ULIMIT_MAXFDS) +fi +]) + +AC_DEFUN([BASH_FUNC_GETCWD], +[AC_MSG_CHECKING([if getcwd() calls popen()]) +AC_CACHE_VAL(bash_cv_getcwd_calls_popen, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifndef __STDC__ +#ifndef const +#define const +#endif +#endif + +int popen_called; + +FILE * +popen(command, type) + const char *command; + const char *type; +{ + popen_called = 1; + return (FILE *)NULL; +} + +FILE *_popen(command, type) + const char *command; + const char *type; +{ + return (popen (command, type)); +} + +int +pclose(stream) +FILE *stream; +{ + return 0; +} + +int +_pclose(stream) +FILE *stream; +{ + return 0; +} + +main() +{ + char lbuf[32]; + popen_called = 0; + getcwd(lbuf, 32); + exit (popen_called); +} +], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, + [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no) + bash_cv_getcwd_calls_popen=no] +)]) +AC_MSG_RESULT($bash_cv_getcwd_calls_popen) +if test $bash_cv_getcwd_calls_popen = yes; then +AC_DEFINE(GETCWD_BROKEN) +AC_LIBOBJ(getcwd) +fi +]) + +dnl +dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every +dnl system, we can't use AC_PREREQ +dnl +AC_DEFUN([BASH_FUNC_GETHOSTBYNAME], +[if test "X$bash_cv_have_gethostbyname" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(for gethostbyname in socket library) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_have_gethostbyname, +[AC_TRY_LINK([#include ], +[ struct hostent *hp; + hp = gethostbyname("localhost"); +], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)] +) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_CHECKING(for gethostbyname in socket library) +fi +AC_MSG_RESULT($bash_cv_have_gethostbyname) +if test "$bash_cv_have_gethostbyname" = yes; then +AC_DEFINE(HAVE_GETHOSTBYNAME) +fi +]) + +AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH], +[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH) +AC_CACHE_VAL(bash_cv_fnm_extmatch, +[AC_TRY_RUN([ +#include + +main() +{ +#ifdef FNM_EXTMATCH + exit (0); +#else + exit (1); +#endif +} +], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no, + [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no) + bash_cv_fnm_extmatch=no]) +]) +AC_MSG_RESULT($bash_cv_fnm_extmatch) +if test $bash_cv_fnm_extmatch = yes; then +AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH) +fi +]) + +AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available]) +AC_DEFUN([BASH_FUNC_POSIX_SETJMP], +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp) +AC_CACHE_VAL(bash_cv_func_sigsetjmp, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +main() +{ +#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) +exit (1); +#else + +int code; +sigset_t set, oset; +sigjmp_buf xx; + +/* get the mask */ +sigemptyset(&set); +sigemptyset(&oset); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); + +/* save it */ +code = sigsetjmp(xx, 1); +if (code) + exit(0); /* could get sigmask and compare to oset here. */ + +/* change it */ +sigaddset(&set, SIGINT); +sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); + +/* and siglongjmp */ +siglongjmp(xx, 10); +exit(1); +#endif +}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, + [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) + bash_cv_func_sigsetjmp=missing] +)]) +AC_MSG_RESULT($bash_cv_func_sigsetjmp) +if test $bash_cv_func_sigsetjmp = present; then +AC_DEFINE(HAVE_POSIX_SIGSETJMP) +fi +]) + +AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.]) +AC_DEFUN([BASH_FUNC_STRCOLL], +[ +AC_MSG_CHECKING(whether or not strcoll and strcmp differ) +AC_CACHE_VAL(bash_cv_func_strcoll_broken, +[AC_TRY_RUN([ +#include +#if defined (HAVE_LOCALE_H) +#include +#endif + +main(c, v) +int c; +char *v[]; +{ + int r1, r2; + char *deflocale, *defcoll; + +#ifdef HAVE_SETLOCALE + deflocale = setlocale(LC_ALL, ""); + defcoll = setlocale(LC_COLLATE, ""); +#endif + +#ifdef HAVE_STRCOLL + /* These two values are taken from tests/glob-test. */ + r1 = strcoll("abd", "aXd"); +#else + r1 = 0; +#endif + r2 = strcmp("abd", "aXd"); + + /* These two should both be greater than 0. It is permissible for + a system to return different values, as long as the sign is the + same. */ + + /* Exit with 1 (failure) if these two values are both > 0, since + this tests whether strcoll(3) is broken with respect to strcmp(3) + in the default locale. */ + exit (r1 > 0 && r2 > 0); +} +], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, + [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) + bash_cv_func_strcoll_broken=no] +)]) +AC_MSG_RESULT($bash_cv_func_strcoll_broken) +if test $bash_cv_func_strcoll_broken = yes; then +AC_DEFINE(STRCOLL_BROKEN) +fi +]) + +AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT], +[AC_MSG_CHECKING([for printf floating point output in hex notation]) +AC_CACHE_VAL(bash_cv_printf_a_format, +[AC_TRY_RUN([ +#include +#include + +int +main() +{ + double y = 0.0; + char abuf[1024]; + + sprintf(abuf, "%A", y); + exit(strchr(abuf, 'P') == (char *)0); +} +], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no, + [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no) + bash_cv_printf_a_format=no] +)]) +AC_MSG_RESULT($bash_cv_printf_a_format) +if test $bash_cv_printf_a_format = yes; then +AC_DEFINE(HAVE_PRINTF_A_FORMAT) +fi +]) + +AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC], +[ +AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[ +#include +#include +]) +]) + +AC_DEFUN([BASH_STRUCT_TERMIO_LDISC], +[ +AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[ +#include +#include +]) +]) + +dnl +dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS +dnl +dnl sets bash_cv_struct_stat_st_blocks +dnl +dnl unused for now; we'll see how AC_CHECK_MEMBERS works +dnl +AC_DEFUN([BASH_STRUCT_ST_BLOCKS], +[ +AC_MSG_CHECKING([for struct stat.st_blocks]) +AC_CACHE_VAL(bash_cv_struct_stat_st_blocks, +[AC_TRY_COMPILE( +[ +#include +#include +], +[ +main() +{ +static struct stat a; +if (a.st_blocks) return 0; +return 0; +} +], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no) +]) +AC_MSG_RESULT($bash_cv_struct_stat_st_blocks) +if test "$bash_cv_struct_stat_st_blocks" = "yes"; then +AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS) +fi +]) + +AC_DEFUN([BASH_CHECK_LIB_TERMCAP], +[ +if test "X$bash_cv_termcap_lib" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(which library has the termcap functions) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_termcap_lib, +[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, + [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, + [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, + bash_cv_termcap_lib=gnutermcap)])])])]) +if test "X$_bash_needmsg" = "Xyes"; then +AC_MSG_CHECKING(which library has the termcap functions) +fi +AC_MSG_RESULT(using $bash_cv_termcap_lib) +if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then +LDFLAGS="$LDFLAGS -L./lib/termcap" +TERMCAP_LIB="./lib/termcap/libtermcap.a" +TERMCAP_DEP="./lib/termcap/libtermcap.a" +elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +TERMCAP_LIB=-ltermcap +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfo; then +TERMCAP_LIB=-ltinfo +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncurses; then +TERMCAP_LIB=-lncurses +TERMCAP_DEP= +else +TERMCAP_LIB=-lcurses +TERMCAP_DEP= +fi +]) + +dnl +dnl Check for the presence of getpeername in libsocket. +dnl If libsocket is present, check for libnsl and add it to LIBS if +dnl it's there, since most systems with libsocket require linking +dnl with libnsl as well. This should only be called if getpeername +dnl was not found in libc. +dnl +dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT +dnl AS WELL +dnl +AC_DEFUN([BASH_CHECK_LIB_SOCKET], +[ +if test "X$bash_cv_have_socklib" = "X"; then +_bash_needmsg= +else +AC_MSG_CHECKING(for socket library) +_bash_needmsg=yes +fi +AC_CACHE_VAL(bash_cv_have_socklib, +[AC_CHECK_LIB(socket, getpeername, + bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)]) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_socklib) + _bash_needmsg= +fi +if test $bash_cv_have_socklib = yes; then + # check for libnsl, add it to LIBS if present + if test "X$bash_cv_have_libnsl" = "X"; then + _bash_needmsg= + else + AC_MSG_CHECKING(for libnsl) + _bash_needmsg=yes + fi + AC_CACHE_VAL(bash_cv_have_libnsl, + [AC_CHECK_LIB(nsl, t_open, + bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)]) + if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_libnsl) + _bash_needmsg= + fi + if test $bash_cv_have_libnsl = yes; then + LIBS="-lsocket -lnsl $LIBS" + else + LIBS="-lsocket $LIBS" + fi + AC_DEFINE(HAVE_LIBSOCKET) + AC_DEFINE(HAVE_GETPEERNAME) +fi +]) + +AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_INO], +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(if struct dirent has a d_ino member) +AC_CACHE_VAL(bash_cv_dirent_has_dino, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_ino; +], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_dino) +if test $bash_cv_dirent_has_dino = yes; then +AC_DEFINE(STRUCT_DIRENT_HAS_D_INO) +fi +]) + +AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO], +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(if struct dirent has a d_fileno member) +AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_fileno; +], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_d_fileno) +if test $bash_cv_dirent_has_d_fileno = yes; then +AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO) +fi +]) + +AC_DEFUN([BASH_STRUCT_TIMEVAL], +[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h) +AC_CACHE_VAL(bash_cv_struct_timeval, +[ +AC_EGREP_HEADER(struct timeval, sys/time.h, + bash_cv_struct_timeval=yes, + AC_EGREP_HEADER(struct timeval, time.h, + bash_cv_struct_timeval=yes, + bash_cv_struct_timeval=no)) +]) +AC_MSG_RESULT($bash_cv_struct_timeval) +if test $bash_cv_struct_timeval = yes; then + AC_DEFINE(HAVE_TIMEVAL) +fi +]) + +AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h]) +AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h]) +AC_DEFUN([BASH_STRUCT_WINSIZE], +[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h) +AC_CACHE_VAL(bash_cv_struct_winsize_header, +[AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=ioctl_h, + [AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other) +])]) +if test $bash_cv_struct_winsize_header = ioctl_h; then + AC_MSG_RESULT(sys/ioctl.h) + AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL) +elif test $bash_cv_struct_winsize_header = termios_h; then + AC_MSG_RESULT(termios.h) + AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS) +else + AC_MSG_RESULT(not found) +fi +]) + +dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) +AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines]) +AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines]) +AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines]) +AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE], +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_MSG_CHECKING(for type of signal functions) +AC_CACHE_VAL(bash_cv_signal_vintage, +[ + AC_MSG_WARN([checking for posix...]) + AC_TRY_LINK([#include ],[ + sigset_t ss; + struct sigaction sa; + sigemptyset(&ss); sigsuspend(&ss); + sigaction(SIGINT, &sa, (struct sigaction *) 0); + sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); + ], bash_cv_signal_vintage="posix", + [ + AC_MSG_WARN([checking for 4.2bsd...]) + AC_TRY_LINK([#include ], [ + int mask = sigmask(SIGINT); + sigsetmask(mask); sigblock(mask); sigpause(mask); + ], bash_cv_signal_vintage="4.2bsd", + [ + AC_MSG_WARN([checking for svr3...]) + AC_TRY_LINK([ + #include + RETSIGTYPE foo() { }], [ + int mask = sigmask(SIGINT); + sigset(SIGINT, foo); sigrelse(SIGINT); + sighold(SIGINT); sigpause(SIGINT); + ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7" + )] + )] +) +]) +AC_MSG_RESULT($bash_cv_signal_vintage) +if test "$bash_cv_signal_vintage" = "posix"; then +AC_DEFINE(HAVE_POSIX_SIGNALS) +elif test "$bash_cv_signal_vintage" = "4.2bsd"; then +AC_DEFINE(HAVE_BSD_SIGNALS) +elif test "$bash_cv_signal_vintage" = "svr3"; then +AC_DEFINE(HAVE_USG_SIGHOLD) +fi +]) + +dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process. +AC_DEFUN([BASH_SYS_PGRP_SYNC], +[AC_REQUIRE([AC_FUNC_GETPGRP]) +AC_MSG_CHECKING(whether pgrps need synchronization) +AC_CACHE_VAL(bash_cv_pgrp_pipe, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +main() +{ +# ifdef GETPGRP_VOID +# define getpgID() getpgrp() +# else +# define getpgID() getpgrp(0) +# define setpgid(x,y) setpgrp(x,y) +# endif + int pid1, pid2, fds[2]; + int status; + char ok; + + switch (pid1 = fork()) { + case -1: + exit(1); + case 0: + setpgid(0, getpid()); + exit(0); + } + setpgid(pid1, pid1); + + sleep(2); /* let first child die */ + + if (pipe(fds) < 0) + exit(2); + + switch (pid2 = fork()) { + case -1: + exit(3); + case 0: + setpgid(0, pid1); + ok = getpgID() == pid1; + write(fds[1], &ok, 1); + exit(0); + } + setpgid(pid2, pid1); + + close(fds[1]); + if (read(fds[0], &ok, 1) != 1) + exit(4); + wait(&status); + wait(&status); + exit(ok ? 0 : 5); +} +], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, + [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no) + bash_cv_pgrp_pipe=no]) +]) +AC_MSG_RESULT($bash_cv_pgrp_pipe) +if test $bash_cv_pgrp_pipe = yes; then +AC_DEFINE(PGRP_PIPE) +fi +]) + +AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.]) +AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS], +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) +AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +typedef RETSIGTYPE sigfunc(); + +int nsigint; + +#ifdef HAVE_POSIX_SIGNALS +sigfunc * +set_signal_handler(sig, handler) + int sig; + sigfunc *handler; +{ + struct sigaction act, oact; + act.sa_handler = handler; + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + sigaction (sig, &act, &oact); + return (oact.sa_handler); +} +#else +#define set_signal_handler(s, h) signal(s, h) +#endif + +RETSIGTYPE +sigint(s) +int s; +{ + nsigint++; +} + +main() +{ + nsigint = 0; + set_signal_handler(SIGINT, sigint); + kill((int)getpid(), SIGINT); + kill((int)getpid(), SIGINT); + exit(nsigint != 2); +} +], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, + [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no) + bash_cv_must_reinstall_sighandlers=no] +)]) +AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers) +if test $bash_cv_must_reinstall_sighandlers = yes; then +AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) +fi +]) + +dnl check that some necessary job control definitions are present +AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING], +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of necessary job control definitions) +AC_CACHE_VAL(bash_cv_job_control_missing, +[AC_TRY_RUN([ +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +/* Add more tests in here as appropriate. */ +main() +{ +/* signal type */ +#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS) +exit(1); +#endif + +/* signals and tty control. */ +#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT) +exit (1); +#endif + +/* process control */ +#if !defined (WNOHANG) || !defined (WUNTRACED) +exit(1); +#endif + +/* Posix systems have tcgetpgrp and waitpid. */ +#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP) +exit(1); +#endif + +#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID) +exit(1); +#endif + +/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */ +#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3) +exit(1); +#endif + +exit(0); +}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, + [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing) + bash_cv_job_control_missing=missing] +)]) +AC_MSG_RESULT($bash_cv_job_control_missing) +if test $bash_cv_job_control_missing = missing; then +AC_DEFINE(JOB_CONTROL_MISSING) +fi +]) + +dnl check whether named pipes are present +dnl this requires a previous check for mkfifo, but that is awkward to specify +AC_DEFUN([BASH_SYS_NAMED_PIPES], +[AC_MSG_CHECKING(for presence of named pipes) +AC_CACHE_VAL(bash_cv_sys_named_pipes, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Add more tests in here as appropriate. */ +main() +{ +int fd, err; + +#if defined (HAVE_MKFIFO) +exit (0); +#endif + +#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO)) +exit (1); +#endif + +#if defined (NeXT) +exit (1); +#endif +err = mkdir("/tmp/bash-aclocal", 0700); +if (err < 0) { + perror ("mkdir"); + exit(1); +} +fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0); +if (fd == -1) { + rmdir ("/tmp/bash-aclocal"); + exit (1); +} +close(fd); +unlink ("/tmp/bash-aclocal/sh-np-autoconf"); +rmdir ("/tmp/bash-aclocal"); +exit(0); +}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, + [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) + bash_cv_sys_named_pipes=missing] +)]) +AC_MSG_RESULT($bash_cv_sys_named_pipes) +if test $bash_cv_sys_named_pipes = missing; then +AC_DEFINE(NAMED_PIPES_MISSING) +fi +]) + +AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR], +[AC_MSG_CHECKING(for default mail directory) +AC_CACHE_VAL(bash_cv_mail_dir, +[if test -d /var/mail; then + bash_cv_mail_dir=/var/mail + elif test -d /var/spool/mail; then + bash_cv_mail_dir=/var/spool/mail + elif test -d /usr/mail; then + bash_cv_mail_dir=/usr/mail + elif test -d /usr/spool/mail; then + bash_cv_mail_dir=/usr/spool/mail + else + bash_cv_mail_dir=unknown + fi +]) +AC_MSG_RESULT($bash_cv_mail_dir) +AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir") +]) + +AC_DEFUN([BASH_HAVE_TIOCGWINSZ], +[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCGWINSZ;], + bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl) +if test $bash_cv_tiocgwinsz_in_ioctl = yes; then +AC_DEFINE(GWINSZ_IN_SYS_IOCTL) +fi +]) + +AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h]) +AC_DEFUN([BASH_HAVE_TIOCSTAT], +[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCSTAT;], + bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl) +if test $bash_cv_tiocstat_in_ioctl = yes; then +AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL) +fi +]) + +AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h]) +AC_DEFUN([BASH_HAVE_FIONREAD], +[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_fionread_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = FIONREAD;], + bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_fionread_in_ioctl) +if test $bash_cv_fionread_in_ioctl = yes; then +AC_DEFINE(FIONREAD_IN_SYS_IOCTL) +fi +]) + +dnl +dnl See if speed_t is declared in . Some versions of linux +dnl require a definition of speed_t each time is included, +dnl but you can only get speed_t if you include (on some +dnl versions) or (on others). +dnl +AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h]) +AC_DEFUN([BASH_CHECK_SPEED_T], +[AC_MSG_CHECKING(for speed_t in sys/types.h) +AC_CACHE_VAL(bash_cv_speed_t_in_sys_types, +[AC_TRY_COMPILE([#include ], [speed_t x;], + bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)]) +AC_MSG_RESULT($bash_cv_speed_t_in_sys_types) +if test $bash_cv_speed_t_in_sys_types = yes; then +AC_DEFINE(SPEED_T_IN_SYS_TYPES) +fi +]) + +AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h]) +AC_DEFUN([BASH_CHECK_GETPW_FUNCS], +[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h) +AC_CACHE_VAL(bash_cv_getpw_declared, +[AC_EGREP_CPP(getpwuid, +[ +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +], +bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)]) +AC_MSG_RESULT($bash_cv_getpw_declared) +if test $bash_cv_getpw_declared = yes; then +AC_DEFINE(HAVE_GETPW_DECLS) +fi +]) + +AC_DEFUN([BASH_CHECK_DEV_FD], +[AC_MSG_CHECKING(whether /dev/fd is available) +AC_CACHE_VAL(bash_cv_dev_fd, +[if test -d /dev/fd && test -r /dev/fd/0; then + bash_cv_dev_fd=standard + elif test -d /proc/self/fd && test -r /proc/self/fd/0; then + bash_cv_dev_fd=whacky + else + bash_cv_dev_fd=absent + fi +]) +AC_MSG_RESULT($bash_cv_dev_fd) +if test $bash_cv_dev_fd = "standard"; then + AC_DEFINE(HAVE_DEV_FD) + AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/") +elif test $bash_cv_dev_fd = "whacky"; then + AC_DEFINE(HAVE_DEV_FD) + AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/") +fi +]) + +AC_DEFUN([BASH_CHECK_DEV_STDIN], +[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available) +AC_CACHE_VAL(bash_cv_dev_stdin, +[if test -d /dev/fd && test -r /dev/stdin; then + bash_cv_dev_stdin=present + elif test -d /proc/self/fd && test -r /dev/stdin; then + bash_cv_dev_stdin=present + else + bash_cv_dev_stdin=absent + fi +]) +AC_MSG_RESULT($bash_cv_dev_stdin) +if test $bash_cv_dev_stdin = "present"; then + AC_DEFINE(HAVE_DEV_STDIN) +fi +]) + +dnl +dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions +dnl +AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT], +[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines]) +AC_CACHE_VAL(bash_cv_kernel_rlimit, +[AC_TRY_COMPILE([ +#include +#include +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=no, +[AC_TRY_COMPILE([ +#include +#define _KERNEL +#include +#undef _KERNEL +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] +)]) +AC_MSG_RESULT($bash_cv_kernel_rlimit) +if test $bash_cv_kernel_rlimit = yes; then +AC_DEFINE(RLIMIT_NEEDS_KERNEL) +fi +]) + +dnl +dnl Check for 64-bit off_t -- used for malloc alignment +dnl +dnl C does not allow duplicate case labels, so the compile will fail if +dnl sizeof(off_t) is > 4. +dnl +AC_DEFUN([BASH_CHECK_OFF_T_64], +[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64, +AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +],[ +switch (0) case 0: case (sizeof (off_t) <= 4):; +], bash_cv_off_t_64=no, bash_cv_off_t_64=yes)) +if test $bash_cv_off_t_64 = yes; then + AC_DEFINE(HAVE_OFF_T_64) +fi]) + +AC_DEFUN([BASH_CHECK_RTSIGS], +[AC_MSG_CHECKING(for unusable real-time signals due to large values) +AC_CACHE_VAL(bash_cv_unusable_rtsigs, +[AC_TRY_RUN([ +#include +#include + +#ifndef NSIG +# define NSIG 64 +#endif + +main () +{ + int n_sigs = 2 * NSIG; +#ifdef SIGRTMIN + int rtmin = SIGRTMIN; +#else + int rtmin = 0; +#endif + + exit(rtmin < n_sigs); +}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no, + [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes) + bash_cv_unusable_rtsigs=yes] +)]) +AC_MSG_RESULT($bash_cv_unusable_rtsigs) +if test $bash_cv_unusable_rtsigs = yes; then +AC_DEFINE(UNUSABLE_RT_SIGNALS) +fi +]) + +dnl +dnl check for availability of multibyte characters and functions +dnl +AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function]) +AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function]) +AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t]) +AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET]) +AC_DEFUN([BASH_CHECK_MULTIBYTE], +[ +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) +AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) + +AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t, +[AC_TRY_RUN([ +#include +int +main () +{ + mbstate_t ps; + return 0; +}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)]) +if test $bash_cv_have_mbstate_t = yes; then + AC_DEFINE(HAVE_MBSTATE_T) +fi + +AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset, +[AC_TRY_LINK( +[#include ], +[char* cs = nl_langinfo(CODESET);], +bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)]) +if test $bash_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET) +fi + +]) + +dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB +dnl require: +dnl AC_PROG_CC +dnl BASH_CHECK_LIB_TERMCAP + +AC_DEFUN([RL_LIB_READLINE_VERSION], +[ +AC_REQUIRE([BASH_CHECK_LIB_TERMCAP]) + +AC_MSG_CHECKING([version of installed readline library]) + +# What a pain in the ass this is. + +# save cpp and ld options +_save_CFLAGS="$CFLAGS" +_save_LDFLAGS="$LDFLAGS" +_save_LIBS="$LIBS" + +# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This +# allows the caller to do something like $_rl_prefix=$withval if the user +# specifies --with-installed-readline=PREFIX as an argument to configure + +if test -z "$ac_cv_rl_prefix"; then +test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} +fi + +eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include +eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib + +LIBS="$LIBS -lreadline ${TERMCAP_LIB}" +CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" +LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" + +AC_TRY_RUN([ +#include +#include + +main() +{ + FILE *fp; + fp = fopen("conftest.rlv", "w"); + if (fp == 0) exit(1); + fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); + fclose(fp); + exit(0); +} +], +ac_cv_rl_version=`cat conftest.rlv`, +ac_cv_rl_version='0.0', +ac_cv_rl_version='4.2') + +CFLAGS="$_save_CFLAGS" +LDFLAGS="$_save_LDFLAGS" +LIBS="$_save_LIBS" + +RL_MAJOR=0 +RL_MINOR=0 + +# ( +case "$ac_cv_rl_version" in +2*|3*|4*|5*|6*|7*|8*|9*) + RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` + RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'` + ;; +esac + +# ((( +case $RL_MAJOR in +[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;; +[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;; +*) _RL_MAJOR=00 ;; +esac + +# ((( +case $RL_MINOR in +[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;; +[[0-9]]) _RL_MINOR=0$RL_MINOR ;; +*) _RL_MINOR=00 ;; +esac + +RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" + +# Readline versions greater than 4.2 have these defines in readline.h + +if test $ac_cv_rl_version = '0.0' ; then + AC_MSG_WARN([Could not test version of installed readline library.]) +elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then + # set these for use by the caller + RL_PREFIX=$ac_cv_rl_prefix + RL_LIBDIR=$ac_cv_rl_libdir + RL_INCLUDEDIR=$ac_cv_rl_includedir + AC_MSG_RESULT($ac_cv_rl_version) +else + +AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library]) + +AC_SUBST(RL_VERSION) +AC_SUBST(RL_MAJOR) +AC_SUBST(RL_MINOR) + +# set these for use by the caller +RL_PREFIX=$ac_cv_rl_prefix +RL_LIBDIR=$ac_cv_rl_libdir +RL_INCLUDEDIR=$ac_cv_rl_includedir + +AC_MSG_RESULT($ac_cv_rl_version) + +fi +]) diff --git a/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/meta/recipes-core/readline/readline-5.2/configure-fix.patch new file mode 100644 index 0000000000..be60a9861e --- /dev/null +++ b/meta/recipes-core/readline/readline-5.2/configure-fix.patch @@ -0,0 +1,26 @@ +Upstream-Status: Pending + +Without this it fails to link against libtermcap causing various missing symbols +issues. + +RP - 8/10/08 + +Index: readline-5.2/configure.in +=================================================================== +--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100 ++++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100 +@@ -211,10 +211,10 @@ + AC_MSG_CHECKING(configuration for building shared libraries) + eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + +-# case "$SHLIB_LIBS" in +-# *curses*|*termcap*|*termlib*) ;; +-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; +-# esac ++ case "$SHLIB_LIBS" in ++ *curses*|*termcap*|*termlib*) ;; ++ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; ++ esac + + AC_SUBST(SHOBJ_CC) + AC_SUBST(SHOBJ_CFLAGS) diff --git a/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch new file mode 100644 index 0000000000..3166b470f2 --- /dev/null +++ b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch @@ -0,0 +1,21 @@ +This support script ends up hardcoding unnecessary rpaths into the libraries. We +will search $libdir automatically so this is just wastes space. There may be some +cases this is necessary but our use cases aren't one of them. + +Upstream-Status: Inappropriate + +Signed-off-by: Saul Wold + +Index: readline-5.2/support/shobj-conf +=================================================================== +--- readline-5.2.orig/support/shobj-conf ++++ readline-5.2/support/shobj-conf +@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*) + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' + +- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' ++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + diff --git a/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/meta/recipes-core/readline/readline-6.3/configure-fix.patch new file mode 100644 index 0000000000..ef3104f8a6 --- /dev/null +++ b/meta/recipes-core/readline/readline-6.3/configure-fix.patch @@ -0,0 +1,35 @@ +Upstream-Status: Pending + +Without this it fails to link against libtermcap causing various missing +symbols issues. + +RP - 8/10/08 + +Support 6.3 which uses configure.ac rather than configure.in. +Signed-off-by: Hongxu Jia +--- + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cea8f91..9075b8f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then + AC_MSG_CHECKING(configuration for building shared libraries) + eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + +-# case "$SHLIB_LIBS" in +-# *curses*|*termcap*|*termlib*) ;; +-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; +-# esac ++ case "$SHLIB_LIBS" in ++ *curses*|*termcap*|*termlib*) ;; ++ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; ++ esac + + AC_SUBST(SHOBJ_CC) + AC_SUBST(SHOBJ_CFLAGS) +-- +1.8.1.2 + diff --git a/meta/recipes-core/readline/readline.inc b/meta/recipes-core/readline/readline.inc new file mode 100644 index 0000000000..6c43e2df11 --- /dev/null +++ b/meta/recipes-core/readline/readline.inc @@ -0,0 +1,37 @@ +SUMMARY = "Library for editing typed command lines" +DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \ +command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \ +additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \ +lines, and perform csh-like history expansion on previous commands." +SECTION = "libs" + +# GPLv2+ (< 6.0), GPLv3+ (>= 6.0) +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +DEPENDS += "ncurses" + +SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \ + file://configure-fix.patch \ + file://norpath.patch \ + file://acinclude.m4" + +S = "${WORKDIR}/${BPN}-${PV}" + +inherit autotools + +LEAD_SONAME = "libreadline.so" + +do_configure_prepend () { + install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/ +} + +do_install_append () { + # Make install doesn't properly install these + oe_libinstall -so -C shlib libhistory ${D}${libdir} + oe_libinstall -so -C shlib libreadline ${D}${libdir} + + rmdir ${D}${bindir} +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/readline/readline_5.2.bb b/meta/recipes-core/readline/readline_5.2.bb new file mode 100644 index 0000000000..05ab26f053 --- /dev/null +++ b/meta/recipes-core/readline/readline_5.2.bb @@ -0,0 +1,82 @@ +SUMMARY = "Library for editing typed command lines" +DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \ +command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \ +additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \ +lines, and perform csh-like history expansion on previous commands." +SECTION = "libs" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f" + +DEPENDS += "ncurses" + +PR = "r9" + +SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \ + ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \ + file://configure-fix.patch \ + file://acinclude.m4 \ + file://fix-redundant-rpath.patch" + +SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751" +SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45" + +SRC_URI[patch1.md5sum] = "9d4d41622aa9b230c57f68548ce87d8f" +SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5" +SRC_URI[patch2.md5sum] = "f03e512d14206e37f7d6a748b56b9476" +SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78" +SRC_URI[patch3.md5sum] = "252b42d8750f1a94b6bdf086612dceb2" +SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934" +SRC_URI[patch4.md5sum] = "a32333c2e603a3ed250514e91050e552" +SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2" +SRC_URI[patch5.md5sum] = "8106796c09b789523a3a78ab69c04b6d" +SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64" +SRC_URI[patch6.md5sum] = "512188e2bf0837f7eca19dbf71f182ae" +SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013" +SRC_URI[patch7.md5sum] = "ac17aca62eb6fb398c9f2fe9de540aff" +SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1" +SRC_URI[patch8.md5sum] = "2484c392db021905f112cf97a94dfd4c" +SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd" +SRC_URI[patch9.md5sum] = "fc6eb35d07914fae5c57d49c12483ff7" +SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf" +SRC_URI[patch10.md5sum] = "7a2bf3dc7ac7680b1461a5701100e91b" +SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e" +SRC_URI[patch11.md5sum] = "ef6cef6822663470f6ac8c517c5a7ec6" +SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6" +SRC_URI[patch12.md5sum] = "e3e9f441c8111589855bc363e5640f6c" +SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e" +SRC_URI[patch13.md5sum] = "3e2e5f543ed268a68fd1fa839faade1a" +SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5" +SRC_URI[patch14.md5sum] = "a1be30e1c6f1099bb5fcef00a2631fb8" +SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817" + +S = "${WORKDIR}/${BPN}-${PV}" + +inherit autotools + +LEAD_SONAME = "libreadline.so" + +do_configure_prepend () { + install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/ +} + +do_install_append () { + # Make install doesn't properly install these + oe_libinstall -so -C shlib libhistory ${D}${libdir} + oe_libinstall -so -C shlib libreadline ${D}${libdir} +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/readline/readline_6.3.bb b/meta/recipes-core/readline/readline_6.3.bb new file mode 100644 index 0000000000..aa30f668b4 --- /dev/null +++ b/meta/recipes-core/readline/readline_6.3.bb @@ -0,0 +1,5 @@ +require readline.inc + +SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a" +SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" + diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch new file mode 100644 index 0000000000..9d828d7026 --- /dev/null +++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch @@ -0,0 +1,15 @@ +Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3600345&group_id=44427&atid=439544] + +Signed-off-by: Marko Lindqvist +diff -Nurd sysfsutils-2.1.0/configure.ac sysfsutils-2.1.0/configure.ac +--- sysfsutils-2.1.0/configure.ac 2006-08-07 08:08:00.000000000 +0300 ++++ sysfsutils-2.1.0/configure.ac 2013-01-11 08:13:08.651550634 +0200 +@@ -2,7 +2,7 @@ + AC_INIT(sysfsutils, 2.1.0, linux-diag-devel@lists.sourceforge.net) + AM_INIT_AUTOMAKE + AC_CONFIG_SRCDIR([config.h.in]) +-AM_CONFIG_HEADER([config.h]) ++AC_CONFIG_HEADERS([config.h]) + + # Checks for KLIBC support (should be before AC_PROG_LIBTOOL and AC_PROG_CC) + AC_CHECK_KLIBC diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch new file mode 100644 index 0000000000..82e725e2ac --- /dev/null +++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch @@ -0,0 +1,65 @@ +Upstream-Status: Pending + +Fix out of tree build issues so ${B} != ${S} works. + +RP 2013/03/18 + +Index: sysfsutils-2.1.0/cmd/Makefile.am +=================================================================== +--- sysfsutils-2.1.0.orig/cmd/Makefile.am 2013-03-08 08:57:27.224556508 +0000 ++++ sysfsutils-2.1.0/cmd/Makefile.am 2013-03-08 08:57:27.480556502 +0000 +@@ -1,6 +1,6 @@ + bin_PROGRAMS = systool + systool_SOURCES = systool.c names.c names.h +-INCLUDES = -I../include ++INCLUDES = -I$(srcdir)/../include + LDADD = ../lib/libsysfs.la + EXTRA_CFLAGS = @EXTRA_CFLAGS@ + AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) +Index: sysfsutils-2.1.0/lib/Makefile.am +=================================================================== +--- sysfsutils-2.1.0.orig/lib/Makefile.am 2013-03-08 08:57:27.224556508 +0000 ++++ sysfsutils-2.1.0/lib/Makefile.am 2013-03-08 08:57:27.480556502 +0000 +@@ -1,7 +1,7 @@ + lib_LTLIBRARIES = libsysfs.la + libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \ + sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h +-INCLUDES = -I../include ++INCLUDES = -I$(srcdir)/../include + libsysfs_la_LDFLAGS = -version-info 2:1:0 + EXTRA_CFLAGS = @EXTRA_CLFAGS@ + libsysfs_la_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS) +Index: sysfsutils-2.1.0/test/Makefile.am +=================================================================== +--- sysfsutils-2.1.0.orig/test/Makefile.am 2013-03-08 08:57:27.224556508 +0000 ++++ sysfsutils-2.1.0/test/Makefile.am 2013-03-08 09:06:48.196543326 +0000 +@@ -2,14 +2,14 @@ + BUILT_SOURCES = test.h + CLEANFILES = test.h + test.h: +- ./create-test ++ $(srcdir)/create-test $(srcdir)/libsysfs.conf + get_device_SOURCES = get_device.c + get_driver_SOURCES = get_driver.c + get_module_SOURCES = get_module.c + testlibsysfs_SOURCES = test.c test_attr.c test_bus.c test_class.c \ + test_device.c test_driver.c test_module.c test_utils.c \ + testout.c test-defs.h libsysfs.conf create-test +-INCLUDES = -I../include ++INCLUDES = -I$(srcdir)/../include + LDADD = ../lib/libsysfs.la + EXTRA_CFLAGS = @EXTRA_CLFAGS@ + AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS) +Index: sysfsutils-2.1.0/test/create-test +=================================================================== +--- sysfsutils-2.1.0.orig/test/create-test 2005-11-28 10:22:10.000000000 +0000 ++++ sysfsutils-2.1.0/test/create-test 2013-03-08 09:07:03.372542838 +0000 +@@ -2,7 +2,7 @@ + + rm -f test.h + +-conf_file=./libsysfs.conf ++conf_file=$1 + + . $conf_file + diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch new file mode 100644 index 0000000000..1a35b7897a --- /dev/null +++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch @@ -0,0 +1,23 @@ +Upstream-Status: Backport [from fedora core 9] + +This patch is from the Fedora Core 9 sysfsutils-2.1.0-3.fc9 package. + +It fixes a problem in the upstream package where not all devices +will be returned by the function. + +The package License indicates this is GPLv2 licensed. + +Signed-off-by: Mark Hatle + +diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c +--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup 2006-09-07 17:01:26.000000000 -0500 ++++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c 2006-09-07 17:01:26.000000000 -0500 +@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void + return 0; + + if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name, +- strlen((char *)a)) == 0) ++ SYSFS_NAME_LEN) == 0) + return 1; + + return 0; diff --git a/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb new file mode 100644 index 0000000000..1d9c476431 --- /dev/null +++ b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb @@ -0,0 +1,29 @@ +SUMMARY = "Tools for working with sysfs" +DESCRIPTION = "Tools for working with the sysfs virtual filesystem. The tool 'systool' can query devices by bus, class and topology." +HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html" + +LICENSE = "GPLv2 & LGPLv2.1" +LICENSE_${PN} = "GPLv2" +LICENSE_libsysfs = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \ + file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \ + file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e" +PR = "r5" + +SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \ + file://sysfsutils-2.0.0-class-dup.patch \ + file://obsolete_automake_macros.patch \ + file://separatebuild.patch" + +SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc" +SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a" +S = "${WORKDIR}/sysfsutils-${PV}" + +inherit autotools + +PACKAGES =+ "libsysfs libsysfs-dev libsysfs-staticdev" +FILES_libsysfs = "${libdir}/lib*${SOLIBS}" +FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}" +FILES_libsysfs-staticdev = "${libdir}/lib*.a" + +export libdir = "${base_libdir}" diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb new file mode 100644 index 0000000000..6419bc2c65 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-compat-units.bb @@ -0,0 +1,41 @@ +SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" + +PR = "r29" + +DEPENDS = "systemd-systemctl-native" + +inherit allarch + +ALLOW_EMPTY_${PN} = "1" + +SYSTEMD_DISABLED_SYSV_SERVICES = " \ + busybox-udhcpc \ + hwclock \ + networking \ + nfsserver \ + nfscommon \ + syslog.busybox \ +" + +pkg_postinst_${PN} () { + cd $D${sysconfdir}/init.d + + echo "Disabling the following sysv scripts: " + + OPTS="" + + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + + for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do + if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service \) ] ; then + echo -n "$i: " ; systemctl ${OPTS} mask $i.service + fi + done ; echo +} + +RDPEPENDS_${PN} = "systemd" diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb new file mode 100644 index 0000000000..13b2dbacec --- /dev/null +++ b/meta/recipes-core/systemd/systemd-serialgetty.bb @@ -0,0 +1,49 @@ +SUMMARY = "Serial terminal support for systemd" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +PR = "r5" + +SERIAL_CONSOLE ?= "115200 ttyS0" + +SRC_URI = "file://serial-getty@.service" + +do_install() { + if [ ! -z "${SERIAL_CONSOLES}" ] ; then + default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'` + install -d ${D}${systemd_unitdir}/system/ + install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ + install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/ + sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service + + tmp="${SERIAL_CONSOLES}" + for entry in $tmp ; do + baudrate=`echo $entry | sed 's/\;.*//'` + ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'` + if [ "$baudrate" = "$default_baudrate" ] ; then + # enable the service + ln -sf ${systemd_unitdir}/system/serial-getty@.service \ + ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service + else + # install custom service file for the non-default baudrate + install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service + sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service + # enable the service + ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \ + ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service + fi + done + fi +} + +RDEPENDS_${PN} = "systemd" + +# This is a machine specific file +FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# As this package is tied to systemd, only build it when we're also building systemd. +python () { + if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): + raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") +} diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service new file mode 100644 index 0000000000..865de3402d --- /dev/null +++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service @@ -0,0 +1,36 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +BindsTo=dev-%i.device +After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +[Service] +ExecStart=-/sbin/agetty --keep-baud %I @BAUDRATE@ $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +[Install] +WantedBy=getty.target diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb new file mode 100644 index 0000000000..72bc77df4f --- /dev/null +++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Wrapper for enabling systemd services" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" + +PR = "r6" + +inherit native + +SRC_URI = "file://systemctl" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/systemctl ${D}${bindir} +} diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl new file mode 100755 index 0000000000..b37f27abfb --- /dev/null +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl @@ -0,0 +1,153 @@ +#!/bin/sh +echo "Started $0 $*" + +ROOT= + +# parse command line params +action= +while [ $# != 0 ]; do + opt="$1" + + case "$opt" in + enable) + shift + + action="$opt" + services="$1" + cmd_args="1" + shift + ;; + disable) + shift + + action="$opt" + services="$1" + cmd_args="1" + shift + ;; + mask) + shift + + action="$opt" + services="$1" + cmd_args="1" + shift + ;; + preset) + shift + + action="$opt" + services="$1" + cmd_args="1" + shift + ;; + --root=*) + ROOT=${opt##--root=} + cmd_args="0" + shift + ;; + *) + if [ "$cmd_args" = "1" ]; then + services="$services $opt" + shift + else + echo "'$opt' is an unkown option; exiting with error" + exit 1 + fi + ;; + esac +done +if [ "$action" = "preset" -a "$service_file" = "" ]; then + services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done) + services="$services $opt" + presetall=1 +fi + +for service in $services; do + if [ "$presetall" = "1" ]; then + action="preset" + fi + if [ "$action" = "mask" ]; then + if [ ! -d $ROOT/etc/systemd/system/ ]; then + mkdir -p $ROOT/etc/systemd/system/ + fi + cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service" + echo "$cmd" + $cmd + exit 0 + fi + + echo "Try to find location of $service..." + # find service file + for p in $ROOT/etc/systemd/system \ + $ROOT/lib/systemd/system \ + $ROOT/usr/lib/systemd/system; do + if [ -e $p/$service ]; then + service_file=$p/$service + service_file=${service_file##$ROOT} + fi + done + if [ -z "$service_file" ]; then + echo "'$service' couldn't be found; exiting with error" + exit 1 + fi + echo "Found $service in $service_file" + + # If any new unit types are added to systemd they should be added + # to this regular expression. + unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)$' + if [ "$action" = "preset" ]; then + action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '` + if [ -z "$action" ]; then + globalpreset=`egrep -sh '\*' $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '` + if [ -n "$globalpreset" ]; then + action="$globalpreset" + else + action="enable" + fi + fi + fi + # create the required symbolic links + wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ + | tr ',' '\n' \ + | grep "$unit_types_re") + + for r in $wanted_by; do + echo "WantedBy=$r found in $service" + if [ "$action" = "enable" ]; then + mkdir -p $ROOT/etc/systemd/system/$r.wants + ln -s $service_file $ROOT/etc/systemd/system/$r.wants + echo "Enabled $service for $wanted_by." + else + rm -f $ROOT/etc/systemd/system/$r.wants/$service + rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants + echo "Disabled $service for $wanted_by." + fi + done + + # create the required symbolic 'Alias' links + alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ + | tr ',' '\n' \ + | grep "$unit_types_re") + + for r in $alias; do + if [ "$action" = "enable" ]; then + mkdir -p $ROOT/etc/systemd/system + ln -s $service_file $ROOT/etc/systemd/system/$r + echo "Enabled $service for $alias." + else + rm -f $ROOT/etc/systemd/system/$r + echo "Disabled $service for $alias." + fi + done + + # call us for the other required scripts + also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ + | tr ',' '\n') + for a in $also; do + echo "Also=$a found in $service" + if [ "$action" = "enable" ]; then + $0 --root=$ROOT enable $a + fi + done +done diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf new file mode 100644 index 0000000000..9ffa88e464 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf @@ -0,0 +1,7 @@ +#This goes hand-in-hand with the base-files of OE-Core. The file must +# be sorted before 'systemd.conf' becuase this attempts to create a file +# inside /var/log. + + +d /var/volatile/log - - - - +d /var/volatile/tmp - - - - diff --git a/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch new file mode 100644 index 0000000000..9fdb3c9ab3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch @@ -0,0 +1,34 @@ +Upstream-Status: Inappropriate [uclibc specific] + +From 7be9273548bcb1f57d011fc252965e45dd2a058c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 21 Aug 2013 19:09:27 -0700 +Subject: [PATCH] uClibc doesn't implement pwritev/preadv + +Lets stub out the testcase for building. + +Signed-off-by: Khem Raj +--- + src/libsystemd-bus/test-bus-memfd.c | 2 ++ + 1 file changed, 2 insertions(+) + +Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c +=================================================================== +--- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 15:03:09.983254602 -0800 ++++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 23:42:10.636652864 -0800 +@@ -151,6 +151,7 @@ + /* check content */ + assert_se(memcmp(buf, "ll", 2) == 0); + ++#ifndef __UCLIBC__ + /* writev it out*/ + iov[0].iov_base = (char *)"ABC"; + iov[0].iov_len = 3; +@@ -173,6 +174,7 @@ + assert_se(memcmp(bufv[0], "ABC", 3) == 0); + assert_se(memcmp(bufv[1], "DEF", 3) == 0); + assert_se(memcmp(bufv[2], "GHI", 3) == 0); ++#endif /* __UCLIBC__ */ + + sd_memfd_free(m); + diff --git a/meta/recipes-core/systemd/systemd/binfmt-install.patch b/meta/recipes-core/systemd/systemd/binfmt-install.patch new file mode 100644 index 0000000000..c2d5099f24 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/binfmt-install.patch @@ -0,0 +1,56 @@ +Don't install dependency links at install time for the binfmt services, use +[Install] blocks so that they get created when the service is enabled like a +traditional service. + +The [Install] blocks were rejected upstream as they don't have a way to "enable" +it on install without static symlinks which can't be disabled, only masked. We +however can do that in a postinst. + +Upstream-Status: Denied +Signed-off-by: Ross Burton + +diff --git a/Makefile.am b/Makefile.am +index 7933de6..78acb6f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3133,10 +3133,6 @@ INSTALL_DIRS += \ + $(prefix)/lib/binfmt.d \ + $(sysconfdir)/binfmt.d + +-SYSINIT_TARGET_WANTS += \ +- systemd-binfmt.service \ +- proc-sys-fs-binfmt_misc.automount +- + endif + + EXTRA_DIST += \ +diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount +index 6be3893..709adef 100644 +--- a/units/proc-sys-fs-binfmt_misc.automount ++++ b/units/proc-sys-fs-binfmt_misc.automount +@@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/ + + [Automount] + Where=/proc/sys/fs/binfmt_misc ++ ++[Install] ++WantedBy=sysinit.target +diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in +index 02dfe77..86d3481 100644 +--- a/units/systemd-binfmt.service.in ++++ b/units/systemd-binfmt.service.in +@@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5) + Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt + DefaultDependencies=no + Conflicts=shutdown.target ++Wants=proc-sys-fs-binfmt_misc.automount + After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount + Before=sysinit.target shutdown.target + ConditionPathIsReadWrite=/proc/sys/ +@@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d + Type=oneshot + RemainAfterExit=yes + ExecStart=@rootlibexecdir@/systemd-binfmt ++ ++[Install] ++WantedBy=sysinit.target diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init new file mode 100644 index 0000000000..ea52be4820 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/init @@ -0,0 +1,104 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +. /etc/init.d/functions + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +readfile () { + filename=$1 + READDATA="" + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + mount -a -t tmpfs 2>/dev/null + + # cache handling + if [ "$DEVCACHE" != "" ]; then + readfile /proc/version + VERSION="$READDATA" + readfile /proc/cmdline + CMDLINE="$READDATA" + readfile /proc/devices + DEVICES="$READDATA" + readfile /proc/atags + ATAGS="$READDATA" + + if [ -e $DEVCACHE ]; then + readfile /etc/udev/cache.data + if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache + fi + else + echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache + fi + fi + + # make_extra_nodes + killproc systemd-udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform + (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name systemd-udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + status systemd-udevd + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch new file mode 100644 index 0000000000..2063268246 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch @@ -0,0 +1,19 @@ +on uclibc secure_getenv is not available +therefore default to using getenv instead + +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: git/src/shared/missing.h +=================================================================== +--- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700 ++++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700 +@@ -233,6 +233,8 @@ + #ifndef HAVE_SECURE_GETENV + # ifdef HAVE___SECURE_GETENV + # define secure_getenv __secure_getenv ++# elif defined __UCLIBC__ ++# define secure_getenv getenv + # else + # error neither secure_getenv nor __secure_getenv are available + # endif diff --git a/meta/recipes-core/systemd/systemd/run-ptest b/meta/recipes-core/systemd/systemd/run-ptest new file mode 100644 index 0000000000..2f6bd93a5b --- /dev/null +++ b/meta/recipes-core/systemd/systemd/run-ptest @@ -0,0 +1,3 @@ +tar -C test -xJf test/sys.tar.xz +make test/rules-test.sh.log +make test/udev-test.pl.log diff --git a/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch new file mode 100644 index 0000000000..c5bee97238 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch @@ -0,0 +1,513 @@ +From a3d59cd1b0a2738d06893948492113f2c35be0af Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 19 Mar 2014 21:41:21 +0100 +Subject: [PATCH] sd-bus: don't use assert_return() to check for disconnected + bus connections + +A terminated connection is a runtime error and not a developer mistake, +hence don't use assert_return() to check for it. + +Upstream-Status: Backport + +Signed-off-by: Jonathan Liu +--- + src/libsystemd/sd-bus/bus-control.c | 20 +++++++++--- + src/libsystemd/sd-bus/bus-convenience.c | 58 +++++++++++++++++++++++++-------- + src/libsystemd/sd-bus/bus-objects.c | 23 +++++++++---- + src/libsystemd/sd-bus/sd-bus.c | 49 ++++++++++++++++++++-------- + 4 files changed, 113 insertions(+), 37 deletions(-) + +diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c +index bb6683e..bd392a2 100644 +--- a/src/libsystemd/sd-bus/bus-control.c ++++ b/src/libsystemd/sd-bus/bus-control.c +@@ -128,12 +128,14 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags) + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(bus->bus_client, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(!(flags & ~(SD_BUS_NAME_ALLOW_REPLACEMENT|SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_QUEUE)), -EINVAL); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(name[0] != ':', -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_request_name_kernel(bus, name, flags); + else +@@ -201,11 +203,13 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) { + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(bus->bus_client, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(name[0] != ':', -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_release_name_kernel(bus, name); + else +@@ -342,9 +346,11 @@ static int bus_list_names_dbus1(sd_bus *bus, char ***acquired, char ***activatab + _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable) { + assert_return(bus, -EINVAL); + assert_return(acquired || activatable, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_list_names_kernel(bus, acquired, activatable); + else +@@ -735,11 +741,13 @@ _public_ int sd_bus_get_owner( + assert_return(name, -EINVAL); + assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP); + assert_return(mask == 0 || creds, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(bus->bus_client, -ENODATA); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_get_owner_kdbus(bus, name, mask, creds); + else +@@ -1196,10 +1204,12 @@ _public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128 + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(machine, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (streq_ptr(name, bus->unique_name)) + return sd_id128_get_machine(machine); + +diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c +index 6e02ad3..c5b9cd4 100644 +--- a/src/libsystemd/sd-bus/bus-convenience.c ++++ b/src/libsystemd/sd-bus/bus-convenience.c +@@ -36,9 +36,11 @@ _public_ int sd_bus_emit_signal( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_signal(bus, &m, path, interface, member); + if (r < 0) + return r; +@@ -70,9 +72,11 @@ _public_ int sd_bus_call_method( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_method_call(bus, &m, destination, path, interface, member); + if (r < 0) + return r; +@@ -100,9 +104,12 @@ _public_ int sd_bus_reply_method_return( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -134,9 +141,12 @@ _public_ int sd_bus_reply_method_error( + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(sd_bus_error_is_set(e), -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -159,9 +169,12 @@ _public_ int sd_bus_reply_method_errorf( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -182,9 +195,12 @@ _public_ int sd_bus_reply_method_errno( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -208,9 +224,12 @@ _public_ int sd_bus_reply_method_errnof( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -239,9 +258,11 @@ _public_ int sd_bus_get_property( + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(reply, -EINVAL); + assert_return(signature_is_single(type, false), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &rep, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -273,9 +294,11 @@ _public_ int sd_bus_get_property_trivial( + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(bus_type_is_trivial(type), -EINVAL); + assert_return(ptr, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -309,9 +332,11 @@ _public_ int sd_bus_get_property_string( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -348,9 +373,11 @@ _public_ int sd_bus_get_property_strv( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -383,9 +410,11 @@ _public_ int sd_bus_set_property( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(signature_is_single(type, false), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_method_call(bus, &m, destination, path, "org.freedesktop.DBus.Properties", "Set"); + if (r < 0) + return r; +@@ -416,9 +445,12 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b + + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + c = sd_bus_message_get_creds(call); + + /* All data we need? */ +diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c +index 08792fe..539cf2a 100644 +--- a/src/libsystemd/sd-bus/bus-objects.c ++++ b/src/libsystemd/sd-bus/bus-objects.c +@@ -2196,9 +2196,10 @@ _public_ int sd_bus_emit_properties_changed_strv( + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(interface_name_is_valid(interface), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + /* A non-NULL but empty names list means nothing needs to be + generated. A NULL list OTOH indicates that all properties +@@ -2241,9 +2242,11 @@ _public_ int sd_bus_emit_properties_changed( + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(interface_name_is_valid(interface), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (!name) + return 0; + +@@ -2361,9 +2364,11 @@ _public_ int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, ch + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (strv_isempty(interfaces)) + return 0; + +@@ -2421,9 +2426,11 @@ _public_ int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const c + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + interfaces = strv_from_stdarg_alloca(interface); + + return sd_bus_emit_interfaces_added_strv(bus, path, interfaces); +@@ -2435,9 +2442,11 @@ _public_ int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (strv_isempty(interfaces)) + return 0; + +@@ -2461,9 +2470,11 @@ _public_ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + interfaces = strv_from_stdarg_alloca(interface); + + return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces); +diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c +index fa6d43a..15c7677 100644 +--- a/src/libsystemd/sd-bus/sd-bus.c ++++ b/src/libsystemd/sd-bus/sd-bus.c +@@ -1594,10 +1594,12 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie, + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (m->n_fds > 0) { + r = sd_bus_can_send(bus, SD_BUS_TYPE_UNIX_FD); + if (r < 0) +@@ -1673,10 +1675,12 @@ _public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destinat + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (!streq_ptr(m->destination, destination)) { + + if (!destination) +@@ -1728,13 +1732,15 @@ _public_ int sd_bus_call_async( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL); + assert_return(callback, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = hashmap_ensure_allocated(&bus->reply_callbacks, uint64_hash_func, uint64_compare_func); + if (r < 0) + return r; +@@ -1841,13 +1847,15 @@ _public_ int sd_bus_call( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL); + assert_return(!bus_error_is_dirty(error), -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = bus_ensure_running(bus); + if (r < 0) + return r; +@@ -1973,9 +1981,11 @@ _public_ int sd_bus_get_events(sd_bus *bus) { + int flags = 0; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING) ++ return -ENOTCONN; ++ + if (bus->state == BUS_OPENING) + flags |= POLLOUT; + else if (bus->state == BUS_AUTHENTICATING) { +@@ -2000,9 +2010,11 @@ _public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { + + assert_return(bus, -EINVAL); + assert_return(timeout_usec, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING) ++ return -ENOTCONN; ++ + if (bus->track_queue) { + *timeout_usec = 0; + return 1; +@@ -2531,7 +2543,8 @@ static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) { + if (bus->state == BUS_CLOSING) + return 1; + +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + e = sd_bus_get_events(bus); + if (e < 0) +@@ -2586,7 +2599,8 @@ _public_ int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) { + if (bus->state == BUS_CLOSING) + return 0; + +- assert_return(BUS_IS_OPEN(bus->state) , -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (bus->rqueue_size > 0) + return 0; +@@ -2603,7 +2617,8 @@ _public_ int sd_bus_flush(sd_bus *bus) { + if (bus->state == BUS_CLOSING) + return 0; + +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + r = bus_ensure_running(bus); + if (r < 0) +@@ -3113,9 +3128,13 @@ _public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **re + assert_return(bus, -EINVAL); + assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); +- assert_return(!bus->is_kernel, -ENOTSUP); ++ ++ if (!bus->is_kernel) ++ return -ENOTSUP; ++ ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (!bus->ucred_valid && !isempty(bus->label)) + return -ENODATA; +@@ -3154,9 +3173,13 @@ _public_ int sd_bus_try_close(sd_bus *bus) { + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); +- assert_return(bus->is_kernel, -ENOTSUP); ++ ++ if (!bus->is_kernel) ++ return -ENOTSUP; ++ ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (bus->rqueue_size > 0) + return -EBUSY; +-- +1.9.1 + diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch new file mode 100644 index 0000000000..4639532236 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch @@ -0,0 +1,32 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700 ++++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700 +@@ -78,6 +78,24 @@ + + M4_DEFINES= + ++# check for few functions not implemented in uClibc ++ ++AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate) ++ ++# check for %ms format support - assume always no if cross compiling ++ ++AC_MSG_CHECKING([whether %ms format is supported by *scanf]) ++ ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([ ++ #include ++ ],[ ++ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; ++ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; ++ return (rc==3)?0:1;])], ++ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])], ++ [AC_MSG_RESULT([no])]) ++ + # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line + m4_ifdef([GTK_DOC_CHECK], [ + GTK_DOC_CHECK([1.18],[--flavour no-tmpl])], diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch new file mode 100644 index 0000000000..7170a38af3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch @@ -0,0 +1,29 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: systemd-209/src/nspawn/nspawn.c +=================================================================== +--- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800 ++++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800 +@@ -91,6 +91,8 @@ + LINK_GUEST + } LinkJournal; + ++#include "config.h" ++ + static char *arg_directory = NULL; + static char *arg_user = NULL; + static sd_id128_t arg_uuid = {}; +@@ -2045,7 +2047,12 @@ + a[0] = (char*) "/sbin/init"; + execve(a[0], a, env_use); + } else if (argc > optind) ++#ifdef HAVE_EXECVPE + execvpe(argv[optind], argv + optind, env_use); ++#else ++ environ = env_use; ++ execvp(argv[optind], argv + optind); ++#endif /* HAVE_EXECVPE */ + else { + chdir(home ? home : "/root"); + execle("/bin/bash", "-bash", NULL, env_use); diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch new file mode 100644 index 0000000000..de73be96a7 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch @@ -0,0 +1,84 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: systemd-209/src/journal/journal-file.c +=================================================================== +--- systemd-209.orig/src/journal/journal-file.c 2014-02-12 18:42:33.000000000 -0800 ++++ systemd-209/src/journal/journal-file.c 2014-02-19 23:23:19.464631643 -0800 +@@ -38,6 +38,8 @@ + #include "compress.h" + #include "fsprg.h" + ++#include "config.h" ++ + #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) + #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem)) + +@@ -316,7 +318,7 @@ + + static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { + uint64_t old_size, new_size; +- int r; ++ int r = 0; + + assert(f); + +@@ -364,9 +366,24 @@ + /* Note that the glibc fallocate() fallback is very + inefficient, hence we try to minimize the allocation area + as we can. */ ++#ifdef HAVE_POSIX_ALLOCATE + r = posix_fallocate(f->fd, old_size, new_size - old_size); + if (r != 0) + return -r; ++#else ++ /* Use good old method to write zeros into the journal file ++ perhaps very inefficient yet working. */ ++ if(new_size > old_size) { ++ char *buf = alloca(new_size - old_size); ++ off_t oldpos = lseek(f->fd, 0, SEEK_CUR); ++ bzero(buf, new_size - old_size); ++ lseek(f->fd, old_size, SEEK_SET); ++ r = write(f->fd, buf, new_size - old_size); ++ lseek(f->fd, oldpos, SEEK_SET); ++ } ++ if (r < 0) ++ return -errno; ++#endif /* HAVE_POSIX_FALLOCATE */ + + if (fstat(f->fd, &f->last_stat) < 0) + return -errno; +Index: systemd-209/src/journal/journald-kmsg.c +=================================================================== +--- systemd-209.orig/src/journal/journald-kmsg.c 2014-02-19 15:03:09.000000000 -0800 ++++ systemd-209/src/journal/journald-kmsg.c 2014-02-19 23:22:14.396630422 -0800 +@@ -441,6 +441,7 @@ + + int server_open_kernel_seqnum(Server *s) { + int fd; ++ int r = 0; + uint64_t *p; + + assert(s); +@@ -454,8 +455,19 @@ + log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); + return 0; + } +- +- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { ++#ifdef HAVE_POSIX_ALLOCATE ++ r = posix_fallocate(fd, 0, sizeof(uint64_t)); ++#else ++ /* Use good old method to write zeros into the journal file ++ perhaps very inefficient yet working. */ ++ char *buf = alloca(sizeof(uint64_t)); ++ off_t oldpos = lseek(fd, 0, SEEK_CUR); ++ bzero(buf, sizeof(uint64_t)); ++ lseek(fd, 0, SEEK_SET); ++ r = write(fd, buf, sizeof(uint64_t)); ++ lseek(fd, oldpos, SEEK_SET); ++#endif /* HAVE_POSIX_FALLOCATE */ ++ if (r < 0) { + log_error("Failed to allocate sequential number file, ignoring: %m"); + close_nointr_nofail(fd); + return 0; diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch new file mode 100644 index 0000000000..9b4c940984 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch @@ -0,0 +1,35 @@ +Prefer getty to agetty in console setup systemd units + +Upstream-Status: Inappropriate [configuration specific] +Signed-off-by: Maxime Ripard +--- + units/getty@.service.m4 | 2 +- + units/serial-getty@.service.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: git/units/getty@.service.m4 +=================================================================== +--- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 ++++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700 +@@ -27,7 +27,7 @@ + + [Service] + # the VT is cleared by TTYVTDisallocate +-ExecStart=-/sbin/agetty --noclear %I $TERM ++ExecStart=-/sbin/getty -L %I $TERM + Type=idle + Restart=always + RestartSec=0 +Index: git/units/serial-getty@.service.m4 +=================================================================== +--- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 ++++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700 +@@ -22,7 +22,7 @@ + IgnoreOnIsolate=yes + + [Service] +-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM ++ExecStart=-/sbin/getty -L 115200 %I $TERM + Type=idle + Restart=always + RestartSec=0 diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch new file mode 100644 index 0000000000..8c7aa072da --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch @@ -0,0 +1,30 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: git/src/shared/util.c +=================================================================== +--- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700 ++++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700 +@@ -85,6 +85,8 @@ + #include "def.h" + #include "missing.h" + ++#include "config.h" ++ + int saved_argc = 0; + char **saved_argv = NULL; + +@@ -6222,7 +6224,13 @@ + + u = umask(077); + ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(pattern, flags); ++#else ++ fd = mkstemp(pattern); ++ if (fd >= 0) fcntl(fd, F_SETFD, flags); ++#endif /* HAVE_MKOSTEMP */ ++ + if (fd < 0) + return -errno; + diff --git a/meta/recipes-core/systemd/systemd/touchscreen.rules b/meta/recipes-core/systemd/systemd/touchscreen.rules new file mode 100644 index 0000000000..d83fd1673d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/touchscreen.rules @@ -0,0 +1,18 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Create a symlink to any touchscreen input device +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch new file mode 100644 index 0000000000..39dfc9e2ea --- /dev/null +++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch @@ -0,0 +1,37 @@ +bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc + +Upstream-Status: Inappropriate [uclibc-specific] + +Signed-off-by: Khem Raj + +Index: git/src/shared/util.c +=================================================================== +--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700 ++++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700 +@@ -6332,11 +6332,24 @@ + + /* We return this as uint64_t in case we are running as 32bit + * process on a 64bit kernel with huge amounts of memory */ +- ++#ifdef __UCLIBC__ ++ char line[128]; ++ FILE *f = fopen("/proc/meminfo", "r"); ++ if (f == NULL) ++ return 0; ++ while (!feof(f) && fgets(line, sizeof(line)-1, f)) { ++ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) { ++ mem *= 1024; ++ break; ++ } ++ } ++ fclose(f); ++ return (uint64_t) mem; ++#else + mem = sysconf(_SC_PHYS_PAGES); + assert(mem > 0); +- + return (uint64_t) mem * (uint64_t) page_size(); ++#endif + } + + char* mount_test_option(const char *haystack, const char *needle) { diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch new file mode 100644 index 0000000000..15645dee11 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch @@ -0,0 +1,19 @@ +Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h + +Signed-off-by: Khem Raj +Upstream-Status: Inappropriate [uclibc specific] + +Index: systemd-209/src/readahead/readahead-common.c +=================================================================== +--- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800 ++++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800 +@@ -22,7 +22,9 @@ + #include + #include + #include ++#ifndef __UCLIBC__ + #include ++#endif + #include + #include + #include diff --git a/meta/recipes-core/systemd/systemd_211.bb b/meta/recipes-core/systemd/systemd_211.bb new file mode 100644 index 0000000000..44b196538a --- /dev/null +++ b/meta/recipes-core/systemd/systemd_211.bb @@ -0,0 +1,353 @@ +SUMMARY = "System and service manager for Linux, replacing SysVinit" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" + +LICENSE = "GPLv2 & LGPLv2.1 & MIT" +LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ + file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ + file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed" + +PROVIDES = "udev" + +PE = "1" + +DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +SECTION = "base/shell" + +inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest + +SRCREV = "3a450ec5c6adf3057bcedd6cc19c10617abc35a5" + +PV = "211+git${SRCPV}" + +SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \ + file://binfmt-install.patch \ + file://systemd-pam-configure-check-uclibc.patch \ + file://systemd-pam-fix-execvpe.patch \ + file://systemd-pam-fix-fallocate.patch \ + file://systemd-pam-fix-mkostemp.patch \ + file://optional_secure_getenv.patch \ + file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \ + file://uclibc-sysinfo_h.patch \ + file://uclibc-get-physmem.patch \ + file://sd-bus-don-t-use-assert_return-to-check-for-disconne.patch \ + \ + file://touchscreen.rules \ + file://00-create-volatile.conf \ + file://init \ + file://run-ptest \ + " + +S = "${WORKDIR}/git" + +SRC_URI_append_libc-uclibc = "\ + file://systemd-pam-fix-getty-unit.patch \ + " +LDFLAGS_append_libc-uclibc = " -lrt" + +GTKDOC_DOCDIR = "${S}/docs/" + +PACKAGECONFIG ??= "xz tcp-wrappers" +# Sign the journal for anti-tampering +PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" +# regardless of PACKAGECONFIG, libgcrypt is always required to expand +# the AM_PATH_LIBGCRYPT autoconf macro +DEPENDS += "libgcrypt" +# Compress the journal +PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" +PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" +PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" +PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" + +CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" + +# Helper variables to clarify locations. This mirrors the logic in systemd's +# build system. +rootprefix ?= "${base_prefix}" +rootlibdir ?= "${base_libdir}" +rootlibexecdir = "${rootprefix}/lib" + +# The gtk+ tools should get built as a separate recipe e.g. systemd-tools +EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ + --with-rootlibdir=${rootlibdir} \ + ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ + --enable-xz \ + --disable-manpages \ + --disable-coredump \ + --disable-introspection \ + --disable-kdbus \ + --enable-split-usr \ + --without-python \ + --with-sysvrcnd-path=${sysconfdir} \ + --with-firmware-path=/lib/firmware \ + ac_cv_path_KILL=${base_bindir}/kill \ + " +# uclibc does not have NSS +EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " + +do_configure_prepend() { + export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" + export KMOD="${base_bindir}/kmod" + if [ -d ${S}/units.pre_sed ] ; then + cp -r ${S}/units.pre_sed ${S}/units + else + cp -r ${S}/units ${S}/units.pre_sed + fi + sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* + sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am + sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am +} + +do_install() { + autotools_do_install + install -d ${D}/${base_sbindir} + # Provided by a separate recipe + rm ${D}${systemd_unitdir}/system/serial-getty* -f + + # Provide support for initramfs + [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init + [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd + + # Create machine-id + # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable + touch ${D}${sysconfdir}/machine-id + + install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ + + install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ + + if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd + sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd + fi + + # Delete journal README, as log can be symlinked inside volatile. + rm -f ${D}/${localstatedir}/log/README +} + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/test + cp -rf ${S}/test/* ${D}${PTEST_PATH}/test + install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ + install -d ${D}${PTEST_PATH}/build-aux + cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ + cp -rf ${B}/rules ${D}${PTEST_PATH}/ + # This directory needs to be there for udev-test.pl to work. + install -d ${D}${libdir}/udev/rules.d + cp ${B}/Makefile ${D}${PTEST_PATH}/ + cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test + sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl + sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile + sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile +} + +python populate_packages_prepend (){ + systemdlibdir = d.getVar("rootlibdir", True) + do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) +} +PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" + +PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ + ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh" + +SYSTEMD_PACKAGES = "${PN}-binfmt" +SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} += "--system systemd-journal-gateway" +GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" + +FILES_${PN}-analyze = "${bindir}/systemd-analyze" + +FILES_${PN}-initramfs = "/init" +RDEPENDS_${PN}-initramfs = "${PN}" + +# The test cases need perl and bash to run correctly. +RDEPENDS_${PN}-ptest += "perl bash" +FILES_${PN}-ptest += "${libdir}/udev/rules.d" + +FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" + +FILES_${PN}-gui = "${bindir}/systemadm" + +FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ + ${systemd_unitdir}/system/systemd-vconsole-setup.service \ + ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" + +FILES_${PN}-kernel-install = "${bindir}/kernel-install \ + ${sysconfdir}/kernel/ \ + ${exec_prefix}/lib/kernel \ + " +FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ + " + +FILES_${PN}-zsh = "${datadir}/zsh/site-functions" + +FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ + ${exec_prefix}/lib/binfmt.d \ + ${rootlibexecdir}/systemd/systemd-binfmt \ + ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ + ${systemd_unitdir}/system/systemd-binfmt.service" +RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" + +RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" + +CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ + ${sysconfdir}/systemd/logind.conf \ + ${sysconfdir}/systemd/system.conf \ + ${sysconfdir}/systemd/user.conf" + +FILES_${PN} = " ${base_bindir}/* \ + ${datadir}/bash-completion \ + ${datadir}/dbus-1/services \ + ${datadir}/dbus-1/system-services \ + ${datadir}/polkit-1 \ + ${datadir}/${BPN} \ + ${sysconfdir}/bash_completion.d/ \ + ${sysconfdir}/dbus-1/ \ + ${sysconfdir}/machine-id \ + ${sysconfdir}/modules-load.d/ \ + ${sysconfdir}/sysctl.d/ \ + ${sysconfdir}/systemd/ \ + ${sysconfdir}/tmpfiles.d/ \ + ${sysconfdir}/xdg/ \ + ${sysconfdir}/init.d/README \ + ${rootlibexecdir}/systemd/* \ + ${systemd_unitdir}/* \ + ${base_libdir}/security/*.so \ + ${libdir}/libnss_myhostname.so.2 \ + /cgroup \ + ${bindir}/systemd* \ + ${bindir}/busctl \ + ${bindir}/localectl \ + ${bindir}/hostnamectl \ + ${bindir}/timedatectl \ + ${bindir}/bootctl \ + ${bindir}/kernel-install \ + ${exec_prefix}/lib/tmpfiles.d/*.conf \ + ${exec_prefix}/lib/systemd \ + ${exec_prefix}/lib/modules-load.d \ + ${exec_prefix}/lib/sysctl.d \ + ${localstatedir} \ + /lib/udev/rules.d/70-uaccess.rules \ + /lib/udev/rules.d/71-seat.rules \ + /lib/udev/rules.d/73-seat-late.rules \ + /lib/udev/rules.d/99-systemd.rules \ + ${@base_contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ + " + +FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" +FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" + +RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" + +RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \ + util-linux-agetty \ + util-linux-fsck e2fsprogs-e2fsck \ + kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ +" + +PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" + +FILES_udev-dbg += "/lib/udev/.debug" + +RDEPENDS_udev += "udev-utils" +RPROVIDES_udev = "hotplug" +RRECOMMENDS_udev += "udev-hwdb" + +RDEPENDS_udev-hwdb += "udev-utils" + +FILES_udev += "${base_sbindir}/udevd \ + ${rootlibexecdir}/systemd/systemd-udevd \ + ${rootlibexecdir}/udev/accelerometer \ + ${rootlibexecdir}/udev/ata_id \ + ${rootlibexecdir}/udev/cdrom_id \ + ${rootlibexecdir}/udev/collect \ + ${rootlibexecdir}/udev/findkeyboards \ + ${rootlibexecdir}/udev/keyboard-force-release.sh \ + ${rootlibexecdir}/udev/keymap \ + ${rootlibexecdir}/udev/mtd_probe \ + ${rootlibexecdir}/udev/scsi_id \ + ${rootlibexecdir}/udev/v4l_id \ + ${rootlibexecdir}/udev/keymaps \ + ${rootlibexecdir}/udev/rules.d/4*.rules \ + ${rootlibexecdir}/udev/rules.d/5*.rules \ + ${rootlibexecdir}/udev/rules.d/6*.rules \ + ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ + ${rootlibexecdir}/udev/rules.d/75*.rules \ + ${rootlibexecdir}/udev/rules.d/78*.rules \ + ${rootlibexecdir}/udev/rules.d/8*.rules \ + ${rootlibexecdir}/udev/rules.d/95*.rules \ + ${sysconfdir}/udev \ + ${sysconfdir}/init.d/systemd-udevd \ + ${systemd_unitdir}/system/*udev* \ + ${systemd_unitdir}/system/*.wants/*udev* \ + " + +FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" + +FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" + +INITSCRIPT_PACKAGES = "udev" +INITSCRIPT_NAME_udev = "systemd-udevd" +INITSCRIPT_PARAMS_udev = "start 03 S ." + +python __anonymous() { + if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} + +# TODO: +# u-a for runlevel and telinit + +ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" + +ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" +ALTERNATIVE_PRIORITY[init] ?= "300" + +ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" +ALTERNATIVE_PRIORITY[halt] ?= "300" + +ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" +ALTERNATIVE_PRIORITY[reboot] ?= "300" + +ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" +ALTERNATIVE_PRIORITY[shutdown] ?= "300" + +ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" +ALTERNATIVE_PRIORITY[poweroff] ?= "300" + +ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" +ALTERNATIVE_PRIORITY[runlevel] ?= "300" + +pkg_postinst_udev-hwdb () { + if test -n "$D"; then + ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ + --root $D + else + udevadm hwdb --update + fi +} + +pkg_prerm_udev-hwdb () { + if test -n "$D"; then + exit 1 + fi + + rm -f ${sysconfdir}/udev/hwdb.bin +} + +# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so +# that we don't build both udev and systemd in world builds. +python () { + if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): + raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") +} diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch new file mode 100644 index 0000000000..7b342901e1 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch @@ -0,0 +1,25 @@ +Upstream-Status: Inappropriate [configuration] + +# The src Makefile was checking for libcrypt.a on the host, not in the +# build environment. This patch checks for $LCRYPT in the environment +# and uses it if it's there. +# - jdike@linux.intel.com + +Index: sysvinit-2.88dsf/src/Makefile +=================================================================== +--- sysvinit-2.88dsf.orig/src/Makefile ++++ sysvinit-2.88dsf/src/Makefile +@@ -85,9 +85,13 @@ else + endif + + # Additional libs for GNU libc. ++ifneq ($(LCRYPT),) ++ SULOGINLIBS += $(LCRYPT) ++else + ifneq ($(wildcard /usr/lib*/libcrypt.a),) + SULOGINLIBS += -lcrypt + endif ++endif + + all: $(BIN) $(SBIN) $(USRBIN) + diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch new file mode 100644 index 0000000000..6c4225a678 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch @@ -0,0 +1,83 @@ +Upstream-Status: Pending + +diff --git a/src/Makefile b/src/Makefile +index e2b8028..3e11e92 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -65,7 +65,14 @@ else + INSTALL_DATA = install -m 644 + endif + INSTALL_DIR = install -m 755 -d +-MANDIR = /usr/share/man ++ ++ROOT ?= ++base_bindir ?= /bin ++base_sbindir ?= /sbin ++bindir ?= /usr/bin ++sysconfdir ?= /etc ++includedir ?= /usr/include ++mandir ?= /usr/share/man + + ifeq ($(WITH_SELINUX),yes) + SELINUX_DEF = -DWITH_SELINUX +@@ -138,39 +145,39 @@ clobber: cleanobjs + distclean: clobber + + install: +- $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/ +- $(INSTALL_DIR) $(ROOT)/usr/bin/ ++ $(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/ ++ $(INSTALL_DIR) $(ROOT)$(bindir)/ + for i in $(BIN); do \ +- $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \ + done + for i in $(SBIN); do \ +- $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \ + done + for i in $(USRBIN); do \ +- $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \ ++ $(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \ + done +- # $(INSTALL_DIR) $(ROOT)/etc/ +- # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/ +- ln -sf halt $(ROOT)/sbin/reboot +- ln -sf halt $(ROOT)/sbin/poweroff +- ln -sf init $(ROOT)/sbin/telinit +- ln -sf /sbin/killall5 $(ROOT)/bin/pidof +- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ +- ln -sf last $(ROOT)/usr/bin/lastb; \ ++ # $(INSTALL_DIR) $(ROOT)$(sysconfdir)/ ++ # $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/ ++ ln -sf halt $(ROOT)$(base_sbindir)/reboot ++ ln -sf halt $(ROOT)$(base_sbindir)/poweroff ++ ln -sf init $(ROOT)$(base_sbindir)/telinit ++ ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof ++ if [ ! -f $(ROOT)$(bindir)/lastb ]; then \ ++ ln -sf last $(ROOT)$(bindir)/lastb; \ + fi +- $(INSTALL_DIR) $(ROOT)/usr/include/ +- $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/ +- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/ +- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/ +- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/ ++ $(INSTALL_DIR) $(ROOT)$(includedir)/ ++ $(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/ ++ $(INSTALL_DIR) $(ROOT)$(mandir)/man1/ ++ $(INSTALL_DIR) $(ROOT)$(mandir)/man5/ ++ $(INSTALL_DIR) $(ROOT)$(mandir)/man8/ + for i in $(MAN1); do \ +- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \ + done + for i in $(MAN5); do \ +- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \ + done + for i in $(MAN8); do \ +- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \ ++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \ + done + ifeq ($(ROOT),) + # diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch new file mode 100644 index 0000000000..5b5dfdc001 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch @@ -0,0 +1,189 @@ +pidof: add -m option + +When used with -o, will also omit any processes that have the same +argv[0] and argv[1] as any explicitly omitted process ids. This can be +used to avoid multiple shell scripts concurrently calling pidof returning +each other's pids. + +https://bugzilla.redhat.com/show_bug.cgi?id=883856 + +Upstream-Status: backport +Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166 + +Signed-off-by: Hongxu Jia +--- + man/pidof.8 | 6 ++++++ + src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 65 insertions(+), 3 deletions(-) + +diff --git a/man/pidof.8 b/man/pidof.8 +--- a/man/pidof.8 ++++ b/man/pidof.8 +@@ -24,6 +24,7 @@ pidof -- find the process ID of a running program. + .RB [ \-c ] + .RB [ \-n ] + .RB [ \-x ] ++.RB [ \-m ] + .RB [ \-o + .IR omitpid[,omitpid..] ] + .RB [ \-o +@@ -63,6 +64,11 @@ shells running the named scripts. + Tells \fIpidof\fP to omit processes with that process id. The special + pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP + program, in other words the calling shell or shell script. ++.IP -m ++When used with -o, will also omit any processes that have the same ++argv[0] and argv[1] as any explicitly omitted process ids. This can be ++used to avoid multiple shell scripts concurrently calling pidof returning ++each other's pids. + .SH "EXIT STATUS" + .TP + .B 0 +diff --git a/src/killall5.c b/src/killall5.c +index 5937d98..e73885e 100644 +--- a/src/killall5.c ++++ b/src/killall5.c +@@ -118,6 +118,7 @@ typedef struct _s_nfs + + /* List of processes. */ + PROC *plist; ++PROC *olist; + + /* List of processes to omit. */ + OMIT *omit; +@@ -345,6 +346,20 @@ static void clear_mnt(void) + } + } + ++static void clear_omit(void) ++{ ++ OMIT *o; ++ PROC *p; ++ for (o = omit; o; o = omit) { ++ omit = omit->next; ++ free(o); ++ } ++ for (p = olist; p; p = olist) { ++ olist = olist->next; ++ free(p); ++ } ++} ++ + /* + * Check if path is ia shadow off a NFS partition. + */ +@@ -452,6 +467,7 @@ int readproc(int do_stat) + DIR *dir; + FILE *fp; + PROC *p, *n; ++ OMIT *o, *m; + struct dirent *d; + struct stat st; + char path[PATH_MAX+1]; +@@ -624,6 +640,17 @@ int readproc(int do_stat) + p->next = plist; + plist = p; + p->pid = pid; ++ /* Could be smarter, but it's a small list. */ ++ m = omit; ++ for (o = omit; m; o = m) { ++ m = o->next; ++ if (o->pid == p->pid) { ++ n = (PROC*)xmalloc(sizeof(PROC)); ++ *n = *p; ++ n->next = olist; ++ olist = n; ++ } ++ } + } + closedir(dir); + +@@ -813,6 +840,26 @@ PIDQ_HEAD *pidof(char *prog) + return q; + } + ++int matches(PROC *o, PROC *p) ++{ ++ int ret = 0; ++ char *oargv1, *pargv1; ++ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) { ++ if (o->argv1 && p->argv1) { ++ if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL) ++ oargv1 = strdup(o->argv1); ++ if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL) ++ pargv1 = strdup(p->argv1); ++ if (! strcmp(oargv1, pargv1)) { ++ ret = 1; ++ } ++ free(oargv1); ++ free(pargv1); ++ } ++ } ++ return ret; ++} ++ + /* Give usage message and exit. */ + void usage(void) + { +@@ -845,6 +892,7 @@ void nsyslog(int pri, char *fmt, ...) + #define PIDOF_SINGLE 0x01 + #define PIDOF_OMIT 0x02 + #define PIDOF_NETFS 0x04 ++#define PIDOF_OMIT_OMIT_MATCHES 0x08 + + /* + * Pidof functionality. +@@ -861,6 +909,7 @@ int main_pidof(int argc, char **argv) + struct stat st; + char tmp[512]; + ++ olist = (PROC*)0; + omit = (OMIT*)0; + nlist = (NFS*)0; + opterr = 0; +@@ -868,7 +917,7 @@ int main_pidof(int argc, char **argv) + if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0)) + flags |= PIDOF_NETFS; + +- while ((opt = getopt(argc,argv,"hco:sxn")) != EOF) switch (opt) { ++ while ((opt = getopt(argc,argv,"hcmo:sxn")) != EOF) switch (opt) { + case '?': + nsyslog(LOG_ERR,"invalid options on command line!\n"); + closelog(); +@@ -907,6 +956,9 @@ int main_pidof(int argc, char **argv) + case 'x': + scripts_too++; + break; ++ case 'm': ++ flags |= PIDOF_OMIT_OMIT_MATCHES; ++ break; + case 'n': + flags |= PIDOF_NETFS; + break; +@@ -938,10 +990,13 @@ int main_pidof(int argc, char **argv) + pid_t spid = 0; + while ((p = get_next_from_pid_q(q))) { + if ((flags & PIDOF_OMIT) && omit) { +- OMIT * optr; +- for (optr = omit; optr; optr = optr->next) { ++ PROC * optr; ++ for (optr = olist; optr; optr = optr->next) { + if (optr->pid == p->pid) + break; ++ if (flags & PIDOF_OMIT_OMIT_MATCHES) ++ if (matches(optr, p)) ++ break; + } + + /* +@@ -977,6 +1032,7 @@ int main_pidof(int argc, char **argv) + if (!first) + printf("\n"); + ++ clear_omit(); + clear_mnt(); + + closelog(); +-- +1.8.1.2 + diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab new file mode 100644 index 0000000000..6abbdf4558 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab @@ -0,0 +1,30 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:5:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb new file mode 100644 index 0000000000..30641dac88 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb @@ -0,0 +1,82 @@ +SUMMARY = "Inittab configuration for SysVinit" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +PR = "r10" + +SRC_URI = "file://inittab" + +S = "${WORKDIR}/sysvinit-${PV}" + +INHIBIT_DEFAULT_DEPS = "1" + +do_compile() { + : +} + +do_install() { + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab + + tmp="${SERIAL_CONSOLES}" + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + label=`echo ${i} | sed -e 's/^.*;tty//' -e 's/;.*//'` + echo "$label:12345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + done + + if [ "${USE_VT}" = "1" ]; then + cat <>${D}${sysconfdir}/inittab +# ${base_sbindir}/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# + +EOF + + for n in ${SYSVINIT_ENABLED_GETTYS} + do + echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab + done + echo "" >> ${D}${sysconfdir}/inittab + fi +} + +pkg_postinst_${PN} () { +# run this on the target +if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then + tmp="${SERIAL_CONSOLES_CHECK}" + for i in $tmp + do + j=`echo ${i} | sed s/^.*\;//g` + if [ -z "`cat /proc/consoles | grep ${j}`" ]; then + sed -i /^.*${j}$/d /etc/inittab + fi + done + kill -HUP 1 +else + if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then + exit 0 + else + exit 1 + fi +fi +} + +# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. +# Set PACKAGE_ARCH appropriately. +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} = "${sysconfdir}/inittab" +CONFFILES_${PN} = "${sysconfdir}/inittab" + +USE_VT ?= "1" +SYSVINIT_ENABLED_GETTYS ?= "1" + + + diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init new file mode 100755 index 0000000000..7d6518d981 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init @@ -0,0 +1,96 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: bootlogd +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: 2 3 4 5 +# Short-Description: One of the first scripts to be executed. Starts or stops +# the bootlogd log program. If this script is called as +# "stop-bootlogd", it will stop the daemon instead of +# starting it even when called with the "start" argument. +# +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/sbin/bootlogd +NAME=bootlogd +DESC="Bootlog daemon" + +# source function library +. /etc/init.d/functions + +test -f $DAEMON || exit 0 + +[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd + +## set -e # not needed + +case "$BOOTLOGD_ENABLE" in + [Nn]*) + exit 0 + ;; +esac + +STOPPER= +ACTION="$1" +case "$0" in + *stop-bootlog*) + STOPPER=Y + if [ "$ACTION" = start ] + then + ACTION=stop + fi + ;; +esac + +case "$ACTION" in + start) + echo -n "Starting $DESC: " + if [ -d /proc/1/. ] + then + umask 027 + start-stop-daemon --start --quiet \ + --exec $DAEMON -- -r -c + else + $DAEMON -r -c + fi + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --exec $DAEMON + + if [ "$STOPPER" ] && [ -f /var/log/boot ] && \ + [ -f /var/log/boot~ ] + then + cd /var/log + chgrp adm boot + savelog -p -c 5 boot > /dev/null 2>&1 + mv boot.0 boot + mv boot~ boot.0 + fi + + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --exec $DAEMON + echo "$NAME." + ;; + status) + status $DAEMON + exit $? + ;; + *) + N=${0##*/} + N=${N#[SK]??} + echo "Usage: $N {start|stop|status|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc new file mode 100755 index 0000000000..1f400d9e55 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/rc @@ -0,0 +1,179 @@ +#!/bin/sh +# +# rc This file is responsible for starting/stopping +# services when the runlevel changes. +# +# Optimization feature: +# A startup script is _not_ run when the service was +# running in the previous runlevel and it wasn't stopped +# in the runlevel transition (most Debian services don't +# have K?? links in rc{1,2,3,4,5} ) +# +# Author: Miquel van Smoorenburg +# Bruce Perens +# +# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl +# + +. /etc/default/rcS +export VERBOSE + +startup_progress() { + step=$(($step + $step_change)) + if [ "$num_steps" != "0" ]; then + progress=$((($step * $progress_size / $num_steps) + $first_step)) + else + progress=$progress_size + fi + #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size" + #if type psplash-write >/dev/null 2>&1; then + # TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true + #fi + if [ -e /mnt/.psplash/psplash_fifo ]; then + echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo + fi +} + + +# +# Start script or program. +# +startup() { + # Handle verbosity + [ "$VERBOSE" = very ] && echo "INIT: Running $@..." + + case "$1" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + scriptname=$1 + shift + . $scriptname + ) + ;; + *) + "$@" + ;; + esac + startup_progress +} + + # Ignore CTRL-C only in this shell, so we can interrupt subprocesses. + trap ":" INT QUIT TSTP + + # Set onlcr to avoid staircase effect. + stty onlcr 0>&1 + + # Now find out what the current and what the previous runlevel are. + + runlevel=$RUNLEVEL + # Get first argument. Set new runlevel to this argument. + [ "$1" != "" ] && runlevel=$1 + if [ "$runlevel" = "" ] + then + echo "Usage: $0 " >&2 + exit 1 + fi + previous=$PREVLEVEL + [ "$previous" = "" ] && previous=N + + export runlevel previous + + # Is there an rc directory for this new runlevel? + if [ -d /etc/rc$runlevel.d ] + then + # Find out where in the progress bar the initramfs got to. + PROGRESS_STATE=0 + #if [ -f /dev/.initramfs/progress_state ]; then + # . /dev/.initramfs/progress_state + #fi + + # Split the remaining portion of the progress bar into thirds + progress_size=$(((100 - $PROGRESS_STATE) / 3)) + + case "$runlevel" in + 0|6) + # Count down from -100 to 0 and use the entire bar + first_step=-100 + progress_size=100 + step_change=1 + ;; + S) + # Begin where the initramfs left off and use 2/3 + # of the remaining space + first_step=$PROGRESS_STATE + progress_size=$(($progress_size * 2)) + step_change=1 + ;; + *) + # Begin where rcS left off and use the final 1/3 of + # the space (by leaving progress_size unchanged) + first_step=$(($progress_size * 2 + $PROGRESS_STATE)) + step_change=1 + ;; + esac + + num_steps=0 + for s in /etc/rc$runlevel.d/[SK]*; do + case "${s##/etc/rc$runlevel.d/S??}" in + gdm|xdm|kdm|reboot|halt) + break + ;; + esac + num_steps=$(($num_steps + 1)) + done + step=0 + + # First, run the KILL scripts. + if [ $previous != N ] + then + for i in /etc/rc$runlevel.d/K[0-9][0-9]* + do + # Check if the script is there. + [ ! -f $i ] && continue + + # Stop the service. + startup $i stop + done + fi + + # Now run the START scripts for this runlevel. + for i in /etc/rc$runlevel.d/S* + do + [ ! -f $i ] && continue + + if [ $previous != N ] && [ $previous != S ] + then + # + # Find start script in previous runlevel and + # stop script in this runlevel. + # + suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]} + stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix + previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix + # + # If there is a start script in the previous level + # and _no_ stop script in this level, we don't + # have to re-start the service. + # + [ -f $previous_start ] && [ ! -f $stop ] && continue + fi + case "$runlevel" in + 0|6) + startup $i stop + ;; + *) + startup $i start + ;; + esac + done + fi + +#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch +if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then + if type psplash-write >/dev/null 2>&1; then + TMPDIR=/mnt/.psplash psplash-write "QUIT" || true + umount -l /mnt/.psplash + fi +fi diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS b/meta/recipes-core/sysvinit/sysvinit/rcS new file mode 100755 index 0000000000..080b04f32f --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/rcS @@ -0,0 +1,34 @@ +#!/bin/sh +# +# rcS Call all S??* scripts in /etc/rcS.d in +# numerical/alphabetical order. +# +# Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +runlevel=S +prevlevel=N +umask 022 +export PATH runlevel prevlevel + +# Make sure proc is mounted +# +[ -d "/proc/1" ] || mount /proc + +# +# Source defaults. +# +. /etc/default/rcS + +# +# Trap CTRL-C &c only in this shell so we can interrupt subprocesses. +# +trap ":" INT QUIT TSTP + +# +# Call all parts in order. +# +exec /etc/init.d/rc S + + diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default new file mode 100644 index 0000000000..709cdf6ec5 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default @@ -0,0 +1,29 @@ +# +# Defaults for the boot scripts in /etc/rcS.d +# + +# Time files in /tmp are kept in days. +TMPTIME=0 +# Set to yes if you want sulogin to be spawned on bootup +SULOGIN=no +# Set to no if you want to be able to login over telnet/rlogin +# before system startup is complete (as soon as inetd is started) +DELAYLOGIN=no +# Assume that the BIOS clock is set to UTC time (recommended) +UTC=yes +# Set VERBOSE to "no" if you would like a more quiet bootup. +VERBOSE=no +# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically +EDITMOTD=no +# Whether to fsck root on boot +ENABLE_ROOTFS_FSCK=no +# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup. +FSCKFIX=yes +# Set TICKADJ to the correct tick value for this specific machine +#TICKADJ=10000 +# Enable caching in populate-volatile.sh +VOLATILE_ENABLE_CACHE=yes +# Indicate whether the rootfs is intended to be read-only or not. +# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs. +# Normally you should not change this value. +ROOTFS_READ_ONLY=no diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb new file mode 100644 index 0000000000..c06eac44cf --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb @@ -0,0 +1,97 @@ +SUMMARY = "System-V like init" +DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts." +HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4" +PR = "r11" + +RDEPENDS_${PN} = "${PN}-inittab" + +SRC_URI = "http://download.savannah.gnu.org/releases-noredirect/sysvinit/sysvinit-${PV}.tar.bz2 \ + file://install.patch \ + file://crypt-lib.patch \ + file://pidof-add-m-option.patch \ + file://rcS-default \ + file://rc \ + file://rcS \ + file://bootlogd.init" + +SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f" +SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519" + +S = "${WORKDIR}/sysvinit-${PV}" +B = "${S}/src" + +inherit update-alternatives +DEPENDS_append = " update-rc.d-native base-passwd" + +ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall" + +ALTERNATIVE_PRIORITY = "200" + +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" +ALTERNATIVE_PRIORITY[init] = "50" + +ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" +ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" +ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" +ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" +ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" +ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" + +ALTERNATIVE_${PN}-pidof = "pidof" +ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof" + +ALTERNATIVE_${PN}-sulogin = "sulogin" +ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" + +ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1" + +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" +ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" +ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" +ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" +ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" + +PACKAGES =+ "sysvinit-pidof sysvinit-sulogin" +FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*" +FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5" +FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit" + +RDEPENDS_${PN} += "sysvinit-pidof initscripts-functions" + +CFLAGS_prepend = "-D_GNU_SOURCE " +export LCRYPT = "-lcrypt" +EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \ + 'base_sbindir=${base_sbindir}' \ + 'bindir=${bindir}' \ + 'sbindir=${sbindir}' \ + 'sysconfdir=${sysconfdir}' \ + 'includedir=${includedir}' \ + 'mandir=${mandir}'" + +do_install () { + oe_runmake 'ROOT=${D}' install + + install -d ${D}${sysconfdir} \ + ${D}${sysconfdir}/default \ + ${D}${sysconfdir}/init.d + for level in S 0 1 2 3 4 5 6; do + install -d ${D}${sysconfdir}/rc$level.d + done + + install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS + install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd + ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd + + update-rc.d -r ${D} bootlogd start 07 S . + update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 . + + chown root.shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown + chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown +} diff --git a/meta/recipes-core/uclibc/site_config/funcs b/meta/recipes-core/uclibc/site_config/funcs new file mode 100644 index 0000000000..ccc85392d7 --- /dev/null +++ b/meta/recipes-core/uclibc/site_config/funcs @@ -0,0 +1,474 @@ +a64l +abs +access +__adjtimex +alarm +alphasort +argz_append +__argz_count +argz_create_sep +argz_insert +__argz_next +argz_next +__argz_stringify +argz_stringify +asprintf +atexit +atof +atoi +bcmp +bcopy +bindresvport +bind_textdomain_codeset +btowc +bzero +calloc +canonicalize_file_name +catgets +cfgetospeed +cfsetispeed +cfsetspeed +chmod +chown +chroot +clock +close +closedir +closelog +confstr +connect +daemon +dcgettext +difftime +dirfd +dirname +dngettext +dup2 +ecvt +endgrent +endmntent +endpwent +endutent +endutxent +epoll_ctl +err +ether_hostton +ether_ntohost +euidaccess +execv +fchdir +fchmod +fchmodat +fchown +fchownat +fcntl +fcvt +fdatasync +fdopendir +feof_unlocked +fgets_unlocked +fgetxattr +finite +flistxattr +flock +flockfile +fnmatch +fork +fpathconf +__fpending +fprintf +free +freeaddrinfo +freeifaddrs +fseeko +__fsetlocking +fsetxattr +fstat64 +fstat +fstatfs +fsync +ftello +ftime +ftruncate +funlockfile +futimes +futimesat +gai_strerror +gcvt +getaddrinfo +getc_unlocked +getcwd +getdelim +getdomainname +getdtablesize +getegid +getenv +geteuid +getgid +getgrent +getgrent_r +getgrgid_r +getgrnam +getgrnam_r +getgrouplist +getgroups +gethostbyaddr_r +gethostbyname2 +gethostbyname +gethostbyname_r +gethostent +gethostid +gethostname +getifaddrs +getline +getloadavg +getmntent +getmsg +getnameinfo +getnetbyaddr_r +getnetgrent_r +getopt +getopt_long +getopt_long_only +getpagesize +getpass +getpeername +getpgrp +getpid +getppid +getprotoent_r +getpwent +getpwent_r +getpwnam +getpwnam_r +getpwuid +getpwuid_r +getresuid +getrlimit +getrusage +getservbyname +getservbyname_r +getservbyport_r +getservent +getservent_r +getspnam +getspnam_r +gettimeofday +getttyent +getttynam +getuid +getusershell +getutent +getutid +getutline +getutmp +getutmpx +getutxent +getutxid +getutxline +getwd +getxattr +glob +gmtime +gmtime_r +grantpt +group_member +herror +hstrerror +iconv +iconv_open +if_freenameindex +if_indextoname +if_nameindex +if_nametoindex +index +inet_addr +inet_aton +inet_ntoa +inet_ntop +inet_pton +initgroups +innetgr +iruserok +isascii +isatty +isblank +isgraph +isinf +isnan +isprint +isspace +iswalnum +iswcntrl +iswctype +iswprint +iswspace +iswupper +isxdigit +kill +killpg +lchown +lckpwdf +lgetxattr +link +listxattr +llistxattr +localtime +localtime_r +lockf +lrand48 +lsearch +lseek64 +lsetxattr +lstat +mallinfo +malloc +mblen +mbrlen +mbrtowc +mbsinit +mbsrtowcs +mbtowc +memalign +memchr +memcmp +memcpy +memmove +mempcpy +memrchr +memset +mkdir +mkdirat +mkdtemp +mkfifo +mknod +mkstemp64 +mkstemp +mktime +mlock +mmap +mtrace +munlock +munmap +nanosleep +nice +nl_langinfo +ntp_adjtime +ntp_gettime +_obstack_free +on_exit +open64 +open +openat +opendir +openlog +pathconf +pipe +poll +popen +posix_memalign +prctl +pread +printf +__progname +pselect +pthread_mutex_lock +ptsname +putenv +putgrent +putpwent +putspent +pututline +pututxline +putwc +pwrite +qsort +raise +rand +random +rand_r +read +readdir +readdir_r +readlink +realloc +realpath +re_comp +recvmsg +re_exec +regcomp +regexec +remove +rename +re_search +rmdir +rpmatch +rresvport_af +ruserok +ruserok_af +sbrk +scandir +sched_setscheduler +sched_yield +__secure_getenv +select +semctl +semget +sendmsg +setbuf +setbuffer +setegid +setenv +seteuid +setgid +setgroups +sethostname +setitimer +_setjmp +setjmp +setlinebuf +setlocale +setmntent +setpgid +setpgrp +setpriority +setregid +setresgid +setresuid +setreuid +setrlimit +setsid +setsockopt +settimeofday +setuid +setutent +setutxent +setvbuf +setxattr +sgetspent +shmat +shmctl +shmdt +shmget +shutdown +sigaction +sigaddset +sigaltstack +sigblock +sigemptyset +sighold +siginterrupt +signal +sigprocmask +sigset +sigsetmask +sigstack +sigsuspend +sigvec +snprintf +socket +socketpair +sprintf +srand48 +srand +srandom +sscanf +stat +statfs +statvfs +stime +stpcpy +strcasecmp +strcasestr +strchr +strchrnul +strcmp +strcspn +strdup +strerror +strerror_r +strftime +strlen +strncasecmp +strncmp +strndup +strnlen +strpbrk +strptime +strrchr +strsep +strsignal +strspn +strstr +strtod +strtoimax +strtok_r +strtol +strtoll +strtoul +strtoull +strtoumax +strverscmp +strxfrm +symlink +sync +sysconf +sysctl +sysinfo +syslog +_sys_siglist +sys_siglist +system +tcgetattr +tcgetpgrp +tcsetattr +tcsetpgrp +time +timegm +times +timezone +tmpnam +towlower +towupper +truncate +tsearch +ttyname +tzset +ulimit +umask +uname +unlink +unsetenv +unshare +updwtmp +updwtmpx +usleep +ustat +utime +utimes +utmpname +utmpxname +valloc +vasprintf +verrx +vfork +vfprintf +vfscanf +vhangup +vprintf +vsnprintf +vsprintf +wait3 +wait4 +waitpid +wcrtomb +wcscoll +wcsdup +wcslen +wctob +wctomb +wctype +wcwidth +wmemchr +wmemcpy +wmempcpy diff --git a/meta/recipes-core/uclibc/site_config/headers b/meta/recipes-core/uclibc/site_config/headers new file mode 100644 index 0000000000..609ab53797 --- /dev/null +++ b/meta/recipes-core/uclibc/site_config/headers @@ -0,0 +1,156 @@ +aio.h +alloca.h +argz.h +arpa/inet.h +arpa/nameser.h +asm/byteorder.h +asm/ioctls.h +asm/page.h +asm/types.h +assert.h +byteswap.h +crypt.h +ctype.h +dirent.h +dlfcn.h +elf.h +endian.h +err.h +errno.h +execinfo.h +fcntl.h +features.h +float.h +fstab.h +ftw.h +getopt.h +glob.h +grp.h +iconv.h +ifaddrs.h +inttypes.h +langinfo.h +lastlog.h +libgen.h +libintl.h +limits.h +linux/capability.h +linux/fd.h +linux/fs.h +linux/hayesesp.h +linux/hdreg.h +linux/icmp.h +linux/in6.h +linux/joystick.h +linux/ptrace.h +linux/serial.h +linux/sonypi.h +linux/unistd.h +linux/utsname.h +linux/version.h +locale.h +malloc.h +math.h +mcheck.h +memory.h +mntent.h +mqueue.h +netdb.h +net/if.h +netinet/ether.h +netinet/in.h +netinet/ip6.h +netinet/ip.h +netinet/tcp.h +netinet/udp.h +netipx/ipx.h +net/route.h +paths.h +poll.h +pthread.h +pty.h +pwd.h +regex.h +resolv.h +rpc/rpc.h +rpc/types.h +sched.h +scsi/scsi.h +search.h +semaphore.h +setjmp.h +sgtty.h +shadow.h +signal.h +stdarg.h +stdbool.h +stdc +stddef.h +stdint.h +stdio.h +stdlib.h +string.h +strings.h +stropts.h +sys/bitypes.h +sys/cdefs.h +sys/dir.h +sys/epoll.h +sysexits.h +sys/fcntl.h +sys/file.h +sys/fsuid.h +sys/ioctl.h +sys/ipc.h +syslog.h +sys/mman.h +sys/mount.h +sys/mtio.h +sys/param.h +sys/poll.h +sys/prctl.h +sys/ptrace.h +sys/queue.h +sys/reg.h +sys/resource.h +sys/select.h +sys/sem.h +sys/shm.h +sys/signal.h +sys/socket.h +sys/socketvar.h +sys/soundcard.h +sys/statfs.h +sys/stat.h +sys/statvfs.h +sys/stropts.h +sys/swap.h +sys/sysctl.h +sys/sysinfo.h +sys/sysmacros.h +sys/termios.h +sys/timeb.h +sys/time.h +sys/times.h +sys/timex.h +sys/types.h +sys/uio.h +sys/un.h +sys/unistd.h +sys/user.h +sys/utsname.h +sys/vfs.h +sys/wait.h +termio.h +termios.h +time.h +ttyent.h +ulimit.h +unistd.h +ustat.h +utime.h +utmp.h +utmpx.h +values.h +wchar.h +wctype.h diff --git a/meta/recipes-core/uclibc/site_config/types b/meta/recipes-core/uclibc/site_config/types new file mode 100644 index 0000000000..178bd85a00 --- /dev/null +++ b/meta/recipes-core/uclibc/site_config/types @@ -0,0 +1,21 @@ +char +char * +double +float +int +long +long double +long int +long long +long long int +short +short int +signed char +unsigned char +unsigned int +unsigned long +unsigned long int +unsigned long long int +unsigned short +unsigned short int +void * diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc new file mode 100644 index 0000000000..8b9e41c64d --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-config.inc @@ -0,0 +1,142 @@ +DEPENDS += "kern-tools-native" +inherit cml1 +# +# Set the ARCH environment variable for uClibc compilation. +# Return value must match one of the architectures known to uClibc: +# libc/sysdeps/*/* +# + +valid_archs = "\ +alpha \ +arm \ +avr32 \ +bfin \ +c6x \ +cris \ +e1 \ +frv \ +h8300 \ +hppa \ +i386 \ +i960 \ +ia64 \ +m68k \ +microblaze \ +mips \ +nios \ +nios2 \ +powerpc \ +sh \ +sh64 \ +sparc \ +v850 \ +vax \ +x86_64 \ +xtensa \ +" +def map_uclibc_arch(a, d): + """Return the uClibc architecture for the given TARGET_ARCH.""" + import re + + valid_archs = d.getVar('valid_archs', True).split() + + if re.match('^(arm|sa110).*', a): + return 'arm' + elif re.match('^(i.86|athlon)$', a): + return 'i386' + elif re.match('^mips.*', a): + return 'mips' + elif re.match('^parisc.*', a): + return 'hppa' + elif re.match('^ppc.*', a): + return 'powerpc' + elif re.match('^s390.*', a): + return 's390' + elif re.match('^sh.*', a): + return 'sh' + elif re.match('^(sun|sparc).*', a): + return 'sparc' + elif re.match('^xtensa.*', a): + return 'xtensa' + elif a in valid_archs: + return a + else: + bb.error("cannot map '%s' to a uClibc architecture" % a) + +export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}" + +def map_uclibc_abi(o, d): + """Return the uClibc ABI for the given TARGET_OS.""" + import re + + arch = d.getVar('TARGET_ARCH', True) + if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm": + if re.match('.*eabi$', o): + return 'ARM_EABI' + else: + return 'ARM_OABI' + # FIXME: This is inaccurate! Handle o32, n32, n64 + elif re.match('^mips.*64$', arch): + return 'MIPS_N64_ABI' + elif re.match('^mips.*', arch): + return 'MIPS_O32_ABI' + return "" + +export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}" + +def map_uclibc_endian(a, d): + """Return the uClibc endianess for the given TARGET_ARCH.""" + import re + + # Always BE + if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a): + return 'BIG' + # Possibly BE + elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a): + return 'BIG' + return 'LITTLE' + +export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}" + +# internal helper +def uclibc_cfg(feature, features, tokens, cnf, rem): + if type(tokens) == type(""): + tokens = [tokens] + rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens]) + if type(features) == type([]) and feature in features: + cnf.extend([token + '=y' for token in tokens]) + else: + cnf.extend(['# ' + token + ' is not set' for token in tokens]) + +# Map distro features to config settings +def features_to_uclibc_settings(d): + cnf, rem = ([], []) + distro_features = d.getVar('DISTRO_FEATURES', True).split() + uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem) + uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem) + uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem) + uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem) + uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem) + uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem) + uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem) + uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem) + uclibc_cfg('libc-posix-clang-wchar', distro_features,'UCLIBC_HAS_WCHAR', cnf, rem) + return "\n".join(cnf), "\n".join(rem) +# X, Y = ${@features_to_uclibc_settings(d)} +# unfortunately doesn't seem to work with bitbake, workaround: +def features_to_uclibc_conf(d): + cnf, rem = features_to_uclibc_settings(d) + return cnf +def features_to_uclibc_del(d): + cnf, rem = features_to_uclibc_settings(d) + return rem + +# returns all the elements from the src uri that are .cfg files +def find_cfgs(d): + sources=src_patches(d, True) + sources_list=[] + for s in sources: + if s.endswith('.cfg'): + sources_list.append(s) + + return sources_list diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc new file mode 100644 index 0000000000..0649acaab5 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git.inc @@ -0,0 +1,29 @@ +SRCREV="5eddde8f094ef52dca06695cc598e3b2556dcccb" + +PV = "0.9.33+git${SRCPV}" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}" + +SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ + file://uClibc.machine \ + file://uClibc.distro \ + file://obstack.cfg \ + file://locale.cfg \ + file://uclibc_enable_log2_test.patch \ + file://powerpc_copysignl.patch \ + file://argp-support.patch \ + file://argp-headers.patch \ + file://remove_attribute_optimize_Os.patch \ + file://compile-arm-fork-with-O2.patch \ + file://orign_path.patch \ + file://0001-atexit_old-Do-not-add-it-to-shared-libc.patch \ + file://0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch \ + file://0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ + file://0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch \ + file://0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch \ + file://0001-Add-eventfd_read-and-eventfd_write.patch \ + file://0002-wire-setns-syscall.patch \ + file://0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch \ + file://0004-Add-clock_adjtime-syscall.patch \ + " +S = "${WORKDIR}/git" diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch new file mode 100644 index 0000000000..dd0efc0f36 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch @@ -0,0 +1,120 @@ +From e3aae24ede969e2dede1aa19c2ee520cab71ce11 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 20 Feb 2014 00:30:18 -0800 +Subject: [PATCH 1/3] Add eventfd_read() and eventfd_write() + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + libc/sysdeps/linux/common/Makefile.in | 2 ++ + libc/sysdeps/linux/common/eventfd_read.c | 27 +++++++++++++++++++++++++++ + libc/sysdeps/linux/common/eventfd_write.c | 28 ++++++++++++++++++++++++++++ + libc/sysdeps/linux/common/sys/eventfd.h | 4 ---- + 4 files changed, 57 insertions(+), 4 deletions(-) + create mode 100644 libc/sysdeps/linux/common/eventfd_read.c + create mode 100644 libc/sysdeps/linux/common/eventfd_write.c + +diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in +index dbf0b0f..45d2e21 100644 +--- a/libc/sysdeps/linux/common/Makefile.in ++++ b/libc/sysdeps/linux/common/Makefile.in +@@ -25,6 +25,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ + capset.c \ + dup3.c \ + eventfd.c \ ++ eventfd_read.c \ ++ eventfd_write.c \ + inotify.c \ + ioperm.c \ + iopl.c \ +diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c +new file mode 100644 +index 0000000..75f2aaa +--- /dev/null ++++ b/libc/sysdeps/linux/common/eventfd_read.c +@@ -0,0 +1,27 @@ ++/* Copyright (C) 2007-2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++#include ++ ++ ++int ++eventfd_read (int fd, eventfd_t *value) ++{ ++ return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; ++} +diff --git a/libc/sysdeps/linux/common/eventfd_write.c b/libc/sysdeps/linux/common/eventfd_write.c +new file mode 100644 +index 0000000..e1509cf +--- /dev/null ++++ b/libc/sysdeps/linux/common/eventfd_write.c +@@ -0,0 +1,28 @@ ++/* Copyright (C) 2007-2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++#include ++ ++ ++int ++eventfd_write (int fd, eventfd_t value) ++{ ++ return write (fd, &value, ++ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; ++} +diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h +index 1bf785f..91b265b 100644 +--- a/libc/sysdeps/linux/common/sys/eventfd.h ++++ b/libc/sysdeps/linux/common/sys/eventfd.h +@@ -33,16 +33,12 @@ __BEGIN_DECLS + value to COUNT. */ + extern int eventfd (int __count, int __flags) __THROW; + +-#if 0 /* not (yet) implemented in uClibc */ +- + /* Read event counter and possibly wait for events. */ + extern int eventfd_read (int __fd, eventfd_t *__value); + + /* Increment event counter. */ + extern int eventfd_write (int __fd, eventfd_t __value); + +-#endif +- + __END_DECLS + + #endif /* sys/eventfd.h */ +-- +1.9.0 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch new file mode 100644 index 0000000000..4ac765c334 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch @@ -0,0 +1,319 @@ +Upstream-Status: Pending + +From 096abf14d2dc978607ccd8a0d7f42da65d8991f3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 9 Sep 2012 22:00:04 -0700 +Subject: [PATCH] Revert "utent.c, wtent.c: move functions from utxent.c" + +This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18. +--- + include/utmp.h | 8 +++++ + libc/misc/utmp/utent.c | 80 +++++++++++------------------------------------ + libc/misc/utmp/utxent.c | 4 +-- + libc/misc/utmp/wtent.c | 14 ++------- + 4 files changed, 30 insertions(+), 76 deletions(-) + +Index: git/include/utmp.h +=================================================================== +--- git.orig/include/utmp.h 2013-01-21 16:37:18.000000000 -0800 ++++ git/include/utmp.h 2013-01-21 16:40:56.987583099 -0800 +@@ -56,30 +56,37 @@ + /* Append entry UTMP to the wtmp-like file WTMP_FILE. */ + extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp) + __THROW; ++libc_hidden_proto(updwtmp) + + /* Change name of the utmp file to be examined. */ + extern int utmpname (const char *__file) __THROW; ++libc_hidden_proto(utmpname) + + /* Read next entry from a utmp-like file. */ + extern struct utmp *getutent (void) __THROW; ++libc_hidden_proto(getutent) + + /* Reset the input stream to the beginning of the file. */ + extern void setutent (void) __THROW; ++libc_hidden_proto(setutent) + + /* Close the current open file. */ + extern void endutent (void) __THROW; ++libc_hidden_proto(endutent) + + /* Search forward from the current point in the utmp file until the + next entry with a ut_type matching ID->ut_type. */ + extern struct utmp *getutid (const struct utmp *__id) __THROW; ++libc_hidden_proto(getutid) + + /* Search forward from the current point in the utmp file until the + next entry with a ut_line matching LINE->ut_line. */ + extern struct utmp *getutline (const struct utmp *__line) __THROW; ++libc_hidden_proto(getutline) + + /* Write out entry pointed to by UTMP_PTR into the utmp file. */ + extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW; +- ++libc_hidden_proto(pututline) + + #if 0 /* def __USE_MISC */ + /* Reentrant versions of the file for handling utmp files. */ +Index: git/libc/misc/utmp/utent.c +=================================================================== +--- git.orig/libc/misc/utmp/utent.c 2013-01-21 16:37:18.000000000 -0800 ++++ git/libc/misc/utmp/utent.c 2013-01-21 16:38:14.035578638 -0800 +@@ -19,9 +19,6 @@ + #include + #include + #include +-#ifdef __UCLIBC_HAS_UTMPX__ +-# include +-#endif + #include + + #include +@@ -34,7 +31,7 @@ + static const char *static_ut_name = default_file_name; + + /* This function must be called with the LOCK held */ +-static void __setutent_unlocked(void) ++static void __setutent(void) + { + if (static_fd < 0) { + static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC); +@@ -53,24 +50,19 @@ + lseek(static_fd, 0, SEEK_SET); + } + #if defined __UCLIBC_HAS_THREADS__ +-static void __setutent(void) ++void setutent(void) + { + __UCLIBC_MUTEX_LOCK(utmplock); +- __setutent_unlocked(); ++ __setutent(); + __UCLIBC_MUTEX_UNLOCK(utmplock); + } + #else +-static void __setutent(void); +-strong_alias(__setutent_unlocked,__setutent) +-#endif + strong_alias(__setutent,setutent) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-strong_alias(__setutent,setutxent) + #endif ++libc_hidden_def(setutent) + + /* This function must be called with the LOCK held */ +-static struct utmp *__getutent_unlocked(void) ++static struct utmp *__getutent(void) + { + if (static_fd < 0) { + __setutent(); +@@ -86,27 +78,19 @@ + return NULL; + } + #if defined __UCLIBC_HAS_THREADS__ +-static struct utmp *__getutent(void) ++struct utmp *getutent(void) + { + struct utmp *ret; + + __UCLIBC_MUTEX_LOCK(utmplock); +- ret = __getutent_unlocked(); ++ ret = __getutent(); + __UCLIBC_MUTEX_UNLOCK(utmplock); + return ret; + } + #else +-static struct utmp *__getutent(void); +-strong_alias(__getutent_unlocked,__getutent) +-#endif + strong_alias(__getutent,getutent) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-struct utmpx *getutxent(void) +-{ +- return (struct utmpx *) __getutent (); +-} + #endif ++libc_hidden_def(getutent) + + static void __endutent(void) + { +@@ -117,13 +101,10 @@ + __UCLIBC_MUTEX_UNLOCK(utmplock); + } + strong_alias(__endutent,endutent) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-strong_alias(__endutent,endutxent) +-#endif ++libc_hidden_def(endutent) + + /* This function must be called with the LOCK held */ +-static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry) ++static struct utmp *__getutid(const struct utmp *utmp_entry) + { + struct utmp *lutmp; + unsigned type; +@@ -133,7 +114,7 @@ + type = utmp_entry->ut_type - 1; + type /= 4; + +- while ((lutmp = __getutent_unlocked()) != NULL) { ++ while ((lutmp = __getutent()) != NULL) { + if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) { + /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */ + return lutmp; +@@ -147,34 +128,26 @@ + return NULL; + } + #if defined __UCLIBC_HAS_THREADS__ +-static struct utmp *__getutid(const struct utmp *utmp_entry) ++struct utmp *getutid(const struct utmp *utmp_entry) + { + struct utmp *ret; + + __UCLIBC_MUTEX_LOCK(utmplock); +- ret = __getutid_unlocked(utmp_entry); ++ ret = __getutid(utmp_entry); + __UCLIBC_MUTEX_UNLOCK(utmplock); + return ret; + } + #else +-static struct utmp *__getutid(const struct utmp *utmp_entry); +-strong_alias(__getutid_unlocked,__getutid) +-#endif + strong_alias(__getutid,getutid) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-struct utmpx *getutxid(const struct utmpx *utmp_entry) +-{ +- return (struct utmpx *) __getutid ((const struct utmp *) utmp_entry); +-} + #endif ++libc_hidden_def(getutid) + + static struct utmp *__getutline(const struct utmp *utmp_entry) + { + struct utmp *lutmp; + + __UCLIBC_MUTEX_LOCK(utmplock); +- while ((lutmp = __getutent_unlocked()) != NULL) { ++ while ((lutmp = __getutent()) != NULL) { + if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) { + if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) == 0) { + break; +@@ -185,13 +158,7 @@ + return lutmp; + } + strong_alias(__getutline,getutline) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-struct utmpx *getutxline(const struct utmpx *utmp_entry) +-{ +- return (struct utmpx *) __getutline ((const struct utmp *) utmp_entry); +-} +-#endif ++libc_hidden_def(getutline) + + static struct utmp *__pututline(const struct utmp *utmp_entry) + { +@@ -200,7 +167,7 @@ + the file pointer where they want it, everything will work out. */ + lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); + +- if (__getutid_unlocked(utmp_entry) != NULL) ++ if (__getutid(utmp_entry) != NULL) + lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); + else + lseek(static_fd, (off_t) 0, SEEK_END); +@@ -211,13 +178,7 @@ + return (struct utmp *)utmp_entry; + } + strong_alias(__pututline,pututline) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-struct utmpx *pututxline (const struct utmpx *utmp_entry) +-{ +- return (struct utmpx *) __pututline ((const struct utmp *) utmp_entry); +-} +-#endif ++libc_hidden_def(pututline) + + static int __utmpname(const char *new_ut_name) + { +@@ -241,7 +202,4 @@ + return 0; /* or maybe return -(static_ut_name != new_ut_name)? */ + } + strong_alias(__utmpname,utmpname) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-strong_alias(__utmpname,utmpxname) +-#endif ++libc_hidden_def(utmpname) +Index: git/libc/misc/utmp/utxent.c +=================================================================== +--- git.orig/libc/misc/utmp/utxent.c 2013-01-21 16:37:18.000000000 -0800 ++++ git/libc/misc/utmp/utxent.c 2013-01-21 16:38:14.035578638 -0800 +@@ -13,7 +13,6 @@ + #include + #include + +-#if 0 /* moved to utent.c */ + void setutxent(void) + { + setutent (); +@@ -49,12 +48,10 @@ + return utmpname (new_ut_name); + } + +-/* moved to wtent.c */ + void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) + { + updwtmp (wtmpx_file, (const struct utmp *) utmpx); + } +-#endif + + /* Copy the information in UTMPX to UTMP. */ + void getutmp (const struct utmpx *utmpx, struct utmp *utmp) +@@ -107,3 +104,4 @@ + utmpx->ut_time = utmp->ut_time; + #endif + } ++ +Index: git/libc/misc/utmp/wtent.c +=================================================================== +--- git.orig/libc/misc/utmp/wtent.c 2013-01-21 16:37:18.000000000 -0800 ++++ git/libc/misc/utmp/wtent.c 2013-01-21 16:38:14.035578638 -0800 +@@ -11,9 +11,6 @@ + #include + #include + #include +-#ifdef __UCLIBC_HAS_UTMPX__ +-# include +-#endif + #include + #include + #include +@@ -36,7 +33,7 @@ + } + #endif + +-static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp) ++void updwtmp(const char *wtmp_file, const struct utmp *lutmp) + { + int fd; + +@@ -49,11 +46,4 @@ + } + } + } +-strong_alias(__updwtmp,updwtmp) +- +-#ifdef __UCLIBC_HAS_UTMPX__ +-void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) +-{ +- __updwtmp (wtmpx_file, (const struct utmp *) utmpx); +-} +-#endif ++libc_hidden_def(updwtmp) diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch b/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch new file mode 100644 index 0000000000..b6dfce483e --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch @@ -0,0 +1,44 @@ +From 74667582526b39a1906228574d73a6528f4587eb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 23 Jun 2012 13:26:30 -0700 +Subject: [PATCH] atexit_old: Do not add it to shared libc + +atexit should only be in either uclibc_nonshared.a +shared libc case or libc.a in static build case + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libc/stdlib/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in +index 3166b8e..3d686d9 100644 +--- a/libc/stdlib/Makefile.in ++++ b/libc/stdlib/Makefile.in +@@ -60,7 +60,6 @@ CSRC-$(if $(findstring yyy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_X + + # multi source _atexit.c + CSRC-y += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c +-CSRC-$(COMPAT_ATEXIT) += old_atexit.c + + STDLIB_DIR := $(top_srcdir)libc/stdlib + STDLIB_OUT := $(top_builddir)libc/stdlib +@@ -70,11 +69,12 @@ STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC-y)) + + libc-y += $(STDLIB_OBJ) + libc-static-y += $(STDLIB_OUT)/atexit.o $(STDLIB_OUT)/system.o ++libc-static-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.o + libc-shared-y += $(STDLIB_OUT)/system.oS + + # this should always be the PIC version, because it could be used in shared libs + libc-nonshared-y += $(STDLIB_OUT)/atexit.os +- ++libc-nonshared-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.os + libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o $(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o + libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o $(STDLIB_OUT)/_stdlib_strto_ll_l.o + +-- +1.7.9.5 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch b/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch new file mode 100644 index 0000000000..ecb9d31645 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch @@ -0,0 +1,33 @@ +From 95f9b6f37152b8316735d3c86c0db963ff59e22d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 23 Jun 2012 16:51:52 -0700 +Subject: [PATCH] librt: Use -nodefaultlibs instead of -nostdlib + +nostdlib disables linking in startup files too which is not +what we want here since it needs to resolve __dso_handle +which comes from crtbeginS.o, otherwise librt has this +undefined reference to a weak undefined __dso_handle that +shows up as error (with gold linker) +when shared libraries are being built which are +linking in librt + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + librt/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +Index: git/librt/Makefile.in +=================================================================== +--- git.orig/librt/Makefile.in 2012-06-24 10:32:59.512653237 -0700 ++++ git/librt/Makefile.in 2012-06-24 11:31:00.660821666 -0700 +@@ -15,6 +15,9 @@ + ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) + LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so + endif ++START_FILE-librt.so := $(SHARED_START_FILES) ++END_FILE-librt.so := $(SHARED_END_FILES) ++ + + librt_FULL_NAME := librt-$(VERSION).so + diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch new file mode 100644 index 0000000000..7e7c5793f1 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch @@ -0,0 +1,28 @@ +From 714f543f4fa8fb3911449b6ce1517481359e0cff Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 23 Jun 2012 14:21:17 -0700 +Subject: [PATCH] nptl/arm: Move aeabi_read_tp to uclibc_nonshared.a + +Otherwise it creates wrong references from shared libs + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + libc/sysdeps/linux/arm/Makefile.arch | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +Index: git/libc/sysdeps/linux/arm/Makefile.arch +=================================================================== +--- git.orig/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:13:32.000000000 -0700 ++++ git/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:16:18.304333131 -0700 +@@ -13,7 +13,9 @@ + vfork.S clone.S + + SSRC-$(UCLIBC_HAS_LFS) += mmap64.S +-SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-aeabi_read_tp.S libc-thumb_atomics.S ++SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-thumb_atomics.S ++libc-nonshared-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.os ++libc-static-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.o + CSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.c + SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += getcontext.S setcontext.S swapcontext.S + diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch new file mode 100644 index 0000000000..297a40bd04 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch @@ -0,0 +1,74 @@ +From d021e6252b33e779857846714fb1899a25c9965d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 23 Jun 2012 15:59:01 -0700 +Subject: [PATCH] nptl/atfork: Hide pthread_atfork in shared versions + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + libpthread/nptl/Makefile.in | 4 +++- + libpthread/nptl/pthread_atfork.c | 12 ++++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in +index 158bcae..3ef7175 100644 +--- a/libpthread/nptl/Makefile.in ++++ b/libpthread/nptl/Makefile.in +@@ -16,6 +16,7 @@ libc-shared-routines-y = forward.c libc-cancellation.c + libc-static-routines-y = alloca_cutoff.c libc-cancellation.c + libpthread-shared-only-routines-y = version.c + libpthread-static-only-routines-y = pthread_atfork.c ++ + libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files + libpthread-routines- += allocatestack.c # dummy included by pthread_create.c + libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them! +@@ -208,7 +209,7 @@ CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables + CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables + + CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib +- ++CFLAGS-pthread_atfork.c = -DNOT_IN_libc + # + # The rest of this file is uClibc specific. + # +@@ -224,3 +225,4 @@ CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-nptl) + CFLAGS-OMIT-forward.c = $(CFLAGS-nptl) + CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-nptl) + CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-nptl) ++ +diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c +index e607d49..6224c17 100644 +--- a/libpthread/nptl/pthread_atfork.c ++++ b/libpthread/nptl/pthread_atfork.c +@@ -38,13 +38,17 @@ + #include + + /* This is defined by newer gcc version unique for each module. */ +-extern void *__dso_handle __attribute__ ((__weak__)); +- //,__visibility__ ("hidden"))); ++extern void *__dso_handle __attribute__ ((__weak__, ++ __visibility__ ("hidden"))); + + + /* Hide the symbol so that no definition but the one locally in the + executable or DSO is used. */ + int ++#ifndef __pthread_atfork ++/* Don't mark the compatibility function as hidden. */ ++attribute_hidden ++#endif + __pthread_atfork ( + void (*prepare) (void), + void (*parent) (void), +@@ -53,4 +57,8 @@ __pthread_atfork ( + return __register_atfork (prepare, parent, child, + &__dso_handle == NULL ? NULL : __dso_handle); + } ++#ifndef __pthread_atfork ++extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), ++ void (*child) (void)) attribute_hidden; + strong_alias (__pthread_atfork, pthread_atfork) ++#endif +-- +1.7.9.5 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch new file mode 100644 index 0000000000..94c6f68571 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch @@ -0,0 +1,68 @@ +From db575359d4b8164ad6c2ac5f36c7a50c065a2864 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 20 Feb 2014 00:44:34 -0800 +Subject: [PATCH 2/3] wire setns syscall + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + libc/sysdeps/linux/common/Makefile.in | 1 + + libc/sysdeps/linux/common/bits/sched.h | 4 ++++ + libc/sysdeps/linux/common/setns.c | 18 ++++++++++++++++++ + 3 files changed, 23 insertions(+) + create mode 100644 libc/sysdeps/linux/common/setns.c + +diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in +index 45d2e21..10d9884 100644 +--- a/libc/sysdeps/linux/common/Makefile.in ++++ b/libc/sysdeps/linux/common/Makefile.in +@@ -45,6 +45,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ + sendfile.c \ + setfsgid.c \ + setfsuid.c \ ++ setns.c \ + setresgid.c \ + setresuid.c \ + signalfd.c \ +diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h +index a5eb6ee..9436f66 100644 +--- a/libc/sysdeps/linux/common/bits/sched.h ++++ b/libc/sysdeps/linux/common/bits/sched.h +@@ -85,6 +85,10 @@ extern int unshare (int __flags) __THROW; + + /* Get index of currently used CPU. */ + extern int sched_getcpu (void) __THROW; ++ ++/* Switch process to namespace of type NSTYPE indicated by FD. */ ++extern int setns (int __fd, int __nstype) __THROW; ++ + #endif + + __END_DECLS +diff --git a/libc/sysdeps/linux/common/setns.c b/libc/sysdeps/linux/common/setns.c +new file mode 100644 +index 0000000..376bf26 +--- /dev/null ++++ b/libc/sysdeps/linux/common/setns.c +@@ -0,0 +1,18 @@ ++/* vi: set sw=4 ts=4: */ ++/* ++ * setns() for uClibc ++ * ++ * Copyright (C) 2014 Khem Raj ++ * ++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++ */ ++ ++#include ++#include ++ ++/* ++ * setns() ++ */ ++#ifdef __NR_setns ++_syscall2(int, setns, int, fd, int, nstype) ++#endif +-- +1.9.0 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch b/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch new file mode 100644 index 0000000000..f4387db9c7 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch @@ -0,0 +1,377 @@ +From 7791d129d777e481a1e429815edcd05978438840 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 20 Feb 2014 01:12:14 -0800 +Subject: [PATCH 3/3] fcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZ + +Signed-off-by: Khem Raj +Upstream-Status: Pending +--- + libc/sysdeps/linux/alpha/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/arc/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/arm/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/bfin/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/cris/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/e1/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/frv/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/h8300/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/hppa/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/i386/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/i960/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/ia64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/m68k/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/metag/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/microblaze/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/mips/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/nios/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/nios2/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/powerpc/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/sh/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/sh64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/sparc/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/v850/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/vax/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/x86_64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/xtensa/bits/fcntl.h | 2 ++ + 26 files changed, 52 insertions(+) + +diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h +index dd32529..a44be9e 100644 +--- a/libc/sysdeps/linux/alpha/bits/fcntl.h ++++ b/libc/sysdeps/linux/alpha/bits/fcntl.h +@@ -94,6 +94,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* for F_[GET|SET]FD */ +diff --git a/libc/sysdeps/linux/arc/bits/fcntl.h b/libc/sysdeps/linux/arc/bits/fcntl.h +index 71136da..1cb9600 100755 +--- a/libc/sysdeps/linux/arc/bits/fcntl.h ++++ b/libc/sysdeps/linux/arc/bits/fcntl.h +@@ -87,6 +87,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h +index f1a54f0..aedc154 100644 +--- a/libc/sysdeps/linux/arm/bits/fcntl.h ++++ b/libc/sysdeps/linux/arm/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h +index c6cba56..e987824 100644 +--- a/libc/sysdeps/linux/bfin/bits/fcntl.h ++++ b/libc/sysdeps/linux/bfin/bits/fcntl.h +@@ -98,6 +98,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h +index acc5e25..029bb80 100644 +--- a/libc/sysdeps/linux/cris/bits/fcntl.h ++++ b/libc/sysdeps/linux/cris/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/e1/bits/fcntl.h b/libc/sysdeps/linux/e1/bits/fcntl.h +index da699c8..2e0e6ba 100644 +--- a/libc/sysdeps/linux/e1/bits/fcntl.h ++++ b/libc/sysdeps/linux/e1/bits/fcntl.h +@@ -93,6 +93,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h +index 3aacc9d..5a7d9ef 100644 +--- a/libc/sysdeps/linux/frv/bits/fcntl.h ++++ b/libc/sysdeps/linux/frv/bits/fcntl.h +@@ -95,6 +95,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h +index d0b8310..45deec4 100644 +--- a/libc/sysdeps/linux/h8300/bits/fcntl.h ++++ b/libc/sysdeps/linux/h8300/bits/fcntl.h +@@ -93,6 +93,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h +index 1bb41ce..abb3372 100644 +--- a/libc/sysdeps/linux/hppa/bits/fcntl.h ++++ b/libc/sysdeps/linux/hppa/bits/fcntl.h +@@ -96,6 +96,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* for F_[GET|SET]FL */ +diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h +index d48e62a..79b69d4 100644 +--- a/libc/sysdeps/linux/i386/bits/fcntl.h ++++ b/libc/sysdeps/linux/i386/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/i960/bits/fcntl.h b/libc/sysdeps/linux/i960/bits/fcntl.h +index e2fcbe6..f6e145d 100644 +--- a/libc/sysdeps/linux/i960/bits/fcntl.h ++++ b/libc/sysdeps/linux/i960/bits/fcntl.h +@@ -93,6 +93,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h +index 1ff0ed5..fedefb6 100644 +--- a/libc/sysdeps/linux/ia64/bits/fcntl.h ++++ b/libc/sysdeps/linux/ia64/bits/fcntl.h +@@ -95,6 +95,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h +index d7beb6c..66df337 100644 +--- a/libc/sysdeps/linux/m68k/bits/fcntl.h ++++ b/libc/sysdeps/linux/m68k/bits/fcntl.h +@@ -98,6 +98,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/metag/bits/fcntl.h b/libc/sysdeps/linux/metag/bits/fcntl.h +index c4f641b..e10abd7 100644 +--- a/libc/sysdeps/linux/metag/bits/fcntl.h ++++ b/libc/sysdeps/linux/metag/bits/fcntl.h +@@ -100,6 +100,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h +index a2e3573..20b7597 100644 +--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h ++++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h +@@ -98,6 +98,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + # define F_SETPIPE_SZ 1031 /* Set of pipe page size array */ + # define F_GETPIPE_SZ 1032 /* Get of pipe page size array */ + #endif +diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h +index 4291f6e..8c4c115 100644 +--- a/libc/sysdeps/linux/mips/bits/fcntl.h ++++ b/libc/sysdeps/linux/mips/bits/fcntl.h +@@ -111,6 +111,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/nios/bits/fcntl.h b/libc/sysdeps/linux/nios/bits/fcntl.h +index 5854c18..36ca766 100644 +--- a/libc/sysdeps/linux/nios/bits/fcntl.h ++++ b/libc/sysdeps/linux/nios/bits/fcntl.h +@@ -96,6 +96,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h +index d7beb6c..66df337 100644 +--- a/libc/sysdeps/linux/nios2/bits/fcntl.h ++++ b/libc/sysdeps/linux/nios2/bits/fcntl.h +@@ -98,6 +98,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h +index 217f54a..d150a31 100644 +--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h ++++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h +index 5c9f047..aceaec6 100644 +--- a/libc/sysdeps/linux/sh/bits/fcntl.h ++++ b/libc/sysdeps/linux/sh/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/sh64/bits/fcntl.h b/libc/sysdeps/linux/sh64/bits/fcntl.h +index ff741cb..b319e8b 100644 +--- a/libc/sysdeps/linux/sh64/bits/fcntl.h ++++ b/libc/sysdeps/linux/sh64/bits/fcntl.h +@@ -95,6 +95,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h +index 235d2ad..7e80d9e 100644 +--- a/libc/sysdeps/linux/sparc/bits/fcntl.h ++++ b/libc/sysdeps/linux/sparc/bits/fcntl.h +@@ -106,6 +106,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + #if __WORDSIZE == 64 +diff --git a/libc/sysdeps/linux/v850/bits/fcntl.h b/libc/sysdeps/linux/v850/bits/fcntl.h +index d0b8310..45deec4 100644 +--- a/libc/sysdeps/linux/v850/bits/fcntl.h ++++ b/libc/sysdeps/linux/v850/bits/fcntl.h +@@ -93,6 +93,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/vax/bits/fcntl.h b/libc/sysdeps/linux/vax/bits/fcntl.h +index ff5bff3..a30d5e1 100644 +--- a/libc/sysdeps/linux/vax/bits/fcntl.h ++++ b/libc/sysdeps/linux/vax/bits/fcntl.h +@@ -92,6 +92,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FL. */ +diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h +index a899dcf..02e011d 100644 +--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h ++++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h +@@ -113,6 +113,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h +index 5d28547..4e9aa7e 100644 +--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h ++++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h +@@ -99,6 +99,8 @@ + # define F_NOTIFY 1026 /* Request notfications on a directory. */ + # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ ++# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ ++# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ + #endif + + /* For F_[GET|SET]FD. */ +-- +1.9.0 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch new file mode 100644 index 0000000000..3062ae4abc --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch @@ -0,0 +1,73 @@ +From 8e19e651145554fbcb90179f3dfbc7ea8a07c900 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 15 Mar 2014 09:32:20 -0700 +Subject: [PATCH 4/4] Add clock_adjtime syscall + +Signed-off-by: Khem Raj +--- + include/sys/timex.h | 5 ++++- + libc/sysdeps/linux/common/Makefile.in | 2 +- + libc/sysdeps/linux/common/clock_adjtime.c | 15 +++++++++++++++ + 3 files changed, 20 insertions(+), 2 deletions(-) + create mode 100644 libc/sysdeps/linux/common/clock_adjtime.c + +diff --git a/include/sys/timex.h b/include/sys/timex.h +index 621afce..9082a28 100644 +--- a/include/sys/timex.h ++++ b/include/sys/timex.h +@@ -20,6 +20,7 @@ + + #include + #include ++#include + + /* These definitions from linux/timex.h as of 2.2.0. */ + +@@ -125,7 +126,9 @@ libc_hidden_proto(adjtimex) + extern int ntp_gettime (struct ntptimeval *__ntv) __THROW; + extern int ntp_adjtime (struct timex *__tntx) __THROW; + #endif +- ++#if defined __UCLIBC_HAS_REALTIME__ ++extern int clock_adjtime (clockid_t __clock_id, struct timex *__ntx) __THROW; ++#endif + __END_DECLS + + #endif /* sys/timex.h */ +diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in +index 10d9884..bb985b6 100644 +--- a/libc/sysdeps/linux/common/Makefile.in ++++ b/libc/sysdeps/linux/common/Makefile.in +@@ -84,7 +84,7 @@ CSRC-$(ARCH_USE_MMU) += msync.c + CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c + CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c + # aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime +-CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ ++CSRC-$(UCLIBC_HAS_REALTIME) += clock_adjtime.c clock_getres.c clock_gettime.c clock_settime.c \ + fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \ + nanosleep.c __rt_sigtimedwait.c __rt_sigwaitinfo.c sched_getparam.c \ + sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ +diff --git a/libc/sysdeps/linux/common/clock_adjtime.c b/libc/sysdeps/linux/common/clock_adjtime.c +new file mode 100644 +index 0000000..968ec27 +--- /dev/null ++++ b/libc/sysdeps/linux/common/clock_adjtime.c +@@ -0,0 +1,15 @@ ++/* ++ * clock_adjtime() for uClibc ++ * ++ * Copyright (C) 2005 by Peter Kjellerstedt ++ * Copyright (C) 2000-2006 Erik Andersen ++ * ++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++ */ ++ ++#include ++#include ++ ++#ifdef __NR_clock_adjtime ++_syscall2(int, clock_adjtime, clockid_t, clock_id, struct timex*, ntx) ++#endif +-- +1.9.0 + diff --git a/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch b/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch new file mode 100644 index 0000000000..b31b991846 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch @@ -0,0 +1,583 @@ +Added headers file needed by argp sources. + +Signed-off-by: Salvatore Cro +--- + include/argp.h | 566 ++++++++++++++++++++++++++++++++++++++++++++ + libc/argp/argp-fmtstream.h | 314 ++++++++++++++++++++++++ + 2 files changed, 880 insertions(+), 0 deletions(-) + create mode 100644 include/argp.h + create mode 100644 libc/argp/argp-fmtstream.h + +Upstream-Status: Pending + +Index: git/include/argp.h +=================================================================== +--- /dev/null ++++ git/include/argp.h +@@ -0,0 +1,566 @@ ++/* Hierarchial argument parsing, layered over getopt. ++ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007, 2009 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++#ifndef _ARGP_H ++#define _ARGP_H ++ ++#include ++#include ++#include ++ ++#define __need_error_t ++#include ++ ++#ifndef __const ++# define __const const ++#endif ++ ++#ifndef __THROW ++# define __THROW ++#endif ++#ifndef __NTH ++# define __NTH(fct) fct __THROW ++#endif ++ ++#ifndef __attribute__ ++/* This feature is available in gcc versions 2.5 and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__) ++# define __attribute__(Spec) /* empty */ ++# endif ++/* The __-protected variants of `format' and `printf' attributes ++ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__) ++# define __format__ format ++# define __printf__ printf ++# endif ++#endif ++ ++/* GCC 2.95 and later have "__restrict"; C99 compilers have ++ "restrict", and "configure" may have defined "restrict". */ ++#ifndef __restrict ++# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) ++# if defined restrict || 199901L <= __STDC_VERSION__ ++# define __restrict restrict ++# else ++# define __restrict ++# endif ++# endif ++#endif ++ ++#ifndef __error_t_defined ++typedef int error_t; ++# define __error_t_defined ++#endif ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* A description of a particular option. A pointer to an array of ++ these is passed in the OPTIONS field of an argp structure. Each option ++ entry can correspond to one long option and/or one short option; more ++ names for the same option can be added by following an entry in an option ++ array with options having the OPTION_ALIAS flag set. */ ++struct argp_option ++{ ++ /* The long option name. For more than one name for the same option, you ++ can use following options with the OPTION_ALIAS flag set. */ ++ __const char *name; ++ ++ /* What key is returned for this option. If > 0 and printable, then it's ++ also accepted as a short option. */ ++ int key; ++ ++ /* If non-NULL, this is the name of the argument associated with this ++ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */ ++ __const char *arg; ++ ++ /* OPTION_ flags. */ ++ int flags; ++ ++ /* The doc string for this option. If both NAME and KEY are 0, This string ++ will be printed outdented from the normal option column, making it ++ useful as a group header (it will be the first thing printed in its ++ group); in this usage, it's conventional to end the string with a `:'. */ ++ __const char *doc; ++ ++ /* The group this option is in. In a long help message, options are sorted ++ alphabetically within each group, and the groups presented in the order ++ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with ++ if this field 0 will inherit the group number of the previous entry, or ++ zero if it's the first one, unless its a group header (NAME and KEY both ++ 0), in which case, the previous entry + 1 is the default. Automagic ++ options such as --help are put into group -1. */ ++ int group; ++}; ++ ++/* The argument associated with this option is optional. */ ++#define OPTION_ARG_OPTIONAL 0x1 ++ ++/* This option isn't displayed in any help messages. */ ++#define OPTION_HIDDEN 0x2 ++ ++/* This option is an alias for the closest previous non-alias option. This ++ means that it will be displayed in the same help entry, and will inherit ++ fields other than NAME and KEY from the aliased option. */ ++#define OPTION_ALIAS 0x4 ++ ++/* This option isn't actually an option (and so should be ignored by the ++ actual option parser), but rather an arbitrary piece of documentation that ++ should be displayed in much the same manner as the options. If this flag ++ is set, then the option NAME field is displayed unmodified (e.g., no `--' ++ prefix is added) at the left-margin (where a *short* option would normally ++ be displayed), and the documentation string in the normal place. For ++ purposes of sorting, any leading whitespace and punctuation is ignored, ++ except that if the first non-whitespace character is not `-', this entry ++ is displayed after all options (and OPTION_DOC entries with a leading `-') ++ in the same group. */ ++#define OPTION_DOC 0x8 ++ ++/* This option shouldn't be included in `long' usage messages (but is still ++ included in help messages). This is mainly intended for options that are ++ completely documented in an argp's ARGS_DOC field, in which case including ++ the option in the generic usage list would be redundant. For instance, ++ if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to ++ distinguish these two cases, -x should probably be marked ++ OPTION_NO_USAGE. */ ++#define OPTION_NO_USAGE 0x10 ++ ++struct argp; /* fwd declare this type */ ++struct argp_state; /* " */ ++struct argp_child; /* " */ ++ ++/* The type of a pointer to an argp parsing function. */ ++typedef error_t (*argp_parser_t) (int __key, char *__arg, ++ struct argp_state *__state); ++ ++/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such ++ returns will simply be ignored. For user keys, this error will be turned ++ into EINVAL (if the call to argp_parse is such that errors are propagated ++ back to the user instead of exiting); returning EINVAL itself would result ++ in an immediate stop to parsing in *all* cases. */ ++#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */ ++ ++/* Special values for the KEY argument to an argument parsing function. ++ ARGP_ERR_UNKNOWN should be returned if they aren't understood. ++ ++ The sequence of keys to a parsing function is either (where each ++ uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key): ++ ++ INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all ++ or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed ++ or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized ++ ++ The third case is where every parser returned ARGP_KEY_UNKNOWN for an ++ argument, in which case parsing stops at that argument (returning the ++ unparsed arguments to the caller of argp_parse if requested, or stopping ++ with an error message if not). ++ ++ If an error occurs (either detected by argp, or because the parsing ++ function returned an error value), then the parser is called with ++ ARGP_KEY_ERROR, and no further calls are made. */ ++ ++/* This is not an option at all, but rather a command line argument. If a ++ parser receiving this key returns success, the fact is recorded, and the ++ ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the ++ argument, a parser function decrements the NEXT field of the state it's ++ passed, the option won't be considered processed; this is to allow you to ++ actually modify the argument (perhaps into an option), and have it ++ processed again. */ ++#define ARGP_KEY_ARG 0 ++/* There are remaining arguments not parsed by any parser, which may be found ++ starting at (STATE->argv + STATE->next). If success is returned, but ++ STATE->next left untouched, it's assumed that all arguments were consume, ++ otherwise, the parser should adjust STATE->next to reflect any arguments ++ consumed. */ ++#define ARGP_KEY_ARGS 0x1000006 ++/* There are no more command line arguments at all. */ ++#define ARGP_KEY_END 0x1000001 ++/* Because it's common to want to do some special processing if there aren't ++ any non-option args, user parsers are called with this key if they didn't ++ successfully process any non-option arguments. Called just before ++ ARGP_KEY_END (where more general validity checks on previously parsed ++ arguments can take place). */ ++#define ARGP_KEY_NO_ARGS 0x1000002 ++/* Passed in before any parsing is done. Afterwards, the values of each ++ element of the CHILD_INPUT field, if any, in the state structure is ++ copied to each child's state to be the initial value of the INPUT field. */ ++#define ARGP_KEY_INIT 0x1000003 ++/* Use after all other keys, including SUCCESS & END. */ ++#define ARGP_KEY_FINI 0x1000007 ++/* Passed in when parsing has successfully been completed (even if there are ++ still arguments remaining). */ ++#define ARGP_KEY_SUCCESS 0x1000004 ++/* Passed in if an error occurs. */ ++#define ARGP_KEY_ERROR 0x1000005 ++ ++/* An argp structure contains a set of options declarations, a function to ++ deal with parsing one, documentation string, a possible vector of child ++ argp's, and perhaps a function to filter help output. When actually ++ parsing options, getopt is called with the union of all the argp ++ structures chained together through their CHILD pointers, with conflicts ++ being resolved in favor of the first occurrence in the chain. */ ++struct argp ++{ ++ /* An array of argp_option structures, terminated by an entry with both ++ NAME and KEY having a value of 0. */ ++ __const struct argp_option *options; ++ ++ /* What to do with an option from this structure. KEY is the key ++ associated with the option, and ARG is any associated argument (NULL if ++ none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be ++ returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then ++ parsing is stopped immediately, and that value is returned from ++ argp_parse(). For special (non-user-supplied) values of KEY, see the ++ ARGP_KEY_ definitions below. */ ++ argp_parser_t parser; ++ ++ /* A string describing what other arguments are wanted by this program. It ++ is only used by argp_usage to print the `Usage:' message. If it ++ contains newlines, the strings separated by them are considered ++ alternative usage patterns, and printed on separate lines (lines after ++ the first are prefix by ` or: ' instead of `Usage:'). */ ++ __const char *args_doc; ++ ++ /* If non-NULL, a string containing extra text to be printed before and ++ after the options in a long help message (separated by a vertical tab ++ `\v' character). */ ++ __const char *doc; ++ ++ /* A vector of argp_children structures, terminated by a member with a 0 ++ argp field, pointing to child argps should be parsed with this one. Any ++ conflicts are resolved in favor of this argp, or early argps in the ++ CHILDREN list. This field is useful if you use libraries that supply ++ their own argp structure, which you want to use in conjunction with your ++ own. */ ++ __const struct argp_child *children; ++ ++ /* If non-zero, this should be a function to filter the output of help ++ messages. KEY is either a key from an option, in which case TEXT is ++ that option's help text, or a special key from the ARGP_KEY_HELP_ ++ defines, below, describing which other help text TEXT is. The function ++ should return either TEXT, if it should be used as-is, a replacement ++ string, which should be malloced, and will be freed by argp, or NULL, ++ meaning `print nothing'. The value for TEXT is *after* any translation ++ has been done, so if any of the replacement text also needs translation, ++ that should be done by the filter function. INPUT is either the input ++ supplied to argp_parse, or NULL, if argp_help was called directly. */ ++ char *(*help_filter) (int __key, __const char *__text, void *__input); ++ ++ /* If non-zero the strings used in the argp library are translated using ++ the domain described by this string. Otherwise the currently installed ++ default domain is used. */ ++ const char *argp_domain; ++}; ++ ++/* Possible KEY arguments to a help filter function. */ ++#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */ ++#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */ ++#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */ ++#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation; ++ TEXT is NULL for this key. */ ++/* Explanatory note emitted when duplicate option arguments have been ++ suppressed. */ ++#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005 ++#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */ ++ ++/* When an argp has a non-zero CHILDREN field, it should point to a vector of ++ argp_child structures, each of which describes a subsidiary argp. */ ++struct argp_child ++{ ++ /* The child parser. */ ++ __const struct argp *argp; ++ ++ /* Flags for this child. */ ++ int flags; ++ ++ /* If non-zero, an optional header to be printed in help output before the ++ child options. As a side-effect, a non-zero value forces the child ++ options to be grouped together; to achieve this effect without actually ++ printing a header string, use a value of "". */ ++ __const char *header; ++ ++ /* Where to group the child options relative to the other (`consolidated') ++ options in the parent argp; the values are the same as the GROUP field ++ in argp_option structs, but all child-groupings follow parent options at ++ a particular group level. If both this field and HEADER are zero, then ++ they aren't grouped at all, but rather merged with the parent options ++ (merging the child's grouping levels with the parents). */ ++ int group; ++}; ++ ++/* Parsing state. This is provided to parsing functions called by argp, ++ which may examine and, as noted, modify fields. */ ++struct argp_state ++{ ++ /* The top level ARGP being parsed. */ ++ __const struct argp *root_argp; ++ ++ /* The argument vector being parsed. May be modified. */ ++ int argc; ++ char **argv; ++ ++ /* The index in ARGV of the next arg that to be parsed. May be modified. */ ++ int next; ++ ++ /* The flags supplied to argp_parse. May be modified. */ ++ unsigned flags; ++ ++ /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the ++ number of the current arg, starting at zero, and incremented after each ++ such call returns. At all other times, this is the number of such ++ arguments that have been processed. */ ++ unsigned arg_num; ++ ++ /* If non-zero, the index in ARGV of the first argument following a special ++ `--' argument (which prevents anything following being interpreted as an ++ option). Only set once argument parsing has proceeded past this point. */ ++ int quoted; ++ ++ /* An arbitrary pointer passed in from the user. */ ++ void *input; ++ /* Values to pass to child parsers. This vector will be the same length as ++ the number of children for the current parser. */ ++ void **child_inputs; ++ ++ /* For the parser's use. Initialized to 0. */ ++ void *hook; ++ ++ /* The name used when printing messages. This is initialized to ARGV[0], ++ or PROGRAM_INVOCATION_NAME if that is unavailable. */ ++ char *name; ++ ++ /* Streams used when argp prints something. */ ++ FILE *err_stream; /* For errors; initialized to stderr. */ ++ FILE *out_stream; /* For information; initialized to stdout. */ ++ ++ void *pstate; /* Private, for use by argp. */ ++}; ++ ++/* Flags for argp_parse (note that the defaults are those that are ++ convenient for program command line parsing): */ ++ ++/* Don't ignore the first element of ARGV. Normally (and always unless ++ ARGP_NO_ERRS is set) the first element of the argument vector is ++ skipped for option parsing purposes, as it corresponds to the program name ++ in a command line. */ ++#define ARGP_PARSE_ARGV0 0x01 ++ ++/* Don't print error messages for unknown options to stderr; unless this flag ++ is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program ++ name in the error messages. This flag implies ARGP_NO_EXIT (on the ++ assumption that silent exiting upon errors is bad behaviour). */ ++#define ARGP_NO_ERRS 0x02 ++ ++/* Don't parse any non-option args. Normally non-option args are parsed by ++ calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg ++ as the value. Since it's impossible to know which parse function wants to ++ handle it, each one is called in turn, until one returns 0 or an error ++ other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the ++ argp_parse returns prematurely (but with a return value of 0). If all ++ args have been parsed without error, all parsing functions are called one ++ last time with a key of ARGP_KEY_END. This flag needn't normally be set, ++ as the normal behavior is to stop parsing as soon as some argument can't ++ be handled. */ ++#define ARGP_NO_ARGS 0x04 ++ ++/* Parse options and arguments in the same order they occur on the command ++ line -- normally they're rearranged so that all options come first. */ ++#define ARGP_IN_ORDER 0x08 ++ ++/* Don't provide the standard long option --help, which causes usage and ++ option help information to be output to stdout, and exit (0) called. */ ++#define ARGP_NO_HELP 0x10 ++ ++/* Don't exit on errors (they may still result in error messages). */ ++#define ARGP_NO_EXIT 0x20 ++ ++/* Use the gnu getopt `long-only' rules for parsing arguments. */ ++#define ARGP_LONG_ONLY 0x40 ++ ++/* Turns off any message-printing/exiting options. */ ++#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP) ++ ++/* Parse the options strings in ARGC & ARGV according to the options in ARGP. ++ FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the ++ index in ARGV of the first unparsed option is returned in it. If an ++ unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser ++ routine returned a non-zero value, it is returned; otherwise 0 is ++ returned. This function may also call exit unless the ARGP_NO_HELP flag ++ is set. INPUT is a pointer to a value to be passed in to the parser. */ ++extern error_t argp_parse (__const struct argp *__restrict __argp, ++ int __argc, char **__restrict __argv, ++ unsigned __flags, int *__restrict __arg_index, ++ void *__restrict __input); ++ ++/* Global variables. */ ++ ++/* If defined or set by the user program to a non-zero value, then a default ++ option --version is added (unless the ARGP_NO_HELP flag is used), which ++ will print this string followed by a newline and exit (unless the ++ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ ++extern __const char *argp_program_version; ++ ++/* If defined or set by the user program to a non-zero value, then a default ++ option --version is added (unless the ARGP_NO_HELP flag is used), which ++ calls this function with a stream to print the version to and a pointer to ++ the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is ++ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ ++extern void (*argp_program_version_hook) (FILE *__restrict __stream, ++ struct argp_state *__restrict ++ __state); ++ ++/* If defined or set by the user program, it should point to string that is ++ the bug-reporting address for the program. It will be printed by ++ argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various ++ standard help messages), embedded in a sentence that says something like ++ `Report bugs to ADDR.'. */ ++extern __const char *argp_program_bug_address; ++ ++/* The exit status that argp will use when exiting due to a parsing error. ++ If not defined or set by the user program, this defaults to EX_USAGE from ++ . */ ++extern error_t argp_err_exit_status; ++ ++/* Flags for argp_help. */ ++#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */ ++#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */ ++#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */ ++#define ARGP_HELP_LONG 0x08 /* a long help message. */ ++#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */ ++#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */ ++#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC) ++#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */ ++#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to ++ reflect ARGP_LONG_ONLY mode. */ ++ ++/* These ARGP_HELP flags are only understood by argp_state_help. */ ++#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */ ++#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */ ++ ++/* The standard thing to do after a program command line parsing error, if an ++ error message has already been printed. */ ++#define ARGP_HELP_STD_ERR \ ++ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) ++/* The standard thing to do after a program command line parsing error, if no ++ more specific error message has been printed. */ ++#define ARGP_HELP_STD_USAGE \ ++ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) ++/* The standard thing to do in response to a --help option. */ ++#define ARGP_HELP_STD_HELP \ ++ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \ ++ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR) ++ ++/* Output a usage message for ARGP to STREAM. FLAGS are from the set ++ ARGP_HELP_*. */ ++extern void argp_help (__const struct argp *__restrict __argp, ++ FILE *__restrict __stream, ++ unsigned __flags, char *__restrict __name); ++ ++/* The following routines are intended to be called from within an argp ++ parsing routine (thus taking an argp_state structure as the first ++ argument). They may or may not print an error message and exit, depending ++ on the flags in STATE -- in any case, the caller should be prepared for ++ them *not* to exit, and should return an appropiate error after calling ++ them. [argp_usage & argp_error should probably be called argp_state_..., ++ but they're used often enough that they should be short] */ ++ ++/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are ++ from the set ARGP_HELP_*. */ ++extern void argp_state_help (__const struct argp_state *__restrict __state, ++ FILE *__restrict __stream, ++ unsigned int __flags); ++/* Possibly output the standard usage message for ARGP to stderr and exit. */ ++extern void argp_usage (__const struct argp_state *__state); ++ ++/* If appropriate, print the printf string FMT and following args, preceded ++ by the program name and `:', to stderr, and followed by a `Try ... --help' ++ message, then exit (1). */ ++extern void argp_error (__const struct argp_state *__restrict __state, ++ __const char *__restrict __fmt, ...) ++ __attribute__ ((__format__ (__printf__, 2, 3))); ++/* Similar to the standard gnu error-reporting function error(), but will ++ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print ++ to STATE->err_stream. This is useful for argument parsing code that is ++ shared between program startup (when exiting is desired) and runtime ++ option parsing (when typically an error code is returned instead). The ++ difference between this function and argp_error is that the latter is for ++ *parsing errors*, and the former is for other problems that occur during ++ parsing but don't reflect a (syntactic) problem with the input. */ ++extern void argp_failure (__const struct argp_state *__restrict __state, ++ int __status, int __errnum, ++ __const char *__restrict __fmt, ...) ++ __attribute__ ((__format__ (__printf__, 4, 5))); ++/* Returns true if the option OPT is a valid short option. */ ++extern int _option_is_short (__const struct argp_option *__opt) __THROW; ++extern int __option_is_short (__const struct argp_option *__opt) __THROW; ++ ++/* Returns true if the option OPT is in fact the last (unused) entry in an ++ options array. */ ++extern int _option_is_end (__const struct argp_option *__opt) __THROW; ++extern int __option_is_end (__const struct argp_option *__opt) __THROW; ++ ++/* Return the input field for ARGP in the parser corresponding to STATE; used ++ by the help routines. */ ++/* We think this should not be exported */ ++extern void *__argp_input (__const struct argp *__restrict __argp, ++ __const struct argp_state *__restrict __state) ++ __THROW; ++ ++#ifdef __USE_EXTERN_INLINES ++ ++# ifndef ARGP_EI ++# define ARGP_EI __extern_inline ++# endif ++ ++ARGP_EI void ++argp_usage (__const struct argp_state *__state) ++{ ++ argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); ++} ++ ++ARGP_EI int ++__NTH (__option_is_short (__const struct argp_option *__opt)) ++{ ++ if (__opt->flags & OPTION_DOC) ++ return 0; ++ else ++ { ++ int __key = __opt->key; ++ return __key > 0 && __key <= UCHAR_MAX && isprint (__key); ++ } ++} ++ ++ARGP_EI int ++__NTH (__option_is_end (__const struct argp_option *__opt)) ++{ ++ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; ++} ++#endif /* Use extern inlines. */ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* argp.h */ diff --git a/meta/recipes-core/uclibc/uclibc-git/argp-support.patch b/meta/recipes-core/uclibc/uclibc-git/argp-support.patch new file mode 100644 index 0000000000..bcec6a593a --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/argp-support.patch @@ -0,0 +1,5192 @@ +From: Salvatore Cro + +Argp is an advanced support for parsing unix-style argument vectors. +In addition to the common getopt interface, it provides automatic response +to `--help' and `--version' options and use of custom parser in conjunction +with argp native option parser, among others. +Argp support is required by elfutils package and prelink. + +In uClibc argp functionalities has been moved from C library to libuargp.so +Further the libc.so linker script contains an AS_NEEDED entry so that +it doesn't need to link libuargp.so explicitely. + +Signed-off-by: Salvatore Cro +Signed-off-by: Filippo Arcidiacono +Signed-off-by: Carmelo Amoroso + +Upstream-Status: Pending + +--- + Makefile.in | 8 + + Makerules | 8 +- + Rules.mak | 7 + + extra/Configs/Config.in | 17 + + libc/sysdeps/linux/common/bits/getopt_int.h | 136 ++ + libc/unistd/getopt.c | 18 +- + libc/unistd/getopt_int.h | 134 -- + libuargp/Makefile | 14 + + libuargp/Makefile.in | 76 ++ + libuargp/argp-ba.c | 26 + + libuargp/argp-eexst.c | 32 + + libuargp/argp-fmtstream.c | 439 +++++++ + libuargp/argp-fmtstream.h | 314 +++++ + libuargp/argp-fs-xinl.c | 44 + + libuargp/argp-help.c | 1882 +++++++++++++++++++++++++++ + libuargp/argp-parse.c | 949 ++++++++++++++ + libuargp/argp-pv.c | 25 + + libuargp/argp-pvh.c | 32 + + libuargp/argp-xinl.c | 35 + + test/argp/Makefile | 7 + + test/argp/Makefile.in | 12 + + test/argp/argp-ex1.c | 15 + + test/argp/argp-ex2.c | 45 + + test/argp/argp-ex3.c | 153 +++ + test/argp/argp-ex4.c | 167 +++ + test/argp/argp-test.c | 209 +++ + test/argp/bug-argp1.c | 26 + + test/argp/tst-argp1.c | 118 ++ + test/argp/tst-argp2.c | 101 ++ + 29 files changed, 4911 insertions(+), 138 deletions(-) + create mode 100644 libc/sysdeps/linux/common/bits/getopt_int.h + delete mode 100644 libc/unistd/getopt_int.h + create mode 100644 libuargp/Makefile + create mode 100644 libuargp/Makefile.in + create mode 100644 libuargp/argp-ba.c + create mode 100644 libuargp/argp-eexst.c + create mode 100644 libuargp/argp-fmtstream.c + create mode 100644 libuargp/argp-fmtstream.h + create mode 100644 libuargp/argp-fs-xinl.c + create mode 100644 libuargp/argp-help.c + create mode 100644 libuargp/argp-parse.c + create mode 100644 libuargp/argp-pv.c + create mode 100644 libuargp/argp-pvh.c + create mode 100644 libuargp/argp-xinl.c + create mode 100644 test/argp/Makefile + create mode 100644 test/argp/Makefile.in + create mode 100644 test/argp/argp-ex1.c + create mode 100644 test/argp/argp-ex2.c + create mode 100644 test/argp/argp-ex3.c + create mode 100644 test/argp/argp-ex4.c + create mode 100644 test/argp/argp-test.c + create mode 100644 test/argp/bug-argp1.c + create mode 100644 test/argp/tst-argp1.c + create mode 100644 test/argp/tst-argp2.c + +Index: git/Makefile.in +=================================================================== +--- git.orig/Makefile.in 2012-06-18 13:10:12.000000000 -0700 ++++ git/Makefile.in 2012-06-18 13:12:06.448829343 -0700 +@@ -48,6 +48,7 @@ + include $(top_srcdir)libutil/Makefile.in + include $(top_srcdir)libpthread/Makefile.in + include $(top_srcdir)librt/Makefile.in ++include $(top_srcdir)libuargp/Makefile.in + include $(top_srcdir)libubacktrace/Makefile.in + include $(top_srcdir)extra/locale/Makefile.in + +@@ -250,6 +251,7 @@ + endif + HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h + HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h ++HEADERS_RM-$(UCLIBC_HAS_ARGP) += argp.h + HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h + HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h + HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h +@@ -368,6 +370,12 @@ + -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/ + endif + echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so ++ifeq ($(UCLIBC_HAS_ARGP),y) ++# Add the AS_NEEDED entry for libuargp.so ++ if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \ ++ echo "GROUP ( $(UARGP_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ ++ fi ++endif + ifeq ($(UCLIBC_HAS_THREADS),y) + ifneq ($(LINUXTHREADS_OLD),y) + ifeq ($(HARDWIRED_ABSPATH),y) +Index: git/Makerules +=================================================================== +--- git.orig/Makerules 2012-06-18 13:10:12.000000000 -0700 ++++ git/Makerules 2012-06-18 13:10:44.052825547 -0700 +@@ -32,12 +32,12 @@ + $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \ + $(libresolv-so-y) $(librt-so-y) \ + $(ldso-y) \ +- $(libutil-so-y) $(libubacktrace-so-y) ++ $(libutil-so-y) $(libubacktrace-so-y) $(libuargp-so-y) + + ar_objs = $(libc-y) $(libc-static-y) $(libcrypt-a-y) \ + $(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \ + $(libpthread-a-y) $(libthread_db-a-y) \ +- $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) ++ $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y) + ifeq ($(DOPIC),y) + ar_objs := $(ar_objs:.o=.os) + endif +@@ -472,7 +472,7 @@ + $(librt-a-y) $(librt-so-y) $(libresolv-a-y) $(libresolv-so-y) \ + $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \ + $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \ +- $(libubacktrace-a-y) $(libubacktrace-so-y) ++ $(libubacktrace-a-y) $(libubacktrace-so-y) $(libuargp-so-y) $(libuargp-a-y) + .depends.dep := \ + $(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \ + $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \ +Index: git/Rules.mak +=================================================================== +--- git.orig/Rules.mak 2012-06-18 13:10:12.000000000 -0700 ++++ git/Rules.mak 2012-06-18 13:10:44.056825544 -0700 +@@ -589,6 +589,13 @@ + else + export UBACKTRACE_ASNEEDED:="" + endif ++ifeq ($(UCLIBC_HAS_ARGP),y) ++# Only used in installed libc.so linker script ++UARGP_FULL_NAME := $(RUNTIME_PREFIX)lib/libuargp.so.$(MAJOR_VERSION) ++export UARGP_ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && echo "AS_NEEDED ( $(UARGP_FULL_NAME) )" || echo "$(UARGP_FULL_NAME)") ++else ++export UARGP_ASNEEDED:="" ++endif + endif + + # Add a bunch of extra pedantic annoyingly strict checks +Index: git/extra/Configs/Config.in +=================================================================== +--- git.orig/extra/Configs/Config.in 2012-06-18 13:10:12.000000000 -0700 ++++ git/extra/Configs/Config.in 2012-06-18 13:10:44.056825544 -0700 +@@ -1853,6 +1853,23 @@ + smaller SUSv3 compatible getsubopt(). + + Most people will answer Y. ++ ++config UCLIBC_HAS_ARGP ++ bool "Support argp (as standalone shared object)" ++ default n ++ help ++ Argp is an interface for parsing unix-style argument vectors. Unlike ++ the common getopt interface, it provides many advanced features in ++ addition to parsing options, such as automatic output in response to ++ `--help' and `--version' options. ++ A library can export an argp option parser, which programs can easily ++ use in conjunction with their own option parser. ++ A new shared object "libuargp" is created. The "libc.so" linker script ++ contains the AS_NEEDED entry for getting the libuargp linked automatically. ++ Argp support is needed by elfutils libdw. ++ ++ Most people can safely answer N. ++ + endmenu + + +Index: git/libc/sysdeps/linux/common/bits/getopt_int.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libc/sysdeps/linux/common/bits/getopt_int.h 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,136 @@ ++/* Internal declarations for getopt. ++ Copyright (C) 1989-1994,1996-1999,2001,2003,2004 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifndef _GETOPT_INT_H ++#define _GETOPT_INT_H 1 ++ ++extern int _getopt_internal (int ___argc, char *const *___argv, ++ const char *__shortopts, ++ const struct option *__longopts, int *__longind, ++ int __long_only) attribute_hidden; ++ ++ ++/* Reentrant versions which can handle parsing multiple argument ++ vectors at the same time. */ ++ ++/* For __ordering member */ ++enum { ++ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER ++}; ++ ++/* Data type for reentrant functions. */ ++ ++struct _getopt_data ++{ ++ /* These have exactly the same meaning as the corresponding global ++ variables, except that they are used for the reentrant ++ versions of getopt. */ ++ int optind; ++ int opterr; ++ char *optarg; ++ smalluint optopt; /* we store characters here, a byte is enough */ ++ ++ /* Internal members. */ ++ ++ /* True if the internal members have been initialized. */ ++ smallint __initialized; ++ ++ /* Describe how to deal with options that follow non-option ARGV-elements. ++ ++ If the caller did not specify anything, ++ the default is REQUIRE_ORDER if the environment variable ++ POSIXLY_CORRECT is defined, PERMUTE otherwise. ++ ++ REQUIRE_ORDER means don't recognize them as options; ++ stop option processing when the first non-option is seen. ++ This is what Unix does. ++ This mode of operation is selected by either setting the environment ++ variable POSIXLY_CORRECT, or using `+' as the first character ++ of the list of option characters. ++ ++ PERMUTE is the default. We permute the contents of ARGV as we ++ scan, so that eventually all the non-options are at the end. ++ This allows options to be given in any order, even with programs ++ that were not written to expect this. ++ ++ RETURN_IN_ORDER is an option available to programs that were ++ written to expect options and other ARGV-elements in any order ++ and that care about the ordering of the two. We describe each ++ non-option ARGV-element as if it were the argument of an option ++ with character code 1. Using `-' as the first character of the ++ list of option characters selects this mode of operation. ++ ++ The special argument `--' forces an end of option-scanning regardless ++ of the value of `ordering'. In the case of RETURN_IN_ORDER, only ++ `--' can cause `getopt' to return -1 with `optind' != ARGC. */ ++ smallint __ordering; ++ ++ /* If the POSIXLY_CORRECT environment variable is set. */ ++ smallint __posixly_correct; ++ ++ /* The next char to be scanned in the option-element ++ in which the last option character we returned was found. ++ This allows us to pick up the scan where we left off. ++ ++ If this is zero, or a null string, it means resume the scan ++ by advancing to the next ARGV-element. */ ++ char *__nextchar; ++ ++ ++ /* Handle permutation of arguments. */ ++ ++ /* Describe the part of ARGV that contains non-options that have ++ been skipped. `first_nonopt' is the index in ARGV of the first ++ of them; `last_nonopt' is the index after the last of them. */ ++ ++ int __first_nonopt; ++ int __last_nonopt; ++ ++#if defined _LIBC && defined USE_NONOPTION_FLAGS ++ int __nonoption_flags_max_len; ++ int __nonoption_flags_len; ++# endif ++}; ++ ++/* The initializer is necessary to set OPTIND and OPTERR to their ++ default values and to clear the initialization flag. */ ++#define _GETOPT_DATA_INITIALIZER { 1, 1 } ++ ++#if 0 /* first is static on uClibc, the others not used */ ++extern int _getopt_internal_r (int ___argc, char *const *___argv, ++ const char *__shortopts, ++ const struct option *__longopts, int *__longind, ++ int __long_only, struct _getopt_data *__data); ++#endif ++#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__ ++#ifndef __need_getopt ++extern int _getopt_long_r (int ___argc, char *const *___argv, ++ const char *__shortopts, ++ const struct option *__longopts, int *__longind, ++ struct _getopt_data *__data); ++ ++extern int _getopt_long_only_r (int ___argc, char *const *___argv, ++ const char *__shortopts, ++ const struct option *__longopts, ++ int *__longind, ++ struct _getopt_data *__data); ++#endif ++#endif ++#endif /* getopt_int.h */ +Index: git/libc/unistd/getopt.c +=================================================================== +--- git.orig/libc/unistd/getopt.c 2012-06-18 13:10:12.000000000 -0700 ++++ git/libc/unistd/getopt.c 2012-06-18 13:10:44.056825544 -0700 +@@ -106,7 +106,7 @@ + they can distinguish the relative order of options and other arguments. */ + + #include +-#include "getopt_int.h" ++#include + + + /* For communication from `getopt' to the caller. +@@ -1170,6 +1170,15 @@ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); + } + ++int ++_getopt_long_r (int argc, char *const *argv, const char *options, ++ const struct option *long_options, int *opt_index, ++ struct _getopt_data *d) ++{ ++ return _getopt_internal_r (argc, argv, options, long_options, opt_index, ++ 0, d); ++} ++ + /* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option +@@ -1182,4 +1191,12 @@ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); + } + ++int ++_getopt_long_only_r (int argc, char *const *argv, const char *options, ++ const struct option *long_options, int *opt_index, ++ struct _getopt_data *d) ++{ ++ return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, d); ++} ++ + #endif /* Not ELIDE_CODE. */ +Index: git/libuargp/Makefile +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/Makefile 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,14 @@ ++# Makefile for uClibc (libuargp) ++# ++# Copyright (C) 2010 STMicroelectronics Ltd ++# Author(s): Filippo Arcidiacono ++# ++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++# ++ ++top_srcdir=../ ++top_builddir=../ ++include $(top_builddir)Rules.mak ++all: libs ++include Makefile.in ++include $(top_srcdir)Makerules +Index: git/libuargp/Makefile.in +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/Makefile.in 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,73 @@ ++# Makefile for uClibc (libuargp) ++# ++# Copyright (C) 2009, 2010 STMicroelectronics Ltd. ++# Author(s): Salvatore Cro ++# - First implementation, embedded into libc ++# Filippo Arcidiacono ++# - Reworked for stand-alone libuargp implementation ++ ++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++# ++ ++CFLAGS-libuargp := -DNOT_IN_libc -DIS_IN_libuargp $(SSP_ALL_CFLAGS) ++ ++LDFLAGS-libuargp.so := $(LDFLAGS) ++ ++LIBS-libuargp.so := $(LIBS) ++ ++libuargp_FULL_NAME := libuargp-$(VERSION).so ++ ++libuargp_DIR := $(top_srcdir)libuargp ++libuargp_OUT := $(top_builddir)libuargp ++ ++libuargp_SRC-y := ++libuargp_SRC-$(UCLIBC_HAS_ARGP) := $(addsuffix .c,$(addprefix argp-, ba \ ++ eexst fmtstream fs-xinl help parse pv pvh xinl)) ++ ++CFLAGS-argp-xinl.c = -fgnu89-inline ++ ++libuargp_SRC := $(addprefix $(libuargp_DIR)/,$(libuargp_SRC-y)) ++libuargp_OBJ := $(patsubst $(libuargp_DIR)/%.c,$(libuargp_OUT)/%.o,$(libuargp_SRC)) ++ ++libuargp_SRCS := $(libuargp_SRC) ++libuargp_OBJS := $(libuargp_OBJ) ++ ++ifeq ($(DOPIC),y) ++libuargp-a-y := $(libuargp_OBJS:.o=.os) ++else ++libuargp-a-y := $(libuargp_OBJS) ++endif ++libuargp-so-y := $(libuargp_OBJS:.o=.os) ++ ++lib-a-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.a ++lib-so-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.so ++ ++objclean-y += CLEAN_libuargp ++ ++ifeq ($(DOMULTI),n) ++ifeq ($(DOPIC),y) ++$(top_builddir)lib/libuargp.so: $(top_builddir)lib/libuargp.a $(libc.depend) ++else ++$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp_so.a $(libc.depend) ++endif ++ $(call link.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION)) ++else ++$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp.oS $(libc.depend) ++ $(call linkm.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION)) ++endif ++ ++$(libuargp_OUT)/libuargp_so.a: $(libuargp-so-y) ++ $(Q)$(RM) $@ ++ $(do_ar) ++ ++$(libuargp_OUT)/libuargp.oS: $(libuargp_SRCS) ++ $(Q)$(RM) $@ ++ $(compile-m) ++ ++$(top_builddir)lib/libuargp.a: $(libuargp-a-y) ++ $(Q)$(INSTALL) -d $(dir $@) ++ $(Q)$(RM) $@ ++ $(do_ar) ++ ++CLEAN_libuargp: ++ $(do_rm) $(addprefix $(libuargp_OUT)/*., o os oS a) +Index: git/libuargp/argp-ba.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-ba.c 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,26 @@ ++/* Default definition for ARGP_PROGRAM_BUG_ADDRESS. ++ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++/* If set by the user program, it should point to string that is the ++ bug-reporting address for the program. It will be printed by argp_help if ++ the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help ++ messages), embedded in a sentence that says something like `Report bugs to ++ ADDR.'. */ ++const char *argp_program_bug_address; +Index: git/libuargp/argp-eexst.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-eexst.c 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,32 @@ ++/* Default definition for ARGP_ERR_EXIT_STATUS ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++ ++#include ++ ++/* The exit status that argp will use when exiting due to a parsing error. ++ If not defined or set by the user program, this defaults to EX_USAGE from ++ . */ ++error_t argp_err_exit_status = EX_USAGE; +Index: git/libuargp/argp-fmtstream.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-fmtstream.c 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,439 @@ ++/* Word-wrapping and line-truncating streams ++ Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++/* This package emulates glibc `line_wrap_stream' semantics for systems that ++ don't have that. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "argp-fmtstream.h" ++ ++#ifndef ARGP_FMTSTREAM_USE_LINEWRAP ++ ++#ifndef isblank ++#define isblank(ch) ((ch)==' ' || (ch)=='\t') ++#endif ++ ++#if defined _LIBC && defined USE_IN_LIBIO ++# include ++# include ++# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a) ++#else ++# define __vsnprintf(s, l, f, a) vsnprintf (s, l, f, a) ++#endif ++ ++#define INIT_BUF_SIZE 200 ++#define PRINTF_SIZE_GUESS 150 ++ ++/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines ++ written on it with LMARGIN spaces and limits them to RMARGIN columns ++ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by ++ replacing the whitespace before them with a newline and WMARGIN spaces. ++ Otherwise, chars beyond RMARGIN are simply dropped until a newline. ++ Returns NULL if there was an error. */ ++argp_fmtstream_t ++__argp_make_fmtstream (FILE *stream, ++ size_t lmargin, size_t rmargin, ssize_t wmargin) ++{ ++ argp_fmtstream_t fs; ++ ++ fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream)); ++ if (fs != NULL) ++ { ++ fs->stream = stream; ++ ++ fs->lmargin = lmargin; ++ fs->rmargin = rmargin; ++ fs->wmargin = wmargin; ++ fs->point_col = 0; ++ fs->point_offs = 0; ++ ++ fs->buf = (char *) malloc (INIT_BUF_SIZE); ++ if (! fs->buf) ++ { ++ free (fs); ++ fs = 0; ++ } ++ else ++ { ++ fs->p = fs->buf; ++ fs->end = fs->buf + INIT_BUF_SIZE; ++ } ++ } ++ ++ return fs; ++} ++#if 0 ++/* Not exported. */ ++#ifdef weak_alias ++weak_alias (__argp_make_fmtstream, argp_make_fmtstream) ++#endif ++#endif ++ ++/* Flush FS to its stream, and free it (but don't close the stream). */ ++void ++__argp_fmtstream_free (argp_fmtstream_t fs) ++{ ++ __argp_fmtstream_update (fs); ++ if (fs->p > fs->buf) ++ { ++#ifdef USE_IN_LIBIO ++ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); ++#else ++ fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); ++#endif ++ } ++ free (fs->buf); ++ free (fs); ++} ++#if 0 ++/* Not exported. */ ++#ifdef weak_alias ++weak_alias (__argp_fmtstream_free, argp_fmtstream_free) ++#endif ++#endif ++ ++/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the ++ end of its buffer. This code is mostly from glibc stdio/linewrap.c. */ ++void ++__argp_fmtstream_update (argp_fmtstream_t fs) ++{ ++ char *buf, *nl; ++ size_t len; ++ ++ /* Scan the buffer for newlines. */ ++ buf = fs->buf + fs->point_offs; ++ while (buf < fs->p) ++ { ++ size_t r; ++ ++ if (fs->point_col == 0 && fs->lmargin != 0) ++ { ++ /* We are starting a new line. Print spaces to the left margin. */ ++ const size_t pad = fs->lmargin; ++ if (fs->p + pad < fs->end) ++ { ++ /* We can fit in them in the buffer by moving the ++ buffer text up and filling in the beginning. */ ++ memmove (buf + pad, buf, fs->p - buf); ++ fs->p += pad; /* Compensate for bigger buffer. */ ++ memset (buf, ' ', pad); /* Fill in the spaces. */ ++ buf += pad; /* Don't bother searching them. */ ++ } ++ else ++ { ++ /* No buffer space for spaces. Must flush. */ ++ size_t i; ++ for (i = 0; i < pad; i++) ++ { ++#ifdef USE_IN_LIBIO ++ if (_IO_fwide (fs->stream, 0) > 0) ++ putwc_unlocked (L' ', fs->stream); ++ else ++#endif ++ putc_unlocked (' ', fs->stream); ++ } ++ } ++ fs->point_col = pad; ++ } ++ ++ len = fs->p - buf; ++ nl = memchr (buf, '\n', len); ++ ++ if (fs->point_col < 0) ++ fs->point_col = 0; ++ ++ if (!nl) ++ { ++ /* The buffer ends in a partial line. */ ++ ++ if (fs->point_col + len < fs->rmargin) ++ { ++ /* The remaining buffer text is a partial line and fits ++ within the maximum line width. Advance point for the ++ characters to be written and stop scanning. */ ++ fs->point_col += len; ++ break; ++ } ++ else ++ /* Set the end-of-line pointer for the code below to ++ the end of the buffer. */ ++ nl = fs->p; ++ } ++ else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin) ++ { ++ /* The buffer contains a full line that fits within the maximum ++ line width. Reset point and scan the next line. */ ++ fs->point_col = 0; ++ buf = nl + 1; ++ continue; ++ } ++ ++ /* This line is too long. */ ++ r = fs->rmargin - 1; ++ ++ if (fs->wmargin < 0) ++ { ++ /* Truncate the line by overwriting the excess with the ++ newline and anything after it in the buffer. */ ++ if (nl < fs->p) ++ { ++ memmove (buf + (r - fs->point_col), nl, fs->p - nl); ++ fs->p -= buf + (r - fs->point_col) - nl; ++ /* Reset point for the next line and start scanning it. */ ++ fs->point_col = 0; ++ buf += r + 1; /* Skip full line plus \n. */ ++ } ++ else ++ { ++ /* The buffer ends with a partial line that is beyond the ++ maximum line width. Advance point for the characters ++ written, and discard those past the max from the buffer. */ ++ fs->point_col += len; ++ fs->p -= fs->point_col - r; ++ break; ++ } ++ } ++ else ++ { ++ /* Do word wrap. Go to the column just past the maximum line ++ width and scan back for the beginning of the word there. ++ Then insert a line break. */ ++ ++ char *p, *nextline; ++ int i; ++ ++ p = buf + (r + 1 - fs->point_col); ++ while (p >= buf && !isblank (*p)) ++ --p; ++ nextline = p + 1; /* This will begin the next line. */ ++ ++ if (nextline > buf) ++ { ++ /* Swallow separating blanks. */ ++ if (p >= buf) ++ do ++ --p; ++ while (p >= buf && isblank (*p)); ++ nl = p + 1; /* The newline will replace the first blank. */ ++ } ++ else ++ { ++ /* A single word that is greater than the maximum line width. ++ Oh well. Put it on an overlong line by itself. */ ++ p = buf + (r + 1 - fs->point_col); ++ /* Find the end of the long word. */ ++ do ++ ++p; ++ while (p < nl && !isblank (*p)); ++ if (p == nl) ++ { ++ /* It already ends a line. No fussing required. */ ++ fs->point_col = 0; ++ buf = nl + 1; ++ continue; ++ } ++ /* We will move the newline to replace the first blank. */ ++ nl = p; ++ /* Swallow separating blanks. */ ++ do ++ ++p; ++ while (isblank (*p)); ++ /* The next line will start here. */ ++ nextline = p; ++ } ++ ++ /* Note: There are a bunch of tests below for ++ NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall ++ at the end of the buffer, and NEXTLINE is in fact empty (and so ++ we need not be careful to maintain its contents). */ ++ ++ if ((nextline == buf + len + 1 ++ ? fs->end - nl < fs->wmargin + 1 ++ : nextline - (nl + 1) < fs->wmargin) ++ && fs->p > nextline) ++ { ++ /* The margin needs more blanks than we removed. */ ++ if (fs->end - fs->p > fs->wmargin + 1) ++ /* Make some space for them. */ ++ { ++ size_t mv = fs->p - nextline; ++ memmove (nl + 1 + fs->wmargin, nextline, mv); ++ nextline = nl + 1 + fs->wmargin; ++ len = nextline + mv - buf; ++ *nl++ = '\n'; ++ } ++ else ++ /* Output the first line so we can use the space. */ ++ { ++#if defined _LIBC && defined USE_IN_LIBIO ++ __fxprintf (fs->stream, "%.*s\n", ++ (int) (nl - fs->buf), fs->buf); ++#else ++ if (nl > fs->buf) ++ fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream); ++ putc_unlocked ('\n', fs->stream); ++#endif ++ ++ len += buf - fs->buf; ++ nl = buf = fs->buf; ++ } ++ } ++ else ++ /* We can fit the newline and blanks in before ++ the next word. */ ++ *nl++ = '\n'; ++ ++ if (nextline - nl >= fs->wmargin ++ || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin)) ++ /* Add blanks up to the wrap margin column. */ ++ for (i = 0; i < fs->wmargin; ++i) ++ *nl++ = ' '; ++ else ++ for (i = 0; i < fs->wmargin; ++i) ++#ifdef USE_IN_LIBIO ++ if (_IO_fwide (fs->stream, 0) > 0) ++ putwc_unlocked (L' ', fs->stream); ++ else ++#endif ++ putc_unlocked (' ', fs->stream); ++ ++ /* Copy the tail of the original buffer into the current buffer ++ position. */ ++ if (nl < nextline) ++ memmove (nl, nextline, buf + len - nextline); ++ len -= nextline - buf; ++ ++ /* Continue the scan on the remaining lines in the buffer. */ ++ buf = nl; ++ ++ /* Restore bufp to include all the remaining text. */ ++ fs->p = nl + len; ++ ++ /* Reset the counter of what has been output this line. If wmargin ++ is 0, we want to avoid the lmargin getting added, so we set ++ point_col to a magic value of -1 in that case. */ ++ fs->point_col = fs->wmargin ? fs->wmargin : -1; ++ } ++ } ++ ++ /* Remember that we've scanned as far as the end of the buffer. */ ++ fs->point_offs = fs->p - fs->buf; ++} ++ ++/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by ++ growing the buffer, or by flushing it. True is returned iff we succeed. */ ++int ++__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount) ++{ ++ if ((size_t) (fs->end - fs->p) < amount) ++ { ++ ssize_t wrote; ++ ++ /* Flush FS's buffer. */ ++ __argp_fmtstream_update (fs); ++ ++#if defined _LIBC && defined USE_IN_LIBIO ++ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); ++ wrote = fs->p - fs->buf; ++#else ++ wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); ++#endif ++ if (wrote == fs->p - fs->buf) ++ { ++ fs->p = fs->buf; ++ fs->point_offs = 0; ++ } ++ else ++ { ++ fs->p -= wrote; ++ fs->point_offs -= wrote; ++ memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf); ++ return 0; ++ } ++ ++ if ((size_t) (fs->end - fs->buf) < amount) ++ /* Gotta grow the buffer. */ ++ { ++ size_t old_size = fs->end - fs->buf; ++ size_t new_size = old_size + amount; ++ char *new_buf; ++ ++ if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size))) ++ { ++ __set_errno (ENOMEM); ++ return 0; ++ } ++ ++ fs->buf = new_buf; ++ fs->end = new_buf + new_size; ++ fs->p = fs->buf; ++ } ++ } ++ ++ return 1; ++} ++ ++ssize_t ++__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...) ++{ ++ int out; ++ size_t avail; ++ size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */ ++ ++ do ++ { ++ va_list args; ++ ++ if (! __argp_fmtstream_ensure (fs, size_guess)) ++ return -1; ++ ++ va_start (args, fmt); ++ avail = fs->end - fs->p; ++ out = __vsnprintf (fs->p, avail, fmt, args); ++ va_end (args); ++ if ((size_t) out >= avail) ++ size_guess = out + 1; ++ } ++ while ((size_t) out >= avail); ++ ++ fs->p += out; ++ ++ return out; ++} ++#if 0 ++/* Not exported. */ ++#ifdef weak_alias ++weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf) ++#endif ++#endif ++ ++#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */ +Index: git/libuargp/argp-fmtstream.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-fmtstream.h 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,314 @@ ++/* Word-wrapping and line-truncating streams. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++/* This package emulates glibc `line_wrap_stream' semantics for systems that ++ don't have that. If the system does have it, it is just a wrapper for ++ that. This header file is only used internally while compiling argp, and ++ shouldn't be installed. */ ++ ++#ifndef _ARGP_FMTSTREAM_H ++#define _ARGP_FMTSTREAM_H ++ ++#include ++#include ++#include ++ ++#ifndef __attribute__ ++/* This feature is available in gcc versions 2.5 and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__) ++# define __attribute__(Spec) /* empty */ ++# endif ++/* The __-protected variants of `format' and `printf' attributes ++ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__) ++# define __format__ format ++# define __printf__ printf ++# endif ++#endif ++ ++#if 0 /* uClibc: disabled */ ++#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \ ++ || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)) ++/* line_wrap_stream is available, so use that. */ ++#define ARGP_FMTSTREAM_USE_LINEWRAP ++#endif ++#else ++/* line_wrap stream NOT available */ ++# undef ARGP_FMTSTREAM_USE_LINEWRAP ++#endif ++ ++#ifdef ARGP_FMTSTREAM_USE_LINEWRAP ++/* Just be a simple wrapper for line_wrap_stream; the semantics are ++ *slightly* different, as line_wrap_stream doesn't actually make a new ++ object, it just modifies the given stream (reversibly) to do ++ line-wrapping. Since we control who uses this code, it doesn't matter. */ ++ ++#include ++ ++typedef FILE *argp_fmtstream_t; ++ ++#define argp_make_fmtstream line_wrap_stream ++#define __argp_make_fmtstream line_wrap_stream ++#define argp_fmtstream_free line_unwrap_stream ++#define __argp_fmtstream_free line_unwrap_stream ++ ++#define __argp_fmtstream_putc(fs,ch) putc(ch,fs) ++#define argp_fmtstream_putc(fs,ch) putc(ch,fs) ++#define __argp_fmtstream_puts(fs,str) fputs(str,fs) ++#define argp_fmtstream_puts(fs,str) fputs(str,fs) ++#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) ++#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) ++#define __argp_fmtstream_printf fprintf ++#define argp_fmtstream_printf fprintf ++ ++#define __argp_fmtstream_lmargin line_wrap_lmargin ++#define argp_fmtstream_lmargin line_wrap_lmargin ++#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin ++#define argp_fmtstream_set_lmargin line_wrap_set_lmargin ++#define __argp_fmtstream_rmargin line_wrap_rmargin ++#define argp_fmtstream_rmargin line_wrap_rmargin ++#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin ++#define argp_fmtstream_set_rmargin line_wrap_set_rmargin ++#define __argp_fmtstream_wmargin line_wrap_wmargin ++#define argp_fmtstream_wmargin line_wrap_wmargin ++#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin ++#define argp_fmtstream_set_wmargin line_wrap_set_wmargin ++#define __argp_fmtstream_point line_wrap_point ++#define argp_fmtstream_point line_wrap_point ++ ++#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */ ++/* Guess we have to define our own version. */ ++ ++#ifndef __const ++#define __const const ++#endif ++ ++struct argp_fmtstream ++{ ++ FILE *stream; /* The stream we're outputting to. */ ++ ++ size_t lmargin, rmargin; /* Left and right margins. */ ++ ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */ ++ ++ /* Point in buffer to which we've processed for wrapping, but not output. */ ++ size_t point_offs; ++ /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */ ++ ssize_t point_col; ++ ++ char *buf; /* Output buffer. */ ++ char *p; /* Current end of text in BUF. */ ++ char *end; /* Absolute end of BUF. */ ++}; ++ ++typedef struct argp_fmtstream *argp_fmtstream_t; ++ ++/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines ++ written on it with LMARGIN spaces and limits them to RMARGIN columns ++ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by ++ replacing the whitespace before them with a newline and WMARGIN spaces. ++ Otherwise, chars beyond RMARGIN are simply dropped until a newline. ++ Returns NULL if there was an error. */ ++extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream, ++ size_t __lmargin, ++ size_t __rmargin, ++ ssize_t __wmargin); ++extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream, ++ size_t __lmargin, ++ size_t __rmargin, ++ ssize_t __wmargin); ++ ++/* Flush __FS to its stream, and free it (but don't close the stream). */ ++extern void __argp_fmtstream_free (argp_fmtstream_t __fs); ++extern void argp_fmtstream_free (argp_fmtstream_t __fs); ++ ++extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs, ++ __const char *__fmt, ...) ++ __attribute__ ((__format__ (printf, 2, 3))); ++extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs, ++ __const char *__fmt, ...) ++ __attribute__ ((__format__ (printf, 2, 3))); ++ ++extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); ++extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); ++ ++extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str); ++extern int argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str); ++ ++extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs, ++ __const char *__str, size_t __len); ++extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, ++ __const char *__str, size_t __len); ++ ++/* Access macros for various bits of state. */ ++#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin) ++#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin) ++#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin) ++#define __argp_fmtstream_lmargin argp_fmtstream_lmargin ++#define __argp_fmtstream_rmargin argp_fmtstream_rmargin ++#define __argp_fmtstream_wmargin argp_fmtstream_wmargin ++ ++/* Set __FS's left margin to LMARGIN and return the old value. */ ++extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, ++ size_t __lmargin); ++extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, ++ size_t __lmargin); ++ ++/* Set __FS's right margin to __RMARGIN and return the old value. */ ++extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, ++ size_t __rmargin); ++extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, ++ size_t __rmargin); ++ ++/* Set __FS's wrap margin to __WMARGIN and return the old value. */ ++extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, ++ size_t __wmargin); ++extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, ++ size_t __wmargin); ++ ++/* Return the column number of the current output point in __FS. */ ++extern size_t argp_fmtstream_point (argp_fmtstream_t __fs); ++extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); ++ ++/* Internal routines. */ ++extern void _argp_fmtstream_update (argp_fmtstream_t __fs); ++extern void __argp_fmtstream_update (argp_fmtstream_t __fs); ++extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); ++extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); ++ ++#ifdef __OPTIMIZE__ ++/* Inline versions of above routines. */ ++ ++#if !_LIBC ++#define __argp_fmtstream_putc argp_fmtstream_putc ++#define __argp_fmtstream_puts argp_fmtstream_puts ++#define __argp_fmtstream_write argp_fmtstream_write ++#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin ++#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin ++#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin ++#define __argp_fmtstream_point argp_fmtstream_point ++#define __argp_fmtstream_update _argp_fmtstream_update ++#define __argp_fmtstream_ensure _argp_fmtstream_ensure ++#endif ++ ++#ifndef ARGP_FS_EI ++#define ARGP_FS_EI __extern_inline ++#endif ++ ++ARGP_FS_EI size_t ++__argp_fmtstream_write (argp_fmtstream_t __fs, ++ __const char *__str, size_t __len) ++{ ++ if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len)) ++ { ++ memcpy (__fs->p, __str, __len); ++ __fs->p += __len; ++ return __len; ++ } ++ else ++ return 0; ++} ++ ++ARGP_FS_EI int ++__argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str) ++{ ++ size_t __len = strlen (__str); ++ if (__len) ++ { ++ size_t __wrote = __argp_fmtstream_write (__fs, __str, __len); ++ return __wrote == __len ? 0 : -1; ++ } ++ else ++ return 0; ++} ++ ++ARGP_FS_EI int ++__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch) ++{ ++ if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1)) ++ return *__fs->p++ = __ch; ++ else ++ return EOF; ++} ++ ++/* Set __FS's left margin to __LMARGIN and return the old value. */ ++ARGP_FS_EI size_t ++__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin) ++{ ++ size_t __old; ++ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) ++ __argp_fmtstream_update (__fs); ++ __old = __fs->lmargin; ++ __fs->lmargin = __lmargin; ++ return __old; ++} ++ ++/* Set __FS's right margin to __RMARGIN and return the old value. */ ++ARGP_FS_EI size_t ++__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin) ++{ ++ size_t __old; ++ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) ++ __argp_fmtstream_update (__fs); ++ __old = __fs->rmargin; ++ __fs->rmargin = __rmargin; ++ return __old; ++} ++ ++/* Set FS's wrap margin to __WMARGIN and return the old value. */ ++ARGP_FS_EI size_t ++__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin) ++{ ++ size_t __old; ++ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) ++ __argp_fmtstream_update (__fs); ++ __old = __fs->wmargin; ++ __fs->wmargin = __wmargin; ++ return __old; ++} ++ ++/* Return the column number of the current output point in __FS. */ ++ARGP_FS_EI size_t ++__argp_fmtstream_point (argp_fmtstream_t __fs) ++{ ++ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) ++ __argp_fmtstream_update (__fs); ++ return __fs->point_col >= 0 ? __fs->point_col : 0; ++} ++ ++#if !_LIBC ++#undef __argp_fmtstream_putc ++#undef __argp_fmtstream_puts ++#undef __argp_fmtstream_write ++#undef __argp_fmtstream_set_lmargin ++#undef __argp_fmtstream_set_rmargin ++#undef __argp_fmtstream_set_wmargin ++#undef __argp_fmtstream_point ++#undef __argp_fmtstream_update ++#undef __argp_fmtstream_ensure ++#endif ++ ++#endif /* __OPTIMIZE__ */ ++ ++#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */ ++ ++#endif /* argp-fmtstream.h */ +Index: git/libuargp/argp-fs-xinl.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-fs-xinl.c 2012-06-18 13:10:44.056825544 -0700 +@@ -0,0 +1,44 @@ ++/* Real definitions for extern inline functions in argp-fmtstream.h ++ Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#define ARGP_FS_EI ++#undef __OPTIMIZE__ ++#define __OPTIMIZE__ 1 ++#include "argp-fmtstream.h" ++ ++#if 0 ++/* Not exported. */ ++/* Add weak aliases. */ ++#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias) ++ ++weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc) ++weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts) ++weak_alias (__argp_fmtstream_write, argp_fmtstream_write) ++weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin) ++weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin) ++weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin) ++weak_alias (__argp_fmtstream_point, argp_fmtstream_point) ++ ++#endif ++#endif +Index: git/libuargp/argp-help.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-help.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,1882 @@ ++/* Hierarchial argument parsing help output ++ Copyright (C) 1995-2003, 2004, 2005, 2006, 2007 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE 1 ++#endif ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++/* AIX requires this to be the first thing in the file. */ ++#ifndef __GNUC__ ++# if HAVE_ALLOCA_H || defined _LIBC ++# include ++# else ++# ifdef _AIX ++#pragma alloca ++# else ++# ifndef alloca /* predefined by HP cc +Olibcalls */ ++char *alloca (); ++# endif ++# endif ++# endif ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef _LIBC ++# include ++#endif ++ ++#include ++#ifndef _ ++/* This is for other GNU distributions with internationalized messages. */ ++# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__ ++# include ++# ifdef _LIBC ++# undef dgettext ++# define dgettext(domain, msgid) \ ++ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) ++# endif ++# else ++# define dgettext(domain, msgid) (msgid) ++# endif ++#endif ++ ++#ifndef _LIBC ++# if HAVE_STRERROR_R ++# if !HAVE_DECL_STRERROR_R ++char *strerror_r (int errnum, char *buf, size_t buflen); ++# endif ++# else ++# if !HAVE_DECL_STRERROR ++char *strerror (int errnum); ++# endif ++# endif ++#endif ++ ++#include ++#include "argp-fmtstream.h" ++#include ++#include ++ ++#ifndef SIZE_MAX ++# define SIZE_MAX ((size_t) -1) ++#endif ++ ++/* User-selectable (using an environment variable) formatting parameters. ++ ++ These may be specified in an environment variable called `ARGP_HELP_FMT', ++ with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2 ++ Where VALn must be a positive integer. The list of variables is in the ++ UPARAM_NAMES vector, below. */ ++ ++/* Default parameters. */ ++#define DUP_ARGS 0 /* True if option argument can be duplicated. */ ++#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */ ++#define SHORT_OPT_COL 2 /* column in which short options start */ ++#define LONG_OPT_COL 6 /* column in which long options start */ ++#define DOC_OPT_COL 2 /* column in which doc options start */ ++#define OPT_DOC_COL 29 /* column in which option text starts */ ++#define HEADER_COL 1 /* column in which group headers are printed */ ++#define USAGE_INDENT 12 /* indentation of wrapped usage lines */ ++#define RMARGIN 79 /* right margin used for wrapping */ ++ ++/* User-selectable (using an environment variable) formatting parameters. ++ They must all be of type `int' for the parsing code to work. */ ++struct uparams ++{ ++ /* If true, arguments for an option are shown with both short and long ++ options, even when a given option has both, e.g. `-x ARG, --longx=ARG'. ++ If false, then if an option has both, the argument is only shown with ++ the long one, e.g., `-x, --longx=ARG', and a message indicating that ++ this really means both is printed below the options. */ ++ int dup_args; ++ ++ /* This is true if when DUP_ARGS is false, and some duplicate arguments have ++ been suppressed, an explanatory message should be printed. */ ++ int dup_args_note; ++ ++ /* Various output columns. */ ++ int short_opt_col; ++ int long_opt_col; ++ int doc_opt_col; ++ int opt_doc_col; ++ int header_col; ++ int usage_indent; ++ int rmargin; ++}; ++ ++/* This is a global variable, as user options are only ever read once. */ ++static struct uparams uparams = { ++ DUP_ARGS, DUP_ARGS_NOTE, ++ SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL, ++ USAGE_INDENT, RMARGIN ++}; ++ ++/* A particular uparam, and what the user name is. */ ++struct uparam_name ++{ ++ const char name[14]; /* User name. */ ++ bool is_bool; /* Whether it's `boolean'. */ ++ uint8_t uparams_offs; /* Location of the (int) field in UPARAMS. */ ++}; ++ ++/* The name-field mappings we know about. */ ++static const struct uparam_name uparam_names[] = ++{ ++ { "dup-args", true, offsetof (struct uparams, dup_args) }, ++ { "dup-args-note", true, offsetof (struct uparams, dup_args_note) }, ++ { "short-opt-col", false, offsetof (struct uparams, short_opt_col) }, ++ { "long-opt-col", false, offsetof (struct uparams, long_opt_col) }, ++ { "doc-opt-col", false, offsetof (struct uparams, doc_opt_col) }, ++ { "opt-doc-col", false, offsetof (struct uparams, opt_doc_col) }, ++ { "header-col", false, offsetof (struct uparams, header_col) }, ++ { "usage-indent", false, offsetof (struct uparams, usage_indent) }, ++ { "rmargin", false, offsetof (struct uparams, rmargin) } ++}; ++#define nuparam_names (sizeof (uparam_names) / sizeof (uparam_names[0])) ++ ++/* Read user options from the environment, and fill in UPARAMS appropiately. */ ++static void ++fill_in_uparams (const struct argp_state *state) ++{ ++ const char *var = getenv ("ARGP_HELP_FMT"); ++ ++#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0); ++ ++ if (var) ++ /* Parse var. */ ++ while (*var) ++ { ++ SKIPWS (var); ++ ++ if (isalpha (*var)) ++ { ++ size_t var_len; ++ const struct uparam_name *un; ++ int unspec = 0, val = 0; ++ const char *arg = var; ++ ++ while (isalnum (*arg) || *arg == '-' || *arg == '_') ++ arg++; ++ var_len = arg - var; ++ ++ SKIPWS (arg); ++ ++ if (*arg == '\0' || *arg == ',') ++ unspec = 1; ++ else if (*arg == '=') ++ { ++ arg++; ++ SKIPWS (arg); ++ } ++ ++ if (unspec) ++ { ++ if (var[0] == 'n' && var[1] == 'o' && var[2] == '-') ++ { ++ val = 0; ++ var += 3; ++ var_len -= 3; ++ } ++ else ++ val = 1; ++ } ++ else if (isdigit (*arg)) ++ { ++ val = atoi (arg); ++ while (isdigit (*arg)) ++ arg++; ++ SKIPWS (arg); ++ } ++ ++ un = uparam_names; ++ size_t u; ++ for (u = 0; u < nuparam_names; ++un, ++u) ++ if (strlen (un->name) == var_len ++ && strncmp (var, un->name, var_len) == 0) ++ { ++ if (unspec && !un->is_bool) ++ argp_failure (state, 0, 0, ++ dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, ++ "\ ++%.*s: ARGP_HELP_FMT parameter requires a value"), ++ (int) var_len, var); ++ else ++ *(int *)((char *)&uparams + un->uparams_offs) = val; ++ break; ++ } ++ if (u == nuparam_names) ++ argp_failure (state, 0, 0, ++ dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, "\ ++%.*s: Unknown ARGP_HELP_FMT parameter"), ++ (int) var_len, var); ++ ++ var = arg; ++ if (*var == ',') ++ var++; ++ } ++ else if (*var) ++ { ++ argp_failure (state, 0, 0, ++ dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, ++ "Garbage in ARGP_HELP_FMT: %s"), var); ++ break; ++ } ++ } ++} ++ ++/* Returns true if OPT hasn't been marked invisible. Visibility only affects ++ whether OPT is displayed or used in sorting, not option shadowing. */ ++#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN)) ++ ++/* Returns true if OPT is an alias for an earlier option. */ ++#define oalias(opt) ((opt)->flags & OPTION_ALIAS) ++ ++/* Returns true if OPT is an documentation-only entry. */ ++#define odoc(opt) ((opt)->flags & OPTION_DOC) ++ ++/* Returns true if OPT is the end-of-list marker for a list of options. */ ++#define oend(opt) __option_is_end (opt) ++ ++/* Returns true if OPT has a short option. */ ++#define oshort(opt) __option_is_short (opt) ++ ++/* ++ The help format for a particular option is like: ++ ++ -xARG, -yARG, --long1=ARG, --long2=ARG Documentation... ++ ++ Where ARG will be omitted if there's no argument, for this option, or ++ will be surrounded by "[" and "]" appropiately if the argument is ++ optional. The documentation string is word-wrapped appropiately, and if ++ the list of options is long enough, it will be started on a separate line. ++ If there are no short options for a given option, the first long option is ++ indented slighly in a way that's supposed to make most long options appear ++ to be in a separate column. ++ ++ For example, the following output (from ps): ++ ++ -p PID, --pid=PID List the process PID ++ --pgrp=PGRP List processes in the process group PGRP ++ -P, -x, --no-parent Include processes without parents ++ -Q, --all-fields Don't elide unusable fields (normally if there's ++ some reason ps can't print a field for any ++ process, it's removed from the output entirely) ++ -r, --reverse, --gratuitously-long-reverse-option ++ Reverse the order of any sort ++ --session[=SID] Add the processes from the session SID (which ++ defaults to the sid of the current process) ++ ++ Here are some more options: ++ -f ZOT, --foonly=ZOT Glork a foonly ++ -z, --zaza Snit a zar ++ ++ -?, --help Give this help list ++ --usage Give a short usage message ++ -V, --version Print program version ++ ++ The struct argp_option array for the above could look like: ++ ++ { ++ {"pid", 'p', "PID", 0, "List the process PID"}, ++ {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"}, ++ {"no-parent", 'P', 0, 0, "Include processes without parents"}, ++ {0, 'x', 0, OPTION_ALIAS}, ++ {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally" ++ " if there's some reason ps can't" ++ " print a field for any process, it's" ++ " removed from the output entirely)" }, ++ {"reverse", 'r', 0, 0, "Reverse the order of any sort"}, ++ {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS}, ++ {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL, ++ "Add the processes from the session" ++ " SID (which defaults to the sid of" ++ " the current process)" }, ++ ++ {0,0,0,0, "Here are some more options:"}, ++ {"foonly", 'f', "ZOT", 0, "Glork a foonly"}, ++ {"zaza", 'z', 0, 0, "Snit a zar"}, ++ ++ {0} ++ } ++ ++ Note that the last three options are automatically supplied by argp_parse, ++ unless you tell it not to with ARGP_NO_HELP. ++ ++*/ ++ ++/* Returns true if CH occurs between BEG and END. */ ++static int ++find_char (char ch, char *beg, char *end) ++{ ++ while (beg < end) ++ if (*beg == ch) ++ return 1; ++ else ++ beg++; ++ return 0; ++} ++ ++struct hol_cluster; /* fwd decl */ ++ ++struct hol_entry ++{ ++ /* First option. */ ++ const struct argp_option *opt; ++ /* Number of options (including aliases). */ ++ unsigned num; ++ ++ /* A pointers into the HOL's short_options field, to the first short option ++ letter for this entry. The order of the characters following this point ++ corresponds to the order of options pointed to by OPT, and there are at ++ most NUM. A short option recorded in a option following OPT is only ++ valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's ++ probably been shadowed by some other entry). */ ++ char *short_options; ++ ++ /* Entries are sorted by their group first, in the order: ++ 1, 2, ..., n, 0, -m, ..., -2, -1 ++ and then alphabetically within each group. The default is 0. */ ++ int group; ++ ++ /* The cluster of options this entry belongs to, or 0 if none. */ ++ struct hol_cluster *cluster; ++ ++ /* The argp from which this option came. */ ++ const struct argp *argp; ++}; ++ ++/* A cluster of entries to reflect the argp tree structure. */ ++struct hol_cluster ++{ ++ /* A descriptive header printed before options in this cluster. */ ++ const char *header; ++ ++ /* Used to order clusters within the same group with the same parent, ++ according to the order in which they occurred in the parent argp's child ++ list. */ ++ int index; ++ ++ /* How to sort this cluster with respect to options and other clusters at the ++ same depth (clusters always follow options in the same group). */ ++ int group; ++ ++ /* The cluster to which this cluster belongs, or 0 if it's at the base ++ level. */ ++ struct hol_cluster *parent; ++ ++ /* The argp from which this cluster is (eventually) derived. */ ++ const struct argp *argp; ++ ++ /* The distance this cluster is from the root. */ ++ int depth; ++ ++ /* Clusters in a given hol are kept in a linked list, to make freeing them ++ possible. */ ++ struct hol_cluster *next; ++}; ++ ++/* A list of options for help. */ ++struct hol ++{ ++ /* An array of hol_entry's. */ ++ struct hol_entry *entries; ++ /* The number of entries in this hol. If this field is zero, the others ++ are undefined. */ ++ unsigned num_entries; ++ ++ /* A string containing all short options in this HOL. Each entry contains ++ pointers into this string, so the order can't be messed with blindly. */ ++ char *short_options; ++ ++ /* Clusters of entries in this hol. */ ++ struct hol_cluster *clusters; ++}; ++ ++/* Create a struct hol from the options in ARGP. CLUSTER is the ++ hol_cluster in which these entries occur, or 0, if at the root. */ ++static struct hol * ++make_hol (const struct argp *argp, struct hol_cluster *cluster) ++{ ++ char *so; ++ const struct argp_option *o; ++ const struct argp_option *opts = argp->options; ++ struct hol_entry *entry; ++ unsigned num_short_options = 0; ++ struct hol *hol = malloc (sizeof (struct hol)); ++ ++ assert (hol); ++ ++ hol->num_entries = 0; ++ hol->clusters = 0; ++ ++ if (opts) ++ { ++ int cur_group = 0; ++ ++ /* The first option must not be an alias. */ ++ assert (! oalias (opts)); ++ ++ /* Calculate the space needed. */ ++ for (o = opts; ! oend (o); o++) ++ { ++ if (! oalias (o)) ++ hol->num_entries++; ++ if (oshort (o)) ++ num_short_options++; /* This is an upper bound. */ ++ } ++ ++ hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries); ++ hol->short_options = malloc (num_short_options + 1); ++ ++ assert (hol->entries && hol->short_options); ++#if SIZE_MAX <= UINT_MAX ++ assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry)); ++#endif ++ ++ /* Fill in the entries. */ ++ so = hol->short_options; ++ for (o = opts, entry = hol->entries; ! oend (o); entry++) ++ { ++ entry->opt = o; ++ entry->num = 0; ++ entry->short_options = so; ++ entry->group = cur_group = ++ o->group ++ ? o->group ++ : ((!o->name && !o->key) ++ ? cur_group + 1 ++ : cur_group); ++ entry->cluster = cluster; ++ entry->argp = argp; ++ ++ do ++ { ++ entry->num++; ++ if (oshort (o) && ! find_char (o->key, hol->short_options, so)) ++ /* O has a valid short option which hasn't already been used.*/ ++ *so++ = o->key; ++ o++; ++ } ++ while (! oend (o) && oalias (o)); ++ } ++ *so = '\0'; /* null terminated so we can find the length */ ++ } ++ ++ return hol; ++} ++ ++/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the ++ associated argp child list entry), INDEX, and PARENT, and return a pointer ++ to it. ARGP is the argp that this cluster results from. */ ++static struct hol_cluster * ++hol_add_cluster (struct hol *hol, int group, const char *header, int index, ++ struct hol_cluster *parent, const struct argp *argp) ++{ ++ struct hol_cluster *cl = malloc (sizeof (struct hol_cluster)); ++ if (cl) ++ { ++ cl->group = group; ++ cl->header = header; ++ ++ cl->index = index; ++ cl->parent = parent; ++ cl->argp = argp; ++ cl->depth = parent ? parent->depth + 1 : 0; ++ ++ cl->next = hol->clusters; ++ hol->clusters = cl; ++ } ++ return cl; ++} ++ ++/* Free HOL and any resources it uses. */ ++static void ++hol_free (struct hol *hol) ++{ ++ struct hol_cluster *cl = hol->clusters; ++ ++ while (cl) ++ { ++ struct hol_cluster *next = cl->next; ++ free (cl); ++ cl = next; ++ } ++ ++ if (hol->num_entries > 0) ++ { ++ free (hol->entries); ++ free (hol->short_options); ++ } ++ ++ free (hol); ++} ++ ++static int ++hol_entry_short_iterate (const struct hol_entry *entry, ++ int (*func)(const struct argp_option *opt, ++ const struct argp_option *real, ++ const char *domain, void *cookie), ++ const char *domain, void *cookie) ++{ ++ unsigned nopts; ++ int val = 0; ++ const struct argp_option *opt, *real = entry->opt; ++ char *so = entry->short_options; ++ ++ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) ++ if (oshort (opt) && *so == opt->key) ++ { ++ if (!oalias (opt)) ++ real = opt; ++ if (ovisible (opt)) ++ val = (*func)(opt, real, domain, cookie); ++ so++; ++ } ++ ++ return val; ++} ++ ++static __inline__ int ++__attribute__ ((always_inline)) ++hol_entry_long_iterate (const struct hol_entry *entry, ++ int (*func)(const struct argp_option *opt, ++ const struct argp_option *real, ++ const char *domain, void *cookie), ++ const char *domain, void *cookie) ++{ ++ unsigned nopts; ++ int val = 0; ++ const struct argp_option *opt, *real = entry->opt; ++ ++ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) ++ if (opt->name) ++ { ++ if (!oalias (opt)) ++ real = opt; ++ if (ovisible (opt)) ++ val = (*func)(opt, real, domain, cookie); ++ } ++ ++ return val; ++} ++ ++/* Iterator that returns true for the first short option. */ ++static __inline__ int ++until_short (const struct argp_option *opt, const struct argp_option *real, ++ const char *domain, void *cookie) ++{ ++ return oshort (opt) ? opt->key : 0; ++} ++ ++/* Returns the first valid short option in ENTRY, or 0 if there is none. */ ++static char ++hol_entry_first_short (const struct hol_entry *entry) ++{ ++ return hol_entry_short_iterate (entry, until_short, ++ entry->argp->argp_domain, 0); ++} ++ ++/* Returns the first valid long option in ENTRY, or 0 if there is none. */ ++static const char * ++hol_entry_first_long (const struct hol_entry *entry) ++{ ++ const struct argp_option *opt; ++ unsigned num; ++ for (opt = entry->opt, num = entry->num; num > 0; opt++, num--) ++ if (opt->name && ovisible (opt)) ++ return opt->name; ++ return 0; ++} ++ ++/* Returns the entry in HOL with the long option name NAME, or 0 if there is ++ none. */ ++static struct hol_entry * ++hol_find_entry (struct hol *hol, const char *name) ++{ ++ struct hol_entry *entry = hol->entries; ++ unsigned num_entries = hol->num_entries; ++ ++ while (num_entries-- > 0) ++ { ++ const struct argp_option *opt = entry->opt; ++ unsigned num_opts = entry->num; ++ ++ while (num_opts-- > 0) ++ if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0) ++ return entry; ++ else ++ opt++; ++ ++ entry++; ++ } ++ ++ return 0; ++} ++ ++/* If an entry with the long option NAME occurs in HOL, set it's special ++ sort position to GROUP. */ ++static void ++hol_set_group (struct hol *hol, const char *name, int group) ++{ ++ struct hol_entry *entry = hol_find_entry (hol, name); ++ if (entry) ++ entry->group = group; ++} ++ ++/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1. ++ EQ is what to return if GROUP1 and GROUP2 are the same. */ ++static int ++group_cmp (int group1, int group2, int eq) ++{ ++ if (group1 == group2) ++ return eq; ++ else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0)) ++ return group1 - group2; ++ else ++ return group2 - group1; ++} ++ ++/* Compare clusters CL1 & CL2 by the order that they should appear in ++ output. */ ++static int ++hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2) ++{ ++ /* If one cluster is deeper than the other, use its ancestor at the same ++ level, so that finding the common ancestor is straightforward. */ ++ while (cl1->depth > cl2->depth) ++ cl1 = cl1->parent; ++ while (cl2->depth > cl1->depth) ++ cl2 = cl2->parent; ++ ++ /* Now reduce both clusters to their ancestors at the point where both have ++ a common parent; these can be directly compared. */ ++ while (cl1->parent != cl2->parent) ++ cl1 = cl1->parent, cl2 = cl2->parent; ++ ++ return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index); ++} ++ ++/* Return the ancestor of CL that's just below the root (i.e., has a parent ++ of 0). */ ++static struct hol_cluster * ++hol_cluster_base (struct hol_cluster *cl) ++{ ++ while (cl->parent) ++ cl = cl->parent; ++ return cl; ++} ++ ++/* Return true if CL1 is a child of CL2. */ ++static int ++hol_cluster_is_child (const struct hol_cluster *cl1, ++ const struct hol_cluster *cl2) ++{ ++ while (cl1 && cl1 != cl2) ++ cl1 = cl1->parent; ++ return cl1 == cl2; ++} ++ ++/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail ++ that should be used for comparisons, and returns true iff it should be ++ treated as a non-option. */ ++static int ++canon_doc_option (const char **name) ++{ ++ int non_opt; ++ /* Skip initial whitespace. */ ++ while (isspace (**name)) ++ (*name)++; ++ /* Decide whether this looks like an option (leading `-') or not. */ ++ non_opt = (**name != '-'); ++ /* Skip until part of name used for sorting. */ ++ while (**name && !isalnum (**name)) ++ (*name)++; ++ return non_opt; ++} ++ ++/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help ++ listing. */ ++static int ++hol_entry_cmp (const struct hol_entry *entry1, ++ const struct hol_entry *entry2) ++{ ++ /* The group numbers by which the entries should be ordered; if either is ++ in a cluster, then this is just the group within the cluster. */ ++ int group1 = entry1->group, group2 = entry2->group; ++ ++ if (entry1->cluster != entry2->cluster) ++ { ++ /* The entries are not within the same cluster, so we can't compare them ++ directly, we have to use the appropiate clustering level too. */ ++ if (! entry1->cluster) ++ /* ENTRY1 is at the `base level', not in a cluster, so we have to ++ compare it's group number with that of the base cluster in which ++ ENTRY2 resides. Note that if they're in the same group, the ++ clustered option always comes laster. */ ++ return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1); ++ else if (! entry2->cluster) ++ /* Likewise, but ENTRY2's not in a cluster. */ ++ return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1); ++ else ++ /* Both entries are in clusters, we can just compare the clusters. */ ++ return hol_cluster_cmp (entry1->cluster, entry2->cluster); ++ } ++ else if (group1 == group2) ++ /* The entries are both in the same cluster and group, so compare them ++ alphabetically. */ ++ { ++ int short1 = hol_entry_first_short (entry1); ++ int short2 = hol_entry_first_short (entry2); ++ int doc1 = odoc (entry1->opt); ++ int doc2 = odoc (entry2->opt); ++ const char *long1 = hol_entry_first_long (entry1); ++ const char *long2 = hol_entry_first_long (entry2); ++ ++ if (doc1) ++ doc1 = long1 != NULL && canon_doc_option (&long1); ++ if (doc2) ++ doc2 = long2 != NULL && canon_doc_option (&long2); ++ ++ if (doc1 != doc2) ++ /* `documentation' options always follow normal options (or ++ documentation options that *look* like normal options). */ ++ return doc1 - doc2; ++ else if (!short1 && !short2 && long1 && long2) ++ /* Only long options. */ ++ return strcasecmp (long1, long2); ++ else ++ /* Compare short/short, long/short, short/long, using the first ++ character of long options. Entries without *any* valid ++ options (such as options with OPTION_HIDDEN set) will be put ++ first, but as they're not displayed, it doesn't matter where ++ they are. */ ++ { ++ char first1 = short1 ? short1 : long1 ? *long1 : 0; ++ char first2 = short2 ? short2 : long2 ? *long2 : 0; ++#ifdef _tolower ++ int lower_cmp = _tolower (first1) - _tolower (first2); ++#else ++ int lower_cmp = tolower (first1) - tolower (first2); ++#endif ++ /* Compare ignoring case, except when the options are both the ++ same letter, in which case lower-case always comes first. */ ++ return lower_cmp ? lower_cmp : first2 - first1; ++ } ++ } ++ else ++ /* Within the same cluster, but not the same group, so just compare ++ groups. */ ++ return group_cmp (group1, group2, 0); ++} ++ ++/* Version of hol_entry_cmp with correct signature for qsort. */ ++static int ++hol_entry_qcmp (const void *entry1_v, const void *entry2_v) ++{ ++ return hol_entry_cmp (entry1_v, entry2_v); ++} ++ ++/* Sort HOL by group and alphabetically by option name (with short options ++ taking precedence over long). Since the sorting is for display purposes ++ only, the shadowing of options isn't effected. */ ++static void ++hol_sort (struct hol *hol) ++{ ++ if (hol->num_entries > 0) ++ qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry), ++ hol_entry_qcmp); ++} ++ ++/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow ++ any in MORE with the same name. */ ++static void ++hol_append (struct hol *hol, struct hol *more) ++{ ++ struct hol_cluster **cl_end = &hol->clusters; ++ ++ /* Steal MORE's cluster list, and add it to the end of HOL's. */ ++ while (*cl_end) ++ cl_end = &(*cl_end)->next; ++ *cl_end = more->clusters; ++ more->clusters = 0; ++ ++ /* Merge entries. */ ++ if (more->num_entries > 0) ++ { ++ if (hol->num_entries == 0) ++ { ++ hol->num_entries = more->num_entries; ++ hol->entries = more->entries; ++ hol->short_options = more->short_options; ++ more->num_entries = 0; /* Mark MORE's fields as invalid. */ ++ } ++ else ++ /* Append the entries in MORE to those in HOL, taking care to only add ++ non-shadowed SHORT_OPTIONS values. */ ++ { ++ unsigned left; ++ char *so, *more_so; ++ struct hol_entry *e; ++ unsigned num_entries = hol->num_entries + more->num_entries; ++ struct hol_entry *entries = ++ malloc (num_entries * sizeof (struct hol_entry)); ++ unsigned hol_so_len = strlen (hol->short_options); ++ char *short_options = ++ malloc (hol_so_len + strlen (more->short_options) + 1); ++ ++ assert (entries && short_options); ++#if SIZE_MAX <= UINT_MAX ++ assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry)); ++#endif ++ ++ mempcpy (mempcpy (entries, hol->entries, ++ hol->num_entries * sizeof (struct hol_entry)), ++ more->entries, ++ more->num_entries * sizeof (struct hol_entry)); ++ ++ mempcpy (short_options, hol->short_options, hol_so_len); ++ ++ /* Fix up the short options pointers from HOL. */ ++ for (e = entries, left = hol->num_entries; left > 0; e++, left--) ++ e->short_options += (short_options - hol->short_options); ++ ++ /* Now add the short options from MORE, fixing up its entries ++ too. */ ++ so = short_options + hol_so_len; ++ more_so = more->short_options; ++ for (left = more->num_entries; left > 0; e++, left--) ++ { ++ int opts_left; ++ const struct argp_option *opt; ++ ++ e->short_options = so; ++ ++ for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--) ++ { ++ int ch = *more_so; ++ if (oshort (opt) && ch == opt->key) ++ /* The next short option in MORE_SO, CH, is from OPT. */ ++ { ++ if (! find_char (ch, short_options, ++ short_options + hol_so_len)) ++ /* The short option CH isn't shadowed by HOL's options, ++ so add it to the sum. */ ++ *so++ = ch; ++ more_so++; ++ } ++ } ++ } ++ ++ *so = '\0'; ++ ++ free (hol->entries); ++ free (hol->short_options); ++ ++ hol->entries = entries; ++ hol->num_entries = num_entries; ++ hol->short_options = short_options; ++ } ++ } ++ ++ hol_free (more); ++} ++ ++/* Inserts enough spaces to make sure STREAM is at column COL. */ ++static void ++indent_to (argp_fmtstream_t stream, unsigned col) ++{ ++ int needed = col - __argp_fmtstream_point (stream); ++ while (needed-- > 0) ++ __argp_fmtstream_putc (stream, ' '); ++} ++ ++/* Output to STREAM either a space, or a newline if there isn't room for at ++ least ENSURE characters before the right margin. */ ++static void ++space (argp_fmtstream_t stream, size_t ensure) ++{ ++ if (__argp_fmtstream_point (stream) + ensure ++ >= __argp_fmtstream_rmargin (stream)) ++ __argp_fmtstream_putc (stream, '\n'); ++ else ++ __argp_fmtstream_putc (stream, ' '); ++} ++ ++/* If the option REAL has an argument, we print it in using the printf ++ format REQ_FMT or OPT_FMT depending on whether it's a required or ++ optional argument. */ ++static void ++arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt, ++ const char *domain, argp_fmtstream_t stream) ++{ ++ if (real->arg) ++ { ++ if (real->flags & OPTION_ARG_OPTIONAL) ++ __argp_fmtstream_printf (stream, opt_fmt, ++ dgettext (domain, real->arg)); ++ else ++ __argp_fmtstream_printf (stream, req_fmt, ++ dgettext (domain, real->arg)); ++ } ++} ++ ++/* Helper functions for hol_entry_help. */ ++ ++/* State used during the execution of hol_help. */ ++struct hol_help_state ++{ ++ /* PREV_ENTRY should contain the previous entry printed, or 0. */ ++ struct hol_entry *prev_entry; ++ ++ /* If an entry is in a different group from the previous one, and SEP_GROUPS ++ is true, then a blank line will be printed before any output. */ ++ int sep_groups; ++ ++ /* True if a duplicate option argument was suppressed (only ever set if ++ UPARAMS.dup_args is false). */ ++ int suppressed_dup_arg; ++}; ++ ++/* Some state used while printing a help entry (used to communicate with ++ helper functions). See the doc for hol_entry_help for more info, as most ++ of the fields are copied from its arguments. */ ++struct pentry_state ++{ ++ const struct hol_entry *entry; ++ argp_fmtstream_t stream; ++ struct hol_help_state *hhstate; ++ ++ /* True if nothing's been printed so far. */ ++ int first; ++ ++ /* If non-zero, the state that was used to print this help. */ ++ const struct argp_state *state; ++}; ++ ++/* If a user doc filter should be applied to DOC, do so. */ ++static const char * ++filter_doc (const char *doc, int key, const struct argp *argp, ++ const struct argp_state *state) ++{ ++ if (argp && argp->help_filter) ++ /* We must apply a user filter to this output. */ ++ { ++ void *input = __argp_input (argp, state); ++ return (*argp->help_filter) (key, doc, input); ++ } ++ else ++ /* No filter. */ ++ return doc; ++} ++ ++/* Prints STR as a header line, with the margin lines set appropiately, and ++ notes the fact that groups should be separated with a blank line. ARGP is ++ the argp that should dictate any user doc filtering to take place. Note ++ that the previous wrap margin isn't restored, but the left margin is reset ++ to 0. */ ++static void ++print_header (const char *str, const struct argp *argp, ++ struct pentry_state *pest) ++{ ++ const char *tstr = dgettext (argp->argp_domain, str); ++ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state); ++ ++ if (fstr) ++ { ++ if (*fstr) ++ { ++ if (pest->hhstate->prev_entry) ++ /* Precede with a blank line. */ ++ __argp_fmtstream_putc (pest->stream, '\n'); ++ indent_to (pest->stream, uparams.header_col); ++ __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col); ++ __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col); ++ __argp_fmtstream_puts (pest->stream, fstr); ++ __argp_fmtstream_set_lmargin (pest->stream, 0); ++ __argp_fmtstream_putc (pest->stream, '\n'); ++ } ++ ++ pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */ ++ } ++ ++ if (fstr != tstr) ++ free ((char *) fstr); ++} ++ ++/* Inserts a comma if this isn't the first item on the line, and then makes ++ sure we're at least to column COL. If this *is* the first item on a line, ++ prints any pending whitespace/headers that should precede this line. Also ++ clears FIRST. */ ++static void ++comma (unsigned col, struct pentry_state *pest) ++{ ++ if (pest->first) ++ { ++ const struct hol_entry *pe = pest->hhstate->prev_entry; ++ const struct hol_cluster *cl = pest->entry->cluster; ++ ++ if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group) ++ __argp_fmtstream_putc (pest->stream, '\n'); ++ ++ if (cl && cl->header && *cl->header ++ && (!pe ++ || (pe->cluster != cl ++ && !hol_cluster_is_child (pe->cluster, cl)))) ++ /* If we're changing clusters, then this must be the start of the ++ ENTRY's cluster unless that is an ancestor of the previous one ++ (in which case we had just popped into a sub-cluster for a bit). ++ If so, then print the cluster's header line. */ ++ { ++ int old_wm = __argp_fmtstream_wmargin (pest->stream); ++ print_header (cl->header, cl->argp, pest); ++ __argp_fmtstream_set_wmargin (pest->stream, old_wm); ++ } ++ ++ pest->first = 0; ++ } ++ else ++ __argp_fmtstream_puts (pest->stream, ", "); ++ ++ indent_to (pest->stream, col); ++} ++ ++/* Print help for ENTRY to STREAM. */ ++static void ++hol_entry_help (struct hol_entry *entry, const struct argp_state *state, ++ argp_fmtstream_t stream, struct hol_help_state *hhstate) ++{ ++ unsigned num; ++ const struct argp_option *real = entry->opt, *opt; ++ char *so = entry->short_options; ++ int have_long_opt = 0; /* We have any long options. */ ++ /* Saved margins. */ ++ int old_lm = __argp_fmtstream_set_lmargin (stream, 0); ++ int old_wm = __argp_fmtstream_wmargin (stream); ++ /* PEST is a state block holding some of our variables that we'd like to ++ share with helper functions. */ ++ struct pentry_state pest = { entry, stream, hhstate, 1, state }; ++ ++ if (! odoc (real)) ++ for (opt = real, num = entry->num; num > 0; opt++, num--) ++ if (opt->name && ovisible (opt)) ++ { ++ have_long_opt = 1; ++ break; ++ } ++ ++ /* First emit short options. */ ++ __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */ ++ for (opt = real, num = entry->num; num > 0; opt++, num--) ++ if (oshort (opt) && opt->key == *so) ++ /* OPT has a valid (non shadowed) short option. */ ++ { ++ if (ovisible (opt)) ++ { ++ comma (uparams.short_opt_col, &pest); ++ __argp_fmtstream_putc (stream, '-'); ++ __argp_fmtstream_putc (stream, *so); ++ if (!have_long_opt || uparams.dup_args) ++ arg (real, " %s", "[%s]", ++ state == NULL ? NULL : state->root_argp->argp_domain, ++ stream); ++ else if (real->arg) ++ hhstate->suppressed_dup_arg = 1; ++ } ++ so++; ++ } ++ ++ /* Now, long options. */ ++ if (odoc (real)) ++ /* A `documentation' option. */ ++ { ++ __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col); ++ for (opt = real, num = entry->num; num > 0; opt++, num--) ++ if (opt->name && ovisible (opt)) ++ { ++ comma (uparams.doc_opt_col, &pest); ++ /* Calling gettext here isn't quite right, since sorting will ++ have been done on the original; but documentation options ++ should be pretty rare anyway... */ ++ __argp_fmtstream_puts (stream, ++ dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, ++ opt->name)); ++ } ++ } ++ else ++ /* A real long option. */ ++ { ++ __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col); ++ for (opt = real, num = entry->num; num > 0; opt++, num--) ++ if (opt->name && ovisible (opt)) ++ { ++ comma (uparams.long_opt_col, &pest); ++ __argp_fmtstream_printf (stream, "--%s", opt->name); ++ arg (real, "=%s", "[=%s]", ++ state == NULL ? NULL : state->root_argp->argp_domain, stream); ++ } ++ } ++ ++ /* Next, documentation strings. */ ++ __argp_fmtstream_set_lmargin (stream, 0); ++ ++ if (pest.first) ++ { ++ /* Didn't print any switches, what's up? */ ++ if (!oshort (real) && !real->name) ++ /* This is a group header, print it nicely. */ ++ print_header (real->doc, entry->argp, &pest); ++ else ++ /* Just a totally shadowed option or null header; print nothing. */ ++ goto cleanup; /* Just return, after cleaning up. */ ++ } ++ else ++ { ++ const char *tstr = real->doc ? dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, ++ real->doc) : 0; ++ const char *fstr = filter_doc (tstr, real->key, entry->argp, state); ++ if (fstr && *fstr) ++ { ++ unsigned int col = __argp_fmtstream_point (stream); ++ ++ __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col); ++ __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col); ++ ++ if (col > (unsigned int) (uparams.opt_doc_col + 3)) ++ __argp_fmtstream_putc (stream, '\n'); ++ else if (col >= (unsigned int) uparams.opt_doc_col) ++ __argp_fmtstream_puts (stream, " "); ++ else ++ indent_to (stream, uparams.opt_doc_col); ++ ++ __argp_fmtstream_puts (stream, fstr); ++ } ++ if (fstr && fstr != tstr) ++ free ((char *) fstr); ++ ++ /* Reset the left margin. */ ++ __argp_fmtstream_set_lmargin (stream, 0); ++ __argp_fmtstream_putc (stream, '\n'); ++ } ++ ++ hhstate->prev_entry = entry; ++ ++cleanup: ++ __argp_fmtstream_set_lmargin (stream, old_lm); ++ __argp_fmtstream_set_wmargin (stream, old_wm); ++} ++ ++/* Output a long help message about the options in HOL to STREAM. */ ++static void ++hol_help (struct hol *hol, const struct argp_state *state, ++ argp_fmtstream_t stream) ++{ ++ unsigned num; ++ struct hol_entry *entry; ++ struct hol_help_state hhstate = { 0, 0, 0 }; ++ ++ for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--) ++ hol_entry_help (entry, state, stream, &hhstate); ++ ++ if (hhstate.suppressed_dup_arg && uparams.dup_args_note) ++ { ++ const char *tstr = dgettext (state == NULL ? NULL ++ : state->root_argp->argp_domain, "\ ++Mandatory or optional arguments to long options are also mandatory or \ ++optional for any corresponding short options."); ++ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE, ++ state ? state->root_argp : 0, state); ++ if (fstr && *fstr) ++ { ++ __argp_fmtstream_putc (stream, '\n'); ++ __argp_fmtstream_puts (stream, fstr); ++ __argp_fmtstream_putc (stream, '\n'); ++ } ++ if (fstr && fstr != tstr) ++ free ((char *) fstr); ++ } ++} ++ ++/* Helper functions for hol_usage. */ ++ ++/* If OPT is a short option without an arg, append its key to the string ++ pointer pointer to by COOKIE, and advance the pointer. */ ++static int ++add_argless_short_opt (const struct argp_option *opt, ++ const struct argp_option *real, ++ const char *domain, void *cookie) ++{ ++ char **snao_end = cookie; ++ if (!(opt->arg || real->arg) ++ && !((opt->flags | real->flags) & OPTION_NO_USAGE)) ++ *(*snao_end)++ = opt->key; ++ return 0; ++} ++ ++/* If OPT is a short option with an arg, output a usage entry for it to the ++ stream pointed at by COOKIE. */ ++static int ++usage_argful_short_opt (const struct argp_option *opt, ++ const struct argp_option *real, ++ const char *domain, void *cookie) ++{ ++ argp_fmtstream_t stream = cookie; ++ const char *arg = opt->arg; ++ int flags = opt->flags | real->flags; ++ ++ if (! arg) ++ arg = real->arg; ++ ++ if (arg && !(flags & OPTION_NO_USAGE)) ++ { ++ arg = dgettext (domain, arg); ++ ++ if (flags & OPTION_ARG_OPTIONAL) ++ __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg); ++ else ++ { ++ /* Manually do line wrapping so that it (probably) won't ++ get wrapped at the embedded space. */ ++ space (stream, 6 + strlen (arg)); ++ __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg); ++ } ++ } ++ ++ return 0; ++} ++ ++/* Output a usage entry for the long option opt to the stream pointed at by ++ COOKIE. */ ++static int ++usage_long_opt (const struct argp_option *opt, ++ const struct argp_option *real, ++ const char *domain, void *cookie) ++{ ++ argp_fmtstream_t stream = cookie; ++ const char *arg = opt->arg; ++ int flags = opt->flags | real->flags; ++ ++ if (! arg) ++ arg = real->arg; ++ ++ if (! (flags & OPTION_NO_USAGE)) ++ { ++ if (arg) ++ { ++ arg = dgettext (domain, arg); ++ if (flags & OPTION_ARG_OPTIONAL) ++ __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg); ++ else ++ __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg); ++ } ++ else ++ __argp_fmtstream_printf (stream, " [--%s]", opt->name); ++ } ++ ++ return 0; ++} ++ ++/* Print a short usage description for the arguments in HOL to STREAM. */ ++static void ++hol_usage (struct hol *hol, argp_fmtstream_t stream) ++{ ++ if (hol->num_entries > 0) ++ { ++ unsigned nentries; ++ struct hol_entry *entry; ++ char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1); ++ char *snao_end = short_no_arg_opts; ++ ++ /* First we put a list of short options without arguments. */ ++ for (entry = hol->entries, nentries = hol->num_entries ++ ; nentries > 0 ++ ; entry++, nentries--) ++ hol_entry_short_iterate (entry, add_argless_short_opt, ++ entry->argp->argp_domain, &snao_end); ++ if (snao_end > short_no_arg_opts) ++ { ++ *snao_end++ = 0; ++ __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts); ++ } ++ ++ /* Now a list of short options *with* arguments. */ ++ for (entry = hol->entries, nentries = hol->num_entries ++ ; nentries > 0 ++ ; entry++, nentries--) ++ hol_entry_short_iterate (entry, usage_argful_short_opt, ++ entry->argp->argp_domain, stream); ++ ++ /* Finally, a list of long options (whew!). */ ++ for (entry = hol->entries, nentries = hol->num_entries ++ ; nentries > 0 ++ ; entry++, nentries--) ++ hol_entry_long_iterate (entry, usage_long_opt, ++ entry->argp->argp_domain, stream); ++ } ++} ++ ++/* Make a HOL containing all levels of options in ARGP. CLUSTER is the ++ cluster in which ARGP's entries should be clustered, or 0. */ ++static struct hol * ++argp_hol (const struct argp *argp, struct hol_cluster *cluster) ++{ ++ const struct argp_child *child = argp->children; ++ struct hol *hol = make_hol (argp, cluster); ++ if (child) ++ while (child->argp) ++ { ++ struct hol_cluster *child_cluster = ++ ((child->group || child->header) ++ /* Put CHILD->argp within its own cluster. */ ++ ? hol_add_cluster (hol, child->group, child->header, ++ child - argp->children, cluster, argp) ++ /* Just merge it into the parent's cluster. */ ++ : cluster); ++ hol_append (hol, argp_hol (child->argp, child_cluster)) ; ++ child++; ++ } ++ return hol; ++} ++ ++/* Calculate how many different levels with alternative args strings exist in ++ ARGP. */ ++static size_t ++argp_args_levels (const struct argp *argp) ++{ ++ size_t levels = 0; ++ const struct argp_child *child = argp->children; ++ ++ if (argp->args_doc && strchr (argp->args_doc, '\n')) ++ levels++; ++ ++ if (child) ++ while (child->argp) ++ levels += argp_args_levels ((child++)->argp); ++ ++ return levels; ++} ++ ++/* Print all the non-option args documented in ARGP to STREAM. Any output is ++ preceded by a space. LEVELS is a pointer to a byte vector the length ++ returned by argp_args_levels; it should be initialized to zero, and ++ updated by this routine for the next call if ADVANCE is true. True is ++ returned as long as there are more patterns to output. */ ++static int ++argp_args_usage (const struct argp *argp, const struct argp_state *state, ++ char **levels, int advance, argp_fmtstream_t stream) ++{ ++ char *our_level = *levels; ++ int multiple = 0; ++ const struct argp_child *child = argp->children; ++ const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0; ++ const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state); ++ ++ if (fdoc) ++ { ++ const char *cp = fdoc; ++ nl = strchrnul (cp, '\n'); ++ if (*nl != '\0') ++ /* This is a `multi-level' args doc; advance to the correct position ++ as determined by our state in LEVELS, and update LEVELS. */ ++ { ++ int i; ++ multiple = 1; ++ for (i = 0; i < *our_level; i++) ++ cp = nl + 1, nl = strchrnul (cp, '\n'); ++ (*levels)++; ++ } ++ ++ /* Manually do line wrapping so that it (probably) won't get wrapped at ++ any embedded spaces. */ ++ space (stream, 1 + nl - cp); ++ ++ __argp_fmtstream_write (stream, cp, nl - cp); ++ } ++ if (fdoc && fdoc != tdoc) ++ free ((char *)fdoc); /* Free user's modified doc string. */ ++ ++ if (child) ++ while (child->argp) ++ advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream); ++ ++ if (advance && multiple) ++ { ++ /* Need to increment our level. */ ++ if (*nl) ++ /* There's more we can do here. */ ++ { ++ (*our_level)++; ++ advance = 0; /* Our parent shouldn't advance also. */ ++ } ++ else if (*our_level > 0) ++ /* We had multiple levels, but used them up; reset to zero. */ ++ *our_level = 0; ++ } ++ ++ return !advance; ++} ++ ++/* Print the documentation for ARGP to STREAM; if POST is false, then ++ everything preceeding a `\v' character in the documentation strings (or ++ the whole string, for those with none) is printed, otherwise, everything ++ following the `\v' character (nothing for strings without). Each separate ++ bit of documentation is separated a blank line, and if PRE_BLANK is true, ++ then the first is as well. If FIRST_ONLY is true, only the first ++ occurrence is output. Returns true if anything was output. */ ++static int ++argp_doc (const struct argp *argp, const struct argp_state *state, ++ int post, int pre_blank, int first_only, ++ argp_fmtstream_t stream) ++{ ++ const char *text; ++ const char *inp_text; ++ void *input = 0; ++ int anything = 0; ++ size_t inp_text_limit = 0; ++ const char *doc = dgettext (argp->argp_domain, argp->doc); ++ const struct argp_child *child = argp->children; ++ ++ if (doc) ++ { ++ char *vt = strchr (doc, '\v'); ++ inp_text = post ? (vt ? vt + 1 : 0) : doc; ++ inp_text_limit = (!post && vt) ? (vt - doc) : 0; ++ } ++ else ++ inp_text = 0; ++ ++ if (argp->help_filter) ++ /* We have to filter the doc strings. */ ++ { ++ if (inp_text_limit) ++ /* Copy INP_TEXT so that it's nul-terminated. */ ++ inp_text = strndup (inp_text, inp_text_limit); ++ input = __argp_input (argp, state); ++ text = ++ (*argp->help_filter) (post ++ ? ARGP_KEY_HELP_POST_DOC ++ : ARGP_KEY_HELP_PRE_DOC, ++ inp_text, input); ++ } ++ else ++ text = (const char *) inp_text; ++ ++ if (text) ++ { ++ if (pre_blank) ++ __argp_fmtstream_putc (stream, '\n'); ++ ++ if (text == inp_text && inp_text_limit) ++ __argp_fmtstream_write (stream, inp_text, inp_text_limit); ++ else ++ __argp_fmtstream_puts (stream, text); ++ ++ if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream)) ++ __argp_fmtstream_putc (stream, '\n'); ++ ++ anything = 1; ++ } ++ ++ if (text && text != inp_text) ++ free ((char *) text); /* Free TEXT returned from the help filter. */ ++ if (inp_text && inp_text_limit && argp->help_filter) ++ free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */ ++ ++ if (post && argp->help_filter) ++ /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */ ++ { ++ text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input); ++ if (text) ++ { ++ if (anything || pre_blank) ++ __argp_fmtstream_putc (stream, '\n'); ++ __argp_fmtstream_puts (stream, text); ++ free ((char *) text); ++ if (__argp_fmtstream_point (stream) ++ > __argp_fmtstream_lmargin (stream)) ++ __argp_fmtstream_putc (stream, '\n'); ++ anything = 1; ++ } ++ } ++ ++ if (child) ++ while (child->argp && !(first_only && anything)) ++ anything |= ++ argp_doc ((child++)->argp, state, ++ post, anything || pre_blank, first_only, ++ stream); ++ ++ return anything; ++} ++ ++/* Output a usage message for ARGP to STREAM. If called from ++ argp_state_help, STATE is the relevent parsing state. FLAGS are from the ++ set ARGP_HELP_*. NAME is what to use wherever a `program name' is ++ needed. */ ++static void ++_help (const struct argp *argp, const struct argp_state *state, FILE *stream, ++ unsigned flags, char *name) ++{ ++ int anything = 0; /* Whether we've output anything. */ ++ struct hol *hol = 0; ++ argp_fmtstream_t fs; ++ ++ if (! stream) ++ return; ++ ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ flockfile (stream); ++#endif ++ ++ fill_in_uparams (state); ++ ++ fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0); ++ if (! fs) ++ { ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ funlockfile (stream); ++#endif ++ return; ++ } ++ ++ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG)) ++ { ++ hol = argp_hol (argp, 0); ++ ++ /* If present, these options always come last. */ ++ hol_set_group (hol, "help", -1); ++ hol_set_group (hol, "version", -1); ++ ++ hol_sort (hol); ++ } ++ ++ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE)) ++ /* Print a short `Usage:' message. */ ++ { ++ int first_pattern = 1, more_patterns; ++ size_t num_pattern_levels = argp_args_levels (argp); ++ char *pattern_levels = alloca (num_pattern_levels); ++ ++ memset (pattern_levels, 0, num_pattern_levels); ++ ++ do ++ { ++ int old_lm; ++ int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent); ++ char *levels = pattern_levels; ++ ++ if (first_pattern) ++ __argp_fmtstream_printf (fs, "%s %s", ++ dgettext (argp->argp_domain, "Usage:"), ++ name); ++ else ++ __argp_fmtstream_printf (fs, "%s %s", ++ dgettext (argp->argp_domain, " or: "), ++ name); ++ ++ /* We set the lmargin as well as the wmargin, because hol_usage ++ manually wraps options with newline to avoid annoying breaks. */ ++ old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent); ++ ++ if (flags & ARGP_HELP_SHORT_USAGE) ++ /* Just show where the options go. */ ++ { ++ if (hol->num_entries > 0) ++ __argp_fmtstream_puts (fs, dgettext (argp->argp_domain, ++ " [OPTION...]")); ++ } ++ else ++ /* Actually print the options. */ ++ { ++ hol_usage (hol, fs); ++ flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */ ++ } ++ ++ more_patterns = argp_args_usage (argp, state, &levels, 1, fs); ++ ++ __argp_fmtstream_set_wmargin (fs, old_wm); ++ __argp_fmtstream_set_lmargin (fs, old_lm); ++ ++ __argp_fmtstream_putc (fs, '\n'); ++ anything = 1; ++ ++ first_pattern = 0; ++ } ++ while (more_patterns); ++ } ++ ++ if (flags & ARGP_HELP_PRE_DOC) ++ anything |= argp_doc (argp, state, 0, 0, 1, fs); ++ ++ if (flags & ARGP_HELP_SEE) ++ { ++ __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\ ++Try `%s --help' or `%s --usage' for more information.\n"), ++ name, name); ++ anything = 1; ++ } ++ ++ if (flags & ARGP_HELP_LONG) ++ /* Print a long, detailed help message. */ ++ { ++ /* Print info about all the options. */ ++ if (hol->num_entries > 0) ++ { ++ if (anything) ++ __argp_fmtstream_putc (fs, '\n'); ++ hol_help (hol, state, fs); ++ anything = 1; ++ } ++ } ++ ++ if (flags & ARGP_HELP_POST_DOC) ++ /* Print any documentation strings at the end. */ ++ anything |= argp_doc (argp, state, 1, anything, 0, fs); ++ ++ if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address) ++ { ++ if (anything) ++ __argp_fmtstream_putc (fs, '\n'); ++ __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, ++ "Report bugs to %s.\n"), ++ argp_program_bug_address); ++ anything = 1; ++ } ++ ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ funlockfile (stream); ++#endif ++ ++ if (hol) ++ hol_free (hol); ++ ++ __argp_fmtstream_free (fs); ++} ++ ++/* Output a usage message for ARGP to STREAM. FLAGS are from the set ++ ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */ ++void argp_help (const struct argp *argp, FILE *stream, ++ unsigned flags, char *name) ++{ ++ _help (argp, 0, stream, flags, name); ++} ++ ++char * ++__argp_short_program_name (void) ++{ ++# ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__ ++/* ++ * uClibc provides both program_invocation_name and ++ * program_invocation_short_name ++ */ ++ return (char *) program_invocation_short_name; ++# else ++ /* FIXME: What now? Miles suggests that it is better to use NULL, ++ but currently the value is passed on directly to fputs_unlocked, ++ so that requires more changes. */ ++# if __GNUC__ ++# warning No reasonable value to return ++# endif /* __GNUC__ */ ++ return ""; ++# endif ++} ++ ++/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are ++ from the set ARGP_HELP_*. */ ++void ++argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags) ++{ ++ if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream) ++ { ++ if (state && (state->flags & ARGP_LONG_ONLY)) ++ flags |= ARGP_HELP_LONG_ONLY; ++ ++ _help (state ? state->root_argp : 0, state, stream, flags, ++ state ? state->name : __argp_short_program_name ()); ++ ++ if (!state || ! (state->flags & ARGP_NO_EXIT)) ++ { ++ if (flags & ARGP_HELP_EXIT_ERR) ++ exit (argp_err_exit_status); ++ if (flags & ARGP_HELP_EXIT_OK) ++ exit (0); ++ } ++ } ++} ++ ++/* If appropriate, print the printf string FMT and following args, preceded ++ by the program name and `:', to stderr, and followed by a `Try ... --help' ++ message, then exit (1). */ ++void ++argp_error (const struct argp_state *state, const char *fmt, ...) ++{ ++ if (!state || !(state->flags & ARGP_NO_ERRS)) ++ { ++ FILE *stream = state ? state->err_stream : stderr; ++ ++ if (stream) ++ { ++ va_list ap; ++ ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ flockfile (stream); ++#endif ++ ++ va_start (ap, fmt); ++ ++#if defined _LIBC && defined USE_IN_LIBIO ++ char *buf; ++ ++ if (_IO_vasprintf (&buf, fmt, ap) < 0) ++ buf = NULL; ++ ++ __fxprintf (stream, "%s: %s\n", ++ state ? state->name : __argp_short_program_name (), buf); ++ ++ free (buf); ++#else ++ fputs_unlocked (state ? state->name : __argp_short_program_name (), ++ stream); ++ putc_unlocked (':', stream); ++ putc_unlocked (' ', stream); ++ ++ vfprintf (stream, fmt, ap); ++ ++ putc_unlocked ('\n', stream); ++#endif ++ ++ argp_state_help (state, stream, ARGP_HELP_STD_ERR); ++ ++ va_end (ap); ++ ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ funlockfile (stream); ++#endif ++ } ++ } ++} ++ ++/* Similar to the standard gnu error-reporting function error(), but will ++ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print ++ to STATE->err_stream. This is useful for argument parsing code that is ++ shared between program startup (when exiting is desired) and runtime ++ option parsing (when typically an error code is returned instead). The ++ difference between this function and argp_error is that the latter is for ++ *parsing errors*, and the former is for other problems that occur during ++ parsing but don't reflect a (syntactic) problem with the input. */ ++void ++argp_failure (const struct argp_state *state, int status, int errnum, ++ const char *fmt, ...) ++{ ++ if (!state || !(state->flags & ARGP_NO_ERRS)) ++ { ++ FILE *stream = state ? state->err_stream : stderr; ++ ++ if (stream) ++ { ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ flockfile (stream); ++#endif ++ ++#if defined _LIBC && defined USE_IN_LIBIO ++ __fxprintf (stream, "%s", ++ state ? state->name : __argp_short_program_name ()); ++#else ++ fputs_unlocked (state ? state->name : __argp_short_program_name (), ++ stream); ++#endif ++ ++ if (fmt) ++ { ++ va_list ap; ++ ++ va_start (ap, fmt); ++#if defined _LIBC && defined USE_IN_LIBIO ++ char *buf; ++ ++ if (_IO_vasprintf (&buf, fmt, ap) < 0) ++ buf = NULL; ++ ++ __fxprintf (stream, ": %s", buf); ++ ++ free (buf); ++#else ++ putc_unlocked (':', stream); ++ putc_unlocked (' ', stream); ++ ++ vfprintf (stream, fmt, ap); ++#endif ++ ++ va_end (ap); ++ } ++ ++ if (errnum) ++ { ++#if (defined _LIBC && defined USE_IN_LIBIO) || defined HAVE_STRERROR_R ++ char buf[200]; ++#endif ++#if defined _LIBC && defined USE_IN_LIBIO ++ __fxprintf (stream, ": %s", ++ strerror_r (errnum, buf, sizeof (buf))); ++#else ++ putc_unlocked (':', stream); ++ putc_unlocked (' ', stream); ++# ifdef HAVE_STRERROR_R ++ fputs (strerror_r (errnum, buf, sizeof (buf)), stream); ++# else ++ fputs (strerror (errnum), stream); ++# endif ++#endif ++ } ++ ++#ifdef USE_IN_LIBIO ++ if (_IO_fwide (stream, 0) > 0) ++ putwc_unlocked (L'\n', stream); ++ else ++#endif ++ putc_unlocked ('\n', stream); ++ ++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) ++ funlockfile (stream); ++#endif ++ ++ if (status && (!state || !(state->flags & ARGP_NO_EXIT))) ++ exit (status); ++ } ++ } ++} +Index: git/libuargp/argp-parse.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-parse.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,949 @@ ++/* Hierarchial argument parsing, layered over getopt ++ Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++/* AIX requires this to be the first thing in the file. */ ++#ifndef __GNUC__ ++# if HAVE_ALLOCA_H || defined _LIBC ++# include ++# else ++# ifdef _AIX ++#pragma alloca ++# else ++# ifndef alloca /* predefined by HP cc +Olibcalls */ ++char *alloca (); ++# endif ++# endif ++# endif ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#ifndef _ ++/* This is for other GNU distributions with internationalized messages. ++ When compiling libc, the _ macro is predefined. */ ++# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__ ++# include ++# ifdef _LIBC ++# undef dgettext ++# define dgettext(domain, msgid) \ ++ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) ++# endif ++# else ++# define dgettext(domain, msgid) (msgid) ++# define gettext(msgid) (msgid) ++# endif ++#endif ++#ifndef N_ ++# define N_(msgid) (msgid) ++#endif ++ ++#include ++ ++/* Getopt return values. */ ++#define KEY_END (-1) /* The end of the options. */ ++#define KEY_ARG 1 /* A non-option argument. */ ++#define KEY_ERR '?' /* An error parsing the options. */ ++ ++/* The meta-argument used to prevent any further arguments being interpreted ++ as options. */ ++#define QUOTE "--" ++ ++/* The number of bits we steal in a long-option value for our own use. */ ++#define GROUP_BITS CHAR_BIT ++ ++/* The number of bits available for the user value. */ ++#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS) ++#define USER_MASK ((1 << USER_BITS) - 1) ++ ++/* EZ alias for ARGP_ERR_UNKNOWN. */ ++#define EBADKEY ARGP_ERR_UNKNOWN ++ ++/* Default options. */ ++ ++/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep ++ for one second intervals, decrementing _ARGP_HANG until it's zero. Thus ++ you can force the program to continue by attaching a debugger and setting ++ it to 0 yourself. */ ++static volatile int _argp_hang; ++ ++#define OPT_PROGNAME -2 ++#define OPT_USAGE -3 ++#define OPT_HANG -4 ++ ++static const struct argp_option argp_default_options[] = ++{ ++ {"help", '?', 0, 0, N_("Give this help list"), -1}, ++ {"usage", OPT_USAGE, 0, 0, N_("Give a short usage message")}, ++ {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")}, ++ {"HANG", OPT_HANG, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN, ++ N_("Hang for SECS seconds (default 3600)")}, ++ {0, 0} ++}; ++ ++static error_t ++argp_default_parser (int key, char *arg, struct argp_state *state) ++{ ++ switch (key) ++ { ++ case '?': ++ argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP); ++ break; ++ case OPT_USAGE: ++ argp_state_help (state, state->out_stream, ++ ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); ++ break; ++ ++ case OPT_PROGNAME: /* Set the program name. */ ++#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME ++ program_invocation_name = arg; ++#endif ++ /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka ++ __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined ++ to be that, so we have to be a bit careful here.] */ ++ ++ /* Update what we use for messages. */ ++ state->name = strrchr (arg, '/'); ++ if (state->name) ++ state->name++; ++ else ++ state->name = arg; ++ ++#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME ++ program_invocation_short_name = state->name; ++#endif ++ ++ if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS)) ++ == ARGP_PARSE_ARGV0) ++ /* Update what getopt uses too. */ ++ state->argv[0] = arg; ++ ++ break; ++ ++ case OPT_HANG: ++ _argp_hang = atoi (arg ? arg : "3600"); ++ while (_argp_hang-- > 0) ++ sleep (1); ++ break; ++ ++ default: ++ return EBADKEY; ++ } ++ return 0; ++} ++ ++static const struct argp argp_default_argp = ++ {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"}; ++ ++ ++static const struct argp_option argp_version_options[] = ++{ ++ {"version", 'V', 0, 0, N_("Print program version"), -1}, ++ {0, 0} ++}; ++ ++static error_t ++argp_version_parser (int key, char *arg, struct argp_state *state) ++{ ++ switch (key) ++ { ++ case 'V': ++ if (argp_program_version_hook) ++ (*argp_program_version_hook) (state->out_stream, state); ++ else if (argp_program_version) ++ fprintf (state->out_stream, "%s\n", argp_program_version); ++ else ++ argp_error (state, dgettext (state->root_argp->argp_domain, ++ "(PROGRAM ERROR) No version known!?")); ++ if (! (state->flags & ARGP_NO_EXIT)) ++ exit (0); ++ break; ++ default: ++ return EBADKEY; ++ } ++ return 0; ++} ++ ++static const struct argp argp_version_argp = ++ {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"}; ++ ++/* Returns the offset into the getopt long options array LONG_OPTIONS of a ++ long option with called NAME, or -1 if none is found. Passing NULL as ++ NAME will return the number of options. */ ++static int ++find_long_option (struct option *long_options, const char *name) ++{ ++ struct option *l = long_options; ++ while (l->name != NULL) ++ if (name != NULL && strcmp (l->name, name) == 0) ++ return l - long_options; ++ else ++ l++; ++ if (name == NULL) ++ return l - long_options; ++ else ++ return -1; ++} ++ ++ ++/* The state of a `group' during parsing. Each group corresponds to a ++ particular argp structure from the tree of such descending from the top ++ level argp passed to argp_parse. */ ++struct group ++{ ++ /* This group's parsing function. */ ++ argp_parser_t parser; ++ ++ /* Which argp this group is from. */ ++ const struct argp *argp; ++ ++ /* Points to the point in SHORT_OPTS corresponding to the end of the short ++ options for this group. We use it to determine from which group a ++ particular short options is from. */ ++ char *short_end; ++ ++ /* The number of non-option args sucessfully handled by this parser. */ ++ unsigned args_processed; ++ ++ /* This group's parser's parent's group. */ ++ struct group *parent; ++ unsigned parent_index; /* And the our position in the parent. */ ++ ++ /* These fields are swapped into and out of the state structure when ++ calling this group's parser. */ ++ void *input, **child_inputs; ++ void *hook; ++}; ++ ++/* Call GROUP's parser with KEY and ARG, swapping any group-specific info ++ from STATE before calling, and back into state afterwards. If GROUP has ++ no parser, EBADKEY is returned. */ ++static error_t ++group_parse (struct group *group, struct argp_state *state, int key, char *arg) ++{ ++ if (group->parser) ++ { ++ error_t err; ++ state->hook = group->hook; ++ state->input = group->input; ++ state->child_inputs = group->child_inputs; ++ state->arg_num = group->args_processed; ++ err = (*group->parser)(key, arg, state); ++ group->hook = state->hook; ++ return err; ++ } ++ else ++ return EBADKEY; ++} ++ ++struct parser ++{ ++ const struct argp *argp; ++ ++ /* SHORT_OPTS is the getopt short options string for the union of all the ++ groups of options. */ ++ char *short_opts; ++ /* LONG_OPTS is the array of getop long option structures for the union of ++ all the groups of options. */ ++ struct option *long_opts; ++ /* OPT_DATA is the getopt data used for the re-entrant getopt. */ ++ struct _getopt_data opt_data; ++ ++ /* States of the various parsing groups. */ ++ struct group *groups; ++ /* The end of the GROUPS array. */ ++ struct group *egroup; ++ /* An vector containing storage for the CHILD_INPUTS field in all groups. */ ++ void **child_inputs; ++ ++ /* True if we think using getopt is still useful; if false, then ++ remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is ++ cleared whenever getopt returns KEY_END, but may be set again if the user ++ moves the next argument pointer backwards. */ ++ int try_getopt; ++ ++ /* State block supplied to parsing routines. */ ++ struct argp_state state; ++ ++ /* Memory used by this parser. */ ++ void *storage; ++}; ++ ++/* The next usable entries in the various parser tables being filled in by ++ convert_options. */ ++struct parser_convert_state ++{ ++ struct parser *parser; ++ char *short_end; ++ struct option *long_end; ++ void **child_inputs_end; ++}; ++ ++/* Converts all options in ARGP (which is put in GROUP) and ancestors ++ into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and ++ CVT->LONG_END are the points at which new options are added. Returns the ++ next unused group entry. CVT holds state used during the conversion. */ ++static struct group * ++convert_options (const struct argp *argp, ++ struct group *parent, unsigned parent_index, ++ struct group *group, struct parser_convert_state *cvt) ++{ ++ /* REAL is the most recent non-alias value of OPT. */ ++ const struct argp_option *real = argp->options; ++ const struct argp_child *children = argp->children; ++ ++ if (real || argp->parser) ++ { ++ const struct argp_option *opt; ++ ++ if (real) ++ for (opt = real; !__option_is_end (opt); opt++) ++ { ++ if (! (opt->flags & OPTION_ALIAS)) ++ /* OPT isn't an alias, so we can use values from it. */ ++ real = opt; ++ ++ if (! (real->flags & OPTION_DOC)) ++ /* A real option (not just documentation). */ ++ { ++ if (__option_is_short (opt)) ++ /* OPT can be used as a short option. */ ++ { ++ *cvt->short_end++ = opt->key; ++ if (real->arg) ++ { ++ *cvt->short_end++ = ':'; ++ if (real->flags & OPTION_ARG_OPTIONAL) ++ *cvt->short_end++ = ':'; ++ } ++ *cvt->short_end = '\0'; /* keep 0 terminated */ ++ } ++ ++ if (opt->name ++ && find_long_option (cvt->parser->long_opts, opt->name) < 0) ++ /* OPT can be used as a long option. */ ++ { ++ cvt->long_end->name = opt->name; ++ cvt->long_end->has_arg = ++ (real->arg ++ ? (real->flags & OPTION_ARG_OPTIONAL ++ ? optional_argument ++ : required_argument) ++ : no_argument); ++ cvt->long_end->flag = 0; ++ /* we add a disambiguating code to all the user's ++ values (which is removed before we actually call ++ the function to parse the value); this means that ++ the user loses use of the high 8 bits in all his ++ values (the sign of the lower bits is preserved ++ however)... */ ++ cvt->long_end->val = ++ ((opt->key | real->key) & USER_MASK) ++ + (((group - cvt->parser->groups) + 1) << USER_BITS); ++ ++ /* Keep the LONG_OPTS list terminated. */ ++ (++cvt->long_end)->name = NULL; ++ } ++ } ++ } ++ ++ group->parser = argp->parser; ++ group->argp = argp; ++ group->short_end = cvt->short_end; ++ group->args_processed = 0; ++ group->parent = parent; ++ group->parent_index = parent_index; ++ group->input = 0; ++ group->hook = 0; ++ group->child_inputs = 0; ++ ++ if (children) ++ /* Assign GROUP's CHILD_INPUTS field some space from ++ CVT->child_inputs_end.*/ ++ { ++ unsigned num_children = 0; ++ while (children[num_children].argp) ++ num_children++; ++ group->child_inputs = cvt->child_inputs_end; ++ cvt->child_inputs_end += num_children; ++ } ++ ++ parent = group++; ++ } ++ else ++ parent = 0; ++ ++ if (children) ++ { ++ unsigned index = 0; ++ while (children->argp) ++ group = ++ convert_options (children++->argp, parent, index++, group, cvt); ++ } ++ ++ return group; ++} ++ ++/* Find the merged set of getopt options, with keys appropiately prefixed. */ ++static void ++parser_convert (struct parser *parser, const struct argp *argp, int flags) ++{ ++ struct parser_convert_state cvt; ++ ++ cvt.parser = parser; ++ cvt.short_end = parser->short_opts; ++ cvt.long_end = parser->long_opts; ++ cvt.child_inputs_end = parser->child_inputs; ++ ++ if (flags & ARGP_IN_ORDER) ++ *cvt.short_end++ = '-'; ++ else if (flags & ARGP_NO_ARGS) ++ *cvt.short_end++ = '+'; ++ *cvt.short_end = '\0'; ++ ++ cvt.long_end->name = NULL; ++ ++ parser->argp = argp; ++ ++ if (argp) ++ parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt); ++ else ++ parser->egroup = parser->groups; /* No parsers at all! */ ++} ++ ++/* Lengths of various parser fields which we will allocated. */ ++struct parser_sizes ++{ ++ size_t short_len; /* Getopt short options string. */ ++ size_t long_len; /* Getopt long options vector. */ ++ size_t num_groups; /* Group structures we allocate. */ ++ size_t num_child_inputs; /* Child input slots. */ ++}; ++ ++/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of ++ argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by ++ the maximum lengths of the resulting merged getopt short options string and ++ long-options array, respectively. */ ++static void ++calc_sizes (const struct argp *argp, struct parser_sizes *szs) ++{ ++ const struct argp_child *child = argp->children; ++ const struct argp_option *opt = argp->options; ++ ++ if (opt || argp->parser) ++ { ++ szs->num_groups++; ++ if (opt) ++ { ++ int num_opts = 0; ++ while (!__option_is_end (opt++)) ++ num_opts++; ++ szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */ ++ szs->long_len += num_opts; ++ } ++ } ++ ++ if (child) ++ while (child->argp) ++ { ++ calc_sizes ((child++)->argp, szs); ++ szs->num_child_inputs++; ++ } ++} ++ ++ ++extern char * __argp_short_program_name (void); ++/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */ ++static error_t ++parser_init (struct parser *parser, const struct argp *argp, ++ int argc, char **argv, int flags, void *input) ++{ ++ error_t err = 0; ++ struct group *group; ++ struct parser_sizes szs; ++ struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER; ++ ++ szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1; ++ szs.long_len = 0; ++ szs.num_groups = 0; ++ szs.num_child_inputs = 0; ++ ++ if (argp) ++ calc_sizes (argp, &szs); ++ ++ /* Lengths of the various bits of storage used by PARSER. */ ++#define GLEN (szs.num_groups + 1) * sizeof (struct group) ++#define CLEN (szs.num_child_inputs * sizeof (void *)) ++#define LLEN ((szs.long_len + 1) * sizeof (struct option)) ++#define SLEN (szs.short_len + 1) ++ ++ parser->storage = malloc (GLEN + CLEN + LLEN + SLEN); ++ if (! parser->storage) ++ return ENOMEM; ++ ++ parser->groups = parser->storage; ++ parser->child_inputs = parser->storage + GLEN; ++ parser->long_opts = parser->storage + GLEN + CLEN; ++ parser->short_opts = parser->storage + GLEN + CLEN + LLEN; ++ parser->opt_data = opt_data; ++ ++ memset (parser->child_inputs, 0, szs.num_child_inputs * sizeof (void *)); ++ parser_convert (parser, argp, flags); ++ ++ memset (&parser->state, 0, sizeof (struct argp_state)); ++ parser->state.root_argp = parser->argp; ++ parser->state.argc = argc; ++ parser->state.argv = argv; ++ parser->state.flags = flags; ++ parser->state.err_stream = stderr; ++ parser->state.out_stream = stdout; ++ parser->state.next = 0; /* Tell getopt to initialize. */ ++ parser->state.pstate = parser; ++ ++ parser->try_getopt = 1; ++ ++ /* Call each parser for the first time, giving it a chance to propagate ++ values to child parsers. */ ++ if (parser->groups < parser->egroup) ++ parser->groups->input = input; ++ for (group = parser->groups; ++ group < parser->egroup && (!err || err == EBADKEY); ++ group++) ++ { ++ if (group->parent) ++ /* If a child parser, get the initial input value from the parent. */ ++ group->input = group->parent->child_inputs[group->parent_index]; ++ ++ if (!group->parser ++ && group->argp->children && group->argp->children->argp) ++ /* For the special case where no parsing function is supplied for an ++ argp, propagate its input to its first child, if any (this just ++ makes very simple wrapper argps more convenient). */ ++ group->child_inputs[0] = group->input; ++ ++ err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0); ++ } ++ if (err == EBADKEY) ++ err = 0; /* Some parser didn't understand. */ ++ ++ if (err) ++ return err; ++ ++ if (parser->state.flags & ARGP_NO_ERRS) ++ { ++ parser->opt_data.opterr = 0; ++ if (parser->state.flags & ARGP_PARSE_ARGV0) ++ /* getopt always skips ARGV[0], so we have to fake it out. As long ++ as OPTERR is 0, then it shouldn't actually try to access it. */ ++ parser->state.argv--, parser->state.argc++; ++ } ++ else ++ parser->opt_data.opterr = 1; /* Print error messages. */ ++ ++ if (parser->state.argv == argv && argv[0]) ++ /* There's an argv[0]; use it for messages. */ ++ { ++ char *short_name = strrchr (argv[0], '/'); ++ parser->state.name = short_name ? short_name + 1 : argv[0]; ++ } ++ else ++ parser->state.name = __argp_short_program_name (); ++ ++ return 0; ++} ++ ++/* Free any storage consumed by PARSER (but not PARSER itself). */ ++static error_t ++parser_finalize (struct parser *parser, ++ error_t err, int arg_ebadkey, int *end_index) ++{ ++ struct group *group; ++ ++ if (err == EBADKEY && arg_ebadkey) ++ /* Suppress errors generated by unparsed arguments. */ ++ err = 0; ++ ++ if (! err) ++ { ++ if (parser->state.next == parser->state.argc) ++ /* We successfully parsed all arguments! Call all the parsers again, ++ just a few more times... */ ++ { ++ for (group = parser->groups; ++ group < parser->egroup && (!err || err==EBADKEY); ++ group++) ++ if (group->args_processed == 0) ++ err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0); ++ for (group = parser->egroup - 1; ++ group >= parser->groups && (!err || err==EBADKEY); ++ group--) ++ err = group_parse (group, &parser->state, ARGP_KEY_END, 0); ++ ++ if (err == EBADKEY) ++ err = 0; /* Some parser didn't understand. */ ++ ++ /* Tell the user that all arguments are parsed. */ ++ if (end_index) ++ *end_index = parser->state.next; ++ } ++ else if (end_index) ++ /* Return any remaining arguments to the user. */ ++ *end_index = parser->state.next; ++ else ++ /* No way to return the remaining arguments, they must be bogus. */ ++ { ++ if (!(parser->state.flags & ARGP_NO_ERRS) ++ && parser->state.err_stream) ++ fprintf (parser->state.err_stream, ++ dgettext (parser->argp->argp_domain, ++ "%s: Too many arguments\n"), ++ parser->state.name); ++ err = EBADKEY; ++ } ++ } ++ ++ /* Okay, we're all done, with either an error or success; call the parsers ++ to indicate which one. */ ++ ++ if (err) ++ { ++ /* Maybe print an error message. */ ++ if (err == EBADKEY) ++ /* An appropriate message describing what the error was should have ++ been printed earlier. */ ++ argp_state_help (&parser->state, parser->state.err_stream, ++ ARGP_HELP_STD_ERR); ++ ++ /* Since we didn't exit, give each parser an error indication. */ ++ for (group = parser->groups; group < parser->egroup; group++) ++ group_parse (group, &parser->state, ARGP_KEY_ERROR, 0); ++ } ++ else ++ /* Notify parsers of success, and propagate back values from parsers. */ ++ { ++ /* We pass over the groups in reverse order so that child groups are ++ given a chance to do there processing before passing back a value to ++ the parent. */ ++ for (group = parser->egroup - 1 ++ ; group >= parser->groups && (!err || err == EBADKEY) ++ ; group--) ++ err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0); ++ if (err == EBADKEY) ++ err = 0; /* Some parser didn't understand. */ ++ } ++ ++ /* Call parsers once more, to do any final cleanup. Errors are ignored. */ ++ for (group = parser->egroup - 1; group >= parser->groups; group--) ++ group_parse (group, &parser->state, ARGP_KEY_FINI, 0); ++ ++ if (err == EBADKEY) ++ err = EINVAL; ++ ++ free (parser->storage); ++ ++ return err; ++} ++ ++/* Call the user parsers to parse the non-option argument VAL, at the current ++ position, returning any error. The state NEXT pointer is assumed to have ++ been adjusted (by getopt) to point after this argument; this function will ++ adjust it correctly to reflect however many args actually end up being ++ consumed. */ ++static error_t ++parser_parse_arg (struct parser *parser, char *val) ++{ ++ /* Save the starting value of NEXT, first adjusting it so that the arg ++ we're parsing is again the front of the arg vector. */ ++ int index = --parser->state.next; ++ error_t err = EBADKEY; ++ struct group *group; ++ int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */ ++ ++ /* Try to parse the argument in each parser. */ ++ for (group = parser->groups ++ ; group < parser->egroup && err == EBADKEY ++ ; group++) ++ { ++ parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */ ++ key = ARGP_KEY_ARG; ++ err = group_parse (group, &parser->state, key, val); ++ ++ if (err == EBADKEY) ++ /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */ ++ { ++ parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */ ++ key = ARGP_KEY_ARGS; ++ err = group_parse (group, &parser->state, key, 0); ++ } ++ } ++ ++ if (! err) ++ { ++ if (key == ARGP_KEY_ARGS) ++ /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't ++ changed by the user, *all* arguments should be considered ++ consumed. */ ++ parser->state.next = parser->state.argc; ++ ++ if (parser->state.next > index) ++ /* Remember that we successfully processed a non-option ++ argument -- but only if the user hasn't gotten tricky and set ++ the clock back. */ ++ (--group)->args_processed += (parser->state.next - index); ++ else ++ /* The user wants to reparse some args, give getopt another try. */ ++ parser->try_getopt = 1; ++ } ++ ++ return err; ++} ++ ++/* Call the user parsers to parse the option OPT, with argument VAL, at the ++ current position, returning any error. */ ++static error_t ++parser_parse_opt (struct parser *parser, int opt, char *val) ++{ ++ /* The group key encoded in the high bits; 0 for short opts or ++ group_number + 1 for long opts. */ ++ int group_key = opt >> USER_BITS; ++ error_t err = EBADKEY; ++ ++ if (group_key == 0) ++ /* A short option. By comparing OPT's position in SHORT_OPTS to the ++ various starting positions in each group's SHORT_END field, we can ++ determine which group OPT came from. */ ++ { ++ struct group *group; ++ char *short_index = strchr (parser->short_opts, opt); ++ ++ if (short_index) ++ for (group = parser->groups; group < parser->egroup; group++) ++ if (group->short_end > short_index) ++ { ++ err = group_parse (group, &parser->state, opt, ++ parser->opt_data.optarg); ++ break; ++ } ++ } ++ else ++ /* A long option. We use shifts instead of masking for extracting ++ the user value in order to preserve the sign. */ ++ err = ++ group_parse (&parser->groups[group_key - 1], &parser->state, ++ (opt << GROUP_BITS) >> GROUP_BITS, ++ parser->opt_data.optarg); ++ ++ if (err == EBADKEY) ++ /* At least currently, an option not recognized is an error in the ++ parser, because we pre-compute which parser is supposed to deal ++ with each option. */ ++ { ++ static const char bad_key_err[] = ++ N_("(PROGRAM ERROR) Option should have been recognized!?"); ++ if (group_key == 0) ++ argp_error (&parser->state, "-%c: %s", opt, ++ dgettext (parser->argp->argp_domain, bad_key_err)); ++ else ++ { ++ struct option *long_opt = parser->long_opts; ++ while (long_opt->val != opt && long_opt->name) ++ long_opt++; ++ argp_error (&parser->state, "--%s: %s", ++ long_opt->name ? long_opt->name : "???", ++ dgettext (parser->argp->argp_domain, bad_key_err)); ++ } ++ } ++ ++ return err; ++} ++ ++/* Parse the next argument in PARSER (as indicated by PARSER->state.next). ++ Any error from the parsers is returned, and *ARGP_EBADKEY indicates ++ whether a value of EBADKEY is due to an unrecognized argument (which is ++ generally not fatal). */ ++static error_t ++parser_parse_next (struct parser *parser, int *arg_ebadkey) ++{ ++ int opt; ++ error_t err = 0; ++ ++ if (parser->state.quoted && parser->state.next < parser->state.quoted) ++ /* The next argument pointer has been moved to before the quoted ++ region, so pretend we never saw the quoting `--', and give getopt ++ another chance. If the user hasn't removed it, getopt will just ++ process it again. */ ++ parser->state.quoted = 0; ++ ++ if (parser->try_getopt && !parser->state.quoted) ++ /* Give getopt a chance to parse this. */ ++ { ++ /* Put it back in OPTIND for getopt. */ ++ parser->opt_data.optind = parser->state.next; ++ /* Distinguish KEY_ERR from a real option. */ ++ parser->opt_data.optopt = KEY_END; ++ if (parser->state.flags & ARGP_LONG_ONLY) ++ opt = _getopt_long_only_r (parser->state.argc, parser->state.argv, ++ parser->short_opts, parser->long_opts, 0, ++ &parser->opt_data); ++ else ++ opt = _getopt_long_r (parser->state.argc, parser->state.argv, ++ parser->short_opts, parser->long_opts, 0, ++ &parser->opt_data); ++ /* And see what getopt did. */ ++ parser->state.next = parser->opt_data.optind; ++ ++ if (opt == KEY_END) ++ /* Getopt says there are no more options, so stop using ++ getopt; we'll continue if necessary on our own. */ ++ { ++ parser->try_getopt = 0; ++ if (parser->state.next > 1 ++ && strcmp (parser->state.argv[parser->state.next - 1], QUOTE) ++ == 0) ++ /* Not only is this the end of the options, but it's a ++ `quoted' region, which may have args that *look* like ++ options, so we definitely shouldn't try to use getopt past ++ here, whatever happens. */ ++ parser->state.quoted = parser->state.next; ++ } ++ else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END) ++ /* KEY_ERR can have the same value as a valid user short ++ option, but in the case of a real error, getopt sets OPTOPT ++ to the offending character, which can never be KEY_END. */ ++ { ++ *arg_ebadkey = 0; ++ return EBADKEY; ++ } ++ } ++ else ++ opt = KEY_END; ++ ++ if (opt == KEY_END) ++ { ++ /* We're past what getopt considers the options. */ ++ if (parser->state.next >= parser->state.argc ++ || (parser->state.flags & ARGP_NO_ARGS)) ++ /* Indicate that we're done. */ ++ { ++ *arg_ebadkey = 1; ++ return EBADKEY; ++ } ++ else ++ /* A non-option arg; simulate what getopt might have done. */ ++ { ++ opt = KEY_ARG; ++ parser->opt_data.optarg = parser->state.argv[parser->state.next++]; ++ } ++ } ++ ++ if (opt == KEY_ARG) ++ /* A non-option argument; try each parser in turn. */ ++ err = parser_parse_arg (parser, parser->opt_data.optarg); ++ else ++ err = parser_parse_opt (parser, opt, parser->opt_data.optarg); ++ ++ if (err == EBADKEY) ++ *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG); ++ ++ return err; ++} ++ ++/* Parse the options strings in ARGC & ARGV according to the argp in ARGP. ++ FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the ++ index in ARGV of the first unparsed option is returned in it. If an ++ unknown option is present, EINVAL is returned; if some parser routine ++ returned a non-zero value, it is returned; otherwise 0 is returned. */ ++error_t ++argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, ++ int *end_index, void *input) ++{ ++ error_t err; ++ struct parser parser; ++ ++ /* If true, then err == EBADKEY is a result of a non-option argument failing ++ to be parsed (which in some cases isn't actually an error). */ ++ int arg_ebadkey = 0; ++ ++ if (! (flags & ARGP_NO_HELP)) ++ /* Add our own options. */ ++ { ++ struct argp_child *child = alloca (4 * sizeof (struct argp_child)); ++ struct argp *top_argp = alloca (sizeof (struct argp)); ++ ++ /* TOP_ARGP has no options, it just serves to group the user & default ++ argps. */ ++ memset (top_argp, 0, sizeof (*top_argp)); ++ top_argp->children = child; ++ ++ memset (child, 0, 4 * sizeof (struct argp_child)); ++ ++ if (argp) ++ (child++)->argp = argp; ++ (child++)->argp = &argp_default_argp; ++ if (argp_program_version || argp_program_version_hook) ++ (child++)->argp = &argp_version_argp; ++ child->argp = 0; ++ ++ argp = top_argp; ++ } ++ ++ /* Construct a parser for these arguments. */ ++ err = parser_init (&parser, argp, argc, argv, flags, input); ++ ++ if (! err) ++ /* Parse! */ ++ { ++ while (! err) ++ err = parser_parse_next (&parser, &arg_ebadkey); ++ err = parser_finalize (&parser, err, arg_ebadkey, end_index); ++ } ++ ++ return err; ++} ++ ++/* Return the input field for ARGP in the parser corresponding to STATE; used ++ by the help routines. */ ++void * ++__argp_input (const struct argp *argp, const struct argp_state *state) ++{ ++ if (state) ++ { ++ struct group *group; ++ struct parser *parser = state->pstate; ++ ++ for (group = parser->groups; group < parser->egroup; group++) ++ if (group->argp == argp) ++ return group->input; ++ } ++ ++ return 0; ++} +Index: git/libuargp/argp-pv.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-pv.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,25 @@ ++/* Default definition for ARGP_PROGRAM_VERSION. ++ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++/* If set by the user program to a non-zero value, then a default option ++ --version is added (unless the ARGP_NO_HELP flag is used), which will ++ print this this string followed by a newline and exit (unless the ++ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ ++const char *argp_program_version; +Index: git/libuargp/argp-pvh.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-pvh.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,32 @@ ++/* Default definition for ARGP_PROGRAM_VERSION_HOOK. ++ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++#include ++ ++/* If set by the user program to a non-zero value, then a default option ++ --version is added (unless the ARGP_NO_HELP flag is used), which calls ++ this function with a stream to print the version to and a pointer to the ++ current parsing state, and then exits (unless the ARGP_NO_EXIT flag is ++ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ ++void (*argp_program_version_hook) (FILE *stream, struct argp_state *state); +Index: git/libuargp/argp-xinl.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libuargp/argp-xinl.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,35 @@ ++/* Real definitions for extern inline functions in argp.h ++ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#if defined _LIBC || defined HAVE_FEATURES_H ++# include ++#endif ++ ++#ifndef __USE_EXTERN_INLINES ++# define __USE_EXTERN_INLINES 1 ++#endif ++#define ARGP_EI ++#undef __OPTIMIZE__ ++#define __OPTIMIZE__ 1 ++#include +Index: git/test/argp/Makefile +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/Makefile 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,7 @@ ++# uClibc argp tests ++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++ ++top_builddir=../../ ++include ../Rules.mak ++-include Makefile.in ++include ../Test.mak +Index: git/test/argp/Makefile.in +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/Makefile.in 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,12 @@ ++# uClibc argp tests ++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++ ++TESTS := $(addprefix argp-, ex1 ex2 ex3 ex4 test) \ ++ bug-argp1 tst-argp1 tst-argp2 ++ ++EXTRA_LDFLAGS = -luargp ++ ++OPTS_argp-ex3 = ARG1 ARG2 ++OPTS_argp-ex4 = ARG1 string1 string2 string3 ++OPTS_bug-argp1 = -- --help ++ +Index: git/test/argp/argp-ex1.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/argp-ex1.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,15 @@ ++/* Argp example #1 -- a minimal program using argp */ ++ ++/* This is (probably) the smallest possible program that ++ uses argp. It won't do much except give an error ++ messages and exit when there are any arguments, and print ++ a (rather pointless) messages for --help. */ ++ ++#include ++#include ++ ++int main (int argc, char **argv) ++{ ++ argp_parse (0, argc, argv, 0, 0, 0); ++ exit (0); ++} +Index: git/test/argp/argp-ex2.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/argp-ex2.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,45 @@ ++/* Argp example #2 -- a pretty minimal program using argp */ ++ ++/* This program doesn't use any options or arguments, but uses ++ argp to be compliant with the GNU standard command line ++ format. ++ ++ In addition to making sure no arguments are given, and ++ implementing a --help option, this example will have a ++ --version option, and will put the given documentation string ++ and bug address in the --help output, as per GNU standards. ++ ++ The variable ARGP contains the argument parser specification; ++ adding fields to this structure is the way most parameters are ++ passed to argp_parse (the first three fields are usually used, ++ but not in this small program). There are also two global ++ variables that argp knows about defined here, ++ ARGP_PROGRAM_VERSION and ARGP_PROGRAM_BUG_ADDRESS (they are ++ global variables because they will almost always be constant ++ for a given program, even if it uses different argument ++ parsers for various tasks). */ ++ ++#include ++#include ++ ++const char *argp_program_version = ++ "argp-ex2 1.0"; ++const char *argp_program_bug_address = ++ ""; ++ ++/* Program documentation. */ ++static char doc[] = ++ "Argp example #2 -- a pretty minimal program using argp"; ++ ++/* Our argument parser. The @code{options}, @code{parser}, and ++ @code{args_doc} fields are zero because we have neither options or ++ arguments; @code{doc} and @code{argp_program_bug_address} will be ++ used in the output for @samp{--help}, and the @samp{--version} ++ option will print out @code{argp_program_version}. */ ++static struct argp argp = { 0, 0, 0, doc }; ++ ++int main (int argc, char **argv) ++{ ++ argp_parse (&argp, argc, argv, 0, 0, 0); ++ exit (0); ++} +Index: git/test/argp/argp-ex3.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/argp-ex3.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,153 @@ ++/* Argp example #3 -- a program with options and arguments using argp */ ++ ++/* This program uses the same features as example 2, and uses options and ++ arguments. ++ ++ We now use the first four fields in ARGP, so here's a description of them: ++ OPTIONS -- A pointer to a vector of struct argp_option (see below) ++ PARSER -- A function to parse a single option, called by argp ++ ARGS_DOC -- A string describing how the non-option arguments should look ++ DOC -- A descriptive string about this program; if it contains a ++ vertical tab character (\v), the part after it will be ++ printed *following* the options ++ ++ The function PARSER takes the following arguments: ++ KEY -- An integer specifying which option this is (taken ++ from the KEY field in each struct argp_option), or ++ a special key specifying something else; the only ++ special keys we use here are ARGP_KEY_ARG, meaning ++ a non-option argument, and ARGP_KEY_END, meaning ++ that all arguments have been parsed ++ ARG -- For an option KEY, the string value of its ++ argument, or NULL if it has none ++ STATE-- A pointer to a struct argp_state, containing ++ various useful information about the parsing state; used here ++ are the INPUT field, which reflects the INPUT argument to ++ argp_parse, and the ARG_NUM field, which is the number of the ++ current non-option argument being parsed ++ It should return either 0, meaning success, ARGP_ERR_UNKNOWN, meaning the ++ given KEY wasn't recognized, or an errno value indicating some other ++ error. ++ ++ Note that in this example, main uses a structure to communicate with the ++ parse_opt function, a pointer to which it passes in the INPUT argument to ++ argp_parse. Of course, it's also possible to use global variables ++ instead, but this is somewhat more flexible. ++ ++ The OPTIONS field contains a pointer to a vector of struct argp_option's; ++ that structure has the following fields (if you assign your option ++ structures using array initialization like this example, unspecified ++ fields will be defaulted to 0, and need not be specified): ++ NAME -- The name of this option's long option (may be zero) ++ KEY -- The KEY to pass to the PARSER function when parsing this option, ++ *and* the name of this option's short option, if it is a ++ printable ascii character ++ ARG -- The name of this option's argument, if any ++ FLAGS -- Flags describing this option; some of them are: ++ OPTION_ARG_OPTIONAL -- The argument to this option is optional ++ OPTION_ALIAS -- This option is an alias for the ++ previous option ++ OPTION_HIDDEN -- Don't show this option in --help output ++ DOC -- A documentation string for this option, shown in --help output ++ ++ An options vector should be terminated by an option with all fields zero. */ ++ ++#include ++#include ++ ++const char *argp_program_version = ++ "argp-ex3 1.0"; ++const char *argp_program_bug_address = ++ ""; ++ ++/* Program documentation. */ ++static char doc[] = ++ "Argp example #3 -- a program with options and arguments using argp"; ++ ++/* A description of the arguments we accept. */ ++static char args_doc[] = "ARG1 ARG2"; ++ ++/* The options we understand. */ ++static struct argp_option options[] = { ++ {"verbose", 'v', 0, 0, "Produce verbose output" }, ++ {"quiet", 'q', 0, 0, "Don't produce any output" }, ++ {"silent", 's', 0, OPTION_ALIAS }, ++ {"output", 'o', "FILE", 0, ++ "Output to FILE instead of standard output" }, ++ { 0 } ++}; ++ ++/* Used by @code{main} to communicate with @code{parse_opt}. */ ++struct arguments ++{ ++ char *args[2]; /* @var{arg1} & @var{arg2} */ ++ int silent, verbose; ++ char *output_file; ++}; ++ ++/* Parse a single option. */ ++static error_t ++parse_opt (int key, char *arg, struct argp_state *state) ++{ ++ /* Get the @var{input} argument from @code{argp_parse}, which we ++ know is a pointer to our arguments structure. */ ++ struct arguments *arguments = state->input; ++ ++ switch (key) ++ { ++ case 'q': case 's': ++ arguments->silent = 1; ++ break; ++ case 'v': ++ arguments->verbose = 1; ++ break; ++ case 'o': ++ arguments->output_file = arg; ++ break; ++ ++ case ARGP_KEY_ARG: ++ if (state->arg_num >= 2) ++ /* Too many arguments. */ ++ argp_usage (state); ++ ++ arguments->args[state->arg_num] = arg; ++ ++ break; ++ ++ case ARGP_KEY_END: ++ if (state->arg_num < 2) ++ /* Not enough arguments. */ ++ argp_usage (state); ++ break; ++ ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++/* Our argp parser. */ ++static struct argp argp = { options, parse_opt, args_doc, doc }; ++ ++int main (int argc, char **argv) ++{ ++ struct arguments arguments; ++ ++ /* Default values. */ ++ arguments.silent = 0; ++ arguments.verbose = 0; ++ arguments.output_file = "-"; ++ ++ /* Parse our arguments; every option seen by @code{parse_opt} will ++ be reflected in @code{arguments}. */ ++ argp_parse (&argp, argc, argv, 0, 0, &arguments); ++ ++ printf ("ARG1 = %s\nARG2 = %s\nOUTPUT_FILE = %s\n" ++ "VERBOSE = %s\nSILENT = %s\n", ++ arguments.args[0], arguments.args[1], ++ arguments.output_file, ++ arguments.verbose ? "yes" : "no", ++ arguments.silent ? "yes" : "no"); ++ ++ exit (0); ++} +Index: git/test/argp/argp-ex4.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/argp-ex4.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,167 @@ ++/* Argp example #4 -- a program with somewhat more complicated options */ ++ ++/* This program uses the same features as example 3, but has more ++ options, and somewhat more structure in the -help output. It ++ also shows how you can `steal' the remainder of the input ++ arguments past a certain point, for programs that accept a ++ list of items. It also shows the special argp KEY value ++ ARGP_KEY_NO_ARGS, which is only given if no non-option ++ arguments were supplied to the program. ++ ++ For structuring the help output, two features are used, ++ *headers* which are entries in the options vector with the ++ first four fields being zero, and a two part documentation ++ string (in the variable DOC), which allows documentation both ++ before and after the options; the two parts of DOC are ++ separated by a vertical-tab character ('\v', or '\013'). By ++ convention, the documentation before the options is just a ++ short string saying what the program does, and that afterwards ++ is longer, describing the behavior in more detail. All ++ documentation strings are automatically filled for output, ++ although newlines may be included to force a line break at a ++ particular point. All documentation strings are also passed to ++ the `gettext' function, for possible translation into the ++ current locale. */ ++ ++#include ++#include ++#include ++ ++const char *argp_program_version = ++ "argp-ex4 1.0"; ++const char *argp_program_bug_address = ++ ""; ++ ++/* Program documentation. */ ++static char doc[] = ++ "Argp example #4 -- a program with somewhat more complicated\ ++options\ ++\vThis part of the documentation comes *after* the options;\ ++ note that the text is automatically filled, but it's possible\ ++ to force a line-break, e.g.\n<-- here."; ++ ++/* A description of the arguments we accept. */ ++static char args_doc[] = "ARG1 [STRING...]"; ++ ++/* Keys for options without short-options. */ ++#define OPT_ABORT 1 /* --abort */ ++ ++/* The options we understand. */ ++static struct argp_option options[] = { ++ {"verbose", 'v', 0, 0, "Produce verbose output" }, ++ {"quiet", 'q', 0, 0, "Don't produce any output" }, ++ {"silent", 's', 0, OPTION_ALIAS }, ++ {"output", 'o', "FILE", 0, ++ "Output to FILE instead of standard output" }, ++ ++ {0,0,0,0, "The following options should be grouped together:" }, ++ {"repeat", 'r', "COUNT", OPTION_ARG_OPTIONAL, ++ "Repeat the output COUNT (default 10) times"}, ++ {"abort", OPT_ABORT, 0, 0, "Abort before showing any output"}, ++ ++ { 0 } ++}; ++ ++/* Used by @code{main} to communicate with @code{parse_opt}. */ ++struct arguments ++{ ++ char *arg1; /* @var{arg1} */ ++ char **strings; /* [@var{string}@dots{}] */ ++ int silent, verbose, abort; /* @samp{-s}, @samp{-v}, @samp{--abort} */ ++ char *output_file; /* @var{file} arg to @samp{--output} */ ++ int repeat_count; /* @var{count} arg to @samp{--repeat} */ ++}; ++ ++/* Parse a single option. */ ++static error_t ++parse_opt (int key, char *arg, struct argp_state *state) ++{ ++ /* Get the @code{input} argument from @code{argp_parse}, which we ++ know is a pointer to our arguments structure. */ ++ struct arguments *arguments = state->input; ++ ++ switch (key) ++ { ++ case 'q': case 's': ++ arguments->silent = 1; ++ break; ++ case 'v': ++ arguments->verbose = 1; ++ break; ++ case 'o': ++ arguments->output_file = arg; ++ break; ++ case 'r': ++ arguments->repeat_count = arg ? atoi (arg) : 10; ++ break; ++ case OPT_ABORT: ++ arguments->abort = 1; ++ break; ++ ++ case ARGP_KEY_NO_ARGS: ++ argp_usage (state); ++ ++ case ARGP_KEY_ARG: ++ /* Here we know that @code{state->arg_num == 0}, since we ++ force argument parsing to end before any more arguments can ++ get here. */ ++ arguments->arg1 = arg; ++ ++ /* Now we consume all the rest of the arguments. ++ @code{state->next} is the index in @code{state->argv} of the ++ next argument to be parsed, which is the first @var{string} ++ we're interested in, so we can just use ++ @code{&state->argv[state->next]} as the value for ++ arguments->strings. ++ ++ @emph{In addition}, by setting @code{state->next} to the end ++ of the arguments, we can force argp to stop parsing here and ++ return. */ ++ arguments->strings = &state->argv[state->next]; ++ state->next = state->argc; ++ ++ break; ++ ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++/* Our argp parser. */ ++static struct argp argp = { options, parse_opt, args_doc, doc }; ++ ++int main (int argc, char **argv) ++{ ++ int i, j; ++ struct arguments arguments; ++ ++ /* Default values. */ ++ arguments.silent = 0; ++ arguments.verbose = 0; ++ arguments.output_file = "-"; ++ arguments.repeat_count = 1; ++ arguments.abort = 0; ++ ++ /* Parse our arguments; every option seen by @code{parse_opt} will be ++ reflected in @code{arguments}. */ ++ argp_parse (&argp, argc, argv, 0, 0, &arguments); ++ ++ if (arguments.abort) ++ error (10, 0, "ABORTED"); ++ ++ for (i = 0; i < arguments.repeat_count; i++) ++ { ++ printf ("ARG1 = %s\n", arguments.arg1); ++ printf ("STRINGS = "); ++ for (j = 0; arguments.strings[j]; j++) ++ printf (j == 0 ? "%s" : ", %s", arguments.strings[j]); ++ printf ("\n"); ++ printf ("OUTPUT_FILE = %s\nVERBOSE = %s\nSILENT = %s\n", ++ arguments.output_file, ++ arguments.verbose ? "yes" : "no", ++ arguments.silent ? "yes" : "no"); ++ } ++ ++ exit (0); ++} +Index: git/test/argp/argp-test.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/argp-test.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,209 @@ ++/* Test program for argp argument parser ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++ ++const char *argp_program_version = "argp-test 1.0"; ++ ++struct argp_option sub_options[] = ++{ ++ {"subopt1", 's', 0, 0, "Nested option 1"}, ++ {"subopt2", 'S', 0, 0, "Nested option 2"}, ++ ++ { 0, 0, 0, 0, "Some more nested options:", 10}, ++ {"subopt3", 'p', 0, 0, "Nested option 3"}, ++ ++ {"subopt4", 'q', 0, 0, "Nested option 4", 1}, ++ ++ {0} ++}; ++ ++static const char sub_args_doc[] = "STRING...\n-"; ++static const char sub_doc[] = "\vThis is the doc string from the sub-arg-parser."; ++ ++static error_t ++sub_parse_opt (int key, char *arg, struct argp_state *state) ++{ ++ switch (key) ++ { ++ case ARGP_KEY_NO_ARGS: ++ printf ("NO SUB ARGS\n"); ++ break; ++ case ARGP_KEY_ARG: ++ printf ("SUB ARG: %s\n", arg); ++ break; ++ ++ case 's' : case 'S': case 'p': case 'q': ++ printf ("SUB KEY %c\n", key); ++ break; ++ ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++static char * ++sub_help_filter (int key, const char *text, void *input) ++{ ++ if (key == ARGP_KEY_HELP_EXTRA) ++ return strdup ("This is some extra text from the sub parser (note that it \ ++is preceded by a blank line)."); ++ else ++ return (char *)text; ++} ++ ++static struct argp sub_argp = { ++ sub_options, sub_parse_opt, sub_args_doc, sub_doc, 0, sub_help_filter ++}; ++ ++/* Structure used to communicate with the parsing functions. */ ++struct params ++{ ++ unsigned foonly; /* Value parsed for foonly. */ ++ unsigned foonly_default; /* Default value for it. */ ++}; ++ ++#define OPT_PGRP 1 ++#define OPT_SESS 2 ++ ++struct argp_option options[] = ++{ ++ {"pid", 'p', "PID", 0, "List the process PID"}, ++ {"pgrp", OPT_PGRP,"PGRP",0, "List processes in the process group PGRP"}, ++ {"no-parent", 'P', 0, 0, "Include processes without parents"}, ++ {0, 'x', 0, OPTION_ALIAS}, ++ {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally" ++ " if there's some reason ps can't" ++ " print a field for any process, it's" ++ " removed from the output entirely)" }, ++ {"reverse", 'r', 0, 0, "Reverse the order of any sort"}, ++ {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS}, ++ {"session", OPT_SESS,"SID", OPTION_ARG_OPTIONAL, ++ "Add the processes from the session" ++ " SID (which defaults to the sid of" ++ " the current process)" }, ++ ++ {0,0,0,0, "Here are some more options:"}, ++ {"foonly", 'f', "ZOT", OPTION_ARG_OPTIONAL, "Glork a foonly"}, ++ {"zaza", 'z', 0, 0, "Snit a zar"}, ++ ++ {0} ++}; ++ ++static const char args_doc[] = "STRING"; ++static const char doc[] = "Test program for argp." ++ "\vThis doc string comes after the options." ++ "\nHey! Some manual formatting!" ++ "\nThe current time is: %s"; ++ ++static void ++popt (int key, char *arg) ++{ ++ char buf[10]; ++ if (isprint (key)) ++ sprintf (buf, "%c", key); ++ else ++ sprintf (buf, "%d", key); ++ if (arg) ++ printf ("KEY %s: %s\n", buf, arg); ++ else ++ printf ("KEY %s\n", buf); ++} ++ ++static error_t ++parse_opt (int key, char *arg, struct argp_state *state) ++{ ++ struct params *params = state->input; ++ ++ switch (key) ++ { ++ case ARGP_KEY_NO_ARGS: ++ printf ("NO ARGS\n"); ++ break; ++ ++ case ARGP_KEY_ARG: ++ if (state->arg_num > 0) ++ return ARGP_ERR_UNKNOWN; /* Leave it for the sub-arg parser. */ ++ printf ("ARG: %s\n", arg); ++ break; ++ ++ case 'f': ++ if (arg) ++ params->foonly = atoi (arg); ++ else ++ params->foonly = params->foonly_default; ++ popt (key, arg); ++ break; ++ ++ case 'p': case 'P': case OPT_PGRP: case 'x': case 'Q': ++ case 'r': case OPT_SESS: case 'z': ++ popt (key, arg); ++ break; ++ ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++static char * ++help_filter (int key, const char *text, void *input) ++{ ++ char *new_text; ++ struct params *params = input; ++ ++ if (key == ARGP_KEY_HELP_POST_DOC && text) ++ { ++ time_t now = time (0); ++ asprintf (&new_text, text, ctime (&now)); ++ } ++ else if (key == 'f') ++ /* Show the default for the --foonly option. */ ++ asprintf (&new_text, "%s (ZOT defaults to %x)", ++ text, params->foonly_default); ++ else ++ new_text = (char *)text; ++ ++ return new_text; ++} ++ ++static struct argp_child argp_children[] = { { &sub_argp }, { 0 } }; ++static struct argp argp = { ++ options, parse_opt, args_doc, doc, argp_children, help_filter ++}; ++ ++int ++main (int argc, char **argv) ++{ ++ struct params params; ++ params.foonly = 0; ++ params.foonly_default = random (); ++ argp_parse (&argp, argc, argv, 0, 0, ¶ms); ++ printf ("After parsing: foonly = %x\n", params.foonly); ++ return 0; ++} +Index: git/test/argp/bug-argp1.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/bug-argp1.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,26 @@ ++#include ++ ++ ++static const struct argp_option test_options[] = ++{ ++ { NULL, 'a', NULL, OPTION_DOC, NULL }, ++ { NULL, 'b', NULL, OPTION_DOC, NULL }, ++ { NULL, 0, NULL, 0, NULL } ++}; ++ ++static struct argp test_argp = ++{ ++ test_options ++}; ++ ++ ++static int ++do_test (int argc, char *argv[]) ++{ ++ int i; ++ argp_parse (&test_argp, argc, argv, 0, &i, NULL); ++ return 0; ++} ++ ++#define TEST_FUNCTION do_test (argc, argv) ++#include "../test-skeleton.c" +Index: git/test/argp/tst-argp1.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/tst-argp1.c 2012-06-18 13:10:44.060825542 -0700 +@@ -0,0 +1,118 @@ ++/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 2002. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++ ++ ++ ++ ++#define OPT_TO_THREAD 300 ++#define OPT_TO_PROCESS 301 ++#define OPT_SYNC_SIGNAL 302 ++#define OPT_SYNC_JOIN 303 ++#define OPT_TOPLEVEL 304 ++ ++ ++static const struct argp_option test_options[] = ++ { ++ { NULL, 0, NULL, 0, "\ ++This is a test for threads so we allow ther user to selection the number of \ ++threads which are used at any one time. Independently the total number of \ ++rounds can be selected. This is the total number of threads which will have \ ++run when the process terminates:" }, ++ { "threads", 't', "NUMBER", 0, "Number of threads used at once" }, ++ { "starts", 's', "NUMBER", 0, "Total number of working threads" }, ++ { "toplevel", OPT_TOPLEVEL, "NUMBER", 0, ++ "Number of toplevel threads which start the other threads; this \ ++implies --sync-join" }, ++ ++ { NULL, 0, NULL, 0, "\ ++Each thread can do one of two things: sleep or do work. The latter is 100% \ ++CPU bound. The work load is the probability a thread does work. All values \ ++from zero to 100 (inclusive) are valid. How often each thread repeats this \ ++can be determined by the number of rounds. The work cost determines how long \ ++each work session (not sleeping) takes. If it is zero a thread would \ ++effectively nothing. By setting the number of rounds to zero the thread \ ++does no work at all and pure thread creation times can be measured." }, ++ { "workload", 'w', "PERCENT", 0, "Percentage of time spent working" }, ++ { "workcost", 'c', "NUMBER", 0, ++ "Factor in the cost of each round of working" }, ++ { "rounds", 'r', "NUMBER", 0, "Number of rounds each thread runs" }, ++ ++ { NULL, 0, NULL, 0, "\ ++There are a number of different methods how thread creation can be \ ++synchronized. Synchronization is necessary since the number of concurrently \ ++running threads is limited." }, ++ { "sync-signal", OPT_SYNC_SIGNAL, NULL, 0, ++ "Synchronize using a signal (default)" }, ++ { "sync-join", OPT_SYNC_JOIN, NULL, 0, "Synchronize using pthread_join" }, ++ ++ { NULL, 0, NULL, 0, "\ ++One parameter for each threads execution is the size of the stack. If this \ ++parameter is not used the system's default stack size is used. If many \ ++threads are used the stack size should be chosen quite small." }, ++ { "stacksize", 'S', "BYTES", 0, "Size of threads stack" }, ++ { "guardsize", 'g', "BYTES", 0, ++ "Size of stack guard area; must fit into the stack" }, ++ ++ { NULL, 0, NULL, 0, "Signal options:" }, ++ { "to-thread", OPT_TO_THREAD, NULL, 0, "Send signal to main thread" }, ++ { "to-process", OPT_TO_PROCESS, NULL, 0, ++ "Send signal to process (default)" }, ++ ++ { NULL, 0, NULL, 0, "Administrative options:" }, ++ { "progress", 'p', NULL, 0, "Show signs of progress" }, ++ { "timing", 'T', NULL, 0, ++ "Measure time from startup to the last thread finishing" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++/* Prototype for option handler. */ ++static error_t parse_opt (int key, char *arg, struct argp_state *state); ++ ++/* Data structure to communicate with argp functions. */ ++static struct argp argp = ++{ ++ test_options, parse_opt ++}; ++ ++ ++static int ++do_test (void) ++{ ++ int argc = 2; ++ char *argv[3] = { (char *) "tst-argp1", (char *) "--help", NULL }; ++ int remaining; ++ ++ /* Parse and process arguments. */ ++ argp_parse (&argp, argc, argv, 0, &remaining, NULL); ++ ++ return 0; ++} ++ ++ ++/* Handle program arguments. */ ++static error_t ++parse_opt (int key, char *arg, struct argp_state *state) ++{ ++ return ARGP_ERR_UNKNOWN; ++} ++ ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" +Index: git/test/argp/tst-argp2.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/test/argp/tst-argp2.c 2012-06-18 13:10:44.064825538 -0700 +@@ -0,0 +1,101 @@ ++/* Copyright (C) 2007 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Jakub Jelinek , 2007. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++ ++static const struct argp_option opt1[] = ++ { ++ { "opt1", '1', "NUMBER", 0, "Option 1" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++static const struct argp_option opt2[] = ++ { ++ { "opt2", '2', "NUMBER", 0, "Option 2" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++static const struct argp_option opt3[] = ++ { ++ { "opt3", '3', "NUMBER", 0, "Option 3" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++static const struct argp_option opt4[] = ++ { ++ { "opt4", '4', "NUMBER", 0, "Option 4" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++static const struct argp_option opt5[] = ++ { ++ { "opt5", '5', "NUMBER", 0, "Option 5" }, ++ { NULL, 0, NULL, 0, NULL } ++ }; ++ ++static struct argp argp5 = ++ { ++ opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL ++ }; ++ ++static struct argp argp4 = ++ { ++ opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL ++ }; ++ ++static struct argp argp3 = ++ { ++ opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL ++ }; ++ ++static struct argp_child children2[] = ++ { ++ { &argp4, 0, "child3", 3 }, ++ { &argp5, 0, "child4", 4 }, ++ { NULL, 0, NULL, 0 } ++ }; ++ ++static struct argp argp2 = ++ { ++ opt2, NULL, "args doc2", "doc2", children2, NULL, NULL ++ }; ++ ++static struct argp_child children1[] = ++ { ++ { &argp2, 0, "child1", 1 }, ++ { &argp3, 0, "child2", 2 }, ++ { NULL, 0, NULL, 0 } ++ }; ++ ++static struct argp argp1 = ++ { ++ opt1, NULL, "args doc1", "doc1", children1, NULL, NULL ++ }; ++ ++ ++static int ++do_test (void) ++{ ++ argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2"); ++ return 0; ++} ++ ++ ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" diff --git a/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch new file mode 100644 index 0000000000..15ee0ca156 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch @@ -0,0 +1,21 @@ +When compiling in thumb mode for arm with -Os gcc gives up since it can not find registers +to spill. So we use -O2 option for compiling fork.c It may be addressable in gcc. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending + +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch +index 329d8a9..41e3646 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch +@@ -30,3 +30,9 @@ CFLAGS-OMIT-libc-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread + # This macro should be alternatively implemented in THUMB + # assembly. + ASFLAGS-vfork.S = -marm ++ ++# For arm fork.c does not compile with -Os when in compiling ++# in thumb1 mode ++ifeq ($(COMPILE_IN_THUMB_MODE),y) ++CFLAGS-fork.c = -O2 ++endif diff --git a/meta/recipes-core/uclibc/uclibc-git/locale.cfg b/meta/recipes-core/uclibc/uclibc-git/locale.cfg new file mode 100644 index 0000000000..fc66435163 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/locale.cfg @@ -0,0 +1,3 @@ +UCLIBC_HAS_LOCALE=y +UCLIBC_HAS_XLOCALE=y +UCLIBC_BUILD_MINIMAL_LOCALE=y diff --git a/meta/recipes-core/uclibc/uclibc-git/obstack.cfg b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg new file mode 100644 index 0000000000..36bf9d6e4a --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg @@ -0,0 +1 @@ +UCLIBC_HAS_OBSTACK=y diff --git a/meta/recipes-core/uclibc/uclibc-git/orign_path.patch b/meta/recipes-core/uclibc/uclibc-git/orign_path.patch new file mode 100644 index 0000000000..81bb8f8459 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/orign_path.patch @@ -0,0 +1,186 @@ +Patch is backported from +http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html + +Upstream-Status: Pending + +Index: git/ldso/ldso/dl-elf.c +=================================================================== +--- git.orig/ldso/ldso/dl-elf.c 2012-06-19 18:29:08.629931662 -0700 ++++ git/ldso/ldso/dl-elf.c 2012-06-19 21:21:14.798431393 -0700 +@@ -133,56 +133,60 @@ + * in uClibc/ldso/util/ldd.c */ + static struct elf_resolve * + search_for_named_library(const char *name, unsigned rflags, const char *path_list, +- struct dyn_elf **rpnt) ++ struct dyn_elf **rpnt, const char* origin) + { +- char *path, *path_n, *mylibname; ++ char *mylibname; + struct elf_resolve *tpnt; +- int done; ++ const char *p, *pn; ++ int plen; + + if (path_list==NULL) + return NULL; + +- /* We need a writable copy of this string, but we don't +- * need this allocated permanently since we don't want +- * to leak memory, so use alloca to put path on the stack */ +- done = _dl_strlen(path_list); +- path = alloca(done + 1); +- + /* another bit of local storage */ + mylibname = alloca(2050); + +- _dl_memcpy(path, path_list, done+1); +- + /* Unlike ldd.c, don't bother to eliminate double //s */ + + /* Replace colons with zeros in path_list */ + /* : at the beginning or end of path maps to CWD */ + /* :: anywhere maps CWD */ + /* "" maps to CWD */ +- done = 0; +- path_n = path; +- do { +- if (*path == 0) { +- *path = ':'; +- done = 1; ++ for (p = path_list; p != NULL; p = pn) { ++ pn = _dl_strchr(p + 1, ':'); ++ if (pn != NULL) { ++ plen = pn - p; ++ pn++; ++ } else ++ plen = _dl_strlen(p); ++ ++ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) { ++ int olen; ++ if (rflags && plen != 7) ++ continue; ++ if (origin == NULL) ++ continue; ++ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--) ++ ; ++ if (olen <= 0) ++ continue; ++ _dl_memcpy(&mylibname[0], origin, olen); ++ _dl_memcpy(&mylibname[olen], p + 7, plen - 7); ++ mylibname[olen + plen - 7] = 0; ++ } else if (plen != 0) { ++ _dl_memcpy(mylibname, p, plen); ++ mylibname[plen] = 0; ++ } else { ++ _dl_strcpy(mylibname, "."); + } +- if (*path == ':') { +- *path = 0; +- if (*path_n) +- _dl_strcpy(mylibname, path_n); +- else +- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */ +- _dl_strcat(mylibname, "/"); +- _dl_strcat(mylibname, name); ++ _dl_strcat(mylibname, "/"); ++ _dl_strcat(mylibname, name); + #ifdef __LDSO_SAFE_RUNPATH__ +- if (*mylibname == '/') ++ if (*mylibname == '/') + #endif +- if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL) +- return tpnt; +- path_n = path+1; +- } +- path++; +- } while (!done); ++ if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL) ++ return tpnt; ++ } + return NULL; + } + +@@ -234,8 +238,10 @@ + if (pnt) { + pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB]; + _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt); +- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL) ++ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, ++ tpnt->libname)) != NULL) + return tpnt1; ++ + } + #endif + +@@ -243,7 +249,7 @@ + /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */ + if (_dl_library_path) { + _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path); +- if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != NULL) ++ if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt, NULL)) != NULL) + { + return tpnt1; + } +@@ -257,7 +263,7 @@ + if (pnt) { + pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB]; + _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt); +- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL) ++ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL) + return tpnt1; + } + #endif +@@ -291,7 +297,7 @@ + /* Look for libraries wherever the shared library loader + * was installed */ + _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath); +- tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt); ++ tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt, NULL); + if (tpnt1 != NULL) + return tpnt1; + #endif +@@ -304,7 +310,7 @@ + #ifndef __LDSO_CACHE_SUPPORT__ + ":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib" + #endif +- , rpnt); ++ , rpnt, NULL); + if (tpnt1 != NULL) + return tpnt1; + +Index: git/ldso/ldso/ldso.c +=================================================================== +--- git.orig/ldso/ldso/ldso.c 2012-06-19 18:29:08.633931663 -0700 ++++ git/ldso/ldso/ldso.c 2012-06-19 18:29:10.197931738 -0700 +@@ -403,6 +403,20 @@ + return p - list; + } + ++static void _dl_setup_progname(const char *argv0) ++{ ++ char image[PATH_MAX]; ++ ssize_t s; ++ ++ s = _dl_readlink("/proc/self/exe", image, sizeof(image)); ++ if (s > 0 && image[0] == '/') { ++ image[s] = 0; ++ _dl_progname = _dl_strdup(image); ++ } else if (argv0) { ++ _dl_progname = argv0; ++ } ++} ++ + void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr, + ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv + DL_GET_READY_TO_RUN_EXTRA_PARMS) +@@ -454,9 +468,7 @@ + * been fixed up by now. Still no function calls outside of this + * library, since the dynamic resolver is not yet ready. + */ +- if (argv[0]) { +- _dl_progname = argv[0]; +- } ++ _dl_setup_progname(argv[0]); + + #ifdef __DSBT__ + _dl_ldso_dsbt = (void *)tpnt->dynamic_info[DT_DSBT_BASE_IDX]; diff --git a/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch new file mode 100644 index 0000000000..2f014cd91e --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch @@ -0,0 +1,113 @@ +Add ppc copysignl implementation + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: git/libc/sysdeps/linux/powerpc/Makefile.arch +=================================================================== +--- git.orig/libc/sysdeps/linux/powerpc/Makefile.arch 2013-05-23 11:09:50.000000000 -0700 ++++ git/libc/sysdeps/linux/powerpc/Makefile.arch 2013-05-23 11:12:06.072328399 -0700 +@@ -5,7 +5,7 @@ + # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + # + +-CSRC-y := __syscall_error.c ioctl.c ++CSRC-y := __syscall_error.c ioctl.c copysignl.c + + SSRC-y := \ + __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ +Index: git/libc/sysdeps/linux/powerpc/copysignl.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libc/sysdeps/linux/powerpc/copysignl.c 2013-05-23 11:11:37.600327865 -0700 +@@ -0,0 +1,89 @@ ++/* s_copysignl.c -- long double version of s_copysign.c. ++ * Conversion to long double by Ulrich Drepper, ++ * Cygnus Support, drepper@cygnus.com. ++ */ ++ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ */ ++ ++/* ++ * copysignl(long double x, long double y) ++ * copysignl(x,y) returns a value with the magnitude of x and ++ * with the sign bit of y. ++ */ ++ ++#include ++#include ++ ++#if __FLOAT_WORD_ORDER == BIG_ENDIAN ++ ++typedef union ++{ ++ long double value; ++ struct ++ { ++ int sign_exponent:16; ++ unsigned int empty:16; ++ uint32_t msw; ++ uint32_t lsw; ++ } parts; ++} ieee_long_double_shape_type; ++ ++#endif ++ ++#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN ++ ++typedef union ++{ ++ long double value; ++ struct ++ { ++ uint32_t lsw; ++ uint32_t msw; ++ int sign_exponent:16; ++ unsigned int empty:16; ++ } parts; ++} ieee_long_double_shape_type; ++ ++#endif ++ ++/* Get int from the exponent of a long double. */ ++ ++#define GET_LDOUBLE_EXP(exp,d) \ ++do { \ ++ ieee_long_double_shape_type ge_u; \ ++ ge_u.value = (d); \ ++ (exp) = ge_u.parts.sign_exponent; \ ++} while (0) ++ ++/* Set exponent of a long double from an int. */ ++ ++#define SET_LDOUBLE_EXP(d,exp) \ ++do { \ ++ ieee_long_double_shape_type se_u; \ ++ se_u.value = (d); \ ++ se_u.parts.sign_exponent = (exp); \ ++ (d) = se_u.value; \ ++} while (0) ++ ++long double copysignl(long double x, long double y); ++libc_hidden_proto(copysignl); ++ ++long double copysignl(long double x, long double y) ++{ ++ uint32_t es1,es2; ++ GET_LDOUBLE_EXP(es1,x); ++ GET_LDOUBLE_EXP(es2,y); ++ SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000)); ++ return x; ++} ++ ++libc_hidden_def(copysignl); diff --git a/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch new file mode 100644 index 0000000000..d2a8a81b94 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch @@ -0,0 +1,140 @@ +Dont support localised optimizations this helps to have a global -O level + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: git/libpthread/nptl/pthread_mutex_timedlock.c +=================================================================== +--- git.orig/libpthread/nptl/pthread_mutex_timedlock.c 2013-01-21 16:22:20.000000000 -0800 ++++ git/libpthread/nptl/pthread_mutex_timedlock.c 2013-01-21 16:24:12.275557670 -0800 +@@ -28,7 +28,9 @@ + * error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’ + */ + int ++#ifndef __OPTIMIZE__ + attribute_optimize("Os") ++#endif + pthread_mutex_timedlock ( + pthread_mutex_t *mutex, + const struct timespec *abstime) +Index: git/libc/sysdeps/linux/powerpc/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/powerpc/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/powerpc/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800 +@@ -26,7 +26,7 @@ + #ifdef __cplusplus + # define __MATH_INLINE __inline + #else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + #endif /* __cplusplus */ + + #if defined __GNUC__ && !defined _SOFT_FLOAT +Index: git/libc/sysdeps/linux/alpha/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/alpha/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/alpha/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800 +@@ -24,7 +24,7 @@ + #ifdef __cplusplus + # define __MATH_INLINE __inline + #else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + #endif + + #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0) +Index: git/libc/sysdeps/linux/i386/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/i386/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/i386/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800 +@@ -25,7 +25,7 @@ + #ifdef __cplusplus + # define __MATH_INLINE __inline + #else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + #endif + + +Index: git/libc/sysdeps/linux/ia64/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/ia64/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/ia64/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800 +@@ -23,7 +23,7 @@ + #ifdef __cplusplus + # define __MATH_INLINE __inline + #else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + #endif + + #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2 +Index: git/libc/sysdeps/linux/m68k/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/m68k/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/m68k/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800 +@@ -91,7 +91,7 @@ + # ifdef __cplusplus + # define __m81_inline __inline + # else +-# define __m81_inline extern __inline ++# define __m81_inline __extern_inline + # endif + # define __M81_MATH_INLINES 1 + #endif +@@ -350,14 +350,14 @@ + /* Note that there must be no whitespace before the argument passed for + NAME, to make token pasting work correctly with -traditional. */ + # define __inline_forward_c(rettype, name, args1, args2) \ +-extern __inline rettype __attribute__((__const__)) \ ++__extern_inline rettype __attribute__((__const__)) \ + name args1 \ + { \ + return __CONCAT(__,name) args2; \ + } + + # define __inline_forward(rettype, name, args1, args2) \ +-extern __inline rettype name args1 \ ++__extern_inline rettype name args1 \ + { \ + return __CONCAT(__,name) args2; \ + } +Index: git/libc/sysdeps/linux/mips/sys/tas.h +=================================================================== +--- git.orig/libc/sysdeps/linux/mips/sys/tas.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/mips/sys/tas.h 2013-01-21 16:24:12.275557670 -0800 +@@ -29,7 +29,7 @@ + #ifdef __USE_EXTERN_INLINES + + # ifndef _EXTERN_INLINE +-# define _EXTERN_INLINE extern __inline ++# define _EXTERN_INLINE __extern_inline + # endif + + _EXTERN_INLINE int +Index: git/libc/sysdeps/linux/sparc/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/sparc/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/sparc/bits/mathinline.h 2013-01-21 16:24:12.279557671 -0800 +@@ -130,7 +130,7 @@ + # ifdef __cplusplus + # define __MATH_INLINE __inline + # else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + # endif /* __cplusplus */ + + /* The gcc, version 2.7 or below, has problems with all this inlining +Index: git/libc/sysdeps/linux/x86_64/bits/mathinline.h +=================================================================== +--- git.orig/libc/sysdeps/linux/x86_64/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800 ++++ git/libc/sysdeps/linux/x86_64/bits/mathinline.h 2013-01-21 16:24:12.279557671 -0800 +@@ -24,7 +24,7 @@ + #ifdef __cplusplus + # define __MATH_INLINE __inline + #else +-# define __MATH_INLINE extern __inline ++# define __MATH_INLINE __extern_inline + #endif + + diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.distro b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro new file mode 100644 index 0000000000..c309e6f79a --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro @@ -0,0 +1,192 @@ +# +# General Library Settings +# +# HAVE_NO_PIC is not set +# DOPIC is not set +# HAVE_NO_SHARED is not set +# ARCH_HAS_NO_LDSO is not set +HAVE_SHARED=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +LDSO_LDD_SUPPORT=y +LDSO_CACHE_SUPPORT=y +# LDSO_PRELOAD_FILE_SUPPORT is not set +LDSO_BASE_FILENAME="ld.so" +# UCLIBC_STATIC_LDCONFIG is not set +LDSO_RUNPATH=y +UCLIBC_CTOR_DTOR=y +LDSO_GNU_HASH_SUPPORT=y +# HAS_NO_THREADS is not set +UCLIBC_HAS_THREADS=y +UCLIBC_HAS_THREADS_NATIVE=y +PTHREADS_DEBUG_SUPPORT=y +# LINUXTHREADS_OLD is not set +UCLIBC_HAS_LFS=y +# MALLOC is not set +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MALLOC_GLIBC_COMPAT=y +UCLIBC_DYNAMIC_ATEXIT=y +COMPAT_ATEXIT=y +UCLIBC_SUSV3_LEGACY=y +UCLIBC_SUSV3_LEGACY_MACROS=y +UCLIBC_SUSV4_LEGACY=y +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS___PROGNAME=y +UNIX98PTY_ONLY=y +ASSUME_DEVPTS=y +UCLIBC_HAS_LIBUTIL=y +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_TZ_FILE_PATH="/etc/TZ" + +# +# Advanced Library Settings +# +UCLIBC_PWD_BUFFER_SIZE=256 +UCLIBC_GRP_BUFFER_SIZE=256 + +# +# Networking Support +# +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_RPC=y +UCLIBC_HAS_FULL_RPC=y +UCLIBC_HAS_REENTRANT_RPC=y +UCLIBC_USE_NETLINK=y +UCLIBC_SUPPORT_AI_ADDRCONFIG=y + +UCLIBC_HAS_BSD_RES_CLOSE=y +UCLIBC_HAS_LIBRESOLV_STUB=y +UCLIBC_HAS_LIBNSL_STUB=y + +# +# String and Stdio Support +# +UCLIBC_HAS_STRING_GENERIC_OPT=y +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_CTYPE_TABLES=y +UCLIBC_HAS_CTYPE_SIGNED=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_WCHAR=y +# UCLIBC_HAS_LOCALE is not set +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +UCLIBC_HAS_STDIO_BUFSIZ_256=y +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +UCLIBC_HAS_STDIO_GETC_MACRO=y +UCLIBC_HAS_STDIO_PUTC_MACRO=y +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +UCLIBC_HAS_PRINTF_M_SPEC=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_SYS_ERRLIST is not set +UCLIBC_HAS_SIGNUM_MESSAGES=y +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_GNU_GETOPT=y +UCLIBC_HAS_GNU_GETSUBOPT=y + +# +# Big and Tall +# +UCLIBC_HAS_REGEX=y +# UCLIBC_HAS_REGEX_OLD is not set +UCLIBC_HAS_FNMATCH=y +# UCLIBC_HAS_FNMATCH_OLD is not set +UCLIBC_HAS_WORDEXP=y +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y +UCLIBC_HAS_FTS=y +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_GLOB=y + +# +# Library Installation Options +# +SHARED_LIB_LOADER_PREFIX="/lib" +RUNTIME_PREFIX="/" +DEVEL_PREFIX="//usr" + +# +# Security options +# +# UCLIBC_BUILD_PIE is not set +# UCLIBC_HAS_ARC4RANDOM is not set +# HAVE_NO_SSP is not set +# UCLIBC_HAS_SSP is not set +UCLIBC_BUILD_RELRO=y +UCLIBC_BUILD_NOW=y +UCLIBC_BUILD_NOEXECSTACK=y + +# +# uClibc development/debugging options +# +CROSS_COMPILER_PREFIX="" +UCLIBC_EXTRA_CFLAGS="" +# DODEBUG is not set +# DODEBUG_PT is not set +# DOSTRIP is not set +# DOASSERTS is not set +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +# UCLIBC_MALLOC_DEBUGGING is not set +UCLIBC_HAS_BACKTRACE=y +WARNINGS="-Wall" +# EXTRA_WARNINGS is not set +# DOMULTI is not set +# UCLIBC_MJN3_ONLY is not set + +# math stuff for perl +DO_C99_MATH=y +UCLIBC_HAS_LONG_DOUBLE_MATH=y +UCLIBC_HAS_FENV=y +UCLIBC_LINUX_MODULE_26=y +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_SPECIFIC=y +UCLIBC_HAS_REALTIME=y +UCLIBC_HAS_ADVANCED_REALTIME=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_BSD_ERR=y +UCLIBC_HAS_SYSLOG=y +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_CRYPT_IMPL=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_HAS_PTY=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_FLOATS=y + +# The below option is needed for ARM since depending +# upong what intruction set is chosen this will be +# enabled. As such it is harmless and will be punted +# by menuconfig for other arches. + +# COMPILE_IN_THUMB_MODE is not set + +# needed by systemd +UCLIBC_HAS_UTMPX=y +UCLIBC_LINUX_MODULE_26=y +UCLIBC_HAS_RESOLVER_SUPPORT=y +# needed for LTP +UCLIBC_SUSV4_LEGACY=y +UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y +DO_XSI_MATH=y +UCLIBC_SV4_DEPRECATED=y diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.machine b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine new file mode 100644 index 0000000000..595f444dac --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine @@ -0,0 +1,14 @@ +# +# Automatically generated make config: don't edit +# Version: 0.9.32-git +# Mon Jul 19 01:34:29 2010 +# +# +# Using ELF file format +# +FORCE_OPTIONS_FOR_ARCH=y +ARCH_HAS_MMU=y +ARCH_USE_MMU=y +KERNEL_HEADERS="/usr/include" +HAVE_DOT_CONFIG=y + diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch new file mode 100644 index 0000000000..37a59884b8 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch @@ -0,0 +1,35 @@ +uclibc now has log2 so enable the tests + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: uClibc/test/math/libm-test.inc +=================================================================== +--- uClibc/test/math/libm-test.inc (revision 23784) ++++ uClibc/test/math/libm-test.inc (working copy) +@@ -3414,7 +3414,6 @@ + } + + +-#if 0 + static void + log2_test (void) + { +@@ -3444,7 +3443,6 @@ + + END (log2); + } +-#endif + + + static void +@@ -4967,9 +4965,7 @@ + log_test (); + log10_test (); + log1p_test (); +-#if 0 + log2_test (); +-#endif + logb_test (); + modf_test (); + ilogb_test (); diff --git a/meta/recipes-core/uclibc/uclibc-initial_git.bb b/meta/recipes-core/uclibc/uclibc-initial_git.bb new file mode 100644 index 0000000000..3a1140e57b --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-initial_git.bb @@ -0,0 +1,36 @@ +SECTION = "base" +require uclibc.inc +require uclibc-git.inc + +DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial kern-tools-native" +PROVIDES = "virtual/${TARGET_PREFIX}libc-initial" + +PACKAGES = "" +PACKAGES_DYNAMIC = "" + +STAGINGCC = "gcc-cross-initial" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial" + +do_install() { + # Install initial headers into the cross dir + make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ + install_headers install_startfiles + + # add links to linux-libc-headers: final uclibc build need this. + for t in linux asm asm-generic; do + if [ -d ${D}${includedir}/$t ]; then + rm -rf ${D}${includedir}/$t + fi + ln -sf ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/ + done + +} +do_compile() { + : +} + +do_siteconfig () { + : +} + +do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/" diff --git a/meta/recipes-core/uclibc/uclibc-package.inc b/meta/recipes-core/uclibc/uclibc-package.inc new file mode 100644 index 0000000000..c1815f9a31 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-package.inc @@ -0,0 +1,37 @@ +# Ensure the uclibc-dev package is processed before uclibc-staticdev to allow +# *_nonshared.a libraries to be packaged in the uclibc-dev package. +PACKAGES = "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}" + +FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so" +FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so" +FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so" +FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so" +FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so" +FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so" +FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so" +FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so" +FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so" + +FILES_ldd = "${bindir}/ldd" +FILES_uclibc-utils = "${bindir} ${sbindir}" +FILES_uclibc-utils-dbg += "${bindir}/.debug ${sbindir}/.debug" +FILES_uclibc-gconv = "${libdir}/gconv" +FILES_uclibc-thread-db = "${base_libdir}/libthread_db*" +FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*" +FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*" + +# The last line (gdb and lib1) is for uclinux-uclibc builds +uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \ + ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \ + ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \ + " +FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}" +FILES_${PN}-dev += "\ + ${libdir}/lib*.so \ + ${libdir}/*_nonshared.a \ + ${libdir}/[S]*crt[1in].o \ + ${libdir}/crtreloc*.o \ + ${includedir}/*.h ${includedir}/*/*.h \ + " +FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \ + ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale" diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc new file mode 100644 index 0000000000..e00de62f90 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc.inc @@ -0,0 +1,166 @@ +SUMMARY = "C library for embedded systems" +DESCRIPTION = "The name uClibc is an abbreviation for 'the \ +microcontroller C library'. For simplicity, uClibc is pronounced \ +'yew-see-lib-see'. The goal of uClibc is to provide as much \ +functionality as possible in a small amount of space, and it is intended \ +primarily for embedded use. It is also highly configurable in supported \ +features, at the cost of ABI differences for different configurations. \ +uClibc has been designed from the ground up to be a C library for \ +embedded Linux. It is NOT compatible with binaries linked against glibc." + +LICENSE = "LGPLv2.1+" +SECTION = "libs" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \ +file://${S}/test/regex/testregex.c;beginline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960" +PR = "r9" + +require uclibc-config.inc + +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +# siteconfig.bbclass runs configure which needs a working compiler +# For the compiler to work we need a working libc yet libc isn't +# in the sysroots directory at this point. This means the libc.so +# linker script won't work as the --sysroot setting isn't correct. +# Here we create a hacked up libc linker script and pass in the right +# flags to let configure work. Ugly. +EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'" +siteconfig_do_siteconfig_gencache_prepend = " \ +mkdir -p ${WORKDIR}/site_config_libc; \ +cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ +sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ +" + +# For now, we will skip building of a gcc package if it is a uclibc one +# and our build is not a uclibc one, and we skip a glibc one if our build +# is a uclibc build. +COMPATIBLE_HOST = ".*-uclibc.*" + +INHIBIT_DEFAULT_DEPS = "1" + +# do_stage barfs on a CC with whitespace, therefore put the 'HOST_CC_ARCH' in +# the CFLAGS (when building the utils). +OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}'" +EXTRA_OEMAKE = "${OEMAKE_NO_CC} \ + 'HOSTCC=${BUILD_CC}' \ + 'HOST_CFLAGS=${BUILD_CFLAGS}' \ + 'CC=${CC}' \ + ARCH=${UCLIBC_ARCH}" + +EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}" + +# enable verbose output: +export V="2" + +# -O -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860 +# +CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" +UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" +UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}" + +do_compile_prepend () { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake pregen +} + +configmangle = '/^KERNEL_HEADERS/d; \ + /^RUNTIME_PREFIX/d; \ + /^DEVEL_PREFIX/d; \ + /^SHARED_LIB_LOADER_PREFIX/d; \ + /^UCLIBC_EXTRA_CFLAGS/d; \ + s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ + ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][d.getVar("ARM_INSTRUCTION_SET", True) != "arm"]} \ + ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][d.getVar("USE_NLS", True) == "yes"]} \ + ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][d.getVar("TARGET_ARCH", True) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \ + /^CROSS/d; \ + /^TARGET_ARCH=/d; \ + /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \ + s,^DOSTRIP.*,# DOSTRIP is not set,g; \ + /_[EO]*ABI/d; \ + /HAS_FPU/d; \ + ' +OE_FEATURES := "${@features_to_uclibc_conf(d)}" +OE_DEL := "${@features_to_uclibc_del(d)}" +python () { + if "${OE_DEL}": + d.setVar('configmangle_append', "${OE_DEL}" + "\n") + + # by default uclibc uses mips1 ISA for o32 ABI + # if we use TARGET_CC_ARCH="-march=mips32" we end up + # with conflicting march options to gcc. Here we + # ask for MIPS32 ISA to match the chosen arch + + if "mips32" in d.getVar("TUNE_FEATURES",True): + d.setVar('configmangle_append', + "/^### MIPS32_CHECK$/a\\\nCONFIG_MIPS_ISA_MIPS32=y\n\n") + if "${OE_FEATURES}": + d.setVar('configmangle_append', + "/^### DISTRO FEATURES$/a\\\n%s\n\n" % + ("\\n".join((d.expand("${OE_FEATURES}").split("\n"))))) + d.setVar('configmangle_append', + "/^### CROSS$/a\\\n%s\n" % + ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"", + "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"", + "KERNEL_HEADERS=\"${STAGING_INCDIR}\"", + "RUNTIME_PREFIX=\"/\"", + "DEVEL_PREFIX=\"/${prefix}\"", + "SHARED_LIB_LOADER_PREFIX=\"/lib\"", + ]) + )) + d.setVar('configmangle_append', + "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" % + ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}")) + d.setVar('configmangle_append', + "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]])) + if "${UCLIBC_ENDIAN}": + d.setVar('configmangle_append', + "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}")) + if "${UCLIBC_ABI}": + d.setVar('configmangle_append', + "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}")) +} + +python do_patch_append() { + import subprocess + subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True) + subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True) +} + +do_configure() { + rm -f ${S}/.config + + # OpenEmbedded splits the uClibc.config in two parts: + # uClibc.machine, uClibc.distro + echo "### uClibc.machine ###" >${S}/merged.config + cat ${WORKDIR}/uClibc.machine >>${S}/merged.config + echo "### uClibc.distro ###" >>${S}/merged.config + cat ${WORKDIR}/uClibc.distro >>${S}/merged.config + echo "### CROSS" >>${S}/merged.config + echo "### TGT" >>${S}/merged.config + echo "### MMU" >>${S}/merged.config + echo "### FPU" >>${S}/merged.config + echo "### ABI" >>${S}/merged.config + echo "### DISTRO FEATURES" >>${S}/merged.config + echo "### MIPS32_CHECK" >>${S}/merged.config + + # Mangle the resulting .config depending on OE variables + sed -i -e '${configmangle}' ${S}/merged.config + cp ${S}/merged.config .config + merge_config.sh -r -n -m .config ${@" ".join(find_cfgs(d))} + cml1_do_configure + +} + +do_install() { + oe_runmake PREFIX=${D} install + rm -rf ${D}${includedir}/iconv.h +} + +# build ldd, ldconfig and friends but only for full uclibc +do_install_append_pn-uclibc () { + oe_runmake PREFIX=${D} "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" -C utils utils_install +} + diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb new file mode 100644 index 0000000000..b4f5d9c9dc --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc_git.bb @@ -0,0 +1,22 @@ +require uclibc.inc +require uclibc-package.inc +require uclibc-git.inc + +STAGINGCC = "gcc-cross-initial" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial" + +PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" + +DEPENDS = "virtual/${TARGET_PREFIX}binutils \ + virtual/${TARGET_PREFIX}gcc-initial \ + virtual/${TARGET_PREFIX}libc-initial \ + linux-libc-headers ncurses-native \ + kern-tools-native" + +RDEPENDS_${PN}-dev = "linux-libc-headers-dev" +RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev" +# uclibc does not really have libsegfault but then using the one from glibc is also not +# going to work. So we pretend that we have it to make bitbake not pull other recipes +# to satisfy this dependency for the images/tasks + +RPROVIDES_${PN} += "libsegfault rtld(GNU_HASH)" diff --git a/meta/recipes-core/udev/udev-extraconf/automount.rules b/meta/recipes-core/udev/udev-extraconf/automount.rules new file mode 100644 index 0000000000..7e844c31bd --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/automount.rules @@ -0,0 +1,19 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + diff --git a/meta/recipes-core/udev/udev-extraconf/autonet.rules b/meta/recipes-core/udev/udev-extraconf/autonet.rules new file mode 100644 index 0000000000..19676aa13b --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/autonet.rules @@ -0,0 +1,19 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Handle network interface setup +SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" +SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" + diff --git a/meta/recipes-core/udev/udev-extraconf/localextra.rules b/meta/recipes-core/udev/udev-extraconf/localextra.rules new file mode 100644 index 0000000000..3d51d3e395 --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/localextra.rules @@ -0,0 +1,23 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# The first rtc device is symlinked to /dev/rtc +KERNEL=="rtc0", SYMLINK+="rtc" + +#The first framebuffer is symlinked to /dev/fb +KERNEL=="fb0", SYMLINK+="fb" + +# Make all input devices read-write to the input group +SUBSYSTEM=="input", GROUP="input", MODE="660" diff --git a/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/meta/recipes-core/udev/udev-extraconf/mount.blacklist new file mode 100644 index 0000000000..e49349428b --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/mount.blacklist @@ -0,0 +1,5 @@ +/dev/loop +/dev/ram +/dev/mtdblock +/dev/md +/dev/dm-* diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh new file mode 100644 index 0000000000..cb57e47a90 --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -0,0 +1,91 @@ +#!/bin/sh +# +# Called from udev +# +# Attempt to mount any added block devices and umount any removed devices + + +MOUNT="/bin/mount" +PMOUNT="/usr/bin/pmount" +UMOUNT="/bin/umount" +for line in `grep -v ^# /etc/udev/mount.blacklist` +do + if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; + then + logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" + exit 0 + fi +done + +automount() { + name="`basename "$DEVNAME"`" + + ! test -d "/media/$name" && mkdir -p "/media/$name" + # Silent util-linux's version of mounting auto + if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; + then + MOUNT="$MOUNT -o silent" + fi + + # If filesystem type is vfat, change the ownership group to 'disk', and + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) + MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) + ;; + esac + + if ! $MOUNT -t auto $DEVNAME "/media/$name" + then + #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!" + rm_dir "/media/$name" + else + logger "mount.sh/automount" "Auto-mount of [/media/$name] successful" + touch "/tmp/.automount-$name" + fi +} + +rm_dir() { + # We do not want to rm -r populated directories + if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1" + then + ! test -z "$1" && rm -r "$1" + else + logger "mount.sh/automount" "Not removing non-empty directory [$1]" + fi +} + +# No ID_FS_TYPE for cdrom device, yet it should be mounted +name="`basename "$DEVNAME"`" +[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media` + +if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then + if [ -x "$PMOUNT" ]; then + $PMOUNT $DEVNAME 2> /dev/null + elif [ -x $MOUNT ]; then + $MOUNT $DEVNAME 2> /dev/null + fi + + # If the device isn't mounted at this point, it isn't + # configured in fstab (note the root filesystem can show up as + # /dev/root in /proc/mounts, so check the device number too) + if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then + grep -q "^$DEVNAME " /proc/mounts || automount + fi +fi + + + +if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then + for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " ` + do + $UMOUNT $mnt + done + + # Remove empty directories from auto-mounter + name="`basename "$DEVNAME"`" + test -e "/tmp/.automount-$name" && rm_dir "/media/$name" +fi diff --git a/meta/recipes-core/udev/udev-extraconf/network.sh b/meta/recipes-core/udev/udev-extraconf/network.sh new file mode 100644 index 0000000000..3ee92714af --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf/network.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# We get two "add" events for hostap cards due to wifi0 +echo "$INTERFACE" | grep -q wifi && exit 0 + +# udevd does clearenv(). Export shell PATH to children. +export PATH + +# Check if /etc/init.d/network has been run yet to see if we are +# called by starting /etc/rcS.d/S03udev and not by hotplugging a device +# +# At this stage, network interfaces should not be brought up +# automatically because: +# a) /etc/init.d/network has not been run yet (security issue) +# b) /var has not been populated yet so /etc/resolv,conf points to +# oblivion, making the network unusable +# + +spoofp="`grep ^spoofprotect /etc/network/options`" +if test -z "$spoofp" +then + # This is the default from /etc/init.d/network + spoofp_val=yes +else + spoofp_val=${spoofp#spoofprotect=} +fi + +test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0 + +# I think it is safe to assume that "lo" will always be there ;) +if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val" +then + echo "$INTERFACE" >> /dev/udev_network_queue + exit 0 +fi + +# +# Code taken from pcmcia-cs:/etc/pcmcia/network +# + +# if this interface has an entry in /etc/network/interfaces, let ifupdown +# handle it +if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then + case $ACTION in + add) + ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE + ;; + remove) + ifdown $INTERFACE + ;; + esac + + exit 0 +fi diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.0.bb new file mode 100644 index 0000000000..3810b28155 --- /dev/null +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb @@ -0,0 +1,41 @@ +SUMMARY = "Extra machine specific configuration files" +DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +PR = "r16" + +SRC_URI = " \ + file://automount.rules \ + file://mount.sh \ + file://mount.blacklist \ + file://autonet.rules \ + file://network.sh \ + file://localextra.rules \ +" + + +do_install() { + install -d ${D}${sysconfdir}/udev/rules.d + + install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules + install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules + install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules + + install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/ + + install -d ${D}${sysconfdir}/udev/scripts/ + + install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh + install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts +} + +FILES_${PN} = "${sysconfdir}/udev" +RDEPENDS_${PN} = "udev" +CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist" + +# to replace udev-extra-rules from meta-oe +RPROVIDES_${PN} = "udev-extra-rules" +RREPLACES_${PN} = "udev-extra-rules" +RCONFLICTS_${PN} = "udev-extra-rules" diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc new file mode 100644 index 0000000000..1b22525436 --- /dev/null +++ b/meta/recipes-core/udev/udev.inc @@ -0,0 +1,107 @@ +SUMMARY = "/dev/ and hotplug management daemon" +DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \ +/dev/, handles hotplug events and loads drivers at boot time." +HOMEPAGE = "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html" +LICENSE = "GPLv2.0+ & LGPLv2.1+" +LICENSE_${PN} = "GPLv2.0+" +LICENSE_libudev = "LGPLv2.1+" +LICENSE_libgudev = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://src/COPYING;md5=17c4e5fb495e6707ac92a3864926f979 \ + file://src/gudev/COPYING;md5=fb494485a7d0505308cb68e4997cc266" + +LDFLAGS += "-lrt" + +DEPENDS = "acl glib-2.0 libusb usbutils pciutils gperf-native libxslt-native util-linux" +RPROVIDES_${PN} = "hotplug" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ + file://0001-Fixing-keyboard_force_release.sh-shell-script-path.patch \ + file://avoid-mouse-autosuspend.patch \ + file://run.rules \ + file://udev.rules \ + file://devfs-udev.rules \ + file://links.conf \ + file://permissions.rules \ + file://local.rules \ + file://udev-cache \ + file://udev-cache.default \ + file://add-install-ptest.patch \ + file://run-ptest \ + file://init" + +inherit autotools pkgconfig update-rc.d ptest +RDEPENDS_${PN}-ptest += "make" + +libexecdir = "${base_libdir}" +EXTRA_OECONF = "--disable-introspection \ + --with-rootlibdir=${base_libdir} \ + --with-pci-ids-path=${datadir}/pci.ids \ + ac_cv_file__usr_share_pci_ids=no \ + ac_cv_file__usr_share_hwdata_pci_ids=no \ + ac_cv_file__usr_share_misc_pci_ids=yes \ + --sbindir=${base_sbindir} \ + --libexecdir=${nonarch_base_libdir} \ + --with-rootlibdir=${base_libdir} \ + --with-rootprefix= \ + --without-systemdsystemunitdir \ + " + +PACKAGES =+ "udev-utils udev-cache" +PACKAGES =+ "libudev" +PACKAGES =+ "libgudev" + +INITSCRIPT_PACKAGES = "udev udev-cache" +INITSCRIPT_NAME_udev = "udev" +INITSCRIPT_PARAMS_udev = "start 04 S ." +INITSCRIPT_NAME_udev-cache = "udev-cache" +INITSCRIPT_PARAMS_udev-cache = "start 36 S ." + +FILES_${PN} += "${libexecdir} ${libdir}/ConsoleKit ${nonarch_base_libdir}/udev" +RRECOMMENDS_${PN} += "udev-utils udev-cache" + +FILES_${PN}-dbg += "${libexecdir}/.debug" +FILES_${PN}-dbg += "${base_libdir}/udev/.debug/" +FILES_${PN}-dbg += "${base_libdir}/udev/.debug/*" +FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*" +FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \ + ${includedir}/libudev.h ${libdir}/libudev.so ${libdir}/libudev.la \ + ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc \ + ${includedir}/gudev* ${libdir}/libgudev*.so ${libdir}/libgudev*.la \ + ${libdir}/libgudev*.a ${libdir}/pkgconfig/gudev*.pc" +FILES_libudev = "${base_libdir}/libudev.so.*" +FILES_libgudev = "${base_libdir}/libgudev*.so.* ${libdir}/libgudev*.so.*" +FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache" + +FILES_udev-utils = "${bindir}/udevadm" + +do_install_append () { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev + install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache + sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev + sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev-cache + + install -d ${D}${sysconfdir}/default + install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache + + touch ${D}${sysconfdir}/udev/cache.data + + install -d ${D}${sysconfdir}/udev/rules.d/ + + install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules + + # hid2hci has moved to bluez4. removed in udev as of version 169 + rm -f ${D}${base_libdir}/udev/hid2hci + + echo 'udev_run="/var/run/udev"' >> ${D}${sysconfdir}/udev/udev.conf +} + +# As systemd also builds udev, skip this package if we're doing a systemd build. +python () { + if oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): + raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES") +} +do_compile_ptest() { + oe_runmake test-udev +} diff --git a/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch new file mode 100644 index 0000000000..41deafa918 --- /dev/null +++ b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch @@ -0,0 +1,35 @@ +From 0f8290c943da298abd269ca60fd8375dfb219971 Mon Sep 17 00:00:00 2001 +From: Alexandru DAMIAN +Date: Thu, 12 Jul 2012 12:54:48 +0300 +Subject: [PATCH] Fixing keyboard_force_release.sh shell script path + +With the introduction of rootprefix, the keyboard-force-release.sh.in +was modified to be executed with @rootprefix@/bin/sh, which is wrong +because @rootprefix@ defaults to /usr (which is correct), but the +shell is always at /bin/sh (IEEE Std 1003.2-1992). + +Therefore the interpreter for shell scripts needs to be /bin/sh at all times. + +The upstream moved to configurable root prefix, this patch taclkes a +transition bug, and will not be applied upstream. + +Upstream-Status: Inappropriate [legacy version] + +Signed-off-by: Alexandru DAMIAN +--- + src/keymap/keyboard-force-release.sh.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/keymap/keyboard-force-release.sh.in b/src/keymap/keyboard-force-release.sh.in +index dd040ce..597a3a6 100755 +--- a/src/keymap/keyboard-force-release.sh.in ++++ b/src/keymap/keyboard-force-release.sh.in +@@ -1,4 +1,4 @@ +-#!@rootprefix@/bin/sh -e ++#!/bin/sh -e + # read list of scancodes, convert hex to decimal and + # append to the atkbd force_release sysfs attribute + # $1 sysfs devpath for serioX +-- +1.7.9.5 + diff --git a/meta/recipes-core/udev/udev/add-install-ptest.patch b/meta/recipes-core/udev/udev/add-install-ptest.patch new file mode 100644 index 0000000000..44365c69e6 --- /dev/null +++ b/meta/recipes-core/udev/udev/add-install-ptest.patch @@ -0,0 +1,73 @@ +Adjustements for ptest: + +- Add 'install-ptest' rule. +- Print a standard result line for each test. +- Replace the use of "tree" with "find". + +Signed-off-by: Björn Stenberg +Signed-off-by: Alexandra Safta +Upstream-status: Pending + +--- a/Makefile.am 2012-03-18 16:28:14.000000000 +0100 ++++ b/Makefile.am 2013-02-18 10:03:36.531101244 +0100 +@@ -708,3 +708,11 @@ + for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done + for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done + for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done ++ ++install-ptest: ++ install test-udev $(DESTDIR) ++ cp Makefile $(DESTDIR) ++ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile ++ $(MKDIR_P) $(DESTDIR)/test ++ (cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test) ++ tar -C $(DESTDIR)/test/ -xJf $(top_srcdir)/test/sys.tar.xz +--- a/test/udev-test.pl 2012-03-18 16:43:36.000000000 +0100 ++++ b/test/udev-test.pl 2013-02-18 10:31:29.706357321 +0100 +@@ -1459,11 +1459,13 @@ + print "add: error"; + if ($rules->{exp_add_error}) { + print " as expected\n"; ++ print "XFAIL: TEST $number: $rules->{desc}: add\n"; + } else { + print "\n"; +- system("tree $udev_root"); ++ system("find $udev_root"); + print "\n"; + $error++; ++ print "FAIL: TEST $number: $rules->{desc}: add\n"; + sleep(1); + } + } +@@ -1479,15 +1481,18 @@ + print "remove: error"; + if ($rules->{exp_rem_error}) { + print " as expected\n"; ++ print "XFAIL: TEST $number: $rules->{desc}: remove\n"; + } else { + print "\n"; +- system("tree $udev_root"); ++ system("find $udev_root"); + print "\n"; + $error++; ++ print "FAIL: TEST $number: $rules->{desc}: remove\n"; + sleep(1); + } + } else { + print "remove: ok\n"; ++ print "PASS: TEST $number: $rules->{desc}: remove\n"; + } + + print "\n"; +--- a/configure.ac 2013-11-28 09:14:02.814248826 +0100 ++++ b/configure.ac 2013-11-28 09:14:34.260874296 +0100 +@@ -6,7 +6,7 @@ + [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html]) + AC_CONFIG_SRCDIR([src/udevd.c]) + AC_CONFIG_AUX_DIR([build-aux]) +-AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects]) ++AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) + AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE + AC_CONFIG_MACRO_DIR([m4]) + diff --git a/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch new file mode 100644 index 0000000000..2c31b33b02 --- /dev/null +++ b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch @@ -0,0 +1,25 @@ +Source: http://cgit.freedesktop.org/systemd/systemd/commit/rules/42-usb-hid-pm.rules?id=e0386cf2809219bbdd30895f46f1f567b56902b6 + +Some USB ports on external hubs may be reported as "fixed". We only want +to auto-enable this on ports that are internal to the machine, so check +the parent state as well. + +Upstream-Status: backport + +Signed-off-by: Nitin A Kamble +2013/09/13 + +Index: udev-182/rules/42-usb-hid-pm.rules +=================================================================== +--- udev-182.orig/rules/42-usb-hid-pm.rules ++++ udev-182/rules/42-usb-hid-pm.rules +@@ -46,4 +46,9 @@ ACTION=="add", SUBSYSTEM=="usb", ATTRS{i + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="14dd", ATTR{idProduct}="0002", TEST=="power/control", ATTR{power/control}="auto" + + # USB HID devices that are internal to the machine should also be safe to autosuspend ++# And skip it for devices which are external but say "fixed" ++ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="removable", GOTO="usb_hid_pm_end" ++ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="unknown", GOTO="usb_hid_pm_end" + ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", ATTRS{removable}=="fixed", TEST=="../power/control", ATTR{../power/control}="auto" ++LABEL="usb_hid_pm_end" ++ diff --git a/meta/recipes-core/udev/udev/devfs-udev.rules b/meta/recipes-core/udev/udev/devfs-udev.rules new file mode 100644 index 0000000000..0ba1ad4e7f --- /dev/null +++ b/meta/recipes-core/udev/udev/devfs-udev.rules @@ -0,0 +1,108 @@ +# The use of these rules is not recommended or supported. +# In a world where devices can come and go at any time, the devfs scheme +# of simple device enumeration does not help _anything_. Just forget about +# it. Use custom rules to name your device or look at the persistent device +# naming scheme, which is implemented for disks and add your subsystem. + +# ide block devices +BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}" + +# md block devices +KERNEL="md[0-9]*", NAME="md/%n" + +# floppy devices +KERNEL="fd[0-9]*", NAME="floppy/%n" + +# tty devices +KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k" +KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k" +KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n" + +# vc devices +KERNEL="vcs", NAME="vcc/0" +KERNEL="vcs[0-9]*", NAME="vcc/%n" +KERNEL="vcsa", NAME="vcc/a0" +KERNEL="vcsa[0-9]*", NAME="vcc/a%n" + +# v4l devices +KERNEL="video[0-9]*", NAME="v4l/video%n" +KERNEL="radio[0-9]*", NAME="v4l/radio%n" +KERNEL="vbi[0-9]*", NAME="v4l/vbi%n" +KERNEL="vtx[0-9]*", NAME="v4l/vtx%n" + +# dm devices (ignore them) +KERNEL="dm-[0-9]*", NAME="" + +# i2c devices +KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k" + +# loop devices +KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k" + +# ramdisks +KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k" + +# framebuffer devices +KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k" + +# misc +KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" +KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" +KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k" +KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" +KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" +KERNEL="uinput", NAME="misc/%k", SYMLINK="%k" + +# alsa devices +KERNEL="controlC[0-9]*", NAME="snd/%k" +KERNEL="hw[CD0-9]*", NAME="snd/%k" +KERNEL="pcm[CD0-9cp]*", NAME="snd/%k" +KERNEL="midi[CD0-9]*", NAME="snd/%k" +KERNEL="timer", NAME="snd/%k" +KERNEL="seq", NAME="snd/%k" + +# oss devices +KERNEL="audio*", NAME="sound/%k", SYMLINK="%k" +KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k" +KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k" +KERNEL="midi*", NAME="sound/%k", SYMLINK="%k" +KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k" +KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k" + +# input devices +KERNEL="mice", NAME="input/%k" +KERNEL="mouse*", NAME="input/%k" +KERNEL="event*", NAME="input/%k" +KERNEL="js*", NAME="input/%k" +KERNEL="ts*", NAME="input/%k" + +# USB devices +KERNEL="hiddev*", NAME="usb/%k" +KERNEL="auer*", NAME="usb/%k" +KERNEL="legousbtower*", NAME="usb/%k" +KERNEL="dabusb*", NAME="usb/%k" +BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k" + +# netlink devices +KERNEL="route", NAME="netlink/%k" +KERNEL="skip", NAME="netlink/%k" +KERNEL="usersock", NAME="netlink/%k" +KERNEL="fwmonitor", NAME="netlink/%k" +KERNEL="tcpdiag", NAME="netlink/%k" +KERNEL="nflog", NAME="netlink/%k" +KERNEL="xfrm", NAME="netlink/%k" +KERNEL="arpd", NAME="netlink/%k" +KERNEL="route6", NAME="netlink/%k" +KERNEL="ip6_fw", NAME="netlink/%k" +KERNEL="dnrtmsg", NAME="netlink/%k" +KERNEL="tap*", NAME="netlink/%k" + +# CAPI devices +KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20" +KERNEL="capi*", NAME="capi/%n" + +# Network devices +KERNEL="tun", NAME="net/%k" + +# raw devices +KERNEL="raw[0-9]*", NAME="raw/%k" diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init new file mode 100644 index 0000000000..410a650bd1 --- /dev/null +++ b/meta/recipes-core/udev/udev/init @@ -0,0 +1,133 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform + (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/meta/recipes-core/udev/udev/links.conf b/meta/recipes-core/udev/udev/links.conf new file mode 100644 index 0000000000..8fff922db6 --- /dev/null +++ b/meta/recipes-core/udev/udev/links.conf @@ -0,0 +1,21 @@ +# This file does not exist. Please do not ask the debian maintainer about it. +# You may use it to do strange and wonderful things, at your risk. + +L fd /proc/self/fd +L stdin /proc/self/fd/0 +L stdout /proc/self/fd/1 +L stderr /proc/self/fd/2 +L core /proc/kcore +L sndstat /proc/asound/oss/sndstat +L MAKEDEV /sbin/MAKEDEV + +D pts +D shm + +# Hic sunt leones. +M ppp c 108 0 +D loop +M loop/0 b 7 0 +D net +M net/tun c 10 200 + diff --git a/meta/recipes-core/udev/udev/local.rules b/meta/recipes-core/udev/udev/local.rules new file mode 100644 index 0000000000..9d4da493f7 --- /dev/null +++ b/meta/recipes-core/udev/udev/local.rules @@ -0,0 +1,22 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Try and modprobe for drivers for new hardware +ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" + +# Create a symlink to any touchscreen input device +# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS, +# has an EV_ABS value (-a) which is used for touchscreen type devices. +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0" diff --git a/meta/recipes-core/udev/udev/permissions.rules b/meta/recipes-core/udev/udev/permissions.rules new file mode 100644 index 0000000000..205b733292 --- /dev/null +++ b/meta/recipes-core/udev/udev/permissions.rules @@ -0,0 +1,131 @@ +ACTION!="add", GOTO="permissions_end" + +# workarounds needed to synchronize with sysfs +# only needed for kernels < v2.6.18-rc1 +ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" +SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt" +# only needed for kernels < 2.6.16 +SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" +# only needed for kernels < 2.6.17 +SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" + +# devices needed to load the drivers providing them +KERNEL=="tun", OPTIONS+="ignore_remove" +KERNEL=="ppp", OPTIONS+="ignore_remove" +KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove" + +# default permissions for block devices +SUBSYSTEM=="block", GROUP="disk" +# the aacraid driver is broken and reports that disks removable (see #404927) +SUBSYSTEM=="block", ATTRS{removable}=="1", \ + DRIVERS!="aacraid", GROUP="floppy" +# all block devices on these buses are "removable" +SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy" + +# IDE devices +KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \ + IMPORT{program}="cdrom_id --export $tempnode" +ENV{ID_CDROM}=="?*", GROUP="cdrom" +KERNEL=="ht[0-9]*", GROUP="tape" +KERNEL=="nht[0-9]*", GROUP="tape" + +# SCSI devices +KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode" +SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape" + +# USB devices +KERNEL=="legousbtower*", MODE="0666" +KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp" + +# usbfs-like devices +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ + MODE="0664" + +# iRiver music players +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \ + ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]" + +# serial devices +SUBSYSTEM=="tty", GROUP="dialout" +SUBSYSTEM=="capi", GROUP="dialout" +SUBSYSTEM=="slamr", GROUP="dialout" +SUBSYSTEM=="zaptel", GROUP="dialout" + +# vc devices (all members of the tty subsystem) +KERNEL=="ptmx", MODE="0666", GROUP="root" +KERNEL=="console", MODE="0600", GROUP="root" +KERNEL=="tty", MODE="0666", GROUP="root" +KERNEL=="tty[0-9]*", GROUP="root" +KERNEL=="pty*", MODE="0666", GROUP="tty" + +# video devices +SUBSYSTEM=="video4linux", GROUP="video" +SUBSYSTEM=="drm", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" +SUBSYSTEM=="em8300", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="nvidia", GROUP="video" + +# misc devices +KERNEL=="random", MODE="0666" +KERNEL=="urandom", MODE="0666" +KERNEL=="mem", MODE="0640", GROUP="kmem" +KERNEL=="kmem", MODE="0640", GROUP="kmem" +KERNEL=="port", MODE="0640", GROUP="kmem" +KERNEL=="full", MODE="0666" +KERNEL=="null", MODE="0666" +KERNEL=="zero", MODE="0666" +KERNEL=="inotify", MODE="0666" +KERNEL=="sgi_fetchop", MODE="0666" +KERNEL=="sonypi", MODE="0666" +KERNEL=="agpgart", GROUP="video" +KERNEL=="nvram", GROUP="nvram" +KERNEL=="rtc|rtc[0-9]*", GROUP="audio" +KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss" +KERNEL=="fuse", GROUP="fuse" +KERNEL=="kqemu", MODE="0666" +KERNEL=="kvm", GROUP="kvm" +KERNEL=="tun", MODE="0666", + +KERNEL=="cdemu[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd", MODE="0644" + +KERNEL=="uverbs*", GROUP="rdma" +KERNEL=="ucm*", GROUP="rdma" +KERNEL=="rdma_ucm", GROUP="rdma" + +# printers and parallel devices +SUBSYSTEM=="printer", GROUP="lp" +SUBSYSTEM=="ppdev", GROUP="lp" +KERNEL=="irlpt*", GROUP="lp" +KERNEL=="pt[0-9]*", GROUP="tape" +KERNEL=="pht[0-9]*", GROUP="tape" + +# sound devices +SUBSYSTEM=="sound", GROUP="audio" + +# ieee1394 devices +KERNEL=="raw1394", GROUP="disk" +KERNEL=="dv1394*", GROUP="video" +KERNEL=="video1394*", GROUP="video" + +# input devices +KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \ + MODE="0664", GROUP="video" +KERNEL=="js[0-9]*", MODE="0664" +KERNEL=="lirc[0-9]*", GROUP="video" + +# AOE character devices +SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" +SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" + +LABEL="permissions_end" + diff --git a/meta/recipes-core/udev/udev/run-ptest b/meta/recipes-core/udev/udev/run-ptest new file mode 100644 index 0000000000..6817ef70e6 --- /dev/null +++ b/meta/recipes-core/udev/udev/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -k check-TESTS \ No newline at end of file diff --git a/meta/recipes-core/udev/udev/run.rules b/meta/recipes-core/udev/udev/run.rules new file mode 100644 index 0000000000..75d71375bb --- /dev/null +++ b/meta/recipes-core/udev/udev/run.rules @@ -0,0 +1,14 @@ +# debugging monitor +RUN+="socket:/org/kernel/udev/monitor" + +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" + +# ignore the events generated by virtual consoles +KERNEL=="ptmx", OPTIONS+="last_rule" +KERNEL=="console", OPTIONS+="last_rule" +KERNEL=="tty" , OPTIONS+="last_rule" +KERNEL=="tty[0-9]*", OPTIONS+="last_rule" +KERNEL=="pty*", OPTIONS+="last_rule" +SUBSYSTEM=="vc", OPTIONS+="last_rule" + diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache new file mode 100644 index 0000000000..db5a513e14 --- /dev/null +++ b/meta/recipes-core/udev/udev/udev-cache @@ -0,0 +1,32 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: udev-cache +# Required-Start: mountall +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: cache /dev to speedup the udev next boot +### END INIT INFO + +export TZ=/etc/localtime + +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -d /sys/class ] || exit 1 + +[ -f /etc/default/rcS ] && . /etc/default/rcS +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache + +if [ "$ROOTFS_READ_ONLY" = "yes" ]; then + [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" + exit 0 +fi + +if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then + echo "Populating dev cache" + (cd /; tar cf "$DEVCACHE" dev) + mv /dev/shm/udev.cache /etc/udev/cache.data +fi + +exit 0 diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default new file mode 100644 index 0000000000..5c4937a9a0 --- /dev/null +++ b/meta/recipes-core/udev/udev/udev-cache.default @@ -0,0 +1,4 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +DEVCACHE="/etc/dev.tar" diff --git a/meta/recipes-core/udev/udev/udev.rules b/meta/recipes-core/udev/udev/udev.rules new file mode 100644 index 0000000000..a19d4a0bf6 --- /dev/null +++ b/meta/recipes-core/udev/udev/udev.rules @@ -0,0 +1,116 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# workaround for devices which do not report media changes +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \ + ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions" +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \ + OPTIONS+="all_partitions" + +# SCSI devices +SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n" + +# USB devices +SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ + ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \ + SYMLINK+="pilot" + +# usbfs-like devices +SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \ + NAME="%c" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}" + +# serial devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi[0-9]*", NAME="capi/%n" + +# video devices +KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \ + NAME="%c" +KERNEL=="card[0-9]*", NAME="dri/%k" + +# misc devices +KERNEL=="hw_random", NAME="hwrng" +KERNEL=="tun", NAME="net/%k" +KERNEL=="evtchn", NAME="xen/%k" + +KERNEL=="cdemu[0-9]*", NAME="cdemu/%n" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n" +KERNEL=="pktcdvd", NAME="pktcdvd/control" + +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode" + +KERNEL=="umad*", NAME="infiniband/%k" +KERNEL=="issm*", NAME="infiniband/%k" +KERNEL=="uverbs*", NAME="infiniband/%k" +KERNEL=="ucm*", NAME="infiniband/%k" +KERNEL=="rdma_ucm", NAME="infiniband/%k" + +# ALSA devices +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" + +# ieee1394 devices +KERNEL=="dv1394*", NAME="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# input devices +KERNEL=="mice", NAME="input/%k" +KERNEL=="mouse[0-9]*", NAME="input/%k" +KERNEL=="event[0-9]*", NAME="input/%k" +KERNEL=="js[0-9]*", NAME="input/%k" +KERNEL=="ts[0-9]*", NAME="input/%k" +KERNEL=="uinput", NAME="input/%k" + +# Zaptel +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zaptimer", NAME="zap/timer" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zap[0-9]*", NAME="zap/%n" + +# AOE character devices +SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k" + +# device mapper creates its own device nodes, so ignore these +KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device" +KERNEL=="device-mapper", NAME="mapper/control" + +KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660" + +# Firmware Helper +ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh" + +# Samsung UARTS +KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n" + +# MXC UARTs +KERNEL=="ttymxc[0-4]", NAME="ttymxc%n" + diff --git a/meta/recipes-core/udev/udev_182.bb b/meta/recipes-core/udev/udev_182.bb new file mode 100644 index 0000000000..d66292ed7a --- /dev/null +++ b/meta/recipes-core/udev/udev_182.bb @@ -0,0 +1,9 @@ +include udev.inc + +PR = "r7" + +# module-init-tools from kmod_git will provide libkmod runtime +DEPENDS += "module-init-tools" + +SRC_URI[md5sum] = "1b964456177fbf48023dfee7db3a708d" +SRC_URI[sha256sum] = "7857ed19fafd8f3ca8de410194e8c7336e9eb8a20626ea8a4ba6449b017faba4" diff --git a/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch new file mode 100644 index 0000000000..fb443ff15e --- /dev/null +++ b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch @@ -0,0 +1,49 @@ +Upstream-Status: Pending + +--- update-rc.d/update-rc.d.org 2005-01-03 00:30:47.000000000 +0200 ++++ update-rc.d/update-rc.d 2007-12-01 19:41:08.000000000 +0200 +@@ -19,6 +19,7 @@ + notreally=0 + force=0 + dostart=0 ++verbose=0 + + usage() + { +@@ -28,6 +29,7 @@ + update-rc.d [-n] [-r ] [-s] start|stop NN runlvl [runlvl] [...] . + -n: not really + -f: force ++ -v: verbose + -r: alternate root path (default is /) + -s: invoke start methods if appropriate to current runlevel + EOF +@@ -69,7 +71,7 @@ + lev=`echo $2 | cut -d/ -f1` + nn=`echo $2 | cut -d/ -f2` + fn="${etcd}${lev}.d/${startstop}${nn}${bn}" +- echo " $fn -> ../init.d/$bn" ++ [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn" + if [ $notreally -eq 0 ]; then + mkdir -p `dirname $fn` + ln -s ../init.d/$bn $fn +@@ -89,7 +91,7 @@ + exit 0 + fi + +- echo " Adding system startup for $initd/$bn ..." ++ echo " Adding system startup for $initd/$bn." + + for i in $startlinks; do + dolink S $i +@@ -105,6 +107,10 @@ + shift + continue + ;; ++ -v) verbose=1 ++ shift ++ continue ++ ;; + -f) force=1 + shift + continue diff --git a/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch new file mode 100644 index 0000000000..075171a5a3 --- /dev/null +++ b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch @@ -0,0 +1,59 @@ +Check if symlinks are valid + +When using root option and $initd/$bn is a symlink, the script would fail because +the symlink points to a path on target. For example: + +/path/to/target/rootfs/etc/init.d/syslog -> /etc/init.d/syslog.busybox + +Hence, [ -f /path/to/target/rootfs/etc/init.d/syslog ] condition would return +false. + +This patch adds the posibility to check whether the file the symlink points to +actually exists in rootfs path and then continue. + +Upstream-Status: Pending + +Signed-off-by: Laurentiu Palcu +Signed-off-by: Christopher Larson + +Index: git/update-rc.d +=================================================================== +--- git.orig/update-rc.d ++++ git/update-rc.d +@@ -147,13 +147,34 @@ fi + bn=$1 + shift + ++sn=$initd/$bn ++if [ -L "$sn" -a -n "$root" ]; then ++ if which readlink >/dev/null; then ++ while true; do ++ linksn="$(readlink "$sn")" ++ if [ -z "$linksn" ]; then ++ break ++ fi ++ ++ sn="$linksn" ++ case "$sn" in ++ /*) sn="$root$sn" ;; ++ *) sn="$initd/$sn" ;; ++ esac ++ done ++ else ++ echo "update-rc.d: readlink tool not present, cannot check whether \ ++ $sn symlink points to a valid file." >&2 ++ fi ++fi ++ + if [ $1 != "remove" ]; then +- if [ ! -f "$initd/$bn" ]; then ++ if [ ! -f "$sn" ]; then + echo "update-rc.d: $initd/$bn: file does not exist" >&2 + exit 1 + fi + else +- if [ -f "$initd/$bn" ]; then ++ if [ -f "$sn" ]; then + if [ $force -eq 1 ]; then + echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2 + else diff --git a/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb new file mode 100644 index 0000000000..50dcaa2d3f --- /dev/null +++ b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb @@ -0,0 +1,30 @@ +SUMMARY = "manage symlinks in /etc/rcN.d" +DESCRIPTION = "update-rc.d is a utilities that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure." +SECTION = "base" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75" + +PR = "r5" + +# Revision corresponding to tag update-rc.d_0.7 +SRCREV = "eca680ddf28d024954895f59a241a622dd575c11" + +SRC_URI = "git://github.com/philb/update-rc.d.git \ + file://add-verbose.patch \ + file://check-if-symlinks-are-valid.patch \ + " + +S = "${WORKDIR}/git" + +inherit allarch + +do_compile() { +} + +do_install() { + install -d ${D}${sbindir} + install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d +} + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc new file mode 100644 index 0000000000..b67620bdbd --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -0,0 +1,270 @@ +SUMMARY = "A suite of basic system administration utilities" +DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \ +commonly found on most Linux systems. Some of the more important utilities include \ +disk partitioning, kernel message management, filesystem creation, and system login." + +SECTION = "base" + +LICENSE = "GPLv2+ & LGPLv2.1+ & BSD" + +LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ + file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \ + file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \ + file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \ + file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \ + file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16" + +inherit autotools gettext pkgconfig systemd ptest +DEPENDS = "zlib ncurses" +DEPENDS_append_class-native = " lzo-native" +DEPENDS_append_class-nativesdk = " lzo-native" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \ + file://MCONFIG \ + file://defines.h \ + file://make_include \ + file://swapargs.h \ + file://ptest.patch \ + file://run-ptest \ + file://avoid_unsupported_find_opts.patch \ + file://avoid_unsupported_grep_opts.patch \ + file://avoid_unsupported_sleep_param.patch \ + file://display_testname_for_subtest.patch \ + " + +PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \ + util-linux-swaponoff util-linux-losetup util-linux-umount \ + util-linux-mount util-linux-readprofile util-linux-libblkid \ + util-linux-libmount util-linux-libuuid util-linux-uuidd \ + util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \ + util-linux-mkfs util-linux-mcookie util-linux-reset \ + util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \ + util-linux-partx ${PN}-bash-completion" + +SHARED_EXTRA_OECONF = "--disable-use-tty-group \ + --disable-makeinstall-chown \ + --enable-kill --enable-last --enable-mesg --enable-partx \ + --enable-raw --enable-reset --disable-login \ + --disable-vipw --disable-newgrp --disable-chfn-chsh \ + --enable-write --enable-mount \ + --enable-libuuid --enable-libblkid --enable-fsck --without-udev \ + usrsbin_execdir='${sbindir}' \ +" + +EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}" + +PACKAGECONFIG_class-target ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ + ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} " +PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," + +# Respect the systemd feature for uuidd +PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir" + +# Build setpriv requires libcap-ng +PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng," + +FILES_${PN}-bash-completion += "${datadir}/bash-completion" +FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" + +FILES_util-linux-agetty = "${base_sbindir}/agetty" +FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}" +FILES_util-linux-fstrim = "${base_sbindir}/fstrim" +FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" +FILES_util-linux-sfdisk = "${sbindir}/sfdisk" +FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}" +FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}" +FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" +FILES_util-linux-mcookie = "${bindir}/mcookie" +FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" +FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}" +FILES_util-linux-uuidgen = "${bindir}/uuidgen" +FILES_util-linux-uuidd = "${sbindir}/uuidd" +FILES_util-linux-reset = "${base_bindir}/reset" +FILES_util-linux-partx = "${sbindir}/partx" + +FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*" +FILES_util-linux-libmount = "${base_libdir}/libmount.so.*" +FILES_util-linux-libuuid = "${base_libdir}/libuuid.so.*" +FILES_util-linux-lscpu = "${bindir}/lscpu" + +FILES_util-linux-fsck = "${base_sbindir}/fsck*" +FILES_util-linux-mkfs = "${sbindir}/mkfs" + +FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" +FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" + + +# Util-linux' blkid replaces the e2fsprogs one +FILES_util-linux-blkid = "${base_sbindir}/blkid*" +RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" +RREPLACES_util-linux-blkid = "e2fsprogs-blkid" + +# reset calls 'tput' +RDEPENDS_util-linux-reset += "ncurses" + +RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup" +RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs " + +RRECOMMENDS_${PN}_class-native = "" +RRECOMMENDS_${PN}_class-nativesdk = "" +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-nativesdk = "" + +RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" + +SYSTEMD_PACKAGES = "${PN}-uuidd" +SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service" + +do_compile () { + set -e + install ${WORKDIR}/MCONFIG ${S}/MCONFIG + install ${WORKDIR}/make_include ${S}/make_include + install ${WORKDIR}/swapargs.h ${S}/mount-deprecated/swapargs.h + install ${WORKDIR}/defines.h ${S}/defines.h + oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}' +} + +do_install () { + # with ccache the timestamps on compiled files may + # end up earlier than on their inputs, this allows + # for the resultant compilation in the install step. + oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \ + 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \ + 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install + + mkdir -p ${D}${base_bindir} + + sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" + sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk readprofile fsck blkid blockdev fstrim" + usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice utmpdump wall setsid chrt flock getopt" + binprogs_a="dmesg kill more umount mount login reset su" + + if [ "${base_sbindir}" != "${sbindir}" ]; then + mkdir -p ${D}${base_sbindir} + for p in $sbinprogs $sbinprogs_a; do + if [ -f "${D}${sbindir}/$p" ]; then + mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" + fi + done + fi + + if [ "${base_bindir}" != "${bindir}" ]; then + mkdir -p ${D}${base_bindir} + for p in $binprogs_a; do + if [ -f "${D}${bindir}/$p" ]; then + mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" + fi + done + fi + + install -d ${D}${sysconfdir}/default/ + echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall + + rm -f ${D}${bindir}/chkdupexe +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root" +ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall" +ALTERNATIVE_${PN} += "setsid chrt flock hwclock utmpdump eject getopt" + +ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" +ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" +ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" +ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" +ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" +ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" +ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix" +ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" +ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" +ALTERNATIVE_TARGET[getopt] = "${bindir}/getopt" + +ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1 reset.1" + +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" +ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" +ALTERNATIVE_LINK_NAME[reset.1] = "${mandir}/man1/reset.1" +ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" +ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" +ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" + +# There seems to be problem, atleast on nslu2, with these, untill they are +# fixed the busybox ones have higher priority +ALTERNATIVE_PRIORITY[hwclock] = "10" +ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" + +ALTERNATIVE_util-linux-fdisk = "fdisk" +ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" + +ALTERNATIVE_util-linux-agetty = "getty" +ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" +ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" + +ALTERNATIVE_util-linux-mount = "mount" +ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" + +ALTERNATIVE_util-linux-umount = "umount" +ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" + +ALTERNATIVE_util-linux-readprofile = "readprofile" +ALTERNATIVE_LINK_NAME[readprofile] = "${base_sbindir}/readprofile" + +ALTERNATIVE_util-linux-losetup = "losetup" +ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" + +ALTERNATIVE_util-linux-swaponoff = "swapoff swapon" +ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" +ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" + +ALTERNATIVE_util-linux-fsck = "fsck.minix fsck" +ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix" +ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" + +ALTERNATIVE_util-linux-blkid = "blkid" +ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" + +ALTERNATIVE_util-linux-reset = "reset" +ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset" +ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset" + +BBCLASSEXTEND = "native nativesdk" + +python do_package_prepend () { + if '--enable-su' in d.getVar('EXTRA_OECONF', True).split(): + alt_name = "su" + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name)) + d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name) +} + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/ts + find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/ + cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected + + list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump" + # The following tests are not installed yet: + # blkid scsi_debug module dependent + # cramfs gcc dependent + # eject gcc dependent + # fdisk scsi_debug module and gcc dependent + # libmount uuidgen dependent + # mount gcc dependant + # partx blkid dependant + for d in $list; do + cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/ + done +} diff --git a/meta/recipes-core/util-linux/util-linux/MCONFIG b/meta/recipes-core/util-linux/util-linux/MCONFIG new file mode 100644 index 0000000000..3fea2c02d7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/MCONFIG @@ -0,0 +1,223 @@ +# MCONFIG -- Configuration stuff for util-linux +# Created: Sat Feb 4 15:50:30 1995 +# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu) + +# For a user-mode install, make (at least) three changes: +# - remove the `-o root' part in INSTALLSUID +# - set USE_TTY_GROUP=no +# - define DESTDIR + +# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips +# Select for CPU i386 if the binaries must be able to run on an intel 386 +# (by default i486 code is generated, see below) +CPU=$(shell uname -m) +ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/') + +# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp +# will use PAM for authentication. Additionally, passwd will not be +# installed as it is not PAM aware. +HAVE_PAM=no + +# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd, +# and vipw will not be built or installed from the login-utils +# subdirectory. +HAVE_SHADOW=yes + +# If HAVE_PASSWD is set to "yes", then passwd will not be built or +# installed from the login-utils subdirectory (but login, chfn, chsh, +# newgrp, and vipw *will* be installed). +HAVE_PASSWD=no + +# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require +# non-root users to enter the account password before updating /etc/passwd. +REQUIRE_PASSWORD=yes +#REQUIRE_PASSWORD=no + +# If you use chsh from this package, ONLY_LISTED_SHELLS will require that +# the selected shell be listed in /etc/shells -- otherwise only a warning is +# printed. This prevents someone from setting their shell to /bin/false. +ONLY_LISTED_SHELLS=yes +#ONLY_LISTED_SHELLS=no + + +# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not +# be built or installed from the login-utils subdirectory. (The shutdown +# and halt that come with the SysVinit package should be used with the init +# found in that package.) +HAVE_SYSVINIT=no + +# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will +# not be built or installed from the login-utils subdirectory. (The +# shutdown and init from the SysVinit package do not depend on the last, +# mesg, and wall from that package.) +HAVE_SYSVINIT_UTILS=no + +# If HAVE_WRITE is set to "yes", then write will not be built or +# installed from the misc-utils subdirectory. +# (There is a network aware write in netwrite from NetKit 0.16 or later.) +HAVE_WRITE=no + +# If HAVE_GETTY is set to "yes", then agetty will not be built or +# installed from the login-utils subdirectory. Note that agetty can +# co-exist with other gettys, so this option should never be used. +HAVE_GETTY=no + +# If USE_TTY_GROUP is set to "yes", then wall and write will be installed +# setgid to the "tty" group, and mesg will only set the group write bit. +# Note that this is only useful if login/xterm/etc. change the group of the +# user's tty to "tty" [The login in util-linux does this correctly, and +# xterm will do it correctly if X is compiled with USE_TTY_GROUP set +# properly.] +USE_TTY_GROUP=no + +# If HAVE_KILL is set to "yes", then kill will not be built or +# installed from the misc-utils subdirectory. +# (There is also a kill in the procps package.) +HAVE_KILL=no + +# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN +# to the current user, allowing her to make a screendump and do other +# nifty things on the console, but also allowing him to keep an open +# file descriptor after logging out to trick the next user. +ALLOW_VCS_USE=yes + +# If HAVE_RESET is set to "yes", then reset won't be installed. The version +# of reset that comes with the ncurses package is less aggressive. +HAVE_RESET=yes + +# If HAVE_SLN is set to "yes", then sln won't be installed +# (but the man page sln.8 will be installed anyway). +# sln also comes with libc and glibc. +HAVE_SLN=no + +# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed. +HAVE_FDUTILS=no + +# If SILENT_PG is set to "yes", then pg will not ring the bell +# when an invalid key is pressed +SILENT_PG=no + +# If configure decides that Native Language Support (NLS) is available, +# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set +# DISABLE_NLS to "yes". +DISABLE_NLS=no + +# Different optimizations for different cpus. +# gcc 3.0 likes options -mcpu=i486 instead of -m486 +ifeq "$(ARCH)" "intel" + ifeq "$(HAVE_OLD_GCC)" "yes" + CPUHEAD=-m + else + CPUHEAD=-mcpu=i + endif + ifeq "$(CPU)" "i386" + CPUTAIL=386 + else + CPUTAIL=486 + endif + CPUOPT= $(CPUHEAD)$(CPUTAIL) + OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer +else + ifeq "$(ARCH)" "arm" + OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer + else + OPT= -O2 -fomit-frame-pointer + endif +endif + +WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes + +LIB=../lib + +ERR_O=$(LIB)/err.o + +# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk) +# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.) +# HAVE_SLANG=yes +# There is a subdirectory /usr/include/slang containing slcurses.h +# SLANGFLAGS=-I/usr/include/slang +# No such subdirectory - slcurses.h lives in /usr/include +# (no extra definition required). +LIBSLANG=-lslang + +# +# Paths used for compilation (not all are actually used, see CFLAGS below) +# +DEV_DIR= /dev +ETC_DIR= /etc +SBIN_DIR= /sbin +USRSBIN_DIR= /usr/sbin +USRLIB_DIR= /usr/lib +USRBIN_DIR= /usr/bin +USRGAMES_DIR= /usr/games +USRSHAREMISC_DIR=/usr/share/misc +LOCALE_DIR= /usr/share/locale +BIN_DIR= /bin +VAR_PATH= /var +LOG_DIR= /var/log +MAN_DIR= /usr/share/man +INFO_DIR= /usr/share/info + +# +# Paths used for install +# +DEVDIR= $(DESTDIR)$(DEV_DIR) +ETCDIR= $(DESTDIR)$(ETC_DIR) +SBINDIR= $(DESTDIR)$(SBIN_DIR) +USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR) +USRLIBDIR= $(DESTDIR)$(USRLIB_DIR) +USRBINDIR= $(DESTDIR)$(USRBIN_DIR) +USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR) +USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR) +LOCALEDIR= $(DESTDIR)$(LOCALE_DIR) +BINDIR= $(DESTDIR)$(BIN_DIR) +VARPATH= $(DESTDIR)$(VAR_PATH) +LOGDIR= $(DESTDIR)$(LOG_DIR) +MANDIR= $(DESTDIR)$(MAN_DIR) +MAN1DIR= $(MANDIR)/man1 +MAN3DIR= $(MANDIR)/man3 +MAN5DIR= $(MANDIR)/man5 +MAN6DIR= $(MANDIR)/man6 +MAN8DIR= $(MANDIR)/man8 +INFODIR= $(DESTDIR)$(INFO_DIR) + +# Directory for shutdown, halt, reboot, etc. +SHUTDOWNDIR= $(SBINDIR) + +# Modes +DIRMODE= 755 +BINMODE= 755 +MANMODE= 644 +DATMODE= 644 +INFOMODE= 644 +SUIDMODE= 4755 + +CHMOD= chmod +INSTALL= install +INSTALLDIR= $(INSTALL) -d -m $(DIRMODE) +INSTALLBIN= $(INSTALL) -m $(BINMODE) +INSTALLMAN= $(INSTALL) -m $(MANMODE) +INSTALLDAT= $(INSTALL) -m $(DATMODE) +INSTALLSUID= $(INSTALL) -m $(SUIDMODE) + +ifeq "$(DISABLE_NLS)" "yes" +NLSFLAGS = -DDISABLE_NLS +endif + +CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \ + $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \ + -D_FILE_OFFSET_BITS=64 \ + -DSBINDIR=\"$(SBIN_DIR)\" \ + -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \ + -DLOGDIR=\"$(LOG_DIR)\" \ + -DVARPATH=\"$(VAR_PATH)\" \ + -DLOCALEDIR=\"$(LOCALE_DIR)\" \ + $(CFLAGS) + + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +%: %.cc + $(CXX) $(CFLAGS) $< -o $@ + diff --git a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch new file mode 100644 index 0000000000..889ed43978 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch @@ -0,0 +1,18 @@ +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +Signed-off-by: Alexandra Safta +Upstream-Status: Pending + +diff -ruN a/configure.ac b/configure.ac +--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200 ++++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200 +@@ -10,7 +10,7 @@ + dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run + dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + AC_USE_SYSTEM_EXTENSIONS +-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests]) + + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch new file mode 100644 index 0000000000..13dc7ddaa1 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch @@ -0,0 +1,38 @@ +Avoid unsupported find options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/tests/run.sh b/tests/run.sh +--- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200 ++++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200 +@@ -91,7 +91,7 @@ + # selected tests only + for s in $SUBTESTS; do + if [ -d "$top_srcdir/tests/ts/$s" ]; then +- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort) + comps="$comps $co" + else + echo "Unknown test component '$s'" +@@ -104,7 +104,7 @@ + exit 1 + fi + +- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) + fi + + +diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config +--- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200 ++++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200 +@@ -32,7 +32,7 @@ + ./configure $opts &> /dev/null + make -j &> /dev/null + +- bins=$(find . -type f -perm /a+x | sort) ++ bins=$(find . -type f -perm -111 | sort) + for b in $bins; do + libs=$(readelf --dynamic $b 2> /dev/null | \ + awk '/NEEDED/ { print $5 }' | \ diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch new file mode 100644 index 0000000000..a0d5efad0f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch @@ -0,0 +1,57 @@ +Avoid unsupported grep options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers +--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200 ++++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200 +@@ -22,35 +22,35 @@ + ts_init "$*" + + ts_log "test: shm headers" +-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: mesg headers" +-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: sem headers" +-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: all headers" +-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT + +-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT + diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch new file mode 100644 index 0000000000..3a6206704a --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch @@ -0,0 +1,20 @@ +Avoid unsupported sleep parameter + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/simple b/simple +--- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200 ++++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200 +@@ -25,9 +25,9 @@ + + $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 & + +-sleep 0.1 ++sleep 1 + echo {0..9} >> $INPUT +-sleep 0.1 ++sleep 1 + + rm -f $INPUT + diff --git a/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch new file mode 100644 index 0000000000..a5b1ff12e5 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch @@ -0,0 +1,23 @@ +util-linux: take ${sbindir} from the environment if it is set there +fix the test, the [ ] syntax was getting eaten by autoconf + +Signed-off-by: Phil Blundell +Signed-off-by: Saul Wold +Upstream-Status: Pending + +diff -ruN a/functions.sh b/functions.sh +--- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200 ++++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200 +@@ -209,7 +209,7 @@ + [ $TS_NSUBTESTS -eq 0 ] && echo + TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 )) + +- printf "%16s: %-27s ..." "" "$TS_SUBNAME" ++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME" + } + + function ts_init { diff --git a/meta/recipes-core/util-linux/util-linux/fix-configure.patch b/meta/recipes-core/util-linux/util-linux/fix-configure.patch new file mode 100644 index 0000000000..cefae97e9c --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/fix-configure.patch @@ -0,0 +1,20 @@ +The userlib_execdir was not getting set correctly, the quoting +was wrong as these quoted items were not getting expanded correctly. + +Upstream-Status: Pending + +Signed-off-by: Saul Wold + +Index: util-linux-2.24.1/configure.ac +=================================================================== +--- util-linux-2.24.1.orig/configure.ac ++++ util-linux-2.24.1/configure.ac +@@ -76,7 +76,7 @@ fi + AC_SUBST([usrsbin_execdir]) + + AS_CASE([$libdir], +- ['${exec_prefix}/'* | '${prefix}/'* | /usr/*], ++ [${exec_prefix}/* | ${prefix}/* | /usr/*], + [usrlib_execdir=$libdir], + [usrlib_execdir='${exec_prefix}'$libdir] + ) diff --git a/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch new file mode 100644 index 0000000000..adb271ce0d --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch @@ -0,0 +1,35 @@ +From 774f55f9dd22c01e4041a183d8dff14811f29114 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Fri, 4 Apr 2014 17:33:04 +0800 +Subject: [PATCH] sys-utils/Makemodule.am: fix parallel build issue + +The rule SETARCH_MAN_LINKS is used for the files under the sys-utils +dir, for example: + +echo ".so man8/setarch.8" > sys-utils/linux32.8 + +but it depends on nothing so that the sys-utils dir may not exist, we +can create the sys-utils dir to fix problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + sys-utils/Makemodule.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am +index 6265282..62ead37 100644 +--- a/sys-utils/Makemodule.am ++++ b/sys-utils/Makemodule.am +@@ -124,6 +124,7 @@ man_MANS += $(SETARCH_MAN_LINKS) + CLEANFILES += $(SETARCH_MAN_LINKS) + + $(SETARCH_MAN_LINKS): ++ $(MKDIR_P) sys-utils + $(AM_V_GEN)echo ".so man8/setarch.8" > $@ + + install-exec-hook-setarch: +-- +1.8.2.1 + diff --git a/meta/recipes-core/util-linux/util-linux/make_include b/meta/recipes-core/util-linux/util-linux/make_include new file mode 100644 index 0000000000..e6abcd91f7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/make_include @@ -0,0 +1,17 @@ +VERSION=2.12 +CC=gcc +CFLAGS= +LDFLAGS= +HAVE_OLD_GCC=yes +HAVE_RAW_H=yes +HAVE_NCURSES=yes +CURSESFLAGS=-DNCH=1 +LIBCURSES=-lncurses +HAVE_TERMCAP=no +NEED_LIBCRYPT=yes +FOREIGN = --foreign-user +HAVE_XGETTEXT=yes +HAVE_OPENPTY=yes +HAVE_PIVOT_ROOT=yes +HAVE_GOOD_RPC=yes +HAVE_ZLIB=yes diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch new file mode 100644 index 0000000000..e9adc90a21 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/ptest.patch @@ -0,0 +1,16 @@ +Define TESTS variable + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/Makefile.am b/Makefile.am +--- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200 ++++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200 +@@ -43,7 +43,7 @@ + dist_usrbin_exec_SCRIPTS = + systemdsystemunit_DATA = + check_PROGRAMS = +-TESTS = ++TESTS = $(check_PROGRAMS) + + PATHFILES = diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest new file mode 100644 index 0000000000..b04f14a835 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh + +cd tests || exit 1 +sh ./run.sh 2>&1 | { + sed '{ + s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ + s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ + s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/ + }' +} diff --git a/meta/recipes-core/util-linux/util-linux/swapargs.h b/meta/recipes-core/util-linux/util-linux/swapargs.h new file mode 100644 index 0000000000..e960eef05f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/swapargs.h @@ -0,0 +1,3 @@ +#define SWAPON_HAS_TWO_ARGS +#include +#include diff --git a/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch new file mode 100644 index 0000000000..5031a7313e --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch @@ -0,0 +1,32 @@ +configure should include errno.h instead of argp.h when +checking for presence of program_invocation_short_name +uclibc defines this to be const char* unlike util-linux-ng +which defines this to be char* so this error goes unnoticed +on glibc/eglibc systems. + +here is the error it fixes + +in file included from mountP.h:14:0, + from cache.c:29: +/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname' +../../../include/c.h:118:14: note: previous declaration of '__progname' was here +make[3]: *** [cache.lo] Error 1 + + +Signed-off-by: Khem Raj +Signed-off-by: Jonathan Liu + +Upstream-Status: Pending +Index: util-linux-2.22.1/configure.ac +=================================================================== +--- util-linux-2.22.1.orig/configure.ac ++++ util-linux-2.22.1/configure.ac +@@ -372,7 +372,7 @@ esac + + AC_MSG_CHECKING([whether program_invocation_short_name is defined]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +- #include ++ #include + ]], [[ + program_invocation_short_name = "test"; + ]])], [ diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch new file mode 100644 index 0000000000..1707683a26 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch @@ -0,0 +1,34 @@ +From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Wed, 26 Mar 2014 01:30:29 +0000 +Subject: [PATCH] sun.c: use qsort() to instead of qsort_r() + +qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on +the host like CentOS 5.x. + +Upstream-Status: Inappropriate [Other] + +Signed-off-by: Robert Yang +--- + libfdisk/src/sun.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c +index e73c701..f7899ec 100644 +--- a/libfdisk/src/sun.c ++++ b/libfdisk/src/sun.c +@@ -427,9 +427,8 @@ static int sun_verify_disklabel(struct fdisk_context *cxt) + else + array[i] = -1; + } +- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]), +- (int (*)(const void *,const void *,void *)) verify_sun_cmp, +- verify_sun_starts); ++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]), ++ (int (*)(const void *,const void *)) verify_sun_cmp); + + if (array[0] == -1) { + fdisk_info(cxt, _("No partitions defined.")); +-- +1.8.2.1 + diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch new file mode 100644 index 0000000000..afe543c6e8 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch @@ -0,0 +1,73 @@ +Support older hosts with latest util-linux-native + +mkostemp is not defined on older machines. So we detect this and +provide a define that uses mkstemp instead. + +O_CLOEXEC is not defined on older machines. It is however defined +in the 'c.h' header. Fix up the users to include 'c.h'. + +fdisks/fdisksunlabel.c was modified to use qsort_r, however +this is not defined on older hosts. Revert: + commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698 + fdisk: (sun): use ask API, remove global variable + +Upstream-Status: Inappropriate [other] +Patches revert upstream changes in order to support older +machines. + +Signed-off-by: Mark Hatle + +Index: util-linux-2.24.1/configure.ac +=================================================================== +--- util-linux-2.24.1.orig/configure.ac ++++ util-linux-2.24.1/configure.ac +@@ -302,6 +302,7 @@ AC_CHECK_FUNCS([ \ + llseek \ + lseek64 \ + mempcpy \ ++ mkostemp \ + nanosleep \ + personality \ + posix_fadvise \ +Index: util-linux-2.24.1/include/c.h +=================================================================== +--- util-linux-2.24.1.orig/include/c.h ++++ util-linux-2.24.1/include/c.h +@@ -236,6 +236,13 @@ static inline int dirfd(DIR *d) + #endif + + /* ++ * mkostemp replacement ++ */ ++#ifndef HAVE_MKOSTEMP ++#define mkostemp(template, flags) mkstemp(template) ++#endif ++ ++/* + * MAXHOSTNAMELEN replacement + */ + static inline size_t get_hostname_max(void) +Index: util-linux-2.24.1/lib/randutils.c +=================================================================== +--- util-linux-2.24.1.orig/lib/randutils.c ++++ util-linux-2.24.1/lib/randutils.c +@@ -16,6 +16,7 @@ + #include + + #include "randutils.h" ++#include "c.h" + + #ifdef HAVE_TLS + #define THREAD_LOCAL static __thread +Index: util-linux-2.24.1/lib/wholedisk.c +=================================================================== +--- util-linux-2.24.1.orig/lib/wholedisk.c ++++ util-linux-2.24.1/lib/wholedisk.c +@@ -10,6 +10,7 @@ + + #include "blkdev.h" + #include "wholedisk.h" ++#include "c.h" + + int is_whole_disk_fd(int fd, const char *name) + { diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch new file mode 100644 index 0000000000..5773d7ea1b --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch @@ -0,0 +1,27 @@ +Upstream-Status: Inappropriate [embedded specific] + +The FHS indicates that /etc must be capable of being mounted R/O. + +The FHS also indicates that lock files belong in /var/lock, and /var must +be R/W as soon as possible during boot. + +This patch moves the mtab lock file from the potentially R/O /etc, to the +R/W /var/lock area. This lock file is used when mounting disks and making +other mount adjustments. The _PATH_MOUNTED_TMP is not adjusted, as failing +to write to this file does not cause any functional limitations. + +(Note, if /etc is R/O, then /etc/mtab should be a symlink to /proc/mounts) + +Signed-off-by: Mark Hatle + +--- util-linux-ng-2.16/include/pathnames.h.orig ++++ util-linux-ng-2.16/include/pathnames.h +@@ -90,7 +90,7 @@ + # endif + #endif + +-#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~" ++#define _PATH_MOUNTED_LOCK "/var/lock/mtab~" + #define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp" + + #ifndef _PATH_DEV diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch new file mode 100644 index 0000000000..f131b763ca --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch @@ -0,0 +1,27 @@ +Upstream-Status: Pending + +Index: util-linux-2.22.1/login-utils/login.c +=================================================================== +--- util-linux-2.22.1.orig/login-utils/login.c ++++ util-linux-2.22.1/login-utils/login.c +@@ -1239,6 +1239,8 @@ int main(int argc, char **argv) + char *buff; + int childArgc = 0; + int retcode; ++ struct sigaction act; ++ + + char *pwdbuf = NULL; + struct passwd *pwd = NULL, _pwd; +@@ -1252,7 +1254,10 @@ int main(int argc, char **argv) + timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT); + + signal(SIGALRM, timedout); +- siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioclt() */ ++ (void) sigaction(SIGALRM, NULL, &act); ++ act.sa_flags &= ~SA_RESTART; ++ sigaction(SIGALRM, &act, NULL); ++ + alarm(timeout); + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); diff --git a/meta/recipes-core/util-linux/util-linux_2.24.1.bb b/meta/recipes-core/util-linux/util-linux_2.24.1.bb new file mode 100644 index 0000000000..d5356e182b --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux_2.24.1.bb @@ -0,0 +1,31 @@ +MAJOR_VERSION = "2.24" +require util-linux.inc + +# To support older hosts, we need to patch and/or revert +# some upstream changes. Only do this for native packages. +OLDHOST = "" +OLDHOST_class-native = "file://util-linux-native.patch \ + file://util-linux-native-qsort.patch \ + " + +SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \ + file://util-linux-ng-2.16-mount_lock_path.patch \ + file://uclibc-__progname-conflict.patch \ + file://configure-sbindir.patch \ + file://fix-configure.patch \ + file://fix-parallel-build.patch \ + file://avoid_parallel_tests.patch \ + ${OLDHOST} \ +" + +SRC_URI[md5sum] = "88d46ae23ca599ac5af9cf96b531590f" +SRC_URI[sha256sum] = "835eb6232cfab0118ef2e4fd649de0ba9f5bd1b8cbf9a7d4d84594541dec8410" + +CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" + +EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \ + --disable-fallocate --disable-use-tty-group \ +" +EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \ + --disable-fallocate --disable-use-tty-group \ +" diff --git a/meta/recipes-core/zlib/site_config/headers b/meta/recipes-core/zlib/site_config/headers new file mode 100644 index 0000000000..50268918aa --- /dev/null +++ b/meta/recipes-core/zlib/site_config/headers @@ -0,0 +1 @@ +zlib.h diff --git a/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch new file mode 100644 index 0000000000..61eea8238a --- /dev/null +++ b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch @@ -0,0 +1,38 @@ +Add 'ptest' target to Makefile, to run tests without checking dependencies. + +Signed-off-by: Anders Roxell +Upstream-Status: Pending +--- +diff -uNr a/Makefile.in b/Makefile.in +--- a/Makefile.in 2013-06-10 13:48:14.321959162 +0200 ++++ b/Makefile.in 2013-06-10 13:49:36.686476448 +0200 +@@ -83,6 +83,9 @@ + test: all teststatic testshared + + teststatic: static ++ @make runteststatic ++ ++runteststatic: + @TMPST=tmpst_$$; \ + if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \ + echo ' *** zlib test OK ***'; \ +@@ -92,6 +95,9 @@ + rm -f $$TMPST + + testshared: shared ++ @make runtestshared ++ ++runtestshared: + @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \ + DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ +@@ -105,6 +111,9 @@ + rm -f $$TMPSH + + test64: all64 ++ @make runtestall64 ++ ++runtestall64: + @TMP64=tmp64_$$; \ + if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ + echo ' *** zlib 64-bit test OK ***'; \ diff --git a/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch new file mode 100644 index 0000000000..403b4825c9 --- /dev/null +++ b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch @@ -0,0 +1,20 @@ + +When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache +(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call +touch */libstdc++.so && /sbin/ldconfig to fix it. + +So remove ldconfig call from make install-libs + +Upstream-Status: Inappropriate [disable feature] + +diff -uNr zlib-1.2.6.orig/Makefile.in zlib-1.2.6/Makefile.in +--- zlib-1.2.6.orig/Makefile.in 2012-01-28 23:48:50.000000000 +0100 ++++ zlib-1.2.6/Makefile.in 2012-02-13 15:38:20.577700723 +0100 +@@ -199,7 +199,6 @@ + rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ +- ($(LDCONFIG) || true) >/dev/null 2>&1; \ + fi + cp zlib.3 $(DESTDIR)$(man3dir) + chmod 644 $(DESTDIR)$(man3dir)/zlib.3 diff --git a/meta/recipes-core/zlib/zlib-1.2.8/run-ptest b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest new file mode 100644 index 0000000000..884d9dc699 --- /dev/null +++ b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runteststatic runtestshared | sed -r -e 's/^(\s+\*+ (.+?) test OK \*+)/\1\nPASS: \2/' -e 's/^(\s+\*+ (.+?) test FAILED \*+)/\1\nFAIL: \2/' diff --git a/meta/recipes-core/zlib/zlib_1.2.8.bb b/meta/recipes-core/zlib/zlib_1.2.8.bb new file mode 100644 index 0000000000..bdfa045b7b --- /dev/null +++ b/meta/recipes-core/zlib/zlib_1.2.8.bb @@ -0,0 +1,60 @@ +SUMMARY = "Zlib Compression Library" +DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \ +library which is used by many different programs." +HOMEPAGE = "http://zlib.net/" +SECTION = "libs" +LICENSE = "Zlib" +LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd" + + +SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \ + file://remove.ldconfig.call.patch \ + file://Makefile-runtests.patch \ + file://run-ptest \ + " + +SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37" +SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057" + +RDEPENDS_${PN}-ptest += "make" + +inherit ptest + +do_configure (){ + ./configure --prefix=${prefix} --shared --libdir=${libdir} +} + +do_compile (){ + oe_runmake +} + +do_compile_ptest() { + oe_runmake static shared +} + +do_install() { + oe_runmake DESTDIR=${D} install +} + +do_install_ptest() { + install ${B}/Makefile ${D}${PTEST_PATH} + install ${B}/example ${D}${PTEST_PATH} + install ${B}/minigzip ${D}${PTEST_PATH} + install ${B}/examplesh ${D}${PTEST_PATH} + install ${B}/minigzipsh ${D}${PTEST_PATH} +} + +# We move zlib shared libraries for target builds to avoid +# qa warnings. +# +do_install_append_class-target() { + if [ ${base_libdir} != ${libdir} ] + then + mkdir -p ${D}/${base_libdir} + mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir} + tmp=`readlink ${D}/${libdir}/libz.so` + ln -sf ../../${base_libdir}/$tmp ${D}/${libdir}/libz.so + fi +} + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf