2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
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.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2012-08-13 10:23:34 +00:00
|
|
|
. "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || . /usr/lib/live/build.sh
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2011-04-23 15:37:36 +00:00
|
|
|
DESCRIPTION="$(Echo 'schedule kernel packages for installation')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
2011-04-23 15:37:36 +00:00
|
|
|
USAGE="${PROGRAM} [--force]"
|
2007-09-23 08:04:48 +00:00
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:46 +00:00
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
# Requiring stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Require_stagefile .build/config .build/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2011-04-23 15:37:36 +00:00
|
|
|
# Checking stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Check_stagefile .build/chroot_linux-image
|
2011-04-23 15:37:36 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
|
|
|
# Diverting update-initramfs
|
|
|
|
#case "${LB_INITRAMFS}" in
|
|
|
|
# live-boot)
|
|
|
|
# mv chroot/usr/sbin/update-initramfs chroot/usr/sbin/update-initramfs.live-build
|
|
|
|
# ;;
|
|
|
|
#esac
|
|
|
|
|
|
|
|
if [ "${LB_LINUX_PACKAGES}" != "none" ]
|
|
|
|
then
|
|
|
|
for FLAVOUR in ${LB_LINUX_FLAVOURS}
|
|
|
|
do
|
|
|
|
for PACKAGE in ${LB_LINUX_PACKAGES}
|
|
|
|
do
|
2011-09-07 13:59:48 +00:00
|
|
|
echo ${PACKAGE}-${FLAVOUR} >> chroot/root/packages.chroot
|
2011-04-23 15:37:36 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2012-06-04 08:41:57 +00:00
|
|
|
# Include firmware packages
|
2012-04-26 20:27:56 +00:00
|
|
|
if [ "${LB_FIRMWARE_CHROOT}" = "true" ]
|
|
|
|
then
|
|
|
|
# Assumption: firmware packages install files into /lib/firmware
|
|
|
|
|
|
|
|
# Get all firmware packages names
|
2012-06-04 08:41:57 +00:00
|
|
|
mkdir -p cache/contents.chroot
|
|
|
|
wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
|
|
|
|
|
|
|
|
FIRMWARE_PACKAGES=""
|
|
|
|
FIRMWARE_PACKAGES="$(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
|
2012-04-26 20:27:56 +00:00
|
|
|
|
|
|
|
if [ "${LB_DERIVATIVE}" = "true" ]
|
|
|
|
then
|
2012-06-04 08:41:57 +00:00
|
|
|
wget {WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
|
|
|
|
|
|
|
|
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
|
2012-04-26 20:27:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Filter out contrib packages if contrib is not enabled
|
|
|
|
if ! echo ${LB_ARCHIVE_AREAS} | grep -qs contrib
|
|
|
|
then
|
2012-06-04 08:41:57 +00:00
|
|
|
_FIRMWARE_PACKAGES=""
|
|
|
|
|
2012-04-26 20:27:56 +00:00
|
|
|
for _PACKAGE in ${FIRMWARE_PACKAGES}
|
|
|
|
do
|
2012-06-04 08:41:57 +00:00
|
|
|
_FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | sed -e 's|^contrib/.*$||')"
|
2012-04-26 20:27:56 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Filter out non-free packages if non-free is not enabled
|
|
|
|
if ! echo ${LB_ARCHIVE_AREAS} | grep -qs non-free
|
|
|
|
then
|
2012-06-04 08:41:57 +00:00
|
|
|
_FIRMWARE_PACKAGES=""
|
|
|
|
|
2012-04-26 20:27:56 +00:00
|
|
|
for _PACKAGE in ${FIRMWARE_PACKAGES}
|
|
|
|
do
|
2012-06-04 08:41:57 +00:00
|
|
|
_FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | sed -e 's|^non-free/.*$||')"
|
2012-04-26 20:27:56 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}"
|
2012-04-26 21:02:50 +00:00
|
|
|
else
|
|
|
|
# Manually add firmware-linux/non-free meta package
|
|
|
|
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
|
2012-06-12 11:38:20 +00:00
|
|
|
|
|
|
|
# Manually add intel-microcode
|
|
|
|
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} intel-microcode"
|
2012-04-26 20:27:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Drop section and keep package names only
|
|
|
|
for _PACKAGE in ${FIRMWARE_PACKAGES}
|
|
|
|
do
|
|
|
|
echo $(echo ${_PACKAGE} | awk -F/ '{ print $NF }') >> chroot/root/packages.chroot
|
|
|
|
done
|
2012-04-26 20:49:57 +00:00
|
|
|
|
|
|
|
# Some known licenses required to be accepted
|
|
|
|
cat >> chroot/root/packages.chroot.cfg << EOF
|
|
|
|
firmware-ivtv firmware-ivtv/license/accepted boolean true
|
|
|
|
firmware-ipw2x00 firmware-ipw2x00/license/accepted boolean true
|
|
|
|
EOF
|
|
|
|
|
2012-04-26 20:27:56 +00:00
|
|
|
fi
|
|
|
|
|
2011-06-11 17:36:46 +00:00
|
|
|
# Creating stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Create_stagefile .build/chroot_linux-image
|
2011-04-23 15:37:36 +00:00
|
|
|
fi
|