Commit e6641bcc authored by Alessandro Elias's avatar Alessandro Elias

Merge branch 'issue/554' into 'develop'

SCRUM#554: Add parameter to easily choose remote repo's and set local repo's codename

See merge request !11
parents 7e5bbefa 7f53388b
......@@ -23,12 +23,14 @@
_HELP=false
_DIST="nodistro"
_ARCH="amd64"
_REPO="stable"
while true; do
case "$1" in
-h | --help ) _HELP=true; shift ;;
-d | --distro ) _DIST=$2; shift; shift ;;
-a | --arch ) _ARCH=$2; shift; shift ;;
-r | --repo ) _REPO=$2; shift; shift ;;
-* ) echo "Unrecognized option. Try with --help."; exit 1 ;;
* ) break ;;
esac
......@@ -38,13 +40,14 @@ if [ ${_HELP} = true ]; then
echo "Usage: sudo $0 [OPTION] [ARGUMENT]..."
echo ""
echo "Examples:"
echo " sudo $0 --distro le6/testing # Generate default arch (amd64) le6 iso image"
echo " sudo $0 -d le6/testing -a i386 # Generate i386 architecture le6 iso image"
echo " sudo $0 --distro le6/testing # Generate default arch (amd64) le6 iso image"
echo " sudo $0 -d le6/testing -a i386 # Generate i386 architecture le6 iso image"
echo ""
echo "Options:"
echo " -h, --help Show this help list"
echo " -d, --distro [DIST] Select iso image's distro"
echo " -a, --arch [amd64 | i386] Select iso image's architecture"
echo " -h, --help Show this help list"
echo " -d, --distro [DIST] Select iso image's distro"
echo " -a, --arch [amd64 | i386] Select iso image's architecture"
echo " -r, --repo [stable | testing | unstable] Select remote repository codename to download packages from"
exit 2
fi
......@@ -58,6 +61,11 @@ if [ ${_ARCH} != "amd64" -a ${_ARCH} != "i386" ]; then
exit 1
fi
if [ ${_REPO} != "stable" -a ${_REPO} != "testing" -a ${_REPO} != "unstable" ]; then
echo "Unrecognized remote repository codename. Try with --help."
exit 1
fi
if [ "$(id -u)" != "0" ]; then
echo "You must have more power to run this script. Are you root?"
exit -1
......@@ -82,7 +90,7 @@ mkdir -p ${TMP}
for file in $(ls ${SCRIPTSDIR}); do
if [ -x "${SCRIPTSDIR}/${file}" ] && egrep -q '^[0-9]{2}-[a-z-]+' <<< "$file"; then
echo "$file"
if ! "${SCRIPTSDIR}/${file}" ${_DIST} ${_ARCH} ${CHROOTDIR} ${CHROOTFILE} ${DISTRO} ${DPLIST} ${INSTLIST} ${ISOLINUX} ${MOUNTLIST} ${OURSOURCESLIST} ${RMDSKT} ${RMLIST} ${SCRIPTSDIR} ${SHORTNAME} ${SOURCESLISTDEFAULT} ${TMP} ${TMPFS} ${REPOPKGS}; then
if ! "${SCRIPTSDIR}/${file}" ${_DIST} ${_ARCH} ${_REPO} ${CHROOTDIR} ${CHROOTFILE} ${DISTRO} ${DPLIST} ${INSTLIST} ${ISOLINUX} ${MOUNTLIST} ${OURSOURCESLIST} ${RMDSKT} ${RMLIST} ${SCRIPTSDIR} ${SHORTNAME} ${SOURCESLISTDEFAULT} ${TMP} ${TMPFS} ${REPOPKGS}; then
log ERROR "While running \"${SCRIPTSDIR}/${file}\""
fi
fi
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -25,22 +25,23 @@ set -e
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......@@ -54,10 +55,10 @@ fi
cp -Ra ${PREFIX}/src/local-repository/ ${PREFIX}/repo/
sed -i "s/##ARCH##/ ${_ARCH}/" ${PREFIX}/repo/conf/distributions
sed -i "s/##GPGKEY##/ ${fingerprint}/" ${PREFIX}/repo/conf/distributions
codename=$(grep 'Codename' ${PREFIX}/repo/conf/distributions | cut -d':' -f2)
sed -i "s/##CODENAME##/ ${_REPO}/" ${PREFIX}/repo/conf/distributions
chroot ${CHROOTDIR} apt-get clean
chroot ${CHROOTDIR} apt-get --download-only --yes install $(cat ${REPOPKGS} | grep -v '^#' | tr '\n' ' ')
reprepro --basedir ${PREFIX}/repo/ includedeb ${codename} ${CHROOTDIR}/var/cache/apt/archives/*.deb
reprepro --basedir ${PREFIX}/repo/ includedeb ${_REPO} ${CHROOTDIR}/var/cache/apt/archives/*.deb
chroot ${CHROOTDIR} apt-get clean
mv repo/{dists,pool} ${TMP}/image/
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -22,29 +22,30 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
addToChrootFile $CHROOTFILE "export PATH='/fakebin:${PATH}'"
addToChrootFile $CHROOTFILE "export DEBIAN_FRONTEND=noninteractive"
addToChrootFile $CHROOTFILE "apt-get update && apt-get -q -y -t stable install le-live-all"
addToChrootFile $CHROOTFILE "apt-get update && apt-get -q -y -t stable install $(cat ${INSTLIST} | grep -v '^#' | tr '\n' ' ')"
addToChrootFile $CHROOTFILE "apt-get update && apt-get -q -y -t ${_REPO} install le-live-all"
addToChrootFile $CHROOTFILE "apt-get update && apt-get -q -y -t ${_REPO} install $(cat ${INSTLIST} | grep -v '^#' | tr '\n' ' ')"
exit 0
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
export PREFIX=$PWD
source common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
if test -z ${CHROOTDIR}; then
......
......@@ -22,22 +22,23 @@
_DIST=$1
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
TMPFS=${17}
REPOPKGS=${18}
_REPO=$3
CHROOTDIR=$4
CHROOTFILE=$5
DISTRO=$6
DPLIST=$7
INSTLIST=$8
ISOLINUX=$9
MOUNTLIST=${10}
OURSOURCESLIST=${11}
RMDSKT=${12}
RMLIST=${13}
SCRIPTSDIR=${14}
SHORTNAME=${15}
SOURCESLISTDEFAULT=${16}
TMP=${17}
TMPFS=${18}
REPOPKGS=${19}
PREFIX=$PWD
source ${PREFIX}/common.sh
......@@ -47,6 +48,7 @@ if [ ! -d "${CHROOTDIR}/etc/apt/sources.list.d" ]; then
mkdir "${CHROOTDIR}/etc/apt/sources.list.d"
fi
cp ${OURSOURCESLIST} ${CHROOTDIR}/etc/apt/sources.list.d/
sed -i "s/##CODENAME##/${_REPO}/g" ${CHROOTDIR}/etc/apt/sources.list.d/$(basename ${OURSOURCESLIST})
addToChrootFile $CHROOTFILE "wget -O- http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key | apt-key add -"
addToChrootFile $CHROOTFILE "apt-get update"
......
deb http://repo.c3sl.ufpr.br/le6/ stable main
deb-src http://repo.c3sl.ufpr.br/le6/ stable main
deb http://repo.c3sl.ufpr.br/le6/ ##CODENAME## main
deb-src http://repo.c3sl.ufpr.br/le6/ ##CODENAME## main
Origin: C3SL
Label: C3sl Live
Architectures:##ARCH##
Codename: stable
Codename:##CODENAME##
Components: main
Description: Repo description
Version: 0.1
......
Markdown is supported
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