2022-06-15 20:53:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-06-27 10:39:11 +00:00
|
|
|
VOLID="{{ shortname }}-{{ major }}-{{ minor }}{{ rc }}-{{ arch }}-dvd"
|
2022-06-17 05:55:07 +00:00
|
|
|
VARIANT="{{ variant }}"
|
|
|
|
ARCH="{{ arch }}"
|
|
|
|
VERSION="{{ revision }}"
|
|
|
|
PRODUCT="{{ distname }}"
|
|
|
|
MOCKBLD="{{ builddir }}"
|
|
|
|
LORAXRES="{{ lorax_work_root }}"
|
2022-06-28 00:59:21 +00:00
|
|
|
LORAX_TAR="lorax-{{ revision }}-{{ arch }}.tar.gz"
|
2022-06-17 18:49:22 +00:00
|
|
|
LOGFILE="lorax-{{ arch }}.log"
|
2022-06-28 00:59:21 +00:00
|
|
|
BUGURL="{{ bugurl }}"
|
2022-06-17 05:55:07 +00:00
|
|
|
|
2022-06-15 20:53:12 +00:00
|
|
|
{% for pkg in lorax %}
|
|
|
|
sed -i '/{{ pkg }}/ s/^/#/' /usr/share/lorax/templates.d/80-rhel/runtime-install.tmpl
|
|
|
|
{% endfor %}
|
|
|
|
|
2022-06-17 05:55:07 +00:00
|
|
|
lorax --product="${PRODUCT}" \
|
|
|
|
--version="${VERSION}" \
|
|
|
|
--release="${VERSION}" \
|
2022-06-17 07:16:21 +00:00
|
|
|
{%- if rc == '' %}
|
|
|
|
--isfinal \
|
|
|
|
{%- endif %}
|
2022-06-15 20:53:12 +00:00
|
|
|
{%- for repo in repos %}
|
|
|
|
--source={{ repo.url }} \
|
|
|
|
{%- endfor %}
|
2022-06-28 00:59:21 +00:00
|
|
|
--bugurl="${BUGURL}" \
|
2022-06-17 05:55:07 +00:00
|
|
|
--variant="${VARIANT}" \
|
2022-06-15 20:53:12 +00:00
|
|
|
--nomacboot \
|
2022-06-17 05:55:07 +00:00
|
|
|
--buildarch="${ARCH}" \
|
|
|
|
--volid="${VOLID}" \
|
2022-06-17 18:49:22 +00:00
|
|
|
--logfile="${MOCKBLD}/${LOGFILE}" \
|
2022-06-15 20:53:12 +00:00
|
|
|
--rootfs-size=3 \
|
2022-06-17 05:55:07 +00:00
|
|
|
"${LORAXRES}"
|
|
|
|
|
|
|
|
ret_val=$?
|
|
|
|
if [ $ret_val -ne 0 ]; then
|
|
|
|
echo "!! LORAX FAILED !!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If we didn't fail, let's pack up everything!
|
|
|
|
cd "${MOCKBLD}"
|
2022-06-27 04:29:55 +00:00
|
|
|
|
|
|
|
# Get ISO manifest
|
|
|
|
if [ -f "/usr/bin/xorriso" ]; then
|
|
|
|
/usr/bin/xorriso -dev lorax/images/boot.iso --find |
|
|
|
|
tail -n+2 |
|
|
|
|
tr -d "'" |
|
2022-06-28 00:59:21 +00:00
|
|
|
cut -c2- | sort >> lorax/images/boot.iso.manifest
|
2022-06-27 04:29:55 +00:00
|
|
|
elif [ -f "/usr/bin/isoinfo" ]; then
|
|
|
|
/usr/bin/isoinfo -R -f -i lorax/images/boot.iso |
|
|
|
|
grep -v '/TRANS.TBL$' | sort >> lorax/images/boot.iso.manifest
|
|
|
|
fi
|
|
|
|
|
2022-07-25 10:30:52 +00:00
|
|
|
find lorax -perm 700 -exec chmod 755 {} \;
|
2022-07-25 08:30:11 +00:00
|
|
|
|
2022-06-17 05:55:07 +00:00
|
|
|
tar czf "${LORAX_TAR}" lorax "${LOGFILE}"
|
|
|
|
|
|
|
|
tar_ret_val=$?
|
|
|
|
if [ $ret_val -ne 0 ]; then
|
|
|
|
echo "!! PROBLEM CREATING ARCHIVE !!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|