diff options
Diffstat (limited to 'helpers/lh_source_usb')
-rwxr-xr-x | helpers/lh_source_usb | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/helpers/lh_source_usb b/helpers/lh_source_usb index 178a558..91207de 100755 --- a/helpers/lh_source_usb +++ b/helpers/lh_source_usb @@ -54,29 +54,12 @@ do # Creating lock file Create_lockfile .lock - if [ ! -f chroot/sbin/mkdosfs ] - then - PACKAGES="${PACKAGES} dosfstools" - fi + # Checking depends + Check_package chroot/sbin/mkdosfs dosfstools + Check_package chroot/sbin/parted parted - if [ ! -f chroot/sbin/parted ] - then - PACKAGES="${PACKAGES} parted" - fi - - if [ -n "${PACKAGES}" ] - then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi + # Installing depends + Install_package # Remove old source if [ -f source.img ] @@ -107,9 +90,9 @@ do lh_losetup $FREELO source.img 1 Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}" mkdir -p source.tmp - mount ${FREELO} source.tmp + ${LH_ROOT_COMMAND} mount ${FREELO} source.tmp cp -r source/* source.tmp - umount source.tmp + ${LH_ROOT_COMMAND} umount source.tmp rmdir source.tmp ${LH_LOSETUP} -d ${FREELO} echo "!!! The above error/warning messages can be ignored !!!" @@ -120,19 +103,8 @@ do mv chroot/dev.tmp chroot/dev fi - if [ -n "${PACKAGES}" ] - then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Removing depends + Remove_package # Creating stage file Create_stagefile .stage/source_usb |