File: sb2-mkinitramfs

package info (click to toggle)
scratchbox2 2.2.4-1debian1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 5,392 kB
  • ctags: 5,239
  • sloc: ansic: 21,734; sh: 4,360; perl: 2,170; cpp: 1,913; makefile: 610; python: 184
file content (24 lines) | stat: -rwxr-xr-x 423 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

if [ "x$1" = x -o  "x$2" = x ]; then
	echo usage fakeroot $0 initramfsdir initramfsfile
	exit 1
fi

if [ x`whoami` != xroot ]; then
	echo must be run under root or fakeroot
	exit 2
fi

rm -rf $1/dev
mkdir -p $1/dev/pts
cp -a /dev/{null,tty,tty0,ram0,console,zero,loop*,ptmx} $1/dev/

# sanity checks

if [ ! -x $1/init ]; then
	echo "$1/init script missing"
fi

(cd $1;  find . | cpio -o -H newc | gzip )  > $2