LinuxSir.cn,穿越时空的Linuxsir!

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

做一个自己的livecd,有问题求教。[最终使用ibox-builder成功。强烈推荐!]

[复制链接]
发表于 2005-3-12 21:08:53 | 显示全部楼层 |阅读模式
试用了教主的iBOX,真棒!同时也引发了自己做livecd的兴趣。在这里http://www.linux-live.org/找到个最新的Live scripts,只是有个问题无法解决,它的requirements文件有这样一段:
   * You must modify your distro to not test the status of root directory
     (whether it is (is not) writable). For example, Slackware is testing
     the status of the root partition during boot and if it's read-write,
     it will display a message and will wait for user input. This is something
     we don't like, right? Unionfs can't be remounted ro, so I can't avoid
     this in linux live scripts. I have to patch Slackware rc scripts (rc.S)
     to skip the test. You will need to do something similar for your distro.

请教究竟如何修改checkroot呢?
发表于 2005-3-12 21:46:13 | 显示全部楼层
兄弟要学LiveCD的制作,为什么不使用ibox-builder呢?
可以看看ibox-builder的脚本代码,或许会给兄弟带来灵感。呵呵。

预祝兄弟成功!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-13 10:51:08 | 显示全部楼层
不是每个人都有兴趣和能力细致、深层次地研究以至于一行一行地写脚本,反复地测试、封装、刻碟...
ibox确实不错,但不一定是我想要的,要构建到自己的“own livecd",ibox确实做得到。
Post by home_king
使用ibox-installer将ibox安装到本地硬盘后,你就可以使用mkibox重新封装你的linux为livecd

当然你得经过大量繁复的步骤。
有没有一种方法,简单易行,将当前运行的gentoo做成属于你自己的livecd?SLAX倒是提供了一套脚本及工具集,如解决了上述的问题,生成一个完全可用的livecd.iso只需一步,岂不快哉!
教主提及的ibox-installer,如果可提取出来直接使用,想来也是可行的。
回复 支持 反对

使用道具 举报

发表于 2005-3-13 12:01:54 | 显示全部楼层
Post by midx

有没有一种方法,简单易行,将当前运行的gentoo做成属于你自己的livecd?SLAX倒是提供了一套脚本及工具集,如解决了上述的问题,生成一个完全可用的livecd.iso只需一步,岂不快哉!
教主提及的ibox-installer,如果可提取出来直接使用,想来也是可行的。

SLAX并非专为Gentoo而作,如果你要使用它的脚本集来制作Gentoo的LiveCD,估计你会走很多弯路。

而ibox-builder正是Gentoo的LiveCD制作脚本,简单易行,无须了解多余的内幕知识。

将ibox上面的ibox-builder提取出来(具体步骤请查看/usr/local/portage/app-admin/ibox-builder的ebuild文件),安装到你的Gentoo box上。
在你的Gentoo box上运行mkibox,ibox-builder会检测制作LiveCD的条件是否满足,如果满足,它会一步一步地教你做你自己的LiveCD的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-13 12:48:11 | 显示全部楼层
谢谢教主耐心答疑。如此倒是打消了使用ibox-builder(第三帖中“ibox-installer”为笔误,请见谅)的顾虑。livecd依赖工具及fs模块想来不缺,只等有时间尝试一下ibox-builder。若成,会第一时间向教主报喜。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-13 20:24:35 | 显示全部楼层
很顺利。其实刚才已经做了一次,livecd.squashfs mount不上,是不是没建/mnt/livecd的原因?
现在正在mksquashfs,正好出去办事,回来刻盘...
  1. # /usr/share/ibox-builder/mkibox mkibox is an ibox-builder written by home_king.
  2. Checking and ajusting the environment to meet the needs
  3. for IBOX, mkibox builds iso file in /root by default.
  4. Enjoy! Welcome any questions and suggestions to home_king@163.com.
  5. >>> checking...
  6.     * local box ... ok
  7.     * ibox-fbsplash-theme ... ok
  8.     * baselayout ... ok
  9.     * morph-sources ... ok
  10.     * kernel configuration file ... ok
  11.     * isolinux directory ... ok
  12.     * cdrtools ... ok
  13.     * mingetty ... ok
  14.     * hotplug suite(hotplug,coldplug,udev) ... ok
  15.     * X,hwsetup,hwdata-knoppix,ddcxinfo-knoppix ... ok
  16. >>> checking size...
  17.     * The size of tmpfs is 85870 KB.
  18.     * The size of uncompressed Squashfs is -1486452 KB.

  19. STEP[1/4]: generate initrd and kernel,
  20. Confirm [*(terminate)|y(lanuch)|j(skip)]:y
  21. >>> Create kernel and initrd...
  22.     * genkernel...
  23. * Gentoo Linux Genkernel; Version 3.1.1b
  24. * Compiling Linux Kernel 2.6.10-morph24 for x86...

  25. * config: --no-clean is enabled; leaving the .config alone.
  26. * config: >> Invoking menuconfig...
  27. #
  28. # using defaults found in .config
  29. #


  30. Your kernel configuration changes were NOT saved.

  31. *         >> Compiling 2.6.10-morph24 bzImage...
  32. *         >> Compiling 2.6.10-morph24 modules...
  33. * Copying config for successful build to /etc/kernels/kernel-config-x86-2.6.10-morph24
  34. * initrd: >> Initializing...
  35. *         >> Copying modules...
  36. *         >> Copying auxilary files...
  37. *         :: Size is at 2410K
  38. *         >> Creating loopback filesystem...
  39. *         >> Moving initrd files to the loopback...
  40. *         >> Cleaning up and compressing the initrd...
  41. *
  42. * Kernel compiled successfully!
  43. *
  44. * Required Kernel Parameters:
  45. *     root=/dev/ram0 real_root=/dev/$ROOT init=/linuxrc
  46. *     [ And "vga=0x317 splash=verbose" if you use a framebuffer ]
  47. *
  48. *     Where $ROOT is the device node for your root partition as the
  49. *     one specified in /etc/fstab
  50. *
  51. * If you require Genkernel's hardware detection features; you MUST
  52. * tell your bootloader to use the provided initrd file. Otherwise;
  53. * substitute the root argument for the real_root argument if you are
  54. * not planning to use the initrd...
  55. *
  56. * Do NOT report kernel bugs as genkernel bugs unless your bug
  57. * is about the default genkernel configuration...
  58. *
  59. * Make sure you have the latest genkernel before reporting bugs.
  60.     * Rebuild kernel with ibox fbsplash themes compiled in.
  61. o Creating directory structure..
  62. o Copying /sbin/splash_helper..
  63. o Copying themes..
  64.   - ibox
  65. o Creating initramfs image..
  66.   CHK     include/linux/version.h
  67. make[1]: “arch/i386/kernel/asm-offsets.s”是最新的。
  68.   CHK     include/asm-i386/asm_offsets.h
  69.   CHK     include/linux/compile.h
  70.   CHK     usr/initramfs_list
  71.   AS      usr/initramfs_data.o
  72.   LD      usr/built-in.o
  73.   GEN     .version
  74.   CHK     include/linux/compile.h
  75.   UPD     include/linux/compile.h
  76.   CC      init/version.o
  77.   LD      init/built-in.o
  78.   LD      .tmp_vmlinux1
  79.   KSYM    .tmp_kallsyms1.S
  80.   AS      .tmp_kallsyms1.o
  81.   LD      .tmp_vmlinux2
  82.   KSYM    .tmp_kallsyms2.S
  83.   AS      .tmp_kallsyms2.o
  84.   LD      vmlinux
  85.   SYSMAP  System.map
  86.   SYSMAP  .tmp_System.map
  87.   AS      arch/i386/boot/setup.o
  88.   LD      arch/i386/boot/setup
  89.   OBJCOPY arch/i386/boot/compressed/vmlinux.bin
  90.   GZIP    arch/i386/boot/compressed/vmlinux.bin.gz
  91.   LD      arch/i386/boot/compressed/piggy.o
  92.   LD      arch/i386/boot/compressed/vmlinux
  93.   OBJCOPY arch/i386/boot/vmlinux.bin
  94.   BUILD   arch/i386/boot/bzImage
  95. Root device is (3, 6)
  96. Boot sector 512 bytes.
  97. Setup is 4606 bytes.
  98. System is 3926 kB
  99. Kernel: arch/i386/boot/bzImage is ready

  100. STEP[2/4]: place iboxilized core,
  101. Confirm [*(terminate)|y(lanuch)|j(skip)]:y
  102. ...
  103. mksquashfs:...
  104. ...
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-3-13 21:10:17 | 显示全部楼层
制作完iso后,应该使用虚拟机来测试一下,不要这么快就刻盘,否则可能会浪费光盘的。
我制作ibox的时候也是如此,这也是为什么ibox-builder不把cdrecord作为最后步骤的原因。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-13 21:55:43 | 显示全部楼层
我用的是DVD+RW,所以刻盘是最完全真实的测试。在mkibox脚本里放宽了TOTALSIZE,最后的iso文件在870M左右。
  1. TOTALSIZE=$(df | awk '$42=="/"{print $3}')
复制代码

启动后居然livecd.squashfs挂不上。大概在执行linuxrc的这个位置出错:
  1.                 mount -t squashfs -o loop,ro /newroot/mnt/cdrom/${LOOPEXT}${LOOP} /newroot/mnt/livecd
  2.                 if [ "$?" != '0' ]
  3.                 then
  4.                         echo 'Failed to mount filesystem; failing back to the shell...'
  5.                         /bin/ash
  6.                 fi
复制代码

教主是否再作些提示?
回复 支持 反对

使用道具 举报

发表于 2005-3-13 22:11:13 | 显示全部楼层
务必打上nitro补丁集,确保内核支持squashfs。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-14 20:29:34 | 显示全部楼层
Post by home_king
内核支持squashfs

正!
先前用SLAX的时候只是把squashfs编译成模块就可以了,可能iBOX没把squashfs模块植入initrd的缘故以致于livecd.squashfs不能被识别,编译进内核就ok了。
至此,livecd可以说是比较完美地做成功了,贺一下!感谢教主指点。
回复 支持 反对

使用道具 举报

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

本版积分规则

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