From dd380544e7c3a9f6c47e23639bb0a45958c3e446 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Jun 2014 10:53:29 +0000 Subject: Add initramfs write extension This creates a gzipped cpio archive that may be used as an initramfs. It is hard-coded to use gzip to compress the initramfs, since it's the most common way to do it. This is unfortunate, since the busybox gzip utility only allows maximum compression, which is rather slow and doesn't give progress reporting, so you can easily think it's gotten stuck. It's possible to use other compression formats, but they need the kernel to be built with them supported, and in the case of lz4, unusual userland tools to create it, since the version of lz4 supported in the kernel is not what the standard lz4 tools produce. --- initramfs.write | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 initramfs.write (limited to 'initramfs.write') diff --git a/initramfs.write b/initramfs.write new file mode 100755 index 00000000..815772f2 --- /dev/null +++ b/initramfs.write @@ -0,0 +1,27 @@ +#!/bin/sh +# Copyright (C) 2014 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# =*= License: GPL-2 =*= + +set -e + +ROOTDIR="$1" +INITRAMFS_PATH="$2" + +(cd "$ROOTDIR" && + find . -print0 | + cpio -0 -H newc -o | + gzip -c) >"$INITRAMFS_PATH" -- cgit v1.2.1 From 6063df929fb29d152b0b1b7fadf2f2c3dc7327c4 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 4 Jun 2014 16:06:29 +0000 Subject: initramfs.write: create parent directories of location --- initramfs.write | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'initramfs.write') diff --git a/initramfs.write b/initramfs.write index 815772f2..f8af6d84 100755 --- a/initramfs.write +++ b/initramfs.write @@ -23,5 +23,5 @@ INITRAMFS_PATH="$2" (cd "$ROOTDIR" && find . -print0 | - cpio -0 -H newc -o | - gzip -c) >"$INITRAMFS_PATH" + cpio -0 -H newc -o) | + gzip -c | install -D -m644 /dev/stdin "$INITRAMFS_PATH" -- cgit v1.2.1 From ed741d8d090086e2380f7b9d68ddc3bd122acb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Fri, 13 Mar 2015 18:18:55 +0000 Subject: Use the modern way of the GPL copyright header: URL instead real address Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0 --- initramfs.write | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'initramfs.write') diff --git a/initramfs.write b/initramfs.write index f8af6d84..1059defa 100755 --- a/initramfs.write +++ b/initramfs.write @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -11,8 +11,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# with this program. If not, see . # # =*= License: GPL-2 =*= -- cgit v1.2.1