source: lliurex-grub-custom/trunk/fuentes/debian/lliurex-grub-custom.postinst

Last change on this file was 2303, checked in by hectorgh, 3 years ago

adding xenial grub background

File size: 2.4 KB
Line 
1#!/bin/sh
2
3fix_ifaces_file(){
4       
5        IFACES=`ls /sys/class/net|egrep -v '^lo$'`
6        I=0
7        cp /etc/network/interfaces /etc/network/interfaces.lliurex-grub-custom-backup
8        for x in $IFACES; do
9            echo " [ LLiureX Grub Custom ] : Fixing ${x} into /etc/network/interfaces"
10            sed -i "s%${x}%eth${I}%g" /etc/network/interfaces || echo "Not found interface ${x} into /etc/network/interfaces"
11            I=$(($I+1))
12        done
13}
14
15regenerate(){
16    # To clean initramfs scripts
17   
18    if type update-initramfs >/dev/null 2>&1; then
19        update-initramfs -u || true
20    fi
21
22    update-grub2 || true
23}
24
25#####
26GRUB_DEFCFG_DIR="/etc/default/grub.d"
27
28#DISTRIBUTION="Lliurex Xenial"
29####Needed by EFI signed application###
30DISTRIBUTION="Ubuntu"
31#######################################
32GFXMODE="1024x768"
33HIDDEN_TIMEOUT_QUIET="true"
34HIDDEN_TIMEOUT=""
35GRUB_BACKGROUND="/usr/share/lliurex-grub-custom/backgrounds/xenial.png"
36CMDLINE="net.ifnames=0 quiet splash rw"
37
38DISTRIBUTION_FILE="01-lliurex-distributor.cfg"
39GFXMODE_FILE="02-lliurex-gfxmode.cfg"
40HIDDEN_TIMEOUT_QUIET_FILE="03-lliurex-hidden-timeout-quiet.cfg"
41HIDDEN_TIMEOUT_FILE="04-lliurex-hidden-timeout.cfg"
42GRUB_BACKGROUND_FILE="05-lliurex-background.cfg"
43CMDLINE_FILE="06-lliurex-cmdline.cfg"
44
45case $1 in
46
47        configure)
48            if [ ! -d ${GRUB_DEFCFG_DIR} ]; then
49                mkdir ${GRUB_DEFCFG_DIR}
50            fi
51            if [ ! -f ${GRUB_DEFCFG_DIR}/${DISTRIBUTION_FILE} ]; then
52                echo "GRUB_DISTRIBUTOR=\"${DISTRIBUTION}\"" >> ${GRUB_DEFCFG_DIR}/${DISTRIBUTION_FILE}
53            fi
54            if [ ! -f ${GRUB_DEFCFG_DIR}/${GFXMODE_FILE} ]; then
55                echo "GRUB_GFXMODE=${GFXMODE}" >> ${GRUB_DEFCFG_DIR}/${GFXMODE_FILE}
56            fi
57            if [ ! -f ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_QUIET_FILE} ]; then
58                echo "GRUB_HIDDEN_TIMEOUT_QUIET=${HIDDEN_TIMEOUT_QUIET}" >> ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_QUIET_FILE}
59            fi
60            if [ ! -f ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_FILE} ]; then
61                echo "GRUB_HIDDEN_TIMEOUT=${HIDDEN_TIMEOUT}" >> ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_FILE}
62            fi
63            if [ ! -f ${GRUB_DEFCFG_DIR}/${GRUB_BACKGROUND_FILE} ]; then
64                echo "GRUB_BACKGROUND=\"${GRUB_BACKGROUND}\"" >> ${GRUB_DEFCFG_DIR}/${GRUB_BACKGROUND_FILE}
65            fi
66            if [ ! -f ${GRUB_DEFCFG_DIR}/${CMDLINE_FILE} ]; then
67                echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${CMDLINE}\"" >> ${GRUB_DEFCFG_DIR}/${CMDLINE_FILE}
68            fi
69           
70            fix_ifaces_file
71
72            regenerate
73            ;;
74        *)
75                echo "Nothing to do"
76                ;;
77esac
78
79#DEBHELPER#
80
81
Note: See TracBrowser for help on using the repository browser.