Commit 6a6fc6a0 authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin

Change bash call

parent 33144870
#!/bin/bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# le6-conf is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
if [ "$(id -u)" != "0" ]; then
echo You must have more power to run this script
exit -1
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 [dist]"
exit 1
fi
if [ "$1" == '--help' ]; then
echo "Usage: $0 [dist]"
exit 2
fi
_DIST=$1
export PREFIX=$(pwd)
source ${PREFIX}/conf/$_DIST/create-iso.conf \
|| log ERROR "configuration file not found for dist: \"${_DIST}\""
source common.sh
mkdir -p ${TMP}
sudo apt-get install syslinux squashfs-tools genisoimage xorriso \
|| log ERROR "Failed to install basic tools: \"${_DIST}\""
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}; then
log ERROR "While running \"${SCRIPTSDIR}/${file}\""
fi
fi
done
NAME="LinuxEducacional6-$(echo ${_DIST} | cut -d'/' -f2).iso"
cd ${TMP}/image
sudo xorriso -as mkisofs -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -no-emul-boot -isohybrid-gpt-basdat -o ${PREFIX}/iso/${_DIST}/${NAME} \
. ||\
log ERROR "Failed to generate iso image."
cd -
cleanTmpFiles
exit 0
#!/bin/bash
#!/usr/bin/env bash
set -x
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......@@ -39,37 +39,21 @@ PREFIX=$PWD
source ${PREFIX}/common.sh
#cp ${CHROOTDIR}/boot/vmlinuz-*-generic ${TMP}/image/casper/vmlinuz || exit 1
cp ${PREFIX}/vmlinuz-*-generic ${TMP}/image/casper/vmlinuz || exit 1
if [ ! -d ${PREFIX}/initrd ]; then
mkdir ${PREFIX}/initrd
else
rm -rf ${PREFIX}/initrd/*
fi
initname=$(ls "${CHROOTDIR}/boot/" | grep "initrd.*")
if [ "$(ls "${CHROOTDIR}/boot/" | grep -c "initrd.*")" -gt "1" ]; then
initname=$(ls "${PREFIX}/" | grep "initrd.img*")
if [ "$(ls "${PREFIX}/" | grep -c "initrd.img*")" -gt "1" ]; then
initname="initrd"$(echo ${initname##*initrd})
fi
echo "initname = '${initname}'"
cd ${PREFIX}/initrd
gzip -dc ${CHROOTDIR}/boot/${initname} | cpio -id
gzip -dc ${PREFIX}/${initname} | cpio -i
cp ${PREFIX}/src/preseed/preseed.cfg ${PREFIX}/initrd/
broken_links=$(find . -type l ! -exec test -e {} \; -print)
for broken_link in ${broken_links}; do
path_file=$(readlink -m ${broken_link})
# Expand path_file and remove prefix presents in broken_link variable
# ex: path_file = /usr/share/plymouth/themes/le-text/le-text.plymouth
# $(dirname broken_link) = ./usr/share/plymouth/themes/
# so relative_path = le-text/le-text.plymouth
# parameter expansion used "${PARAMETER#PATTERN}" remove substring from PARAMETER that matches with PATTHERN
link_dir=$(dirname ${broken_link})
link_name=$(basename ${broken_link})
cd ${link_dir}
relative_path=${path_file#*${link_dir#.}/}
rm ${link_name}
ln -s ${relative_path} ${link_name}
cd -
done
find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../initrd.lz
find . | cpio --quiet -o -H newc | lzma -7 > ../initrd.lz
cd ..
cp initrd.lz ${TMP}/image/casper/initrd.lz || exit 1
exit 0
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
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