Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 2213 2017-05-08 21:55:08Z richard $
|
2 |
# $Id: alcasar.sh 2214 2017-05-09 08:08:37Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
|
5 |
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
Line 2026... |
Line 2026... |
2026 |
# GRUB modifications (only one time)
|
2026 |
# GRUB modifications (only one time)
|
2027 |
# Limit wait time to 3s - Create an alcasar entry instead of linux-nonfb - Change the default banner
|
2027 |
# Limit wait time to 3s - Create an alcasar entry instead of linux-nonfb - Change the default banner
|
2028 |
vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l` # test if in VM
|
2028 |
vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l` # test if in VM
|
2029 |
grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
|
2029 |
grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
|
2030 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
2030 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
2031 |
if [ $grub_already_modified == 0 ]
|
2031 |
if [ $grub_already_modified == 0 ]
|
2032 |
then
|
2032 |
then
|
2033 |
$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
|
2033 |
$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
|
2034 |
$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
|
2034 |
$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
|
2035 |
$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
|
2035 |
$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
|
- |
|
2036 |
$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
|
- |
|
2037 |
$SED "/^gfxmenu/d" /boot/grub/menu.lst
|
2036 |
if [ $vm_vga == 0 ] # is not a VM
|
2038 |
if [ $vm_vga == 0 ] # is not a VM
|
2037 |
then
|
2039 |
then
|
2038 |
$SED "/^kernel/s/$/ vga=791/" /boot/grub/menu.lst # change display to 1024*768 (vga791) only if not on VM
|
2040 |
$SED "/BOOT_IMAGE=linux-nonfb/s/$/ vga=791/" /boot/grub/menu.lst # change display to 1024*768 (vga791) only if not on VM and only on ALCASAR entry
|
2039 |
fi
|
2041 |
fi
|
2040 |
fi
|
2042 |
fi
|
2041 |
if [ $vm_vga == 0 ] # is not a VM
|
2043 |
if [ $vm_vga == 0 ] # is not a VM
|
2042 |
then
|
2044 |
then
|
2043 |
cp -f $DIR_CONF/banner /etc/mageia-release
|
2045 |
cp -f $DIR_CONF/banner /etc/mageia-release
|
2044 |
echo " V$VERSION" >> /etc/mageia-release
|
2046 |
echo " V$VERSION" >> /etc/mageia-release
|
2045 |
else
|
2047 |
else
|
2046 |
echo "ALCASAR V$VERSION" > /etc/mageia-release
|
2048 |
echo "ALCASAR V$VERSION" > /etc/mageia-release
|
2047 |
fi
|
2049 |
fi
|
2048 |
$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
|
- |
|
2049 |
$SED "/^gfxmenu/d" /boot/grub/menu.lst
|
- |
|
2050 |
# Load and apply the previous conf file
|
2050 |
# Load and apply the previous conf file
|
2051 |
if [ "$mode" = "update" ]
|
2051 |
if [ "$mode" = "update" ]
|
2052 |
then
|
2052 |
then
|
2053 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
2053 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
2054 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|
2054 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|