Line 24... |
Line 24... |
24 |
ISO_DIR="/var/iso"
|
24 |
ISO_DIR="/var/iso"
|
25 |
ISO_IN="$ISO_DIR/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso"
|
25 |
ISO_IN="$ISO_DIR/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso"
|
26 |
|
26 |
|
27 |
# Drake installer
|
27 |
# Drake installer
|
28 |
INSTALLER_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/alcasar"
|
28 |
INSTALLER_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/alcasar"
|
- |
|
29 |
EFI_GRUB_CFG="${MAGEIA_NEW_DIR}/EFI/BOOT/grub.cfg"
|
29 |
AUTO_INSTALL_CFG="/var/iso/auto_inst.cfg.pl"
|
30 |
AUTO_INSTALL_CFG="/var/iso/auto_inst.cfg.pl"
|
30 |
ADVERT_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/extra/advertising"
|
31 |
ADVERT_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/extra/advertising"
|
31 |
|
32 |
|
32 |
# Alcasar
|
33 |
# Alcasar
|
33 |
ALCASAR_TAR="$1"
|
34 |
ALCASAR_TAR="$1"
|
Line 37... |
Line 38... |
37 |
ISO_SUPPORT="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH-DVD/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso"
|
38 |
ISO_SUPPORT="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH-DVD/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso"
|
38 |
ISO_MD5="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH-DVD/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso.md5"
|
39 |
ISO_MD5="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH-DVD/Mageia-$MAGEIA_VERSION-$ARCH-DVD.iso.md5"
|
39 |
|
40 |
|
40 |
# RPMs
|
41 |
# RPMs
|
41 |
RPM_DIR="/root/rpms"
|
42 |
RPM_DIR="/root/rpms"
|
42 |
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-mageia-theme harddrake hdparm hexedit info iwlwifi-agn-ucode kernel-desktop-latest kernel-firmware kernel-firmware-nonfree ldetect lftp lib64alsa-plugins lib64glib-networking-gnutls locales-en locales-fr lsof lvm2 mageia-theme-Default man-db mandi-ifw 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"
|
43 |
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 iwlwifi-agn-ucode kernel-desktop-latest kernel-firmware kernel-firmware-nonfree ldetect lftp lib64alsa-plugins lib64glib-networking-gnutls locales-en locales-fr lsof lvm2 mageia-theme-Default man-db mandi-ifw 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"
|
43 |
|
44 |
|
44 |
#######################
|
45 |
#######################
|
45 |
###### Functions ######
|
46 |
###### Functions ######
|
46 |
################################################################################
|
47 |
################################################################################
|
47 |
# Print the given error message and exit 1
|
48 |
# Print the given error message and exit 1
|
Line 96... |
Line 97... |
96 |
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
|
97 |
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
|
97 |
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
|
98 |
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
|
98 |
|
99 |
|
99 |
# Installing tools to create the iso
|
100 |
# Installing tools to create the iso
|
100 |
printBold "Installing necessary tools"
|
101 |
printBold "Installing necessary tools"
|
101 |
dnf install 'dnf-command(download)' -y >/dev/null || errorExit "could not install necessary packages"
|
102 |
dnf install 'dnf-command(download)' -y || errorExit "could not install necessary packages"
|
- |
|
103 |
#dnf install 'dnf-command(config-manager)' -y || errorExit "could not install necessary packages"
|
102 |
dnf config-manager --set-enabled mageia-x86_64-nonfree updates-x86_64-nonfree >/dev/null || errorExit "could not install necessary packages"
|
104 |
dnf config-manager --set-enabled mageia-x86_64-nonfree updates-x86_64-nonfree || errorExit "could not install necessary packages"
|
103 |
dnf install -y lftp wget cdrkit-genisoimage rpmtools >/dev/null || errorExit "could not install necessary packages"
|
105 |
dnf install -y lftp wget cdrkit-genisoimage xorriso rpmtools syslinux || errorExit "could not install necessary packages"
|
104 |
|
106 |
|
105 |
|
107 |
|
106 |
# Directories initialization
|
108 |
# Directories initialization
|
107 |
#-------------------------------------------------------------------------------
|
109 |
#-------------------------------------------------------------------------------
|
108 |
[[ ! -d "$RPM_DIR" ]] && mkdir -p "$RPM_DIR"
|
110 |
[[ ! -d "$RPM_DIR" ]] && mkdir -p "$RPM_DIR"
|
Line 120... |
Line 122... |
120 |
fi
|
122 |
fi
|
121 |
|
123 |
|
122 |
# Mounting the image
|
124 |
# Mounting the image
|
123 |
printBold "Mounting the image"
|
125 |
printBold "Mounting the image"
|
124 |
[[ ! -d "$MAGEIA_OFFICIAL_DIR" ]] && mkdir -p "$MAGEIA_OFFICIAL_DIR"
|
126 |
[[ ! -d "$MAGEIA_OFFICIAL_DIR" ]] && mkdir -p "$MAGEIA_OFFICIAL_DIR"
|
125 |
mount -o ro,loop "$ISO_IN" "$MAGEIA_OFFICIAL_DIR" || errorExit "failed mounting $ISO_IN"
|
127 |
mount -o ro,loop "$ISO_IN" "$MAGEIA_OFFICIAL_DIR" || (sleep 5 ; mount -o ro,loop "$ISO_IN" "$MAGEIA_OFFICIAL_DIR" || errorExit "failed mounting $ISO_IN. Running the script again might solve the issue.")
|
126 |
|
128 |
|
127 |
# Checking ARCHitecture
|
129 |
# Checking ARCHitecture
|
128 |
[[ -d ${MAGEIA_OFFICIAL_DIR}/x86_64 ]] && ARCH=x86_64 || ARCH=i586
|
130 |
[[ -d ${MAGEIA_OFFICIAL_DIR}/x86_64 ]] && ARCH=x86_64 || ARCH=i586
|
129 |
|
131 |
|
130 |
# Creating new directory that will contains the "cleared" iso image
|
132 |
# Creating new directory that will contains the "cleared" iso image
|
Line 212... |
Line 214... |
212 |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/compssUsers.pl ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/compssUsers.pl
|
214 |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/compssUsers.pl ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/compssUsers.pl
|
213 |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/media.cfg ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/media.cfg
|
215 |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/media.cfg ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/media.cfg
|
214 |
|
216 |
|
215 |
# Specify install configuration
|
217 |
# Specify install configuration
|
216 |
sed -i -e 's*rdz*rdz kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g' ${MAGEIA_NEW_DIR}/isolinux/isolinux.cfg
|
218 |
sed -i -e 's*rdz*rdz kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g' ${MAGEIA_NEW_DIR}/isolinux/isolinux.cfg
|
- |
|
219 |
sed -i -e 's*noiswmd*noiswmd kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g' $EFI_GRUB_CFG
|
217 |
|
220 |
|
218 |
# Generating distr
|
221 |
# Generating distr
|
219 |
echo "Generating mirror tree..."
|
222 |
echo "Generating mirror tree..."
|
220 |
gendistrib -s ${MAGEIA_NEW_DIR}/${ARCH}
|
223 |
gendistrib -s ${MAGEIA_NEW_DIR}/${ARCH}
|
221 |
|
224 |
|
222 |
# Creating the new iso file
|
225 |
# Creating the new iso file
|
223 |
echo "Creating the isofile..."
|
226 |
echo "Creating the isofile..."
|
224 |
alcasarVersion=$(echo $ALCASAR_TAR | cut -d '-' -f2 | rev | cut -d '.' -f 3- | rev )
|
227 |
alcasarVersion=$(echo $ALCASAR_TAR | cut -d '-' -f2 | rev | cut -d '.' -f 3- | rev )
|
225 |
newIsoName=Mageia-$MAGEIA_VERSION-${ARCH}-Alcasar${alcasarVersion}.iso
|
228 |
newIsoName=Mageia-$MAGEIA_VERSION-${ARCH}-Alcasar${alcasarVersion}.iso
|
226 |
cd ${MAGEIA_NEW_DIR} && genisoimage -quiet -o ${CURRENT_DIR}/${newIsoName} \
|
229 |
#cd ${MAGEIA_NEW_DIR} && genisoimage -quiet -o ${CURRENT_DIR}/${newIsoName} \
|
- |
|
230 |
# -b isolinux/isolinux.bin \
|
- |
|
231 |
# -c boot.catalog \
|
- |
|
232 |
# -no-emul-boot -boot-load-size 4 \
|
- |
|
233 |
# -boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
|
- |
|
234 |
|
- |
|
235 |
cd ${MAGEIA_NEW_DIR} && xorriso -as mkisofs -quiet -o ${CURRENT_DIR}/${newIsoName} \
|
- |
|
236 |
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
|
- |
|
237 |
-isohybrid-gpt-basdat \
|
227 |
-b isolinux/isolinux.bin \
|
238 |
-b isolinux/isolinux.bin \
|
228 |
-c boot.catalog \
|
239 |
-c boot.catalog \
|
229 |
-no-emul-boot -boot-load-size 4 \
|
240 |
-no-emul-boot -boot-load-size 4 \
|
230 |
-boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
|
241 |
-boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
|
231 |
|
242 |
|