附录
附录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 作为光盘启动文件。
阅读(1317) | 评论(0) | 转发(1) |