root/build-tools/build_minimal_iso/build_centos.sh
Sun Austin 7c748292c4 Fix linters issues and enable tox/zuul linters job as gate
Fix below issues:
    E003 Indent not multiple of 4
    E011 Then keyword is not on same line as if or elif keyword
    E020: Function declaration not in format "^function name {$":
          'function check_all_explicit_deps_installed'

add ignore in tox env
    E006 Line too long
    E010: Do not on same line as command
Change-Id: I13fb83452324c0db74c485f304827a6c9aacf9ae
Story: 2003370
Task: 24431
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-09-05 22:42:11 +08:00

63 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Build a basic CentOS system
CREATEREPO=$(which createrepo_c)
if [ $? -ne 0 ]; then
CREATEREPO="createrepo"
fi
function final_touches {
# create the repo
cd ${ROOTDIR}/${DEST}/isolinux
$CREATEREPO -g ../comps.xml .
# build the ISO
printf "Building image $OUTPUT_FILE\n"
cd ${ROOTDIR}/${DEST}
chmod 664 isolinux/isolinux.bin
mkisofs -o $OUTPUT_FILE \
-R -D -A 'oe_iso_boot' -V 'oe_iso_boot' \
-b isolinux.bin -c boot.cat -no-emul-boot \
-boot-load-size 4 -boot-info-table \
-eltorito-alt-boot \
-e images/efiboot.img \
-no-emul-boot \
isolinux/
isohybrid --uefi $OUTPUT_FILE
implantisomd5 $OUTPUT_FILE
cd $ROOTDIR
}
function setup_disk {
tar xJf emptyInstaller.tar.xz
mkdir ${DEST}/isolinux/Packages
}
function install_packages {
cd ${DEST}/isolinux/Packages
ROOT=${ROOTDIR} ../../../cgts_deps.sh --deps=../../../${MINIMAL}
cd ${ROOTDIR}
}
ROOTDIR=$PWD
INSTALLER_SRC=basicDisk
DEST=newDisk
PKGS_DIR=all_rpms
MINIMAL=minimal_rpm_list.txt
OUTPUT_FILE=${ROOTDIR}/centosIso.iso
# Make a basic install disk (no packages, at this point)
rm -rf ${DEST}
setup_disk
# install the packages (initially from minimal list, then resolve deps)
install_packages
# build the .iso
final_touches