summaryrefslogtreecommitdiffstats
path: root/abs/core/grub/grub.install
blob: ddd66817e16b5b7ede7900653e3817c71e2c310b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
infodir="usr/share/info"
filelist=('grub.info' 'grub-dev.info')

post_install() {
  if [ -f /boot/grub/grub.cfg.pacsave ]; then
    echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
    install -D -m0644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
  fi

  post_upgrade
}

post_upgrade() {
  cat << 'EOM'
Generating grub.cfg config file...
EOM

  systemconfig.py -m advanced  
  echo "done."

  for file in ${filelist[@]}; do
    install-info ${infodir}/${file}.gz ${infodir}/dir 2> /dev/null
  done

  if [[ -d /boot/grub/locale ]] && [[ ! -a /boot/grub/locale/en.mo ]]; then
  cat << 'EOM'
Creating link /boot/grub/locale/en.mo ...
EOM
    cd /boot/grub/locale
    ln -s "en@quot.mo" "en.mo"
    echo "done."
  fi
}

pre_remove() {
  for file in ${filelist[@]}; do
    install-info --delete ${infodir}/${file} ${infodir}/dir 2> /dev/null
  done
}