Commit ad2385c0 authored by Gerardo Exequiel Pozzi's avatar Gerardo Exequiel Pozzi
Browse files

[archiso] Use -w <work_dir> instead of cmd <work>, add -o <out_dir>



Default (if not specified) -w work -o out.

-o <out_dir> is only used by 'iso' command.

Adjust build.sh of releng and baseline profile to reflect this change.

<project>
  - work <- $work_dir
  - out  <- $out_dir

Signed-off-by: default avatarGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
parent 14903dfc
......@@ -11,6 +11,8 @@ export iso_label="ARCH_$(date +%Y%m)"
iso_publisher="Arch Linux <http://www.archlinux.org>"
iso_application="Arch Linux Live/Rescue CD"
install_dir="arch"
work_dir="work"
out_dir="out"
# Show an INFO message
# $1: message string
......@@ -104,17 +106,21 @@ _usage ()
echo " -D <install_dir> Set an install_dir. All files will by located here."
echo " Default ${install_dir}"
echo " NOTE: Max 8 characters, use only [a-z0-9]"
echo " -w <work_dir> Set the working directory"
echo " Default ${work_dir}"
echo " -o <out_dir> Set the output directory"
echo " Default ${out_dir}"
echo " -v Enable verbose output"
echo " -h This message"
echo " commands:"
echo " create <dir>"
echo " create"
echo " create a base directory layout to work with"
echo " includes all specified packages"
echo " prepare <dir>"
echo " prepare"
echo " build all images"
echo " checksum <dir>"
echo " checksum"
echo " make a checksum.md5 for self-test"
echo " iso <dir> <image name>"
echo " iso <image name>"
echo " build an iso image from the working dir"
exit ${1}
}
......@@ -310,7 +316,8 @@ command_iso () {
_show_config iso
if _is_directory_changed "${work_dir}/iso" "${img_name}"; then
if _is_directory_changed "${work_dir}/iso" "${out_dir}/${img_name}"; then
mkdir -p ${out_dir}
_msg_info "Creating ISO image..."
local _qflag=""
if [[ ${quiet} == "y" ]]; then
......@@ -325,9 +332,9 @@ command_iso () {
-publisher "${iso_publisher}" \
-A "${iso_application}" \
-V "${iso_label}" \
-o "${img_name}" "${work_dir}/iso/"
isohybrid "${img_name}"
_msg_info "Done! | $(ls -sh ${img_name})"
-o "${out_dir}/${img_name}" "${work_dir}/iso/"
isohybrid "${out_dir}/${img_name}"
_msg_info "Done! | $(ls -sh ${out_dir}/${img_name})"
fi
}
......@@ -406,7 +413,7 @@ if [[ ${EUID} -ne 0 ]]; then
_msg_error "This script must be run as root." 1
fi
while getopts 'p:C:L:P:A:D:fvh' arg; do
while getopts 'p:C:L:P:A:D:w:o:vh' arg; do
case "${arg}" in
p) pkg_list="${pkg_list} ${OPTARG}" ;;
C) pacman_conf="${OPTARG}" ;;
......@@ -414,6 +421,8 @@ while getopts 'p:C:L:P:A:D:fvh' arg; do
P) iso_publisher="${OPTARG}" ;;
A) iso_application="${OPTARG}" ;;
D) install_dir="${OPTARG}" ;;
w) work_dir="${OPTARG}" ;;
o) out_dir="${OPTARG}" ;;
v) quiet="n" ;;
h|?) _usage 0 ;;
*)
......@@ -431,12 +440,6 @@ if [[ $# -lt 1 ]]; then
fi
command_name="${1}"
if [[ $# -lt 2 ]]; then
_msg_error "No working directory specified" 0
_usage 1
fi
work_dir="${2}"
case "${command_name}" in
create)
command_create
......@@ -448,11 +451,11 @@ case "${command_name}" in
command_checksum
;;
iso)
if [[ $# -lt 3 ]]; then
if [[ $# -lt 2 ]]; then
_msg_error "No image specified" 0
_usage 1
fi
img_name="${3}"
img_name="${2}"
command_iso
;;
*)
......
......@@ -8,14 +8,15 @@ iso_version=$(date +%Y.%m.%d)
install_dir=arch
arch=$(uname -m)
work_dir=work
out_dir=out
verbose="n"
script_path=$(readlink -f ${0%/*})
# Base installation (root-image)
make_basefs() {
mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -p "syslinux" create "${work_dir}"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "base" create
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "syslinux" create
}
# Copy mkinitcpio archiso hooks (root-image)
......@@ -73,13 +74,13 @@ make_aitab() {
# Build all filesystem images specified in aitab (.fs .fs.sfs .sfs)
make_prepare() {
mkarchiso ${verbose} -D "${install_dir}" prepare "${work_dir}"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare
}
# Build ISO
make_iso() {
mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${iso_name}-${iso_version}-${arch}.iso"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" checksum
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch}.iso"
}
if [[ $verbose == "y" ]]; then
......
......@@ -8,19 +8,20 @@ iso_version=$(date +%Y.%m.%d)
install_dir=arch
arch=$(uname -m)
work_dir=work
out_dir=out
verbose="n"
script_path=$(readlink -f ${0%/*})
# Base installation (root-image)
make_basefs() {
mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -p "memtest86+ syslinux mkinitcpio-nfs-utils nbd" create "${work_dir}"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "base" create
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "memtest86+ syslinux mkinitcpio-nfs-utils nbd" create
}
# Additional packages (root-image)
make_packages() {
mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create "${work_dir}"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create
}
# Customize installation (root-image)
......@@ -156,15 +157,15 @@ make_aitab() {
# Build all filesystem images specified in aitab (.fs .fs.sfs .sfs)
make_prepare() {
mkarchiso ${verbose} -D "${install_dir}" prepare "${work_dir}"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare
}
# Build ISO
# args: $1 (core | netinstall)
make_iso() {
local _iso_type=${1}
mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${iso_name}-${iso_version}-${_iso_type}-${arch}.iso"
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" checksum
mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${_iso_type}-${arch}.iso"
}
# Build dual-iso images from ${work_dir}/i686/iso and ${work_dir}/x86_64/iso
......@@ -207,8 +208,8 @@ make_dual() {
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${install_dir}|g" ${_cfg} > ${work_dir}/dual/iso/${install_dir}/boot/syslinux/${_cfg##*/}
done
mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}/dual"
mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}/dual" "${iso_name}-${iso_version}-${_iso_type}-dual.iso"
mkarchiso ${verbose} -w "${work_dir}/dual" -D "${install_dir}" checksum
mkarchiso ${verbose} -w "${work_dir}/dual" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${_iso_type}-dual.iso"
: > ${work_dir}/dual/build.${FUNCNAME}_${_iso_type}
fi
}
......@@ -298,11 +299,11 @@ case "${command_name}" in
;;
clean_single)
rm -rf ${work_dir}
rm -f ${iso_name}-${iso_version}-*-${arch}.iso
rm -f ${out_dir}/${iso_name}-${iso_version}-*-${arch}.iso
;;
clean_dual)
rm -rf ${work_dir}/dual
rm -f ${iso_name}-${iso_version}-*-dual.iso
rm -f ${out_dir}/${iso_name}-${iso_version}-*-dual.iso
;;
*)
echo "Invalid command name '${command_name}'"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment