LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3414|回复: 5

升级 lfslivecd-x86-6.3-r2160

[复制链接]
发表于 2009-8-29 16:03:49 | 显示全部楼层 |阅读模式
需要安装的包:
cdrtools
zisofs-tools

环境变量:
  1. export WORK=xxxx
复制代码
本例中 $WORK=/mnt/lfslivecd

需要的脚本:
$WORK/openlivecd
$WORK/closelivecd
$WORK/mklfslivecd
具体如下

$WORK/openlivecd
[php]
#!/bin/sh

export WORK=/mnt/lfslivecd
cd $WORK

# remount
mount -o loop $WORK/root.ext2 $WORK/root

mkdir $WORK/root/build
mount --bind $WORK/build $WORK/root/build

mount -t proc proc $WORK/root/proc
mount -t sysfs sysfs $WORK/root/sys
mount -t devpts devpts $WORK/root/dev/pts
mount -t tmpfs tmpfs $WORK/root/dev/shm
[/php]

$WORK/closelivecd
[php]
#!/bin/sh

export WORK=/mnt/lfslivecd
cd $WORK

#umount
umount $WORK/root/dev/shm
umount $WORK/root/dev/pts
umount $WORK/root/sys
umount $WORK/root/proc
umount $WORK/root/build
rmdir $WORK/root/build

#remove history
rm $WORK/root/root/.bash_history
rm $WORK/root/root/.viminfo

#umount
umount $WORK/root
[/php]

$WORK/mklfslivecd
[php]
#!/bin/sh

export WORK=/mnt/lfslivecd
cd $WORK

# umount
./closelivecd

# compress
mkzftree -v -F $WORK/root.ext2 iso/root.ext2

# burn cd
cd $WORK/iso
mkisofs -z -R -l --allow-leading-dots -D -o \
    ../lfslivecd-x86-6.3-r2160-custom.iso -b boot/isolinux/isolinux.bin \
    -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
    -V "lfslivecd-x86-6.3-r2160" ./

# transfer
cd $WORK
ftp 192.168.101.1


# remount
./openlivecd
[/php]



下面开始具体工作

1. mount ISO
  1. root[ ~ ]# mount /dev/cdrom /media/cdrom/
  2. mount: block device /dev/hda is write-protected, mounting read-only
  3. root[ ~ ]# ll /media/cdrom/
  4. total 383881
  5. -rw-r--r-- 1 root root      32701 Dec 29  2007 README.html
  6. drwxr-xr-x 3 root root       2048 Dec 29  2007 boot
  7. drwxr-xr-x 2 root root       4096 Dec 29  2007 drivers
  8. drwxr-xr-x 2 root root      14336 Dec 29  2007 lfs-sources
  9. -rw-r--r-- 1 root root 1610612736 Dec 29  2007 root.ext2
  10. root[ ~ ]#
复制代码

2. 复制源 ISO 内容
  1. mkdir $WORK/iso -p
  2. mkdir $WORK/root
  3. cp /media/cdrom/* $WORK/iso/ -a
复制代码

如果 root.ext2 有 1.6G 左右,那么:
  1. mv $WORK/iso/root.ext2 $WORK/
复制代码

如果 root.ext2 有 400M 左右,那么:
  1. mkzftree -u -F $WORK/iso/root.ext2 $WORK/root.ext2
复制代码

3. 更新内容
  1. cd $WORK
  2. ./openlivecd
复制代码

3.1. lfs packages
  1. rm $WORK/iso/lfs-sources/*
复制代码
下载 6.5 所有 package, 放入 $WORK/iso/lfs-sources/

3.2. 6.5 LFS BOOK

下载 LFS-BOOK-6.5-HTML, LFS-BOOK-6.5-XML 解压到 $WORK/root/usr/share/
删除原 6.3 的 HTML 和 XML

3.3. jhalfs-2.3.2

下载 jhalfs-2.3.2 解压到 $WORK/root/home/jhalfs/
删除原 /$WORK/root/home/jhalfs/jhalfs-2.3.1

3.4. 其它

复制一份 kernel-config 及 fstab 到 $WORK/root/home/jhalfs/
(需要一份完备的 kernel-config, 好让 jhalfs 无缝地运行)

准备一份 jhalfs 的 configuration 到 $WORK/root/home/jhalfs/jhalfs-2.3.2/configuration
(configuration 内容见附录)
  1. root[ /mnt/lfslivecd ]# ll $WORK/root/home/jhalfs
  2. total 52
  3. -rw-r--r--  1 101 101   518 Aug 27 07:57 fstab
  4. drwxr-xr-x 13 101 101  4096 Aug 27 11:21 jhalfs-2.3.2
  5. -rw-r--r--  1 101 101 44458 Aug 26 01:10 kernel-config
  6. root[ /mnt/lfslivecd ]#
复制代码

4. 制作 ISO
  1. cd $WORK
  2. ./mklfslivecd
复制代码

5. 结束
  1. cd $WORK
  2. ./closelivecd
复制代码


附录A. 如果需要 opensshd
  1. touch $WORK/root/.autosshd
  2. chroot $WORK/root
  3. passwd
复制代码

附录B. 关于 /media/cdrom/root.ext2 的大小

如果 kernel
  1. File systems  --->
  2.   CD-ROM/DVD Filesystems  --->
  3.     [*]   Transparent decompression extension
复制代码
那么 root.ext2 就是 1.6G, 反之就是 400M, 需要先解压

附录C. $WORK/root/home/jhalfs/jhalfs-2.3.2/configuration
  1. #
  2. # Automatically generated configuration: don't edit
  3. # use make menuconfig or make config to make changes
  4. #
  5. #
  6. # --- BOOK Settings
  7. #
  8. BOOK_LFS=y
  9. # BOOK_CLFS is not set
  10. # BOOK_CLFS2 is not set
  11. # BOOK_CLFS3 is not set
  12. # BOOK_BLFS is not set
  13. PROGNAME="lfs"
  14. RUN_ME="./jhalfs run"
  15. # relSVN is not set
  16. WORKING_COPY=y
  17. # BRANCH is not set
  18. BRANCH_ID=""
  19. BOOK="/usr/share/LFS-BOOK-6.5-XML"
  20. # ARCH_X86 is not set
  21. # ARCH_MIPS is not set
  22. # ARCH_PPC is not set
  23. # ARCH_SPARC is not set
  24. # ARCH_ALPHA is not set
  25. # ARCH_ARM is not set
  26. # ARCH_HPPA is not set
  27. # PLATFORM_GENERIC is not set
  28. # PLATFORM_WRT is not set
  29. # DATA_32 is not set
  30. # DATA_64 is not set
  31. # DATA_MULTI is not set
  32. # PROC_i486 is not set
  33. # PROC_i586 is not set
  34. # PROC_i686 is not set
  35. # PROC_mipsel is not set
  36. # PROC_mips is not set
  37. # PROC_unknown is not set
  38. # PROC_hppa1 is not set
  39. # PROC_hppa2 is not set
  40. # PROC_EV5 is not set
  41. # PROC_EV56 is not set
  42. # PROC_PCA56 is not set
  43. # PROC_PCA57 is not set
  44. # PROC_EV6 is not set
  45. # PROC_EV67 is not set
  46. # PROC_EV68 is not set
  47. # PROC_ARM is not set
  48. # PROC_ARM5L is not set
  49. # PROC_ARM5B is not set
  50. # PROC_ULTRA1 is not set
  51. # PROC_ULTRA2 is not set
  52. # PROC_ULTRA3 is not set
  53. # ABI_32 is not set
  54. # ABI_N32 is not set
  55. # ABI_64 is not set
  56. TARGET=""
  57. TARGET32=""
  58. PLATFORM="GENERIC"
  59. SPARC64_PROC="none"
  60. ARCH=""
  61. MIPS_LEVEL=""
  62. ABI=""
  63. ENDIAN=""
  64. # BUILD_CHROOT is not set
  65. # BUILD_BOOT is not set
  66. METHOD=""
  67. BOOT_CONFIG=""
  68. # GRSECURITY_HOST is not set
  69. # LIB_GLIBC is not set
  70. # LIB_UCLIBC is not set
  71. MODEL=""
  72. # KERNEL_26 is not set
  73. # KERNEL_24 is not set
  74. KERNEL=""
  75. SSP=",ssp,"
  76. ASLR=",aslr,"
  77. PAX=",pax,"
  78. HARDENED_TMP=",hardened_tmp,"
  79. WARNINGS=",warnings,"
  80. MISC=",misc,"
  81. BLOWFISH=",blowfish,"
  82. # CUSTOM_TOOLS is not set
  83. # BLFS_TOOL is not set
  84. # BLFS_SVN is not set
  85. # BLFS_BRANCH is not set
  86. BLFS_BRANCH_ID=""
  87. # DEP_LIBXML is not set
  88. # DEP_LIBXSLT is not set
  89. # DEP_TIDY is not set
  90. # DEP_DBXML is not set
  91. # DEP_UNZIP is not set
  92. # DEP_LYNX is not set
  93. # DEP_SUDO is not set
  94. # DEP_WGET is not set
  95. # DEP_GPM is not set
  96. # DEP_SVN is not set
  97. BLFS_ROOT=""
  98. BLFS_XML=""
  99. TRACKING_DIR=""
  100. #
  101. # --- General Settings
  102. #
  103. # CONFIG_USER is not set
  104. DEF_USER="lfs"
  105. SET_USER=""
  106. # CONFIG_GROUP is not set
  107. SET_GROUP=""
  108. # CONFIG_HOME is not set
  109. SET_HOME=""
  110. LUSER="lfs"
  111. LGROUP="lfs"
  112. LHOME="/home"
  113. BUILDDIR="/mnt/lfs"
  114. GETPKG=y
  115. SRC_ARCHIVE="/lfs-sources"
  116. SERVER="http://ftp.lfs-matrix.net/"
  117. GETKERNEL=y
  118. RUNMAKE=y
  119. # CLEAN is not set
  120. #
  121. # --- Build Settings
  122. #
  123. # CONFIG_TESTS is not set
  124. # TST_1 is not set
  125. # TST_2 is not set
  126. # TST_3 is not set
  127. TEST=0
  128. # NO_BOMB is not set
  129. # BOMB is not set
  130. # BOMB_TEST is not set
  131. # INSTALL_LOG is not set
  132. HAVE_FSTAB=y
  133. FSTAB="/home/jhalfs/fstab"
  134. CONFIG_BUILD_KERNEL=y
  135. CONFIG="/home/jhalfs/kernel-config"
  136. STRIP=y
  137. VIMLANG=y
  138. # NO_PROGRESS_BAR is not set
  139. TIMEZONE="GMT"
  140. LANG="$LANG"
  141. PAGE_LETTER=y
  142. # PAGE_A4 is not set
  143. PAGE="letter"
  144. #
  145. # --- Advanced Features
  146. #
  147. REPORT=y
  148. # COMPARE is not set
  149. ITERATIONS=0
  150. # RUN_ICA is not set
  151. # RUN_FARCE is not set
  152. # CONFIG_OPTIMIZE is not set
  153. # OPT_1 is not set
  154. # OPT_2 is not set
  155. OPTIMIZE=0
  156. #
  157. # --- Internal Settings (WARNING: for jhalfs developers only)
  158. #
  159. SCRIPT_ROOT="jhalfs"
  160. JHALFSDIR="$BUILDDIR/$SCRIPT_ROOT"
  161. LOGDIRBASE="logs"
  162. LOGDIR="$JHALFSDIR/logs"
  163. TESTLOGDIRBASE="test-logs"
  164. TESTLOGDIR="$JHALFSDIR/test-logs"
  165. FILELOGDIRBASE="installed-files"
  166. FILELOGDIR="$JHALFSDIR/$FILELOGDIRBASE"
  167. ICALOGDIR="$LOGDIR/ICA"
  168. FARCELOGDIR="$LOGDIR/farce"
  169. MKFILE="$JHALFSDIR/Makefile"
  170. XSL="$PROGNAME.xsl"
  171. PKG_LST="unpacked"
  172. # REBUILD_MAKEFILE is not set
复制代码
 楼主| 发表于 2009-8-29 19:10:49 | 显示全部楼层
写了 XML, 看这里吧:

http://imghch.com/doc/lfs_r2160_livecd.html
回复 支持 反对

使用道具 举报

发表于 2009-8-30 06:54:13 | 显示全部楼层
感谢 Server 兄分享心得,似乎本篇更值得置顶 :)

原有的 6.5 packages patches list 在此 http://www.linuxsir.cn/bbs/thread355492.html
回复 支持 反对

使用道具 举报

发表于 2009-9-2 17:00:59 | 显示全部楼层
楼主 厉害 值得学习
回复 支持 反对

使用道具 举报

发表于 2009-11-26 21:00:55 | 显示全部楼层
有没有用过的?反馈一声!谢谢!
回复 支持 反对

使用道具 举报

发表于 2009-12-1 23:28:02 | 显示全部楼层
openlivecd中
mount --bind $WORK/build $WORK/root/build
按照
http://imghch.com/doc/lfs_r2160_livecd.html
描述的应该是
mount --bind /usr/src $WORK/root/build
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表