File: addbmods

package info (click to toggle)
oskit 0.97.20000202-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 58,008 kB
  • ctags: 172,612
  • sloc: ansic: 832,827; asm: 7,640; sh: 3,920; yacc: 3,664; perl: 1,457; lex: 427; makefile: 337; csh: 141; awk: 78
file content (32 lines) | stat: -rwxr-xr-x 633 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

#
# This script takes a kernel and and, optional, a list of directories 
#
# It uses mkmbimage to create a boot image that has this kernel and
# the contents of all directories as bmods, relative to their respective
# roots.
#
# This allows you to prepare a boot filesystem somewhere in your filesystem
# and then to build your boot image.
#

ARG=$1

if [ $# = 0 ]; then
    echo Usage: $0 kernel [bmoddir] {,bmoddir}
    exit;
else
    shift
    for DIR in "$@"
    do
	for FILE in `find $DIR -type f -print`
	do
	    ARG="$ARG $FILE:"`echo $FILE | sed "s|$DIR||g"`
	done
    done
fi

echo mkmbimage $ARG
mkmbimage $ARG