141,6 → 141,9 |
echo "Mageia-6-${arch} ${p}" |
} |
|
################################# |
# BEGIN HERE # |
################################# |
# Checking arguments (rpm_list and iso file and eventually lang) |
[[ ($# -lt 1) || ($# -gt 2) ]] && echo \ |
"Usage: $0 ARGS |
170,8 → 173,9 |
RPMS_DIR=$(pwd)"/rpms" |
[[ -d ${RPMS_DIR} ]] && rm -rf ${RPMS_DIR} |
mkdir ${RPMS_DIR} |
# Retreiving rpm_list |
rpm_needed=`rpm -qa` |
# Retreiving rpm_lists |
rpm_need_by_alcasar=`rpm -qa` |
rpm_need_by_mageia=`cat minimal-rpm-list` |
|
# official and new dirs |
mageiaNewDir=/tmp/mageia_new |
193,7 → 197,7 |
|
# Copying main files except core and nonfree directories |
echo "Extracting base image..." |
cd /tmp/mageia_official && \ |
cd $mageiaOfficialDir && \ |
tar cf - --exclude=${arch}/media . | (cd $mageiaNewDir && tar xf - ) && cd "${actualDir}" |
|
# Creating new directories core and nonfree and dir for alcasar stufs |
216,10 → 220,9 |
# Copying the RPM in core and nonfree and clearing the plop.idx file |
echo "Copying RPMS in ISO ..." |
> ${plopFilePath} |
total=`echo $rpm_needed | wc -w` |
|
# Selecting rpm |
for rpm in ${rpm_needed}; do |
total=`echo $rpm_need_by_mageia | wc -w` |
# Selecting & copying of rpm need by Mageia |
for rpm in ${rpm_need_by_mageia}; do |
let percent="${count} * 100 / ${total}" |
print_percentage ${percent} |
# Retreiving output of ls in directories |
230,40 → 233,53 |
# Copying RPM |
cp "${coreDir}/${fileInCore}" ${coreDirNew} |
countCore=$(expr ${countCore} + 1) |
# Updating the plop.idx |
purifyRpmName ${rpm} ${arch} >> ${plopFilePath} |
# If present in nonfree, copying in nonfree_new |
elif [[ ! -z ${fileInNonFree} ]]; then |
# Updating the plop.idx |
purifyRpmName ${rpm} ${arch} >> ${plopFilePath} |
# if present in nonfree, copying in nonfree_new |
elif [[ ! -z ${fileInNonFree} ]]; then |
# Copying RPM |
cp "${nonFreeDir}/${fileInNonFree}" ${nonFreeDirNew} |
countNonFree=$(expr ${countNonFree} + 1) |
# Updating the plop.idx |
purifyRpmName ${rpm} ${arch} >> ${plopFilePath} |
else |
# we need to download it and to copy on ALCASAR special RPM tarball |
# if RPM name is also in core/nonfree, we need to copying it in core/nonfree |
# be carefull with kernel (ISO must boot on the original one) |
# Updating the plop.idx |
purifyRpmName ${rpm} ${arch} >> ${plopFilePath} |
else |
echo "$rpm not found" |
fi |
count=$(expr ${count} + 1) |
done |
# Sorting the plop file alphabetically |
cat ${plopFilePath} | sort > /tmp/tmpFileMageia && mv /tmp/tmpFileMageia ${plopFilePath} |
# Informations |
echo "$count RPMs copied (${countCore} from core and ${countNonFree} from nonfree)" |
echo "Hit a Key to download complemmentary RPMs" |
read a |
|
count=0 |
total=`echo $rpm_need_by_alcasar | wc -w` |
# Selecting & copying of rpm need by alcasar |
for rpm in ${rpm_need_by_alcasar}; do |
let percent="${count} * 100 / ${total}" |
print_percentage ${percent} |
# Retreiving output of ls in directories |
fileInCore=$(ls ${coreDir} | grep "^${rpm}") |
fileInNonFree=$(ls ${nonFreeDir} | grep "^${rpm}") |
# we need to download icomplementary RPMS (that aren't in core nor in nonfree) |
if [ -z ${fileInCore} ] && [ -z ${fileInNonFree} ]; then |
url=$(urpmq --ignorearch --sources ${rpm} | grep 'updates\|release' | uniq) |
wget -P "${RPMS_DIR}" "${url}" --quiet |
short_name=`rpm -q $rpm --qf "%{NAME}\n"` |
# echo "$count - $countCore - $countNonFree : $rpm not in core/update - shortame = $short_name" |
#read a |
cp ${RPMS_DIR}/${rpm}.${arch}.rpm ${coreDirNew} |
fi |
count=$(expr ${count} + 1) |
done |
|
# Sorting the plop file alphabetically |
cat ${plopFilePath} | sort > /tmp/tmpFileMageia && mv /tmp/tmpFileMageia ${plopFilePath} |
|
tar -cvf ${actualDir}/alcasar.tar.gz ${RPMS_DIR}/ |
cp ${actualDir}/alcasar.tar.gz ${mageiaNewDir}/${arch}/install/alcasar |
# Informations |
echo "${countCore} files kept from core" |
echo "${countNonFree} files kept from nonfree" |
echo "$count complementary RPMs copied" |
echo "Hit a Key to create the ISO file" |
read a |
|
# Copying customized files |
echo "Copying customized files..." |
tar -cvf ${actualDir}/alcasar.tar.gz ${RPMS_DIR}/ |
cp ${actualDir}/alcasar.tar.gz ${mageiaNewDir}/${arch}/install/alcasar |
### only if we want to change the normal install procedure ### |
#cp ${actualDir}/config/first_login ${mageiaNewDir}/${arch}/install/alcasar |
#cp ${actualDir}/config/auto_inst-${arch}${lang}.cfg.pl ${mageiaNewDir}/${arch}/install/alcasar/auto_inst-${arch}.cfg.pl |