Commit 383cd32f authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin

SCRUM#494: Add script to generate local repository

parents c376573d dd04c33a
chroot
chroot-old
chroot-ultima.tar.gz
chroot.tar.bz2
overlay
kernel
*.swp
iso/**/*.iso
src/preseed/.preseed.bkp
initrd
initrd.lz
chroot*.tar.gz
repo.c3sl.ufpr.br
packages-needed
base
todos.txt
vmlinuz-*-generic
initrd.img-*-generic
SHORTNAME=le6
TMP=/home/daniel/image/${_DIST}/
CHROOTDIR=/home/daniel/overlay
TMP=/home/lucas/${_DIST}/
CHROOTDIR=/home/lucas/create-iso/overlay
OVERLAY=/home/lucas/tmp
CHROOTFILE=${TMP}/todo.sh
DISTRO=Linux_Educacional_6.1.0
DPLIST=${PREFIX}/pkg-list/${_DIST}/dependencies.list
......
......@@ -20,21 +20,49 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
_HELP=false
_DIST="nodistro"
_ARCH="amd64"
if [ "$(id -u)" != "0" ]; then
echo You must have more power to run this script
exit -1
while true; do
case "$1" in
-h | --help ) _HELP=true; shift ;;
-d | --distro ) _DIST=$2; shift; shift ;;
-a | --arch ) _ARCH=$2; shift; shift ;;
-* ) echo "Unrecognized option. Try with --help."; exit 1 ;;
* ) break ;;
esac
done
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 ""
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"
exit 2
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 [dist]"
if [ ${_DIST} = "nodistro" ]; then
echo "No distro. Try with --help."
exit 1
fi
if [ "$1" == '--help' ]; then
echo "Usage: $0 [dist]"
exit 2
if [ ${_ARCH} != "amd64" -a ${_ARCH} != "i386" ]; then
echo "Unrecognized architecture. 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
fi
_DIST=$1
export PREFIX=$(pwd)
source ${PREFIX}/conf/$_DIST/create-iso.conf \
......@@ -50,7 +78,7 @@ sudo apt-get install syslinux squashfs-tools genisoimage xorriso \
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} ${CHROOTDIR} ${CHROOTFILE} ${DISTRO} ${DPLIST} ${INSTLIST} ${ISOLINUX} ${MOUNTLIST} ${OURSOURCESLIST} ${RMDSKT} ${RMLIST} ${SCRIPTSDIR} ${SHORTNAME} ${SOURCESLISTDEFAULT} ${TMP} ${REPOPKGS}; then
if ! "${SCRIPTSDIR}/${file}" ${_DIST} ${_ARCH} ${CHROOTDIR} ${CHROOTFILE} ${DISTRO} ${DPLIST} ${INSTLIST} ${ISOLINUX} ${MOUNTLIST} ${OURSOURCESLIST} ${RMDSKT} ${RMLIST} ${SCRIPTSDIR} ${SHORTNAME} ${SOURCESLISTDEFAULT} ${TMP} ${OVERLAY} ${REPOPKGS}; then
log ERROR "While running \"${SCRIPTSDIR}/${file}\""
fi
fi
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source common.sh
......
......@@ -21,26 +21,27 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
OVERLAY=$(mktemp --suffix \-overlay --directory)
mkdir --mode=0700 --parents "${OVERLAY}/upper"
mkdir --mode=0700 --parents "${OVERLAY}/work"
mkdir --mode=0700 ${CHROOTDIR}
mkdir "${OVERLAY}/upper"
mkdir "${OVERLAY}/work"
mkdir ${CHROOTDIR}
if [ ! -d "${OVERLAY}" ]; then
echo "overlay path: '${OVERLAY}' has not been found."
......@@ -63,11 +64,13 @@ if [ ! -d "${PREFIX}/chroot" ]; then
exit 1
fi
if ! mount -t overlay overlay -o rw,lowerdir="${PREFIX}/chroot",upperdir="${OVERLAY}"/upper,workdir="${OVERLAY}"/work "${CHROOTDIR}"; then
echo "Overlay could not be mounted:" >&2
echo " lowerdir: '${PREFIX}/chroot'" >&2
echo " upperdir: '${OVERLAY}/upper'" >&2
echo " workdir: '${OVERLAY}/work'" >&2
echo "mount point: '${CHROOTDIR}'" >&2
exit 1
if ! mountpoint ${CHROOTDIR}; then
if ! mount -t overlay overlay -o rw,lowerdir="${PREFIX}/chroot",upperdir="${OVERLAY}"/upper,workdir="${OVERLAY}"/work "${CHROOTDIR}"; then
echo "Overlay could not be mounted:" >&2
echo " lowerdir: '${PREFIX}/chroot'" >&2
echo " upperdir: '${OVERLAY}/upper'" >&2
echo " workdir: '${OVERLAY}/work'" >&2
echo "mount point: '${CHROOTDIR}'" >&2
exit 1
fi
fi
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
export PREFIX=$PWD
source common.sh
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
......@@ -21,21 +21,24 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
if test -z ${CHROOTDIR}; then
echo "Variavel CHROOTDIR vazia!!"
echo "CHROOTDIR=\"${CHROOTDIR}\""
......@@ -50,7 +53,7 @@ cp src/keyboard ${CHROOTDIR}/etc/default/
set -x
printf $(sudo du -s --block-size=1 ${CHROOTDIR} | cut -f1) > ${TMP}image/casper/filesystem.size || exit 1
set +x
cp src/README.diskdefines ${TMP}/image/ || exit 1
cp src/README.diskdefines-${_ARCH} ${TMP}/image/README.diskdefines || exit 1
set -x
pushd ${TMP}/image/
ln -s . ubuntu
......
......@@ -21,20 +21,22 @@
# USA.
_DIST=$1
CHROOTDIR=$2
CHROOTFILE=$3
DISTRO=$4
DPLIST=$5
INSTLIST=$6
ISOLINUX=$7
MOUNTLIST=$8
OURSOURCESLIST=$9
RMDSKT=${10}
RMLIST=${11}
SCRIPTSDIR=${12}
SHORTNAME=${13}
SOURCESLISTDEFAULT=${14}
TMP=${15}
_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}
OVERLAY=${17}
PREFIX=$PWD
source ${PREFIX}/common.sh
......
#define DISKNAME Linux-Educacional 6.0
#define TYPE binary
#define TYPEbinary 1
#define ARCH i386
#define ARCHi386 1
#define DISKNUM 1
#define DISKNUM1 1
#define TOTALNUM 0
#define TOTALNUM0 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