@@ -59,10 +59,7 @@ OPTIONS:
5959 Build from ZFSBootMenu source tree at 6060 (Default: fetch upstream source tree inside container)
6161
62- -R Remove any existing zpool.cache and hostid in the build directory
63-
64- -C Do not include host /etc/zfs/zpool.cache in image
65- (If ./zpool.cache exists, this switch will be ignored)
62+ -R Remove any existing hostid in the build directory
6663
6764 -H Do not include host /etc/hostid in image
6865 (If ./hostid exists, this switch will be ignored)
7875}
7976
8077SKIP_HOSTID=
81- SKIP_CACHE=
8278REMOVE_HOST_FILES=
8379
8480# By default, use the latest upstream build container image
105101 PODMAN=" docker"
106102fi
107103
108- CMDOPTS=" b:dhi:l:c:O:CHR "
104+ CMDOPTS=" b:dhi:l:c:O:HR "
109105
110106# First pass to get build directory and configuration file
111107while getopts " ${CMDOPTS} " opt; do
@@ -163,9 +159,6 @@ while getopts "${CMDOPTS}" opt; do
163159 O)
164160 RUNTIME_ARGS+=( " ${OPTARG} " )
165161 ;;
166- C)
167- SKIP_CACHE=" yes"
168- ;;
169162 H)
170163 SKIP_HOSTID=" yes"
171164 ;;
@@ -200,16 +193,13 @@ if [ -n "${BUILD_REPO}" ]; then
200193 RUNTIME_ARGS+=( " -v" " ${BUILD_REPO} :/zbm:ro" )
201194fi
202195
203- if boolean_enabled " ${REMOVE_HOST_FILES} " ; then
204- # Remove existing host files
205- for host_file in " hostid" " zpool.cache" ; do
206- [ -e " ${BUILD_DIRECTORY} /${host_file} " ] || continue
207- if ! rm " ${BUILD_DIRECTORY} /${host_file} " ; then
208- echo " ERROR: failed to remove file '${host_file} ' from build directory"
209- exit 1
210- fi
211- echo " Removed file '${host_file} ' by user request"
212- done
196+ # Remove existing hostid
197+ if boolean_enabled " ${REMOVE_HOST_FILES} " && [ -e " ${BUILD_DIRECTORY} /hostid" ]; then
198+ if ! rm " ${BUILD_DIRECTORY} /hostid" ; then
199+ echo " ERROR: failed to remove hostid from build directory"
200+ exit 1
201+ fi
202+ echo " Removed hostid by user request"
213203fi
214204
215205# If no local hostid is available, copy the system hostid if desired
@@ -223,17 +213,6 @@ if ! [ -r "${BUILD_DIRECTORY}"/hostid ]; then
223213 fi
224214fi
225215
226- # If no local zpool.cache is available, copy the system cache if desired
227- if ! [ -r " ${BUILD_DIRECTORY} " /zpool.cache ]; then
228- if ! boolean_enabled " ${SKIP_CACHE} " && [ -r /etc/zfs/zpool.cache ]; then
229- if ! cp /etc/zfs/zpool.cache " ${BUILD_DIRECTORY} " /zpool.cache; then
230- echo " ERROR: unable to copy /etc/zfs/zpool.cache"
231- echo " Copy a zpool cache to ./zpool.cache or use -C to disable"
232- exit 1
233- fi
234- fi
235- fi
236-
237216# If no config is specified, use in-tree default but force EFI and components
238217if ! [ -r " ${BUILD_DIRECTORY} " /config.yaml ]; then
239218 BUILD_ARGS=(
0 commit comments