赞
踩
如何定制化自己的centos?下面来讲解一下,怎么制作rootfs
[root@localhost ~]# mkdir –p /home/arron/centos
[root@localhost ~]# cd /home/arron/centos
[root@localhost centos]# mkdir rootfs
[root@localhost centos]# mkdir -p rootfs/var/lib/rpm
[root@localhost centos]# rpm --root /home/arron/centos/rootfs/ --initdb
rpm -ivh --nodeps --root /home/arron/centos/rootfs/ http://vault.centos.org/7.4.1708/os/x86_64/Packages/centos-release-7-4.1708.el7.centos.x86_64.rpm
The rootfs like this:
[root@localhost centos]# ls rootfs/
etc/ usr/ var/
[root@localhost centos]# ls rootfs/etc/
centos-release redhat-release yum/
issue rpm/ yum.repos.d/
issue.net system-release
pki/ system-release-cpe
yum --installroot=/home/arron/centos/rootfs install yum --nogpgcheck
[root@localhost centos]#cp -L /etc/resolv.conf ./rootfs/etc/resolv.conf
[root@localhost centos]#cp –r /etc/yum.repos.d/ /home/arron/centos/rootfs/etc/
[root@localhost centos]# mount --bind /dev ./rootfs/dev
[root@localhost centos]# mount -t proc /proc ./rootfs/proc
[root@localhost centos]# mount -t sysfs /sys ./rootfs/sys
Refer to this link:
https://raw.githubusercontent.com/psachin/bash_scripts/master/ch-mount.sh
[root@localhost centos]# chroot ./rootfs /bin/bash
Refer to this link:
https://linux.cn/article-8310-1.html
http://ask.xmodulo.com/enable-elrepo-repository.html
bash-4.2# yum install net-tools
bash-4.2# yum install passwd
bash-4.2# passwd
passwd: unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 is not authorized to change the password of root
bash-4.2# cp -v /etc/skel/.bash* /root/
bash-4.2# exit
下一篇build kernel
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。