summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnqnfe <jnqnfe@gmail.com>2015-01-05 18:49:13 +0000
committerLuca Boccassi <bluca@debian.org>2020-03-05 20:42:31 +0000
commitaa858eb2c8e3b2dea98e063cf150a28b9a4379ad (patch)
tree2d587322482f86a0f7c458bc0b045a52f0ad2aa4
parent8b109ffb96282a6dd1aa5d61aa935bcba69c56f1 (diff)
downloadvyos-live-build-aa858eb2c8e3b2dea98e063cf150a28b9a4379ad.tar.gz
vyos-live-build-aa858eb2c8e3b2dea98e063cf150a28b9a4379ad.zip
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
-rwxr-xr-xscripts/build/binary_disk126
1 files changed, 60 insertions, 66 deletions
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk
index aebca2a0e..1187fea69 100755
--- a/scripts/build/binary_disk
+++ b/scripts/build/binary_disk
@@ -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
- ;;
-
- 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
+ DISK_LABEL="LIVE/CD"
+ DISK_TYPE="full_cd"
;;
-
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
+ DISK_LABEL="LIVE/BC"
+ DISK_TYPE="not_complete"
+ ;;
+ none)
+ DISK_LABEL="LIVE"
+ DISK_TYPE=""
+ ;;
+esac
- echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
+echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} ${DISK_LABEL} 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
+if [ -n "${DISK_TYPE}" ]; then
+ echo "${DISK_TYPE}" > binary/.disk/cd_type
+fi
- continue
- fi
- done
+#FIXME review the netboot case
+case "${LB_DEBIAN_INSTALLER}" in
+ none|netboot)
;;
-
- none)
- echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
+ 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