Re: [patch] installer ufs initrd support (how to create a ufs filesystem as a normal user?)

2009-07-13 Thread Luca Favatella
On 07/07/2009, Luca Favatella slacky...@gmail.com wrote:
 On 07/07/2009, Thorsten Glaser t...@mirbsd.de wrote:
 Luca Favatella dixit:

This patch adds ufs initrd support.

 4.2FFS, UFS2, or both?

 In the attached second version of the patch, I explicated UFS2.

 UFS1 works too, but I chose to introduce only UFS2.
 (I'll use UFS2 in kfreebsd-i386 commit in next days/weeks.
 I think it is not good to add a feature and not use it.)
 See http://svn.debian.org/viewsvn/d-i?view=revrevision=59261

Committed in svn trunk.

Cheers,
Luca Favatella


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: [patch] installer ufs initrd support (how to create a ufs filesystem as a normal user?)

2009-07-07 Thread Luca Favatella
On 07/07/2009, Thorsten Glaser t...@mirbsd.de wrote:
 Luca Favatella dixit:

This patch adds ufs initrd support.

 4.2FFS, UFS2, or both?

In the attached second version of the patch, I explicated UFS2.

UFS1 works too, but I chose to introduce only UFS2.
(I'll use UFS2 in kfreebsd-i386 commit in next days/weeks.
I think it is not good to add a feature and not use it.)
See http://svn.debian.org/viewsvn/d-i?view=revrevision=59261


 I would very much like to be able to install Debian GNU/kFreeBSD on
 4.2FFS (aka UFS1) filesystems, not just UFS2.

This patch is only about initrd (a.k.a. mfsroot).
I think (I didn't test) you can already install Debian GNU/kFreeBSD on
UFS1 with current hacked sysinstall
(http://glibc-bsd.alioth.debian.org/doc/installing.html).


 bye,
 //mirabilos

Thanks,
Luca Favatella
Index: build/Makefile
===
--- build/Makefile	(.../trunk/installer)	(revision 59247)
+++ build/Makefile	(.../branches/d-i/kfreebsd/installer)	(revision 59256)
@@ -119,6 +119,18 @@
   (cd $(TREE)  find . | cpio --quiet -o -H newc)  
 endef
 
+define mkfs.ufs2
+  fs=`mktemp` ; \
+  dd if=/dev/zero of=$${fs} bs=1M count=16 ; \
+  md=`mdconfig -a -t vnode -f $${fs}` ; \
+  mkfs.ufs -O2 /dev/$${md} ; \
+  mnt=`mktemp -d` ; mount /dev/$${md} $${mnt} ; \
+  cp -a $(TREE)/* $${mnt}/ ; \
+  umount $${mnt} ; rmdir $${mnt} ; \
+  mdconfig -d -u $${md} ; \
+  mv $${fs}
+endef
+
 define e2fsck
   e2fsck -fy
 endef
@@ -610,6 +622,10 @@
 	jffs2) \
 		$(mkjffs2) $(TEMP_INITRD); \
 	;; \
+	ufs2) \
+		$(mkfs.ufs2) $(TEMP)/initrd; \
+		gzip -v9f $(TEMP)/initrd; \
+	;; \
 	*) \
 		echo Unsupported filesystem type; \
 		exit 1 ;; \
Index: debian/changelog
===
--- debian/changelog	(.../trunk/installer)	(revision 59247)
+++ debian/changelog	(.../branches/d-i/kfreebsd/installer)	(revision 59256)
@@ -76,6 +76,7 @@
 
   [ Luca Favatella ]
   * Handle libc0.1 (GNU/kFreeBSD) and libc0.3 (GNU/Hurd) as libc6/libc6.1.
+  * Add ufs2 initrd support. Thanks to Robert Millan.
 
  -- Frans Pop f...@debian.org  Sat, 13 Jun 2009 16:35:46 +0200
 


[patch] installer ufs initrd support (how to create a ufs filesystem as a normal user?)

2009-07-06 Thread Luca Favatella
This patch adds ufs initrd support.
It was in the previous d-i kfreebsd branch, so thanks to Robert Millan.

This code has the bad thing that mkfs.ufs must be executed as root,
and I don't know how to create a ufs filesystem on kfreebsd without
being root.
Comments on how to create a ufs filesystem as a normal user?


I use this on kfreebsd-i386.


Cheers,
Luca Favatella
Index: build/Makefile
===
--- build/Makefile	(.../trunk/installer)	(revision 59247)
+++ build/Makefile	(.../branches/d-i/kfreebsd/installer)	(revision 59256)
@@ -119,6 +119,18 @@
   (cd $(TREE)  find . | cpio --quiet -o -H newc)  
 endef
 
+define mkfs.ufs
+  fs=`mktemp` ; \
+  dd if=/dev/zero of=$${fs} bs=1M count=16 ; \
+  md=`mdconfig -a -t vnode -f $${fs}` ; \
+  mkfs.ufs /dev/$${md} ; \
+  mnt=`mktemp -d` ; mount /dev/$${md} $${mnt} ; \
+  cp -a $(TREE)/* $${mnt}/ ; \
+  umount $${mnt} ; rmdir $${mnt} ; \
+  mdconfig -d -u $${md} ; \
+  mv $${fs}
+endef
+
 define e2fsck
   e2fsck -fy
 endef
@@ -610,6 +622,10 @@
 	jffs2) \
 		$(mkjffs2) $(TEMP_INITRD); \
 	;; \
+	ufs) \
+		$(mkfs.ufs) $(TEMP)/initrd; \
+		gzip -v9f $(TEMP)/initrd; \
+	;; \
 	*) \
 		echo Unsupported filesystem type; \
 		exit 1 ;; \
Index: debian/changelog
===
--- debian/changelog	(.../trunk/installer)	(revision 59247)
+++ debian/changelog	(.../branches/d-i/kfreebsd/installer)	(revision 59256)
@@ -76,6 +76,7 @@
 
   [ Luca Favatella ]
   * Handle libc0.1 (GNU/kFreeBSD) and libc0.3 (GNU/Hurd) as libc6/libc6.1.
+  * Add ufs initrd support. Thanks to Robert Millan.
 
  -- Frans Pop f...@debian.org  Sat, 13 Jun 2009 16:35:46 +0200