diff options
author | Amadeusz Żołnowski <aidecoe@gentoo.org> | 2015-06-02 09:34:05 +0000 |
---|---|---|
committer | Amadeusz Żołnowski <aidecoe@gentoo.org> | 2015-06-02 09:34:05 +0000 |
commit | f2b3ed5843b15fb31b4c9494767c2c26935cb0dd (patch) | |
tree | 04aaa2b6bcd81c78e623eca5de6cca7c197bada0 /sys-kernel | |
parent | Version bump (diff) | |
download | historical-f2b3ed5843b15fb31b4c9494767c2c26935cb0dd.tar.gz historical-f2b3ed5843b15fb31b4c9494767c2c26935cb0dd.tar.bz2 historical-f2b3ed5843b15fb31b4c9494767c2c26935cb0dd.zip |
Make dracut tools compile on musl. Fix bug #550204.
Package-Manager: portage-2.2.20/cvs/Linux x86_64
Manifest-Sign-Key: 0xF0134531E1DBFAB5
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/dracut/ChangeLog | 8 | ||||
-rw-r--r-- | sys-kernel/dracut/Manifest | 18 | ||||
-rw-r--r-- | sys-kernel/dracut/dracut-041-r3.ebuild | 279 | ||||
-rw-r--r-- | sys-kernel/dracut/files/041-r2-0004-Portability-fixes.patch | 63 |
4 files changed, 359 insertions, 9 deletions
diff --git a/sys-kernel/dracut/ChangeLog b/sys-kernel/dracut/ChangeLog index abb6a41a40f3..d9bf847012a7 100644 --- a/sys-kernel/dracut/ChangeLog +++ b/sys-kernel/dracut/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-kernel/dracut # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.190 2015/03/31 10:54:29 aidecoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.191 2015/06/02 09:34:01 aidecoe Exp $ + +*dracut-041-r3 (02 Jun 2015) + + 02 Jun 2015; Amadeusz Żołnowski <aidecoe@gentoo.org> +dracut-041-r3.ebuild, + +files/041-r2-0004-Portability-fixes.patch: + Make dracut tools compile on musl. Fix bug #550204. 31 Mar 2015; Amadeusz Żołnowski <aidecoe@gentoo.org> dracut-040-r3.ebuild, dracut-041.ebuild, dracut-041-r2.ebuild: diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest index ad26d868267a..9aa1455ec301 100644 --- a/sys-kernel/dracut/Manifest +++ b/sys-kernel/dracut/Manifest @@ -29,6 +29,7 @@ AUX 041-0005-Take-into-account-lib64-dirs-when-dete.patch 1877 SHA256 9f0ddd9dc3 AUX 041-r2-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch 2410 SHA256 31f7ef0e7837f7f3977c29eb6102beb238e170edbdbbe0da0c9e0893424a22b7 SHA512 98e3ceaf1ad196ca951ef48aae5dae6eb4ee2eb603d7d842fd134c24713bceb9732efc5924670abd32409c82c6a1cec60b24da1353fd7846f1af475008dccabc WHIRLPOOL 847df267c421d01a220816e803802394e321a75f9b0130209844e717e1692e38961108590f2148e2a57737150c27a94ebd78b5d7c2ec9c5a5d5816348aa18a52 AUX 041-r2-0002-Install-dracut-install-and-skipcpio-in.patch 4255 SHA256 b32c724c08daefa3886e11a5b098da6ef66039ef01378ea24beb52b81cd61b83 SHA512 cc6b09811729b177885600c7c5de061051e8b15ee190396665e705d086f723b28c0b4b892ba1faee645765b364361b03d6f70c1039b48b745c6c50d82e090db6 WHIRLPOOL d8e7ca8444fe61e293947b347e31cd96110f1b25aa8a997cca9cf7f45cee44820d1bb2902dfd46b67c3f8c74bed2d78a37132ed8a91ad75eee2c152077551840 AUX 041-r2-0003-Take-into-account-lib64-dirs-when-dete.patch 2028 SHA256 2726bd4eea86017fb443ed1375408a64c01e1070702c14c349bcd0a5e276eacb SHA512 b71a9c884974b22389370ca3c72fad7dccb3ce3f80fcca230e47b68928bf5ed388707433d9093277bfc2a9d20f261d2abe1ecd639ebd147582bd6a6792cacfe4 WHIRLPOOL c02d50137b5a5d21c530a20e2e04c08dfd53b2c6ead6f4f976b10aaf2cb3f472590435ee9c1e619bfaa354c34a950b1b7bec41699c72903df566024f2a30a47d +AUX 041-r2-0004-Portability-fixes.patch 1960 SHA256 4fcae04bd5eb6ec378347d7d3774e1901326a49ceb291b28ff2ce3bcafc1be8f SHA512 89171c41769e71997897c90390c8667a26f171a9a049b5bffda3a8635c0c3e4feef56e0647624d89fbf22a115f35d0829e1ded9d813156111cc7d18ff6eacc1a WHIRLPOOL a23467d7dfa1ad4befd73b1333ee24f61ad2bdda247122debcfc0cd9185384dd82b3d64f885695a31cf5d2167ce81535075a145582a0e7b99de9095f689be645 DIST 034-0010-module-setup.sh-add-comments.patch.bz2 6424 SHA256 fbcb940c83e362cc93a78c5be28ffd7c794a331f992498e451d69c1830f054fa SHA512 e5e41b8696716c5284ea981ae85dbe688c5c31330e400c79f4ba46890939dffdd7744e4a85d27d074987a8db65114332171af0a5471338e3e4bed19d54edc6fd WHIRLPOOL c5d29ef2f20aa752e57180be35a2014c214a25e4e49d3f623d05cd6ef1debd2cec38d24453ecb0c004cdbb52239f0d541ddc9df065ab84fb7d62c30594704347 DIST dracut-034.tar.bz2 277692 SHA256 48c7fd57e287d4f34dfff5b5ead14a4511926858f1e2ffaa40b762f257516d7f SHA512 ae06510668e63550d4d6b509b314c7668880387cfe696fc7f21cf04cc488be743440871dbd1fcf4e8314f9aa9e61ee3e78a42a75631123c420767677c6744e34 WHIRLPOOL 0412dea239fbd82d79e873869211ea31b7495dac74d7079e8aa52dd8d2484986fd0a0831aefffe29cfe5acfbf64fa01a9a1fa742192a28276a8671b663a69e13 DIST dracut-040.tar.xz 263944 SHA256 b6e743353804b46e350177b9ecb9a8511df7e8c4ff9e0b4f3b4f72bc509c98a3 SHA512 6bc6a714572cc18c4cf9f9c1af4bc787287554ead1e39fbec8a1b8986585cf8c7c7ef476f87fc361f565eb344fe2594d63185ffe02cc5fa7cc3eaa03bcb4b72b WHIRLPOOL d8dbdbf6cb7705a0b7793f82a0323c49b4ac0dc3d61cf0073e3061f34af0b5c92dd21a7dc080f2a8d24d3eef3abc99df91f113675721267352f934f1319c66ba @@ -36,17 +37,18 @@ DIST dracut-041.tar.xz 268288 SHA256 8ece6c2240bf0e9283e5f717b65dfcd6830b3ef7f8d EBUILD dracut-034-r4.ebuild 10446 SHA256 80ab338aeeadb2fbd62f2ecfd61b35ea79acabbda0f927af1e28523e166ba092 SHA512 c8a0190f302d986f808886e5e2846f094c62a3c6d8073559237b54d1f3e70334db3f0b6eace31e6b57825dab3a261a2e6c23fad542a54a04fd7938dade3f2c4b WHIRLPOOL 3ea152d45dad874279424f38c67eafb4c30f9d61fdc23a9256178aea6268ad4be68ebac193839e0c6f9f66ca47305f6d1eb637862bc710dbb2ee3403aac0dbb5 EBUILD dracut-040-r3.ebuild 8014 SHA256 a40b8c18005d1192dfc7de5d7be3dff69ea06af527f4fd924713320a01916c7a SHA512 331770cab521efeef3502667fbb4f206cf31acb5dea0bc0dff93d5264c12053a917bcdd62827d7839b2314a0928497237311744b5f3aef8ef215bc838d250c7b WHIRLPOOL 20d99a72f854527e2ab30b103650b9ca046bc55d1781651bd8bf1461435ff82f3f9f90c61343f81b56c9a4ccbc2b47d95922e45175ccff91a7edcb7fb516391b EBUILD dracut-041-r2.ebuild 7957 SHA256 5dd05ea31707651b8ae322e9ebfc8846c212682246f12164e1a35235a9e7bbe9 SHA512 5dba976f8a0c41f1ecb31bad6f156b4030554c2f9e7d556ce3871beb126795a448a63e44a565600efe7d3580d4e86cf076135562aa98d9b4598cba6b411a4fa2 WHIRLPOOL beb4b77b525abfda492eb472f46a04ee903dedef2d3b66f2dd8201a387f8ee594a468dcb229caf43776d04c4bb5cec970a31412d4e3b3b7998f140a926e3d532 +EBUILD dracut-041-r3.ebuild 8008 SHA256 8f3f76b1ebacac2d62256883fb697bae10e98323f1fb7c2d74c436189eba01a9 SHA512 fd378f94cdfe4c0164823798ac84a574c4c7f1ad780871ecf301e248b5510427cda24797c042af139964c77a25bccf666633a0703b5501c2c5294f0a6391697b WHIRLPOOL 9b9d13f9920885ba1e1e08763151f33d5d9244718c7705409f7cbf1279a86473124050446bdb89c1a91da8f5996ecf8cfe3d62e6636c7a3d48855a3133b5d455 EBUILD dracut-041.ebuild 7960 SHA256 6ed7035163b4671020c3836c0461d60262e774d8ef7e8d6f7ca016df13e6b2e8 SHA512 0c00da4b1db0f340f85418cf6d5418bccb6c68e0007b2a60e6e48735dc11172fafc4f95a87fbc88c5f06e550034ea48e0129fac09cf52d0dc5998d828ce5e655 WHIRLPOOL 13bd88f0aded8ae2f26e5318e02cf1a431f875414ec2194130f9a65c01f70ca2c10fe8fc116960ba8ad634df409d1edca679849a7762b5ec3b209a9346530782 -MISC ChangeLog 82213 SHA256 f7dd66d1c88102a0a0eb0924bbfe9e34b6aeeef6e6eac270daf1e5f3b90c70e1 SHA512 9d77ea255926a4246fc27bd75a3445edd4d6a20f604f14a8f11ff929fb8ee30d28898eeef010046f85f827e20ef950f625a1fc2bd33b0512795ab4b4672a82b3 WHIRLPOOL fc92a459afd81534cfe6ef9268031d42ee3ecb07ceba406430704280e77b6a2fd8729ff6dd056c10d67738d04074430cd3c3c1c23600dd7f334173249061b8f1 +MISC ChangeLog 82424 SHA256 e866c431d608d3daf402c33b6aba4fc2516ab58c237d23fa29d5a14a2c672dd6 SHA512 9f24f14854dcbeb2210d0e04b4fb6c1adca4f9f5b2906c83857af36a2f6a2370e8f82406bae509362f46ce7bd10848c44cfd966827c83890e5fb79d278eb49de WHIRLPOOL 635d19b92cdaa686707d819742d01d628339f4482bbd95293bab5252891e29bde036dd4f46c7440be99576154e97c65c5c8189b40b8e60f27dc1708f8b5734bd MISC metadata.xml 906 SHA256 5f19b725d0669877fdd7814634b7aa7dd73331459bace52de02908417b833c3f SHA512 c5838d36080528d541b67cb38de17cc2351f7e5e17ab060c58f037792225ea223ade6b7e69376f4a9256b0bb3dcf4de578dcd50ee1c7d04a3f3288ca3c1ada43 WHIRLPOOL 532ea421fab965094820d5c0961a00ca38c858461f572a0cd4a145aa90340a569ee942062338ae03773c2709a08e4882f3176333aa5383b7e3c467cb01c0874d -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQEcBAEBCAAGBQJVGnzmAAoJEPATRTHh2/q1CO4H/2LUe0yG7yNb+kGmL3S3eu5D -7Pkt6CGhFXoSy0oyhMJe35ck2ydti9ylSGPyeFaC6xjM/RflBc4P/IZE7UnaConr -Bs2nUB6HjFqBFaxskmr0a2hnyR3CAtNb6crPfk2r+ki1Of0f7OP7J1juNcOf1lN3 -OE7QIs/21qa93UFDQGj9l6r2eAV1vPrdw9evceN/vTOWMI0DH/RwFMkkzf75xmvE -LIF2gpaQQCA2xYHCOInlY4H4PGB9XP9zsN3bx/t1v1GRfeLDQE2LaVWI3mEQfqJx -H7sQB6hrdGFAu3LEQVbrd0E3cTRKeO001u48HQ8JZZvy9LqRqVHnTzky0kLMMYQ= -=Vh9j +iQEcBAEBCAAGBQJVbXiKAAoJEPATRTHh2/q1weEH/i44M5X3MBHvYY1FUFqndenT +oIoGErtdJUf8mLK5smK4ISzBL0TdF0OXcmOnVwKRK0cBU60S7LAASf1BSosGTkt+ +sExzFGl/6UfN4z+04C/pugnqHocpOR0zB5udVpxV0Yh82F0lPz04W8DRVSfB9Lrr +iz9Mn3z8Oy3sicyHI9HFQ8fr/eKz9JGnQYdUhCiPNspS5g2LnAk3pXe9EQY7XF+N +nIOXMzTlfQo6oOHODPgADB+1yv+Qo38EZY+vNdAtbKwxbJspKkh7ih5VeOSd5KIV +rDtboRlOE0iqSLdBHH5uRIM9VREcinI94o//Cb9cnGgkmpaPNjM9MwUOKD7MWaM= +=OHkf -----END PGP SIGNATURE----- diff --git a/sys-kernel/dracut/dracut-041-r3.ebuild b/sys-kernel/dracut/dracut-041-r3.ebuild new file mode 100644 index 000000000000..40d50ffc7fc1 --- /dev/null +++ b/sys-kernel/dracut/dracut-041-r3.ebuild @@ -0,0 +1,279 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-041-r3.ebuild,v 1.1 2015/06/02 09:34:01 aidecoe Exp $ + +EAPI=4 + +inherit bash-completion-r1 eutils linux-info multilib systemd + +DESCRIPTION="Generic initramfs generation tool" +HOMEPAGE="http://dracut.wiki.kernel.org" +SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="debug selinux systemd" + +RESTRICT="test" + +CDEPEND="virtual/udev + systemd? ( >=sys-apps/systemd-199 ) + " +RDEPEND="${CDEPEND} + app-arch/cpio + >=app-shells/bash-4.0 + >sys-apps/kmod-5[tools] + || ( + >=sys-apps/sysvinit-2.87-r3 + sys-apps/systemd[sysv-utils] + sys-apps/systemd-sysv-utils + ) + >=sys-apps/util-linux-2.21 + + debug? ( dev-util/strace ) + selinux? ( + sys-libs/libselinux + sys-libs/libsepol + sec-policy/selinux-dracut + ) + " +DEPEND="${CDEPEND} + app-text/asciidoc + >=dev-libs/libxslt-1.1.26 + app-text/docbook-xml-dtd:4.5 + >=app-text/docbook-xsl-stylesheets-1.75.2 + virtual/pkgconfig + " + +DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules + README.testsuite TODO ) +MY_LIBDIR=/usr/lib +PATCHES=( + "${FILESDIR}/${PVR}-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch" + "${FILESDIR}/${PVR}-0002-Install-dracut-install-and-skipcpio-in.patch" + "${FILESDIR}/${PVR}-0003-Take-into-account-lib64-dirs-when-dete.patch" + "${FILESDIR}/${PVR}-0004-Portability-fixes.patch" + ) +QA_MULTILIB_PATHS=" + usr/lib/dracut/dracut-install + usr/lib/dracut/skipcpio + " + +# +# Helper functions +# + +# Removes module from modules.d. +# $1 = module name +# Module name can be specified without number prefix. +rm_module() { + local force m + [[ $1 = -f ]] && force=-f + + for m in $@; do + if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then + rm ${force} --interactive=never -r "${modules_dir}"/$m + else + rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m + fi + done +} + +# Grabbed from net-misc/netctl ebuild. +optfeature() { + local desc=$1 + shift + while (( $# )); do + if has_version "$1"; then + elog " [I] $1 to ${desc}" + else + elog " [ ] $1 to ${desc}" + fi + shift + done +} + +# +# ebuild functions +# + +src_prepare() { + epatch "${PATCHES[@]}" + + local libdirs="/$(get_libdir) /usr/$(get_libdir)" + if [[ ${SYMLINK_LIB} = yes ]]; then + # Preserve lib -> lib64 symlinks in initramfs + [[ $libdirs =~ /lib\ ]] || libdirs+=" /lib /usr/lib" + fi + einfo "Setting libdirs to \"${libdirs}\" ..." + sed -e "3alibdirs=\"${libdirs}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + + local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)" + einfo "Setting udevdir to ${udevdir}..." + sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + + if use systemd; then + local systemdutildir="$(systemd_get_utildir)" + local systemdsystemunitdir="$(systemd_get_unitdir)" + local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \ + --variable=systemdsystemconfdir)" + [[ ${systemdsystemconfdir} ]] \ + || systemdsystemconfdir=/etc/systemd/system + einfo "Setting systemdutildir to ${systemdutildir} and ..." + sed -e "5asystemdutildir=\"${systemdutildir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..." + sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..." + sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + else + local systemdutildir="/lib/systemd" + einfo "Setting systemdutildir for standalone udev to" \ + "${systemdutildir}..." + sed -e "5asystemdutildir=\"${systemdutildir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + fi + + epatch_user +} + +src_configure() { + local myconf="--libdir=${MY_LIBDIR}" + myconf+=" --bashcompletiondir=$(get_bashcompdir)" + + if use systemd; then + myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'" + fi + + econf ${myconf} +} + +src_compile() { + tc-export CC + emake doc install/dracut-install skipcpio/skipcpio +} + +src_install() { + default + + local my_libdir="${MY_LIBDIR}" + local dracutlibdir="${my_libdir#/}/dracut" + + echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh" + + insinto "${dracutlibdir}/dracut.conf.d/" + newins dracut.conf.d/gentoo.conf.example gentoo.conf + + insinto /etc/logrotate.d + newins dracut.logrotate dracut + + dodir /var/lib/dracut/overlay + + dohtml dracut.html + + if ! use systemd; then + # Scripts in kernel/install.d are systemd-specific + rm -r "${D%/}/${my_libdir}/kernel" || die + fi + + # + # Modules + # + local module + modules_dir="${D%/}/${dracutlibdir}/modules.d" + + use debug || rm_module 95debug + use selinux || rm_module 98selinux + + if use systemd; then + # With systemd following modules do not make sense + rm_module 96securityfs 97masterkey 98integrity + else + rm_module 98systemd + # Without systemd following modules do not make sense + rm_module 00systemd-bootchart + fi + + # Remove modules which won't work for sure + rm_module 95fcoe # no tools + # fips module depends on masked app-crypt/hmaccalc + rm_module 01fips 02fips-aesni +} + +pkg_postinst() { + if linux-info_get_any_version && linux_config_src_exists; then + ewarn "" + ewarn "If the following test report contains a missing kernel" + ewarn "configuration option, you should reconfigure and rebuild your" + ewarn "kernel before booting image generated with this Dracut version." + ewarn "" + + local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS" + + # Kernel configuration options descriptions: + local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev" + local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\ +"(initramfs/initrd) support" + + local opt desc + + # Generate ERROR_* variables for check_extra_config. + for opt in ${CONFIG_CHECK}; do + opt=${opt#\~} + desc=desc_${opt} + eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \ + "is missing and REQUIRED'" + done + + check_extra_config + echo + else + ewarn "" + ewarn "Your kernel configuration couldn't be checked. Do you have" + ewarn "/usr/src/linux/.config file there? Please check manually if" + ewarn "following options are enabled:" + ewarn "" + ewarn " CONFIG_BLK_DEV_INITRD" + ewarn " CONFIG_DEVTMPFS" + ewarn "" + fi + + elog "To get additional features, a number of optional runtime" + elog "dependencies may be installed:" + elog "" + optfeature "Networking support" net-misc/curl "net-misc/dhcp[client]" \ + sys-apps/iproute2 + optfeature \ + "Measure performance of the boot process for later visualisation" \ + app-benchmarks/bootchart2 app-admin/killproc sys-process/acct + optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs + optfeature "Load kernel modules and drop this privilege for real init" \ + sys-libs/libcap + optfeature "Support CIFS" net-fs/cifs-utils + optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \ + "sys-fs/cryptsetup[-static-libs]" + optfeature "Support for GPG-encrypted keys for crypt module" \ + app-crypt/gnupg + optfeature \ + "Allows use of dash instead of default bash (on your own risk)" \ + app-shells/dash + optfeature "Framebuffer splash (media-gfx/splashutils)" \ + media-gfx/splashutils + optfeature "Support iSCSI" sys-block/open-iscsi + optfeature "Support Logical Volume Manager" sys-fs/lvm2 + optfeature "Support MD devices, also known as software RAID devices" \ + sys-fs/mdadm + optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools + optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5' + optfeature "Support network block devices" sys-block/nbd + optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind + optfeature \ + "Install ssh and scp along with config files and specified keys" \ + net-misc/openssh + optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \ + app-admin/rsyslog +} diff --git a/sys-kernel/dracut/files/041-r2-0004-Portability-fixes.patch b/sys-kernel/dracut/files/041-r2-0004-Portability-fixes.patch new file mode 100644 index 000000000000..f92cba390e66 --- /dev/null +++ b/sys-kernel/dracut/files/041-r2-0004-Portability-fixes.patch @@ -0,0 +1,63 @@ +From 82f7e46c8fdb2bb41b7b26916e463add7af70a94 Mon Sep 17 00:00:00 2001 +From: xtraeme <xtraeme@voidlinux.eu> +Date: Tue, 2 Jun 2015 11:11:21 +0200 +Subject: [PATCH 5/5] Portability fixes: + +- Use uid_t not __uid_t. +- Define _GNU_SOURCE for cpu_set_t and others. +- Include string.h for strncmp(). +- Detect musl's ldd error message. +--- + install/dracut-install.c | 7 ++++++- + install/util.h | 3 +++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 201f181..0ff5c49 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -222,7 +222,7 @@ static int cp(const char *src, const char *dst) + if (ret == 0) { + struct timeval tv[2]; + if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0) +- if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0) ++ if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0) + log_error("Failed to chown %s: %m", dst); + tv[0].tv_sec = sb.st_atime; + tv[0].tv_usec = 0; +@@ -388,6 +388,11 @@ static int resolve_deps(const char *src) + break; + } + ++ /* musl ldd */ ++ if (strstr(buf, "Not a valid dynamic program")) ++ break; ++ ++ /* glibc */ + if (strstr(buf, "not a dynamic executable")) + break; + +diff --git a/install/util.h b/install/util.h +index cc7b988..2ad3254 100644 +--- a/install/util.h ++++ b/install/util.h +@@ -20,6 +20,8 @@ + along with systemd; If not, see <http://www.gnu.org/licenses/>. + ***/ + ++#define _GNU_SOURCE ++ + #include <inttypes.h> + #include <time.h> + #include <sys/time.h> +@@ -27,6 +29,7 @@ + #include <stdbool.h> + #include <stdlib.h> + #include <stdio.h> ++#include <string.h> + #include <signal.h> + #include <sched.h> + #include <limits.h> +-- +2.4.1 + |