File: preinst

package info (click to toggle)
lilo 21-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 812 kB
  • ctags: 895
  • sloc: ansic: 3,420; asm: 2,546; sh: 767; perl: 607; makefile: 193; cpp: 3
file content (30 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
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
#!/bin/sh

[ x"install" = x"$1" -o x"upgrade" = x"$1" ] || exit 0

set -e

preserve() {
  if [ -f "$1" ]; then
	if [ "$1" -ef "$1".preserved ]; then
		echo "already preserved: $1"
	else
		echo "preserving $1"
		ln -f "$1" "$1".preserved || echo "Warning: Cant link $1 to $1.preserved in /boot/"
	fi
  fi
}

echo "Since your boot sector or MBR might still need some files from /boot"
echo "this script will preserve them as /boot/filename.preserved"
echo "IMPORTANT: In the dpkg prompt answer 'N' to overwriting lilo.conf"

cd /boot

set +e # Turn it off!

preserve boot.b
preserve chain.b
preserve os2_d.b
preserve any_b.b
preserve any_d.b