repo.or.cz
/
ana-net.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
microblaze/bin: script for zipping/unzipping initramfs
[ana-net.git]
/
microblaze
/
misc
/
bin
/
cpio_manage.sh
blob
2f1b765c8787fba6dafb22293ae82656ead6bf71
1
#!/bin/sh
2
usage
=
"Usage: cpio_manage.sh <unpack|pack> <initramfs.cpio.gz> <out/in dir>"
;
3
if
test
$#
-lt
3
;
then
4
echo
$usage
;
5
exit
6
fi
7
if
[
"`id -u`"
!=
"0"
];
then
8
echo
"Not root?!"
9
exit
10
fi
11
arg
=
"
$1
"
12
ramfs
=
"../
$2
"
13
dir
=
"
$3
"
14
case
"
$arg
"
in
15
p|pa|pac|pack
)
16
cd
$dir
17
find
. |
cpio
-o
|
gzip
-c
>
$ramfs
18
;;
19
u|un|unp|unpa|unpac|unpack
)
20
mkdir
-p
$dir
21
cd
$dir
22
gunzip
-c
$ramfs
|
cpio
-id
23
;;
24
*)
25
echo
$usage
;
26
;;
27
esac