/alcasar.sh |
---|
2176,6 → 2176,7 |
[ -e /etc/bashrc.default ] || cp /etc/bashrc /etc/bashrc.default |
cp -f $DIR_CONF/bashrc /etc/. ; chmod 644 /etc/bashrc ; chown root:root /etc/bashrc |
$SED "s?^ORGANISME.*?ORGANISME=$ORGANISME?g" /etc/bashrc |
$SED "s?^alias ll=.*?alias ll=\"ls -al --color\"?g" /etc/profile.d/60alias.sh |
# sudoers configuration for "apache" & "sysadmin" |
[ -e /etc/sudoers.default ] || cp /etc/sudoers /etc/sudoers.default |
cp -f $DIR_CONF/sudoers /etc/ ; chmod 440 /etc/sudoers ; chown root:root /etc/sudoers |
2384,7 → 2385,11 |
fi |
done |
# RPMs install |
$DIR_SCRIPTS/alcasar-urpmi.sh |
if [ "$mode" == "update" ] # to avoid updating unbound during the V5.3.3 update (to be removed after this version) |
then |
echo "/^unbound/" >> /etc/urpmi/skip.list |
fi |
$DIR_SCRIPTS/alcasar-rpm.sh |
if [ "$?" != "0" ] |
then |
exit 0 |
/conf/bashrc |
---|
16,23 → 16,29 |
# are we an interactive shell? |
if [ "$PS1" ]; then |
i='${USER}@${HOSTNAME%%.*}:$([[ "${PWD}" =~ ^"${HOME}"(/|$) ]] && echo "~${PWD#${HOME}}" || echo "${PWD}")' |
case $TERM in |
xterm*) |
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' |
PROMPT_COMMAND='echo -ne "\033]0;'${i}'\007"' |
;; |
screen) |
PROMPT_COMMAND='echo -ne "\033_'${i}'\033\\"' |
;; |
*) |
;; |
esac |
unset i |
# [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " # default |
# met un peu de couleur sur le compte 'root' |
# color prompt |
if [ `id -un` = root ]; then |
PS1='\[\033[1;31m\]\h-$ORGANISME:\w\$\[\033[0m\] ' |
PS1='\e[31;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] ' |
alias ll='ls -al --color' |
else |
PS1='\[\033[1;30m\]\h-$ORGANISME:\w\$\[\033[0m\] ' |
PS1='\e[32;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] ' |
fi |
if [ -z "$loginsh" ]; then # We're not a login shell |
# Not all scripts in profile.d are compatible with other shells |
# TODO: make the scripts compatible or check the running shell by |
/iso/scripts/build-image.sh |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/iso/buildMageiar.sh |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/iso/README.md |
---|
1,34 → 1,27 |
Mageiar ISO builder |
Mageia + ALCASAR (Mageiar) ISO builder |
=================== |
Goal |
---- |
The goal here is to create a minimalist ISO image to install both Mageia and Alcasar with all its dependencies, wth only one command. |
The goal is to create a minimalist ISO image to install both Mageia and Alcasar with all its dependencies. |
How it works |
------------ |
The script uses an official Mageia docker image to retrieve a recursive list of dependecies that are downloaded and packaged in the installation ISO. Alcasar dependencies list, as well as its kernel version, are retrieved from the Alcasar tar archive. |
The script lists the RPMs installed on a running ALCASAR in order to download them from Internet repository. |
Then, it downloads the RPM need to create an ISO file. |
Once the ISO is done, one can boot on it and install the OS normally. The ALCASAR archive is copied in /root folder |
Once the ISO is done, one can boot on it and install the OS normally. The dependencies are installed along the basesystem packages, which means that the Alcasar installer will only download updates. |
What it needs |
------------- |
The script can be provided with both the Alcasar tar archive as well as the Mageia ISO image. |
The Alcasar archive can be given in argument using the `-a` option. Otherwise it will be downloaded automatically in its latest version. |
The Mageia ISO image and ALCASAR archive are to be placed in the `ressources` directory before running the script. |
The Mageia ISO image is to be placed in the `ressources` directory. |
If Mageia image has been provided, it will be downloaded in the docker. |
This is because the version has to match the one in the docker |
The script's only dependency is the docker service. All other dependencies, such as the RPM and ISO tools, will be installed within the docker. |
How to use |
---------- |
Usage : buildMageiar [-a alcasar.tar.gz] |
Usage : build-iso.sh |
What can be done |
---------------- |
36,5 → 29,6 |
The ISO image seems to be already as light as it can be. With all the necessary packages, it weighs around 800Mo. |
Here is a list of interesting functionnalities: |
- if a needed RPM has not been updated, copy it from the Mageia iso file instead of download it from repository |
- Use DrakX to install and configure Alcasar graphically |
- Propose an automatic partition table suitable for Alcasar |
/iso/build-iso.sh |
---|
0,0 → 1,231 |
#!/bin/bash |
# |
# Build Mageiar (Mageia + ALCASAR) ISO file |
# Authors: Hamza ESSAYEGH (Querdos) - Rexy - Laurent Roux - Aurelien Dubois - Pierre Rivault |
# |
#################################### |
###### Variables & functions ###### |
################################################################################ |
CURRENT_DIR="$(readlink -f "$(dirname $0)")" |
LOG_FILE="$CURRENT_DIR/build-image.log" |
RESSOURCES="$CURRENT_DIR/ressources" |
# Print the given error message and exit 1 |
function errorExit() |
{ |
tput bold |
echo -e "ERROR : $1 \nAborting\n" >&2 |
echo "$1" > "$LOG_FILE" |
tput sgr0 |
exit 1 |
} |
#------------------------------------------------------------------------------- |
# Print progress bar. $1 is a multiple of five |
function printProgress() |
{ |
local a |
let "a = $1 / 5" |
let "b = 25 - $a" |
progressStr=$(printf "%${a}s") |
progressStrBlanks=$(printf "%${b}s") |
echo -en "Downloading...$1% [${progressStr// /#}${progressStrBlanks// / }]\r" |
} |
#------------------------------------------------------------------------------- |
function printBold() |
{ |
tput bold 2>/dev/null |
echo $1 |
tput sgr0 2>/dev/null |
} |
ISO_IN=`ls $RESSOURCES | grep '^Mageia.*iso'` |
MAGEIA_VERSION=`echo $ISO_IN|cut -d"-" -f2` |
ARCH=`echo $ISO_IN |cut -d"-" -f3|cut -d"." -f1` |
ALCASAR_TARBALL=`ls $RESSOURCES| grep '^alcasar.*gz'` |
ALCASAR_EXTRACTED_DIR=$(echo $ALCASAR_TARBALL | rev | cut -d '.' -f 3- | rev) |
ALCASAR_VERSION=`echo $ALCASAR_EXTRACTED_DIR | cut -d"-" -f2` |
MAGEIA_NEW_DIR=/var/tmp/mageia_new |
MAGEIA_OFFICIAL_DIR=/var/tmp/mageia_official |
MAGEIA_OFFICIAL_DIR_EFI=/var/tmp/mageia_official_efi |
coreDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/core |
nonFreeDir=${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/nonfree |
coreDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/core/ |
nonFreeDirNew=${MAGEIA_NEW_DIR}/${ARCH}/media/nonfree |
plopFilePath=${MAGEIA_NEW_DIR}/${ARCH}/media/plop.idx |
ISO_OUT=/var/tmp/iso |
RPM_DIR=/var/tmp/rpms |
# Drake installer |
INSTALLER_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/alcasar" |
EFI_GRUB_CFG="${MAGEIA_NEW_DIR}/boot/grub2/grub.cfg" |
ADVERT_DIR="${MAGEIA_NEW_DIR}/${ARCH}/install/extra/advertising" |
AUTO_INSTALL_CFG="${ISO_OUT}/auto_inst.cfg.pl" |
# 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 iwlwifi-agn-ucode 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 socat" |
####################### |
###### Main ###### |
################################################################################ |
# Some checks |
[[ $(whoami) != 'root' ]] && errorExit 'Please run as root' |
[[ $ISO_IN == "" ]] && errorExit "No Mageia iso file in $RESSOURCES" |
[[ ! -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 $ISO_OUT $RPM_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 Alcasar dependencies |
tar -xf $RESSOURCES/$ALCASAR_TARBALL -C /tmp/ || errorExit "could not extract alcasar tar archive" |
alcasarRpmList="$(grep -oP "(?<=PACKAGES=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-rpm.sh)" |
alcasarKernel="$(grep -oP "(?<=KERNEL=\").*?(?=\")" /tmp/$ALCASAR_EXTRACTED_DIR/scripts/alcasar-rpm.sh)" |
alcasarRpmList="$alcasarRpmList $alcasarKernel" |
# Make clean rpm list |
rpmList=$(echo $BASE_RPM_LIST $alcasarRpmList | sed "s/ /\n/g" | sort | uniq | sed "s/\n/ /g") |
# Insert list into AUTO_INSTALL_CFG |
formattedList=$(echo $rpmList | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g" | sed "/kernel-server/d") |
cp $RESSOURCES/auto_inst.cfg.pl_template $AUTO_INSTALL_CFG -f |
insertLineNumber=$(grep -n "'default_packages' => " "$AUTO_INSTALL_CFG" | cut -d ':' -f1) |
fileTop=$(head -n "+$insertLineNumber" "$AUTO_INSTALL_CFG") |
fileBottom=$(tail -n "+$insertLineNumber" "$AUTO_INSTALL_CFG" | tail -n +2) |
cat /dev/null > "$AUTO_INSTALL_CFG" |
echo "$fileTop" > "$AUTO_INSTALL_CFG" |
echo "$formattedList" >> "$AUTO_INSTALL_CFG" |
echo "$fileBottom" >> "$AUTO_INSTALL_CFG" |
# Installing tools to create the iso |
printBold "Installing necessary tools" |
dnf install 'dnf-command(download)' -y || errorExit "could not install necessary packages" |
#dnf install 'dnf-command(config-manager)' -y || errorExit "could not install necessary packages" |
#dnf config-manager --set-enabled mageia-x86_64-nonfree updates-x86_64-nonfree || errorExit "could not install necessary packages" |
dnf install -y lftp wget cdrkit-genisoimage xorriso rpmtools syslinux || errorExit "could not install necessary packages" |
# Mounting the ISO image |
printBold "Mounting the image" |
mount -o ro,loop $RESSOURCES/$ISO_IN $MAGEIA_OFFICIAL_DIR || errorExit "failed mounting $ISO_IN." |
sleep 1 # wait for mounting process |
[ -d ${MAGEIA_OFFICIAL_DIR}/x86_64 ] || umount $MAGEIA_OFFICIAL_DIR || errorExit "The ISO file isn't in the target architecture ($ARCH)" |
# Copying main files except core and nonfree directories |
echo "Extracting base image..." |
cd $MAGEIA_OFFICIAL_DIR && \ |
tar cf - --exclude=${ARCH}/media . | (cd $MAGEIA_NEW_DIR && tar xf - ) && cd "${CURRENT_DIR}" |
# Creating new directories core and nonfree and dir for alcasar stufs |
mkdir -p ${MAGEIA_NEW_DIR}/${ARCH}/{media/{core,nonfree},install/alcasar} |
# Adding Alcasar image advert to the installer |
cp -f $RESSOURCES/install_slideshow/* "$ADVERT_DIR" |
# Create the installed RPM list excluding those brought with alcasar archive (they aren't in repository) |
installedList="$(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' ' ')" |
nbInstalled=$(echo $installedList | wc -w) |
rpmList="$installedList $BASE_RPM_LIST" |
total=`echo $rpmList | wc -w` |
count=0 |
# Copying the RPM in core and clearing the plop.idx file |
echo "Copying RPMS in ISO ..." |
echo /dev/null > ${plopFilePath} |
for rpm in ${rpmList}; do |
let percent="${count} * 100 / ${total}" |
if [[ $count -lt $nbInstalled ]] ; then |
dnf download -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm" |
else |
dnf install -y --downloadonly --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm" |
fi |
printProgress ${percent} |
count=$(expr ${count} + 1) |
done |
echo "STOP"; exit 1 |
# Sorting the plop file alphabetically |
cat ${plopFilePath} | sort > /tmp/tmpFileMageia && mv /tmp/tmpFileMageia ${plopFilePath} |
# Informations |
printBold "$count RPMs copied" |
# Downloading rpms needed by Alcasar |
cd "$CURRENT_DIR" |
printBold "Downloading Alcasar dependencies" |
tar -xf /var/iso/$ALCASAR_TARBALL |
# Copying the Alcasar tar to be put into the ISO |
cp /var/iso/$ALCASAR_TARBALL $INSTALLER_DIR/ |
# Add automatic install options |
mkdir -p $INSTALLER_DIR || errorExit "could not create directory $INSTALLER_DIR" |
cp $AUTO_INSTALL_CFG $INSTALLER_DIR || errorExit "could not copy $AUTO_INSTALL_CFG to $INSTALLER_DIR" |
# Generating media info for core |
echo "Generating media_info for core..." |
genhdlist2 ${coreDirNew} --allow-empty-media --quiet |
echo "Generating media_info for nonfree..." |
genhdlist2 ${nonFreeDirNew} --allow-empty-media --quiet |
# Puting pubkeys in media_info |
cp ${coreDir}/media_info/pubkey ${coreDirNew}/media_info/ |
cp ${nonFreeDir}/media_info/pubkey ${nonFreeDirNew}/media_info/ |
# Retrieving media.cfg & compssUsers.pl depending on the arch |
mkdir ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/compssUsers.pl ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/compssUsers.pl |
cp ${MAGEIA_OFFICIAL_DIR}/${ARCH}/media/media_info/media.cfg ${MAGEIA_NEW_DIR}/${ARCH}/media/media_info/media.cfg |
# Specify install configuration |
#sed -i -e 's*rdz*rdz kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g' ${MAGEIA_NEW_DIR}/isolinux/isolinux.cfg |
sed -i -e 's*noiswmd*noiswmd kickstart=/tmp/media/x86_64/install/alcasar/auto_inst.cfg.pl*g' $EFI_GRUB_CFG |
# Generating distr |
echo "Generating mirror tree..." |
gendistrib -s ${MAGEIA_NEW_DIR}/${ARCH} |
# Creating the new iso file |
echo "Creating the isofile..." |
newIsoName=Mageia-$MAGEIA_VERSION-${ARCH}-Alcasar-$ALCASAR_VERSION.iso |
# Generating the iso file |
# Parameters for xorriso found using the following command on the original mageia iso |
# xorriso -indev Mageia-7-x86_64.iso -report_el_torito as_mkisofs |
cd ${MAGEIA_NEW_DIR} && xorriso -as mkisofs \ |
-V 'Mageia-7.1-x86_64' \ |
--grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt:${ISO_IN} \ |
-partition_cyl_align off \ |
-partition_offset 0 \ |
--mbr-force-bootable \ |
-append_partition 2 0xef --interval:local_fs:8785156d-8793347d::${ISO_IN} \ |
-iso_mbr_part_type 0x00 \ |
-c '/boot.catalog' \ |
-b '/boot/grub2/eltorito.img' \ |
-no-emul-boot \ |
-boot-load-size 4 \ |
-boot-info-table \ |
--grub2-boot-info \ |
-eltorito-alt-boot \ |
-e '--interval:appended_partition_2_start_2196289s_size_8192d:all::' \ |
-no-emul-boot \ |
-boot-load-size 8192 \ |
-o ${CURRENT_DIR}/${newIsoName} . |
# Unmounting & Removing temporary dir |
echo "Umounting..." |
umount $MAGEIA_OFFICIAL_DIR |
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR $MAGEIA_OFFICIAL_DIR_EFI $ISO_OUT $RPM_DIR |
do |
[ -d $directory ] && rm -rf $directory |
done |
mv ${CURRENT_DIR}/${newIsoName} /var/iso/ |
# Finished |
rm -f "$AUTO_INSTALL_CFG" |
echo "Done." |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/iso/ressources/install_slideshow/02_IM_mageia.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/iso/ressources/install_slideshow/02_IM_mageia.pl |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/iso/ressources/install_slideshow/list |
---|
1,2 → 1,3 |
01_IM_mageia.png |
02_IM_mageia.png |
alcasar.png |
/scripts/alcasar-urpmi.sh |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-LF |
\ No newline at end of property |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:keywords |
-Id Author Date |
\ No newline at end of property |
/scripts/alcasar-rpm-download.sh |
---|
1,7 → 1,7 |
#!/bin/bash |
# $Id$ |
# alcasar-urpmi.sh |
# alcasar-rpm-download.sh |
# by Franck BOUIJOUX and Richard REY |
# This script is distributed under the Gnu General Public License (GPL) |
13,7 → 13,7 |
# The kernel version we compile netflow for |
KERNEL="kernel-server-5.10.27-1.mga7-1-1.mga7" |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ****** |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli php-rrd unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamd fail2ban gnupg2 ulogd pm-fallback-policy ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat" |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamd fail2ban gnupg2 ulogd pm-fallback-policy ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat" |
rpm_repository_sync () |
{ |
32,9 → 32,9 |
{ |
echo |
echo "Relancez l'installation ultérieurement." |
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'" |
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-rpm.sh'" |
echo "Try an other install later." |
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'" |
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-rpm.sh'" |
} |
# extract the current architecture (i586 ou X64) |
/scripts/alcasar-rpm.sh |
---|
0,0 → 1,274 |
#!/bin/bash |
# alcasar-rpm.sh |
# by 3abtux and Rexy |
# This script is distributed under the Gnu General Public License (GPL) |
# script de mise en place des dépots RPM |
# configure the RPM repository |
Lang=`echo $LANG|cut -c 1-2` |
VERSION="7" |
ARCH="x86_64" |
# The kernel version we compile netflow for |
KERNEL="kernel-server-5.10.27-1.mga7-1-1.mga7" |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ****** |
# (old) perl-Socket6 : needed by nfsen |
# "fonts-dejavu-common" & "fonts-ttf-dejavu" : fonts needed by wkhtmltopdf |
# "lsscsi" & nvme-cli" : needed by phpsysinfo |
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh") |
# "sudo" : needed after a reinstallation (to be investigated) |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamd fail2ban gnupg2 ulogd pm-fallback-policy ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat" |
rpm_repository_sync () |
{ |
cat <<EOF > /etc/urpmi/urpmi.cfg |
{ |
downloader: wget |
} |
EOF |
echo ${!MIRRORLIST} |
urpmi.addmedia core --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/release |
urpmi.addmedia core-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/updates |
urpmi.addmedia nonfree --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/release |
urpmi.addmedia nonfree-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/updates |
} |
rpm_error () |
{ |
echo |
if [ $Lang == "fr" ] |
then |
echo "Relancez l'installation ultérieurement." |
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-rpm.sh'" |
else |
echo "Try an other install later." |
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-rpm.sh'" |
fi |
} |
# extract the current Mageia version and hardware architecture (i586 ou X64) |
fic=`cat /etc/product.id` |
old="$IFS" |
IFS="," |
set $fic |
for i in $* |
do |
if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ] |
then |
DISTRIBUTION=`echo $i|cut -d"=" -f2` |
fi |
if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ] |
then |
CURRENT_VERSION=`echo $i|cut -d"=" -f2` |
fi |
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ] |
then |
ARCH=`echo $i|cut -d"=" -f2` |
fi |
done |
IFS="$old" |
# We prefer wget than curl |
urpmi --no-verify-rpm --auto rpms/$ARCH/wget*.rpm |
# Set the RPM repository (if not already set) |
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l` |
MIRROR_NBR=2 |
# For Europeans |
MIRRORLIST1="https://www.mirrorservice.org/pub/mageia/distrib/$VERSION/$ARCH" |
# For International install |
MIRRORLIST2="https://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list" |
try_nb="0"; nb_repository="0" |
while [ "$nb_repository" != "4" ] |
do |
try_nb=`expr $try_nb + 1` |
MIRRORLIST="MIRRORLIST$try_nb" |
rpm_repository_sync |
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l` |
if [ "$nb_repository" != "4" ] |
then |
if [ $Lang == "fr" ] |
then |
echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb." |
else |
echo "An error occurs when synchronising the repositories N°$try_nb" |
fi |
if [ $(expr $try_nb) -eq $MIRROR_NBR ] |
then |
rpm_error |
exit 1 |
fi |
if [ $Lang == "fr" ] |
then |
echo "Voulez-vous tenter une synchronisation avec un autre dépôt ? (O/n)" |
else |
echo "Do you want to try a synchronisation with an other repository? (Y/n)" |
fi |
response=0 |
PTN='^[oOnNyY]?$' |
until [[ "$response" =~ $PTN ]] |
do |
read response |
done |
if [ "$response" = "n" ] || [ "$response" = "N" ] |
then |
exit 1 |
fi |
fi |
done |
# download the kernel used by ALCASAR |
if [ $Lang == "fr" ] |
then |
echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..." |
else |
echo "Download the Linux kernel used by ALCASAR. Please wait ..." |
fi |
urpmi --auto --quiet $KERNEL |
# Remove some of our RPMs in order to avoid their update |
urpme wkhtmltopdf |
# download updated RPM in cache |
if [ $Lang == "fr" ] |
then |
echo "Récupération des paquetages de mise à jour. Veuillez patienter ..." |
echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)" |
else |
echo "Updated RPM download. Please wait ..." |
echo "You should now take a coffe (or a good beer) ;-)" |
fi |
urpmi --auto --auto-update --quiet --test --retry 2 |
if [ "$?" != "0" ] |
then |
echo |
if [ $Lang == "fr" ] |
then |
echo "Une erreur a été détectée lors de la récupération des paquetages." |
else |
echo "An error occurs when downloading RPMS" |
fi |
rpm_error |
exit 1 |
fi |
# update with cached RPM |
urpmi --auto --auto-update |
if [ "$?" != "0" ] |
then |
echo |
if [ $Lang == "fr" ] |
then |
echo "Une erreur a été détectée lors de la mise à jour des paquetages." |
else |
echo "An error occurs when updating packages" |
fi |
rpm_error |
exit 1 |
fi |
# Clean the RPM cache |
urpmi --clean |
# Download of ALCASAR specifics RPM in cache (and test) |
if [ $Lang == "fr" ] |
then |
echo "Récupération des paquetages complémentaires. Veuillez patienter ..." |
else |
echo "Download of complementary packages. Please wait ..." |
fi |
urpmi --auto --no-recommends $PACKAGES --quiet --test --retry 2 |
if [ "$?" != "0" ] |
then |
echo |
if [ $Lang == "fr" ] |
then |
echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires." |
else |
echo "An error occurs when downloading complementary packages" |
fi |
rpm_error |
exit 1 |
fi |
# update with cached RPM |
urpmi --auto --no-recommends $PACKAGES |
if [ "$?" != "0" ] |
then |
echo |
if [ $Lang == "fr" ] |
then |
echo "Une erreur a été détectée lors de l'installation des paquetages complémentaires." |
else |
echo "An error occurs when installing complementary packages" |
fi |
rpm_error |
exit 1 |
fi |
# Keep only the kernel version we compil netflow with, and remove all others |
kernelVersion=$(rpm -qa | grep -e ^kernel-server -e ^kernel-desktop) |
for i in $kernelVersion |
do |
if [ $i != $KERNEL ];then |
urpme --auto $i |
fi |
done |
# delete unused RPMs |
if [ $Lang == "fr" ] |
then |
echo "Cleaning the system : " |
else |
echo "Nettoyage du système : " |
fi |
rm_rpm="shorewall mandi plymouth cpupower squid" |
/usr/sbin/urpme --auto -a $rm_rpm |
/usr/sbin/urpme --auto --auto-orphans |
# Save chilli launch script (erase with new rpm one) |
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/ |
# Install home made RPMs |
for pkg in `ls rpms/$ARCH/*.rpm` |
do |
urpmi --no-verify --auto $pkg |
done |
# restore chilli launch script |
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/ |
# Clean the RPM cache |
urpmi --clean |
# the ipt-netflow RPM add the kernel module ipt_NETFLOW (the modules dependance tree need to be updated). "2>/dev/null" in order not to display a error (the running kernel is not the ALCASAR one during the installation process) |
/sbin/depmod -a 2>/dev/null |
# test if all needed rpms are correctly installed |
count_pkg=0; nb_pkg=0; |
for pkg in $PACKAGES |
do |
nb_pkg=`expr $nb_pkg + 1` |
if rpm -q --quiet $pkg ; then |
count_pkg=`expr $count_pkg + 1` |
else |
echo "error installing $pkg" |
fi |
done |
if [ $count_pkg -ne $nb_pkg ] |
then |
exit 1 |
fi |
# test if all custom rpms are correctly installed |
count_pkg=0; nb_pkg=0; |
for pkg in `ls rpms/$ARCH/|sed 's/.x86_64.rpm//'` |
do |
nb_pkg=`expr $nb_pkg + 1` |
if rpm -q --quiet $pkg ; then |
count_pkg=`expr $count_pkg + 1` |
else |
echo "error installing $pkg" |
fi |
done |
if [ $count_pkg -ne $nb_pkg ] |
then |
exit 1 |
fi |
# fix some RPM versions |
echo "/^kernel/" > /etc/urpmi/skip.list |
echo "/^wkhtmltopdf/" >> /etc/urpmi/skip.list |
echo "/^clamd/" >> /etc/urpmi/skip.list |
echo "/^clamav/" >> /etc/urpmi/skip.list |
echo "exclude=kernel* wkhtmltopdf clamd clamav" >> /etc/dnf/dnf.conf |
exit 0 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/scripts/alcasar-uninstall.sh |
---|
418,6 → 418,7 |
# Reset "skip.list" (we keep "kernel" in order not to download kernel we don't want to have) |
echo "/^kernel/" > /etc/urpmi/skip.list |
$SED "/^exclude/d" /etc/dnf/dnf.conf |
# Cleaning (remove all "old" alcasar scripts) |
echo -en "\n- End of cleaning ...\n" |
/web/acc/alcasar-3.5.2-presentation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-installation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-technique.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-presentation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-installation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-exploitation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.2-exploitation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-exploitation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-exploitation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-installation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-installation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-presentation-en.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-presentation-fr.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/alcasar-3.5.3-technique.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |