~timrchavez/live-build/lb-sg-2.x-add-suppport-for-pxz

« back to all changes in this revision

Viewing changes to scripts/build/binary_win32-loader

  • Committer: Daniel Baumann
  • Date: 2011-03-09 18:17:15 UTC
  • Revision ID: daniel@debian.org-20110309181715-2s6s9tqa8xup5aep
Rearranging helpers scripts in source tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_binary_win32-loader(1) - copy win32-loader into binary
 
4
# Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
 
5
#
 
6
# live-helper 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
set -e
 
11
 
 
12
# Including common functions
 
13
. "${LH_BASE:-/usr/share/live-helper}"/scripts/build.sh
 
14
 
 
15
# Setting static variables
 
16
DESCRIPTION="$(Echo 'copy win32-loader into binary')"
 
17
HELP=""
 
18
USAGE="${PROGRAM} [--force]"
 
19
 
 
20
Arguments "${@}"
 
21
 
 
22
# Reading configuration files
 
23
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
 
24
Set_defaults
 
25
 
 
26
if [ "${LH_WIN32_LOADER}" != "true" ] || [ "${LH_BINARY_IMAGES}" = "virtual-hdd" ]
 
27
then
 
28
        exit 0
 
29
fi
 
30
 
 
31
Echo_message "Begin copying win32-loader..."
 
32
 
 
33
# Requiring stage file
 
34
Require_stagefile .stage/config .stage/bootstrap
 
35
 
 
36
# Checking stage file
 
37
Check_stagefile .stage/binary_win32-loader
 
38
 
 
39
# Checking lock file
 
40
Check_lockfile .lock
 
41
 
 
42
# Creating lock file
 
43
Create_lockfile .lock
 
44
 
 
45
case "${LH_ARCHITECTURE}" in
 
46
        amd64|i386)
 
47
                case "${LH_DISTRIBUTION}" in
 
48
                        lenny|squeeze)
 
49
                                WIN32_LOADER="/usr/lib/win32-loader"
 
50
                                ;;
 
51
 
 
52
                        *)
 
53
                                WIN32_LOADER="/usr/share/win32"
 
54
                                ;;
 
55
                esac
 
56
 
 
57
                if [ "${LH_BUILD_WITH_CHROOT}" = "true" ]
 
58
                then
 
59
                        # Checking depends
 
60
                        Check_package chroot/${WIN32_LOADER}/win32-loader.exe win32-loader
 
61
 
 
62
                        # Restoring cache
 
63
                        Restore_cache cache/packages_binary
 
64
 
 
65
                        # Installing depends
 
66
                        Install_package
 
67
 
 
68
                        # Copying win32-loader
 
69
                        cp -r chroot/${WIN32_LOADER}/* binary
 
70
                else
 
71
                        cp -r ${WIN32_LOADER}/* binary
 
72
                fi
 
73
 
 
74
                mv binary/win32-loader.exe binary/setup.exe
 
75
 
 
76
                if [ -e binary/win32-loader-standalone.exe ]
 
77
                then
 
78
                        mv binary/win32-loader-standalone.exe binary/setup-standalone.exe
 
79
                fi
 
80
 
 
81
                if [ "${LH_DEBIAN_INSTALLER}" != "false" ]
 
82
                then
 
83
 
 
84
cat > binary/win32-loader.ini << EOF
 
85
[installer]
 
86
arch=${LH_ARCHITECTURE}
 
87
i386/linux=install/vmlinuz
 
88
i386/initrd=install/initrd.gz
 
89
i386/gtk/linux=install/vmlinuz
 
90
i386/gtk/initrd=install/gtk/initrd.gz
 
91
 
 
92
[grub]
 
93
g2ldr=g2ldr
 
94
g2ldr.mbr=g2ldr.mbr
 
95
EOF
 
96
 
 
97
                fi
 
98
 
 
99
                # Saving cache
 
100
                Save_cache cache/packages_binary
 
101
 
 
102
                # Removing depends
 
103
                Remove_package
 
104
                ;;
 
105
 
 
106
        *)
 
107
                Echo_warning "win32-loader inclusion is set to true but not compatible with your architecture, ignoring."
 
108
                ;;
 
109
esac
 
110
 
 
111
# Creating stage file
 
112
Create_stagefile .stage/binary_win32-loader