summaryrefslogtreecommitdiff
path: root/configs/releng/build.sh
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-08-17 12:26:22 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-08-17 12:26:22 -0300
commitbe5fc1d5c788df0f2d8d050e97581977caf133a3 (patch)
tree39f6c577dbad42bbd5efc5eae6a4f316e476f3c1 /configs/releng/build.sh
parentacdae85c827f2a6349397740c9e3ed2ded82cb07 (diff)
parent708ba38c206a2147fbd7a357d6ece8881807231d (diff)
Merge branch 'master' of https://projects.archlinux.org/git/archiso
Conflicts: configs/baseline/build.sh configs/baseline/syslinux/syslinux.cfg configs/releng/build.sh configs/releng/syslinux.dual/syslinux_arch32.cfg configs/releng/syslinux.dual/syslinux_arch64.cfg configs/releng/syslinux/syslinux.cfg
Diffstat (limited to 'configs/releng/build.sh')
-rwxr-xr-xconfigs/releng/build.sh73
1 files changed, 46 insertions, 27 deletions
diff --git a/configs/releng/build.sh b/configs/releng/build.sh
index 9e10b0a..8c96c76 100755
--- a/configs/releng/build.sh
+++ b/configs/releng/build.sh
@@ -10,6 +10,8 @@ arch=$(uname -m)
work_dir=work
verbose="n"
+script_path=$(readlink -f ${0%/*})
+
# Base installation (root-image)
make_basefs() {
mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}"
@@ -18,13 +20,13 @@ make_basefs() {
# Additional packages (root-image)
make_packages() {
- mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# packages.${arch})" create "${work_dir}"
+ mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create "${work_dir}"
}
# Customize installation (root-image)
make_customize_root_image() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
- cp -af root-image ${work_dir}
+ cp -af ${script_path}/root-image ${work_dir}
chmod 750 ${work_dir}/root-image/etc/sudoers.d
chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel
mkdir -p ${work_dir}/root-image/etc/pacman.d
@@ -58,11 +60,11 @@ make_boot() {
local _dst_boot=${work_dir}/iso/${install_dir}/boot
mkdir -p ${_dst_boot}/${arch}
mkinitcpio \
- -c ./mkinitcpio.conf \
+ -c ${script_path}/mkinitcpio.conf \
-b ${_src} \
- -k /boot/vmlinuz26 \
+ -k /boot/vmlinuz-linux-libre \
-g ${_dst_boot}/${arch}/libreiso.img
- mv ${_src}/boot/vmlinuz26 ${_dst_boot}/${arch}
+ mv ${_src}/boot/vmlinuz-linux-libre ${_dst_boot}/${arch}/vmlinuz
cp ${_src}/boot/memtest86+/memtest.bin ${_dst_boot}/memtest
cp ${_src}/usr/share/licenses/common/GPL2/license.txt ${_dst_boot}/memtest.COPYING
: > ${work_dir}/build.${FUNCNAME}
@@ -77,8 +79,8 @@ make_syslinux() {
mkdir -p ${_dst_syslinux}
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${install_dir}|g;
- s|%ARCH%|${arch}|g" syslinux/syslinux.cfg > ${_dst_syslinux}/syslinux.cfg
- cp syslinux/splash.png ${_dst_syslinux}
+ s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${_dst_syslinux}/syslinux.cfg
+ cp ${script_path}/syslinux/splash.png ${_dst_syslinux}
cp ${_src_syslinux}/*.c32 ${_dst_syslinux}
cp ${_src_syslinux}/*.com ${_dst_syslinux}
cp ${_src_syslinux}/*.0 ${_dst_syslinux}
@@ -94,7 +96,7 @@ make_syslinux() {
make_isolinux() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
mkdir -p ${work_dir}/iso/isolinux
- sed "s|%INSTALL_DIR%|${install_dir}|g" isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
+ sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/
: > ${work_dir}/build.${FUNCNAME}
fi
@@ -117,17 +119,18 @@ make_usr_share() {
}
# Make [core] repository, keep "any" pkgs in a separate fs (makes more "dual-iso" friendly)
+# TODO add 'base' packages on [libre]
make_core_repo() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
local _url _urls _pkg_name _cached_pkg _dst
- mkdir -p ${work_dir}/core-any-pkgs
- mkdir -p ${work_dir}/core-pkgs
+ mkdir -p ${work_dir}/repo-core-any
+ mkdir -p ${work_dir}/repo-core-${arch}
pacman -Sy
- _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# core.exclude.${arch} | sort)))
+ _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort)))
for _url in ${_urls}; do
_pkg_name=${_url##*/}
_cached_pkg=/var/cache/pacman/pkg/${_pkg_name}
- _dst=${work_dir}/core-pkgs/${_pkg_name}
+ _dst=${work_dir}/repo-core-${arch}/${_pkg_name}
if [[ ! -e ${_dst} ]]; then
if [[ -e ${_cached_pkg} ]]; then
cp -v "${_cached_pkg}" "${_dst}"
@@ -135,10 +138,10 @@ make_core_repo() {
wget -nv "${_url}" -O "${_dst}"
fi
fi
- repo-add -q ${work_dir}/core-pkgs/core.db.tar.gz ${work_dir}/core-pkgs/${_pkg_name}
+ repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${work_dir}/repo-core-${arch}/${_pkg_name}
if [[ ${_pkg_name} =~ any.pkg ]]; then
- mv "${_dst}" ${work_dir}/core-any-pkgs/${_pkg_name}
- ln -sf ../any/${_pkg_name} ${work_dir}/core-pkgs/${_pkg_name}
+ mv "${_dst}" ${work_dir}/repo-core-any/${_pkg_name}
+ ln -sf ../any/${_pkg_name} ${work_dir}/repo-core-${arch}/${_pkg_name}
fi
done
: > ${work_dir}/build.${FUNCNAME}
@@ -150,7 +153,7 @@ make_core_repo() {
make_aitab() {
local _iso_type=${1}
if [[ ! -e ${work_dir}/build.${FUNCNAME}_${_iso_type} ]]; then
- sed "s|%ARCH%|${arch}|g" aitab.${_iso_type} > ${work_dir}/iso/${install_dir}/aitab
+ sed "s|%ARCH%|${arch}|g" ${script_path}/aitab.${_iso_type} > ${work_dir}/iso/${install_dir}/aitab
: > ${work_dir}/build.${FUNCNAME}_${_iso_type}
fi
}
@@ -164,6 +167,7 @@ make_prepare() {
# args: $1 (core | netinstall)
make_iso() {
local _iso_type=${1}
+ mkarchiso ${verbose} checksum "${work_dir}"
mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${name}-${version}-${_iso_type}-${arch}.iso"
}
@@ -190,23 +194,24 @@ make_dual() {
rm -f ${work_dir}/dual/iso/${install_dir}/aitab
rm -f ${work_dir}/dual/iso/${install_dir}/boot/syslinux/syslinux.cfg
if [[ ${_iso_type} == "core" ]]; then
- if [[ ! -e ${work_dir}/dual/iso/${install_dir}/any/core-any-pkgs.sfs ||
- ! -e ${work_dir}/dual/iso/${install_dir}/i686/core-pkgs.sfs ||
- ! -e ${work_dir}/dual/iso/${install_dir}/x86_64/core-pkgs.sfs ]]; then
+ if [[ ! -e ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs ||
+ ! -e ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs ||
+ ! -e ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs ]]; then
echo "ERROR: core_iso_single build is not found."
_usage 1
fi
else
- rm -f ${work_dir}/dual/iso/${install_dir}/any/core-any-pkgs.sfs
- rm -f ${work_dir}/dual/iso/${install_dir}/i686/core-pkgs.sfs
- rm -f ${work_dir}/dual/iso/${install_dir}/x86_64/core-pkgs.sfs
+ rm -f ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs
+ rm -f ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs
+ rm -f ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs
fi
- paste -d"\n" <(sed "s|%ARCH%|i686|g" aitab.${_iso_type}) \
- <(sed "s|%ARCH%|x86_64|g" aitab.${_iso_type}) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab
- for _cfg in syslinux.dual/*.cfg; do
+ paste -d"\n" <(sed "s|%ARCH%|i686|g" ${script_path}/aitab.${_iso_type}) \
+ <(sed "s|%ARCH%|x86_64|g" ${script_path}/aitab.${_iso_type}) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab
+ for _cfg in ${script_path}/syslinux.dual/*.cfg; do
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} checksum "${work_dir}/dual"
mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}/dual" "${name}-${version}-${_iso_type}-dual.iso"
: > ${work_dir}/dual/build.${FUNCNAME}_${_iso_type}
fi
@@ -216,8 +221,8 @@ make_dual() {
_usage ()
{
- echo "usage ${0##*/} net_iso_single | core_iso_single | all_iso_single | clean_single"
- echo " net_iso_dual | core_iso_dual | all_iso_dual | clean_dual"
+ echo "usage ${0##*/} net_iso_single | core_iso_single | all_iso_single | purge_single | clean_single"
+ echo " net_iso_dual | core_iso_dual | all_iso_dual | purge_dual | clean_dual"
echo
exit ${1}
}
@@ -281,6 +286,20 @@ case "${command_name}" in
make_dual netinstall
make_dual core
;;
+ purge_single)
+ if [[ -d ${work_dir} ]]; then
+ find ${work_dir} -mindepth 1 -maxdepth 1 \
+ ! -path ${work_dir}/iso -prune \
+ | xargs rm -rf
+ fi
+ ;;
+ purge_dual)
+ if [[ -d ${work_dir}/dual ]]; then
+ find ${work_dir}/dual -mindepth 1 -maxdepth 1 \
+ ! -path ${work_dir}/dual/iso -prune \
+ | xargs rm -rf
+ fi
+ ;;
clean_single)
rm -rf ${work_dir}
rm -f ${name}-${version}-*-${arch}.iso