Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NBfBS-0007RC-80 for mharc-grub-devel@gnu.org; Fri, 20 Nov 2009 20:54:42 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBfBQ-0007QP-2j for grub-devel@gnu.org; Fri, 20 Nov 2009 20:54:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBfBL-0007OC-D9 for grub-devel@gnu.org; Fri, 20 Nov 2009 20:54:39 -0500 Received: from [199.232.76.173] (port=37543 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBfBL-0007O6-2r for grub-devel@gnu.org; Fri, 20 Nov 2009 20:54:35 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:43356 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBfBK-0007KC-7a for grub-devel@gnu.org; Fri, 20 Nov 2009 20:54:34 -0500 Received: from pinux (82-45-164-87.cable.ubr06.hari.blueyonder.co.uk [82.45.164.87]) by mail.pina.cat (Postfix) with ESMTP id A3EA0288FBA3F for ; Sat, 21 Nov 2009 02:54:31 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 304CCE774; Sat, 21 Nov 2009 01:54:36 +0000 (GMT) Date: Sat, 21 Nov 2009 01:54:36 +0000 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091121015436.GA16794@pina.cat> References: <20091119222257.GA1189@pina.cat> <20091120133620.GA5413@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20091120133620.GA5413@thorin> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: grub-mkrescue and hard links X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 01:54:40 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Nov/20/2009, Robert Millan wrote: > On Thu, Nov 19, 2009 at 10:22:57PM +0000, Carles Pina i Estany wrote: > > > > Hello, > > > > grub-mkrescue is trying to execute cp -dpRl (l for link). If the origin > > and destination directories are in different file systems this fails. > > One of the purposes of grub-mkrescue is to generate images that are > bootable using GRUB. These images might be complete CDs or DVDs, > making a complete copy very undesireable. I see... > I think I'd rather remove the copiing stage altogether and operate on > the original directory (this is not so strange, e.g. -boot-info-table > in mkisofs also modifies original data and is widely used). I'm not convinced about it, but I'm not familiar in these utilities either. Find attached a second patch that lets the user to specify where the utilities are. With this _and_ some manual things with the modules I've generated and ISO image that boots using qemu. Which approach do you have in mind for the modules? Which modules should be copied and where? (I see some modules inside the core img, I guess that this is what should be in the core image and then the modules that the user specifies in the option --modules should be copied into boot/grub/ (or in 386-pc?) or something by default?) Yes, I know that could be better done (avoid copying, more options, etc.) but I'm doing this to do some comfortable tests with qemu and gettext :-) If you tell what you wanted to do I can try to do tomorrow and carry on with other things. -- Carles Pina i Estany http://pinux.info --bg08WKrSYDhXBjb5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ChangeLog-grub-mkrescue.in.patch" 2009-11-21 Carles Pina i Estany * util/grub-mkrescue.in: copies the files instead of hard linking (removes option -l from cp) * adds the option --grub-utilities-directory to specify the directory of the grub utilities used by grub-mkrescue * adds the optoin --pc_dir to overwrite the detected by default * source from /boot/grub/grub.cfg to the specific by architecture --bg08WKrSYDhXBjb5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="grub-mkrescue.in.patch" === modified file 'util/grub-mkrescue.in' --- util/grub-mkrescue.in 2009-11-14 18:38:11 +0000 +++ util/grub-mkrescue.in 2009-11-21 01:37:30 +0000 @@ -30,19 +30,22 @@ coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-coreboot pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-pc -grub_mkisofs="grub-mkisofs" +grub_utilities_directory="" # by default, from $PATH # Usage: usage # Print the usage. usage () { cat <&2 usage @@ -92,6 +99,7 @@ # build coreboot core.img if test -e ${coreboot_dir} ; then + echo "Generates coreboot" memdisk_img=`mktemp` memdisk_dir=`mktemp -d` mkdir -p ${memdisk_dir}/boot/grub @@ -111,26 +119,28 @@ tar -C ${memdisk_dir} -cf ${memdisk_img} boot rm -rf ${memdisk_dir} - grub-mkelfimage -d ${coreboot_dir}/ -m ${memdisk_img} -o ${iso9660_dir}/boot/multiboot.img \ + ${grub_utilities_directory}grub-mkelfimage -d ${coreboot_dir}/ -m ${memdisk_img} -o ${iso9660_dir}/boot/multiboot.img \ memdisk tar search iso9660 configfile sh \ ata at_keyboard rm -f ${memdisk_img} - grub_mkisofs="${grub_mkisofs} --modification-date=$(echo ${iso_uuid} | sed -e s/-//g)" + grub_mkisofs_arguments="--modification-date=$(echo ${iso_uuid} | sed -e s/-//g)" fi if [ "${source}" != "" ] ; then for d in ${source}; do echo "Processing $d" - cp -dpRl "${d}" ${iso9660_dir}/ + cp -dpR "${d}" ${iso9660_dir}/ done fi # build eltorito core.img if test -e ${pc_dir} ; then + echo "Generates eltorito" core_img=`mktemp` - grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \ + ${grub_utilities_directory}grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \ memdisk tar search iso9660 configfile sh \ biosdisk + mkdir -p ${iso9660_dir}/boot/grub/i386-pc/ cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img rm -f ${core_img} @@ -138,14 +148,14 @@ (for i in ${modules} ; do echo "insmod $i" done ; \ - echo "source /boot/grub/grub.cfg") \ - > ${iso9660_dir}/boot/grub/i386-pc/grub.cfg + echo "source /boot/grub/i386-pc/grub.cfg") \ + > ${iso9660_dir}/boot/grub/grub.cfg - grub_mkisofs="${grub_mkisofs} -b boot/grub/i386-pc/eltorito.img -boot-info-table" + grub_mkisofs_arguments="-b boot/grub/i386-pc/eltorito.img -boot-info-table" fi # build iso image -${grub_mkisofs} -o ${output_image} -r -J ${iso9660_dir} +${grub_utilities_directory}grub-mkisofs ${grub_mkisofs_arguments} -o ${output_image} -r -J ${iso9660_dir} rm -rf ${iso9660_dir} exit 0 --bg08WKrSYDhXBjb5--