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

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

add original source

  • Property svn:executable set to *
File size: 3.1 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 'install disk information into source')"
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
27case "${LB_SOURCE_IMAGES}" in
28        iso*|hdd*)
29                ;;
30
31        *)
32                exit 0
33                ;;
34esac
35
36Echo_message "Begin installing disk information..."
37
38# Requiring stage file
39Require_stagefile .build/config .build/bootstrap
40
41# Checking stage file
42Check_stagefile .build/source_disk
43
44# Checking lock file
45Check_lockfile .lock
46
47# Creating lock file
48Create_lockfile .lock
49
50mkdir -p source/.disk
51
52DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
53DISTRIBUTION="${DISTRIBUTION}$(echo ${LB_DISTRIBUTION} | cut -b 2-)"
54eval VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`"
55
56case "${LB_MODE}" in
57        debian)
58                TITLE="Debian GNU/Linux"
59                STRING="Official Snapshot ${ARCHITECTURE}"
60                TRACE="project/trace/ftp-master.debian.org"
61                ;;
62
63        ubuntu)
64                TITLE="Ubuntu"
65                STRING="Build ${ARCHITECTURE}"
66                TRACE=""
67                ;;
68
69        kubuntu)
70                TITLE="Kubuntu"
71                STRING="Build ${ARCHITECTURE}"
72                TRACE=""
73                ;;
74
75        progress)
76                TITLE="Progress Linux"
77                STRING="${VERSION} (${DISTRIBUTION}) - ${ARCHITECTURE}"
78                TRACE="project/trace/archive-master.progress-linux.org"
79                ;;
80
81        *)
82                TITLE="Debian GNU/Linux"
83                STRING="Snapshot ${ARCHITECTURE}"
84                TRACE=""
85                ;;
86esac
87
88if [ -n "${TRACE}" ]
89then
90        case "${LB_DERIVATIVE}" in
91                true)
92                        echo "$(echo ${LB_PARENT_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
93                        > source/.disk/archive_trace
94
95                        echo "$(echo ${LB_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
96                        >> source/.disk/archive_trace
97                        ;;
98
99                false)
100                        echo "$(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
101                        > source/.disk/archive_trace
102                        ;;
103        esac
104fi
105
106case "${LB_DEBIAN_INSTALLER}" in
107        cdrom)
108                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
109                ;;
110
111        true|netinst)
112                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
113                ;;
114
115        live)
116                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
117                ;;
118
119        businesscard)
120                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
121                ;;
122
123        false)
124                echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
125                ;;
126esac
127
128# Creating stage file
129Create_stagefile .build/source_disk
Note: See TracBrowser for help on using the repository browser.