From 1593f6ee4f51364ff4f19e862a2bec27c1215cb6 Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Fri, 21 Aug 2009 12:23:49 +0200 Subject: Rootfs: include missing mkinitramfs script Signed-off-by: Abdoulaye Walsimou Gaye --- scripts/mkinitramfs | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 scripts/mkinitramfs (limited to 'scripts/mkinitramfs') diff --git a/scripts/mkinitramfs b/scripts/mkinitramfs new file mode 100755 index 0000000..2e818fa --- /dev/null +++ b/scripts/mkinitramfs @@ -0,0 +1,58 @@ +#!/bin/sh +################################################################################ +# GAYE Abdoulaye Walsimou, +# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved. +# For Copyrright from linux kernel's build/configure system, see their source +# code. +# +# This program is free software; you can distribute it and/or modify it +# under the terms of the GNU General Public License +# (Version 2 or later) published by the Free Software Foundation. +# +# This program is distributed in the hope 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., +# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +################################################################################ +# +# \file mkinitramfs +# \brief mkinitramfs of Embtoolkit +# \author GAYE Abdoulaye Walsimou, +# \date August 2009 +################################################################################ + +usage() +{ + echo "usage: mkinitramfs directory compression_mode imagename" + echo "where:" + echo "directory: directory containing files to include in the archive." + echo "compression_mode: gzip or bzip2." + echo "imagename: output file name prefix" + echo "" +} + +if [ $# -ne 3 ] +then + echo "3 inputs arguments are required." + usage + exit 1 +fi + +if [ "$2" = "gzip" ] +then + echo "creating $3.cpio.gz from $1" + (cd "$1"; find . | cpio -o -H newc | gzip) > "$3.cpio.gz" +elif [ "$2" = "bzip2" ] +then + echo "creating $3.cpio.bz2 from $1" + (cd "$1"; find . | cpio -o -H newc | bzip2) > "$3.cpio.bz2" +else + echo "Error while using mkinitramfs!!!" + usage + exit 1 +fi + -- cgit v1.2.3