-
$ mkdir -pv $LFS/{dev,proc,sys}
一步一步打造自己的Linux--LFS6.3安装过程(四)
本站文章已轉移,敬請移步:http://www.xxb.me/ ,謝謝!
(注:本文于2月28日修改)
III. 构建 LFS 系统
挂载虚拟内核文件系统
创建初始设备节点:
-
$ mknod -m 600 $LFS/dev/console c 5 1
-
$ mknod -m 666 $LFS/dev/null c 1 3
挂载并填充 /dev 目录:
-
$ mount -v --bind /dev $LFS/dev
现在挂载虚拟内核文件系统:
-
$ mount -vt devpts devpts $LFS/dev/pts
-
$ mount -vt tmpfs shm $LFS/dev/shm
-
$ mount -vt proc proc $LFS/proc
-
$ mount -vt sysfs sysfs $LFS/sys
为了方便使用源码包,将lfs-sources里面所有源码包复制到$LFS/sources目录中:
-
$ cp -v /lfs-sources/* $LFS/sources/
进入 Chroot 环境,以便不受主系统的影响来制作目标系统:
-
$ chroot "$LFS" /tools/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h
此时 bash 提示符会显示“I have no name! :/#”因为 /etc/passwd 还没有创建。
如果此时重启了,需要再执行一次上面带*号的命令
创建系统目录结构:
-
$ mkdir -pv /{bin,boot,etc/opt,home,lib,mnt,opt}
-
$ mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
-
$ install -dv -m 0750 /root
-
$ install -dv -m 1777 /tmp /var/tmp
-
$ mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
-
$ mkdir -pv /usr/{,local/}share/{doc,info,locale,man}
-
$ mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
-
$ mkdir -pv /usr/{,local/}share/man/man{1..8}
-
$ for dir in /usr /usr/local; do
-
ln -sv share/{man,doc,info} $dir
-
done
-
$ mkdir -v /var/{lock,log,mail,run,spool}
-
$ mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
创建必需的文件与符号连接,在目标系统的编译过程中,部分编译程序会用绝对路径来寻找命令或文件:
-
$ ln -sv /tools/bin/{bash,cat,echo,grep,pwd,stty} /bin
-
$ ln -sv /tools/bin/perl /usr/bin
-
$ ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
-
$ ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib
-
$ ln -sv bash /bin/sh
为用到/etc/mtab的程序创建一个空文件:
-
$ touch /etc/mtab
创建root用户和必要的组:
-
$ cat > /etc/passwd << "EOF"
-
root:x:0:0:root:/root:/bin/bash
-
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
-
EOF
root 的真正密码将在后面设置("x"在这里只是一个占位符)。
-
$ cat > /etc/group << "EOF"
-
root:x:0:
-
bin:x:1:
-
sys:x:2:
-
kmem:x:3:
-
tty:x:4:
-
tape:x:5:
-
daemon:x:6:
-
floppy:x:7:
-
disk:x:8:
-
lp:x:9:
-
dialout:x:10:
-
audio:x:11:
-
video:x:12:
-
utmp:x:13:
-
usb:x:14:
-
cdrom:x:15:
-
mail:x:34:
-
nogroup:x:99:
-
EOF
启动新的shell,驱除"I have no name!"提示符:
-
$ exec /tools/bin/bash --login +h
初始化日志文件,并设置适当的权限:
-
$ touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
-
$ chgrp -v utmp /var/run/utmp /var/log/lastlog
-
$ chmod -v 664 /var/run/utmp /var/log/lastlog
到目前为止,创建目标系统的准备工作已基本完成,下面将开始目标系统的软件包安装。
(未完待续)
- 版权所有,转载请遵循“署名-非商业用途-保持一致”创作共用协议。
Apr 29, 2020 03:51:42 PM
After study many of the blog articles in your web site now, i really as if your method of blogging. I bookmarked it to my bookmark website list and will also be checking back soon. Pls look at my internet site also and make me aware how you feel.
May 04, 2020 05:56:39 PM
I am glad that I noticed this website, just the right info that I was searching for!
May 07, 2020 06:11:50 PM
Hi Im itching to know if I may use this article in one of my blogs if I link back to you? Thanks
May 15, 2020 01:46:34 AM
Aw, it was an extremely good post. In concept I would like to invest writing this way moreover – spending time and actual effort to make a top notch article… but exactly what can I say… I procrastinate alot by no indicates find a way to get something accomplished.
May 18, 2020 09:37:35 AM
People wouldn’t think about precisely how it may possibly enormously have an effect on your current destin breast augmentation profits by exercising this rules utilized in seduction methods.
May 22, 2020 10:57:49 AM
This web page is actually a walk-through its the info you wanted about it and didn’t know who to ask. Glimpse here, and you’ll undoubtedly discover it.
Jul 01, 2020 09:03:09 PM
Thank you for sharing excellent information. Your web-site is so cool. I’m impressed by the info that you’ve on this website. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. Christmas in colorado
Jul 29, 2020 01:36:21 AM
I am glad to be one of the visitors on this great site (:, appreciate it for posting. long range thermal camera
Aug 24, 2020 02:37:14 AM
Many thanks for bothering to line this all out for all of us. This write-up ended up being extremely useful in my opinion.
Sep 17, 2020 07:26:29 PM
You produced some decent points there. I looked on the web for that issue and found most people will go as well as with all your site.
Oct 07, 2020 01:30:40 AM
Can I just say what a relief to locate somebody that really knows what theyre discussing on-line. You definitely realize how to bring a problem to light to make it critical. Workout . ought to check out this and fully grasp this side of your story. I cant believe youre no more well-liked since you also definitely provide the gift.
Dec 23, 2020 05:24:00 PM
Hey there, Could I copy your photo and employ it on my own webpage? booking and reservation software
Feb 09, 2021 07:15:48 PM
Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. Pharmaceutical sales jobs
Feb 16, 2021 09:42:32 PM
One present why galore businesses opt for postcards is because they are overmuch cheaper to be prefab and this can forbear a lot of expenses on the lengthened run. 꽁머니사이트
Feb 20, 2021 11:26:17 PM
An adrenaline-fueled adventure that captivates you without a single explosion and leaves you completely satisfied. event management software
Feb 22, 2021 04:51:57 PM
I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! 먹튀검증
Feb 27, 2021 07:15:54 PM
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! 토토
Feb 28, 2021 08:58:12 PM
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Full Circle Health careers
Mar 03, 2021 07:43:55 PM
I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... walmartone
Apr 04, 2021 07:57:31 PM
I think this is definitely an amazing project here. So much good will be coming from this project. The ideas and the work behind this will pay off so much. เปิดยูสเซอร์ ไม่มี ขั้นต่ำ
May 17, 2021 02:04:09 AM
Your post has those facts which are not accessible from anywhere else. It’s my humble request to u please keep writing such remarkable articles Personal Trainer San Diego
May 17, 2021 05:28:17 PM
Impressive web site, Distinguished feedback that I can tackle. I am moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards دعم متابعين سناب
May 18, 2021 01:27:39 AM
I appreciate several from the Information which has been composed, and especially the remarks posted I will visit once more. finocchiona
May 18, 2021 03:29:54 AM
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. pest control doha qatar
May 22, 2021 02:33:14 AM
I needed to thank you for this phenomenal read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. Karaoke DJ
May 25, 2021 04:14:31 PM
I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information. Terpenes for sale
May 25, 2021 11:48:24 PM
BR sells their items under five applications with name of ice cream, cakes, sundaes, beverages and prepacks. They have other promotional packages individually or as subprogram of any other programs.
May 26, 2021 12:54:39 AM
Thanks for the tips guys. They were all great. I have been having issues with being fat both mentally and physically. Thanks to you guys i have been showing improvements. Do post more. شحن شدات بوبجي
Jun 02, 2021 02:19:15 AM
Many homework on the continual hunt along with offstage on the road to winning. Definitely not attached, simple to-fall as a result of wayside; And not investigation, afterward into a path travel toward the black. شدات ببجي
Jun 07, 2021 05:36:05 PM
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up quien es la mascara en vivo
Jun 08, 2021 02:55:50 AM
Intriguing post. I Have Been pondering about this issue, so much obliged for posting. Really cool post.It "s truly extremely pleasant and Useful post.Thanks Gym Near Me
Jun 12, 2021 04:18:46 PM
I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. Minneapolis Wedding photographer
Jun 12, 2021 04:51:53 PM
Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. Personal Trainer Near Me
Jun 20, 2021 11:41:31 PM
Nothing compares to Weber using Genesis sort of grills. That is certainly the type gas grills which have been that will always make sure that they deliver a high performance part of down interval Face mask
Jul 02, 2021 03:47:49 AM
Kostenlose Inserate im Marktplatz Österreich aufgeben. Kaufen oder Verkaufen sie alles auf dem Verticken Marktplatz über kostenlose Kleinanzeigen Kaufen oder verkaufen Sie Autos
Jul 02, 2021 07:33:39 PM
Tutarchive is the premier and authentic blog publisher that shares knowledge & tips about online earning, digital marketing, freelancing & more! how do podcasts make money
Aug 18, 2021 04:29:35 PM
HGH MD is the best and most trusted human growth hormone therapy clinic in Florida and surrounding areas in USA. Our specialists help men and women feel younger and healthier. Call Us Today! 888-763-4221
Aug 24, 2021 08:26:56 PM
there are sporting goods that are very cheap but the quality is not very good,, conference scheduling software
Sep 09, 2021 08:51:23 PM
I am curious to find out what blog platform you’re using? I’m experiencing some minor security problems with my latest blog and I would like to find something more safe. Do you have any solutions? property management medford
Sep 26, 2021 10:25:46 PM
Peak Residence by Tuan Sing & Rich Capital . Hotline 61009266. Get Discounts, Direct Developer Price, Brochure, Floor Plan, Price List & More. (Former Peak Court) Peak Residence Showroom
Oct 07, 2021 09:13:38 PM
My brother suggested I would possibly like this website. He used to be entirely right. This post actually made my day. You can not imagine just how much time I had spent for this info! Thanks! Urban Treasures showflat
Nov 12, 2021 04:24:25 PM
Nov 12, 2021 10:10:15 PM
of course cruise ships are expensive but of course the trip is very nice;; east end market orlando
Nov 12, 2021 11:16:29 PM
y first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. math book answers
Dec 07, 2021 07:19:46 PM
My spouse and i do not possess a lot of time now to compose plenty of my personal blathering thoughts,(my lil woman wants consideration, : )), however when I logon yet again, I will explain thorough precisely why To be sure with this particular write-up. marijuana dispensaries santa barbara
Aug 10, 2022 03:19:31 AM
Skype for Business is a platform created by Microsoft, which is under the suit of Microsoft Office 365, and Skype for Business has good benefits and despite having some disadvantages. uninstall skype for business This Application does use high Ram which it gets launched and it becomes sometimes hard to close it from Task Manager, and therefore there are many users who want to get rid of this Application from their Windows or Mac Device.
Mar 22, 2023 03:07:09 PM
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. Content marketing strategy
Mar 22, 2023 05:27:12 PM
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. Content marketing strategy
Aug 16, 2023 04:11:58 PM
It’s one thing to show conflict between the two but when they come to blows, it just seemed so un-Spocklike. vintage floral curtains
Aug 20, 2023 07:23:07 PM
His idyllic existence is one day broken when a team of heavily armed men turn his house into dust in an attempt to kill him, it’s up to him then and a few old friends to try and get to the bottom of the mysterious kill squad. UFABETแทงบอลบนมือถือ
Aug 21, 2023 05:06:04 PM
Nice post. I discover some thing more challenging on different blogs everyday. Most commonly it is stimulating to study content off their writers and use a specific thing there. I’d want to apply certain while using the content on my weblog whether or not you don’t mind. Natually I’ll supply you with a link on your web blog. Thanks for sharing. แทงใบเหลืองใบแดงUFABET
Aug 21, 2023 10:35:18 PM
A lot of thanks for all your hard work on this website. Kim delights in setting aside time for investigations and it’s really easy to see why. We all learn all regarding the dynamic tactic you make sensible suggestions by means of the website and in addition foster participation from people on that topic then our own princess is actually discovering so much. Take pleasure in the remaining portion of the new year. You have been carrying out a wonderful job. UFABETแทงบอลทายผลผู้ชนะ
Aug 23, 2023 09:08:03 PM
I do accept as true with all the ideas you have introduced on your post. They are very convincing and can definitely work. Nonetheless, the posts are too quick for newbies. May just you please lengthen them a bit from subsequent time? Thanks for the post. 안전놀이터
Aug 23, 2023 09:46:41 PM
Thanks a lot for being our mentor on this niche. I enjoyed your current article very much and most of all cherished how you really handled the aspect I considered to be controversial. You are always quite kind to readers much like me and let me in my everyday living. Thank you. เว็บพนันบอลออนไลน์อันดับ1
Aug 24, 2023 04:48:51 PM
You really should be a part of a contest first of the most effective blogs over the internet. I am going to suggest this blog! UFABET เว็บพนันแตกง่าย
Aug 24, 2023 06:27:50 PM
Hello, i think that i saw you visited my blog thus i came to “return the favor”.I’m trying to find things to enhance my site!I suppose its ok to use a few of your ideas!! เว็บบอลออนไลน์UFA
Aug 25, 2023 01:14:31 AM
I’m impressed, I must say. Genuinely rarely should i encounter a blog that’s both educative and entertaining, and let me tell you, you might have hit the nail around the head. Your concept is outstanding; the catch is an element that not enough consumers are speaking intelligently about. I am very happy i always came across this at my seek out something in regards to this. สมัครแทงบอลฟรี
Aug 25, 2023 01:39:00 AM
Many thanks for creating the effort to discuss this, I feel strongly about this and like learning a great deal more on this subject. If feasible, as you gain expertise, would you mind updating your weblog with a great deal more details? It’s very useful for me. เว็บไซต์แทงบอลอันดับ1
Aug 25, 2023 11:47:01 PM
After study many of the blog posts in your website now, and i really appreciate your way of blogging. I bookmarked it to my bookmark site list and will also be checking back soon. Pls look into my site likewise and figure out what you believe. เว็บพนันออนไลน์UFA
Aug 27, 2023 05:59:31 PM
I am extremely impressed along with your writing abilities well with the format for your blog. Is that this a paid topic or did you modify it yourself? Anyway keep up the excellent quality writing, it’s rare to see a great blog like this one nowadays. 메이저사이트
Aug 30, 2023 04:37:19 PM
Great info – Gulvafslibning | Kurt Gulvmand I’m inquisitive to find out exactly what blog platform you’re using? We are experiencing several minor safety issues with my blog plus I would wish to locate something better and secure. Do you have some solutions! Oh yeah how about Egypt wonderful media stories Regards … Flash Factory 메이저사이트
Sep 03, 2023 07:47:04 PM
Great info – Gulvafslibning | Kurt Gulvmand I’m inquisitive to find out exactly what blog platform you’re using? We are experiencing several minor safety issues with my blog plus I would wish to locate something better and secure. Do you have some solutions! Oh yeah how about Egypt wonderful media stories Regards … Flash Factory 안전놀이터
Sep 05, 2023 12:10:06 AM
Your blog site is so interesting … keep up the good work! Also, is your wordpress theme a free one? and if so..can i have it? My best wishes, Joanne. salingsilang
Sep 08, 2023 09:34:42 PM
Your blog is spectacular. A lot of the things on your own page are usually my consent concerning. we appreciate you discussing. tactical gun hawaiian shirt
Sep 08, 2023 10:39:56 PM
Hello! I just now would wish to offer a enormous thumbs up for your great information you’ve here for this post. I am coming back to your blog site for much more soon. filmyzilla 2023
Sep 14, 2023 09:10:35 PM
You really should get involved in a contest for starters of the finest blogs on the web. I will recommend this web site! สล็อต
Sep 20, 2023 12:30:08 AM
Another thing I have noticed is always that for many people, a bad credit score is the results of circumstances beyond their control. By way of example they may happen to be saddled with illness so they have excessive bills for collections. It can be due to a employment loss or inability to do the job. Sometimes divorce process can truly send the finances in the wrong direction. Thank you for sharing your notions on this site. birthday crocs
Sep 23, 2023 04:20:25 PM
I delight in, result in I found exactly what I was having a look for. You have ended my four day long hunt! God Bless you man. Have a great day. Bye roof cleaning southampton
Sep 24, 2023 01:14:32 AM
The the next time I just read a blog, I am hoping who’s doesnt disappoint me around that one. After all, It was my solution to read, but I just thought youd have some thing interesting to convey. All I hear is often a lot of whining about something that you could fix should you werent too busy seeking attention. shillong teer common number
Oct 02, 2023 10:55:29 PM
My brother recommended I might like this web site. He was entirely right. This post truly made my day. You cann’t imagine simply how much time I had spent for this info! Thanks! Kalaastar song lyrics
Oct 06, 2023 06:36:23 PM
Comfortabl y, the post is really the freshest on this deserving topic. I harmonise with your conclusions and also can thirstily look forward to your next updates. Just saying thanks will not simply just be adequate, for the extraordinary clarity in your writing. I can directly grab your rss feed to stay informed of any updates. Gratifying work and much success in your business dealings! custom shrek crocs
Oct 08, 2023 04:04:35 PM
Nice post. I learn something on different blogs everyday. It can all the time be stimulating to read content from other writers and observe somewhat something from their blog. how do I recover my funds?
Oct 12, 2023 05:08:35 PM
I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Roof Cleaning Southampton
Oct 14, 2023 12:29:43 AM
Youre so cool! I dont suppose Ive read something like this before. So good to seek out any individual with some authentic ideas on this subject. realy thank you for beginning this up. this website is one thing that is needed on the web, somebody with a little bit originality. useful job for bringing one thing new to the internet! transparent training bra
Oct 21, 2023 12:35:41 AM
I think you will in no way cease! This is probably the greatest weblogs You will find actually study. Youve got some crazy talent right here, man. I just desire that you simply don’t shed your thing because you are one with the best blog writers out there. Please keep it up because the world wide web requirements someone like you getting the news out. แทงบอลเงินสด
Oct 31, 2023 03:27:58 PM
This approach can be how it looks genuinely the most appropriate. Every one involving minute best parts are generally planned with many customs knowledge. I propose it rather a lot. 1xbet промокод
Nov 02, 2023 11:47:15 PM
That appears to be undoubtedly fantastic. These types of teeny particulars were created possessing great deal of history experience. Now i'm thinking about that a lot. 온라인카지노사이트
Nov 03, 2023 08:54:21 PM
This is exactly evenly a good material that i extremely extremely enjoyed reading viewing. It's not regularly which i maintain opportunity to run a difficulty. nhà cái Sky88
Nov 04, 2023 11:21:32 PM
It is actually all at once a great put which i quite savored surfing. Is not really routine that give the outlook to see items. https://www.special-job.com/
Nov 07, 2023 09:57:22 PM
Hello there, I discovered your website via Google whilst searching for a related topic, your web site came up, it seems good. I have bookmarked it in my google bookmarks. digitalglobaltimes.com
Nov 08, 2023 08:46:26 PM
For this reason it's best that you need to suitable analysis just before creating. You'll be able to produce far better submit as a result. Zorgverzekeringen Vergelijken
Nov 09, 2023 03:15:32 PM
That's the reason it is best that you ought to appropriate investigation prior to composing. It is possible to create much better publish by doing this. HB88
Nov 13, 2023 08:22:14 PM
It's at the same time a decent place which i extremely savored browsing. Isn't day to day that provide the prospect to observe an item. https://www.salt-shaq.com/
Nov 13, 2023 11:55:39 PM
The look favorably fantastic. Many of these small data tend to be designed making use of lots of background encounter. I'd like everything considerably. kontes123
Nov 21, 2023 04:49:53 PM
That is why advertising which you appropriate search earlier than submitting. It'll be effortless to write down excellent write-up like that. where to buy pappy van winkle
Nov 25, 2023 02:30:49 PM
That's look into you ought to special groundwork ahead of when authoring. Shall be likely that will even more alluring blog post through this industry. lingerie stores
Dec 28, 2023 01:13:39 AM
Every year, thousands of customers around the world choose MaroCar for a cheap car hire in Morocco. The platform operates in the main cities of the kingdom (Casablanca, Marrakech, Tangiers, Rabat ...) and delivers its cars to the address of your choice or directly to the main airports in the country.
Mar 30, 2024 05:16:33 PM
https://www.pallaviindustries.in/hose-testing-machine.php
Mar 30, 2024 05:18:18 PM
<a href="https://www.pallaviindustries.in/hose-testing-machine.php">Hose Testing Machine!</a>