48,11 → 48,12 |
TMP_DIR=/var/tmp |
MAGEIA_NEW_DIR=$TMP_DIR/mageia_new |
MAGEIA_OFFICIAL_DIR=$TMP_DIR/mageia_official |
MAGEIA_OFFICIAL_DIR_EFI=$TMP_DIR/mageia_official_efi |
coreDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/core |
nonFreeDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/nonfree |
mediaDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media |
coreDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/core/ |
nonFreeDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/nonfree |
urpmi_cache=/var/cache/urpmi/rpms |
|
# Drake installer |
INSTALLER_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/alcasar" |
62,6 → 63,7 |
|
# RPMs needed during an install stage |
BASE_RPM_LIST="acpi acpid alsa-utils aoss arp-scan basesystem bash-completion coreutils-doc cpupower curl dhcp-client dmraid dnf dnf-plugins-core dosfstools dracut drakx-net-text gpm grub2 grub2-efi grub2-mageia-theme harddrake hdparm hexedit info ldetect lftp lib64alsa-plugins lib64glib-networking-gnutls locales-en locales-fr lsof lvm2 mageia-theme-Default man-db man-pages microcode microcode_ctl mtools ntfs-3g numlock os-prober p11-kit perl-Hal-Cdroms plymouth procmail python3 python3-dbus radeon-firmware ralink-firmware rtlwifi-firmware sharutils shorewall-ipv6 strace sysfsutils tmpwatch tree vim-minimal vnstat xdg-user-dirs-gtk sudo socat mandi mandi-ifw" |
ISO_RPM_LIST="cdrkit-genisoimage xorriso rpmtools syslinux" |
|
####################### |
###### Main ###### |
73,13 → 75,14 |
[[ ! -f "$RESSOURCES/auto_inst.cfg.pl_template" ]] && errorExit "No auto_inst.cfg.pl_template file in $RESSOURCES" |
[[ $ALCASAR_TARBALL == "" ]] && errorExit "No ALCASAR tarball file in $RESSOURCES" |
|
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR $MAGEIA_OFFICIAL_DIR_EFI |
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR |
do |
[ -d $directory ] || mkdir -p $directory |
done |
printBold "Mageiar will be build with Mageia-$MAGEIA_VERSION-$ARCH and $ALCASAR_EXTRACTED_DIR" |
|
# Retrieve list of installed RPM |
# remove some rpm (if this script has been already run) |
urpme $ISO_RPM_LIST --auto-orphans --force 2>/dev/null |
# Retrieve list of installed RPM (without those that will be installed with the alcasar install script) |
ALCASAR_RPM_LIST="$(dnf list installed | cut -d " " -f1 | rev | cut -d "." -f2- | rev | grep -Ev 'coova-chilli|gammu|lib64gammu8|ipt-netflow|nfdump|wkhtmltopdf' | tail -n +2 | tr '\n' ' ')" |
# agregate & clean rpm list |
RPM_LIST=$(echo $BASE_RPM_LIST $ALCASAR_RPM_LIST | sed "s/ /\n/g" | sort | uniq | sed "s/\n/ /g") |
97,8 → 100,9 |
|
# Installing tools to create the iso file |
printBold "Installing ISO building tools" |
dnf install 'dnf-command(download)' -y || errorExit "could not install necessary packages" |
dnf install -y lftp wget cdrkit-genisoimage xorriso rpmtools syslinux || errorExit "could not install necessary packages" |
#dnf install 'dnf-command(download)' -y || errorExit "could not install necessary packages" |
#dnf install -y $ISO_RPM_LIST || errorExit "could not install necessary packages" |
urpmi $ISO_RPM_LIST --force|| errorExit "could not install necessary packages" |
|
# Mounting the ISO image |
printBold "Mounting the image" |
127,17 → 131,18 |
echo "Copying $total RPMS in ISO ..." |
for rpm in ${RPM_LIST}; do |
let percent="${count} * 100 / ${total}" |
dnf download --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm" |
# dnf download --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm" |
#urpmi --no-install --replacepkgs -q $rpm 2> /dev/null || urpmi --no-install -q --force $rpm 2> /dev/null || echo "could not download $rpm" |
printProgress ${percent} |
count=$(expr ${count} + 1) |
done |
printBold "$count RPMs copied" |
|
# Copying the Alcasar tarball & automatic install option into the ISO |
mkdir -p $INSTALLER_DIR || errorExit "could not create directory $INSTALLER_DIR" |
cp $RESSOURCES/$ALCASAR_TARBALL $INSTALLER_DIR || errorExit "could not copy $RESSOURCES/$ALCASAR_TARBALL to $INSTALLER_DIR" |
cp $AUTO_INSTALL_CFG $INSTALLER_DIR || errorExit "could not copy $AUTO_INSTALL_CFG to $INSTALLER_DIR" |
|
mv $urpmi_cache/*.rpm $coreDirNew |
# Generating media info for core |
echo "Generating media_info for core..." |
genhdlist2 ${coreDirNew} --allow-empty-media --quiet |
187,9 → 192,10 |
# Unmounting & Removing temporary dir |
echo "Umounting..." |
umount $MAGEIA_OFFICIAL_DIR |
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR $MAGEIA_OFFICIAL_DIR_EFI |
mv $coreDirNew/*.rpm $urpmi_cache |
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR |
do |
[ -d $directory ] && rm -rf $directory |
done |
rm -f "$AUTO_INSTALL_CFG" |
echo "Done." |
echo "All RPM are always in '/var/cache/urpmi/rpms'Done. Remove them if nedded." |