diff options
Diffstat (limited to 'meta-initramfs')
45 files changed, 1323 insertions, 0 deletions
diff --git a/meta-initramfs/COPYING.MIT b/meta-initramfs/COPYING.MIT new file mode 100644 index 000000000..fb950dc69 --- /dev/null +++ b/meta-initramfs/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/meta-initramfs/README b/meta-initramfs/README new file mode 100644 index 000000000..e5d27d788 --- /dev/null +++ b/meta-initramfs/README | |||
@@ -0,0 +1,43 @@ | |||
1 | meta-initramfs | ||
2 | ============== | ||
3 | |||
4 | This layer contains the metadata necessary to build the klibc library and | ||
5 | utilities (shared and static) plus other tools useful for the creation of | ||
6 | small-sized initramfs. | ||
7 | |||
8 | |||
9 | Dependencies | ||
10 | ------------ | ||
11 | |||
12 | This layer depends on: | ||
13 | |||
14 | URI: git://github.com/openembedded/oe-core.git | ||
15 | branch: dizzy | ||
16 | revision: HEAD | ||
17 | |||
18 | |||
19 | Maintenance | ||
20 | ----------- | ||
21 | |||
22 | Send patches / pull requests to openembedded-devel@lists.openembedded.org | ||
23 | with '[meta-initramfs][dizzy]' in the subject. | ||
24 | |||
25 | When sending single patches, please using something like: | ||
26 | 'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-initramfs][dizzy][PATCH' | ||
27 | |||
28 | Layer maintainers: Andrea Adami <andrea.adami@gmail.com> | ||
29 | Paul Eggleton <paul.eggleton@linux.intel.com> | ||
30 | |||
31 | |||
32 | Dizzy branch maintainers: | ||
33 | Otavio Salvador <otavio@ossystems.com.br> | ||
34 | Armin Kuster <akuster808@gmail.com> | ||
35 | |||
36 | Prefix email subject with: [dizzy] | ||
37 | |||
38 | License | ||
39 | ------- | ||
40 | |||
41 | All metadata is MIT licensed unless otherwise stated. Source code included | ||
42 | in tree for individual recipes is under the LICENSE stated in each recipe | ||
43 | (.bb file) unless otherwise stated. | ||
diff --git a/meta-initramfs/classes/klibc.bbclass b/meta-initramfs/classes/klibc.bbclass new file mode 100644 index 000000000..f864104cf --- /dev/null +++ b/meta-initramfs/classes/klibc.bbclass | |||
@@ -0,0 +1,15 @@ | |||
1 | # klcc-cross depends on klibc | ||
2 | DEPENDS =+ "klcc-cross" | ||
3 | |||
4 | # Default for klcc is to build static binaries. | ||
5 | # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version. | ||
6 | |||
7 | export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}" | ||
8 | export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork" | ||
9 | |||
10 | export CPP = "${CC} -E" | ||
11 | |||
12 | # klcc uses own optimizations by default. See klcc(1) man file. | ||
13 | export CFLAGS="" | ||
14 | export CPPFLAGS="" | ||
15 | export LDFLAGS="" | ||
diff --git a/meta-initramfs/conf/layer.conf b/meta-initramfs/conf/layer.conf new file mode 100644 index 000000000..cc78c1ac5 --- /dev/null +++ b/meta-initramfs/conf/layer.conf | |||
@@ -0,0 +1,16 @@ | |||
1 | # Layer configuration for meta-initramfs layer | ||
2 | |||
3 | # We have a conf and classes directory, append to BBPATH | ||
4 | BBPATH .= ":${LAYERDIR}" | ||
5 | |||
6 | # We have a recipes directory, add to BBFILES | ||
7 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
8 | |||
9 | BBFILE_COLLECTIONS += "meta-initramfs" | ||
10 | BBFILE_PATTERN_meta-initramfs := "^${LAYERDIR}/" | ||
11 | |||
12 | # Define the priority for recipes (.bb files) from this layer, | ||
13 | # choosing carefully how this layer interacts with all of the | ||
14 | # other layers. | ||
15 | |||
16 | BBFILE_PRIORITY_meta-initramfs = "8" | ||
diff --git a/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb b/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb new file mode 100644 index 000000000..35eb245ce --- /dev/null +++ b/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "Initramfs image for kexecboot kernel" | ||
2 | DESCRIPTION = "This image provides kexecboot (linux as bootloader) and helpers." | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | |||
6 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | ||
7 | |||
8 | # avoid circular dependencies | ||
9 | EXTRA_IMAGEDEPENDS = "" | ||
10 | |||
11 | # We really need just kexecboot, kexec and ubiattach | ||
12 | IMAGE_INSTALL = "kexecboot kexec mtd-utils-ubifs" | ||
13 | |||
14 | # Do not pollute the initrd image with rootfs features | ||
15 | IMAGE_FEATURES = "" | ||
16 | |||
17 | IMAGE_LINGUAS = "" | ||
18 | |||
19 | FEED_DEPLOYDIR_BASE_URI = "" | ||
20 | LDCONFIGDEPEND = "" | ||
21 | |||
22 | inherit image | ||
diff --git a/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb b/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb new file mode 100644 index 000000000..df9751189 --- /dev/null +++ b/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb | |||
@@ -0,0 +1,7 @@ | |||
1 | require initramfs-kexecboot-image.bb | ||
2 | |||
3 | SUMMARY = "Initramfs image for kexecboot kernel (klibc-static binaries)" | ||
4 | |||
5 | # We really need just kexecboot, kexec and ubiattach | ||
6 | # statically compiled against klibc | ||
7 | IMAGE_INSTALL = "kexecboot-klibc kexec-klibc ubiattach-klibc" | ||
diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm b/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm new file mode 100644 index 000000000..6e6fd776d --- /dev/null +++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm | |||
@@ -0,0 +1,43 @@ | |||
1 | /* XPM */ | ||
2 | static char * icon_xpm[] = { | ||
3 | "32 32 8 1", | ||
4 | " c None", | ||
5 | ". c #D6DBDE", | ||
6 | "+ c #9BA6AE", | ||
7 | "@ c #60727D", | ||
8 | "# c #B8BFC5", | ||
9 | "$ c #A9E8F6", | ||
10 | "% c #12BCE4", | ||
11 | "& c #57D2EC", | ||
12 | " ", | ||
13 | " ", | ||
14 | " ", | ||
15 | " .++@@@@++. ", | ||
16 | " +@@@@@@@@@@@@+ ", | ||
17 | " #@@@@@@@@@@@@@@@@# ", | ||
18 | " +@@@@@@@@@@@@@@@@@@+ ", | ||
19 | " .@@@@@@@@++##+@@@@@@@@@. ", | ||
20 | " @@@@@@@. .@@@@@@@ ", | ||
21 | " +@@@@@+ $$$$ #@@@@@+ ", | ||
22 | " #@@@@@. $%%%%%%%%$ .@@@@@# ", | ||
23 | " @@@@@. &%%%%%%%%%%& .@@@@@ ", | ||
24 | " #@@@@+ %%%%%%%%%%%%%% +@@@@# ", | ||
25 | " @@@@@ &%%%%%%%%%%%%%%& @@@@@ ", | ||
26 | ".@@@@. $%%%%%& $%%%%%& .@@@@.", | ||
27 | "+@@@@ %%%%% $%%%%%& @@@@+", | ||
28 | "+@@@+ %%%%$ $%%%%%& $$ +@@@+", | ||
29 | "@@@@+ $%%%% $%%%%%& $%$ +@@@@", | ||
30 | "@@@@# &%%%& &%%%%& $%%& #@@@@", | ||
31 | "@@@@. &%%%& %%%%& $%%%& .@@@@", | ||
32 | "@@@@# $%%%& &%%& &%%%$ #@@@@", | ||
33 | "+@@@+ $%%%% %%%%$ +@@@+", | ||
34 | "+@@@@ %%%%& &%%%% @@@@+", | ||
35 | "#@@@@ &%%%%& &%%%%& @@@@#", | ||
36 | " @@@@+ %%%%%%&$$&%%%%%% +@@@@ ", | ||
37 | " +@@@@. $%%%%%%%%%%%%%%$ .@@@@+ ", | ||
38 | " .@@@@@ $%%%%%%%%%%%%$ @@@@@. ", | ||
39 | " #++++. &%%%%%%%%& .++++# ", | ||
40 | " $&&%%&&$ ", | ||
41 | " ", | ||
42 | " ", | ||
43 | " "}; | ||
diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.1.bb b/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.1.bb new file mode 100644 index 000000000..ec476f829 --- /dev/null +++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.1.bb | |||
@@ -0,0 +1,62 @@ | |||
1 | SUMMARY = "Configuration files for kexecboot" | ||
2 | DESCRIPTION = "Default icon and boot.cfg for kexecboot linux-as-bootloader." | ||
3 | SECTION = "base" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" | ||
6 | PR = "r14" | ||
7 | |||
8 | SRC_URI = "file://icon.xpm" | ||
9 | |||
10 | do_configure_prepend () { | ||
11 | install -m 0644 ${WORKDIR}/icon.xpm ${S} | ||
12 | } | ||
13 | do_install_prepend () { | ||
14 | echo '# /boot/boot.cfg - KEXECBOOT configuration file. | ||
15 | # | ||
16 | # First kernel stanza. | ||
17 | # Show this label in kexecboot menu. | ||
18 | # | ||
19 | LABEL=${KEXECBOOT_LABEL} | ||
20 | # | ||
21 | # Specify full kernel path on target. | ||
22 | KERNEL=/boot/${KERNEL_IMAGETYPE} | ||
23 | # | ||
24 | # Append this tags to the kernel cmdline. | ||
25 | APPEND=${CMDLINE} ${CMDLINE_DEBUG} | ||
26 | # | ||
27 | # Specify optional initrd/initramfs. | ||
28 | # INITRD=/boot/initramfs.cpio.gz | ||
29 | # | ||
30 | # Specify full path for a custom icon for the menu-item. | ||
31 | # If not set, use device-icons as default (NAND, SD, CF, ...). | ||
32 | # ICON=/boot/icon.xpm | ||
33 | # | ||
34 | # Priority of item in kexecboot menu. | ||
35 | # Items with highest priority will be shown at top of menu. | ||
36 | # Default: 0 (lowest, ordered by device ordering) | ||
37 | # PRIORITY=10 | ||
38 | # | ||
39 | # | ||
40 | # Second kernel stanza. | ||
41 | # LABEL=${KEXECBOOT_LABEL}-test | ||
42 | # KERNEL=/boot/${KERNEL_IMAGETYPE}-test | ||
43 | # APPEND=${CMDLINE} | ||
44 | #' > ${S}/boot.cfg | ||
45 | } | ||
46 | do_install () { | ||
47 | install -d ${D}/boot | ||
48 | install -m 0644 boot.cfg ${D}/boot/boot.cfg | ||
49 | install -m 0644 icon.xpm ${D}/boot/icon.xpm | ||
50 | } | ||
51 | |||
52 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
53 | |||
54 | FILES_${PN} += "/boot/*" | ||
55 | |||
56 | CMDLINE ?= "" | ||
57 | CMDLINE_DEBUG ?= "quiet" | ||
58 | |||
59 | INHIBIT_DEFAULT_DEPS = "1" | ||
60 | |||
61 | # Note: for qvga the label is currently limited to about 24 chars | ||
62 | KEXECBOOT_LABEL ?= "${@d.getVar('DISTRO', True) or d.getVar('DISTRO_VERSION', True)}-${MACHINE}" | ||
diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb new file mode 100644 index 000000000..1fb5f0da5 --- /dev/null +++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb | |||
@@ -0,0 +1,66 @@ | |||
1 | ########################### | ||
2 | # Configure options: | ||
3 | # | ||
4 | # --enable-static-linking compile kexecboot as static executable [default=no] | ||
5 | # --enable-fbui support framebuffer menu [default=yes] | ||
6 | # --enable-fbui-width limit FB UI width to specified value [default=no] | ||
7 | # --enable-fbui-height limit FB UI height to specified value [default=no] | ||
8 | # --enable-textui support console text user interface [default=no] | ||
9 | # --enable-cfgfiles support config files [default=yes] | ||
10 | # --enable-icons support custom icons (depends on fbui) [default=yes] | ||
11 | # --enable-zaurus compile Sharp Zaurus specific code [default=no] | ||
12 | # --enable-zimage compile with zImage support [default=yes] | ||
13 | # --enable-uimage compile with uImage support [default=no] | ||
14 | # --enable-machine-kernel look for machine-specific zImage kernel [default=no] | ||
15 | # --enable-devices-recreating | ||
16 | # enable devices re-creating [default=yes] | ||
17 | # --enable-debug enable debug output [default=no] | ||
18 | # --enable-host-debug allow for non-destructive executing of kexecboot on | ||
19 | # host system [default=no] | ||
20 | # --enable-numkeys enable menu item selection by keys [0-9] [default=yes] | ||
21 | # --enable-bg-buffer enable buffer for pre-drawed FB GUI background | ||
22 | # | ||
23 | # --enable-timeout allow to boot 1st kernel after timeout in seconds | ||
24 | # [default=no] | ||
25 | # --enable-delay specify delay before device scanning, allowing | ||
26 | # initialization of old CF/SD cards [default=1] | ||
27 | # --enable-bpp enable support of specified bpp modes | ||
28 | # (all,32,24,18,16,4,2,1) [default=all] | ||
29 | # --enable-evdev-rate change evdev (keyboard/mouse) repeat rate | ||
30 | # in milliseconds e.g. "1000,250" [default=no] | ||
31 | # --with-kexec-binary look for kexec binary at path | ||
32 | # [default="/usr/sbin/kexec"] | ||
33 | ########################## | ||
34 | SUMMARY = "kexecboot linux-as-bootloader" | ||
35 | DESCRIPTION = "kexecboot is a graphical linux-as-bootloader implementation based on kexec." | ||
36 | HOMEPAGE = "http://kexecboot.org" | ||
37 | LICENSE = "GPLv2" | ||
38 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
39 | |||
40 | S = "${WORKDIR}/kexecboot-${PV}" | ||
41 | SRC_URI = "https://github.com/kexecboot/kexecboot/archive/v${PV}.tar.gz" | ||
42 | SRC_URI[md5sum] = "46b7c1a6f20531be56445ebb8669a2b8" | ||
43 | SRC_URI[sha256sum] = "6b360b8aa59bc5d68a96705349a0dd416f8ed704e931fa0ac7849298258f0f15" | ||
44 | |||
45 | inherit autotools-brokensep | ||
46 | |||
47 | EXTRA_OECONF = "--enable-delay=2 --enable-evdev-rate=1000,250" | ||
48 | |||
49 | do_install () { | ||
50 | install -d ${D}${bindir} | ||
51 | install -m 0755 kexecboot ${D}${bindir} | ||
52 | install -d ${D}/proc | ||
53 | install -d ${D}/mnt | ||
54 | install -d ${D}/dev | ||
55 | install -d ${D}/sys | ||
56 | } | ||
57 | |||
58 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
59 | |||
60 | FILES_${PN} += " ${bindir}/kexecboot /init /proc /mnt /dev /sys" | ||
61 | |||
62 | pkg_postinst_${PN} () { | ||
63 | ln -sf ${bindir}/kexecboot $D/init | ||
64 | } | ||
65 | |||
66 | BBCLASSEXTEND = "klibc" | ||
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb new file mode 100644 index 000000000..ea55a4dfb --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb | |||
@@ -0,0 +1,42 @@ | |||
1 | SUMMARY = "Initramfs generator using udev" | ||
2 | DESCRIPTION = "Dracut is an event driven initramfs infrastructure. dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the dracut framework, usually found in /usr/lib/dracut/modules.d." | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
6 | |||
7 | PE = "1" | ||
8 | PV = "038" | ||
9 | |||
10 | # v038 tag | ||
11 | SRCREV = "267a109a81715c8957f14659593deb7b6255d40e" | ||
12 | SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git" | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | do_configure() { | ||
17 | ./configure --prefix=${prefix} \ | ||
18 | --libdir=${libdir} \ | ||
19 | --datadir=${datadir} \ | ||
20 | --sysconfdir=${sysconfdir} \ | ||
21 | --sbindir=${sbindir} \ | ||
22 | --disable-documentation \ | ||
23 | --bindir=${bindir} \ | ||
24 | --includedir=${includedir} \ | ||
25 | --localstatedir=${localstatedir} \ | ||
26 | } | ||
27 | |||
28 | do_install() { | ||
29 | oe_runmake install DESTDIR=${D} | ||
30 | } | ||
31 | |||
32 | FILES_${PN} += "${datadir}/bash-completion \ | ||
33 | ${libdir}/kernel \ | ||
34 | " | ||
35 | |||
36 | # 'getopt' is in the util-linux main package | ||
37 | RDEPENDS_${PN} = "systemd findutils cpio util-linux-blkid util-linux bash ldd" | ||
38 | # This could be optimized a bit, but let's avoid non-booting systems :) | ||
39 | RRECOMMENDS_${PN} = " \ | ||
40 | kernel-modules \ | ||
41 | coreutils \ | ||
42 | " | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb new file mode 100644 index 000000000..2f4afce06 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb | |||
@@ -0,0 +1,40 @@ | |||
1 | SUMMARY = "The klcc crosscompiler for klibc" | ||
2 | |||
3 | require klibc.inc | ||
4 | DEPENDS = "klibc" | ||
5 | |||
6 | FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" | ||
7 | |||
8 | SRC_URI += "file://use-env-for-perl.patch" | ||
9 | |||
10 | # disable task already run in klibc recipe | ||
11 | do_configure[noexec] = "1" | ||
12 | |||
13 | do_compile() { | ||
14 | oe_runmake 'INSTALLDIR=${STAGING_DIR_TARGET}${libdir}/klibc' klcc | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d ${D}${bindir_crossscripts}/ | ||
19 | install -m 0755 klcc/klcc ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc | ||
20 | # Insert an unencoded path as a comment to trigger the sstate renaming functions | ||
21 | sed -i '2i #${STAGING_DIR_TARGET}' ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc | ||
22 | } | ||
23 | |||
24 | SYSROOT_PREPROCESS_FUNCS += "klcc_sysroot_preprocess" | ||
25 | |||
26 | klcc_sysroot_preprocess () { | ||
27 | sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
28 | } | ||
29 | |||
30 | deltask do_package | ||
31 | deltask do_packagedata | ||
32 | deltask do_package_write_ipk | ||
33 | deltask do_package_write_rpm | ||
34 | deltask do_package_write_deb | ||
35 | deltask do_package_write_tar | ||
36 | |||
37 | SSTATE_SCAN_FILES = "*" | ||
38 | EXTRA_STAGING_FIXMES = "MANGLEDSTAGINGDIRTARGET MANGLEDSTAGINGDIR" | ||
39 | MANGLEDSTAGINGDIR = "${@d.getVar("STAGING_DIR", True).replace("/", "\\\\/").replace("-", "\\\\-")}" | ||
40 | MANGLEDSTAGINGDIRTARGET = "${@d.getVar("STAGING_DIR_TARGET", True).replace("/", "\\\\/").replace("-", "\\\\-")}" | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch new file mode 100644 index 000000000..6bb384bb0 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Status: not applicable upstream, in OE/Yocto we use $(FIX_V4BX) | ||
2 | which is "" in case of armv5 or thumbs. | ||
3 | |||
4 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
5 | |||
6 | --- a/usr/klibc/arch/arm/MCONFIG 2013-01-09 01:12:02.000000000 +0100 | ||
7 | +++ b/usr/klibc/arch/arm/MCONFIG 2013-01-08 23:45:59.000000000 +0100 | ||
8 | @@ -29,6 +29,7 @@ | ||
9 | KLIBCSHAREDFLAGS = -Ttext 0x01800200 | ||
10 | ifeq ($(CONFIG_AEABI),y) | ||
11 | KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork | ||
12 | +KLIBCLDFLAGS += $(FIX_ARMV4_EABI_BX) | ||
13 | else | ||
14 | KLIBCREQFLAGS += -mabi=apcs-gnu -mno-thumb-interwork | ||
15 | endif | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch new file mode 100644 index 000000000..9bc4835dc --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | diff --git a/klcc/klcc.in b/klcc/klcc.in | ||
2 | index 43d0984..61e9385 100644 | ||
3 | --- a/klcc/klcc.in | ||
4 | +++ b/klcc/klcc.in | ||
5 | @@ -204,6 +204,9 @@ while ( defined($a = shift(@ARGV)) ) { | ||
6 | # Libraries | ||
7 | push(@libs, $a); | ||
8 | push(@libs, shift(@ARGV)) if ( $2 eq '' ); | ||
9 | + } elsif ( $a =~ /^--([sysroot=])(.*)$/ ) { | ||
10 | + # Override gcc encoded sysroot | ||
11 | + push(@ccopt, $a); | ||
12 | } else { | ||
13 | die "$0: unknown option: $a\n"; | ||
14 | } | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-config-eabi.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-config-eabi.patch new file mode 100644 index 000000000..316c80a92 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-config-eabi.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Patch was imported from the OpenEmbedded git server | ||
2 | (git://git.openembedded.org/openembedded) | ||
3 | as of commit id b6764cf32ec93547531130dca364fb95e1c495f4 | ||
4 | Signed-off-by: Thomas Kunze <thommycheck@gmx.de> | ||
5 | |||
6 | diff -Nur klibc-1.5/defconfig klibc-1.5p/defconfig | ||
7 | --- klibc-1.5/defconfig 2007-03-04 02:52:10.000000000 +0100 | ||
8 | +++ klibc-1.5p/defconfig 2008-02-08 19:24:22.337127756 +0100 | ||
9 | @@ -5,4 +5,4 @@ | ||
10 | CONFIG_REGPARM=y | ||
11 | # ARM options | ||
12 | # CONFIG_KLIBC_THUMB is not set | ||
13 | -# CONFIG_AEABI is not set | ||
14 | +CONFIG_AEABI=y | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch new file mode 100644 index 000000000..204306475 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | commit 43adf69062254fb4f8d4d11fb5fe36a60ae25d5a | ||
2 | Author: Ben Hutchings <ben@decadent.org.uk> | ||
3 | Date: Sun Mar 14 18:41:56 2010 +0000 | ||
4 | |||
5 | Taken from debian "Fix klibc Debian specific build trouble" | ||
6 | Adapted for klibc_2.0.2 | ||
7 | |||
8 | Index: klibc-2.0~rc2/scripts/Kbuild.install | ||
9 | =================================================================== | ||
10 | --- klibc-2.0~rc2.orig/scripts/Kbuild.install 2012-02-11 18:50:21.000000000 +0000 | ||
11 | +++ klibc-2.0~rc2/scripts/Kbuild.install 2012-02-11 19:04:52.000000000 +0000 | ||
12 | @@ -95,7 +95,9 @@ | ||
13 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include | ||
14 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib | ||
15 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin | ||
16 | - $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install | ||
17 | + $(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \ | ||
18 | + ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ | ||
19 | + done | ||
20 | $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/. | ||
21 | $(Q)chmod -R a+rX $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include | ||
22 | $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1 | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch new file mode 100644 index 000000000..400864bb2 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch | |||
@@ -0,0 +1,144 @@ | |||
1 | Patch was imported from the OpenEmbedded git server | ||
2 | (git://git.openembedded.org/openembedded) | ||
3 | as of commit id eefb99a313bbcc8f34c8b32bf0c5aa2dd2580735 | ||
4 | Signed-off-by: Thomas Kunze <thommycheck@gmx.de> | ||
5 | |||
6 | Minor edits following upstream changes | ||
7 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
8 | |||
9 | Index: klibc-1.5.24/scripts/Kbuild.install | ||
10 | =================================================================== | ||
11 | --- a/scripts/Kbuild.install 2011-07-27 15:50:53.000000000 +0200 | ||
12 | +++ b/scripts/Kbuild.install 2011-08-01 00:03:03.000000000 +0200 | ||
13 | @@ -88,13 +88,10 @@ | ||
14 | header: | ||
15 | $(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)" | ||
16 | $(Q)mkdir -p $(INSTALLROOT)$(bindir) | ||
17 | - $(Q)mkdir -p $(INSTALLROOT)$(mandir)/man1 | ||
18 | - $(Q)mkdir -p $(INSTALLROOT)$(SHLIBDIR) | ||
19 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR) | ||
20 | $(Q)-rm -rf $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include | ||
21 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include | ||
22 | $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib | ||
23 | - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin | ||
24 | $(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \ | ||
25 | ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ | ||
26 | done | ||
27 | @@ -103,7 +100,6 @@ | ||
28 | done | ||
29 | $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/. | ||
30 | $(Q)chmod -R a+rX $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include | ||
31 | - $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1 | ||
32 | $(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir) | ||
33 | |||
34 | footer: header | ||
35 | |||
36 | Index: klibc-1.5.24/usr/dash/Kbuild | ||
37 | =================================================================== | ||
38 | --- a/usr/dash/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
39 | +++ b/usr/dash/Kbuild 2011-08-01 00:07:56.000000000 +0200 | ||
40 | @@ -92,5 +92,3 @@ | ||
41 | $(obj)/syntax.h: $(obj)/syntax.c | ||
42 | $(Q): | ||
43 | |||
44 | -# Targets to install | ||
45 | -install-y := sh.shared | ||
46 | |||
47 | Index: klibc-1.5.24/usr/gzip/Kbuild | ||
48 | =================================================================== | ||
49 | --- a/usr/gzip/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
50 | +++ b/usr/gzip/Kbuild 2011-08-01 00:06:39.000000000 +0200 | ||
51 | @@ -21,5 +21,3 @@ | ||
52 | # Cleaning | ||
53 | targets := gzip gzip.g gunzip zcat | ||
54 | |||
55 | -# Targets to install | ||
56 | -install-y := gzip gunzip zcat | ||
57 | |||
58 | Index: klibc-1.5.24/usr/kinit/fstype/Kbuild | ||
59 | =================================================================== | ||
60 | --- a/usr/kinit/fstype/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
61 | +++ b/usr/kinit/fstype/Kbuild 2011-08-01 00:09:12.000000000 +0200 | ||
62 | @@ -21,5 +21,3 @@ | ||
63 | # Cleaning | ||
64 | clean-dirs := static shared | ||
65 | |||
66 | -# install binary | ||
67 | -install-y := $(shared-y) | ||
68 | |||
69 | Index: klibc-1.5.24/usr/kinit/ipconfig/Kbuild | ||
70 | =================================================================== | ||
71 | --- a/usr/kinit/ipconfig/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
72 | +++ b/usr/kinit/ipconfig/Kbuild 2011-08-01 00:10:52.000000000 +0200 | ||
73 | @@ -27,5 +27,3 @@ | ||
74 | # Cleaning | ||
75 | clean-dirs := static shared | ||
76 | |||
77 | -# install binary | ||
78 | -install-y := $(shared-y) | ||
79 | |||
80 | Index: klibc-1.5.24/usr/kinit/Kbuild | ||
81 | =================================================================== | ||
82 | --- a/usr/kinit/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
83 | +++ b/usr/kinit/Kbuild 2011-08-01 00:20:18.000000000 +0200 | ||
84 | @@ -33,5 +33,3 @@ | ||
85 | subdir- := fstype ipconfig nfsmount resume run-init | ||
86 | |||
87 | |||
88 | -# install binary | ||
89 | -install-y := kinit kinit.shared | ||
90 | |||
91 | Index: klibc-1.5.24/usr/kinit/nfsmount/Kbuild | ||
92 | =================================================================== | ||
93 | --- a/usr/kinit/nfsmount/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
94 | +++ b/usr/kinit/nfsmount/Kbuild 2011-08-01 00:12:52.000000000 +0200 | ||
95 | @@ -23,5 +23,3 @@ | ||
96 | |||
97 | clean-dirs := static shared | ||
98 | |||
99 | -# Install binary | ||
100 | -install-y := $(shared-y) | ||
101 | |||
102 | Index: klibc-1.5.24/usr/kinit/resume/Kbuild | ||
103 | =================================================================== | ||
104 | --- a/usr/kinit/resume/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
105 | +++ b/usr/kinit/resume/Kbuild 2011-08-01 00:13:51.000000000 +0200 | ||
106 | @@ -26,5 +26,3 @@ | ||
107 | # Cleaning | ||
108 | clean-dirs := static shared | ||
109 | |||
110 | -# install binary | ||
111 | -install-y := $(shared-y) | ||
112 | |||
113 | Index: klibc-1.5.24/usr/kinit/run-init/Kbuild | ||
114 | =================================================================== | ||
115 | --- a/usr/kinit/run-init/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
116 | +++ b/usr/kinit/run-init/Kbuild 2011-08-01 00:14:41.000000000 +0200 | ||
117 | @@ -25,5 +25,3 @@ | ||
118 | # Cleaning | ||
119 | clean-dirs := static shared | ||
120 | |||
121 | -# install binary | ||
122 | -install-y := $(shared-y) | ||
123 | |||
124 | Index: klibc-1.5.24/usr/klibc/Kbuild | ||
125 | =================================================================== | ||
126 | --- a/usr/klibc/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
127 | +++ b/usr/klibc/Kbuild 2011-08-01 00:18:11.000000000 +0200 | ||
128 | @@ -177,5 +177,3 @@ | ||
129 | $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib)) | ||
130 | $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \ | ||
131 | $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib | ||
132 | - $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \ | ||
133 | - $(INSTALLROOT)$(SHLIBDIR) | ||
134 | |||
135 | Index: klibc-1.5.24/usr/utils/Kbuild | ||
136 | =================================================================== | ||
137 | --- a/usr/utils/Kbuild 2011-07-27 15:50:53.000000000 +0200 | ||
138 | +++ b/usr/utils/Kbuild 2011-08-01 00:19:13.000000000 +0200 | ||
139 | @@ -72,5 +72,3 @@ | ||
140 | # Clean deletes the static and shared dir | ||
141 | clean-dirs := static shared | ||
142 | |||
143 | -# install only install the shared binaries | ||
144 | -install-y := $(shared-y) shared/reboot shared/poweroff | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/use-env-for-perl.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/use-env-for-perl.patch new file mode 100644 index 000000000..eac128cc0 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/use-env-for-perl.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Patch was imported from the OpenEmbedded git server | ||
2 | (git://git.openembedded.org/openembedded) | ||
3 | as of commit id 676cbb54d42c89a4832871064cfcb7ee2ad372ee | ||
4 | |||
5 | klcc-cross: Add patch to use /usr/bin/env perl | ||
6 | Certain configurations (such as autobuilders) may build in very | ||
7 | deep paths (that are longer than the #! mechanism allows) which | ||
8 | makes it unsafe to use the direct path for perl. In our case we know | ||
9 | that /usr/bin/env perl will always return ours (if it has been built). | ||
10 | |||
11 | Signed-off-by: Tom Rini <tom_rini@mentor.com> | ||
12 | |||
13 | Index: klibc-1.5.20/klcc/makeklcc.pl | ||
14 | =================================================================== | ||
15 | --- a/klcc/makeklcc.pl | ||
16 | +++ b/klcc/makeklcc.pl | ||
17 | @@ -26,7 +26,7 @@ sub pathsearch($) { | ||
18 | return undef; | ||
19 | } | ||
20 | |||
21 | -print "#!${perlpath}\n"; | ||
22 | +print "#!/usr/bin/env perl\n"; | ||
23 | |||
24 | open(KLIBCCONF, "< $klibcconf\0") | ||
25 | or die "$0: cannot open $klibcconf: $!\n"; | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.4.bb new file mode 100644 index 000000000..c835fd647 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.4.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | SUMMARY = "klibc utils for initramfs statically compiled" | ||
2 | |||
3 | FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" | ||
4 | |||
5 | PACKAGES = "${PN}" | ||
6 | FILES_${PN} = "" | ||
7 | |||
8 | KLIBC_UTILS_VARIANT = "static" | ||
9 | KLIBC_UTILS_PKGNAME = "klibc-static-utils" | ||
10 | |||
11 | require klibc-utils.inc | ||
12 | require klibc.inc | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc new file mode 100644 index 000000000..9014f5267 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc | |||
@@ -0,0 +1,60 @@ | |||
1 | do_install() { | ||
2 | install -d ${D}${base_bindir} | ||
3 | install -d ${D}${base_sbindir} | ||
4 | # debian packages kinit + kinit.shared but only sh.shared | ||
5 | if [ "${KLIBC_UTILS_VARIANT}" = "shared" ]; then | ||
6 | install -m 755 usr/kinit/kinit ${D}${base_bindir}/kinit | ||
7 | install -m 755 usr/kinit/kinit.shared ${D}${base_bindir}/kinit.shared | ||
8 | install -m 755 usr/dash/sh.shared ${D}${base_bindir}/sh.shared | ||
9 | else | ||
10 | install -m 755 usr/dash/sh ${D}${base_bindir}/sh | ||
11 | install -m 755 usr/kinit/kinit ${D}${base_bindir}/kinit | ||
12 | fi | ||
13 | install -m 755 usr/gzip/gzip ${D}${base_bindir} | ||
14 | install -m 755 usr/kinit/fstype/${KLIBC_UTILS_VARIANT}/fstype ${D}${base_bindir} | ||
15 | install -m 755 usr/kinit/ipconfig/${KLIBC_UTILS_VARIANT}/ipconfig ${D}${base_bindir} | ||
16 | install -m 755 usr/kinit/nfsmount/${KLIBC_UTILS_VARIANT}/nfsmount ${D}${base_bindir} | ||
17 | install -m 755 usr/kinit/resume/${KLIBC_UTILS_VARIANT}/resume ${D}${base_bindir} | ||
18 | install -m 755 usr/kinit/run-init/${KLIBC_UTILS_VARIANT}/run-init ${D}${base_bindir} | ||
19 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/cat ${D}${base_bindir} | ||
20 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/chroot ${D}${base_bindir} | ||
21 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/cpio ${D}${base_bindir} | ||
22 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/dd ${D}${base_bindir} | ||
23 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/dmesg ${D}${base_bindir} | ||
24 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/false ${D}${base_bindir} | ||
25 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/halt ${D}${base_bindir} | ||
26 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/kill ${D}${base_bindir} | ||
27 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/ln ${D}${base_bindir} | ||
28 | # losetup goes in ${base_sbindir} | ||
29 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/losetup ${D}${base_sbindir} | ||
30 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/ls ${D}${base_bindir} | ||
31 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/minips ${D}${base_bindir} | ||
32 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/mkdir ${D}${base_bindir} | ||
33 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/mkfifo ${D}${base_bindir} | ||
34 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/mknod ${D}${base_bindir} | ||
35 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/mount ${D}${base_bindir} | ||
36 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/mv ${D}${base_bindir} | ||
37 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/nuke ${D}${base_bindir} | ||
38 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/pivot_root ${D}${base_bindir} | ||
39 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/poweroff ${D}${base_bindir} | ||
40 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/readlink ${D}${base_bindir} | ||
41 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/reboot ${D}${base_bindir} | ||
42 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/sleep ${D}${base_bindir} | ||
43 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/sync ${D}${base_bindir} | ||
44 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/true ${D}${base_bindir} | ||
45 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/umount ${D}${base_bindir} | ||
46 | install -m 755 usr/utils/${KLIBC_UTILS_VARIANT}/uname ${D}${base_bindir} | ||
47 | ln -s gzip ${D}${base_bindir}/gunzip | ||
48 | ln -s gzip ${D}${base_bindir}/zcat | ||
49 | } | ||
50 | |||
51 | EXTRA_KLIBC_DEPS = "${@base_conditional('KLIBC_UTILS_VARIANT', 'shared', '${THIS_LIBKLIBC}', '', d)}" | ||
52 | |||
53 | PACKAGES_DYNAMIC += "^${KLIBC_UTILS_PKGNAME}-.*" | ||
54 | |||
55 | python populate_packages_prepend () { | ||
56 | base_bin_dir = d.expand('${base_bindir}') | ||
57 | do_split_packages(d, base_bin_dir, '(.*)', '${KLIBC_UTILS_PKGNAME}-%s', 'Klibc util for %s', extra_depends='${EXTRA_KLIBC_DEPS}', allow_links=True, allow_dirs=True) | ||
58 | base_sbin_dir = d.expand('${base_sbindir}') | ||
59 | do_split_packages(d, base_sbin_dir, '(.*)', '${KLIBC_UTILS_PKGNAME}-%s', 'Klibc util for %s', extra_depends='${EXTRA_KLIBC_DEPS}', allow_dirs=True) | ||
60 | } | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.4.bb new file mode 100644 index 000000000..06e71cb7b --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.4.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "klibc utils for initramfs" | ||
2 | |||
3 | FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" | ||
4 | |||
5 | PACKAGES = "${PN}" | ||
6 | FILES_${PN} = "" | ||
7 | |||
8 | KLIBC_UTILS_VARIANT = "shared" | ||
9 | KLIBC_UTILS_PKGNAME = "klibc-utils" | ||
10 | |||
11 | require klibc-utils.inc | ||
12 | require klibc.inc | ||
13 | |||
14 | DEPENDS = "klibc" | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc new file mode 100644 index 000000000..f3e9972a4 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc | |||
@@ -0,0 +1,52 @@ | |||
1 | DESCRIPTION = "klibc is intended to be a minimalistic libc subset for \ | ||
2 | use with initramfs. It is deliberately written for small size, \ | ||
3 | minimal entaglement, and portability, not speed." | ||
4 | SECTION = "libs" | ||
5 | LICENSE = "BSD-3-Clause & GPL-2.0 & MIT & Zlib" | ||
6 | LIC_FILES_CHKSUM = "file://usr/klibc/LICENSE;md5=d75181f10e998c21eb147f6d2e43ce8b" | ||
7 | DEPENDS = "linux-libc-headers perl-native" | ||
8 | SRCREV = "7763dd33e5b8eed4b9e3c583c02c10176fd550d3" | ||
9 | |||
10 | SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git" | ||
11 | SRC_URI_append_linux-gnueabi = " file://klibc-config-eabi.patch \ | ||
12 | file://armv4-fix-v4bx.patch \ | ||
13 | " | ||
14 | SRC_URI_append_linux-uclibceabi = " file://klibc-config-eabi.patch \ | ||
15 | file://armv4-fix-v4bx.patch \ | ||
16 | " | ||
17 | SRC_URI += "file://klibc-linux-libc-dev.patch \ | ||
18 | file://staging.patch \ | ||
19 | file://klcc-consider-sysroot.patch \ | ||
20 | " | ||
21 | |||
22 | S = "${WORKDIR}/git" | ||
23 | |||
24 | EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ | ||
25 | 'CROSS_COMPILE=${TARGET_PREFIX}' \ | ||
26 | 'KLIBCKERNELSRC=${STAGING_DIR_TARGET}${exec_prefix}' \ | ||
27 | 'prefix=${exec_prefix}' \ | ||
28 | 'INSTALLROOT=${D}' \ | ||
29 | 'SHLIBDIR=${libdir}' \ | ||
30 | " | ||
31 | |||
32 | export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" | ||
33 | |||
34 | do_configure () { | ||
35 | ln -sf "${STAGING_DIR_TARGET}${exec_prefix}" linux | ||
36 | } | ||
37 | |||
38 | INHIBIT_PACKAGE_STRIP = "1" | ||
39 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
40 | KLIBC_ARCH = "${TARGET_ARCH}" | ||
41 | KLIBC_ARCH_aarch64 = "arm64" | ||
42 | KLIBC_ARCH_armeb = "arm" | ||
43 | KLIBC_ARCH_mipsel = "mips" | ||
44 | KLIBC_ARCH_x86 = "i386" | ||
45 | KLIBC_ARCH_x86-64 = "x86_64" | ||
46 | KLIBC_ARCH_i486 = "i386" | ||
47 | KLIBC_ARCH_i586 = "i386" | ||
48 | KLIBC_ARCH_i686 = "i386" | ||
49 | KLIBC_ARCH_pentium = "i386" | ||
50 | KLIBC_ARCH_powerpc = "ppc" | ||
51 | KLIBC_ARCH_powerpc64 = "ppc64" | ||
52 | THIS_LIBKLIBC = "libklibc (= ${PV})" | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.4.bb new file mode 100644 index 000000000..bc80f382f --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.4.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | SUMMARY = "klibc, a small C library for use with initramfs" | ||
2 | |||
3 | do_install() { | ||
4 | oe_runmake install | ||
5 | # the crosscompiler is packaged by klcc-cross | ||
6 | # remove klcc | ||
7 | rm ${D}${bindir}/klcc | ||
8 | # remove now empty dir | ||
9 | rmdir ${D}${bindir} | ||
10 | install -d ${D}${libdir} | ||
11 | install -m 755 usr/klibc/klibc-*.so ${D}${libdir} | ||
12 | (cd ${D}${libdir}; ln -s klibc-*.so klibc.so) | ||
13 | } | ||
14 | |||
15 | PACKAGES = "libklibc libklibc-staticdev libklibc-dev" | ||
16 | |||
17 | FILES_libklibc = "${libdir}/klibc-*.so" | ||
18 | FILES_libklibc-staticdev = "${libdir}/klibc/lib/libc.a" | ||
19 | FILES_libklibc-dev = "${libdir}/klibc.so \ | ||
20 | ${libdir}/klibc/lib/* \ | ||
21 | ${libdir}/klibc/include/* \ | ||
22 | " | ||
23 | |||
24 | require klibc.inc | ||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch new file mode 100644 index 000000000..b7dad878b --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | --- a/Makefile 2012-05-01 19:46:47.000000000 +0200 | ||
2 | +++ b/Makefile 2012-05-01 19:48:01.000000000 +0200 | ||
3 | @@ -16,27 +16,13 @@ | ||
4 | |||
5 | TESTS = tests | ||
6 | |||
7 | -MTD_BINS = \ | ||
8 | - ftl_format flash_erase nanddump doc_loadbios \ | ||
9 | - ftl_check mkfs.jffs2 flash_lock flash_unlock \ | ||
10 | - flash_otp_info flash_otp_dump mtd_debug flashcp nandwrite nandtest \ | ||
11 | - jffs2dump \ | ||
12 | - nftldump nftl_format docfdisk \ | ||
13 | - rfddump rfdformat \ | ||
14 | - serve_image recv_image \ | ||
15 | - sumtool jffs2reader | ||
16 | UBI_BINS = \ | ||
17 | ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \ | ||
18 | ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol | ||
19 | |||
20 | -BINS = $(MTD_BINS) | ||
21 | -BINS += mkfs.ubifs/mkfs.ubifs | ||
22 | -BINS += $(addprefix ubi-utils/,$(UBI_BINS)) | ||
23 | -SCRIPTS = flash_eraseall | ||
24 | +BINS = $(addprefix ubi-utils/,$(UBI_BINS)) | ||
25 | |||
26 | TARGETS = $(BINS) | ||
27 | -TARGETS += lib/libmtd.a | ||
28 | -TARGETS += ubi-utils/libubi.a | ||
29 | |||
30 | OBJDEPS = $(BUILDDIR)/include/version.h | ||
31 | |||
32 | @@ -58,12 +44,9 @@ | ||
33 | rm -f $(BUILDDIR)/include/version.h | ||
34 | $(MAKE) -C $(TESTS) clean | ||
35 | |||
36 | -install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS} | ||
37 | +install:: $(addprefix $(BUILDDIR)/,${BINS}) | ||
38 | mkdir -p ${DESTDIR}/${SBINDIR} | ||
39 | install -m 0755 $^ ${DESTDIR}/${SBINDIR}/ | ||
40 | - mkdir -p ${DESTDIR}/${MANDIR}/man1 | ||
41 | - install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/ | ||
42 | - -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1 | ||
43 | |||
44 | tests:: | ||
45 | $(MAKE) -C $(TESTS) | ||
46 | @@ -88,7 +71,6 @@ | ||
47 | LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) | ||
48 | LDLIBS_jffs2reader = -lz $(LZOLDLIBS) | ||
49 | |||
50 | -$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v)))) | ||
51 | |||
52 | # | ||
53 | # Common libmtd | ||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch new file mode 100644 index 000000000..0a48416c0 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch | |||
@@ -0,0 +1,8 @@ | |||
1 | --- a/common.mk 2012-04-29 18:15:30.000000000 +0200 | ||
2 | +++ b/common.mk 2012-04-29 00:51:53.000000000 +0200 | ||
3 | @@ -1,4 +1,4 @@ | ||
4 | -CC := $(CROSS)gcc | ||
5 | +CC := $(CROSS)klcc | ||
6 | AR := $(CROSS)ar | ||
7 | RANLIB := $(CROSS)ranlib | ||
8 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch new file mode 100644 index 000000000..45f2439c8 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | --- a/ubi-utils/libiniparser.c 2012-05-29 23:46:08.000000000 +0200 | ||
2 | +++ b/ubi-utils/libiniparser.c 2012-05-29 23:45:01.000000000 +0200 | ||
3 | @@ -327,6 +327,8 @@ | ||
4 | the notfound value is returned. | ||
5 | */ | ||
6 | /*--------------------------------------------------------------------------*/ | ||
7 | +/* Floating-point is not supported in klibc */ | ||
8 | +/* | ||
9 | double iniparser_getdouble(dictionary * d, char * key, double notfound) | ||
10 | { | ||
11 | char * str ; | ||
12 | @@ -335,6 +337,7 @@ | ||
13 | if (str==INI_INVALID_KEY) return notfound ; | ||
14 | return atof(str); | ||
15 | } | ||
16 | +*/ | ||
17 | |||
18 | /*-------------------------------------------------------------------------*/ | ||
19 | /** | ||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch new file mode 100644 index 000000000..b52e20789 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | --- a/ubi-utils/libubi.c 2012-05-01 01:57:51.000000000 +0200 | ||
2 | +++ b/ubi-utils/libubi.c 2012-05-01 01:55:14.000000000 +0200 | ||
3 | @@ -686,7 +706,7 @@ | ||
4 | * success and %-1 in case of failure. @r->ubi_num contains newly created UBI | ||
5 | * device number. | ||
6 | */ | ||
7 | -static int do_attach(const char *node, const struct ubi_attach_req *r) | ||
8 | +static int do_attach(const char *node, struct ubi_attach_req *r) | ||
9 | { | ||
10 | int fd, ret; | ||
11 | |||
12 | @@ -1346,13 +1346,13 @@ | ||
13 | |||
14 | int ubi_set_property(int fd, uint8_t property, uint64_t value) | ||
15 | { | ||
16 | - struct ubi_set_prop_req r; | ||
17 | + struct ubi_set_vol_prop_req r; | ||
18 | |||
19 | - memset(&r, 0, sizeof(struct ubi_set_prop_req)); | ||
20 | + memset(&r, 0, sizeof(struct ubi_set_vol_prop_req)); | ||
21 | r.property = property; | ||
22 | r.value = value; | ||
23 | |||
24 | - return ioctl(fd, UBI_IOCSETPROP, &r); | ||
25 | + return ioctl(fd, UBI_IOCSETVOLPROP, &r); | ||
26 | } | ||
27 | |||
28 | int ubi_leb_unmap(int fd, int lnum) | ||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch new file mode 100644 index 000000000..d21ed577b --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | --- a/ubi-utils/ubiformat.c 2012-05-03 01:14:39.000000000 +0200 | ||
2 | +++ b/ubi-utils/ubiformat.c 2012-05-20 23:11:57.000000000 +0200 | ||
3 | @@ -246,7 +246,7 @@ | ||
4 | |||
5 | while (1) { | ||
6 | normsg_cont("continue? (yes/no) "); | ||
7 | - if (scanf("%3s", buf) == EOF) { | ||
8 | + if (fgets(buf,4,stdin) == NULL) { | ||
9 | sys_errmsg("scanf returned unexpected EOF, assume \"yes\""); | ||
10 | return 1; | ||
11 | } | ||
12 | @@ -262,7 +262,7 @@ | ||
13 | char buf[4]; | ||
14 | |||
15 | while (1) { | ||
16 | - if (scanf("%3s", buf) == EOF) { | ||
17 | + if (fgets(buf,4,stdin) == NULL) { | ||
18 | sys_errmsg("scanf returned unexpected EOF, assume \"no\""); | ||
19 | return 0; | ||
20 | } | ||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.0.bb b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.0.bb new file mode 100644 index 000000000..134dd80f0 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.0.bb | |||
@@ -0,0 +1,49 @@ | |||
1 | SUMMARY = "UBI utils statically compiled against klibc" | ||
2 | DESCRIPTION = "Small sized tools from mtd-utils for use with initramfs." | ||
3 | SECTION = "base" | ||
4 | DEPENDS = "zlib lzo e2fsprogs util-linux" | ||
5 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
6 | LICENSE = "GPLv2+" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
8 | file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" | ||
9 | |||
10 | |||
11 | inherit klibc | ||
12 | |||
13 | SRC_URI = "git://git.infradead.org/mtd-utils.git;tag=ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f \ | ||
14 | file://Makefile.patch \ | ||
15 | file://common.mk.patch \ | ||
16 | file://libubi.c.patch \ | ||
17 | file://libiniparser.c.patch \ | ||
18 | file://ubiformat.c.patch \ | ||
19 | " | ||
20 | |||
21 | S = "${WORKDIR}/git/" | ||
22 | |||
23 | EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}include -DWITHOUT_XATTR' 'BUILDDIR=${S}'" | ||
24 | |||
25 | do_install () { | ||
26 | |||
27 | install -d ${D}${sbindir} | ||
28 | oe_runmake DESTDIR="${D}" install | ||
29 | |||
30 | } | ||
31 | |||
32 | PACKAGES = "ubi-utils-klibc-dbg" | ||
33 | |||
34 | PACKAGES =+ "ubinfo-klibc ubiattach-klibc ubidetach-klibc mtdinfo-klibc ubiupdatevol-klibc \ | ||
35 | ubimkvol-klibc ubirename-klibc ubirmvol-klibc ubirsvol-klibc \ | ||
36 | ubinize-klibc ubiformat-klibc ubicrc32-klibc" | ||
37 | |||
38 | FILES_ubinfo-klibc = "${sbindir}/ubinfo" | ||
39 | FILES_ubiattach-klibc = "${sbindir}/ubiattach" | ||
40 | FILES_ubidetach-klibc = "${sbindir}/ubidetach" | ||
41 | FILES_mtdinfo-klibc = "${sbindir}/mtdinfo" | ||
42 | FILES_ubiupdatevol-klibc = "${sbindir}/ubiupdatevol" | ||
43 | FILES_ubimkvol-klibc = "${sbindir}/ubimkvol" | ||
44 | FILES_ubirename-klibc = "${sbindir}/ubirename" | ||
45 | FILES_ubirmvol-klibc = "${sbindir}/ubirmvol" | ||
46 | FILES_ubirsvol-klibc = "${sbindir}/ubirsvol" | ||
47 | FILES_ubinize-klibc = "${sbindir}/ubinize" | ||
48 | FILES_ubiformat-klibc = "${sbindir}/ubiformat" | ||
49 | FILES_ubicrc32-klibc = "${sbindir}/ubicrc32" | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch new file mode 100644 index 000000000..0ff61e543 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- a/kexec/arch/arm/crashdump-arm.c | ||
2 | +++ b/kexec/arch/arm/crashdump-arm.c | ||
3 | @@ -20,7 +20,7 @@ | ||
4 | * along with this program; if not, write to the Free Software | ||
5 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
6 | */ | ||
7 | -#include <elf.h> | ||
8 | +#include "../../../include/elf.h" | ||
9 | #include <errno.h> | ||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch new file mode 100644 index 000000000..35100a3b4 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/Makefile.in | ||
2 | +++ b/Makefile.in | ||
3 | @@ -46,7 +46,7 @@ | ||
4 | # where necessary. | ||
5 | CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \ | ||
6 | -Iinclude/ | ||
7 | -CFLAGS = @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
8 | +CFLAGS = @CFLAGS@ -static -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
9 | PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@ | ||
10 | ASFLAGS = @ASFLAGS@ | ||
11 | LDFLAGS = @LDFLAGS@ | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch new file mode 100644 index 000000000..7f8cddd35 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/kexec/ifdown.c | ||
2 | +++ b/kexec/ifdown.c | ||
3 | @@ -14,7 +14,7 @@ | ||
4 | #include <sys/ioctl.h> | ||
5 | #include <sys/socket.h> | ||
6 | #include <sys/time.h> | ||
7 | -#include <sys/errno.h> | ||
8 | +#include <errno.h> | ||
9 | |||
10 | #include <net/if.h> | ||
11 | #include <netinet/in.h> | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch new file mode 100644 index 000000000..c666afcac --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | --- a/kexec/kexec-elf-rel.c | ||
2 | +++ b/kexec/kexec-elf-rel.c | ||
3 | @@ -4,7 +4,7 @@ | ||
4 | #include <stdio.h> | ||
5 | #include <errno.h> | ||
6 | #include <stdlib.h> | ||
7 | -#include "elf.h" | ||
8 | +#include "../include/elf.h" | ||
9 | #include <boot/elf_boot.h> | ||
10 | #include "kexec.h" | ||
11 | #include "kexec-elf.h" | ||
12 | |||
13 | --- a/kexec/arch/arm/kexec-elf-rel-arm.c | ||
14 | +++ b/kexec/arch/arm/kexec-elf-rel-arm.c | ||
15 | @@ -1,5 +1,5 @@ | ||
16 | #include <stdio.h> | ||
17 | -#include <elf.h> | ||
18 | +#include "../../../include/elf.h" | ||
19 | #include "../../kexec.h" | ||
20 | #include "../../kexec-elf.h" | ||
21 | |||
22 | |||
23 | --- a/kexec/arch/i386/kexec-elf-rel-x86.c | ||
24 | +++ b/kexec/arch/i386/kexec-elf-rel-x86.c | ||
25 | @@ -1,5 +1,5 @@ | ||
26 | #include <stdio.h> | ||
27 | -#include <elf.h> | ||
28 | +#include "../../../include/elf.h" | ||
29 | #include "../../kexec.h" | ||
30 | #include "../../kexec-elf.h" | ||
31 | |||
32 | |||
33 | --- a/kexec/arch/ppc/kexec-elf-rel-ppc.c | ||
34 | +++ b/kexec/arch/ppc/kexec-elf-rel-ppc.c | ||
35 | @@ -1,5 +1,5 @@ | ||
36 | #include <stdio.h> | ||
37 | -#include <elf.h> | ||
38 | +#include "../../../include/elf.h" | ||
39 | #include "../../kexec.h" | ||
40 | #include "../../kexec-elf.h" | ||
41 | |||
42 | |||
43 | --- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c | ||
44 | +++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c | ||
45 | @@ -1,5 +1,5 @@ | ||
46 | #include <stdio.h> | ||
47 | -#include <elf.h> | ||
48 | +#include "../../../include/elf.h" | ||
49 | #include <string.h> | ||
50 | #include "../../kexec.h" | ||
51 | #include "../../kexec-elf.h" | ||
52 | |||
53 | --- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c | ||
54 | +++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c | ||
55 | @@ -1,5 +1,5 @@ | ||
56 | #include <stdio.h> | ||
57 | -#include <elf.h> | ||
58 | +#include "../../../include/elf.h" | ||
59 | #include "../../kexec.h" | ||
60 | #include "../../kexec-elf.h" | ||
61 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-syscall.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-syscall.patch new file mode 100644 index 000000000..081de1bb5 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-syscall.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | --- a/kexec/kexec-syscall.h | ||
2 | +++ b/kexec/kexec-syscall.h | ||
3 | @@ -2,7 +2,7 @@ | ||
4 | #define KEXEC_SYSCALL_H | ||
5 | |||
6 | #define __LIBRARY__ | ||
7 | -#include <syscall.h> | ||
8 | +/*#include <syscall.h>*/ | ||
9 | #include <sys/syscall.h> | ||
10 | #include <unistd.h> | ||
11 | |||
12 | @@ -23,6 +23,7 @@ | ||
13 | #define LINUX_REBOOT_CMD_KEXEC 0x45584543 | ||
14 | |||
15 | #ifndef __NR_kexec_load | ||
16 | +/* | ||
17 | #ifdef __i386__ | ||
18 | #define __NR_kexec_load 283 | ||
19 | #endif | ||
20 | @@ -61,19 +62,21 @@ | ||
21 | #ifndef __NR_kexec_load | ||
22 | #error Unknown processor architecture. Needs a kexec_load syscall number. | ||
23 | #endif | ||
24 | +*/ | ||
25 | #endif /*ifndef __NR_kexec_load*/ | ||
26 | |||
27 | struct kexec_segment; | ||
28 | - | ||
29 | +/* | ||
30 | static inline long kexec_load(void *entry, unsigned long nr_segments, | ||
31 | struct kexec_segment *segments, unsigned long flags) | ||
32 | { | ||
33 | return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags); | ||
34 | } | ||
35 | - | ||
36 | +*/ | ||
37 | static inline long kexec_reboot(void) | ||
38 | { | ||
39 | - return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); | ||
40 | + //return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); | ||
41 | + return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); | ||
42 | } | ||
43 | |||
44 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch new file mode 100644 index 000000000..56cdfb08d --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | --- a/purgatory/arch/ppc/crt.S | ||
2 | +++ b/purgatory/arch/ppc/crt.S | ||
3 | @@ -249,6 +249,7 @@ | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | +/* already defined in misc.S | ||
8 | _GLOBAL(__lshrdi3) | ||
9 | subfic 6,5,32 | ||
10 | srw 4,4,5 # LSW = count > 31 ? 0 : LSW >> count | ||
11 | @@ -259,5 +260,7 @@ | ||
12 | srw 3,3,5 # MSW = MSW >> count | ||
13 | or 4,4,7 # LSW |= t2 | ||
14 | blr | ||
15 | +*/ | ||
16 | + | ||
17 | #endif | ||
18 | #endif | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch new file mode 100644 index 000000000..41fc1168f --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | --- a/purgatory/Makefile | ||
2 | +++ b/purgatory/Makefile | ||
3 | @@ -47,7 +47,7 @@ | ||
4 | $(PURGATORY): CC=$(TARGET_CC) | ||
5 | $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \ | ||
6 | $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
7 | - -Os -fno-builtin -ffreestanding | ||
8 | + -Os -fno-builtin -ffreestanding -nostdinc | ||
9 | |||
10 | $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
11 | -I$(srcdir)/purgatory/include \ | ||
12 | @@ -61,7 +61,8 @@ | ||
13 | |||
14 | $(PURGATORY): $(PURGATORY_OBJS) | ||
15 | $(MKDIR) -p $(@D) | ||
16 | - $(CC) $(LDFLAGS) -o $@ $^ | ||
17 | +# $(CC) $(LDFLAGS) -o $@ $^ | ||
18 | + $(LD) $(LDFLAGS) -o $@ $^ | ||
19 | |||
20 | # $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB) | ||
21 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch new file mode 100644 index 000000000..5710561b1 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch | |||
@@ -0,0 +1,9 @@ | |||
1 | --- a/purgatory/string.c | ||
2 | +++ b/purgatory/string.c | ||
3 | @@ -1,5 +1,5 @@ | ||
4 | #include <stddef.h> | ||
5 | -#include <string.h> | ||
6 | +/* #include <string.h> */ | ||
7 | |||
8 | size_t strnlen(const char *s, size_t max) | ||
9 | { | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch new file mode 100644 index 000000000..85bf7aa4f --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/util_lib/include/sha256.h | ||
2 | +++ b/util_lib/include/sha256.h | ||
3 | @@ -1,7 +1,8 @@ | ||
4 | #ifndef SHA256_H | ||
5 | #define SHA256_H | ||
6 | |||
7 | -#include <sys/types.h> | ||
8 | +//#include <sys/types.h> | ||
9 | +#include <stddef.h> | ||
10 | #include <stdint.h> | ||
11 | |||
12 | typedef struct | ||
13 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch new file mode 100644 index 000000000..04a97e6bc --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/kexec/crashdump-elf.c | ||
2 | +++ b/kexec/crashdump-elf.c | ||
3 | @@ -47,7 +47,8 @@ | ||
4 | if (xen_present()) | ||
5 | nr_cpus = xen_get_nr_phys_cpus(); | ||
6 | else | ||
7 | - nr_cpus = sysconf(_SC_NPROCESSORS_CONF); | ||
8 | + /*nr_cpus = sysconf(_SC_NPROCESSORS_CONF);*/ | ||
9 | + nr_cpus = 1; | ||
10 | |||
11 | if (nr_cpus < 0) { | ||
12 | return -1; | ||
13 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch new file mode 100644 index 000000000..77a1c01a1 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | --- a/kexec/arch/i386/x86-linux-setup.c | ||
2 | +++ b/kexec/arch/i386/x86-linux-setup.c | ||
3 | @@ -280,9 +280,9 @@ static int add_edd_entry(struct x86_linu | ||
4 | memset(edd_info, 0, sizeof(struct edd_info)); | ||
5 | |||
6 | /* extract the device number */ | ||
7 | - if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) { | ||
8 | + if (sscanf(strrchr(sysfs_name,'/') + 1, "int13_dev%hhx", &devnum) != 1) { | ||
9 | fprintf(stderr, "Invalid format of int13_dev dir " | ||
10 | - "entry: %s\n", basename(sysfs_name)); | ||
11 | + "entry: %s\n", strrchr(sysfs_name,'/') + 1); | ||
12 | return -1; | ||
13 | } | ||
14 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch new file mode 100644 index 000000000..9500bd604 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/Makefile.in | ||
2 | +++ b/Makefile.in | ||
3 | @@ -106,8 +106,8 @@ | ||
4 | |||
5 | MAN_PAGES:= kexec/kexec.8 | ||
6 | MAN_PAGES+= kdump/kdump.8 | ||
7 | -BINARIES_i386:= $(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test | ||
8 | -BINARIES_x86_64:=$(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test | ||
9 | +BINARIES_i386:= $(SBINDIR)/kexec | ||
10 | +BINARIES_x86_64:=$(SBINDIR)/kexec | ||
11 | BINARIES:=$(SBINDIR)/kexec $(SBINDIR)/kdump $(BINARIES_$(ARCH)) | ||
12 | |||
13 | TARGETS:=$(BINARIES) $(MAN_PAGES) | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch new file mode 100644 index 000000000..a497c9a63 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | --- a/purgatory/arch/i386/pic.c | ||
2 | +++ b/purgatory/arch/i386/pic.c | ||
3 | @@ -16,7 +16,7 @@ | ||
4 | * along with this program; if not, write to the Free Software | ||
5 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
6 | */ | ||
7 | -#include <sys/io.h> | ||
8 | +#include "include/arch/io.h" | ||
9 | #include <purgatory.h> | ||
10 | #include "purgatory-x86.h" | ||
11 | |||
12 | |||
13 | --- a/purgatory/arch/i386/vga.c | ||
14 | +++ b/purgatory/arch/i386/vga.c | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#include <sys/io.h> | ||
17 | +#include "include/arch/io.h" | ||
18 | #include <purgatory.h> | ||
19 | #include "purgatory-x86.h" | ||
20 | |||
21 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch new file mode 100644 index 000000000..cad695154 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- a/kexec/arch/i386/x86-linux-setup.c | ||
2 | +++ b/kexec/arch/i386/x86-linux-setup.c | ||
3 | @@ -176,6 +176,8 @@ static int file_scanf(const char *dir, c | ||
4 | FILE *fp; | ||
5 | int retno; | ||
6 | char filename[PATH_MAX]; | ||
7 | + long line_size = MAX_LINE; | ||
8 | + char *line; | ||
9 | |||
10 | snprintf(filename, PATH_MAX, "%s/%s", dir, file); | ||
11 | filename[PATH_MAX-1] = 0; | ||
12 | @@ -186,7 +188,14 @@ static int file_scanf(const char *dir, c | ||
13 | } | ||
14 | |||
15 | va_start(argptr, scanf_line); | ||
16 | - retno = vfscanf(fp, scanf_line, argptr); | ||
17 | + | ||
18 | + line = xmalloc(sizeof(line) * line_size); | ||
19 | + while(fgets(line, sizeof(line), fp) != NULL ) { | ||
20 | + line_size += MAX_LINE; | ||
21 | + line = xrealloc(line,line_size); | ||
22 | + } | ||
23 | + retno = vsscanf(line, scanf_line, argptr); | ||
24 | + | ||
25 | va_end(argptr); | ||
26 | |||
27 | fclose(fp); | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb new file mode 100644 index 000000000..b1b6ffca4 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | # the binaries are statically linked against klibc | ||
2 | require recipes-kernel/kexec/kexec-tools.inc | ||
3 | SUMMARY = "Kexec tools, statically compiled against klibc" | ||
4 | SRC_URI[md5sum] = "92eff93b097475b7767f8c98df84408a" | ||
5 | SRC_URI[sha256sum] = "09e180ff36dee087182cdc939ba6c6917b6adbb5fc12d589f31fd3659b6471f2" | ||
6 | |||
7 | inherit klibc | ||
8 | |||
9 | FILESPATH =. "${FILE_DIRNAME}/kexec-tools-${PV}:" | ||
10 | |||
11 | SRC_URI += " \ | ||
12 | file://kexec-elf-rel.patch \ | ||
13 | file://kexec-syscall.patch \ | ||
14 | file://cflags_static.patch \ | ||
15 | file://ifdown_errno.patch \ | ||
16 | file://purgatory_flags.patch \ | ||
17 | file://purgatory_string.patch \ | ||
18 | file://sha256.patch \ | ||
19 | file://sysconf_nrprocessors.patch \ | ||
20 | " | ||
21 | |||
22 | SRC_URI_append_arm = " file://arm_crashdump.patch" | ||
23 | SRC_URI_append_powerpc = " file://ppc__lshrdi3.patch" | ||
24 | SRC_URI_append_x86 = " file://x86_sys_io.patch file://x86_basename.patch file://x86_vfscanf.patch file://x86_kexec_test.patch" | ||
25 | SRC_URI_append_x86-64 = " file://x86_sys_io.patch file://x86_basename.patch file://x86_vfscanf.patch file://x86_kexec_test.patch" | ||
26 | |||
27 | S = "${WORKDIR}/kexec-tools-${PV}" | ||
28 | |||
29 | EXTRA_OECONF += "--without-zlib --without-lzma --without-xen" | ||
30 | |||
31 | CFLAGS += "-I${STAGING_DIR_HOST}${libdir}/klibc/include -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" | ||
32 | CFLAGS_x86-64 += "-I${STAGING_DIR_HOST}${libdir}/klibc/include -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" | ||
33 | |||
34 | PACKAGES =+ "kexec-klibc kdump-klibc" | ||
35 | |||
36 | FILES_kexec-klibc = "${sbindir}/kexec" | ||
37 | FILES_kdump-klibc = "${sbindir}/kdump" | ||
diff --git a/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bb b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bb new file mode 100644 index 000000000..a823e0fb3 --- /dev/null +++ b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bb | |||
@@ -0,0 +1,26 @@ | |||
1 | require recipes-kernel/linux/linux-yocto-tiny_3.10.bb | ||
2 | SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs" | ||
3 | |||
4 | PACKAGES = "" | ||
5 | PROVIDES = "" | ||
6 | |||
7 | KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${PV}-${MACHINE}" | ||
8 | KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${MACHINE}" | ||
9 | |||
10 | INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image" | ||
11 | INITRAMFS_TASK = "${INITRAMFS_IMAGE}:do_rootfs" | ||
12 | |||
13 | # disable unneeded tasks | ||
14 | do_install[noexec] = "1" | ||
15 | do_package[noexec] = "1" | ||
16 | do_package_qa[noexec] = "1" | ||
17 | do_packagedata[noexec] = "1" | ||
18 | do_package_deb[noexec] = "1" | ||
19 | do_package_ipk[noexec] = "1" | ||
20 | do_package_rpm[noexec] = "1" | ||
21 | do_package_tar[noexec] = "1" | ||
22 | do_package_write_deb[noexec] = "1" | ||
23 | do_package_write_ipk[noexec] = "1" | ||
24 | do_package_write_rpm[noexec] = "1" | ||
25 | do_package_write_tar[noexec] = "1" | ||
26 | do_populate_sysroot[noexec] = "1" | ||
diff --git a/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.17.bb b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.17.bb new file mode 100644 index 000000000..f3296c7e8 --- /dev/null +++ b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.17.bb | |||
@@ -0,0 +1,26 @@ | |||
1 | require recipes-kernel/linux/linux-yocto-tiny_3.17.bb | ||
2 | SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs" | ||
3 | |||
4 | PACKAGES = "" | ||
5 | PROVIDES = "" | ||
6 | |||
7 | KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${PV}-${MACHINE}" | ||
8 | KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${MACHINE}" | ||
9 | |||
10 | INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image" | ||
11 | INITRAMFS_TASK = "${INITRAMFS_IMAGE}:do_rootfs" | ||
12 | |||
13 | # disable unneeded tasks | ||
14 | do_install[noexec] = "1" | ||
15 | do_package[noexec] = "1" | ||
16 | do_package_qa[noexec] = "1" | ||
17 | do_packagedata[noexec] = "1" | ||
18 | do_package_deb[noexec] = "1" | ||
19 | do_package_ipk[noexec] = "1" | ||
20 | do_package_rpm[noexec] = "1" | ||
21 | do_package_tar[noexec] = "1" | ||
22 | do_package_write_deb[noexec] = "1" | ||
23 | do_package_write_ipk[noexec] = "1" | ||
24 | do_package_write_rpm[noexec] = "1" | ||
25 | do_package_write_tar[noexec] = "1" | ||
26 | do_populate_sysroot[noexec] = "1" | ||