Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2941 → Rev 2944

/CHANGELOG
8,11 → 8,12
- add the favicon in status page
- add another filter when importing the blacklist to remove line beginning with a dot
- improve tcpdump filter when IoT live captures option is enable
- improve ISO file process (EFI + USB) : Thanks to Pierre RIVAULT
- adapt CA certificate to edge/chrome (add the "Subject Alt Name" - SAN)
- improve "alcasar-CA.sh" script : can create server certificate for every hostname (not only alcasar.localdomain)
- kernel 5.10.27 + coova-chilli 1.6 + nfdump 1.6.22
- kernel 5.10.30 + coova-chilli 1.6 + nfdump 1.6.22
- move all alcasar systemd units in "/etc/systemd" (compliant with Linux file-hierarchy)
- ISO File is now created from an running alcasar system with updated packages.
- ISO file can now boot on more devices (USB, EFI, VM, etc.) with several video configurations : Thanks to Pierre RIVAULT
BUGS
- Fix a display bug in ACC activity & stat page
- Add the CA chain certificates in Coova in order to allow authentication with the last versions of Chrome/Edge
/iso/README.md
9,14 → 9,13
How it works
------------
 
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
The script lists the RPMs installed on a running ALCASAR in order to create a dedicated ISO file.
Once the ISO is done, one can boot on it and install the OS normally. The ALCASAR tarball is available in /root folder.
 
What it needs
-------------
 
The Mageia ISO image and ALCASAR archive are to be placed in the `ressources` directory before running the script.
The Mageia ISO image and ALCASAR tarball are to be placed in the `ressources` directory before running the script.
 
How to use
----------
26,9 → 25,9
What can be done
----------------
 
The ISO image seems to be already as light as it can be. With all the necessary packages, it weighs around 800Mo.
The ISO image seems to be already as light as it can be. With all the necessary packages, it weighs around 800 Mo.
 
Here is a list of interesting functionnalities:
Here is a list of interesting functionalities:
- 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
45,26 → 45,23
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
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
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"
AUTO_INSTALL_CFG=$TMP_DIR/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"
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"
 
#######################
###### Main ######
75,24 → 72,21
[[ $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
 
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR $MAGEIA_OFFICIAL_DIR_EFI
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"
# Retrieve list of installed RPM
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")
 
# 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
formattedList=$(echo $RPM_LIST | sed "s/[^ ]*/\'\0\'/g" | sed "s/ /,\n/g")
cp -f $RESSOURCES/auto_inst.cfg.pl_template $AUTO_INSTALL_CFG
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)
101,16 → 95,16
echo "$formattedList" >> "$AUTO_INSTALL_CFG"
echo "$fileBottom" >> "$AUTO_INSTALL_CFG"
 
# Installing tools to create the iso
printBold "Installing necessary tools"
# 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 '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."
if [ `mount |grep $MAGEIA_OFFICIAL_DIR | wc -l` -eq 0 ]; then # if not already mounted
mount -o ro,loop $RESSOURCES/$ISO_IN $MAGEIA_OFFICIAL_DIR || errorExit "failed mounting $ISO_IN."
fi
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)"
 
123,51 → 117,30
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"
cp -f $RESSOURCES/install_slideshow/* "$ADVERT_DIR" || errorExit "could not copy custom slideshow to $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`
nbInstalled=$(echo $RPM_LIST | wc -w)
total=`echo $RPM_LIST | 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
echo "Copying $total RPMS in ISO ..."
for rpm in ${RPM_LIST}; 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
dnf download --downloaddir $coreDirNew $rpm 1> /dev/null || errorExit "could not download $rpm"
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
# 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"
 
# 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
 
197,35 → 170,26
# 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' \
-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} .
-o ${TMP_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
for directory in $MAGEIA_NEW_DIR $MAGEIA_OFFICIAL_DIR $MAGEIA_OFFICIAL_DIR_EFI
do
[ -d $directory ] && rm -rf $directory
done
 
mv ${CURRENT_DIR}/${newIsoName} /var/iso/
 
# Finished
rm -f "$AUTO_INSTALL_CFG"
echo "Done."
/iso/ressources/auto_inst.cfg.pl_template
1,16 → 1,15
#!/usr/bin/perl -cw
#
# Configuration file written by :
# * Hamza ESSAYEGH (Querdos) Laurent Roux
# * Hamza ESSAYEGH (Querdos) Laurent Roux Rexy
#
# /!\ Before putting this file in the iso, check the syntax with
# `perl -cw auto_inst.cfg.pl`
# /!\ The package list will be generated in the iso creation script
# See https://wiki.mageia.org/en/Auto_inst for more informations
 
$o = {
# Interactive steps option
# http://members.shaw.ca/mandrake/ -> section Replay Steps for
# more informations
'interactiveSteps' => [
# Select language(s) support to be installed.
'selectLanguage',
70,12 → 69,14
'clearall' => 1
},
 
'enabled_media' => [
'Core Release (Installer)',
'Nonfree Release (Installer)'
],
'enabled_media' => [
'Core Release (Installer)',
'Nonfree Release (Installer)'
],
'X' => { 'disabled' => 1 },
 
 
# Post installation script, executed as root in the installed
# environments and not inside the DrakX installation program
'postInstallNonRooted' => "
90,22 → 91,16
 
# Allow root shell login
rm -f /mnt/etc/securetty
 
# Install server kernel
urpmi --root /mnt/ --auto /tmp/media/x86_64/media/core/kernel-server-4*.rpm --no-verify-rpm
 
# Lock kernel version (exclude from further updates)
echo '/^kernel/' > /mnt/etc/urpmi/skip.list
 
# Place ISO_INSTALL flag
touch /mnt/root/iso_install
",
 
'postInstall' => "
#sert à la synchro des DD en cas d'un RAID
dracut -f -H
#pour synchro horloge
hwclock --systohc --utc
# synchro des DD en cas d'un RAID
dracut -f -H
# synchro horloge
hwclock --systohc --utc
",
 
 
/readme.txt
1,11 → 1,11
$Id: readme-2.0.txt 581 2011-04-21 16:59:59Z richard $
 
ALCASAR-3.5.2
ALCASAR-3.5.3
 
*********** English **********
- New installation : Boot your system with the ISO file of Linux-Mageia-7.1 (or with "Mageiar" ISO file which is customized ISO file of Linux-Mageia (Linux Mageia + ALCASAR = Mageiar).
--> Follow ALCASAR installation documentation.
- Update ALCASAR 3.5 & 3.5.1
- Update ALCASAR 3.5 to 3.5.2
--> Copy, uncompress and run the installation script. It ask you if you want to update
- Update ALCASAR 3.x
--> On your running ALCASAR, create and retrieve the configuration file via ACC (or with the command "alcasar-conf.sh -create"). This configuration file (alcasar-conf.tar.gz) is stored in "/var/tmp/" (or in "/tmp/").
13,7 → 13,7
*********** Français ********
- Nouvelle installation : Démarrez votre système avec l'image ISO de Linux-Mageia7.1 (ou l'image ISO de "Mageiar" qui est une image ISO personnalisée de Linux-Mageia (Linux Mageia + ALCASAR = Mageiar).
--> Suivez la documentation d'installation d'ALCASAR.
- Mise à jour d'une version 3.5 et 3.5.1
- Mise à jour d'une version 3.5 à 3.5.2
--> copiez, décompressez et lancez le script d'installation. Il vous demandera si vous voulez mettre à jour.
- Mise à jour d'une version 3.x
--> Sur votre ALCASAR en fonctionnement, créez et récupérez le fichier de configuration via l'ACC (ou avec la commande "alcasar-conf.sh -create"). Ce fichier de configuration (alcasar-conf.tar.gz) est enregistré dans le répertoire "/var/tmp/' (ou "/tmp/").
/rpms/ipt-netflow-2.5.1.spec
1,4 → 1,4
%define kversion 5.10.27-server-1.mga7
%define kversion 5.10.30-server-1.mga7
%define debug_package %{nil}
Name: ipt-netflow
Version: 2.5.1
45,7 → 45,7
 
%changelog
* Wed Feb 24 2021 Richard REY <Rexy>
- Version 2.5.1-2 for the kernel 5.10.27 (ALCASAR 3.5.3)
- Version 2.5.1-2 for the kernel 5.10.30 (ALCASAR 3.5.3)
* Sat Oct 17 2020 Richard REY <Rexy>
- Version 2.5.1-1 for the kernel 5.7.19 (ALCASAR 3.5.1)
* Fri May 22 2020 Richard REY <Rexy>
/rpms/x86_64/ipt-netflow-2.5.1-2.mga7.x86_64.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/scripts/alcasar-rpm-download.sh
11,7 → 11,7
VERSION="7"
ARCH="x86_64"
# The kernel version we compile netflow for
KERNEL="kernel-server-5.10.27-1.mga7-1-1.mga7"
KERNEL="kernel-server-5.10.30-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 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"
 
/scripts/alcasar-rpm.sh
11,7 → 11,7
VERSION="7"
ARCH="x86_64"
# The kernel version we compile netflow for
KERNEL="kernel-server-5.10.27-1.mga7-1-1.mga7"
KERNEL="kernel-server-5.10.30-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
218,7 → 218,7
else
echo "Nettoyage du système : "
fi
rm_rpm="shorewall mandi plymouth cpupower squid"
rm_rpm="shorewall mandi plymouth squid"
/usr/sbin/urpme --auto -a $rm_rpm
/usr/sbin/urpme --auto --auto-orphans