summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2011-06-08 10:02:10 +0200
committerDaniel Baumann <daniel@debian.org>2011-06-08 10:02:10 +0200
commit8b05781dbcb27847b5f3afb432d48f8486d79b57 (patch)
tree6c0345ba790b2c15243111624f09f49f10654248
parenta951e84c4f8da02edd20c7a36656f37b59bc1898 (diff)
downloadvyos-live-build-8b05781dbcb27847b5f3afb432d48f8486d79b57.tar.gz
vyos-live-build-8b05781dbcb27847b5f3afb432d48f8486d79b57.zip
Use mkfs.ext2/mkfs.ext2 instead of genext2fs (Closes: #629533).
-rw-r--r--debian/control2
-rw-r--r--debian/live-build.bug-script2
-rwxr-xr-xscripts/build/lb_binary_rootfs31
-rwxr-xr-xscripts/build/lb_source_debian1
4 files changed, 26 insertions, 10 deletions
diff --git a/debian/control b/debian/control
index 57d60e670..3d00d98f9 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Depends: ${misc:Depends}, debootstrap | cdebootstrap | cdebootstrap-static
Recommends: cpio, gettext-base, gnu-fdisk
Suggests:
dosfstools, genisoimage, memtest86+ | memtest86, mtools, parted,
- squashfs-tools | genext2fs | mtd-tools, sudo | fakeroot, syslinux | grub,
+ squashfs-tools | mtd-tools, sudo | fakeroot, syslinux | grub,
uuid-runtime, win32-loader
Description: Debian Live - System Build Scripts
live-build contains the scripts that build a Debian Live system image from a
diff --git a/debian/live-build.bug-script b/debian/live-build.bug-script
index c0e56f044..0cf407a91 100644
--- a/debian/live-build.bug-script
+++ b/debian/live-build.bug-script
@@ -6,7 +6,7 @@ DEFAULT_SETTINGS="/etc/live/build.conf"
dpkg -l debootstrap cdebootstrap
# Checking suggests
-dpkg -l dosfstools genisoimage memtest86+ memtest86 mtools parted squashfs-tools genext2fs mtd-tools sudo fakeroot syslinux grub uuid-runtime win32-loader
+dpkg -l dosfstools genisoimage memtest86+ memtest86 mtools parted squashfs-tools mtd-tools sudo fakeroot syslinux grub uuid-runtime win32-loader
if [ -e "${DEFAULT_SETTINGS}" ]; then
echo "Contents of ${DEFAULT_SETTINGS}:"
diff --git a/scripts/build/lb_binary_rootfs b/scripts/build/lb_binary_rootfs
index 85785fc7e..f2993f1af 100755
--- a/scripts/build/lb_binary_rootfs
+++ b/scripts/build/lb_binary_rootfs
@@ -86,7 +86,7 @@ done
case "${LB_CHROOT_FILESYSTEM}" in
ext2|ext3)
# Checking depends
- Check_package chroot/usr/bin/genext2fs genext2fs
+ Check_package chroot/sbin/mkfs.ext2 e2fsprogs
# Restoring cache
Restore_cache cache/packages_binary
@@ -102,21 +102,30 @@ case "${LB_CHROOT_FILESYSTEM}" in
case "${LB_BUILD_WITH_CHROOT}" in
true)
- DU_DIM="$(du -ks chroot/chroot | cut -f1)"
+ DU_DIM="$(du -ms chroot/chroot | cut -f1)"
+ INODES="$(find chroot/chroot | wc -l)"
;;
false)
- DU_DIM="$(du -ks chroot | cut -f1)"
+ DU_DIM="$(du -ms chroot | cut -f1)"
+ INODES="$(find chroot | wc -l)"
;;
esac
REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LB_CHROOT_FILESYSTEM})"
-
- RESERVED_PERCENTAGE="--reserved-percentage"
+ REAL_INODES="$(Calculate_partition_size ${INODES} ${LB_CHROOT_FILESYSTEM})"
case "${LB_BUILD_WITH_CHROOT}" in
true)
- Chroot chroot "genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot filesystem.${LB_CHROOT_FILESYSTEM}"
+ dd if=/dev/zero of=chroot/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+ Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
+
+ mkdir -p filesystem.tmp
+ ${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+ cp -a chroot/chroot/* filesystem.tmp
+
+ ${LB_ROOT_COMMAND} umount filesystem.tmp
+ rmdir filesystem.tmp
# Move image
mv chroot/filesystem.${LB_CHROOT_FILESYSTEM} binary/${INITFS}
@@ -173,7 +182,15 @@ case "${LB_CHROOT_FILESYSTEM}" in
;;
false)
- genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
+ dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+ mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
+
+ mkdir -p filesystem.tmp
+ ${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+ cp -a chroot/* filesystem.tmp
+
+ ${LB_ROOT_COMMAND} umount filesystem.tmp
+ rmdir filesystem.tmp
;;
esac
diff --git a/scripts/build/lb_source_debian b/scripts/build/lb_source_debian
index 7964ccbb4..75661556a 100755
--- a/scripts/build/lb_source_debian
+++ b/scripts/build/lb_source_debian
@@ -61,7 +61,6 @@ dosfstools
genisoimage
parted
squashfs-tools
-genext2fs
mtd-tools
EOF