Cleaning up from python removal (LIVE_IMAGE_ARCHITECTURE).
[debian-live-build.git] / scripts / build / binary_loadlin
blobe771c29316ee49b601c9cd4d8825ff597f3997dc
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 'copy loadlin into binary')"
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 if [ "${LB_LOADLIN}" != "true" ] || [ "${LB_BINARY_IMAGES}" = "netboot" ]
28 then
29 exit 0
32 Echo_message "Begin copying loadlin..."
34 # Requiring stage file
35 Require_stagefile .build/config .build/bootstrap
37 # Checking stage file
38 Check_stagefile .build/binary_loadlin
40 # Checking lock file
41 Check_lockfile .lock
43 # Creating lock file
44 Create_lockfile .lock
46 case "${LB_ARCHITECTURES}" in
47 amd64|i386)
48 case "${LB_BUILD_WITH_CHROOT}" in
49 true)
50 # Checking depends
51 Check_package chroot/usr/lib/loadlin/loadlin.exe.gz loadlin
53 # Restoring cache
54 Restore_cache cache/packages.binary
56 # Installing depends
57 Install_package
59 _PREFIX="chroot"
62 false)
63 _PREFIX=""
65 esac
67 # Copying loadlin
68 mkdir -p binary/tools
69 gunzip -c "${_PREFIX}/usr/lib/loadlin/loadlin.exe.gz" > binary/tools/loadlin.exe
70 gunzip -c "${_PREFIX}/usr/share/doc/loadlin/manual.txt.gz" > binary/tools/loadlin.txt
72 case "${LB_BUILD_WITH_CHROOT}" in
73 true)
74 # Saving cache
75 Save_cache cache/packages.binary
77 # Removing depends
78 Remove_package
80 esac
82 cat > binary/install/install.bat << EOF
83 \tools\loadlin.exe vmlinuz initrd=initrd.gz
84 EOF
86 if [ -e binary/install/gtk ]
87 then
89 cat > binary/install/gtk/install.bat << EOF
90 \tools\loadlin.exe \install\vmlinuz initrd=initrd.gz vga=788
91 EOF
95 # Creating stage file
96 Create_stagefile .build/binary_loadlin
100 Echo_warning "loadlin inclusion is set to true but not compatible with your architecture, ignoring."
102 esac