~asac/live-build/virtual-hdd-mtab-hack

« back to all changes in this revision

Viewing changes to helpers/lh_binary_disk

  • Committer: Daniel Baumann
  • Date: 2009-11-22 13:38:00 UTC
  • Revision ID: git-v1:a62f12110b19a52a58d7eae871012202cfa16055
Renaming categories to archive areas (Closes: #519690).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_binary_disk (1) - install disk information into binary
 
4
# Copyright (C) 2006-2009 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}"/functions.sh
 
14
 
 
15
# Setting static variables
 
16
DESCRIPTION="$(Echo 'install disk information 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
case "${LH_BINARY_IMAGES}" in
 
27
        iso|usb-hdd)
 
28
                ;;
 
29
        *)
 
30
                exit 0
 
31
                ;;
 
32
esac
 
33
 
 
34
Echo_message "Begin installing disk information..."
 
35
 
 
36
# Requiring stage file
 
37
Require_stagefile .stage/config .stage/bootstrap
 
38
 
 
39
# Checking stage file
 
40
Check_stagefile .stage/binary_disk
 
41
 
 
42
# Checking lock file
 
43
Check_lockfile .lock
 
44
 
 
45
# Creating lock file
 
46
Create_lockfile .lock
 
47
 
 
48
mkdir -p binary/.disk
 
49
 
 
50
ARCHITECTURE="$(echo ${LH_ARCHITECTURE} | sed -e 's| |/|g')"
 
51
DISTRIBUTION="$(echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
 
52
DISTRIBUTION="${DISTRIBUTION}$(echo ${LH_DISTRIBUTION} | cut -b 2-)"
 
53
eval VERSION="$`echo RELEASE_${LH_DISTRIBUTION}`"
 
54
 
 
55
TITLE="Debian GNU/Linux"
 
56
case "${LH_MODE}" in
 
57
        debian)
 
58
                STRING="Official Snapshot ${ARCHITECTURE}"
 
59
                TRACE="project/trace/ftp-master.debian.org"
 
60
                ;;
 
61
 
 
62
        debian-release)
 
63
                STRING="Official ${ARCHITECTURE}"
 
64
                TRACE="project/trace/ftp-master.debian.org"
 
65
                ;;
 
66
 
 
67
        ubuntu)
 
68
                TITLE="Ubuntu GNU/Linux"
 
69
                STRING="Build ${ARCHITECTURE}"
 
70
                TRACE=""
 
71
                ;;
 
72
 
 
73
        *)
 
74
                STRING="Snapshot ${ARCHITECTURE}"
 
75
                TRACE=""
 
76
                ;;
 
77
esac
 
78
 
 
79
if [ -n "${TRACE}" ]
 
80
then
 
81
        echo "$(wget -q ${LH_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
 
82
        > binary/.disk/archive_trace
 
83
fi
 
84
 
 
85
case "${LH_DEBIAN_INSTALLER}" in
 
86
        cdrom)
 
87
                echo "main" > binary/.disk/base_components
 
88
 
 
89
                touch binary/.disk/base_installable
 
90
 
 
91
                echo "full_cd" > binary/.disk/cd_type
 
92
 
 
93
                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
 
94
 
 
95
                cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_udeb_include binary/.disk/udeb_include
 
96
                ;;
 
97
 
 
98
        enabled|netinst|live)
 
99
                echo "main" > binary/.disk/base_components
 
100
 
 
101
                touch binary/.disk/base_installable
 
102
 
 
103
                echo "not_complete" > binary/.disk/cd_type
 
104
 
 
105
                if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
 
106
                then
 
107
                        echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
 
108
                else
 
109
                        echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
 
110
 
 
111
                fi
 
112
 
 
113
                cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_netinst_udeb_include binary/.disk/udeb_include
 
114
 
 
115
                if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
 
116
                then
 
117
                        echo "live-installer" >> binary/.disk/udeb_include
 
118
                fi
 
119
                ;;
 
120
 
 
121
        businesscard)
 
122
                echo "main" > binary/.disk/base_components
 
123
 
 
124
                echo "not_complete" > binary/.disk/cd_type
 
125
 
 
126
                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
 
127
 
 
128
                cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_businesscard_udeb_include binary/.disk/udeb_include
 
129
                ;;
 
130
 
 
131
        disabled)
 
132
                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
 
133
                ;;
 
134
esac
 
135
 
 
136
# Creating stage file
 
137
Create_stagefile .stage/binary_disk