source: live-build/trunk/fuentes/scripts/build/lb_binary_checksums @ 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.0 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 'create binary checksums')"
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_CHECKSUMS}" = "none" ] || [ "${LB_BINARY_IMAGES}" = "virtual-hdd" ]
28then
29        exit 0
30fi
31
32# Requiring stage file
33Require_stagefile .build/config .build/bootstrap
34
35# Checking stage file
36Check_stagefile .build/binary_checksums
37
38# Checking lock file
39Check_lockfile .lock
40
41# Creating lock file
42Create_lockfile .lock
43
44for CHECKSUM in ${LB_CHECKSUMS}
45do
46        CHECKSUMS="$(echo ${CHECKSUM} | tr [a-z] [A-Z])SUMS"
47
48        Echo_message "Begin creating binary ${CHECKSUMS}..."
49
50        # Remove old checksums
51        if [ -f binary/${CHECKSUMS} ]
52        then
53                rm -f binary/${CHECKSUMS}
54        fi
55
56        # Calculating checksums
57        cd binary
58        find . -type f \
59                \! -path './isolinux/isolinux.bin' \
60                \! -path './boot/boot.bin' \
61                \! -path './boot/grub/stage2_eltorito' \
62                \! -path './*SUMS' \
63        -print0 | sort -z | xargs -0 ${CHECKSUM}sum > ../${CHECKSUMS}
64
65cat > ${CHECKSUMS} << EOF
66This file contains the list of ${CHECKSUM} checksums of all files on this medium.
67
68You can verify them automatically with the 'integrity-check' boot parameter,
69or, manually with: '${CHECKSUM}sum -c ${CHECKSUMS}'.
70
71
72EOF
73
74        cat ../${CHECKSUMS} >> ${CHECKSUMS}
75        rm -f ../${CHECKSUMS}
76
77        cd "${OLDPWD}"
78done
79
80# File list
81cd binary
82find . | sed -e 's|^.||g' | grep "^/" | sort > ../binary.contents
83cd "${OLDPWD}"
84
85# Creating stage file
86Create_stagefile .build/binary_checksums
Note: See TracBrowser for help on using the repository browser.