Author: alexander
Date: 2005-05-01 20:52:17 -0600 (Sun, 01 May 2005)
New Revision: 119

Added:
   branches/unionfs/initramfs/init
   branches/unionfs/packages/isoinfo/
   branches/unionfs/packages/isoinfo/Makefile
   branches/unionfs/packages/klibc/
   branches/unionfs/packages/klibc/Makefile
   branches/unionfs/packages/klibc/isoinfo-0.03.02-fixes-1.patch
   branches/unionfs/packages/klibc/util-linux-2.12q-klibc-1.patch
   branches/unionfs/packages/unionfs/
   branches/unionfs/packages/unionfs/Makefile
Modified:
   branches/unionfs/Makefile
   branches/unionfs/initramfs/Makefile
   branches/unionfs/packages/lfs-bootscripts/Makefile
   branches/unionfs/packages/util-linux/Makefile
Log:
Added unionfs and klibc

Modified: branches/unionfs/Makefile
===================================================================
--- branches/unionfs/Makefile   2005-05-02 02:32:23 UTC (rev 118)
+++ branches/unionfs/Makefile   2005-05-02 02:52:17 UTC (rev 119)
@@ -857,6 +857,10 @@
        make -C $(PKG)/$@ chroot
        make unmount
 
+klibc: prep-chroot
+       make -C $(PKG)/$@ chroot
+       make unmount
+
 strip: prep-chroot
        @chroot $(MP) $(chenvstrip) 'cd $(ROOT) && make ch-strip'
        make unmount
@@ -1348,6 +1352,12 @@
 ch-syslinux: popdev
        make -C $(PKG)/syslinux stage2
 
+ch-klibc: popdev
+       make -C $(PKG)/klibc stage2
+
+ch-unionfs: popdev
+       make -C $(PKG)/unionfs stage2
+
 ch-strip: popdev
        @$(WD)/bin/find /{,usr/}{bin,lib,sbin} -type f -exec $(WD)/bin/strip 
--strip-debug '{}' ';'
 
@@ -1355,7 +1365,7 @@
 # Rules to create the iso
 #----------------------------------
 
-prepiso:
+prepiso: unmount
        @-rm $(MP)/etc/rc.d/rc{2,3,5}.d/{K,S}21xprint
        @install -m644 etc/issue $(MP)/etc/issue
        @sed -i "s/Version:/Version: $(VERSION)/" $(MP)/etc/issue
@@ -1363,12 +1373,12 @@
        @-mv $(MP)/bin/uname.real $(MP)/bin/uname
        @-mkdir $(MP)/iso
        @-rm $(MP)/etc/X11/xorg.conf
-       @for i in bin boot etc lib sbin sources ; do cp -ra $(MP)/$$i $(MP)/iso 
; done && \
-        cd $(MP) && tar cjvf etc.tar.bz2 etc && cp etc.tar.bz2 iso/ && \
-        if [ -f root/.bash_history ] ; then rm root/.bash_history ; fi && \
-        tar cjvf root.tar.bz2 root && cp root.tar.bz2 iso/ && \
-        $(WD)/bin/mksquashfs usr usr.sqfs && mv usr.sqfs iso/ && \
-        echo "LFS-LIVECD" > iso/LFS
+       @cp -rav $(MP)/sources $(MP)/iso && \
+        cp -rav $(MP)/boot $(MP)/iso && \
+        rm -f iso/root.sqfs && \
+        $(WD)/bin/mksquashfs $(MP) $(MP)/iso/root.sqfs -info -e \
+        boot sources tools iso lfs-livecd lost+found && \
+        echo "LFS-LIVECD" > $(MP)/iso/LFS
        @touch prepiso
 
 iso: prepiso

Modified: branches/unionfs/initramfs/Makefile
===================================================================
--- branches/unionfs/initramfs/Makefile 2005-05-02 02:32:23 UTC (rev 118)
+++ branches/unionfs/initramfs/Makefile 2005-05-02 02:52:17 UTC (rev 119)
@@ -2,14 +2,20 @@
 # Written by Jeremy Huntwork, 2004-12-16
 #
 
-CFLAGS = -Os -s -Wall -static
-CC = gcc
-all: init
+all: initramfs_data.cpio.gz
 MK= mknod
+CP= cp
 WD= temp
+KLIBC= /usr/lib/klibc
 
-init: init.c
-       mkdir -p $(WD)/dev
+initramfs_data.cpio.gz: init
+       @make -C .. ch-klibc
+       @make -C .. ch-unionfs
+       mkdir -p $(WD)/{dev,bin,lib,.cdrom,.sqfs,.tmpfs,.union}
+       $(CP) $(KLIBC)/bin/{insmod,isoinfo,losetup,mount,run-init,sh,sleep} 
$(WD)/bin
+       $(CP) $(KLIBC)/lib/klibc-*.so $(WD)/lib
+       $(CP) /lib/modules/$(KVERS)/kernel/fs/unionfs.ko $(WD)/lib
+       $(CP) init $(WD)
        $(MK) -m 640 $(WD)/dev/console c 5 1
        $(MK) -m 660 $(WD)/dev/hda b 3 0
        $(MK) -m 660 $(WD)/dev/hdb b 3 64
@@ -28,11 +34,10 @@
        $(MK) -m 660 $(WD)/dev/sr5 b 11 5
        $(MK) -m 660 $(WD)/dev/sr6 b 11 6
        $(MK) -m 660 $(WD)/dev/sr7 b 11 7
-       $(CC) $(CFLAGS) $? -o $(WD)/$@
+       $(MK) -m 660 $(WD)/dev/loop0 b 7 0
        cd $(WD); find . | cpio -o -H newc | gzip -9 > ../initramfs_data.cpio.gz
        rm -rf temp
 
 clean:
-       -rm -f init
        -rm -rf temp
        -rm -f initramfs_data*

Added: branches/unionfs/initramfs/init
===================================================================
--- branches/unionfs/initramfs/init     2005-05-02 02:32:23 UTC (rev 118)
+++ branches/unionfs/initramfs/init     2005-05-02 02:52:17 UTC (rev 119)
@@ -0,0 +1,23 @@
+#!/bin/sh
+LABEL="LFS_CD"
+DEVS=`echo /dev/hd* /dev/scd*`
+
+sleep 5
+
+for DEV in $DEVS ; do
+       if [ "`isoinfo -V $DEV 2>/dev/null`" = "$LABEL" ] ; then
+               CDROM=$DEV
+       fi
+done
+
+[ -z "$CDROM" ] && exit 1
+
+echo "CD-ROM is $CDROM"
+
+mount -w -t tmpfs -o size=90%,mode=755 tmpfs /.tmpfs
+mount -r -t iso9660 $CDROM /.cdrom
+losetup /dev/loop0 /.cdrom/root.sqfs
+mount -r -t squashfs /dev/loop0 /.sqfs
+insmod /lib/unionfs.ko
+mount -w -t unionfs -o dirs=/.tmpfs=rw:/.cdrom=ro:/.sqfs=ro unionfs /.union
+exec run-init /.union /sbin/init


Property changes on: branches/unionfs/initramfs/init
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/unionfs/packages/isoinfo/Makefile
===================================================================
--- branches/unionfs/packages/isoinfo/Makefile  2005-05-02 02:32:23 UTC (rev 
118)
+++ branches/unionfs/packages/isoinfo/Makefile  2005-05-02 02:52:17 UTC (rev 
119)
@@ -0,0 +1,29 @@
+# isoinfo Makefile
+
+# Package versions
+NM= isoinfo
+VRS= 0.03.02
+DIR= $(NM)-$(VRS)
+FILE= $(DIR).tar.gz
+URL= ftp://metalab.unc.edu/pub/Linux/utils/disk-management/$(FILE)
+
+#RULES
+
+.PHONY: clean chroot klibc-isoinfo
+
+chroot:
+       @chroot "$(MP)" $(chenv3) 'cd $(ROOT) && make ch-$(NM) $(chbash2)'
+
+klibc-isoinfo:
+       @echo ""
+       @echo "=====> Building $(NM) in chroot"
+       @echo ""
+       @if [ ! -f $(FILE) ] ; then $(WGET) $(URL) ; fi
+       @if [ ! -f /usr/lib/klibc/bin/isoinfo ] ; then tar -xzvf $(FILE) && cd 
$(DIR) && \
+        patch -Np1 -i ../../klibc/$(NM)-$(VRS)-fixes-1.patch && \
+        make CC="klcc -shared" -f Makefile.Linux isoinfo && \
+        install isoinfo /usr/lib/klibc/bin ; fi
+       @make clean
+
+clean:
+       @-rm -rf $(DIR)

Added: branches/unionfs/packages/klibc/Makefile
===================================================================
--- branches/unionfs/packages/klibc/Makefile    2005-05-02 02:32:23 UTC (rev 
118)
+++ branches/unionfs/packages/klibc/Makefile    2005-05-02 02:52:17 UTC (rev 
119)
@@ -0,0 +1,31 @@
+# Klibc Makefile
+
+# Package versions
+NM= klibc
+VRS= 1.0
+DIR= $(NM)-$(VRS)
+FILE= $(DIR).tar.bz2
+URL= http://www.kernel.org/pub/linux/libs/$(NM)/$(FILE)
+
+# RULES
+
+.PHONY: clean chroot stage2
+
+chroot:
+       @chroot "$(MP)" $(chenv3) 'cd $(ROOT) && make ch-$(NM) $(chbash2)'
+
+stage2:
+       @echo ""
+       @echo "=====> Building $(NM) in chroot"
+       @echo ""
+       @if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
+        mv $(FILE) $(SRC) ; fi
+       @if [ ! -d /usr/lib/klibc ] ; then tar xjvf $(SRC)/$(FILE) && cd $(DIR) 
&& \
+        ln -nsf ../../linux/linux-$(KVERS) linux && make && make install && \
+        make -C ../../util-linux klibc-losetup && \
+        make -C ../../isoinfo klibc-isoinfo ; fi
+       @make clean
+       
+
+clean:
+       @-rm -rf $(DIR)

Added: branches/unionfs/packages/klibc/isoinfo-0.03.02-fixes-1.patch
===================================================================
--- branches/unionfs/packages/klibc/isoinfo-0.03.02-fixes-1.patch       
2005-05-02 02:32:23 UTC (rev 118)
+++ branches/unionfs/packages/klibc/isoinfo-0.03.02-fixes-1.patch       
2005-05-02 02:52:17 UTC (rev 119)
@@ -0,0 +1,57 @@
+diff -urN isoinfo-0.03.02/isoinfo.c isoinfo-0.03.02.fixed/isoinfo.c
+--- isoinfo-0.03.02/isoinfo.c  2002-10-13 03:28:17.000000000 +0600
++++ isoinfo-0.03.02.fixed/isoinfo.c    2005-04-22 13:31:33.000000000 +0600
+@@ -103,7 +103,7 @@
+ iso_str( char* p, int n ) {
+   static char string[256];
+   int i= 0;
+-  while( i < n ) string[i]= p[i++];
++  while( i < n ) { string[i]= p[i]; i++;}
+   string[i--]= '\0';
+   while( string[i] == ' ' ) string[i--]= '\0';
+   return( string );
+@@ -340,7 +340,7 @@
+   if( in_fd != STDIN_FILENO ) {
+     if( (in_fd=open(in_fn,O_RDONLY)) == -1 ) {
+       fprintf( ERROR_CHANNEL, "%s: Cannot open `%s'. %s.\n",
+-               pn, in_fn, sys_errlist[errno] );
++               pn, in_fn, strerror(errno) );
+       retval= RETVAL_ERROR; goto DIE_NOW;
+     }
+   }
+@@ -354,12 +354,12 @@
+     if( in_fd != STDIN_FILENO ) { /* we can lseek() */
+       if( lseek(in_fd,blk_to_read*ISO_BLOCK_SIZE,SEEK_SET) == -1 ) {
+         fprintf( ERROR_CHANNEL, "%s: Cannot lseek `%s'. %s.\n",
+-                 pn, in_fn, sys_errlist[errno] );
++                 pn, in_fn, strerror(errno) );
+         retval= RETVAL_ERROR; goto DIE_NOW;
+       }
+       if( (nbr=my_read(in_fd,buf,ISO_BLOCK_SIZE)) == -1 ) {
+         fprintf( ERROR_CHANNEL, "%s: Cannot read block %ld of `%s'. %s.\n",
+-                 pn, blk, in_fn, sys_errlist[errno] );
++                 pn, blk, in_fn, strerror(errno) );
+         retval= RETVAL_ERROR; goto DIE_NOW;
+       }
+       blk= blk_to_read;
+@@ -411,7 +411,7 @@
+ 
+   if( close(in_fd) == -1 ) {
+     fprintf( ERROR_CHANNEL, "%s: Cannot close `%s'. %s.\n",
+-             pn, in_fn, sys_errlist[errno] );
++             pn, in_fn, strerror(errno) );
+     retval= RETVAL_ERROR; goto DIE_NOW;
+   }
+ 
+diff -urN isoinfo-0.03.02/isoinfo.h isoinfo-0.03.02.fixed/isoinfo.h
+--- isoinfo-0.03.02/isoinfo.h  2002-10-13 03:28:17.000000000 +0600
++++ isoinfo-0.03.02.fixed/isoinfo.h    2005-04-22 11:00:53.000000000 +0600
+@@ -5,7 +5,7 @@
+ #undef        DEBUG
+ 
+ #include <stdio.h>            /* printf() */
+-#include <getopt.h>           /* getopt() */
++/*#include <getopt.h> */      /* getopt() */
+ #include <errno.h>            /* error numbers */
+ #include <unistd.h>           /* read(), write(), close(), STDIN_FILENO */
+ #include <sys/types.h>                /* open() */

Added: branches/unionfs/packages/klibc/util-linux-2.12q-klibc-1.patch
===================================================================
--- branches/unionfs/packages/klibc/util-linux-2.12q-klibc-1.patch      
2005-05-02 02:32:23 UTC (rev 118)
+++ branches/unionfs/packages/klibc/util-linux-2.12q-klibc-1.patch      
2005-05-02 02:52:17 UTC (rev 119)
@@ -0,0 +1,54 @@
+diff -urN util-linux-2.12q.orig/lib/getpass.c util-linux-2.12q/lib/getpass.c
+--- util-linux-2.12q.orig/lib/getpass.c        1970-01-01 05:00:00.000000000 
+0500
++++ util-linux-2.12q/lib/getpass.c     2005-04-22 13:57:34.000000000 +0600
+@@ -0,0 +1,7 @@
++#include <stdio.h>
++
++const char *getpass(const char *prompt)
++{
++      fprintf(stderr, "This version of losetup doesn't support passwords.\n");
++      return "";      
++}
+diff -urN util-linux-2.12q.orig/mount/lomount.c 
util-linux-2.12q/mount/lomount.c
+--- util-linux-2.12q.orig/mount/lomount.c      2004-12-21 03:11:04.000000000 
+0500
++++ util-linux-2.12q/mount/lomount.c   2005-04-22 13:39:50.000000000 +0600
+@@ -395,7 +395,6 @@
+ 
+ #ifdef LOOP_SET_FD
+ 
+-#include <getopt.h>
+ #include <stdarg.h>
+ 
+ int verbose = 0;
+@@ -448,10 +447,6 @@
+       int pfd = -1;
+       unsigned long long off;
+ 
+-      setlocale(LC_ALL, "");
+-      bindtextdomain(PACKAGE, LOCALEDIR);
+-      textdomain(PACKAGE);
+-
+       delete = find = 0;
+       off = 0;
+       offset = encryption = passfd = NULL;
+diff -urN util-linux-2.12q.orig/mount/Makefile util-linux-2.12q/mount/Makefile
+--- util-linux-2.12q.orig/mount/Makefile       2004-12-22 14:32:08.000000000 
+0500
++++ util-linux-2.12q/mount/Makefile    2005-04-22 13:51:59.000000000 +0600
+@@ -29,7 +29,7 @@
+ 
+ MAYBE = pivot_root swapoff
+ 
+-LO_OBJS = lomount.o $(LIB)/xstrncpy.o
++LO_OBJS = lomount.o $(LIB)/xstrncpy.o $(LIB)/getpass.o
+ NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
+ GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
+ 
+@@ -64,7 +64,7 @@
+ main_losetup.o: lomount.c
+       $(COMPILE) -DMAIN lomount.c -o $@
+ 
+-losetup: main_losetup.o $(LIB)/xstrncpy.o
++losetup: main_losetup.o $(LIB)/xstrncpy.o $(LIB)/getpass.o
+       $(LINK) $^ -o $@
+ 
+ mount.o umount.o nfsmount.o losetup.o fstab.o realpath.o sundries.o: 
sundries.h

Modified: branches/unionfs/packages/lfs-bootscripts/Makefile
===================================================================
--- branches/unionfs/packages/lfs-bootscripts/Makefile  2005-05-02 02:32:23 UTC 
(rev 118)
+++ branches/unionfs/packages/lfs-bootscripts/Makefile  2005-05-02 02:52:17 UTC 
(rev 119)
@@ -21,8 +21,12 @@
        @echo ""
        @if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
         mv $(FILE) $(SRC) ; fi
-       @if [ ! -f /etc/rc.d/init.d/mountsqfs ] ; then tar xjvf ${SRC}/${FILE} 
&& \
-        cd ${DIR} && make install-livecd ; fi
+       @if [ ! -f /etc/rc.d/init.d/functions ] ; then tar xjvf ${SRC}/${FILE} 
&& \
+        cd ${DIR} && make install-livecd && \
+        install -m 755 lfs/init.d/{mountkernfs,udev} /etc/rc.d/init.d && \
+        ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernks && \
+        ln -sf ../init.d/udev /etc/rc.d/rcsysinit.d/S10udev && \
+        rm -f /etc/rc.d/*/*mountsqfs /etc/rc.d/*/*startup ; fi
 
 clean:
        @-rm -rf bootscripts

Added: branches/unionfs/packages/unionfs/Makefile
===================================================================
--- branches/unionfs/packages/unionfs/Makefile  2005-05-02 02:32:23 UTC (rev 
118)
+++ branches/unionfs/packages/unionfs/Makefile  2005-05-02 02:52:17 UTC (rev 
119)
@@ -0,0 +1,31 @@
+# Unionfs Makefile
+
+# Package versions
+NM= unionfs
+VRS= 1.0.11
+DIR= $(NM)-$(VRS)
+FILE= $(DIR).tar.gz
+URL= ftp://ftp.fsl.cs.sunysb.edu/pub/$(NM)/$(FILE)
+
+# RULES
+
+.PHONY: clean chroot stage2
+
+chroot:
+       @chroot "$(MP)" $(chenv3) 'cd $(ROOT) && make ch-$(NM) $(chbash2)'
+
+stage2:
+       @echo ""
+       @echo "=====> Building $(NM) in chroot"
+       @echo ""
+       @if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
+        mv $(FILE) $(SRC) ; fi
+       @if [ ! -f /usr/sbin/unionctl ] ; then tar xzvf $(SRC)/$(FILE) && cd 
$(DIR) && \
+        make KVERS=$(KVERS) PREFIX=/usr EXTRACFLAGS=-DNODEBUG && \
+        make KVERS=$(KVERS) PREFIX=/usr EXTRACFLAGS=-DNODEBUG install && \
+        strip --strip-debug /lib/modules/$(KVERS)/kernel/fs/unionfs.ko ; fi
+       @make clean
+       
+
+clean:
+       @-rm -rf $(DIR)

Modified: branches/unionfs/packages/util-linux/Makefile
===================================================================
--- branches/unionfs/packages/util-linux/Makefile       2005-05-02 02:32:23 UTC 
(rev 118)
+++ branches/unionfs/packages/util-linux/Makefile       2005-05-02 02:52:17 UTC 
(rev 119)
@@ -11,7 +11,7 @@
 
 # RULES
 
-.PHONY: stage1 clean chroot stage2
+.PHONY: stage1 clean chroot stage2 klibc-losetup
 
 stage1:
        @echo ""
@@ -43,6 +43,15 @@
         make HAVE_KILL=yes HAVE_SLN=yes install ; fi
        @make clean
        
-
+klibc-losetup:
+       @echo ""
+       @echo "=====> Building losetup with klibc"
+       @echo ""
+       @if [ ! -f /usr/lib/klibc/bin/losetup ] ; then tar xjvf $(SRC)/$(FILE) 
&& cd $(DIR) && \
+        patch -Np1 -i ../../klibc/util-linux-2.12q-klibc-1.patch && \
+        CC="klcc" LDFLAGS="-shared" ./configure && \
+        make lib/xstrncpy.o lib/getpass.o && make -C mount losetup && \
+        strip -s mount/losetup && install mount/losetup /usr/lib/klibc/bin ; fi
+       @make clean
 clean:
        @-rm -rf $(DIR)

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to