2009-02-08 08:27:12 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2015-01-04 18:05:39 -01:00
|
|
|
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2010-09-02 11:12:37 +00:00
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2009-02-08 08:27:12 -01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
2012-08-27 13:52:29 +00:00
|
|
|
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
|
2009-02-08 08:27:12 -01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2012-09-26 13:36:42 +00:00
|
|
|
if [ "${LB_WIN32_LOADER}" != "true" ]
|
2009-02-25 07:51:28 -01:00
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2009-02-08 08:27:12 -01:00
|
|
|
Echo_message "Begin copying win32-loader..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Require_stagefile .build/config .build/bootstrap
|
2009-02-08 08:27:12 -01:00
|
|
|
|
|
|
|
# Checking stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Check_stagefile .build/binary_win32-loader
|
2009-02-08 08:27:12 -01:00
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
2015-01-04 17:37:21 -01:00
|
|
|
case "${LB_MODE}" in
|
|
|
|
progress-linux)
|
|
|
|
RUN_LABEL="Run Progress Linux"
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
RUN_LABEL="Run Debian GNU/Linux"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-12-10 05:39:58 -01:00
|
|
|
case "${LB_ARCHITECTURES}" in
|
2009-12-09 19:54:41 -01:00
|
|
|
amd64|i386)
|
2017-08-28 09:29:54 +00:00
|
|
|
# Checking depends
|
|
|
|
Check_package chroot /usr/share/win32/win32-loader.exe win32-loader
|
2009-03-05 14:33:31 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Restoring cache
|
|
|
|
Restore_cache cache/packages.binary
|
2009-02-08 08:35:25 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Installing depends
|
|
|
|
Install_package
|
2009-02-08 08:35:25 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
|
|
|
|
then
|
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-02-08 08:35:25 -01:00
|
|
|
|
2009-11-16 10:40:43 -01:00
|
|
|
mv binary/win32-loader.exe binary/setup.exe
|
2013-01-02 09:41:30 -01:00
|
|
|
mv binary/win32-loader/g2ldr* binary
|
|
|
|
rmdir binary/win32-loader > /dev/null 2>&1 || true
|
2013-01-02 08:59:59 -01:00
|
|
|
|
2015-04-28 05:50:16 +00:00
|
|
|
cat > binary/autorun.inf << EOF
|
2013-01-02 08:59:59 -01:00
|
|
|
[autorun]
|
|
|
|
open=setup.exe
|
2015-01-04 17:37:21 -01:00
|
|
|
icon=setup.exe,0
|
|
|
|
label=${RUN_LABEL}
|
|
|
|
|
|
|
|
[Content]
|
|
|
|
MusicFiles=false
|
|
|
|
PictureFiles=false
|
|
|
|
VideoFiles=false
|
2013-01-02 08:59:59 -01:00
|
|
|
EOF
|
|
|
|
|
2010-09-07 13:11:20 +00:00
|
|
|
if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
|
2009-11-16 10:40:43 -01:00
|
|
|
then
|
2009-02-08 09:37:17 -01:00
|
|
|
|
|
|
|
cat > binary/win32-loader.ini << EOF
|
|
|
|
[installer]
|
2013-01-02 09:19:08 -01:00
|
|
|
kernel=linux
|
2014-12-10 05:39:58 -01:00
|
|
|
arch=${LB_ARCHITECTURES}
|
2013-01-02 09:19:08 -01:00
|
|
|
default_desktop=gnome
|
2014-12-10 05:39:58 -01:00
|
|
|
${LB_ARCHITECTURES}/linux=install/vmlinuz
|
|
|
|
${LB_ARCHITECTURES}/initrd=install/initrd.gz
|
2013-01-02 09:18:20 -01:00
|
|
|
EOF
|
|
|
|
|
2013-03-07 20:04:24 -01:00
|
|
|
if [ -e binary/install/gtk ]
|
2013-01-02 09:18:20 -01:00
|
|
|
then
|
|
|
|
|
|
|
|
cat >> binary/win32-loader.ini << EOF
|
2014-12-10 05:39:58 -01:00
|
|
|
${LB_ARCHITECTURES}/gtk/linux=install/vmlinuz
|
|
|
|
${LB_ARCHITECTURES}/gtk/initrd=install/gtk/initrd.gz
|
2013-01-02 09:18:20 -01:00
|
|
|
EOF
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat >> binary/win32-loader.ini << EOF
|
2009-02-08 09:37:17 -01:00
|
|
|
|
|
|
|
[grub]
|
|
|
|
g2ldr=g2ldr
|
|
|
|
g2ldr.mbr=g2ldr.mbr
|
|
|
|
EOF
|
|
|
|
|
2009-11-16 10:40:43 -01:00
|
|
|
fi
|
2009-02-08 09:37:17 -01:00
|
|
|
|
2009-11-16 10:40:43 -01:00
|
|
|
# Saving cache
|
2012-06-04 08:52:28 +00:00
|
|
|
Save_cache cache/packages.binary
|
2009-02-08 08:35:25 -01:00
|
|
|
|
2009-11-16 10:40:43 -01:00
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
|
|
|
;;
|
2009-02-08 08:35:25 -01:00
|
|
|
|
2009-11-16 10:40:43 -01:00
|
|
|
*)
|
2009-12-13 19:17:45 -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
|
2009-02-08 08:27:12 -01:00
|
|
|
|
|
|
|
# Creating stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Create_stagefile .build/binary_win32-loader
|