Subversion Repositories ALCASAR

Rev

Rev 2945 | Rev 2947 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2945 Rev 2946
Line 80... Line 80...
80
	[ -d $directory ] || mkdir -p $directory
80
	[ -d $directory ] || mkdir -p $directory
81
done
81
done
82
printBold "Mageiar will be build with Mageia-$MAGEIA_VERSION-$ARCH and $ALCASAR_EXTRACTED_DIR" 
82
printBold "Mageiar will be build with Mageia-$MAGEIA_VERSION-$ARCH and $ALCASAR_EXTRACTED_DIR" 
83
# remove some rpm (if this script has been already run)
83
# remove some rpm (if this script has been already run)
84
urpme $ISO_RPM_LIST --auto-orphans --force 2>/dev/null
84
urpme $ISO_RPM_LIST --auto-orphans --force 2>/dev/null
-
 
85
urpmi $BASE_RPM_LIST --force --auto 2>/dev/null
85
# Retrieve list of installed RPM (without those that will be installed with the alcasar install script)
86
# Retrieve list of installed RPM (without those that will be installed with the alcasar install script)
86
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' ' ')"
87
RPM_LIST="$(rpm -qa --queryformat "%{NAME}\n"| grep -Ev 'coova-chilli|gammu|lib64gammu8|ipt-netflow|nfdump|wkhtmltopdf' | tr '\n' ' ')"
87
# agregate & clean rpm list
-
 
88
RPM_LIST=$(echo $BASE_RPM_LIST $ALCASAR_RPM_LIST | sed "s/ /\n/g" | sort | uniq | sed "s/\n/ /g")
-
 
89
 
88
 
90
# Insert list into AUTO_INSTALL_CFG
89
# Insert list into AUTO_INSTALL_CFG
91
formattedList=$(echo $RPM_LIST | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g")
90
formattedList=$(echo $RPM_LIST | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g")
92
cp -f $RESSOURCES/auto_inst.cfg.pl_template $AUTO_INSTALL_CFG
91
cp -f $RESSOURCES/auto_inst.cfg.pl_template $AUTO_INSTALL_CFG
93
insertLineNumber=$(grep -n "'default_packages' => " "$AUTO_INSTALL_CFG" | cut -d ':' -f1)
92
insertLineNumber=$(grep -n "'default_packages' => " "$AUTO_INSTALL_CFG" | cut -d ':' -f1)
Line 98... Line 97...
98
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
97
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
99
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
98
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
100
 
99
 
101
# Installing tools to create the iso file
100
# Installing tools to create the iso file
102
printBold "Installing ISO building tools"
101
printBold "Installing ISO building tools"
103
#dnf install 'dnf-command(download)' -y || errorExit "could not install necessary packages"
-
 
104
#dnf install -y $ISO_RPM_LIST || errorExit "could not install necessary packages"
102
#dnf install -y $ISO_RPM_LIST || errorExit "could not install necessary packages"
105
urpmi $ISO_RPM_LIST --force|| errorExit "could not install necessary packages"
103
urpmi $ISO_RPM_LIST --force|| errorExit "could not install necessary packages"
106
 
104
 
107
# Mounting the ISO image
105
# Mounting the ISO image
108
printBold "Mounting the image"
106
printBold "Mounting the image"
Line 129... Line 127...
129
count=0
127
count=0
130
# Copying the RPM in core and clearing the plop.idx file
128
# Copying the RPM in core and clearing the plop.idx file
131
echo "Copying $total RPMS in ISO ..."
129
echo "Copying $total RPMS in ISO ..."
132
for rpm in ${RPM_LIST}; do
130
for rpm in ${RPM_LIST}; do
133
	let percent="${count} * 100 / ${total}"
131
	let percent="${count} * 100 / ${total}"
-
 
132
	full_rpm_name=`rpm -q $rpm`
-
 
133
	if [ `ls $urpmi_cache/* | grep $full_rpm_name | wc -l` -eq 0 ] ; then  # rpm not already downloaded
134
	# dnf download --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
134
		# dnf download --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
135
	#urpmi --no-install --replacepkgs -q $rpm 2> /dev/null || urpmi --no-install -q --force $rpm 2> /dev/null || echo "could not download $rpm"
135
		urpmi --no-install --replacepkgs -q $rpm 2> /dev/null || urpmi --no-install -q --force $rpm 2> /dev/null || echo "could not download $rpm"
-
 
136
	fi
136
	printProgress ${percent}
137
	printProgress ${percent}
137
	count=$(expr ${count} + 1)
138
	count=$(expr ${count} + 1)
138
done
139
done
139
printBold "$count RPMs copied"
140
printBold "$count RPMs copied"
140
# Copying the Alcasar tarball & automatic install option into the ISO
141
# Copying the Alcasar tarball & automatic install option into the ISO