Changeset 374
- Timestamp:
- Mar 16, 2007 2:50:37 AM (6 years ago)
- Location:
- trunk/debirf/fs/usr
- Files:
-
- 5 edited
-
sbin/make-debirf (modified) (10 diffs)
-
share/debirf/common (modified) (1 diff)
-
share/debirf/plugins/install-kernel (modified) (1 diff)
-
share/debirf/plugins/serial-terminal (modified) (1 diff)
-
share/man/man8/make-debirf.8 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/debirf/fs/usr/sbin/make-debirf
r373 r374 39 39 usage() { 40 40 cat <<EOF 41 Usage: $CMD kernel-image 41 Usage: $CMD kernel-image.deb 42 42 43 Creat a debirf initramfs.43 Create a debirf initramfs. 44 44 45 45 Default config file: /etc/debirf/debirf.conf … … 67 67 ## their first argument. 68 68 69 # ##stupid simple method69 # stupid simple method 70 70 create_initrd_stupid_simple() { 71 71 #ln sbin/init to /init … … 73 73 74 74 # create root image 75 debirf_msg "creating debirf initrd..."75 msg "creating debirf initrd..." 76 76 ( cd "$DEBIRF_ROOT" && find * | cpio -H newc --create | gzip ) > "$1" 77 77 } 78 78 79 # ##tweak initrd method: untested, probably doesn't work right yet. soon!79 # tweak initrd method: untested, probably doesn't work right yet. soon! 80 80 create_initrd_tweak_initrd() { 81 81 cat "$DEBIRF_ROOT"/scripts/debirf <<EOF … … 96 96 EOF 97 97 # create root image 98 debirf_msg "creating debirf initrd..."98 msg "creating debirf initrd..." 99 99 cp initrd.img* "$1" 100 100 (cd "$DEBIRF_ROOT" && find * | cpio -H newc --create | gzip ) >> "$1" … … 107 107 108 108 # check specified kernel package exists, and determine kernel name 109 DEBIRF_KERNEL_PACKAGE="$1"109 export DEBIRF_KERNEL_PACKAGE="$1" 110 110 if [ ! -f "$DEBIRF_KERNEL_PACKAGE" ] ; then 111 111 echo "Specified kernel package $DEBIRF_KERNEL_PACKAGE not found." … … 116 116 117 117 # check for common functions 118 [ -f "$DEBIRF_COMMON" ] || debirf_fail"debirf function file $DEBIRF_COMMON not found."118 [ -f "$DEBIRF_COMMON" ] || failure "debirf function file $DEBIRF_COMMON not found." 119 119 source "$DEBIRF_COMMON" 120 120 … … 123 123 read -p "Plugin directory $DEBIRF_PLUGINS not found. Continue? [y|N]: " -n 1 OK ; [ -z $OK ] || echo 124 124 if [ "${OK/y/Y}" != 'Y' ] ; then 125 debirf_fail"aborting."125 failure "aborting." 126 126 fi 127 127 fi … … 131 131 read -p "Directory $DEBIRF_ROOT already exists. write over? [y|N]: " -n 1 OK ; [ -z $OK ] || echo 132 132 if [ "${OK/y/Y}" = 'Y' ] ; then 133 debirf_msg "installing new root..."133 msg "installing new root..." 134 134 create_debootstrap 135 135 fi 136 136 else 137 debirf_msg "installing root..."137 msg "installing root..." 138 138 create_debootstrap 139 139 fi … … 149 149 150 150 # install plugins 151 debirf_msg "installing plugins..."151 msg "installing plugins..." 152 152 run_plugins 153 153 … … 169 169 # final output 170 170 DEBIRF_KERNEL="vmlinu"*"$KERNAVAIL" 171 debirf_msg "debirf initrd created."171 msg "debirf initrd created." 172 172 if [ "$DEBIRF_INITRD/$DEBIRF_KERNEL" ] ; then 173 debirf_msg "kernel: $DEBIRF_PATH/"$DEBIRF_KERNEL173 msg "kernel: $DEBIRF_PATH/"$DEBIRF_KERNEL 174 174 fi 175 debirf_msg "initrd: $DEBIRF_PATH/$DEBIRF_INITRD"175 msg "initrd: $DEBIRF_PATH/$DEBIRF_INITRD" -
trunk/debirf/fs/usr/share/debirf/common
r372 r374 6 6 7 7 # output debirf message to stdout 8 debirf_msg() {9 echo " debirf: $@"8 msg() { 9 echo "debirf: $@" 10 10 } 11 export -f debirf_msg11 export -f msg 12 12 13 13 # cause debirf to exit immediately with message and exit code 14 14 # failure message <exit-code> 15 debirf_fail() {15 failure() { 16 16 echo "$1" >&2 17 17 exit ${2:-'1'} 18 18 } 19 export -f debirf_fail19 export -f failure 20 20 21 21 # output info to the debirf.info file on the initramfs -
trunk/debirf/fs/usr/share/debirf/plugins/install-kernel
r370 r374 33 33 34 34 ##### install kernel 35 msg "installing kernel..."36 35 install_kernel "$DEBIRF_KERNEL_PACKAGE" -
trunk/debirf/fs/usr/share/debirf/plugins/serial-terminal
r370 r374 8 8 if grep "$TTY" "$INITTAB" | grep -q -v "^[:space:]*#" ; then 9 9 echo "inittab already has terminal on $TTY." 10 exit 1 11 fi 12 13 cat >> "$DEBIRF_ROOT"/etc/inittab <<EOF 10 else 11 cat >> "$DEBIRF_ROOT"/etc/inittab <<EOF 14 12 # debirf: added serial console output: 15 13 T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 16 14 EOF 15 fi -
trunk/debirf/fs/usr/share/man/man8/make-debirf.8
r370 r374 52 52 ). 53 53 .TP 54 .B debirf_msg <message>54 .B msg <message> 55 55 Output a message to standard out during the build process. 56 56 .TP 57 .B debirf_failure <message> <exit-code>57 .B failure <message> <exit-code> 58 58 Cause make-debirf script to fail with <exit-code>, and <message> to stderr. 59 59 .RE
Note: See TracChangeset
for help on using the changeset viewer.

