Adding option to set binary-net compression (or disable it).
This commit is contained in:
parent
265e6360d7
commit
0c9fc8846d
|
@ -590,6 +590,9 @@ Set_defaults ()
|
|||
# Setting net cow filesystem
|
||||
LH_NET_COW_FILESYSTEM="${LH_NET_COW_FILESYSTEM:-nfs}"
|
||||
|
||||
# Setting net tarball
|
||||
LH_NET_TARBALL="gzip"
|
||||
|
||||
# Setting syslinux configuration file
|
||||
# LH_SYSLINUX_CFG
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@ then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${LH_NET_TARBALL}" = "none" ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Echo_message "Begin building binary netboot image..."
|
||||
|
||||
# Requiring stage file
|
||||
|
@ -53,10 +58,9 @@ Check_lockfile .lock
|
|||
Create_lockfile .lock
|
||||
|
||||
# Remove old binary
|
||||
if [ -f binary-net.tar.gz ]
|
||||
then
|
||||
rm -f binary-net.tar.gz
|
||||
fi
|
||||
rm -f binary-net.tar.bz2
|
||||
rm -f binary-net.tar.gz
|
||||
rm -f binary-net.tar
|
||||
|
||||
# Creating image file
|
||||
ROOT_DIR=$(basename ${LH_NET_ROOT_PATH})
|
||||
|
@ -71,8 +75,24 @@ then
|
|||
fi
|
||||
|
||||
cd ..
|
||||
tar cfz binary-net.tar.gz "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||
mv binary-net.tar.gz "${OLDPWD}"
|
||||
|
||||
case "${LH_NET_TARBALL}" in
|
||||
bzip2)
|
||||
tar cfj binary-net-tar.bz2 "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||
mv binary-net.tar.bz2 "${OLDPWD}"
|
||||
;;
|
||||
|
||||
gzip)
|
||||
tar cfz binary-net.tar.gz "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||
mv binary-net.tar.gz "${OLDPWD}"
|
||||
;;
|
||||
|
||||
tar)
|
||||
tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||
mv binary-net.tar "${OLDPWD}"
|
||||
;;
|
||||
esac
|
||||
|
||||
cd "${OLDPWD}"
|
||||
|
||||
if [ "${ROOT_DIR}" != "binary" ]
|
||||
|
|
|
@ -89,6 +89,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
|
|||
\t [--net-cow-mountoptions OPTIONS]\n\
|
||||
\t [--net-cow-path PATH]\n\
|
||||
\t [--net-cow-server IP|HOSTNAME]\n\
|
||||
\t [--net-tarball bzip2|gzip|tar|none]\n\
|
||||
\t [-p|--packages-lists FILE]\n\
|
||||
\t [--packages PACKAGE|\"PACKAGES\"]\n\
|
||||
\t [--quiet]\n\
|
||||
|
@ -113,7 +114,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
|
|||
|
||||
Local_arguments ()
|
||||
{
|
||||
ARGUMENTS="$(getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-bootstrap-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,debian-installer-daily:,encryption:,grub-splash:,hostname:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,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:,syslinux-splash:,syslinux-timeout:,syslinux-menu:,username:,source:,source-images:,breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
|
||||
ARGUMENTS="$(getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-bootstrap-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,debian-installer-daily:,encryption:,grub-splash:,hostname:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,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:,syslinux-splash:,syslinux-timeout:,syslinux-menu:,username:,source:,source-images:,breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
|
||||
|
||||
if [ "${?}" != "0" ]
|
||||
then
|
||||
|
@ -549,6 +550,11 @@ Local_arguments ()
|
|||
shift 2
|
||||
;;
|
||||
|
||||
--net-tarball)
|
||||
LH_NET_TARBALL="${2}"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
--syslinux-splash)
|
||||
LH_SYSLINUX_SPLASH="${2}"
|
||||
shift 2
|
||||
|
@ -1040,6 +1046,10 @@ LH_NET_COW_PATH="${LH_NET_COW_PATH}"
|
|||
# (Default: ${LH_NET_COW_SERVER})
|
||||
LH_NET_COW_SERVER="${LH_NET_COW_SERVER}"
|
||||
|
||||
# \$LH_NET_TARBALL: set net tarball
|
||||
# (Default: ${LH_NET_TARBALL})
|
||||
LH_NET_TARBALL="${LH_NET_TARBALL}"
|
||||
|
||||
# \$LH_SYSLINUX_SPLASH: set custom syslinux splash
|
||||
# (Default: empty)
|
||||
LH_SYSLINUX_SPLASH="${LH_SYSLINUX_SPLASH}"
|
||||
|
|
Loading…
Reference in New Issue