binary_disk: refactor

Avoid all of the duplication for each installer case

Note, what is done for the netboot case (which was previously missing)
still needs addressing

Gbp-Dch: Short
Closes: #952865
This commit is contained in:
jnqnfe 2015-01-05 18:49:13 +00:00 committed by Luca Boccassi
parent 8b109ffb96
commit aa858eb2c8
1 changed files with 62 additions and 68 deletions

View File

@ -99,82 +99,76 @@ fi
case "${LB_DEBIAN_INSTALLER}" in
cdrom)
echo "main" > binary/.disk/base_components
touch binary/.disk/base_installable
echo "full_cd" > binary/.disk/cd_type
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
for LOCATION in "${LIVE_BUILD}/data/debian-cd" /usr/share/live/build/data/debian-cd
do
if [ -e "${LOCATION}" ]
then
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_udeb_include" binary/.disk/udeb_include
continue
fi
done
DISK_LABEL="LIVE/CD"
DISK_TYPE="full_cd"
;;
netinst|live)
echo "main" > binary/.disk/base_components
touch binary/.disk/base_installable
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
then
echo "live" > binary/.disk/cd_type
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
else
echo "not_complete" > binary/.disk/cd_type
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
fi
for LOCATION in "${LIVE_BUILD}/data/debian-cd" /usr/share/live/build/data/debian-cd
do
if [ -e "${LOCATION}" ]
then
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_netinst_udeb_include" binary/.disk/udeb_include
continue
fi
done
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
then
echo "live-installer" >> binary/.disk/udeb_include
fi
;;
netboot)
#FIXME incomplete?
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETBOOT Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
DISK_LABEL="LIVE/NETBOOT"
#FIXME: type?
DISK_TYPE=""
;;
netinst)
DISK_LABEL="LIVE/NETINST"
DISK_TYPE="not_complete"
;;
live)
DISK_LABEL="LIVE/INSTALL"
DISK_TYPE="live"
;;
businesscard)
echo "main" > binary/.disk/base_components
echo "not_complete" > binary/.disk/cd_type
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
for LOCATION in "${LIVE_BUILD}/data/debian-cd" /usr/share/live/build/data/debian-cd
do
if [ -e "${LOCATION}" ]
then
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_businesscard_udeb_include" binary/.disk/udeb_include
continue
fi
done
DISK_LABEL="LIVE/BC"
DISK_TYPE="not_complete"
;;
none)
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
DISK_LABEL="LIVE"
DISK_TYPE=""
;;
esac
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} ${DISK_LABEL} Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
if [ -n "${DISK_TYPE}" ]; then
echo "${DISK_TYPE}" > binary/.disk/cd_type
fi
#FIXME review the netboot case
case "${LB_DEBIAN_INSTALLER}" in
none|netboot)
;;
businesscard)
echo "main" > binary/.disk/base_components
;;
*)
echo "main" > binary/.disk/base_components
touch binary/.disk/base_installable
;;
esac
#FIXME review the netboot case
for LOCATION in "${LIVE_BUILD}/data/debian-cd" /usr/share/live/build/data/debian-cd
do
if [ -e "${LOCATION}" ]
then
case "${LB_DEBIAN_INSTALLER}" in
cdrom)
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_udeb_include" binary/.disk/udeb_include
;;
netinst|live)
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_netinst_udeb_include" binary/.disk/udeb_include
;;
businesscard)
cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES}_businesscard_udeb_include" binary/.disk/udeb_include
;;
none|netboot)
;;
esac
fi
done
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
then
echo "live-installer" >> binary/.disk/udeb_include
fi
# Creating stage file
Create_stagefile .build/binary_disk