极限首页 业界焦点 软件工程师之路 系统工程师之路 网络工程师之路 软件下载 技术社区
 体验 Wine: Windows 到 Li
 Linux操作系统打印机配置全
 驱动SD/MMC读卡器
 redhat 安装程序 anaconda
 构造Linux的图形化安装程序
 使用Linux实现负载均衡
 Xen和虚拟化技术(一)
 Linux 操作系统安装盘的定
 在Linux上实现高可用服务
 如何在Linux使用宽屏
 体验 Wine: Windows 到 Li
 Linux操作系统打印机配置全
 驱动SD/MMC读卡器
 redhat 安装程序 anaconda
 构造Linux的图形化安装程序
 使用Linux实现负载均衡
 Xen和虚拟化技术(一)
 Linux 操作系统安装盘的定
 在Linux上实现高可用服务
 如何在Linux使用宽屏

Shell 中文手册

Python 2.3 中文手册

Python 2.4 中文手册

Mysql 4.x 中文手册

PHP 4.x 中文手册

Apache 2.x 中文手册
更多手册

站内搜索:
当前位置:首页>>系统工程师之路>>解决方案>>正文
Linux发行版制作指南(3)
时间:2005-09-07 作者:LinuxAID 来源:LinuxAID

 

附录

  附录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 作为光盘启动文件。


  共3页: 上一页 [1] [2] 3   
推荐】【 】【关闭


关于极限 | 站内地图 | 意见反馈 | 广告服务 | 数据服务 | 联系我们
本站所刊登的文章,技术资料,软件均整理于网络资源或本站原创,转载请务必联系原作者或本站。
Copyright ? 2001-2004 UPLinux.com All Rights Reserved.
本站唯一联系信箱:
京ICP备05010519