Мой опыт сборки Linux From Scratch

lfs
Эта статья нужна для того что-бы поделиться опытом сборки Linux From Scratch. Дело в том, что совершив те или иные ошибки, я приходил к тому, что что-то сделано не правильно изначально и это дело нужно бросать, либо начинать сначала. Именно поэтому я бросал сборку LFS раза, наверное, два или три. Во время последних новогодних праздников мне удалось довести начатое дело до конца. Так что предупрежу сразу, для того, чтобы это сделать нужно иметь много времени и терпения.

Этап 1. Подготовка окружения

Этот этап может показаться самым простым, но он же и самый ответственный, поскольку если вы предпримете что-то не так, все последующие шаги могут оказаться пустой тратой времени. Начнем с компьютера: я создал виртуальную машину, использовав VirtualBox. Я думаю, вам ее возможностей хватит сполна и вы ее можете ее использовать тоже. Те кто считает себя джедаями линукса, способными прямо в консоли поднять ВМ, в системе виртуализации, у которой нет GUI, например гипервизоре Xen, могут для этих целей использовать Xen. Самый важный момент в создании ВМ — это выбор размера виртуального жесткого диска, поскольку если вы упретесь в границы размеров жесткого диска, вам придется либо бросить сборку LFS, либо создать новый диск и перенести все что вы собрали на другой раздел. Возможно, я позже сделаю заметку о том, как переносить linux на другой диск/раздел, так, чтобы он после этого продолжал загружаться, хотя, если вы сможете собрать Linux From Scratch, вы сами знаете, как это сделать. В моем случае, я использовал фиксированный жесткий диск, размером в 40Гб, поделенный поровну на два ext4 раздела, в одном из которых установлена host система, а в другом LFS.
В качестве host системы я использовал Debian netinstall без установки рабочих столов. Чтобы впоследствии из нее было удобно работать, я рекомендую настроить SSH соединение. После того, как установите sshd в автозапуске системы, прокиньте 22 порт наружу, чтобы он был доступен SSH клиенту в вашей основной ОС. В качестве SSH клиента я использовал PuTTY, поскольку это наиболее распространенный вариант среди пользователей Windows. Если ваша основная система linux, можно использовать тот-же PuTTY, либо openssh-client, доступный из командной строки. Для того, чтобы быстрее заходить в систему, стоит настроить автоматическую авторизацию при помощи закрытых ключей. После установки ОС и SSH, я запускал ВМ в headless-mode, для того, чтобы не видеть его окно, поскольку моим UI был SSH клиент. Настроенный SSH позволит вам, во-первых — не ограничиваться размерами стандартного разрешения консоли, во-вторых, при желании, копипастить код из книги. Настройка X-ов и интеграции ВМ, с моей точки зрения, менее приемлемо, поскольку такое решение сильнее нагружает систему, потребляя не лишние ресурсы, а так-же может доставить вам больше сюрпризов и меньше удобств, чем вариант с SSH клиентом.
Во время подготовки, убедитесь в том, что у вас в системе есть все, что перечислено в требованиях к host системе, того, чего нет — доустановите. Не меньшее внимание уделите настройке переменных $LFS и $LFS_TGT, поскольку эти переменные будут во многих командах, на протяжении всей пятой главы книги, а так-же папке tools с ссылкой на нее. И в конце-концов убедиться, что список пакетов, по которому вы их скачивали принадлежит той версии книги, по которой вы собираете систему. Так-же советую добавить раздел с LFS в fstab, чтобы он был монтирован уже во время загрузки системы.
Если вы сделали здесь все правильно, то последующие совершенные вами действия могут не пойти на смарку. Выше я акцентировал некоторые моменты из книги, потому что это те грабли, на которые я наступил, как можно быстрее приступив к сборке своего Linux’а.

Этап 2. Сборка chroot окружения

Суть этого этапа заключается в том, что вы не можете прямо в разделе собрать готовый linux. Если вы будете просто менять префикс при сборке на точку монтирования раздела с ОС, то во многих программах этот путь будет захардкожен и недействителен когда вы перезагрузитесь в тот раздел. На этом разделе нужно будет собрать минимально необходимый для сборки набор инструментов, статически слинкованный с библиотеками. Обратите внимание, что последующие пакеты часто зависят от предыдущих, статически линкуясь с ними, поэтому если вы проступились на этом или предыдущем этапе, вам, возможно, придется собрать все заново, чуть более подготовившись.

Этап 3. Сборка самой системы

Если у вас, вдруг, на предыдущих двух этапах все закончилось успешно, то стоит приступить к сборке самой системы. Если до этого у вас получалось все правильно, то вы получаете именно то chroot окружение, которое ожидал автор этой книги, а значит вас не должно поджидать никаких сюрпризов.
Единственное хотелось бы отметить два момента в книге:

  1. Требуемое время и 311Гб свободного места у GCC в версии книги 7.8-systemd, скорее всего, является багой. Я потратил целый день на создание раздела фиксированного диска, размером 0.5Тб, хотя на самом мне столько места не понадобилось. Поэтому советую предпринимать такие координальные меры, только тогда, когда вы упретесь в сообщение об ошибке, а не тогда, когда думаете, что упретесь.
  2. Упущенные пакеты во втором разделе, можно дособрать, только для этого потребуется воссоздать окружение на момент второго этапа, т.е. выйти из chroot и вернуть прежние переменные окружения.

В заключении

Когда вы закончите строительство системы, вы просто устанавливаете загрузчик, делаете последние настройки, готовите fstab и перезагружаетесь в свеже-построенную систему linux. Ванильной конфигурации ядра должно хватить, для того, чтобы система загрузилась без ram-диска.

204 комментария к “Мой опыт сборки Linux From Scratch

  1. Hi there! This post couldn’t be written much better! Going through this post reminds me of my previous roommate! He always kept talking about this. I’ll send this post to him. Pretty sure he’s going to have a good read. Many thanks for sharing!

  2. I must thank you for the efforts you have put in penning this blog. I really hope to check out the same high-grade content from you in the future as well. In truth, your creative writing abilities has motivated me to get my own blog now 😉

  3. After going over a number of the articles on your website, I seriously appreciate your technique of writing a blog. I book-marked it to my bookmark site list and will be checking back soon. Take a look at my website as well and let me know your opinion.

  4. I have actually dealt with blood sugar changes for many years, and it actually affected my energy levels throughout the day.
    Because starting Sugar Protector, I feel extra balanced and alert, and I do not experience those afternoon sags anymore!

    I like that it’s a natural remedy that works with no extreme adverse
    effects. It’s truly been a game-changer for me

  5. Discovering Sugar Defender has been a game-changer for
    me, as I have actually constantly been vigilant about handling my blood sugar degrees.
    With this supplement, I really feel equipped to organize my health and wellness,
    and my latest medical check-ups have shown a substantial turn-around.
    Having a credible ally in my corner gives me with
    a sense of security and reassurance, and I’m deeply glad for the
    profound distinction Sugar Defender has actually
    made in my health.

  6. Finding Sugar Defender has actually been a game-changer for me,
    as I have actually always been vigilant concerning handling my
    blood glucose levels. I currently feel encouraged and certain in my capacity to maintain healthy and balanced levels, and my latest checkup have reflected this progress.
    Having a credible supplement to enhance my a substantial source of comfort, and I’m truly happy
    for the substantial distinction Sugar Protector has actually
    made in my total wellness.

  7. For years, I’ve fought unpredictable blood glucose swings that left me really feeling drained pipes and inactive.
    Yet since including Sugar Defender right into my
    regular, I’ve observed a considerable renovation in my general
    power and security. The feared mid-day thing of the past, and
    I value that this natural treatment attains these outcomes without any unpleasant or damaging responses.
    truthfully been a transformative discovery for me.

  8. Adding Sugar Protector to my daily regimen was among
    the best choices I’ve produced my health and wellness. I’m careful about what I eat,
    but this supplement adds an added layer of support.
    I really feel a lot more consistent throughout the day, and my food cravings have actually decreased dramatically.

    It’s nice to have something so basic that makes such a huge distinction!

  9. Integrating Sugar Defender right into my daily program has been a game-changer for
    my general wellness. As somebody that currently prioritizes healthy and balanced consuming, this supplement has provided an included increase of defense.
    in my energy degrees, and my wish for harmful treats so uncomplicated can have such an extensive impact on my daily life.

  10. sugar defender reviews Discovering Sugar
    Protector has actually been a game-changer for
    me, as I have actually constantly been vigilant concerning handling my blood sugar
    levels. With this supplement, I feel equipped to organize my health and wellness, and my latest medical check-ups have actually reflected a substantial turnaround.

    Having a trustworthy ally in my corner gives me with a complacency and peace
    of mind, and I’m deeply happy for the profound difference Sugar Defender has actually made in my health.
    sugar defender official website

  11. sugar defender ingredients I’ve struggled with blood sugar changes for several years, and it really affected my power degrees throughout the day.

    Because starting Sugar Protector, I feel a lot more well balanced and alert, and I don’t experience
    those afternoon drops anymore! I enjoy that
    it’s a natural remedy that functions with no harsh negative effects.
    It’s absolutely been a game-changer for me sugar defender official website

  12. sugar defender reviews For years,
    I have actually battled uncertain blood glucose swings that left
    me really feeling drained pipes and tired. However considering that integrating Sugar
    Defender right into my routine, I have actually observed a considerable improvement in my
    total power and security. The dreaded mid-day thing of the past, and I appreciate that this natural solution achieves these results with
    no undesirable or adverse reactions. honestly been a transformative discovery for me.

    Sugar Defender Reviews

  13. sugar defender official website I’ve dealt with blood glucose variations for many
    years, and it actually affected my power degrees throughout the day.
    Considering that beginning Sugar Defender, I really feel more well balanced and alert, and I do not experience those afternoon slumps anymore!

    I like that it’s a natural remedy that works without any
    severe side effects. It’s genuinely been a game-changer for me sugar defender

  14. thanx for such a fantastic website. Where else could someone get that kind of info written in such a perfect way? I have a presentation that I am presently working on, and I have been on the look out for such information.

  15. This could be the proper blog for anybody who wants to check out this topic. You know a lot its practically not easy to argue to you (not that When i would want…HaHa). You certainly put a new spin on a topic thats been discussed for some time. Fantastic stuff, just wonderful!

  16. Along with almost everything which seems to be developing within this particular subject material, all your perspectives are somewhat exciting. Even so, I beg your pardon, but I do not subscribe to your entire strategy, all be it radical none the less. It seems to me that your commentary are actually not completely rationalized and in reality you are generally your self not even wholly convinced of the point. In any event I did appreciate reading through it.

  17. It’s the best time to make a few plans for the longer term and it is time to be happy. I’ve read this post and if I could I want to suggest you some interesting issues or suggestions. Perhaps you could write subsequent articles relating to this article. I desire to read even more issues about it!

  18. It’s a shame you don’t have a donate button! I’d most certainly donate to this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this blog with my Facebook group. Chat soon!

  19. This constantly amazes me exactly how blog owners for example yourself can find the time and also the commitment to keep on composing fantastic blog posts. Your site isexcellent and one of my own ought to read blogs. I simply want to thank you.

  20. This is a good subject to talk about. Generally when I come across these sort of things I like to post them on Digg. This article probably wont do well with that crowd. Ill take a look around your site though and submit something else.

  21. We extremely appreciate your website post. There are dozens of techniques we could put it to proper use with a minimum of effort with time and capital. Thank you so much for helping make the post give light to many queries we have got before now.

  22. I’m impressed, I must say. Actually rarely should i encounter a weblog that’s both educative and entertaining, and without a doubt, you may have hit the nail to the head. Your concept is outstanding; the catch is something that not enough people are speaking intelligently about. I am happy i always came across this around my seek out something relating to this.

  23. Wonderful paintings! That is the type of info that are supposed to be shared across the net. Shame on search engines for not positioning this submit higher! Come on over and consult with my website . Thanks =)

  24. There are some fascinating closing dates on this article however I don know if I see all of them heart to heart. There’s some validity however I will take maintain opinion till I look into it further. Good article , thanks and we would like more! Added to FeedBurner as properly

  25. Just what’s Occurring we’m a new comer to this, I ran across this I’ve found It completely beneficial and possesses helped me away loads. I am hoping to be able to lead & help some other users such as it’s aided me. Great career.

  26. After study some of the blog posts in your internet site now, i genuinely appreciate your means of blogging. I bookmarked it to my bookmark site list and you will be checking back soon. Pls have a look at my web page at the same time and inform me what you consider.

  27. I wanted to send you the very small note to thank you yet again with your striking things you have discussed in this case. It’s remarkably generous with people like you to provide publicly exactly what a few individuals might have sold for an electronic book to generate some cash for their own end, most importantly since you might well have tried it if you ever desired. The ideas also acted to become fantastic way to understand that many people have the same zeal the same as mine to understand good deal more around this issue. I’m sure there are millions of more fun times ahead for folks who browse through your website.

  28. However, the detailed description that he provides appears to be a fanciful train, partly inspired by the Kalacakra Tantra, and can’t with confidence be attached to any identified historic site.

  29. The game ends when the player’s present character dies with out an heir of the identical dynasty to succeed him/her, when all landed titles of the count rank or above are stripped from all members of the player’s dynasty (together with themselves), or when the sport reaches its end in 1453 (except the player is in «observer mode», at which point the game will proceed onwards).

  30. Within the capital city Kumasi, artisans of Asante and different ethnic groups converged and received royal patronage, according to «Adinkra and Kente Cloth in History, Legislation, and Life,» by Boatema Boateng, Ph.D., revealed within the journal Textile Society of America Symposium Proceedings.

  31. This sort of account provides you much more reductions in addition to services like a statement of the previous orders — which helps you tremendous tune your plan to save lots of on office provides bills — customized pricing, credit phrases, product critiques and additional information that may provide help to save on stationery prices.

  32. Contributors carried out sure actions (comparable to breaking a toothpick) however not others, then imagined doing other actions in the general set, and eventually had been given a list of previous actions encountered in the primary two elements of the examine and brand new actions.

  33. Made with air-impregnated foam to keep the weight at only one-and-a-half times that of wooden furniture, Edison’s line of concrete furnishings would be sanded and smoothed into a mirror-like finish or stained to look like wood grain.

  34. CVC fund managers usually will examine a broad array of investment opportunities that are related to some degree to the activities of their parent company in the hopes that the technologies developed will complement the product line of the parent company or even lead the parent company into an area of the industry in which it previously had not been occupied.

  35. Generally the Defendant or the Surety pays 10 of the total whole bail complete the bondsman, and the Defendant or the Surety will need to have adequate monetary property they might pay out the rest of the connection if the bail will probably be revoked or if the Defendant is not going to meet the problems of his bail.

  36. With a Bsc. Degree in Physics followed by a Masters in Finance and Control, Professor T. Viswanathan has developed a keen interest in the areas of corporate finance, financial derivatives, international finance and security analysis and portfolio management.

  37. Uzbekistan’s Prime Minister Shavkat Mirziyoyev became the country’s second president after profitable 88.61 vote in the primary presidential election since the death of the authoritarian leader and President Islam Karimov.

  38. I pondered on how the senseless nerds sitting in some dungeon within the bowels (probably even the colon) of London within the «Ministry of Health, Safety And Stopping Little Boys Doing Anything Within the Least Bit Pleasurable» would react to this case.

  39. It found that the output impact of a rise in government consumption is bigger in industrial than in developing nations, the fiscal multiplier is comparatively large in economies operating underneath a predetermined alternate rate but zero in economies operating beneath flexible exchange rates; fiscal multipliers in open economies are lower than in closed economies and fiscal multipliers in high-debt international locations are additionally zero.

  40. The band has launched 5 studio albums (SMPT:e, Bridge Throughout Ceaselessly, The Whirlwind, Kaleidoscope and Absolutely the Universe) plus live albums from the tours behind each studio disc: Dwell in America, Live in Europe, Whirld Tour 2010: Stay in London, More Never Is Sufficient and KaLIVEoscope.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

*