summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2011-09-12 09:19:30 +0200
committerDaniel Baumann <daniel@debian.org>2011-09-12 09:19:30 +0200
commitbb718340e227fe25761fc52469664428323ea1a9 (patch)
tree8f2c38df057915326f3d117971ca743764b659cd
parent80fa0406d9dbc687b42df52361ca6339bc81e1bb (diff)
downloadvyos-live-build-bb718340e227fe25761fc52469664428323ea1a9.tar.gz
vyos-live-build-bb718340e227fe25761fc52469664428323ea1a9.zip
Adding option for setting filesystem label on usb-hdd images.
-rwxr-xr-xfunctions/defaults.sh23
-rwxr-xr-xscripts/build/lb_binary_usb6
-rwxr-xr-xscripts/build/lb_config13
-rwxr-xr-xscripts/build/lb_source_usb6
4 files changed, 41 insertions, 7 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 643123c89..f157091f4 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -1010,6 +1010,29 @@ Set_defaults ()
;;
esac
+ # Setting hdd options
+ case "${LB_MODE}" in
+ debian)
+ LB_HDD_LABEL="${LB_HDD_LABEL:-DEBIAN_LIVE}"
+ ;;
+
+ emdebian)
+ LB_HDD_LABEL="${LB_HDD_LABEL:-EMDEBIAN_LIVE}"
+ ;;
+
+ progress)
+ LB_HDD_LABEL="${LB_HDD_LABEL:-PROGRESS_$(echo ${LB_DISTRIBUTION} | tr [a-z][A-Z])}"
+ ;;
+
+ ubuntu)
+ LB_HDD_LABEL="${LB_HDD_LABEL:-UBUNTU}"
+ ;;
+
+ kubuntu)
+ LB_HDD_LABEL="${LB_HDD_LABEL:-KUBUNTU}"
+ ;;
+ esac
+
# Setting iso volume
case "${LB_MODE}" in
debian)
diff --git a/scripts/build/lb_binary_usb b/scripts/build/lb_binary_usb
index 228827dd0..ad03caa51 100755
--- a/scripts/build/lb_binary_usb
+++ b/scripts/build/lb_binary_usb
@@ -172,17 +172,17 @@ Losetup $FREELO chroot/binary.img 1
case "${LB_BINARY_FILESYSTEM}" in
ext2|ext3|ext4)
MKFS="${LB_BINARY_FILESYSTEM}"
- MKFS_OPTIONS="-L DEBIAN_LIVE -m 0"
+ MKFS_OPTIONS="-L ${LB_HDD_LABEL} -m 0"
;;
fat16)
MKFS="vfat"
- MKFS_OPTIONS="-F 16 -n DEBIAN_LIVE"
+ MKFS_OPTIONS="-F 16 -n ${LB_HDD_LABEL}"
;;
fat32)
MKFS="vfat"
- MKFS_OPTIONS="-F 32 -n DEBIAN_LIVE"
+ MKFS_OPTIONS="-F 32 -n ${LB_HDD_LABEL}"
;;
esac
diff --git a/scripts/build/lb_config b/scripts/build/lb_config
index d231a7d4b..af9c7d9a6 100755
--- a/scripts/build/lb_config
+++ b/scripts/build/lb_config
@@ -83,6 +83,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--initsystem sysvinit|runit|systemd|upstart|none]\n\
\t [--interactive shell]\n\
\t [--isohybrid-options OPTION|\"OPTIONS\"]\n\
+\t [--hdd-label LABEL]\n\
\t [--iso-application NAME]\n\
\t [--iso-preparer NAME]\n\
\t [--iso-publisher NAME]\n\
@@ -163,7 +164,7 @@ Local_arguments ()
package-lists:,tasks:,security:,volatile:,backports:,binary-filesystem:,binary-images:,
apt-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,compression:,build-with-chroot:,
debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
- grub-splash:,hostname:,isohybrid-options:,iso-application:,iso-preparer:,iso-publisher:,
+ grub-splash:,hostname:,isohybrid-options:,hdd-label:,iso-application:,iso-preparer:,iso-publisher:,
iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
net-cow-server:,net-tarball:,swap-file-path:,swap-file-size:,syslinux-theme:,
@@ -669,6 +670,11 @@ Local_arguments ()
shift 2
;;
+ --hdd-label)
+ LB_HDD_LABEL="${2}"
+ shift 2
+ ;;
+
--iso-application)
LB_ISO_APPLICATION="${2}"
shift 2
@@ -1303,6 +1309,11 @@ LB_GRUB_SPLASH="${LB_GRUB_SPLASH}"
# (Default: ${LB_HOSTNAME})
LB_HOSTNAME="${LB_HOSTNAME}"
+# \$LB_HDD_LABEL: set hdd label
+# (Default: ${LB_HDD_LABEL})
+LB_HDD_LABEL="${LB_HDD_LABEL}"
+
+
# \$LB_ISO_APPLICATION: set iso author
# (Default: ${LB_ISO_APPLICATION})
LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"
diff --git a/scripts/build/lb_source_usb b/scripts/build/lb_source_usb
index 1ba7e44e6..6f2fde750 100755
--- a/scripts/build/lb_source_usb
+++ b/scripts/build/lb_source_usb
@@ -100,17 +100,17 @@ Losetup $FREELO source.img 1
case "${LB_BINARY_FILESYSTEM}" in
ext2|ext3|ext4)
MKFS="${LB_BINARY_FILESYSTEM}"
- MKFS_OPTIONS="-L DEBIAN_LIVE -m 0"
+ MKFS_OPTIONS="-L ${LB_HDD_LABEL} -m 0"
;;
fat16)
MKFS="vfat"
- MKFS_OPTIONS="-F 16 -n DEBIAN_LIVE"
+ MKFS_OPTIONS="-F 16 -n ${LB_HDD_LABEL}"
;;
fat32)
MKFS="vfat"
- MKFS_OPTIONS="-F 32 -n DEBIAN_LIVE"
+ MKFS_OPTIONS="-F 32 -n ${LB_HDD_LABEL}"
;;
esac