免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 968 | 回复: 0
打印 上一主题 下一主题

Linux发行版制作指南[3] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-05 20:53 |只看该作者 |倒序浏览

摘要
  此文档着重介绍了Linux发行版制作过程中的各个步骤。(2002-10-08 13:20:09)
附录
  附录A boot.img和initrd.img的解析过程
  1.首先建立两个映像文件解析后的装载点(mount point):
  mkdir         /mnt/boot                /mnt/initrd
2.写shell脚本进行解析和还原:
  解析脚本命名为up
  #!/bin/sh
  mount        -o loop        -t msdos        boot.img        /mnt/boot       
  gzip        -cd        /mnt/boot/initrd.img > /tmp/initrd.ext2
  mount        -o loop –t ext2        /tmp/initrd.ext2  /mnt/initrd
  还原脚本命名为down
  #!/bin/sh
  umount /mnt/initrd
  gzip        -c9        /tmp/initrd.ext2        >        /mnt/boot/initrd.img
  umount        /mnt/boot
  附录B stage2.img解析过程
  1.首先建立映像文件解析后的装载点(mount point):
  mkdir         /mnt/stage2
  2.写shell脚本进行解析和还原:
  解析脚本命名为up2
  #!/bin/sh
  mount        -o loop        stage2.img        /mnt/stage2
  还原脚本命名为down2
  #!/bin/sh
  umount        /mnt/stage2
  附录C comps文件清单
4
1 Base {
  MAKEDEV
  SysVinit
  anacron
  at
  basesystem
  bash
  bdflush
  bzip2
  chkconfig
  console-tools
  cpio
  cracklib
  cracklib-dicts
  crontabs
  cyrus-sasl
  openssl
  db1
  db2
  db3
  dev
  devfsd
  diffutils
  e2fsprogs
  file
  filesystem
  fileutils
  findutils
  gawk
  glib
  glibc
  glibc-common
  grep
  gzip
  hdparm
  hotplug
  lilo
  info
  initscripts
  kbdconfig
  kernel
  krb5-libs
  kudzu
  less
  libstdc++
  libtermcap
  logrotate
  losetup
  mingetty
  mkbootdisk
  mkinitrd
  modutils
  mount
  net-tools
  newt
  ntsysv
  pam
  passwd
  pciutils
  popt
  procps
  psmisc
  pwdb
  quota
  rpm
  sed
  setserial
  setup
  setuptool
  sh-utils
  shadow-utils
  slang
  slocate
  sysklogd
  tar
  termcap
  textutils
  time
  timeconfig
  tmpwatch
  util-linux
  vim-common
  vim-minimal
  vixie-cron
  which
  zlib
}
1 --hide IDS Sensor {
iptables
iputils
libpcap
mysql
openssh
openssh-clients
openssl
perl
rdate
snort
tcpdump
traceroute
unzip
zip
}
  附录D hdlist和hdlist2生成方
  假设在/tmp/cdimage/RedHat/RPMS目录下收录着RPM包的话,则通过使用
  genhdlist        /tmp/cdimage/               
  生成hdlist和hdlist2文件,文件的生成位置在目录/tmp/cdimage/RedHat/base/下
  附录E sensor.py文件清单
  from installclass import BaseInstallClass
  from translate import *
  from installclass import FSEDIT_CLEAR_ALL
  import os
  import iutil
  class InstallClass(BaseInstallClass):
  name = N_("IDS Sensor")
  pixmap = "sensor.png"
  sortPriority = 10
  def __init__(self, expert):
        BaseInstallClass.__init__(self)
        self.setGroups(["IDS Sensor"])
        self.addToSkipList("lilo")
        self.addNewPartition('/boot', (48, -1, 0), (None, -1, 0), (0,0))
        self.addNewPartition('/', (256, -1, 0), (None, -1, 0), (0,0))
        self.addNewPartition('/usr', (512, -1, 1), (None, -1, 0), (0,0))
        self.addNewPartition('/var', (256, -1, 0), (None, -1, 0), (0,0))
        self.addNewPartition('/home',(512, -1, 1), (None, -1, 0), (0,0))
        self.setClearParts(FSEDIT_CLEAR_ALL,
            warningText = N_("Automatic partitioning will erase ALL DATA
                on your hard "
                "drive to make room for your Linux installation."))
#        self.addNewPartition('swap', (64, 256, 1), (None, -1, 0), (0,0))
        # 2.4 kernel requires more swap, so base amount we try to get
        # on amount of memory
        (minswap, maxswap) = iutil.swapSuggestion()
        self.addNewPartition('swap', (minswap, maxswap, 1),
            (None, -1, 0), (0,0))
  附录F syslinux.cfg文件清单
  label linux
  kernel vmlinuz
  append initrd=initrd.img lang=us devfs=nomount vga=788
  附录G boot.img制作启动盘方法
  cat        boot.img        > /dev/fd0       
  或
  dd if=boot.img of=/dev/fd0 bs=1440
  附录H Linux光盘映像制作方法
  在Linux下光盘映像的制作用mkisofs命令,具体的,假设在/tmp/cdimage/目录下收录着将要被制作的光盘内容,则执行
  mkisofs –v –r –T –J –V “NetCop Linux”        –b images/boot.img
          -o /tmp/NetCopLinux.iso
  即可在/tmp目录下做出一命名为NetCopLinux.iso的光盘映像文件,它以/tmp/cdimage/images/boot.img 作为光盘启动文件。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44942/showart_354238.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP