[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#629533: marked as done (use mkfs.ext2/mkfs.ext3 instead of genext2fs)



Your message dated Sat, 11 Jun 2011 09:34:08 +0000
with message-id <E1QVKa0-000306-3f@franck.debian.org>
and subject line Bug#629533: fixed in live-build 3.0~a19-1
has caused the Debian Bug report #629533,
regarding use mkfs.ext2/mkfs.ext3 instead of genext2fs
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
629533: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629533
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: live-build
Version: 3.0~a18-1
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

genext2fs doesn't work very well with even moderately large filesystems.
It wants to allocate memory roughly equivalent to the size of the
filesystem it's creating.  On my 2GB test filesystem, it runs out of
memory even on my fairly well-provisioned laptop; on an ARM build
machine, I expect that using it would be thoroughly infeasible.

The attached patch converts live-build to use mkfs.ext2/mkfs.ext3
instead.

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]
>From 0d598fbff7f17f87a19450686c2e514ec03a4992 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Tue, 7 Jun 2011 14:46:25 +0100
Subject: [PATCH] Use mkfs.ext2/mkfs.ext2 instead of genext2fs.

---
 debian/control                 |    2 +-
 debian/live-build.bug-script   |    2 +-
 scripts/build/lb_binary_rootfs |   31 ++++++++++++++++++++++++-------
 scripts/build/lb_source_debian |    1 -
 4 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/debian/control b/debian/control
index 57d60e6..3d00d98 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 c0e56f0..0cf407a 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 417c381..70a6dc7 100755
--- a/scripts/build/lb_binary_rootfs
+++ b/scripts/build/lb_binary_rootfs
@@ -90,7 +90,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
@@ -106,21 +106,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}
@@ -177,7 +186,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 7964ccb..7566155 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
 
-- 
1.7.4.1


--- End Message ---
--- Begin Message ---
Source: live-build
Source-Version: 3.0~a19-1

We believe that the bug you reported is fixed in the latest version of
live-build, which is due to be installed in the Debian FTP archive:

live-build-cgi_3.0~a19-1_all.deb
  to main/l/live-build/live-build-cgi_3.0~a19-1_all.deb
live-build_3.0~a19-1.debian.tar.gz
  to main/l/live-build/live-build_3.0~a19-1.debian.tar.gz
live-build_3.0~a19-1.dsc
  to main/l/live-build/live-build_3.0~a19-1.dsc
live-build_3.0~a19-1_all.deb
  to main/l/live-build/live-build_3.0~a19-1_all.deb
live-build_3.0~a19.orig.tar.gz
  to main/l/live-build/live-build_3.0~a19.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 629533@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel@debian.org> (supplier of updated live-build package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 11 Jun 2011 11:04:08 +0200
Source: live-build
Binary: live-build live-build-cgi
Architecture: source all
Version: 3.0~a19-1
Distribution: unstable
Urgency: low
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Changed-By: Daniel Baumann <daniel@debian.org>
Description: 
 live-build - Debian Live - System Build Scripts
 live-build-cgi - Debian Live - System Build Scripts (cgi frontend)
Closes: 627887 629533
Changes: 
 live-build (3.0~a19-1) unstable; urgency=low
 .
   [ Richard Nelson ]
   * Update VERSION in common.sh to match last release.
 .
   [ Daniel Baumann ]
   * Updating packages in sun-java6 example hook.
   * Updating default kernel flavour for progress on i386.
   * Updating default kernel flavour for debian on i386.
 .
   [ Colin Watson ]
   * Use mkfs.ext2/mkfs.ext2 instead of genext2fs (Closes: #629533).
   * Make --initramfs none work more consistently (Closes: #627887).
 .
   [ Richard Nelson ]
   * Add progress as an option for --mode in lb_config manpage.
 .
   [ Daniel Baumann ]
   * Don't try to install standard task on anything but ubuntu.
Checksums-Sha1: 
 ccf03f7e4586afea384db05d7f2208bde501ecf0 1282 live-build_3.0~a19-1.dsc
 91c1e8d2af56c1fcf68657c7058b05f8376b04f0 1928667 live-build_3.0~a19.orig.tar.gz
 9277d1fa5b7f6a7d78907e46866c198f1429f4b1 41383 live-build_3.0~a19-1.debian.tar.gz
 d5dc7c5813c187053ef4ec62a8ac74d0b50755a7 1133090 live-build_3.0~a19-1_all.deb
 b39d330fa41e192c88818476e7250136b2e8b777 57680 live-build-cgi_3.0~a19-1_all.deb
Checksums-Sha256: 
 c64da2f3a9f83386441eb25947f94a976f14299ae66ab720b0f2afd94e4049a3 1282 live-build_3.0~a19-1.dsc
 5d5e70c149e0026d52472b528c561ab32f9dc95f71767bfc49fa7213a7205cd3 1928667 live-build_3.0~a19.orig.tar.gz
 00c80df1b19bb0191ce1601627086be7409d22af78c4c294f0876b1e21794c91 41383 live-build_3.0~a19-1.debian.tar.gz
 d2a7d797bc2d62f6e532462d7e34c80fd04425ff5de99add5b1bfce8695e1e12 1133090 live-build_3.0~a19-1_all.deb
 536666dbfff8ae3cec03ffcb212a92a5f86bda0c6378366478859d3fcbfb9fc5 57680 live-build-cgi_3.0~a19-1_all.deb
Files: 
 8988d6659648cfe480a3a0e2a87f1325 1282 misc optional live-build_3.0~a19-1.dsc
 4903bdc132a2b775dc10c333bbab49fe 1928667 misc optional live-build_3.0~a19.orig.tar.gz
 faad2867e8b05dd3f099c27e230089cb 41383 misc optional live-build_3.0~a19-1.debian.tar.gz
 cf4be2056af3493abce692df69222585 1133090 misc optional live-build_3.0~a19-1_all.deb
 e47e81665e70af490f08597911688a9c 57680 misc optional live-build-cgi_3.0~a19-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk3zMicACgkQ+C5cwEsrK54x/wCgqpHCLluvyJMJXGkae83Rxwah
3BAAn3pXlgNYaWfzMioH/uBUELkdufpw
=6nrM
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: