Skip to contentSkip to conversation

mkinitcpio: add new recipe

PATCH In review Ioan-Adrian Ratiu 3 participants 3 messages Sep 27, 2017 – Oct 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkinitcpio: add new recipe

This recipe provides a very flexible and useful tool for building initfamfs'es from custom directories, having the ability to auto-detect kernel module dependencies (for kernels built outside OE), add custom build/runtime hooks, etc.

It can also be used on deployed systems (installed images on targets) to re-generate the initramfs when a new kernel is installed from a package feed.

---
 ...0001-Makefile-don-t-check-asciidoc-output.patch | 35 ++++++++++++++++++++++
 ...efile-don-t-preserve-ownership-on-install.patch | 28 +++++++++++++++++
 .../recipes-devtools/mkinitcpio/mkinitcpio_git.bb  | 30 +++++++++++++++++++
 3 files changed, 93 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/0001-Makefile-don-t-check-asciidoc-output.patch
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/0002-Makefile-don-t-preserve-ownership-on-install.patch
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb
meta-initramfs/recipes-devtools/mkinitcpio/files/0001-Makefile-don-t-check-asciidoc-output.patch new file +35 -0
new file mode 100644
index 000000000..30ce60b6f
@@ -0,0 +1,35 @@
+From 6388c79f5d9458c58451c231eb6163184d6801bc Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 15:28:19 +0300
+Subject: [PATCH 1/2] Makefile: don't check asciidoc output
+
+Don't use xmllint to validate the doc xsl schema because mkinitcpio's
+use of docbook is broken in a cross-compile environment (docbookx.dtd
+can't be found even though it's present in the recipe's sysroot).
+
+Investigating this is time consuming and this check is 99.9% benign
+anyway so it's safe to disable it.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 264f077..dbbf0a8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -72,7 +72,7 @@ install: all
+ 
+ doc: $(MANPAGES)
+ man/%: man/%.txt Makefile
+-	a2x -d manpage \
++	a2x -L -d manpage \
+ 		-f manpage \
+ 		-a manversion=$(VERSION) \
+ 		-a manmanual="mkinitcpio manual" $<
+-- 
+2.14.1
+
meta-initramfs/recipes-devtools/mkinitcpio/files/0002-Makefile-don-t-preserve-ownership-on-install.patch new file +28 -0
new file mode 100644
index 000000000..a22b0631c
@@ -0,0 +1,28 @@
+From ed9ce55000e26801b69a38be7c53c8c529313492 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 18:03:05 +0300
+Subject: [PATCH 2/2] Makefile: don't preserve ownership on install
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dbbf0a8..db31313 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,7 @@ install: all
+ 	install -m644 -t $(DESTDIR)/usr/lib/initcpio init_functions functions
+ 	install -m644 udev/01-memdisk.rules $(DESTDIR)/usr/lib/initcpio/udev/01-memdisk.rules
+ 
+-	cp -at $(DESTDIR)/usr/lib/initcpio hooks install
++	cp -rt $(DESTDIR)/usr/lib/initcpio hooks install
+ 	install -m644 -t $(DESTDIR)/usr/share/mkinitcpio mkinitcpio.d/*
+ 	install -m644 systemd/mkinitcpio-generate-shutdown-ramfs.service \
+ 			$(DESTDIR)/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service
+-- 
+2.14.1
+
meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb new file +30 -0
new file mode 100644
index 000000000..2ecbf0bf4
@@ -0,0 +1,30 @@
+SUMMARY = "mkinitcpio is the next generation of initramfs creation."
+DESCRIPTION = "mkinitcpio is a modular tool for building an initramfs CPIO image, offering many advantages over alternative methods."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+
+PV = "v23+git${SRCPV}"
+
+# v23 tag
+SRCREV = "12e44319725517b869796bd71dbfd8db6521343a"
+
+SRC_URI = "\
+	git://git.archlinux.org/mkinitcpio.git \
+	file://0001-Makefile-don-t-check-asciidoc-output.patch \
+	file://0002-Makefile-don-t-preserve-ownership-on-install.patch \
+"
+
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} += "bash"
+
+DEPENDS += "asciidoc-native libxml2-native xmlto-native"
+
+inherit autotools-brokensep systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "mkinitcpio-generate-shutdown-ramfs.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+FILES_${PN} = "${bindir} ${sysconfdir} ${libdir} /usr/share"
Signature · 1 line
2.14.1
#1 lore raw
Quoted 9 lines · Ioan-Adrian Ratiu

This recipe provides a very flexible and useful tool for building initfamfs'es from custom directories, having the ability to auto-detect kernel module dependencies (for kernels built outside OE), add custom build/runtime hooks, etc.

It can also be used on deployed systems (installed images on targets) to re-generate the initramfs when a new kernel is installed from a package feed.

I see these errors
ERROR: mkinitcpio-v23+gitAUTOINC+12e4431972-r0 do_package_qa: QA
Issue: /usr/lib/initcpio/shutdown contained in package mkinitcpio requires /usr/bin/ash, but no providers found in RDEPENDS_mkinitcpio? [file-rdeps]
NOTE: recipe mkinitcpio-v23+gitAUTOINC+12e4431972-r0: task
do_populate_sysroot: Started
ERROR: mkinitcpio-v23+gitAUTOINC+12e4431972-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.

Quoted 129 lines
---
 ...0001-Makefile-don-t-check-asciidoc-output.patch | 35 ++++++++++++++++++++++
 ...efile-don-t-preserve-ownership-on-install.patch | 28 +++++++++++++++++
 .../recipes-devtools/mkinitcpio/mkinitcpio_git.bb  | 30 +++++++++++++++++++
 3 files changed, 93 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/0001-Makefile-don-t-check-asciidoc-output.patch
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/0002-Makefile-don-t-preserve-ownership-on-install.patch
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb
meta-initramfs/recipes-devtools/mkinitcpio/files/0001-Makefile-don-t-check-asciidoc-output.patch new file +35 -0
new file mode 100644
index 000000000..30ce60b6f
@@ -0,0 +1,35 @@
+From 6388c79f5d9458c58451c231eb6163184d6801bc Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 15:28:19 +0300
+Subject: [PATCH 1/2] Makefile: don't check asciidoc output
+
+Don't use xmllint to validate the doc xsl schema because mkinitcpio's
+use of docbook is broken in a cross-compile environment (docbookx.dtd
+can't be found even though it's present in the recipe's sysroot).
+
+Investigating this is time consuming and this check is 99.9% benign
+anyway so it's safe to disable it.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 264f077..dbbf0a8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -72,7 +72,7 @@ install: all
+
+ doc: $(MANPAGES)
+ man/%: man/%.txt Makefile
+-      a2x -d manpage \
++      a2x -L -d manpage \
+               -f manpage \
+               -a manversion=$(VERSION) \
+               -a manmanual="mkinitcpio manual" $<
+--
+2.14.1
+
meta-initramfs/recipes-devtools/mkinitcpio/files/0002-Makefile-don-t-preserve-ownership-on-install.patch new file +28 -0
new file mode 100644
index 000000000..a22b0631c
@@ -0,0 +1,28 @@
+From ed9ce55000e26801b69a38be7c53c8c529313492 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 18:03:05 +0300
+Subject: [PATCH 2/2] Makefile: don't preserve ownership on install
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dbbf0a8..db31313 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,7 @@ install: all
+       install -m644 -t $(DESTDIR)/usr/lib/initcpio init_functions functions
+       install -m644 udev/01-memdisk.rules $(DESTDIR)/usr/lib/initcpio/udev/01-memdisk.rules
+
+-      cp -at $(DESTDIR)/usr/lib/initcpio hooks install
++      cp -rt $(DESTDIR)/usr/lib/initcpio hooks install
+       install -m644 -t $(DESTDIR)/usr/share/mkinitcpio mkinitcpio.d/*
+       install -m644 systemd/mkinitcpio-generate-shutdown-ramfs.service \
+                       $(DESTDIR)/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service
+--
+2.14.1
+
meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb new file +30 -1
new file mode 100644
index 000000000..2ecbf0bf4
@@ -0,0 +1,30 @@
+SUMMARY = "mkinitcpio is the next generation of initramfs creation."
+DESCRIPTION = "mkinitcpio is a modular tool for building an initramfs CPIO image, offering many advantages over alternative methods."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+
+PV = "v23+git${SRCPV}"
+
+# v23 tag
+SRCREV = "12e44319725517b869796bd71dbfd8db6521343a"
+
+SRC_URI = "\
+       git://git.archlinux.org/mkinitcpio.git \
+       file://0001-Makefile-don-t-check-asciidoc-output.patch \
+       file://0002-Makefile-don-t-preserve-ownership-on-install.patch \
+"
+
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} += "bash"
+
+DEPENDS += "asciidoc-native libxml2-native xmlto-native"
+
+inherit autotools-brokensep systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "mkinitcpio-generate-shutdown-ramfs.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+FILES_${PN} = "${bindir} ${sysconfdir} ${libdir} /usr/share"
--

2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#2 lore raw

It also fails with:

ERROR: mkinitcpio-v23+gitAUTOINC+12e4431972-r0 do_package:
SYSTEMD_SERVICE_mkinitcpio value mkinitcpio-generate-shutdown-ramfs.service does not exist

as reported in latest "state of bitbake world" e-mail.

I've dropped this from master-next until both issues are fixed.

Quoted 177 lines · Khem Raj
Quoted 9 lines · Ioan-Adrian Ratiu

This recipe provides a very flexible and useful tool for building initfamfs'es from custom directories, having the ability to auto-detect kernel module dependencies (for kernels built outside OE), add custom build/runtime hooks, etc.

It can also be used on deployed systems (installed images on targets) to re-generate the initramfs when a new kernel is installed from a package feed.

I see these errors
ERROR: mkinitcpio-v23+gitAUTOINC+12e4431972-r0 do_package_qa: QA
Issue: /usr/lib/initcpio/shutdown contained in package mkinitcpio requires /usr/bin/ash, but no providers found in RDEPENDS_mkinitcpio? [file-rdeps]
NOTE: recipe mkinitcpio-v23+gitAUTOINC+12e4431972-r0: task
do_populate_sysroot: Started
ERROR: mkinitcpio-v23+gitAUTOINC+12e4431972-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.

Quoted 3 lines
---
 ...0001-Makefile-don-t-check-asciidoc-output.patch | 35

++++++++++++++++++++++

Quoted 1 line
 ...efile-don-t-preserve-ownership-on-install.patch | 28

+++++++++++++++++

Quoted 1 line
 .../recipes-devtools/mkinitcpio/mkinitcpio_git.bb  | 30

+++++++++++++++++++

Quoted 2 lines
 3 files changed, 93 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/

0001-Makefile-don-t-check-asciidoc-output.patch

Quoted 1 line
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/files/

0002-Makefile-don-t-preserve-ownership-on-install.patch

Quoted 1 line
 create mode 100644 meta-initramfs/recipes-devtools/mkinitcpio/

mkinitcpio_git.bb

Review

Quoted 2 lines
(quoted diff) +0 -0

0001-Makefile-don-t-check-asciidoc-output.patch b/meta-initramfs/recipes- devtools/mkinitcpio/files/0001-Makefile-don-t-check-asciidoc-output.patch

meta-initramfs/recipes-devtools/mkinitcpio/files/

Quoted 4 lines

new file mode 100644
index 000000000..30ce60b6f

meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +0 -0

0001-Makefile-don-t-check-asciidoc-output.patch

Review

Quoted 37 lines
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +35 -0
@@ -0,0 +1,35 @@
+From 6388c79f5d9458c58451c231eb6163184d6801bc Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 15:28:19 +0300
+Subject: [PATCH 1/2] Makefile: don't check asciidoc output
+
+Don't use xmllint to validate the doc xsl schema because mkinitcpio's
+use of docbook is broken in a cross-compile environment (docbookx.dtd
+can't be found even though it's present in the recipe's sysroot).
+
+Investigating this is time consuming and this check is 99.9% benign
+anyway so it's safe to disable it.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 264f077..dbbf0a8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -72,7 +72,7 @@ install: all
+
+ doc: $(MANPAGES)
+ man/%: man/%.txt Makefile
+-      a2x -d manpage \
++      a2x -L -d manpage \
+               -f manpage \
+               -a manversion=$(VERSION) \
+               -a manmanual="mkinitcpio manual" $<
+--
+2.14.1
+
(quoted diff) +0 -0

0002-Makefile-don-t-preserve-ownership-on-install.patch b/meta-initramfs/recipes-devtools/mkinitcpio/files/ 0002-Makefile-don-t-preserve-ownership-on-install.patch

meta-initramfs/recipes-devtools/mkinitcpio/files/

Quoted 4 lines

new file mode 100644
index 000000000..a22b0631c

meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +0 -0

0002-Makefile-don-t-preserve-ownership-on-install.patch

Quoted 9 lines
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +8 -0
@@ -0,0 +1,28 @@
+From ed9ce55000e26801b69a38be7c53c8c529313492 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Tue, 26 Sep 2017 18:03:05 +0300
+Subject: [PATCH 2/2] Makefile: don't preserve ownership on install
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Ioan-Adrian Ratiu <[email protected]>

meta-initramfs/recipes-devtools/mkinitcpio/files/ line 18

Quoted 10 lines
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +10 -0
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dbbf0a8..db31313 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,7 @@ install: all
+       install -m644 -t $(DESTDIR)/usr/lib/initcpio init_functions

functions

meta-initramfs/recipes-devtools/mkinitcpio/files/ line 19

Quoted 1 line
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +1 -0
+       install -m644 udev/01-memdisk.rules $(DESTDIR)/usr/lib/initcpio/

udev/01-memdisk.rules

meta-initramfs/recipes-devtools/mkinitcpio/files/ line 24

Quoted 5 lines
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +5 -0
+
+-      cp -at $(DESTDIR)/usr/lib/initcpio hooks install
++      cp -rt $(DESTDIR)/usr/lib/initcpio hooks install
+       install -m644 -t $(DESTDIR)/usr/share/mkinitcpio mkinitcpio.d/*
+       install -m644 systemd/mkinitcpio-generate-shutdown-ramfs.service

\

meta-initramfs/recipes-devtools/mkinitcpio/files/ line 25

Quoted 1 line
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +1 -0
+                       $(DESTDIR)/usr/lib/systemd/

system/mkinitcpio-generate-shutdown-ramfs.service

Review

Quoted 4 lines
meta-initramfs/recipes-devtools/mkinitcpio/files/ new file +3 -0
+--
+2.14.1
+
(quoted diff) +0 -0

_git.bb b/meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb

meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb line 2

Quoted 7 lines

new file mode 100644
index 000000000..2ecbf0bf4

meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb new file +2 -0
@@ -0,0 +1,30 @@
+SUMMARY = "mkinitcpio is the next generation of initramfs creation."
+DESCRIPTION = "mkinitcpio is a modular tool for building an initramfs

CPIO image, offering many advantages over alternative methods."

meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb

Quoted 3 lines
meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb new file +3 -0
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c5

0a"

Quoted 28 lines
meta-initramfs/recipes-devtools/mkinitcpio/mkinitcpio_git.bb new file +25 -1
+
+PV = "v23+git${SRCPV}"
+
+# v23 tag
+SRCREV = "12e44319725517b869796bd71dbfd8db6521343a"
+
+SRC_URI = "\
+       git://git.archlinux.org/mkinitcpio.git \
+       file://0001-Makefile-don-t-check-asciidoc-output.patch \
+       file://0002-Makefile-don-t-preserve-ownership-on-install.patch \
+"
+
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} += "bash"
+
+DEPENDS += "asciidoc-native libxml2-native xmlto-native"
+
+inherit autotools-brokensep systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "mkinitcpio-generate-shutdown-ramfs.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+FILES_${PN} = "${bindir} ${sysconfdir} ${libdir} /usr/share"
--

2.14.1

Quoted 5 lines

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel