live-build/helpers/binary_win32-loader

113 lines
2.3 KiB
Plaintext
Raw Normal View History

#!/bin/sh
# lh_binary_win32-loader(1) - copy win32-loader into binary
# Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
set -e
# Including common functions
2009-11-22 12:40:20 -01:00
. "${LH_BASE:-/usr/share/live-helper}"/live-helper.sh
# Setting static variables
DESCRIPTION="$(Echo 'copy win32-loader into binary')"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
# Reading configuration files
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
if [ "${LH_WIN32_LOADER}" != "true" ] || [ "${LH_BINARY_IMAGES}" = "virtual-hdd" ]
then
exit 0
fi
Echo_message "Begin copying win32-loader..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/binary_win32-loader
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
2009-11-16 10:40:43 -01:00
case "${LH_ARCHITECTURE}" in
amd64|i386)
case "${LH_DISTRIBUTION}" in
lenny)
WIN32_LOADER="/usr/lib/win32-loader"
;;
*)
WIN32_LOADER="/usr/share/win32-loader"
;;
esac
if [ "${LH_CHROOT_BUILD}" = "true" ]
2009-11-16 10:40:43 -01:00
then
# Checking depends
Check_package chroot/${WIN32_LOADER}/win32-loader.exe win32-loader
2009-11-16 10:40:43 -01:00
# Restoring cache
Restore_cache cache/packages_binary
2009-11-16 10:40:43 -01:00
# Installing depends
Install_package
2009-11-16 10:40:43 -01:00
# Copying win32-loader
cp chroot/${WIN32_LOADER}/* binary
2009-11-16 10:40:43 -01:00
else
cp ${WIN32_LOADER}/* binary
2009-11-16 10:40:43 -01:00
fi
2009-11-16 10:40:43 -01:00
mv binary/win32-loader.exe binary/setup.exe
if [ -e binary/win32-loader-standalone.exe ]
then
mv binary/win32-loader-standalone.exe binary/setup-standalone.exe
fi
if [ "${LH_DEBIAN_INSTALLER}" != "false" ]
2009-11-16 10:40:43 -01:00
then
cat > binary/win32-loader.ini << EOF
[installer]
arch=${LH_ARCHITECTURE}
i386/linux=install/vmlinuz
i386/initrd=install/initrd.gz
i386/gtk/linux=install/vmlinuz
i386/gtk/initrd=install/gtk/initrd.gz
[grub]
g2ldr=g2ldr
g2ldr.mbr=g2ldr.mbr
EOF
2009-11-16 10:40:43 -01:00
fi
2009-11-16 10:40:43 -01:00
# Saving cache
Save_cache cache/packages_binary
2009-11-16 10:40:43 -01:00
# Removing depends
Remove_package
;;
2009-11-16 10:40:43 -01:00
*)
Echo_warning "win32-loader inclusion is set to true but not compatible with your architecture, ignoring."
2009-11-16 10:40:43 -01:00
;;
esac
# Creating stage file
Create_stagefile .stage/binary_win32-loader