Releasing debian version 4.0~alpha39-1.
[live-build.git] / scripts / build / lb_binary_linux-image
1 #!/bin/sh
2
3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5 ##
6 ## live-build 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
11 set -e
12
13 # Including common functions
14 . "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
15
16 # Setting static variables
17 DESCRIPTION="$(Echo 'install linux-image into binary')"
18 HELP=""
19 USAGE="${PROGRAM} [--force]"
20
21 Arguments "${@}"
22
23 # Reading configuration files
24 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25 Set_defaults
26
27 if [ "${LB_BINARY_IMAGES}" = "virtual-hdd" ] || [ "${LB_LINUX_PACKAGES}" = "none" ]
28 then
29         exit 0
30 fi
31
32 Echo_message "Begin install linux-image..."
33
34 # Requiring stage file
35 Require_stagefile .build/config .build/bootstrap
36
37 # Checking stage file
38 Check_stagefile .build/binary_linux-image
39
40 # Checking lock file
41 Check_lockfile .lock
42
43 # Creating lock file
44 Create_lockfile .lock
45
46 case "${LB_INITRAMFS}" in
47         casper)
48                 DESTDIR="binary/casper"
49                 ;;
50
51         live-boot)
52                 DESTDIR="binary/live"
53                 ;;
54
55         *)
56                 DESTDIR="binary/boot"
57                 ;;
58 esac
59
60 case "${LB_ARCHITECTURES}" in
61         powerpc)
62                 LINUX="vmlinux"
63                 ;;
64
65         *)
66                 LINUX="vmlinuz"
67                 ;;
68 esac
69
70 Check_multiarchitectures
71
72 # Creating directory
73 mkdir -p "${DESTDIR}"
74
75 # Installing linux-image
76 if [ "${LB_LINUX_PACKAGES}" != "none" ]
77 then
78         cp chroot/boot/"${LINUX}"-* "${DESTDIR}"
79         cp chroot/boot/initrd.img-* "${DESTDIR}"
80 fi
81
82 case "${LB_INITRAMFS}" in
83         live-boot)
84                 if [ -e chroot/usr/share/doc/live-boot/parameters.txt ]
85                 then
86                         cp chroot/usr/share/doc/live-boot/parameters.txt "${DESTDIR}"/parameters
87                 fi
88                 ;;
89 esac
90
91 # Creating stage file
92 Create_stagefile .build/binary_linux-image