From be5333c46b854112fd6b8f7ddb809e3ac43b188a Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 6 Oct 2014 19:27:06 -0400 Subject: [PATCH 1/3] Changed makefile to support building an image wi.. ..thout gzip compression. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 5948dc5..c215815 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ help: @scripts/meta help image: @scripts/meta image +image-no-gz: + @scripts/meta image-no-gz clean: @scripts/meta clean prepare: From 1f8a9f553f714a191ee69867f0cecc71afd7f0a8 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 6 Oct 2014 19:29:03 -0400 Subject: [PATCH 2/3] Changed makefile to support building an image wi.. ..thout gzip compression. --- scripts/meta | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/meta b/scripts/meta index 1a4d369..9364a9d 100755 --- a/scripts/meta +++ b/scripts/meta @@ -146,6 +146,28 @@ image() { fi } +image-no-gz() { + if ! [ -f "${sourceroot}/bin/busybox" ]; then die "Initramfs will not work without busybox."; fi + + einfo 'Building image...' + + ( cd "${sourceroot}" && find . | cpio --quiet -H newc -o > ../output/initramfs.cpio.gz) + + if [ -f "${sourceroot}/../output/initramfs.cpio" ]; then + einfo "output/initramfs.cpio is ready." + else + die "There is no initramfs.cpio, something goes wrong." + fi + + if [ -f "${sourceroot}/etc/dropbear/dropbear_rsa_host_key" ] || [ -f "${sourceroot}/etc/dropbear/dropbear_dss_host_key" ]; then + echo + ewarn "Your initramfs image contains sshd's server-side keys." + ewarn "Redistributing this image will be a security risk" + ewarn "for any server you use this initramfs on." + echo + fi +} + gen_sshd_keys() { umask 077 if ! [ -f "${sourceroot}/bin/dropbearkey" ]; then die "You need dropbear ssh to generate keys."; fi From 18d5f8f304cbb49ad97b655d95decb7933a63d3c Mon Sep 17 00:00:00 2001 From: treeman1111 Date: Mon, 6 Oct 2014 20:15:32 -0400 Subject: [PATCH 3/3] Added support for making an un-gzipped image of the initramfs. This proves useful for people who wish to embed the initramfs in their kernel. --- Makefile | 4 ++-- scripts/meta | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c215815..21c872d 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ help: @scripts/meta help image: @scripts/meta image -image-no-gz: - @scripts/meta image-no-gz +image_no_gz: + @scripts/meta image_no_gz clean: @scripts/meta clean prepare: diff --git a/scripts/meta b/scripts/meta index 9364a9d..79b119c 100755 --- a/scripts/meta +++ b/scripts/meta @@ -146,12 +146,12 @@ image() { fi } -image-no-gz() { +image_no_gz() { if ! [ -f "${sourceroot}/bin/busybox" ]; then die "Initramfs will not work without busybox."; fi einfo 'Building image...' - ( cd "${sourceroot}" && find . | cpio --quiet -H newc -o > ../output/initramfs.cpio.gz) + ( cd "${sourceroot}" && find . | cpio --quiet -H newc -o > ../output/initramfs.cpio) if [ -f "${sourceroot}/../output/initramfs.cpio" ]; then einfo "output/initramfs.cpio is ready." @@ -179,7 +179,7 @@ gen_sshd_keys() { case $1 in - prepare|image|clean|gen_sshd_keys) + prepare|image|image_no_gz|clean|gen_sshd_keys) $1 ;; help) @@ -190,6 +190,7 @@ case $1 in echo " make prepare" echo " (OPTIONAL) make gen_sshd_keys" echo " make image" + echo " make image_no_gz" echo ;; esac