live-build/scripts/build/binary_win32-loader

125 lines
2.6 KiB
Plaintext
Raw Normal View History

#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2013 Daniel Baumann <daniel@debian.org>
##
## This program 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
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.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 [ "${LB_WIN32_LOADER}" != "true" ]
then
exit 0
fi
Echo_message "Begin copying win32-loader..."
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
# Checking stage file
Check_stagefile .build/binary_win32-loader
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
case "${LB_ARCHITECTURES}" in
amd64|i386)
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
2009-11-16 10:40:43 -01:00
then
# Checking depends
2010-09-26 10:38:38 +00:00
Check_package chroot/usr/share/win32/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
2010-09-26 10:38:38 +00:00
cp -r chroot/usr/share/win32/* binary
2009-11-16 10:40:43 -01:00
else
2010-09-26 10:38:38 +00:00
cp -r usr/share/win32/* 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
mv binary/win32-loader/g2ldr* binary
rmdir binary/win32-loader > /dev/null 2>&1 || true
if [ -e binary/win32-loader-standalone.exe ]
then
# squeeze
mv binary/win32-loader-standalone.exe binary/setup-standalone.exe
fi
cat >> binary/autorun.inf << EOF
[autorun]
open=setup.exe
EOF
if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
2009-11-16 10:40:43 -01:00
then
cat > binary/win32-loader.ini << EOF
[installer]
2013-01-02 09:19:08 -01:00
kernel=linux
arch=${LB_ARCHITECTURES}
2013-01-02 09:19:08 -01:00
default_desktop=gnome
${LB_ARCHITECTURES}/linux=install/vmlinuz
${LB_ARCHITECTURES}/initrd=install/initrd.gz
EOF
if [ -e binary/install/gtk ]
then
cat >> binary/win32-loader.ini << EOF
${LB_ARCHITECTURES}/gtk/linux=install/vmlinuz
${LB_ARCHITECTURES}/gtk/initrd=install/gtk/initrd.gz
EOF
fi
cat >> binary/win32-loader.ini << EOF
[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 .build/binary_win32-loader