diff options
| author | David M. Syzdek <david@syzdek.net> | 2018-04-27 15:12:49 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2018-04-27 15:17:14 -0800 |
| commit | 0397d5278b3c887327b8e55193b5d6d22682c958 (patch) | |
| tree | 249419510ac9fe286297896436fbb8dd4ac904e4 | |
| parent | 53e727a15834badcd3ed0d5d4d3167f6e5b61c7b (diff) | |
| download | iperd-0397d5278b3c887327b8e55193b5d6d22682c958.tar.gz iperd-0397d5278b3c887327b8e55193b5d6d22682c958.tar.bz2 iperd-0397d5278b3c887327b8e55193b5d6d22682c958.tar.xz iperd-0397d5278b3c887327b8e55193b5d6d22682c958.zip | |
replacing 'deps_*_inc()' with 'generate_cfg()'
| -rwxr-xr-x | src/scripts/genfiles.sh | 109 |
1 files changed, 33 insertions, 76 deletions
diff --git a/src/scripts/genfiles.sh b/src/scripts/genfiles.sh index a28e122..d42c466 100755 --- a/src/scripts/genfiles.sh +++ b/src/scripts/genfiles.sh | |||
| @@ -56,72 +56,29 @@ fi | |||
| 56 | # # | 56 | # # |
| 57 | ############### | 57 | ############### |
| 58 | 58 | ||
| 59 | # generate include file for isolinux.cfg | ||
| 60 | deps_isolinux_inc() | ||
| 61 | { | ||
| 62 | CFG_DEP_FILES="" | ||
| 63 | rm -f ${CONFIGDIR}/isolinux.inc | ||
| 64 | for ISODISTRO in $(list_cfg_distros);do | ||
| 65 | gen_dosubst "${ISODISTRO}" cfg "cfg.label cfg.label.iso" | ||
| 66 | done > "${CONFIGDIR}/isolinux.inc" | ||
| 67 | ISOLINUX_INC_DEPS="${CFG_DEP_FILES}" | ||
| 68 | } | ||
| 69 | |||
| 70 | |||
| 71 | # generate include file for pxelinux.cfg | ||
| 72 | deps_pxelinux_inc() | ||
| 73 | { | ||
| 74 | CFG_DEP_FILES="" | ||
| 75 | rm -f ${CONFIGDIR}/pxelinux.inc | ||
| 76 | for ISODISTRO in $(list_cfg_distros);do | ||
| 77 | gen_dosubst "${ISODISTRO}" cfg "cfg.label cfg.label.pxe" | ||
| 78 | done > "${CONFIGDIR}/pxelinux.inc" | ||
| 79 | PXELINUX_INC_DEPS="${CFG_DEP_FILES}" | ||
| 80 | } | ||
| 81 | |||
| 82 | |||
| 83 | # generate include file for pxelx64.cfg | ||
| 84 | deps_pxelx64_inc() | ||
| 85 | { | ||
| 86 | CFG_DEP_FILES="" | ||
| 87 | rm -f ${CONFIGDIR}/pxelx64.inc | ||
| 88 | for ISODISTRO in $(list_cfg_distros);do | ||
| 89 | if test ! -f "${DISTRODIR}/${DISTRO}/broken.efi64";then | ||
| 90 | gen_dosubst "${ISODISTRO}" cfg "cfg.label cfg.label.pxe" | ||
| 91 | fi | ||
| 92 | done > "${CONFIGDIR}/pxelx64.inc" | ||
| 93 | PXELX64_INC_DEPS="${CFG_DEP_FILES}" | ||
| 94 | } | ||
| 95 | |||
| 96 | 59 | ||
| 97 | # generate include file for syslinux.cfg | 60 | # generate syslinux configurations |
| 98 | deps_syslinux_inc() | 61 | generate_cfg() |
| 99 | { | 62 | { |
| 100 | CFG_DEP_FILES="" | 63 | INCFILE="${1}" |
| 101 | rm -f ${CONFIGDIR}/syslinux.inc | 64 | SRCFILES="cfg.label ${2}" |
| 102 | for ISODISTRO in $(list_cfg_distros);do | 65 | BROKEFILE="${3}" |
| 103 | gen_dosubst "${ISODISTRO}" cfg "cfg.label cfg.label.sys" | ||
| 104 | done > "${CONFIGDIR}/syslinux.inc" | ||
| 105 | SYSLINUX_INC_DEPS="${CFG_DEP_FILES}" | ||
| 106 | } | ||
| 107 | 66 | ||
| 67 | rm -f "${CONFIGDIR}/${INCFILE}" || return 1 | ||
| 108 | 68 | ||
| 109 | # generate include file for syslx64.cfg | 69 | for GENDISTRO in $(list_cfg_distros);do |
| 110 | deps_syslx64_inc() | 70 | if test ! -z "${BROKEFILE}";then |
| 111 | { | 71 | if test -f "${DISTRODIR}/${GENDISTRO}/${BROKEFILE}";then |
| 112 | CFG_DEP_FILES="" | 72 | continue; |
| 113 | rm -f ${CONFIGDIR}/syslx64.inc | 73 | fi |
| 114 | for ISODISTRO in $(list_cfg_distros);do | ||
| 115 | if test ! -f "${DISTRODIR}/${DISTRO}/broken.efi64";then | ||
| 116 | gen_dosubst "${ISODISTRO}" cfg "cfg.label cfg.label.sys" | ||
| 117 | fi | 74 | fi |
| 118 | done > "${CONFIGDIR}/syslx64.inc" | 75 | gen_dosubst "${GENDISTRO}" cfg "${SRCFILES}" || return 1 |
| 119 | SYSLX64_INC_DEPS="${CFG_DEP_FILES}" | 76 | done > "${CONFIGDIR}/${INCFILE}" |
| 120 | } | 77 | } |
| 121 | 78 | ||
| 122 | 79 | ||
| 123 | # build Makefile configuration | 80 | # build Makefile configuration |
| 124 | deps_makefile_config() | 81 | generate_makefile_config() |
| 125 | { | 82 | { |
| 126 | CFG_DEP_FILES="" | 83 | CFG_DEP_FILES="" |
| 127 | rm -f ${BASEDIR}/Makefile.config | 84 | rm -f ${BASEDIR}/Makefile.config |
| @@ -188,30 +145,30 @@ gen_dosubst() | |||
| 188 | 145 | ||
| 189 | 146 | ||
| 190 | case "${REGEN_FILE}" in | 147 | case "${REGEN_FILE}" in |
| 191 | var/config/isolinux.inc) deps_isolinux_inc || exit 1;; | 148 | isolinux.inc) generate_cfg isolinux.inc cfg.label.iso || exit 1;; |
| 192 | var/config/pxelinux.inc) deps_pxelinux_inc || exit 1;; | 149 | pxelinux.inc) generate_cfg pxelinux.inc cfg.label.pxe || exit 1;; |
| 193 | var/config/pxelx64.inc) deps_pxelx64_inc || exit 1;; | 150 | pxelx64.inc) generate_cfg pxelx64.inc cfg.label.pxe broken.efi64 || exit 1;; |
| 194 | var/config/syslinux.inc) deps_syslinux_inc || exit 1;; | 151 | syslinux.inc) generate_cfg syslinux.inc cfg.label.sys || exit 1;; |
| 195 | var/config/syslx64.inc) deps_syslx64_inc || exit 1;; | 152 | syslx64.inc) generate_cfg syslx64.inc cfg.label.sys broken.efi64 || exit 1;; |
| 196 | Makefile.config) deps_makefile_config || exit 1;; | 153 | Makefile.config) generate_makefile_config || exit 1;; |
| 197 | 154 | ||
| 198 | all) | 155 | all) |
| 199 | deps_isolinux_inc || exit 1 | 156 | generate_cfg isolinux.inc cfg.label.iso || exit 1 |
| 200 | deps_pxelinux_inc || exit 1 | 157 | generate_cfg pxelinux.inc cfg.label.pxe || exit 1 |
| 201 | deps_pxelx64_inc || exit 1 | 158 | generate_cfg pxelx64.inc cfg.label.pxe broken.efi64 || exit 1 |
| 202 | deps_syslinux_inc || exit 1 | 159 | generate_cfg syslinux.inc cfg.label.sys || exit 1 |
| 203 | deps_syslx64_inc || exit 1 | 160 | generate_cfg syslx64.inc cfg.label.sys broken.efi64 || exit 1 |
| 204 | deps_makefile_config || exit 1 | 161 | generate_makefile_config || exit 1 |
| 205 | ;; | 162 | ;; |
| 206 | 163 | ||
| 207 | *) | 164 | *) |
| 208 | echo "Usage: ${PROG_NAME} all" 1>&2 | 165 | echo "Usage: ${PROG_NAME} all" 1>&2 |
| 209 | echo " ${PROG_NAME} var/config/isolinux.inc" 1>&2 | 166 | echo " ${PROG_NAME} isolinux.inc" 1>&2 |
| 210 | echo " ${PROG_NAME} var/config/pxelinux.inc" 1>&2 | 167 | echo " ${PROG_NAME} pxelinux.inc" 1>&2 |
| 211 | echo " ${PROG_NAME} var/config/pxelx64.inc" 1>&2 | 168 | echo " ${PROG_NAME} pxelx64.inc" 1>&2 |
| 212 | echo " ${PROG_NAME} var/config/syslinux.inc" 1>&2 | 169 | echo " ${PROG_NAME} syslinux.inc" 1>&2 |
| 213 | echo " ${PROG_NAME} var/config/syslx64.inc" 1>&2 | 170 | echo " ${PROG_NAME} syslx64.inc" 1>&2 |
| 214 | echo " ${PROG_NAME} Makefile.config" 1>&2 | 171 | echo " ${PROG_NAME} Makefile.config" 1>&2 |
| 215 | echo "" | 172 | echo "" |
| 216 | exit 1 | 173 | exit 1 |
| 217 | ;; | 174 | ;; |
