ethernetgmii: updated kernel config, simpleImage.xilinx and other misc files
[ana-net.git] / microblaze / ethernetgmii / misc / bin / cpio_manage.sh
blobec1872c9dc49e4cd3c3263e6c87365ac811445b8
1 #!/bin/sh
2 # Copyright 2012 Daniel Borkmann <borkmann@gnumaniacs.org>
3 # Licensed under GPL version 2
4 usage="Usage: cpio_manage.sh <unpack|pack> <initramfs.cpio.gz> <out/in dir>";
5 if [ "$#" -lt "3" ]; then
6 echo $usage;
7 exit
8 fi
9 if [ "`id -u`" != "0" ]; then
10 echo "Not root?!"
11 exit
13 arg="$1"
14 ramfs="../$2"
15 dir="$3"
16 case "$arg" in
17 p|pa|pac|pack)
18 cd $dir
19 find . -print0 | cpio -0 -ov -H newc | gzip -c > $ramfs
21 u|un|unp|unpa|unpac|unpack)
22 mkdir -p $dir
23 cd $dir
24 gunzip -c $ramfs | cpio -idv -H newc --no-absolute-filenames
27 echo $usage;
29 esac