Adding option for setting filesystem label on usb-hdd images.

This commit is contained in:
Daniel Baumann 2011-09-12 09:19:30 +02:00
parent 80fa0406d9
commit bb718340e2
4 changed files with 41 additions and 7 deletions

View File

@ -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)

View File

@ -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

View File

@ -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}"

View File

@ -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