summaryrefslogtreecommitdiff
path: root/helpers/lh_binary_rootfs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:51 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:29 +0100
commit8a4a50fdb6b206fbff62fd3043ed388f25a0ffb1 (patch)
tree621dc56a00a65ab0eb1fd4e7d42ad4e45d718741 /helpers/lh_binary_rootfs
parent4739146fc6c4de8b16418517bb882312c475195c (diff)
downloadlive-build-8a4a50fdb6b206fbff62fd3043ed388f25a0ffb1.zip
live-build-8a4a50fdb6b206fbff62fd3043ed388f25a0ffb1.tar.gz
Adding live-helper 1.0~a7-1.
Diffstat (limited to 'helpers/lh_binary_rootfs')
-rwxr-xr-xhelpers/lh_binary_rootfs89
1 files changed, 28 insertions, 61 deletions
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs
index daacaea..12ac0bb 100755
--- a/helpers/lh_binary_rootfs
+++ b/helpers/lh_binary_rootfs
@@ -54,24 +54,11 @@ fi
case "${LIVE_FILESYSTEM}" in
ext2)
- if [ ! -f chroot/usr/bin/genext2fs ]
- then
- PACKAGES="${PACKAGES} genext2fs"
- fi
+ # Checking depends
+ Check_package chroot/usr/bin/genext2fs genext2fs
- 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 ext2 image
if [ -f binary/casper/filesystem.ext2 ]
@@ -88,19 +75,8 @@ case "${LIVE_FILESYSTEM}" in
mv chroot/filesystem.ext2 binary/casper
rm -rf chroot/chroot
- # Removing packages
- if [ -n "${PACKAGES}" ]
- then
- 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
;;
plain)
@@ -113,56 +89,47 @@ case "${LIVE_FILESYSTEM}" in
;;
squashfs)
- if [ ! -f chroot/usr/sbin/mksquashfs ]
+ # Checking depends
+ Check_package chroot/usr/sbin/mksquashfs squashfs-tools
+
+ # Installing depends
+ Install_package
+
+ # Remove old squashfs image
+ if [ -f binary/casper/filesystem.squashfs ]
then
- PACKAGES="${PACKAGES} squashfs-tools"
+ rm -f binary/casper/filesystem.squashfs
fi
- if [ -n "${PACKAGES}" ]
+ if [ "${LH_QUIET}" = "enabled" ]
then
- # Installing packages
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get install --yes ${PACKAGES}"
- ;;
-
- aptitude)
- Chroot "aptitude install --assume-yes ${PACKAGES}"
- ;;
- esac
+ MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -no-progress"
fi
- # Remove old squashfs image
- if [ -f binary/casper/filesystem.squashfs ]
+ if [ "${LH_VERBOSE}" = "enabled" ]
then
- rm -f binary/casper/filesystem.squashfs
+ MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -i"
fi
# Create image
if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ]
then
- Chroot "mksquashfs chroot filesystem.squashfs"
+ Chroot "mksquashfs ${MKSQUASHFS_OPTIONS} chroot filesystem.squashfs"
else
- Chroot "mksquashfs chroot filesystem.squashfs -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*"
+ Chroot "mksquashfs ${MKSQUASHFS_OPTIONS} chroot filesystem.squashfs -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*"
fi
# Move image
- mv chroot/filesystem.squashfs binary/casper
- rm -rf chroot/chroot
+ ${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/casper
+ ${LH_ROOT_COMMAND} rm -rf chroot/chroot
- # Removing packages
- if [ -n "${PACKAGES}" ]
+ if [ -n "${LH_ROOT_COMMAND}" ]
then
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get remove --purge --yes ${PACKAGES}"
- ;;
-
- aptitude)
- Chroot "aptitude purge --assume-yes ${PACKAGES}"
- ;;
- esac
+ ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` binary/casper
fi
+
+ # Removing depends
+ Remove_package
;;
esac