Chinaunix首页 | 论坛 | 博客
  • 博客访问: 233486
  • 博文数量: 65
  • 博客积分: 1430
  • 博客等级: 中尉
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-27 00:30
文章分类
文章存档

2011年(65)

分类: LINUX

2011-05-21 21:28:39

今天写了两篇哦,哈哈哈哈。。。。
1.如何给自己的小linux造一个名字
在自己的小linux已经启动的前提下做一下事情(如何建小linux前面的日志已经讲过)
which hostname
将/bin/hostname 拷到 /mnt/sysroot/bin
ldd /bin/hostnaem
将其依赖的库文件以及库文件的链接文件拷到/mnt/sysroot/lib
cd /mnt/sysroot
mkdir etc/sysconfig
vim etc/sysconfig/network
HOSTNAME=
保存退出
vim /etc/rc.d/rc.sysinit
#!/bin/bash
echo -e "\tWelcome \033[31mMy\033[0m linux"
#for hostname
 [ -f /etc/sysconfig/network ] && ./etc/sysconfig/network
 if [ -z $HOSTNAME -O $HOSTNAME='(none)' ];then
HOSTNAME=localhost
 fi
/bin/hostname $HOSTNAME
/bin/bash
保存退出
sync
sync
sync
 
2.boot目录是怎么挂载上的。
which mount
ldd /bin/mount
将库文件以及库文件的链接文件拷到/mnt/sysroot/lib下
which umount
ldd /bin/umount
将库文件以及库文件的链接文件拷到/mnt/sysroot/lib下
vim etc/rc.d/rc.sysinit
vim /etc/rc.d/rc.sysinit
#!/bin/bash
echo -e "\tWelcome \033[31mMy\033[0m linux"
#for hostname
 [ -f /etc/sysconfig/network ] && ./etc/sysconfig/network
 if [ -z $HOSTNAME -O $HOSTNAME='(none)' ];then
HOSTNAME=localhost
 fi
/bin/hostname $HOSTNAME
echo "Remount the root file skystem..."
/bin/mount -n -o remount, rw /
echo "Mounting the boot...."
/bin/mount -n -t ext3 /boot
/bin/bash
保存退出
mkdir /mnt/sysroot/boot
vim etc/fstab
/dev/sda2 /     ext3 defaults 0 0
/dev/sda1 /boot ext3 defaults 0 0
which touch
ldd /bin/touch
cp /bin/touch bin/
将库文件以及库文件的链接文件拷到/mnt/sysroot/lib下

3.如何给grub加张图片
 启动宿主机的图像界面,找一张图片(picture1)放上去,然后修改图片
 步骤如下:
 Application-->Graphics-->The GiMP(如果没有,用yum安装重启即可)
 file-->open-->picture1
 image--scale image
 width:640
 height:480
 点scale
 image-->mode-->index
 Maximum number of colors :14
 点ok
 file-->save as-->展开Select File Type--选择xpm格式-->save
 gzip picture1
 mv picture1 /mnt/boot/grub/
 cd /mnt/boot/grub/
 vim grub.conf
 default=0
 timeout=5
 slashimage=(hd0,0)/grub/picture1.gz
 title Mylinux=0.01
       root (hd0,0)
       kernel /vmlinuz ro root=/dev/sda2
       initrd /initrd
保存退出即可
sync
sync
sync
sync
挂起宿主机,启动我们的小linux即可
 
 

 
阅读(1494) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~