Changeset 370 for trunk/debirf/fs/usr/sbin/make-debirf
- Timestamp:
- Mar 16, 2007 2:05:30 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/debirf/fs/usr/sbin/make-debirf (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/debirf/fs/usr/sbin/make-debirf
r369 r370 27 27 DEBIRF_DISTRO=${DEBIRF_DISTRO:-"etch"} 28 28 29 DEBIRF_COMMON="/usr/share/debirf/common" 30 29 31 # set locale default 30 32 export LC_CTYPE="C" … … 47 49 } 48 50 49 failure() {50 echo "$1" >&251 exit ${2:-'1'}52 }53 export -f failure54 55 msg() {56 echo " debirf: $@"57 }58 export -f msg59 60 setup_debirf_info() {61 export DEBIRF_INFO_TARGET="${DEBIRF_ROOT}/etc/debirf/debirf.info"62 mkdir -p $(dirname "$DEBIRF_INFO_TARGET")63 64 cat > "$DEBIRF_INFO_TARGET" <<EOF65 #!/bin/sh66 # this debirf initramfs was generated on $(hostname)67 # at $(date -R)68 69 EOF70 debirf_info_comment() {71 echo "$@" | sed 's|^\(.\)|\# \1|' >> "$DEBIRF_INFO_TARGET"72 }73 debirf_info_sh() {74 echo "$@" >> "$DEBIRF_INFO_TARGET"75 }76 export -f debirf_info_comment77 export -f debirf_info_sh78 }79 80 51 create_debootstrap() { 81 52 # include initramfs-tools because they'll be handy … … 85 56 } 86 57 87 run_plugins _install() {58 run_plugins() { 88 59 # export all the DEBIRF_* environment variables: 89 60 for var in ${!DEBIRF_*}; do 90 61 export $var 91 62 done 92 run-parts --verbose "$DEBIRF_PLUGINS/install" 93 } 94 95 run_plugins_prune() { 96 # export all the DEBIRF_* environment variables: 97 for var in ${!DEBIRF_*}; do 98 export $var 99 done 100 run-parts --verbose "$DEBIRF_PLUGINS/prune" 63 run-parts --verbose "$DEBIRF_PLUGINS" 101 64 } 102 65 … … 150 113 fi 151 114 115 # check for common functions 116 [ -f "$DEBIRF_COMMON" ] || debirf_fail "debirf function file $DEBIRF_COMMON not found." 117 source "$DEBIRF_COMMON" 118 152 119 # check plugin directory exists 153 120 if [ ! -d "$DEBIRF_PLUGINS" ] ; then 154 121 read -p "Plugin directory $DEBIRF_PLUGINS not found. Continue? [y|N]: " -n 1 OK ; [ -z $OK ] || echo 155 122 if [ "${OK/y/Y}" != 'Y' ] ; then 156 failure"aborting."123 debirf_fail "aborting." 157 124 fi 158 125 fi … … 179 146 180 147 # update apt 181 chroot "$DEBIRF_ROOT"apt-get update148 debirf_exec apt-get update 182 149 183 # run plugins/install 184 msg "running install plugins..." 185 run_plugins_install 186 187 # run plugins/prune 188 msg "running prune plugins..." 189 run_plugins_prune 150 # install plugins 151 msg "installing plugins..." 152 run_plugins 190 153 191 154 # umount sys,proc
Note: See TracChangeset
for help on using the changeset viewer.

