From 8321653cb36511324d576e65cb13b5c9b0c5f438 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 12 Nov 2007 22:43:28 +0100 Subject: =?UTF-8?q?Adding=20check=20to=20detect=20gnu-fdisk=20and=20using?= =?UTF-8?q?=20the=20original=20fdisk,=20thanks=20to=20Peter=20Skogstr?= =?UTF-8?q?=C3=B6m=20=20for=20the=20report.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/defaults.sh | 17 +++++++++++++++++ helpers/lh_config | 12 +++++++++++- helpers/lh_losetup | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/functions/defaults.sh b/functions/defaults.sh index a7a1238..6c76ac7 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -138,10 +138,27 @@ Set_defaults () fi fi + # Setting fdisk + if [ -z "${LH_FDISK}" ] || [ ! -x "${LH_FDISK}" ] + then + # Workaround for gnu-fdisk divertion + # (gnu-fdisk is buggy, #445304). + if [ -x /sbin/fdisk.distrib ] + then + LH_FDISK="fdisk.distrib" + elif [ -x /sbin/fdisk ] + then + LH_FDISK="fdisk" + else + echo "E: Can't proces file /sbin/fdisk (FIXME)" + fi + fi + # Setting losetup if [ -z "${LH_LOSETUP}" ] || [ ! -x "${LH_LOSETUP}" ] then # Workaround for loop-aes-utils divertion + # (loop-aes-utils' losetup lacks features). if [ -x /sbin/losetup.orig ] then LH_LOSETUP="losetup.orig" diff --git a/helpers/lh_config b/helpers/lh_config index c3769d8..05e5cb0 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -53,6 +53,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--debug]\n\ \t [-d|--distribution CODENAME]\n\ \t [-e|--encryption aes128|aes192|aes256]\n\ +\t [--fdisk\n\ \t [--force]\n\ \t [--genisoimage genisomage|mkisofs]\n\ \t [--grub-splash FILE]\n\ @@ -108,7 +109,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ Local_arguments () { - ARGUMENTS="$(getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,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-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,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-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-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,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 -- "${@}")" if [ "${?}" != "0" ] then @@ -202,6 +203,11 @@ Local_arguments () shift 2 ;; + --fdisk) + LH_FDISK="${2}" + shift 2 + ;; + --losetup) LH_LOSETUP="${2}" shift 2 @@ -699,6 +705,10 @@ LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" # (Default: ${LH_INITRAMFS}) LH_INITRAMFS="${LH_INITRAMFS}" +# \$LH_FDISK: set fdisk program +# (Default: autodetected) +LH_FDISK="${LH_FDISK}" + # \$LH_LOSETUP: set losetup program # (Default: autodetected) LH_LOSETUP="${LH_LOSETUP}" diff --git a/helpers/lh_losetup b/helpers/lh_losetup index 2ea7f9e..f3b6720 100755 --- a/helpers/lh_losetup +++ b/helpers/lh_losetup @@ -38,7 +38,7 @@ FILE="${2}" PARTITION="${3:=1}" ${LH_ROOT_COMMAND} ${LH_LOSETUP} "${DEVICE}" "${FILE}" -FDISK_OUT="$(fdisk -l -u ${DEVICE} 2>&1)" +FDISK_OUT="$(LH_FDISK -l -u ${DEVICE} 2>&1)" ${LH_ROOT_COMMAND} ${LH_LOSETUP} -d "${DEVICE}" LOOPDEVICE="$(echo ${DEVICE}p${PARTITION})" -- cgit v1.0