--For more information------------------- https://youtu.be/FaUYL6x1XV8 svn checkout svn://svn.code.sf.net/p/unattended/code/trunk unattended-code svnrdump dump svn://svn.code.sf.net/p/unattended/code/trunk > unattended-trunk.bak --for bzImage & initrd-------------------- 1 modify initrd{ --------------------------------- you can unpack the initrd image by (yes, you need cpio twice): cat initrd | (cpio -i -d -m ; cpio -i -d -m) To create a new image use: find . | cpio -o -H newc -O initrd ---------------------------------e.g. find . | cpio -o -H newc -O initrd-new.img gzip -9 initrd-new.img rm -f ../initrd-new.img.gz mv ./initrd-new.img.gz ../ find . | cpio -o -H newc -O ../initrd-new.img } 2 compile bzImage & initrd{ --get package for ready(to /var/tmp)---------------------------- usbutils-006.tar.bz2 fuse-2.9.3.tar.gz --check out make file------------------------------- svn co http://nas-e5-dd-10/svn/unattended-code/unattended --do compile---------------------------------------- cd unattended/linuxboot make download make --output-------------------------------------------- unattended/linuxboot/tftpboot/bzImage unattended/linuxboot/tftpboot/initrd --scp output-------------------------------------------- scp tftpboot/bzImage root@CentOs68x64_server:/tftpboot/vmlinuz/unattended scp tftpboot/initrd root@CentOs68x64_server:/tftpboot/vmlinuz/unattended gzip -9 initrd ##scp tftpboot/bzImage root@192.168.1.240:/tftpboot/vmlinuz/unattended/ ##scp tftpboot/initrd root@192.168.1.240:/tftpboot/vmlinuz/unattended/ --error list------------------------------------------ glibc-static{ gcc -m32 -g -O2 -Wunused -Wall -o modinfo modinfo.o zlibsupport.o libmodtools.a gcc -m32 -g -O2 -Wunused -Wall -static -o insmod.static insmod.o libmodtools.a /usr/bin/ld: cannot find -lc collect2: ld returned 1 exit status make[2]: *** [insmod.static] Error 1 make[2]: Leaving directory `/home/jin/source/unattended/linuxboot/module-init-tools-3.15/build' make[1]: *** [all-all] Error 2 make[1]: Leaving directory `/home/jin/source/unattended/linuxboot/module-init-tools-3.15' make: *** [module-init-tools-3.15/build/depmod] Error 2 ---------------------------------------------------- { svn diff -r 266:267 dhcp_tftp_setup/ftp/arm-kickstart/CentOs6.7_i386-server_anaconda-ks.cfg { +glibc-static } ---------------------------------------------------- yum -y install glibc-static } } glibc-2.13{ ../sysdeps/i386/fpu/s_frexp.S: Assembler messages: ../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef" ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.' ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' ../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive ../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if" ../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression make[3]: *** [/home/jin/source/unattended/linuxboot/build-glibc-2.13/math/s_frexp.os] Error 1 make[3]: Leaving directory `/home/jin/source/unattended/linuxboot/glibc-2.13/math' make[2]: *** [math/subdir_lib] Error 2 make[2]: Leaving directory `/home/jin/source/unattended/linuxboot/glibc-2.13' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/jin/source/unattended/linuxboot/build-glibc-2.13' make: *** [build-glibc-2.13/libc.so] Error 2 ---------------------------------------------------- { svn diff -r 8:9 http://nas-e5-dd-10/svn/unattended-code/unattended { Index: Makefile =================================================================== --- Makefile (revision 8) +++ Makefile (revision 9) @@ -313,10 +313,15 @@ sed -ie "s| gcc -E | $(CC) -E |" $(glibc)/locale/gen-translit.pl touch $@ +$(glibc)/.stamp-glibc-gen-213-patch: patch/glibc-2.13.diff + cd $(cwd) && patch -p0 < $(cwd)/$< + touch $@ + ## glibc # Configure switches cheerfully stolen from LFS project # (http://www.linuxfromscratch.org/lfs/view/development/chapter05/glibc.html). build-$(glibc)/libc.so: $(linux)/arch/x86/boot/bzImage \ + $(glibc)/.stamp-glibc-gen-213-patch \ $(glibc)/.stamp-glibc-gen-translit.pl-patch mkdir -p build-$(glibc) cd build-$(glibc) && CC="$(CC)" CFLAGS="-O2 -U_FORTIFY_SOURCE -fno-stack-protector $(CFLAGS)" \ Index: patch/glibc-2.13.diff =================================================================== --- patch/glibc-2.13.diff (revision 0) +++ patch/glibc-2.13.diff (revision 9) @@ -0,0 +1,31 @@ +Index: glibc-2.13/sysdeps/unix/sysv/linux/i386/sysdep.h +=================================================================== +--- glibc-2.13/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1) ++++ glibc-2.13/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h +Index: glibc-2.13/nptl/sysdeps/pthread/pt-initfini.c +=================================================================== +--- glibc-2.13/nptl/sysdeps/pthread/pt-initfini.c (revision 1) ++++ glibc-2.13/nptl/sysdeps/pthread/pt-initfini.c (working copy) +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + } ---------------------------------------------------- } } libm.so{ /usr/lib/gcc/i686-redhat-linux/4.4.7/../../../libm.so: undefined reference to `__get_cpu_features@GLIBC_PRIVATE' collect2: ld returned 1 exit status make[1]: *** [busybox_unstripped] Error 1 make[1]: Leaving directory `/home/jin/source/unattended/linuxboot/busybox-1.16.2' make: *** [busybox-1.16.2/busybox] Error 2 ---------------------------------------------------- { svn diff -r 8:9 http://nas-e5-dd-10/svn/unattended-code/unattended { Index: Makefile =================================================================== --- Makefile (revision 8) +++ Makefile (revision 9) @@ -357,6 +362,7 @@ # against our just-built libraries instead of the system libraries. #FIXME: Should include -nostdinc here fakelib_cflags=-isystem $(cwd)/fakeinclude -L$(cwd)/fakelib -L$(cwd)/stage1/lib \ + -L$(cwd)/build-$(glibc)/math \ -L$(cwd)/stage1/usr/lib -Wl,-rpath-link,$(cwd)/stage1/lib # Create empty config file to silence ldconfig warnings } ---------------------------------------------------- } } libntfs-3g{ checking whether to include support for ntfs-3g... yes checking for LIBNTFS_3G... no configure: error: Cannot find libntfs-3g version 2011-4-12 or later! Without libntfs-3g, wimlib cannot include support for capturing or applying a WIM image directly from/to an unmounted NTFS volume while preserving NTFS-specific data such as security descriptors and named data streams. Either install libntfs-3g, or configure --without-ntfs-3g to disable this feature. make: *** [wimlib-1.8.2/.libs/wimlib-imagex] Error 1 ---------------------------------------------------- { svn diff -r 266:267 dhcp_tftp_setup/ftp/arm-kickstart/CentOs6.7_i386-server_anaconda-ks.cfg { +yum -y install epel-release +yum -y install ntfs-3g +yum -y install ntfs-3g-devel } ---------------------------------------------------- yum -y install epel-release yum -y install ntfs-3g yum -y install ntfs-3g-devel yum -y install epel-release ntfs-3g ntfs-3g-devel } } libusb{ checking whether to build static libraries... yes checking for libusb_init in -lusb-1.0... no configure: error: in `/home/jin/source/unattended/linuxboot/usbutils-0.91/usbhid-dump': configure: error: libusb is required, but was not found, abort. Try installing libusb-1.0-0-dev package. See `config.log' for more details. configure: error: ./configure failed for usbhid-dump make: *** [usbutils-0.91/lsusb] Error 1 ---------------------------------------------------- { svn diff -r 9:10 http://nas-e5-dd-10/svn/unattended-code/unattended { Index: Makefile =================================================================== --- Makefile (revision 9) +++ Makefile (revision 10) @@ -17,7 +17,7 @@ #TODO: kbd-1.15.5 kbd=kbd-1.15.2 #TODO:libusb-1.0.18 -libusb=libusb-0.1.12 +libusb=libusb-1.0.9 linux=linux-3.10.87 libxml2=libxml2-2.9.1 module-init-tools=module-init-tools-3.15 @@ -42,7 +42,7 @@ #TODO: syslinux 6.02 syslinux=syslinux-5.10 #TODO usbutils-007 -usbutils=usbutils-0.91 +usbutils=usbutils-006 wimlib=wimlib-1.8.2 wireless_tools=wireless_tools.29 zlib=zlib-1.2.8 @@ -850,7 +850,7 @@ stage1 += stage1/lib/libexpat.so ## libusb -$(libusb)/.libs/libusb-0.1.so.4.4.4: +$(libusb)/libusb/.libs/libusb-1.0.so.0.1.0: cd $(libusb) \ && CC="$(CC)" CXX="$(CXX)" ./configure --disable-static \ --build=i586-linux --disable-build-docs\ @@ -858,18 +858,19 @@ && $(MAKE) [ -e $@ ] -$(call copy_lib,$(libusb)/.libs/libusb-0.1.so.4.4.4,stage1/lib/libusb.so) -$(call copy_file,$(libusb)/usb.h,fakeinclude/usb.h) -stage1 += stage1/lib/libusb.so +$(call copy_lib,$(libusb)/libusb/.libs/libusb-1.0.so.0.1.0,stage1/lib/libusb-1.0.so) +$(call copy_file,$(libusb)/libusb/libusb.h,fakeinclude/libusb.h) +$(call copy_file,$(libusb)/libusb/libusb.h,fakeinclude/libusb-1.0/libusb.h) +stage1 += stage1/lib/libusb-1.0.so ## usbutils ## use LIBUSB_CFLAGS and LIBUSB_LIBS to avoid pkg-config usage. #FIXME '-lusb' is sufficient since usage of fakelib_cflags for CFLAGS. -$(usbutils)/lsusb: stage1/lib/libusb.so fakeinclude/usb.h +$(usbutils)/lsusb: stage1/lib/libusb-1.0.so fakeinclude/libusb.h fakeinclude/libusb-1.0/libusb.h cd $(usbutils) \ - && CC="$(CC)" CFLAGS="$(fakelib_cflags)" \ - LIBUSB_CFLAGS="-I$(cwd)/fakeinclude" LIBUSB_LIBS="-lusb" \ + && CC="$(CC)" CFLAGS="$(fakelib_cflags) -I$(cwd)/fakeinclude" LDFLAGS="$(fakelib_cflags)" \ + LIBUSB_CFLAGS="-I$(cwd)/fakeinclude" LIBUSB_LIBS="-lusb-1.0" \ ./configure --prefix=/usr\ && $(MAKE) @@ -1097,8 +1098,8 @@ http://ftp.gnu.org/gnu/glibc/) $(call download_rule, $(kbd), tar.gz, \ http://ftp.altlinux.com/pub/people/legion/kbd/) -$(call download_rule, $(libusb), tar.gz, \ - http://downloads.sourceforge.net/libusb/) +$(call download_rule, $(libusb), tar.bz2, \ + http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.9/) $(call download_rule, $(linux), tar.gz, \ http://www.kernel.org/pub/linux/kernel/v3.x/) $(call download_rule, $(libxml2), tar.gz, \ } ---------------------------------------------------- } } init{ Failed to execute /init ---------------------------------------------------- { svn diff -r 9:10 http://nas-e5-dd-10/svn/unattended-code/unattended { Property changes on: misc/master ___________________________________________________________________ Added: svn:executable + * Property changes on: misc/init ___________________________________________________________________ Added: svn:executable + * } ---------------------------------------------------- } } udhcpc{ Sending discover... udhcpc: sendto: Network is down ---------------------------------------------------- { svn diff -r 11:12 http://nas-e5-dd-10/svn/unattended-code/unattended { Property changes on: linuxboot/misc/udhcpc-script ___________________________________________________________________ Added: svn:executable + * } ---------------------------------------------------- } } pciutils-3.3.1{ gcc -m32 lspci.o ls-vpd.o ls-caps.o ls-caps-vendor.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/libpci.a -lz -lresolv -ludev -o lspci /usr/bin/ld: cannot find -ludev collect2: error: ld returned 1 exit status make[1]: *** [lspci] Error 1 make[1]: Leaving directory `/home/jin/source/unattended0/linuxboot/pciutils-3.3.1'' make: *** [pciutils-3.3.1/lspci] Error 2 ---------------------------------------------------- { i386时候应该不包含-ludev -------------------------linuxboot/pciutils-3.3.1/lib/configure if `which pkg-config >/dev/null && pkg-config --atleast-version=196 libudev` ; then HWDB=yes else HWDB=no fi } } ---------------------------------------------------- } 3 initrd boot{ init -> master } ------------------------------------------- --未解决问题------------------------------ { --linux 环境如何格式化分区后,能安装win2k/XP----- mkdosfs /dev/sda1,安装win2k/XP时候显示信息 Datenträgerfehler Neustart mit beliebiger Taste ------------------------------------------- }