Moving partial python rewrite to separate branch, let's do it in the jessie+1 cycle...
[debian-live-build.git] / scripts / build / source_disk
bloba1f30f655b96a83d2ba4e0994e73380c88fd5949
1 #!/bin/sh
3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
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.
11 set -e
13 # Including common functions
14 [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
16 # Setting static variables
17 DESCRIPTION="$(Echo 'install disk information into source')"
18 HELP=""
19 USAGE="${PROGRAM} [--force]"
21 Arguments "${@}"
23 # Reading configuration files
24 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25 Set_defaults
27 case "${LB_SOURCE_IMAGES}" in
28 iso*|hdd*)
32 exit 0
34 esac
36 Echo_message "Begin installing disk information..."
38 # Requiring stage file
39 Require_stagefile .build/config .build/bootstrap
41 # Checking stage file
42 Check_stagefile .build/source_disk
44 # Checking lock file
45 Check_lockfile .lock
47 # Creating lock file
48 Create_lockfile .lock
50 mkdir -p source/.disk
52 DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
53 DISTRIBUTION="${DISTRIBUTION}$(echo ${LB_DISTRIBUTION} | cut -b 2-)"
54 eval VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`"
56 case "${LB_MODE}" in
57 debian)
58 TITLE="Debian GNU/Linux"
59 STRING="Official Snapshot ${ARCHITECTURE}"
60 TRACE="project/trace/ftp-master.debian.org"
63 ubuntu)
64 TITLE="Ubuntu"
65 STRING="Build ${ARCHITECTURE}"
66 TRACE=""
69 progress-linux)
70 TITLE="Progress Linux"
71 STRING="${VERSION} (${DISTRIBUTION}) - ${ARCHITECTURE}"
72 TRACE="project/trace/archive-master.progress-linux.org"
76 TITLE="Debian GNU/Linux"
77 STRING="Snapshot ${ARCHITECTURE}"
78 TRACE=""
80 esac
82 if [ -n "${TRACE}" ]
83 then
84 case "${LB_DERIVATIVE}" in
85 true)
86 echo "$(echo ${LB_PARENT_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
87 > source/.disk/archive_trace
89 echo "$(echo ${LB_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
90 >> source/.disk/archive_trace
93 false)
94 echo "$(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \
95 > source/.disk/archive_trace
97 esac
100 case "${LB_DEBIAN_INSTALLER}" in
101 cdrom)
102 echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
105 true|netinst)
106 echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
109 live)
110 echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
113 businesscard)
114 echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
117 false)
118 echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Source $(date +%Y%m%d-%H:%M)" > source/.disk/info
120 esac
122 # Creating stage file
123 Create_stagefile .build/source_disk