source: live-build/trunk/fuentes/scripts/build/lb_binary_memtest @ 900

Last change on this file since 900 was 900, checked in by kbut, 4 years ago

add original source

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11set -e
12
13# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Setting static variables
17DESCRIPTION="$(Echo 'installs a memtest into binary')"
18HELP=""
19USAGE="${PROGRAM} [--force]"
20
21Arguments "${@}"
22
23# Reading configuration files
24Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25Set_defaults
26
27if [ "${LB_BINARY_IMAGES}" = "virtual-hdd" ] || [ "${LB_MEMTEST}" = "false" ] || [ "${LB_MEMTEST}" = "none" ]
28then
29        exit 0
30fi
31
32Echo_message "Begin installing memtest..."
33
34# Requiring stage file
35Require_stagefile .build/config .build/bootstrap
36
37# Checking stage file
38Check_stagefile .build/binary_memtest
39
40# Checking lock file
41Check_lockfile .lock
42
43# Creating lock file
44Create_lockfile .lock
45
46if [ "${LB_ARCHITECTURES}" != "amd64" ] && [ "${LB_ARCHITECTURES}" != "i386" ]
47then
48        Echo_warning "skipping binary_memtest, foreign architecture."
49        exit 0
50fi
51
52if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
53then
54
55        if [ -f chroot/usr/sbin/grub ] && [ ! -f chroot/boot/grub/menu.lst ]
56        then
57                GRUB="yes"
58
59                mkdir -p chroot/boot/grub
60                touch chroot/boot/grub/menu.lst
61        fi
62fi
63
64# Checking depends
65case "${LB_MEMTEST}" in
66        memtest86)
67                Check_package chroot/boot/memtest86.bin memtest86
68                ;;
69
70        memtest86+)
71                Check_package chroot/boot/memtest86+.bin memtest86+
72                ;;
73esac
74
75# Restoring cache
76Restore_cache cache/packages.binary
77
78# Installing depends
79Install_package
80
81# Setting destination directory
82case "${LB_INITRAMFS}" in
83        casper)
84                DESTDIR="binary/casper"
85                ;;
86
87        live-boot)
88                DESTDIR="binary/live"
89                ;;
90
91        *)
92                DESTDIR="binary/boot"
93                ;;
94esac
95
96Check_multiarchitectures
97
98# Creating directory
99mkdir -p "${DESTDIR}"
100
101# Installing memtest
102case "${LB_BUILD_WITH_CHROOT}" in
103        true)
104                cp chroot/boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
105                ;;
106
107        false)
108                cp /boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
109                ;;
110esac
111
112# Saving cache
113Save_cache cache/packages.binary
114
115# Removing depends
116Remove_package
117
118if [ "${GRUB}" ]
119then
120        rm -rf chroot/boot/grub
121fi
122
123# Creating stage file
124Create_stagefile .build/binary_memtest
Note: See TracBrowser for help on using the repository browser.