~vorlon/live-build/cloud-images-ppc64el

« back to all changes in this revision

Viewing changes to helpers/lh_binary_memtest86

  • Committer: Daniel Baumann
  • Date: 2011-03-09 17:14:51 UTC
  • Revision ID: git-v1:fe6eb1c593e2df135c8807bf94df614984b4d6ec
Adding live-helper 1.0~a1-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_binary_memtest86(1) - installs memtest86+
 
4
 
 
5
set -e
 
6
 
 
7
# Source common functions
 
8
for FUNCTION in /usr/share/live-helper/functions/*.sh
 
9
do
 
10
        . ${FUNCTION}
 
11
done
 
12
 
 
13
# Reading configuration files
 
14
Read_conffile config/common
 
15
Read_conffile config/bootstrap
 
16
Read_conffile config/image
 
17
Set_defaults
 
18
 
 
19
# Requiring stage file
 
20
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
 
21
 
 
22
# Checking lock file
 
23
Check_lockfile "${LIVE_ROOT}"/.lock
 
24
 
 
25
# Creating lock file
 
26
Create_lockfile "${LIVE_ROOT}"/.lock
 
27
 
 
28
# Checking stage file
 
29
Check_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86
 
30
 
 
31
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
 
32
then
 
33
        echo "W: skipping binary_memtest86, foreign architecture."
 
34
        exit 0
 
35
fi
 
36
 
 
37
if [ "${LIVE_MEMTEST86}" = "enabled" ]
 
38
then
 
39
        if [ ! -f "${LIVE_CHROOT}"/boot/memtest86+.bin ]
 
40
        then
 
41
                PACKAGES="${PACKAGES} memtest86+"
 
42
        fi
 
43
 
 
44
        if [ -n "${PACKAGES}" ]
 
45
        then
 
46
                # Installing symlinks
 
47
                case "${LH_APT}" in
 
48
                        apt)
 
49
                                Chroot "apt-get install --yes ${PACKAGES}"
 
50
                                ;;
 
51
 
 
52
                        aptitude)
 
53
                                Chroot "aptitude install --assume-yes ${PACKAGES}"
 
54
                                ;;
 
55
                esac
 
56
        fi
 
57
 
 
58
        case "${LIVE_BINARY_IMAGE}" in
 
59
                iso)
 
60
                        DESTDIR="${LIVE_ROOT}/binary/isolinux"
 
61
                        ;;
 
62
 
 
63
                net)
 
64
                        DESTDIR="${LIVE_ROOT}/tftpboot"
 
65
                        ;;
 
66
 
 
67
                usb)
 
68
                        DESTDIR="${LIVE_ROOT}/binary"
 
69
                        ;;
 
70
        esac
 
71
 
 
72
        # Creating directory
 
73
        if [ ! -d "${DESTDIR}" ]
 
74
        then
 
75
                mkdir -p "${DESTDIR}"
 
76
        fi
 
77
 
 
78
        # Installing memtest86+
 
79
        cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${DESTDIR}"/memtest
 
80
 
 
81
        if [ -n "${PACKAGES}" ]
 
82
        then
 
83
                # Removing syslinux
 
84
                case "${LH_APT}" in
 
85
                        apt)
 
86
                                Chroot "apt-get remove --purge --yes ${PACKAGES}"
 
87
                                ;;
 
88
 
 
89
                        aptitude)
 
90
                                Chroot "aptitude purge --assume-yes ${PACKAGES}"
 
91
                                ;;
 
92
                esac
 
93
        fi
 
94
 
 
95
        # Creating stage file
 
96
        Create_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86
 
97
fi