2012-09-29 11:20:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## live-build(7) - System Build Scripts
|
2020-03-11 09:07:21 -01:00
|
|
|
## Copyright (C) 2016-2020 The Debian Live team
|
2015-01-04 18:05:39 -01:00
|
|
|
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
|
2012-09-29 11:20:21 +00:00
|
|
|
##
|
|
|
|
## 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
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Copy loadlin into binary"
|
2012-09-29 11:20:21 +00:00
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Processing arguments and configuration files
|
|
|
|
Init_config_data "${@}"
|
2012-09-29 11:20:21 +00:00
|
|
|
|
2013-04-30 08:30:33 +00:00
|
|
|
if [ "${LB_LOADLIN}" != "true" ] || [ "${LB_BINARY_IMAGES}" = "netboot" ]
|
2012-09-29 11:20:21 +00:00
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
Echo_message "Begin copying loadlin..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
2020-03-15 12:05:44 -01:00
|
|
|
Require_stagefiles config bootstrap
|
2012-09-29 11:20:21 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Check_stagefile
|
2012-09-29 11:20:21 +00:00
|
|
|
|
2020-03-13 15:19:59 -01:00
|
|
|
# Acquire lock file
|
2015-02-05 02:30:47 -01:00
|
|
|
Acquire_lockfile
|
2017-08-28 09:29:54 +00:00
|
|
|
|
2014-12-10 05:39:58 -01:00
|
|
|
case "${LB_ARCHITECTURES}" in
|
2012-09-29 11:20:21 +00:00
|
|
|
amd64|i386)
|
2017-08-28 09:29:54 +00:00
|
|
|
# Checking depends
|
|
|
|
Check_package chroot /usr/lib/loadlin/loadlin.exe.gz loadlin
|
2013-01-06 21:30:49 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Restoring cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Restore_package_cache binary
|
2013-01-06 21:30:49 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Installing depends
|
|
|
|
Install_package
|
2013-01-06 21:30:49 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
|
|
|
true)
|
2013-01-06 21:30:49 -01:00
|
|
|
_PREFIX="chroot"
|
|
|
|
;;
|
|
|
|
|
|
|
|
false)
|
|
|
|
_PREFIX=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Copying loadlin
|
|
|
|
mkdir -p binary/tools
|
|
|
|
gunzip -c "${_PREFIX}/usr/lib/loadlin/loadlin.exe.gz" > binary/tools/loadlin.exe
|
|
|
|
gunzip -c "${_PREFIX}/usr/share/doc/loadlin/manual.txt.gz" > binary/tools/loadlin.txt
|
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Saving cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Save_package_cache binary
|
2013-01-06 21:30:49 -01:00
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
2013-01-02 09:09:11 -01:00
|
|
|
|
2013-01-04 17:13:23 -01:00
|
|
|
cat > binary/install/install.bat << EOF
|
|
|
|
\tools\loadlin.exe vmlinuz initrd=initrd.gz
|
|
|
|
EOF
|
2013-01-02 09:09:11 -01:00
|
|
|
|
|
|
|
if [ -e binary/install/gtk ]
|
|
|
|
then
|
2013-01-04 17:13:23 -01:00
|
|
|
|
|
|
|
cat > binary/install/gtk/install.bat << EOF
|
2013-01-23 22:26:29 -01:00
|
|
|
\tools\loadlin.exe \install\vmlinuz initrd=initrd.gz vga=788
|
2013-01-04 17:13:23 -01:00
|
|
|
EOF
|
|
|
|
|
2013-01-02 09:09:11 -01:00
|
|
|
fi
|
2012-09-29 11:20:21 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
Echo_warning "loadlin inclusion is set to true but not compatible with your architecture, ignoring."
|
|
|
|
;;
|
|
|
|
esac
|
2020-03-12 00:38:58 -01:00
|
|
|
|
|
|
|
# Creating stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Create_stagefile
|