Subversion Repositories ALCASAR

Rev

Rev 2750 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2750 Rev 2860
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# Authors: Mageia Team
3
# Authors: Mageia Team
4
# Update for ALCASAR : Hamza ESSAYEGH (Querdos) - Rexy - Laurent Roux - Aurelien Dubois
4
# Update for ALCASAR : Hamza ESSAYEGH (Querdos) - Rexy - Laurent Roux - Aurelien Dubois
5
##
5
##
6
# Usage: $0 ARGS
6
# Usage: $0 ARGS
7
#     --iso-file, -i      Mageia-xxx-xxxxxx-xxx.iso (mandatory)
7
#     --iso-file, -i      Mageia-xxx-xxxxxx-xxx.iso (mandatory)
8
#     --lang, -l          Language for installation (optional)
8
#     --lang, -l          Language for installation (optional)
9
#                         Supported languages: fr;en
9
#                         Supported languages: fr;en
10
#
10
#
11
#######################
11
#######################
12
###### Variables ######
12
###### Variables ######
13
###############################################################################""
13
###############################################################################""
14
 
14
 
15
CURRENT_DIR="$(readlink -f "$(dirname $0)")"
15
CURRENT_DIR="$(readlink -f "$(dirname $0)")"
16
LOG_FILE="$CURRENT_DIR/build-image.log"
16
LOG_FILE="$CURRENT_DIR/build-image.log"
17
 
17
 
18
# Mageia
18
# Mageia
19
MAGEIA_VERSION=`cat /etc/release|cut -c 16`
19
MAGEIA_VERSION=`cat /etc/release|cut -c 16`
20
ARCH=`cat /etc/release|cut -c 33-38`
20
ARCH=`cat /etc/release|cut -c 33-38`
21
MAGEIA_NEW_DIR=/tmp/mageia_new
21
MAGEIA_NEW_DIR=/tmp/mageia_new
22
MAGEIA_OFFICIAL_DIR=/tmp/mageia_official
22
MAGEIA_OFFICIAL_DIR=/tmp/mageia_official
23
# ISO file
23
# ISO file
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.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
EFI_GRUB_CFG="${MAGEIA_NEW_DIR}/boot/grub2/grub.cfg"
30
AUTO_INSTALL_CFG="/var/iso/auto_inst.cfg.pl"
30
AUTO_INSTALL_CFG="/var/iso/auto_inst.cfg.pl"
31
ADVERT_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/extra/advertising"
31
ADVERT_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/extra/advertising"
32
 
32
 
33
# Alcasar
33
# Alcasar
34
ALCASAR_TAR="$1"
34
ALCASAR_TAR="$1"
35
ALCASAR_EXTRACTED_DIR=$(echo $ALCASAR_TAR | rev | cut -d '.' -f 3- | rev)
35
ALCASAR_EXTRACTED_DIR=$(echo $ALCASAR_TAR | rev | cut -d '.' -f 3- | rev)
36
 
36
 
37
# Mirrors
37
# Mirrors
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_SUPPORT="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH/Mageia-$MAGEIA_VERSION-$ARCH.iso"
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
ISO_MD5="http://ftp.free.fr/mirrors/mageia.org/iso/$MAGEIA_VERSION/Mageia-$MAGEIA_VERSION-$ARCH/Mageia-$MAGEIA_VERSION-$ARCH.iso.md5"
40
 
40
 
41
# RPMs
41
# RPMs
42
RPM_DIR="/root/rpms"
42
RPM_DIR="/root/rpms"
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
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 sudo"
44
 
44
 
45
#######################
45
#######################
46
###### Functions ######
46
###### Functions ######
47
################################################################################
47
################################################################################
48
# Print the given error message and exit 1
48
# Print the given error message and exit 1
49
function errorExit()
49
function errorExit()
50
{
50
{
51
    tput bold
51
    tput bold
52
    echo -e "ERROR : $1 \nAborting\n" >&2
52
    echo -e "ERROR : $1 \nAborting\n" >&2
53
    echo "$1" > "$LOG_FILE"
53
    echo "$1" > "$LOG_FILE"
54
    tput sgr0
54
    tput sgr0
55
    exit 1
55
    exit 1
56
}
56
}
57
#-------------------------------------------------------------------------------
57
#-------------------------------------------------------------------------------
58
# Print progress bar. $1 is a multiple of five
58
# Print progress bar. $1 is a multiple of five
59
function printProgress()
59
function printProgress()
60
{
60
{
61
    local a
61
    local a
62
    let "a = $1 / 5"
62
    let "a = $1 / 5"
63
    let "b = 25 - $a"
63
    let "b = 25 - $a"
64
    progressStr=$(printf "%${a}s")
64
    progressStr=$(printf "%${a}s")
65
    progressStrBlanks=$(printf "%${b}s")
65
    progressStrBlanks=$(printf "%${b}s")
66
    echo -en "Downloading...$1% [${progressStr// /#}${progressStrBlanks// / }]\r"
66
    echo -en "Downloading...$1% [${progressStr// /#}${progressStrBlanks// / }]\r"
67
}
67
}
68
#-------------------------------------------------------------------------------
68
#-------------------------------------------------------------------------------
69
function printBold()
69
function printBold()
70
{
70
{
71
    tput bold 2>/dev/null
71
    tput bold 2>/dev/null
72
    echo $1
72
    echo $1
73
    tput sgr0 2>/dev/null
73
    tput sgr0 2>/dev/null
74
}
74
}
75
#######################
75
#######################
76
######    Main    ######
76
######    Main    ######
77
################################################################################
77
################################################################################
78
 
78
 
79
# Retrieve list of Alcasar dependencies
79
# Retrieve list of Alcasar dependencies
80
tar -xf /var/iso/$ALCASAR_TAR -C /tmp/ || errorExit "could not extract alcasar tar archive"
80
tar -xf /var/iso/$ALCASAR_TAR -C /tmp/ || errorExit "could not extract alcasar tar archive"
81
alcasarRpmList="$(grep -oP "(?<=PACKAGES=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-urpmi.sh)"
81
alcasarRpmList="$(grep -oP "(?<=PACKAGES=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-urpmi.sh)"
82
alcasarKernel="$(grep -oP "(?<=KERNEL=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-urpmi.sh)"
82
alcasarKernel="$(grep -oP "(?<=KERNEL=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-urpmi.sh)"
83
alcasarRpmList="$alcasarRpmList $alcasarKernel"
83
alcasarRpmList="$alcasarRpmList $alcasarKernel"
84
 
84
 
85
# Make clean rpm list
85
# Make clean rpm list
86
rpmList=$(echo $BASE_RPM_LIST $alcasarRpmList | sed "s/ /\n/g" | sort | uniq | sed "s/\n/ /g")
86
rpmList=$(echo $BASE_RPM_LIST $alcasarRpmList | sed "s/ /\n/g" | sort | uniq | sed "s/\n/ /g")
87
 
87
 
88
# Insert list into AUTO_INSTALL_CFG
88
# Insert list into AUTO_INSTALL_CFG
89
formattedList=$(echo $rpmList | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g" | sed "/kernel-server/d")
89
formattedList=$(echo $rpmList | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g" | sed "/kernel-server/d")
90
cp "${AUTO_INSTALL_CFG}_template" "$AUTO_INSTALL_CFG" -f
90
cp "${AUTO_INSTALL_CFG}_template" "$AUTO_INSTALL_CFG" -f
91
insertLineNumber=$(grep -n "'default_packages' => " "$AUTO_INSTALL_CFG" | cut -d ':' -f1)
91
insertLineNumber=$(grep -n "'default_packages' => " "$AUTO_INSTALL_CFG" | cut -d ':' -f1)
92
fileTop=$(head -n "+$insertLineNumber" "$AUTO_INSTALL_CFG")
92
fileTop=$(head -n "+$insertLineNumber" "$AUTO_INSTALL_CFG")
93
fileBottom=$(tail -n "+$insertLineNumber" "$AUTO_INSTALL_CFG" | tail -n +2)
93
fileBottom=$(tail -n "+$insertLineNumber" "$AUTO_INSTALL_CFG" | tail -n +2)
94
cat /dev/null > "$AUTO_INSTALL_CFG"
94
cat /dev/null > "$AUTO_INSTALL_CFG"
95
 
95
 
96
echo "$fileTop" > "$AUTO_INSTALL_CFG"
96
echo "$fileTop" > "$AUTO_INSTALL_CFG"
97
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
97
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
98
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
98
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
99
 
99
 
100
# Installing tools to create the iso
100
# Installing tools to create the iso
101
printBold "Installing necessary tools"
101
printBold "Installing necessary tools"
102
dnf install 'dnf-command(download)' -y || 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"
103
#dnf install 'dnf-command(config-manager)' -y || 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"
104
dnf config-manager --set-enabled mageia-x86_64-nonfree updates-x86_64-nonfree  || errorExit "could not install necessary packages"
105
dnf install -y lftp wget cdrkit-genisoimage xorriso rpmtools syslinux || errorExit "could not install necessary packages"
105
dnf install -y lftp wget cdrkit-genisoimage xorriso rpmtools syslinux || errorExit "could not install necessary packages"
106
 
106
 
107
 
107
 
108
# Directories initialization
108
# Directories initialization
109
#-------------------------------------------------------------------------------
109
#-------------------------------------------------------------------------------
110
[[ ! -d "$RPM_DIR" ]] && mkdir -p "$RPM_DIR"
110
[[ ! -d "$RPM_DIR" ]] && mkdir -p "$RPM_DIR"
111
 
111
 
112
# Beggining work on the ISO
112
# Beggining work on the ISO
113
#-------------------------------------------------------------------------------
113
#-------------------------------------------------------------------------------
114
# Checking the optional Mageia image. If not present or does not match the
114
# Checking the optional Mageia image. If not present or does not match the
115
# docker's version, download it
115
# docker's version, download it
116
if [[ ! -f "$ISO_IN" ]]; then
116
if [[ ! -f "$ISO_IN" ]]; then
117
    printBold "Downloading the Mageia iso"
117
    printBold "Downloading the Mageia iso"
118
    cd $ISO_DIR || errorExit "could not cd to $ISO_DIR"
118
    cd $ISO_DIR || errorExit "could not cd to $ISO_DIR"
119
    echo Installing lftp
119
    echo Installing lftp
120
    lftpget -c $ISO_SUPPORT || ( cd "$CURRENT_DIR" && errorExit "could not download Mageia iso" )
120
    lftpget -c $ISO_SUPPORT || ( cd "$CURRENT_DIR" && errorExit "could not download Mageia iso" )
121
    cd $CURRENT_DIR
121
    cd $CURRENT_DIR
122
fi
122
fi
123
 
123
 
124
# Mounting the image
124
# Mounting the image
125
printBold "Mounting the image"
125
printBold "Mounting the image"
126
[[ ! -d "$MAGEIA_OFFICIAL_DIR" ]] && mkdir -p "$MAGEIA_OFFICIAL_DIR"
126
[[ ! -d "$MAGEIA_OFFICIAL_DIR" ]] && mkdir -p "$MAGEIA_OFFICIAL_DIR"
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.")
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.")
128
 
128
 
129
# Checking ARCHitecture
129
# Checking ARCHitecture
130
[[ -d ${MAGEIA_OFFICIAL_DIR}/x86_64 ]] && ARCH=x86_64 || ARCH=i586
130
[[ -d ${MAGEIA_OFFICIAL_DIR}/x86_64 ]] && ARCH=x86_64 || ARCH=i586
131
 
131
 
132
# Creating new directory that will contains the "cleared" iso image
132
# Creating new directory that will contains the "cleared" iso image
133
[[ -d ${MAGEIA_NEW_DIR} ]] && rm -rf ${MAGEIA_NEW_DIR}
133
[[ -d ${MAGEIA_NEW_DIR} ]] && rm -rf ${MAGEIA_NEW_DIR}
134
mkdir ${MAGEIA_NEW_DIR}
134
mkdir ${MAGEIA_NEW_DIR}
135
 
135
 
136
# Copying main files except core and nonfree directories
136
# Copying main files except core and nonfree directories
137
echo "Extracting base image..."
137
echo "Extracting base image..."
138
cd $MAGEIA_OFFICIAL_DIR && \
138
cd $MAGEIA_OFFICIAL_DIR && \
139
    tar cf - --exclude=${ARCH}/media . | (cd $MAGEIA_NEW_DIR && tar xf - ) && cd "${CURRENT_DIR}"
139
    tar cf - --exclude=${ARCH}/media . | (cd $MAGEIA_NEW_DIR && tar xf - ) && cd "${CURRENT_DIR}"
140
 
140
 
141
# Creating new directories core and nonfree and dir for alcasar stufs
141
# Creating new directories core and nonfree and dir for alcasar stufs
142
mkdir -p ${MAGEIA_NEW_DIR}/${ARCH}/{media/{core,nonfree},install/alcasar}
142
mkdir -p ${MAGEIA_NEW_DIR}/${ARCH}/{media/{core,nonfree},install/alcasar}
143
 
143
 
144
# Adding Alcasar image advert to the installer
144
# Adding Alcasar image advert to the installer
145
cp -f /var/iso/install_slideshow/* "$ADVERT_DIR"
145
cp -f /var/iso/install_slideshow/* "$ADVERT_DIR"
146
 
146
 
147
# Retrieving core and nonfree dirs (official)
147
# Retrieving core and nonfree dirs (official)
148
coreDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/core
148
coreDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/core
149
nonFreeDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/nonfree
149
nonFreeDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/nonfree
150
 
150
 
151
# Retrieving core and nonfree dirs (new)
151
# Retrieving core and nonfree dirs (new)
152
coreDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/core/
152
coreDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/core/
153
nonFreeDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/nonfree
153
nonFreeDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/nonfree
154
plopFilePath=${MAGEIA_NEW_DIR}/${ARCH}/media/plop.idx
154
plopFilePath=${MAGEIA_NEW_DIR}/${ARCH}/media/plop.idx
155
 
155
 
156
# Initializing counts
156
# Initializing counts
157
count=0
157
count=0
158
 
158
 
159
# Getting list of rpms needed by Mageia
159
# Getting list of rpms needed by Mageia
160
#mageiaRpms="$(cat $MINIMAL_rpmList)"
160
#mageiaRpms="$(cat $MINIMAL_rpmList)"
161
 
161
 
162
# Copying the RPM in core and nonfree and clearing the plop.idx file
162
# Copying the RPM in core and nonfree and clearing the plop.idx file
163
echo "Copying RPMS in ISO ..."
163
echo "Copying RPMS in ISO ..."
164
echo /dev/null > ${plopFilePath}
164
echo /dev/null > ${plopFilePath}
165
 
165
 
-
 
166
dnf upgrade -y
-
 
167
 
166
installedList="$(dnf list installed | cut -d ' ' -f1 | rev | cut -d . -f2- | rev | tail -n +2 | tr '\n' ' ')"
168
installedList="$(dnf list installed | cut -d ' ' -f1 | rev | cut -d . -f2- | rev | tail -n +2 | tr '\n' ' ')"
167
nbInstalled=$(echo $installedList | wc -w)
169
nbInstalled=$(echo $installedList | wc -w)
168
rpmList="$installedList $BASE_RPM_LIST $alcasarRpmList"
170
rpmList="$installedList $BASE_RPM_LIST $alcasarRpmList"
169
total=`echo $rpmList | wc -w`
171
total=`echo $rpmList | wc -w`
170
 
172
 
171
for rpm in ${rpmList}; do
173
for rpm in ${rpmList}; do
172
	let percent="${count} * 100 / ${total}"
174
	let percent="${count} * 100 / ${total}"
173
    if [[ $count -lt $nbInstalled ]] ; then
175
    if [[ $count -lt $nbInstalled ]] ; then
174
        dnf reinstall -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
176
        dnf reinstall -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
175
    else
177
    else
176
        dnf install -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
178
        dnf install -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
177
    fi
179
    fi
178
    printProgress ${percent}
180
    printProgress ${percent}
179
 
181
 
180
	count=$(expr ${count} + 1)
182
	count=$(expr ${count} + 1)
181
done
183
done
182
 
184
 
183
# Sorting the plop file alphabetically
185
# Sorting the plop file alphabetically
184
cat ${plopFilePath} | sort > /tmp/tmpFileMageia && mv /tmp/tmpFileMageia ${plopFilePath}
186
cat ${plopFilePath} | sort > /tmp/tmpFileMageia && mv /tmp/tmpFileMageia ${plopFilePath}
185
 
187
 
186
# Informations
188
# Informations
187
printBold "$count RPMs copied"
189
printBold "$count RPMs copied"
188
 
190
 
189
# Downloading rpms needed by Alcasar
191
# Downloading rpms needed by Alcasar
190
cd "$CURRENT_DIR"
192
cd "$CURRENT_DIR"
191
printBold "Downloading Alcasar dependencies"
193
printBold "Downloading Alcasar dependencies"
192
tar -xf /var/iso/$ALCASAR_TAR
194
tar -xf /var/iso/$ALCASAR_TAR
193
 
195
 
194
# Copying the Alcasar tar to be put into the ISO
196
# Copying the Alcasar tar to be put into the ISO
195
cp /var/iso/$ALCASAR_TAR $INSTALLER_DIR/
197
cp /var/iso/$ALCASAR_TAR $INSTALLER_DIR/
196
 
198
 
197
# Add automatic install options
199
# Add automatic install options
198
mkdir -p $INSTALLER_DIR || errorExit "could not create directory $INSTALLER_DIR"
200
mkdir -p $INSTALLER_DIR || errorExit "could not create directory $INSTALLER_DIR"
199
cp $AUTO_INSTALL_CFG $INSTALLER_DIR || errorExit "could not copy $AUTO_INSTALL_CFG to $INSTALLER_DIR"
201
cp $AUTO_INSTALL_CFG $INSTALLER_DIR || errorExit "could not copy $AUTO_INSTALL_CFG to $INSTALLER_DIR"
200
 
202
 
201
# Generating media info for core
203
# Generating media info for core
202
echo "Generating media_info for core..."
204
echo "Generating media_info for core..."
203
genhdlist2 ${coreDirNew} --allow-empty-media --quiet
205
genhdlist2 ${coreDirNew} --allow-empty-media --quiet
204
 
206
 
205
echo "Generating media_info for nonfree..."
207
echo "Generating media_info for nonfree..."
206
genhdlist2 ${nonFreeDirNew} --allow-empty-media --quiet
208
genhdlist2 ${nonFreeDirNew} --allow-empty-media --quiet
207
 
209
 
208
# Puting pubkeys in media_info
210
# Puting pubkeys in media_info
209
cp ${coreDir}/media_info/pubkey ${coreDirNew}/media_info/
211
cp ${coreDir}/media_info/pubkey ${coreDirNew}/media_info/
210
cp ${nonFreeDir}/media_info/pubkey ${nonFreeDirNew}/media_info/
212
cp ${nonFreeDir}/media_info/pubkey ${nonFreeDirNew}/media_info/
211
 
213
 
212
# Retrieving media.cfg & compssUsers.pl depending on the arch
214
# Retrieving media.cfg & compssUsers.pl depending on the arch
213
mkdir ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info
215
mkdir ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info
214
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/compssUsers.pl ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/compssUsers.pl
216
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/compssUsers.pl ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/compssUsers.pl
215
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/media.cfg ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/media.cfg
217
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/media.cfg ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/media.cfg
216
 
218
 
217
# Specify install configuration
219
# Specify install configuration
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
220
#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 
221
sed -i -e 's*noiswmd*noiswmd kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g'  $EFI_GRUB_CFG 
220
 
222
 
221
# Generating distr
223
# Generating distr
222
echo "Generating mirror tree..."
224
echo "Generating mirror tree..."
223
gendistrib -s ${MAGEIA_NEW_DIR}/${ARCH}
225
gendistrib -s ${MAGEIA_NEW_DIR}/${ARCH}
224
 
226
 
225
# Creating the new iso file
227
# Creating the new iso file
226
echo "Creating the isofile..."
228
echo "Creating the isofile..."
227
alcasarVersion=$(echo $ALCASAR_TAR | cut -d '-' -f2 | rev | cut -d '.' -f 3- | rev )
229
alcasarVersion=$(echo $ALCASAR_TAR | cut -d '-' -f2 | rev | cut -d '.' -f 3- | rev )
228
newIsoName=Mageia-$MAGEIA_VERSION-${ARCH}-Alcasar${alcasarVersion}.iso
230
newIsoName=Mageia-$MAGEIA_VERSION-${ARCH}-Alcasar${alcasarVersion}.iso
229
#cd ${MAGEIA_NEW_DIR} && genisoimage -quiet -o ${CURRENT_DIR}/${newIsoName} \
231
#cd ${MAGEIA_NEW_DIR} && genisoimage -quiet -o ${CURRENT_DIR}/${newIsoName} \
230
#    -b isolinux/isolinux.bin \
232
#    -b isolinux/isolinux.bin \
231
#    -c boot.catalog \
233
#    -c boot.catalog \
232
#    -no-emul-boot -boot-load-size 4 \
234
#    -no-emul-boot -boot-load-size 4 \
233
#    -boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
235
#    -boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
234
 
236
 
235
cd ${MAGEIA_NEW_DIR} && xorriso -as mkisofs -quiet -o ${CURRENT_DIR}/${newIsoName} \
237
cd ${MAGEIA_NEW_DIR} && xorriso -as mkisofs -quiet -o ${CURRENT_DIR}/${newIsoName} \
236
    -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
238
    -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
237
    -isohybrid-gpt-basdat \
239
    -isohybrid-gpt-basdat \
238
    -b isolinux/isolinux.bin \
240
    -b /boot/grub2/eltorito.img \
239
    -c boot.catalog \
241
    -c boot.catalog \
240
    -no-emul-boot -boot-load-size 4 \
242
    -no-emul-boot -boot-load-size 4 \
241
    -boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
243
    -boot-info-table -J -R -V "Mageia-$MAGEIA_VERSION Alcasar ${ARCH}" .
242
 
244
 
-
 
245
 
243
# Unmounting
246
# Unmounting
244
echo "Umounting..."
247
echo "Umounting..."
245
umount ${MAGEIA_OFFICIAL_DIR} && rmdir ${MAGEIA_OFFICIAL_DIR}
248
umount ${MAGEIA_OFFICIAL_DIR} && rmdir ${MAGEIA_OFFICIAL_DIR}
246
 
249
 
247
# Removing temporary dir
250
# Removing temporary dir
248
rm -rf ${MAGEIA_NEW_DIR}
251
rm -rf ${MAGEIA_NEW_DIR}
249
 
252
 
250
mv ${CURRENT_DIR}/${newIsoName} /var/iso/
253
mv ${CURRENT_DIR}/${newIsoName} /var/iso/
251
 
254
 
252
# Finished
255
# Finished
253
rm -f "$AUTO_INSTALL_CFG"
256
rm -f "$AUTO_INSTALL_CFG"
254
echo "Done."
257
echo "Done."
255
 
258